2014-09-12 22:35:07 +02:00
tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties2.ts(4,8): error TS1005: ';' expected.
tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties2.ts(4,9): error TS1131: Property or signature expected.
tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties2.ts(8,8): error TS1005: ';' expected.
tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties2.ts(8,9): error TS1131: Property or signature expected.
2014-12-01 09:31:31 +01:00
tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties2.ts(12,8): error TS1144: '{' or ';' expected.
2014-09-12 22:35:07 +02:00
tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties2.ts(12,9): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties2.ts(16,8): error TS1005: ';' expected.
tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties2.ts(16,9): error TS1131: Property or signature expected.
2014-12-01 09:31:31 +01:00
tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties2.ts(20,8): error TS1144: '{' or ';' expected.
2014-09-12 22:35:07 +02:00
tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties2.ts(20,9): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties2.ts(25,8): error TS1005: '{' expected.
tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties2.ts(25,9): error TS1136: Property assignment expected.
tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties2.ts(26,1): error TS1005: ':' expected.
tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties2.ts(12,5): error TS2391: Function implementation is missing or not immediately following the declaration.
tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties2.ts(20,5): error TS2391: Function implementation is missing or not immediately following the declaration.
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
~
2014-09-12 00:19:57 +02:00
!!! error TS1005: ';' expected.
2014-07-13 01:04:16 +02:00
~
2014-09-12 00:19:57 +02:00
!!! error TS1131: Property or signature expected.
2014-07-13 01:04:16 +02:00
}
interface I {
x()?: number; // error
~
2014-09-12 00:19:57 +02:00
!!! error TS1005: ';' expected.
2014-07-13 01:04:16 +02:00
~
2014-09-12 00:19:57 +02:00
!!! error TS1131: Property or signature expected.
2014-07-13 01:04:16 +02:00
}
class C {
x()?: number; // error
~
2014-12-01 09:31:31 +01:00
!!! error TS1144: '{' or ';' expected.
2014-07-13 01:04:16 +02:00
~
2014-09-12 00:19:57 +02:00
!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
2014-07-31 01:27:13 +02:00
~
2014-09-12 00:19:57 +02:00
!!! error TS2391: Function implementation is missing or not immediately following the declaration.
2014-07-13 01:04:16 +02:00
}
interface I2<T> {
x()?: T; // error
~
2014-09-12 00:19:57 +02:00
!!! error TS1005: ';' expected.
2014-07-13 01:04:16 +02:00
~
2014-09-12 00:19:57 +02:00
!!! error TS1131: Property or signature expected.
2014-07-13 01:04:16 +02:00
}
class C2<T> {
x()?: T; // error
~
2014-12-01 09:31:31 +01:00
!!! error TS1144: '{' or ';' expected.
2014-07-13 01:04:16 +02:00
~
2014-09-12 00:19:57 +02:00
!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
2014-07-31 01:27:13 +02:00
~
2014-09-12 00:19:57 +02:00
!!! error TS2391: Function implementation is missing or not immediately following the declaration.
2014-07-13 01:04:16 +02:00
}
var b = {
x()?: 1 // error
~
2014-09-12 00:19:57 +02:00
!!! error TS1005: '{' expected.
2014-07-13 01:04:16 +02:00
~
2014-09-12 00:19:57 +02:00
!!! error TS1136: Property assignment expected.
2014-07-13 01:04:16 +02:00
}
~
2014-09-12 00:19:57 +02:00
!!! error TS1005: ':' expected.