TypeScript/tests/baselines/reference/objectTypesWithOptionalProperties2.errors.txt
2014-07-31 11:06:42 -07:00

57 lines
1.3 KiB
Plaintext

==== tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties2.ts (15 errors) ====
// Illegal attempts to define optional methods
var a: {
x()?: number; // error
~
!!! ';' expected.
~
!!! Property or signature expected.
}
interface I {
x()?: number; // error
~
!!! ';' expected.
~
!!! Property or signature expected.
}
class C {
x()?: number; // error
~
!!! Block or ';' expected.
~
!!! Unexpected token. A constructor, method, accessor, or property was expected.
~
!!! Function implementation is missing or not immediately following the declaration.
}
interface I2<T> {
x()?: T; // error
~
!!! ';' expected.
~
!!! Property or signature expected.
}
class C2<T> {
x()?: T; // error
~
!!! Block or ';' expected.
~
!!! Unexpected token. A constructor, method, accessor, or property was expected.
~
!!! Function implementation is missing or not immediately following the declaration.
}
var b = {
x()?: 1 // error
~
!!! '{' expected.
~
!!! Property assignment expected.
}
~
!!! ':' expected.