mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 03:23:08 -06:00
Accepting new baselines
This commit is contained in:
parent
15dcccde7d
commit
d6eb486c3a
@ -1,5 +1,6 @@
|
||||
tests/cases/compiler/arrayCast.ts(3,1): error TS2352: Neither type '{ foo: string; }[]' nor type '{ id: number; }[]' is assignable to the other.
|
||||
Type '{ foo: string; }' is not assignable to type '{ id: number; }'.
|
||||
Property 'id' is missing in type '{ foo: string; }'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/arrayCast.ts (1 errors) ====
|
||||
@ -9,6 +10,7 @@ tests/cases/compiler/arrayCast.ts(3,1): error TS2352: Neither type '{ foo: strin
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2352: Neither type '{ foo: string; }[]' nor type '{ id: number; }[]' is assignable to the other.
|
||||
!!! error TS2352: Type '{ foo: string; }' is not assignable to type '{ id: number; }'.
|
||||
!!! error TS2352: Property 'id' is missing in type '{ foo: string; }'.
|
||||
|
||||
// Should succeed, as the {} element causes the type of the array to be {}[]
|
||||
<{ id: number; }[]>[{ foo: "s" }, {}];
|
||||
@ -2,10 +2,10 @@ tests/cases/compiler/assignmentCompatBug2.ts(1,5): error TS2322: Type '{ a: numb
|
||||
Property 'b' is missing in type '{ a: number; }'.
|
||||
tests/cases/compiler/assignmentCompatBug2.ts(3,1): error TS2322: Type '{ a: number; }' is not assignable to type '{ b: number; }'.
|
||||
Property 'b' is missing in type '{ a: number; }'.
|
||||
tests/cases/compiler/assignmentCompatBug2.ts(15,1): error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; n?: number; k?(a: any): any; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'.
|
||||
Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; n?: number; k?(a: any): any; }'.
|
||||
tests/cases/compiler/assignmentCompatBug2.ts(20,1): error TS2322: Type '{ f: (n: number) => number; m: number; n?: number; k?(a: any): any; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'.
|
||||
Property 'g' is missing in type '{ f: (n: number) => number; m: number; n?: number; k?(a: any): any; }'.
|
||||
tests/cases/compiler/assignmentCompatBug2.ts(15,1): error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'.
|
||||
Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; }'.
|
||||
tests/cases/compiler/assignmentCompatBug2.ts(20,1): error TS2322: Type '{ f: (n: number) => number; m: number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'.
|
||||
Property 'g' is missing in type '{ f: (n: number) => number; m: number; }'.
|
||||
tests/cases/compiler/assignmentCompatBug2.ts(33,1): error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'.
|
||||
Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }'.
|
||||
|
||||
@ -33,16 +33,16 @@ tests/cases/compiler/assignmentCompatBug2.ts(33,1): error TS2322: Type '{ f: (n:
|
||||
|
||||
b3 = {
|
||||
~~
|
||||
!!! error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; n?: number; k?(a: any): any; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'.
|
||||
!!! error TS2322: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; n?: number; k?(a: any): any; }'.
|
||||
!!! error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'.
|
||||
!!! error TS2322: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; }'.
|
||||
f: (n) => { return 0; },
|
||||
g: (s) => { return 0; },
|
||||
}; // error
|
||||
|
||||
b3 = {
|
||||
~~
|
||||
!!! error TS2322: Type '{ f: (n: number) => number; m: number; n?: number; k?(a: any): any; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'.
|
||||
!!! error TS2322: Property 'g' is missing in type '{ f: (n: number) => number; m: number; n?: number; k?(a: any): any; }'.
|
||||
!!! error TS2322: Type '{ f: (n: number) => number; m: number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'.
|
||||
!!! error TS2322: Property 'g' is missing in type '{ f: (n: number) => number; m: number; }'.
|
||||
f: (n) => { return 0; },
|
||||
m: 0,
|
||||
}; // error
|
||||
|
||||
@ -51,13 +51,13 @@ var b: { foo: string; baz?: string }
|
||||
var a2: S2 = { foo: '' };
|
||||
>a2 : S2
|
||||
>S2 : S2
|
||||
>{ foo: '' } : { foo: string; bar?: string; }
|
||||
>{ foo: '' } : { foo: string; }
|
||||
>foo : string
|
||||
|
||||
var b2: T2 = { foo: '' };
|
||||
>b2 : T2
|
||||
>T2 : T2
|
||||
>{ foo: '' } : { foo: string; baz?: string; }
|
||||
>{ foo: '' } : { foo: string; }
|
||||
>foo : string
|
||||
|
||||
s = t;
|
||||
|
||||
@ -12,7 +12,7 @@ module __test1__ {
|
||||
>U : U
|
||||
>obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>interfaceWithPublicAndOptional : interfaceWithPublicAndOptional<T, U>
|
||||
>{ one: 1 } : { one: number; two?: string; }
|
||||
>{ one: 1 } : { one: number; }
|
||||
>one : number
|
||||
|
||||
export var __val__obj4 = obj4;
|
||||
|
||||
@ -12,7 +12,7 @@ module __test1__ {
|
||||
>U : U
|
||||
>obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>interfaceWithPublicAndOptional : interfaceWithPublicAndOptional<T, U>
|
||||
>{ one: 1 } : { one: number; two?: string; }
|
||||
>{ one: 1 } : { one: number; }
|
||||
>one : number
|
||||
|
||||
export var __val__obj4 = obj4;
|
||||
|
||||
@ -12,7 +12,7 @@ module __test1__ {
|
||||
>U : U
|
||||
>obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>interfaceWithPublicAndOptional : interfaceWithPublicAndOptional<T, U>
|
||||
>{ one: 1 } : { one: number; two?: string; }
|
||||
>{ one: 1 } : { one: number; }
|
||||
>one : number
|
||||
|
||||
export var __val__obj4 = obj4;
|
||||
|
||||
@ -12,7 +12,7 @@ module __test1__ {
|
||||
>U : U
|
||||
>obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>interfaceWithPublicAndOptional : interfaceWithPublicAndOptional<T, U>
|
||||
>{ one: 1 } : { one: number; two?: string; }
|
||||
>{ one: 1 } : { one: number; }
|
||||
>one : number
|
||||
|
||||
export var __val__obj4 = obj4;
|
||||
|
||||
@ -12,7 +12,7 @@ module __test1__ {
|
||||
>U : U
|
||||
>obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>interfaceWithPublicAndOptional : interfaceWithPublicAndOptional<T, U>
|
||||
>{ one: 1 } : { one: number; two?: string; }
|
||||
>{ one: 1 } : { one: number; }
|
||||
>one : number
|
||||
|
||||
export var __val__obj4 = obj4;
|
||||
|
||||
@ -12,7 +12,7 @@ module __test1__ {
|
||||
>U : U
|
||||
>obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>interfaceWithPublicAndOptional : interfaceWithPublicAndOptional<T, U>
|
||||
>{ one: 1 } : { one: number; two?: string; }
|
||||
>{ one: 1 } : { one: number; }
|
||||
>one : number
|
||||
|
||||
export var __val__obj4 = obj4;
|
||||
@ -29,7 +29,7 @@ module __test2__ {
|
||||
>T : T
|
||||
>obj3 : interfaceWithOptional<number>
|
||||
>interfaceWithOptional : interfaceWithOptional<T>
|
||||
>{ } : { one?: number; }
|
||||
>{ } : {}
|
||||
|
||||
export var __val__obj3 = obj3;
|
||||
>__val__obj3 : interfaceWithOptional<number>
|
||||
|
||||
@ -12,7 +12,7 @@ module __test1__ {
|
||||
>U : U
|
||||
>obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>interfaceWithPublicAndOptional : interfaceWithPublicAndOptional<T, U>
|
||||
>{ one: 1 } : { one: number; two?: string; }
|
||||
>{ one: 1 } : { one: number; }
|
||||
>one : number
|
||||
|
||||
export var __val__obj4 = obj4;
|
||||
@ -32,7 +32,7 @@ module __test2__ {
|
||||
>U : U
|
||||
>obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>interfaceWithPublicAndOptional : interfaceWithPublicAndOptional<T, U>
|
||||
>{ one: 1 } : { one: number; two?: string; }
|
||||
>{ one: 1 } : { one: number; }
|
||||
>one : number
|
||||
|
||||
export var __val__obj4 = obj4;
|
||||
|
||||
@ -12,7 +12,7 @@ module __test1__ {
|
||||
>U : U
|
||||
>obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>interfaceWithPublicAndOptional : interfaceWithPublicAndOptional<T, U>
|
||||
>{ one: 1 } : { one: number; two?: string; }
|
||||
>{ one: 1 } : { one: number; }
|
||||
>one : number
|
||||
|
||||
export var __val__obj4 = obj4;
|
||||
|
||||
@ -12,7 +12,7 @@ module __test1__ {
|
||||
>U : U
|
||||
>obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>interfaceWithPublicAndOptional : interfaceWithPublicAndOptional<T, U>
|
||||
>{ one: 1 } : { one: number; two?: string; }
|
||||
>{ one: 1 } : { one: number; }
|
||||
>one : number
|
||||
|
||||
export var __val__obj4 = obj4;
|
||||
|
||||
@ -14,8 +14,8 @@ Object.defineProperty({}, "0", <PropertyDescriptor>({
|
||||
>{} : {}
|
||||
><PropertyDescriptor>({ get: getFunc, set: setFunc, configurable: true }) : PropertyDescriptor
|
||||
>PropertyDescriptor : PropertyDescriptor
|
||||
>({ get: getFunc, set: setFunc, configurable: true }) : { get: () => any; set: (v: any) => void; configurable: boolean; enumerable?: boolean; value?: any; writable?: boolean; }
|
||||
>{ get: getFunc, set: setFunc, configurable: true } : { get: () => any; set: (v: any) => void; configurable: boolean; enumerable?: boolean; value?: any; writable?: boolean; }
|
||||
>({ get: getFunc, set: setFunc, configurable: true }) : { get: () => any; set: (v: any) => void; configurable: boolean; }
|
||||
>{ get: getFunc, set: setFunc, configurable: true } : { get: () => any; set: (v: any) => void; configurable: boolean; }
|
||||
|
||||
get: getFunc,
|
||||
>get : () => any
|
||||
|
||||
@ -1,20 +0,0 @@
|
||||
tests/cases/compiler/indexer2.ts(6,25): error TS2352: 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/indexer2.ts (1 errors) ====
|
||||
interface IHeapObjectProperty {}
|
||||
interface IDirectChildrenMap {
|
||||
hasOwnProperty(objectId: number) : boolean;
|
||||
[objectId: number] : IHeapObjectProperty[];
|
||||
}
|
||||
var directChildrenMap = <IDirectChildrenMap>{};
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2352: Neither type '{ [x: number]: undefined; }' nor type 'IDirectChildrenMap' is assignable to the other.
|
||||
!!! error TS2352: Types of property 'hasOwnProperty' are incompatible.
|
||||
!!! error TS2352: Type '(v: string) => boolean' is not assignable to type '(objectId: number) => boolean'.
|
||||
!!! error TS2352: Types of parameters 'v' and 'objectId' are incompatible.
|
||||
!!! error TS2352: Type 'string' is not assignable to type 'number'.
|
||||
21
tests/baselines/reference/indexer2.types
Normal file
21
tests/baselines/reference/indexer2.types
Normal file
@ -0,0 +1,21 @@
|
||||
=== tests/cases/compiler/indexer2.ts ===
|
||||
interface IHeapObjectProperty {}
|
||||
>IHeapObjectProperty : IHeapObjectProperty
|
||||
|
||||
interface IDirectChildrenMap {
|
||||
>IDirectChildrenMap : IDirectChildrenMap
|
||||
|
||||
hasOwnProperty(objectId: number) : boolean;
|
||||
>hasOwnProperty : (objectId: number) => boolean
|
||||
>objectId : number
|
||||
|
||||
[objectId: number] : IHeapObjectProperty[];
|
||||
>objectId : number
|
||||
>IHeapObjectProperty : IHeapObjectProperty
|
||||
}
|
||||
var directChildrenMap = <IDirectChildrenMap>{};
|
||||
>directChildrenMap : IDirectChildrenMap
|
||||
><IDirectChildrenMap>{} : IDirectChildrenMap
|
||||
>IDirectChildrenMap : IDirectChildrenMap
|
||||
>{} : { [x: number]: undefined; }
|
||||
|
||||
@ -1,12 +1,7 @@
|
||||
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 TS2352: 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) ====
|
||||
==== tests/cases/compiler/indexer2A.ts (1 errors) ====
|
||||
class IHeapObjectProperty { }
|
||||
class IDirectChildrenMap {
|
||||
// Decided to enforce a semicolon after declarations
|
||||
@ -15,10 +10,4 @@ tests/cases/compiler/indexer2A.ts(7,25): error TS2352: Neither type '{ [x: numbe
|
||||
!!! error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
[objectId: number]: IHeapObjectProperty[]
|
||||
}
|
||||
var directChildrenMap = <IDirectChildrenMap>{};
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2352: Neither type '{ [x: number]: undefined; }' nor type 'IDirectChildrenMap' is assignable to the other.
|
||||
!!! error TS2352: Types of property 'hasOwnProperty' are incompatible.
|
||||
!!! error TS2352: Type '(v: string) => boolean' is not assignable to type '(objectId: number) => boolean'.
|
||||
!!! error TS2352: Types of parameters 'v' and 'objectId' are incompatible.
|
||||
!!! error TS2352: Type 'string' is not assignable to type 'number'.
|
||||
var directChildrenMap = <IDirectChildrenMap>{};
|
||||
@ -39,8 +39,8 @@ tests/cases/compiler/intTypeCheck.ts(146,5): error TS2322: Type 'boolean' is not
|
||||
tests/cases/compiler/intTypeCheck.ts(146,21): error TS1109: Expression expected.
|
||||
tests/cases/compiler/intTypeCheck.ts(146,22): error TS2304: Cannot find name 'i4'.
|
||||
tests/cases/compiler/intTypeCheck.ts(147,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
|
||||
tests/cases/compiler/intTypeCheck.ts(152,5): error TS2322: Type '{ p1?: any; p2?: string; p4?(): any; p5?(): void; p7?(pa1: any, pa2: any): void; }' is not assignable to type 'i5'.
|
||||
Property 'p' is missing in type '{ p1?: any; p2?: string; p4?(): any; p5?(): void; p7?(pa1: any, pa2: any): void; }'.
|
||||
tests/cases/compiler/intTypeCheck.ts(152,5): error TS2322: Type '{}' is not assignable to type 'i5'.
|
||||
Property 'p' is missing in type '{}'.
|
||||
tests/cases/compiler/intTypeCheck.ts(153,5): error TS2322: Type 'Object' is not assignable to type 'i5'.
|
||||
Property 'p' is missing in type 'Object'.
|
||||
tests/cases/compiler/intTypeCheck.ts(154,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
|
||||
@ -313,8 +313,8 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit
|
||||
var obj44: i5;
|
||||
var obj45: i5 = {};
|
||||
~~~~~
|
||||
!!! error TS2322: Type '{ p1?: any; p2?: string; p4?(): any; p5?(): void; p7?(pa1: any, pa2: any): void; }' is not assignable to type 'i5'.
|
||||
!!! error TS2322: Property 'p' is missing in type '{ p1?: any; p2?: string; p4?(): any; p5?(): void; p7?(pa1: any, pa2: any): void; }'.
|
||||
!!! error TS2322: Type '{}' is not assignable to type 'i5'.
|
||||
!!! error TS2322: Property 'p' is missing in type '{}'.
|
||||
var obj46: i5 = new Object();
|
||||
~~~~~
|
||||
!!! error TS2322: Type 'Object' is not assignable to type 'i5'.
|
||||
|
||||
@ -34,27 +34,27 @@ class Bug {
|
||||
>{} : { [x: string]: undefined; }
|
||||
|
||||
this.values['comments'] = { italic: true };
|
||||
>this.values['comments'] = { italic: true } : { italic: boolean; bold?: boolean; }
|
||||
>this.values['comments'] = { italic: true } : { italic: boolean; }
|
||||
>this.values['comments'] : IOptions
|
||||
>this.values : IMap
|
||||
>this : Bug
|
||||
>values : IMap
|
||||
>{ italic: true } : { italic: boolean; bold?: boolean; }
|
||||
>{ italic: true } : { italic: boolean; }
|
||||
>italic : boolean
|
||||
}
|
||||
shouldBeOK() {
|
||||
>shouldBeOK : () => void
|
||||
|
||||
this.values = {
|
||||
>this.values = { comments: { italic: true } } : { [x: string]: { italic: boolean; bold?: boolean; }; comments: { italic: boolean; bold?: boolean; }; }
|
||||
>this.values = { comments: { italic: true } } : { [x: string]: { italic: boolean; }; comments: { italic: boolean; }; }
|
||||
>this.values : IMap
|
||||
>this : Bug
|
||||
>values : IMap
|
||||
>{ comments: { italic: true } } : { [x: string]: { italic: boolean; bold?: boolean; }; comments: { italic: boolean; bold?: boolean; }; }
|
||||
>{ comments: { italic: true } } : { [x: string]: { italic: boolean; }; comments: { italic: boolean; }; }
|
||||
|
||||
comments: { italic: true }
|
||||
>comments : { italic: boolean; bold?: boolean; }
|
||||
>{ italic: true } : { italic: boolean; bold?: boolean; }
|
||||
>comments : { italic: boolean; }
|
||||
>{ italic: true } : { italic: boolean; }
|
||||
>italic : boolean
|
||||
|
||||
};
|
||||
|
||||
@ -11,8 +11,8 @@
|
||||
>obj : {}
|
||||
><PropertyDescriptor>({ get: function () { eval("public = 1;"); return 11; }, set: function (v) { } }) : PropertyDescriptor
|
||||
>PropertyDescriptor : PropertyDescriptor
|
||||
>({ get: function () { eval("public = 1;"); return 11; }, set: function (v) { } }) : { get: () => number; set: (v: any) => void; configurable?: boolean; enumerable?: boolean; value?: any; writable?: boolean; }
|
||||
>{ get: function () { eval("public = 1;"); return 11; }, set: function (v) { } } : { get: () => number; set: (v: any) => void; configurable?: boolean; enumerable?: boolean; value?: any; writable?: boolean; }
|
||||
>({ get: function () { eval("public = 1;"); return 11; }, set: function (v) { } }) : { get: () => number; set: (v: any) => void; }
|
||||
>{ get: function () { eval("public = 1;"); return 11; }, set: function (v) { } } : { get: () => number; set: (v: any) => void; }
|
||||
|
||||
get: function () {
|
||||
>get : () => number
|
||||
|
||||
@ -24,7 +24,7 @@ var x = foo({ name: "Sprocket" });
|
||||
>x : string
|
||||
>foo({ name: "Sprocket" }) : string
|
||||
>foo : { (item: Item): string; (item: any): number; }
|
||||
>{ name: "Sprocket" } : { name: string; description?: string; }
|
||||
>{ name: "Sprocket" } : { name: string; }
|
||||
>name : string
|
||||
|
||||
var x: string;
|
||||
@ -74,7 +74,7 @@ var b = bar({});
|
||||
>b : {}
|
||||
>bar({}) : {}
|
||||
>bar : <T>(param: { x?: T; }) => T
|
||||
>{} : { x?: {}; }
|
||||
>{} : {}
|
||||
|
||||
var b: {};
|
||||
>b : {}
|
||||
|
||||
@ -21,7 +21,7 @@ defineMyProperty({}, "name", { get: function () { return 5; } });
|
||||
>defineMyProperty({}, "name", { get: function () { return 5; } }) : any
|
||||
>defineMyProperty : (o: any, p: string, attributes: MyPropertyDescriptor) => any
|
||||
>{} : {}
|
||||
>{ get: function () { return 5; } } : { get: () => number; set?(v: any): void; }
|
||||
>{ get: function () { return 5; } } : { get: () => number; }
|
||||
>get : () => number
|
||||
>function () { return 5; } : () => number
|
||||
|
||||
@ -47,7 +47,7 @@ defineMyProperty2({}, "name", { get: function () { return 5; } });
|
||||
>defineMyProperty2({}, "name", { get: function () { return 5; } }) : any
|
||||
>defineMyProperty2 : (o: any, p: string, attributes: MyPropertyDescriptor2) => any
|
||||
>{} : {}
|
||||
>{ get: function () { return 5; } } : { get: () => number; set?: (v: any) => void; }
|
||||
>{ get: function () { return 5; } } : { get: () => number; }
|
||||
>get : () => number
|
||||
>function () { return 5; } : () => number
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
tests/cases/compiler/optionalPropertiesTest.ts(14,1): error TS2322: Type '{ name: string; print?(): void; }' is not assignable to type 'IFoo'.
|
||||
Property 'id' is missing in type '{ name: string; print?(): void; }'.
|
||||
tests/cases/compiler/optionalPropertiesTest.ts(14,1): error TS2322: Type '{ name: string; }' is not assignable to type 'IFoo'.
|
||||
Property 'id' is missing in type '{ name: string; }'.
|
||||
tests/cases/compiler/optionalPropertiesTest.ts(25,5): error TS2322: Type '{}' is not assignable to type 'i1'.
|
||||
Property 'M' is missing in type '{}'.
|
||||
tests/cases/compiler/optionalPropertiesTest.ts(26,5): error TS2322: Type '{}' is not assignable to type 'i3'.
|
||||
@ -24,8 +24,8 @@ tests/cases/compiler/optionalPropertiesTest.ts(40,1): error TS2322: Type 'i2' is
|
||||
foo = { id: 1234, name: "test" }; // Ok
|
||||
foo = { name: "test" }; // Error, id missing
|
||||
~~~
|
||||
!!! error TS2322: Type '{ name: string; print?(): void; }' is not assignable to type 'IFoo'.
|
||||
!!! error TS2322: Property 'id' is missing in type '{ name: string; print?(): void; }'.
|
||||
!!! error TS2322: Type '{ name: string; }' is not assignable to type 'IFoo'.
|
||||
!!! error TS2322: Property 'id' is missing in type '{ name: string; }'.
|
||||
foo = {id: 1234, print:()=>{}} // Ok
|
||||
|
||||
var s = foo.name || "default";
|
||||
|
||||
@ -105,17 +105,17 @@ var a1 = a.a({});
|
||||
>a.a : { (o: Opt1): Opt1; (o: Opt2): Opt2; (o: Opt3): Opt3; (o: Opt4): Opt4; }
|
||||
>a : A
|
||||
>a : { (o: Opt1): Opt1; (o: Opt2): Opt2; (o: Opt3): Opt3; (o: Opt4): Opt4; }
|
||||
>{} : { r?: any; }
|
||||
>{} : {}
|
||||
|
||||
var a1 = a({});
|
||||
>a1 : Opt3
|
||||
>a({}) : Opt3
|
||||
>a : A
|
||||
>{} : { r?: any; }
|
||||
>{} : {}
|
||||
|
||||
var a1 = new a({});
|
||||
>a1 : Opt3
|
||||
>new a({}) : Opt3
|
||||
>a : A
|
||||
>{} : { r?: any; }
|
||||
>{} : {}
|
||||
|
||||
|
||||
@ -108,17 +108,17 @@ var a1 = a.a({});
|
||||
>a.a : { (o: Opt1): Opt1; (o: Opt2): Opt2; (o: Opt3): Opt3; (o: Opt4): Opt4; }
|
||||
>a : A
|
||||
>a : { (o: Opt1): Opt1; (o: Opt2): Opt2; (o: Opt3): Opt3; (o: Opt4): Opt4; }
|
||||
>{} : { r?: any; }
|
||||
>{} : {}
|
||||
|
||||
var a1 = a({});
|
||||
>a1 : Opt3
|
||||
>a({}) : Opt3
|
||||
>a : A
|
||||
>{} : { r?: any; }
|
||||
>{} : {}
|
||||
|
||||
var a1 = new a({});
|
||||
>a1 : Opt3
|
||||
>new a({}) : Opt3
|
||||
>a : A
|
||||
>{} : { r?: any; }
|
||||
>{} : {}
|
||||
|
||||
|
||||
@ -23,16 +23,16 @@ interface IMenuItem {
|
||||
var menuData: IMenuItem[] = [
|
||||
>menuData : IMenuItem[]
|
||||
>IMenuItem : IMenuItem
|
||||
>[ { "id": "ourLogo", "type": "image", "link": "", "icon": "modules/menu/logo.svg" }, { "id": "productName", "type": "default", "link": "", "text": "Product Name" }] : ({ "id": string; "type": string; "link": string; "icon": string; classes?: string; text?: string; } | { "id": string; "type": string; "link": string; "text": string; classes?: string; icon?: string; })[]
|
||||
>[ { "id": "ourLogo", "type": "image", "link": "", "icon": "modules/menu/logo.svg" }, { "id": "productName", "type": "default", "link": "", "text": "Product Name" }] : ({ "id": string; "type": string; "link": string; "icon": string; } | { "id": string; "type": string; "link": string; "text": string; })[]
|
||||
{
|
||||
>{ "id": "ourLogo", "type": "image", "link": "", "icon": "modules/menu/logo.svg" } : { "id": string; "type": string; "link": string; "icon": string; classes?: string; text?: string; }
|
||||
>{ "id": "ourLogo", "type": "image", "link": "", "icon": "modules/menu/logo.svg" } : { "id": string; "type": string; "link": string; "icon": string; }
|
||||
|
||||
"id": "ourLogo",
|
||||
"type": "image",
|
||||
"link": "",
|
||||
"icon": "modules/menu/logo.svg"
|
||||
}, {
|
||||
>{ "id": "productName", "type": "default", "link": "", "text": "Product Name" } : { "id": string; "type": string; "link": string; "text": string; classes?: string; icon?: string; }
|
||||
>{ "id": "productName", "type": "default", "link": "", "text": "Product Name" } : { "id": string; "type": string; "link": string; "text": string; }
|
||||
|
||||
"id": "productName",
|
||||
"type": "default",
|
||||
|
||||
@ -1317,11 +1317,11 @@ compiled2({ epithet: "stooge" });
|
||||
>epithet : string
|
||||
|
||||
_.templateSettings = {
|
||||
>_.templateSettings = { interpolate: /\{\{(.+?)\}\}/g} : { interpolate: RegExp; evaluate?: RegExp; escape?: RegExp; }
|
||||
>_.templateSettings = { interpolate: /\{\{(.+?)\}\}/g} : { interpolate: RegExp; }
|
||||
>_.templateSettings : Underscore.TemplateSettings
|
||||
>_ : Underscore.Static
|
||||
>templateSettings : Underscore.TemplateSettings
|
||||
>{ interpolate: /\{\{(.+?)\}\}/g} : { interpolate: RegExp; evaluate?: RegExp; escape?: RegExp; }
|
||||
>{ interpolate: /\{\{(.+?)\}\}/g} : { interpolate: RegExp; }
|
||||
|
||||
interpolate: /\{\{(.+?)\}\}/g
|
||||
>interpolate : RegExp
|
||||
@ -1347,7 +1347,7 @@ _.template("Using 'with': <%= data.answer %>", { answer: 'no' }, { variable: 'da
|
||||
>template : { (templateString: string): (data: any) => string; (templateString: string, data: any, settings?: Underscore.TemplateSettings): string; }
|
||||
>{ answer: 'no' } : { answer: string; }
|
||||
>answer : string
|
||||
>{ variable: 'data' } : { variable: string; evaluate?: RegExp; interpolate?: RegExp; escape?: RegExp; }
|
||||
>{ variable: 'data' } : { variable: string; }
|
||||
>variable : string
|
||||
|
||||
=== tests/cases/compiler/underscoreTest1_underscore.ts ===
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user