TypeScript/tests/baselines/reference/indexer2A.errors.txt
2014-10-13 06:56:58 -07:00

24 lines
No EOL
1.5 KiB
Text

tests/cases/compiler/indexer2A.ts(4,5): error TS2391: Function implementation is missing or not immediately following the declaration.
tests/cases/compiler/indexer2A.ts(7,25): error TS2353: Neither type '{ [x: number]: undefined; }' nor type 'IDirectChildrenMap' is assignable to the other:
Types of property 'hasOwnProperty' are incompatible:
Type '(v: string) => boolean' is not assignable to type '(objectId: number) => boolean':
Types of parameters 'v' and 'objectId' are incompatible:
Type 'string' is not assignable to type 'number'.
==== tests/cases/compiler/indexer2A.ts (2 errors) ====
class IHeapObjectProperty { }
class IDirectChildrenMap {
// Decided to enforce a semicolon after declarations
hasOwnProperty(objectId: number): boolean
~~~~~~~~~~~~~~
!!! error TS2391: Function implementation is missing or not immediately following the declaration.
[objectId: number]: IHeapObjectProperty[]
}
var directChildrenMap = <IDirectChildrenMap>{};
~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2353: Neither type '{ [x: number]: undefined; }' nor type 'IDirectChildrenMap' is assignable to the other:
!!! error TS2353: Types of property 'hasOwnProperty' are incompatible:
!!! error TS2353: Type '(v: string) => boolean' is not assignable to type '(objectId: number) => boolean':
!!! error TS2353: Types of parameters 'v' and 'objectId' are incompatible:
!!! error TS2353: Type 'string' is not assignable to type 'number'.