Skip to content

Commit

Permalink
Accepting new baselines
Browse files Browse the repository at this point in the history
  • Loading branch information
ahejlsberg committed Nov 23, 2015
1 parent 6a14450 commit c5dd297
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(
Type 'number | string[][] | string' is not assignable to type 'number | string[][]'.
Type 'string' is not assignable to type 'number | string[][]'.
Type 'string' is not assignable to type 'string[][]'.
Property 'push' is missing in type 'String'.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(16,8): error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(16,16): error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(23,14): error TS2345: Argument of type '{ x: string; y: boolean; }' is not assignable to parameter of type '{ x: number; y: any; }'.
Expand Down Expand Up @@ -77,6 +78,7 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(
!!! error TS2345: Type 'number | string[][] | string' is not assignable to type 'number | string[][]'.
!!! error TS2345: Type 'string' is not assignable to type 'number | string[][]'.
!!! error TS2345: Type 'string' is not assignable to type 'string[][]'.
!!! error TS2345: Property 'push' is missing in type 'String'.


// If the declaration includes an initializer expression (which is permitted only
Expand Down
25 changes: 25 additions & 0 deletions tests/baselines/reference/errorElaboration.errors.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
tests/cases/compiler/errorElaboration.ts(12,5): error TS2345: Argument of type '() => Container<Ref<string>>' is not assignable to parameter of type '() => Container<Ref<number>>'.
Type 'Container<Ref<string>>' is not assignable to type 'Container<Ref<number>>'.
Type 'Ref<string>' is not assignable to type 'Ref<number>'.
Type 'string' is not assignable to type 'number'.


==== tests/cases/compiler/errorElaboration.ts (1 errors) ====
// Repro for #5712

interface Ref<T> {
prop: T;
}
interface Container<T> {
m1: Container<Ref<T>>;
m2: T;
}
declare function foo(x: () => Container<Ref<number>>): void;
let a: () => Container<Ref<string>>;
foo(a);
~
!!! error TS2345: Argument of type '() => Container<Ref<string>>' is not assignable to parameter of type '() => Container<Ref<number>>'.
!!! error TS2345: Type 'Container<Ref<string>>' is not assignable to type 'Container<Ref<number>>'.
!!! error TS2345: Type 'Ref<string>' is not assignable to type 'Ref<number>'.
!!! error TS2345: Type 'string' is not assignable to type 'number'.

19 changes: 19 additions & 0 deletions tests/baselines/reference/errorElaboration.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//// [errorElaboration.ts]
// Repro for #5712

interface Ref<T> {
prop: T;
}
interface Container<T> {
m1: Container<Ref<T>>;
m2: T;
}
declare function foo(x: () => Container<Ref<number>>): void;
let a: () => Container<Ref<string>>;
foo(a);


//// [errorElaboration.js]
// Repro for #5712
var a;
foo(a);
8 changes: 6 additions & 2 deletions tests/baselines/reference/promisePermutations3.errors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ tests/cases/compiler/promisePermutations3.ts(159,21): error TS2345: Argument of
Type 'number' is not assignable to type 'string'.
tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of type '{ <T>(x: T): IPromise<T>; <T>(x: T, y: T): Promise<T>; }' is not assignable to parameter of type '(value: (x: any) => any) => Promise<any>'.
Type 'IPromise<any>' is not assignable to type 'Promise<any>'.
Property 'done' is optional in type 'IPromise<any>' but required in type 'Promise<any>'.
Types of property 'then' are incompatible.
Type '<U>(success?: (value: any) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise<U>' is not assignable to type '{ <U>(success?: (value: any) => Promise<U>, error?: (error: any) => Promise<U>, progress?: (progress: any) => void): Promise<U>; <U>(success?: (value: any) => Promise<U>, error?: (error: any) => U, progress?: (progress: any) => void): Promise<U>; <U>(success?: (value: any) => U, error?: (error: any) => Promise<U>, progress?: (progress: any) => void): Promise<U>; <U>(success?: (value: any) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise<U>; }'.
Type 'IPromise<any>' is not assignable to type 'Promise<any>'.


==== tests/cases/compiler/promisePermutations3.ts (35 errors) ====
Expand Down Expand Up @@ -368,5 +370,7 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of
~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '{ <T>(x: T): IPromise<T>; <T>(x: T, y: T): Promise<T>; }' is not assignable to parameter of type '(value: (x: any) => any) => Promise<any>'.
!!! error TS2345: Type 'IPromise<any>' is not assignable to type 'Promise<any>'.
!!! error TS2345: Property 'done' is optional in type 'IPromise<any>' but required in type 'Promise<any>'.
!!! error TS2345: Types of property 'then' are incompatible.
!!! error TS2345: Type '<U>(success?: (value: any) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise<U>' is not assignable to type '{ <U>(success?: (value: any) => Promise<U>, error?: (error: any) => Promise<U>, progress?: (progress: any) => void): Promise<U>; <U>(success?: (value: any) => Promise<U>, error?: (error: any) => U, progress?: (progress: any) => void): Promise<U>; <U>(success?: (value: any) => U, error?: (error: any) => Promise<U>, progress?: (progress: any) => void): Promise<U>; <U>(success?: (value: any) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise<U>; }'.
!!! error TS2345: Type 'IPromise<any>' is not assignable to type 'Promise<any>'.
var s12c = s12.then(testFunction12P, testFunction12, testFunction12); // ok

0 comments on commit c5dd297

Please sign in to comment.