TypeScript/tests/baselines/reference/objectTypesWithOptionalProperties2.errors.txt
2014-07-12 17:30:19 -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 expected.
}
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 expected.
}
var b = {
x()?: 1 // error
~
!!! '{' expected.
~
!!! Property assignment expected.
}
~
!!! ':' expected.