Skip to content

Commit

Permalink
Accept baselines for now
Browse files Browse the repository at this point in the history
  • Loading branch information
weswigham committed Aug 7, 2018
1 parent 87613bc commit c881d97
Show file tree
Hide file tree
Showing 13 changed files with 744 additions and 96 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES5.ts(6,5): error TS2322: Type '{ [x: number]: string | number; }' is not assignable to type 'I'.
Index signatures are incompatible.
Type 'string | number' is not assignable to type 'boolean'.
Type 'string' is not assignable to type 'boolean'.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES5.ts(7,5): error TS2418: Type of computed property's value is 'string', which is not assignable to type 'boolean'.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES5.ts(8,5): error TS2418: Type of computed property's value is 'number', which is not assignable to type 'boolean'.


==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES5.ts (1 errors) ====
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES5.ts (2 errors) ====
interface I {
[s: string]: boolean;
[s: number]: boolean;
}

var o: I = {
~
!!! error TS2322: Type '{ [x: number]: string | number; }' is not assignable to type 'I'.
!!! error TS2322: Index signatures are incompatible.
!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'.
!!! error TS2322: Type 'string' is not assignable to type 'boolean'.
[+"foo"]: "",
~~~~~~~~
!!! error TS2418: Type of computed property's value is 'string', which is not assignable to type 'boolean'.
!!! related TS6501 tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES5.ts:2:5: The expected type comes from this index signature.
[+"bar"]: 0
~~~~~~~~
!!! error TS2418: Type of computed property's value is 'number', which is not assignable to type 'boolean'.
!!! related TS6501 tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES5.ts:2:5: The expected type comes from this index signature.
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES6.ts(6,5): error TS2322: Type '{ [x: number]: string | number; }' is not assignable to type 'I'.
Index signatures are incompatible.
Type 'string | number' is not assignable to type 'boolean'.
Type 'string' is not assignable to type 'boolean'.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES6.ts(7,5): error TS2418: Type of computed property's value is 'string', which is not assignable to type 'boolean'.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES6.ts(8,5): error TS2418: Type of computed property's value is 'number', which is not assignable to type 'boolean'.


==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES6.ts (1 errors) ====
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES6.ts (2 errors) ====
interface I {
[s: string]: boolean;
[s: number]: boolean;
}

var o: I = {
~
!!! error TS2322: Type '{ [x: number]: string | number; }' is not assignable to type 'I'.
!!! error TS2322: Index signatures are incompatible.
!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'.
!!! error TS2322: Type 'string' is not assignable to type 'boolean'.
[+"foo"]: "",
~~~~~~~~
!!! error TS2418: Type of computed property's value is 'string', which is not assignable to type 'boolean'.
!!! related TS6501 tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES6.ts:2:5: The expected type comes from this index signature.
[+"bar"]: 0
~~~~~~~~
!!! error TS2418: Type of computed property's value is 'number', which is not assignable to type 'boolean'.
!!! related TS6501 tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES6.ts:2:5: The expected type comes from this index signature.
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
tests/cases/conformance/types/conditional/conditionalTypesExcessProperties.ts(8,5): error TS2322: Type '{ test: string; arg: A; }' is not assignable to type 'Something<A>'.
Type '{ test: string; arg: A; }' is not assignable to type 'A extends object ? { arg: A; } : { arg?: undefined; }'.
tests/cases/conformance/types/conditional/conditionalTypesExcessProperties.ts(9,33): error TS2322: Type 'A' is not assignable to type 'Something<A>["arr"]'.
Type 'object' is not assignable to type 'Something<A>["arr"]'.
tests/cases/conformance/types/conditional/conditionalTypesExcessProperties.ts(9,33): error TS2322: Type '{ test: string; arg: A; arr: A; }' is not assignable to type 'Something<A>'.
Object literal may only specify known properties, and 'arr' does not exist in type 'Something<A>'.


==== tests/cases/conformance/types/conditional/conditionalTypesExcessProperties.ts (2 errors) ====
Expand All @@ -17,8 +17,8 @@ tests/cases/conformance/types/conditional/conditionalTypesExcessProperties.ts(9,
!!! error TS2322: Type '{ test: string; arg: A; }' is not assignable to type 'Something<A>'.
!!! error TS2322: Type '{ test: string; arg: A; }' is not assignable to type 'A extends object ? { arg: A; } : { arg?: undefined; }'.
sa = { test: 'bye', arg: a, arr: a } // excess
~~~
!!! error TS2322: Type 'A' is not assignable to type 'Something<A>["arr"]'.
!!! error TS2322: Type 'object' is not assignable to type 'Something<A>["arr"]'.
~~~~~~
!!! error TS2322: Type '{ test: string; arg: A; arr: A; }' is not assignable to type 'Something<A>'.
!!! error TS2322: Object literal may only specify known properties, and 'arr' does not exist in type 'Something<A>'.
}

31 changes: 0 additions & 31 deletions tests/baselines/reference/deferredLookupTypeResolution2.errors.txt

This file was deleted.

37 changes: 37 additions & 0 deletions tests/baselines/reference/indexedAccessRelation.errors.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
tests/cases/compiler/indexedAccessRelation.ts(16,23): error TS2345: Argument of type '{ a: T; }' is not assignable to parameter of type 'Pick<S & State<T>, "a">'.
Types of property 'a' are incompatible.
Type 'T' is not assignable to type 'S["a"] & T'.
Type 'Foo' is not assignable to type 'S["a"] & T'.
Type 'Foo' is not assignable to type 'S["a"]'.
Type 'T' is not assignable to type 'S["a"]'.
Type 'Foo' is not assignable to type 'S["a"]'.


==== tests/cases/compiler/indexedAccessRelation.ts (1 errors) ====
// Repro from #14723

class Component<S> {
setState<K extends keyof S>(state: Pick<S, K>) {}
}

export interface State<T> {
a?: T;
}

class Foo {}

class Comp<T extends Foo, S> extends Component<S & State<T>>
{
foo(a: T) {
this.setState({ a: a });
~~~~~~~~
!!! error TS2345: Argument of type '{ a: T; }' is not assignable to parameter of type 'Pick<S & State<T>, "a">'.
!!! error TS2345: Types of property 'a' are incompatible.
!!! error TS2345: Type 'T' is not assignable to type 'S["a"] & T'.
!!! error TS2345: Type 'Foo' is not assignable to type 'S["a"] & T'.
!!! error TS2345: Type 'Foo' is not assignable to type 'S["a"]'.
!!! error TS2345: Type 'T' is not assignable to type 'S["a"]'.
!!! error TS2345: Type 'Foo' is not assignable to type 'S["a"]'.
}
}

2 changes: 1 addition & 1 deletion tests/baselines/reference/indexedAccessRelation.types
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Comp<T extends Foo, S> extends Component<S & State<T>>
>a : T

this.setState({ a: a });
>this.setState({ a: a }) : void
>this.setState({ a: a }) : any
>this.setState : <K extends keyof S | "a">(state: Pick<S & State<T>, K>) => void
>this : this
>setState : <K extends keyof S | "a">(state: Pick<S & State<T>, K>) => void
Expand Down
4 changes: 2 additions & 2 deletions tests/baselines/reference/indexingTypesWithNever.types
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ declare function genericFn3<

// Should be never
const result5 = genericFn3({ g: "gtest", h: "htest" }, "g", "h"); // 'g' & 'h' will reduce to never
>result5 : any
>genericFn3({ g: "gtest", h: "htest" }, "g", "h") : any
>result5 : unknown
>genericFn3({ g: "gtest", h: "htest" }, "g", "h") : unknown
>genericFn3 : <T extends { [K in keyof T]: T[K]; }, U extends keyof T, V extends keyof T>(obj: T, u: U, v: V) => T[U & V]
>{ g: "gtest", h: "htest" } : { g: string; h: string; }
>g : string
Expand Down
Loading

0 comments on commit c881d97

Please sign in to comment.