TypeScript/tests/baselines/reference/objectTypesWithOptionalProperties2.errors.txt

57 lines
1.3 KiB
Plaintext
Raw Normal View History

2014-07-13 01:04:16 +02:00
==== 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.
2014-07-31 01:27:13 +02:00
~
!!! Function implementation is missing or not immediately following the declaration.
2014-07-13 01:04:16 +02:00
}
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.
2014-07-31 01:27:13 +02:00
~
!!! Function implementation is missing or not immediately following the declaration.
2014-07-13 01:04:16 +02:00
}
var b = {
x()?: 1 // error
~
!!! '{' expected.
~
!!! Property assignment expected.
}
~
!!! ':' expected.