summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/error_003_typescript.ts42
-rw-r--r--cli/tests/error_003_typescript.ts.out42
2 files changed, 33 insertions, 51 deletions
diff --git a/cli/tests/error_003_typescript.ts b/cli/tests/error_003_typescript.ts
index 6fb077ea0..4ce86bb83 100644
--- a/cli/tests/error_003_typescript.ts
+++ b/cli/tests/error_003_typescript.ts
@@ -1,26 +1,20 @@
/* eslint-disable */
-interface Value<T> {
- f?: (r: T) => any;
- v?: string;
-}
-
-interface C<T> {
- values?: (r: T) => Array<Value<T>>;
-}
-
-class A<T> {
- constructor(private e?: T, public s?: C<T>) {}
-}
-
-class B {
- t = "foo";
-}
-
-var a = new A(new B(), {
- values: o => [
- {
- v: o.t,
- f: x => "bar"
+let x = {
+ a: {
+ b: {
+ c() {
+ return { d: "hello" };
+ }
}
- ]
-});
+ }
+};
+let y = {
+ a: {
+ b: {
+ c() {
+ return { d: 1234 };
+ }
+ }
+ }
+};
+x = y;
diff --git a/cli/tests/error_003_typescript.ts.out b/cli/tests/error_003_typescript.ts.out
index f00a935e4..0b1d94db4 100644
--- a/cli/tests/error_003_typescript.ts.out
+++ b/cli/tests/error_003_typescript.ts.out
@@ -1,28 +1,16 @@
-[WILDCARD]error TS2322: Type '(o: T) => { v: any; f: (x: B) => string; }[]' is not assignable to type '(r: B) => Value<B>[]'.
- Types of parameters 'o' and 'r' are incompatible.
- Type 'B' is not assignable to type 'T'.
- 'B' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
-
-[WILDCARD]tests/error_003_typescript.ts:20:3
-
-20 values: o => [
- ~~~~~~
-
- The expected type comes from property 'values' which is declared here on type 'C<B>'
-
- [WILDCARD]tests/error_003_typescript.ts:8:3
-
- 8 values?: (r: T) => Array<Value<T>>;
- ~~~~~~
-
-
-error TS2339: Property 't' does not exist on type 'T'.
-
-[WILDCARD]tests/error_003_typescript.ts:22:12
-
-22 v: o.t,
- ^
-
-
-Found 2 errors.
+[WILDCARD]error TS2322: Type '{ a: { b: { c(): { d: number; }; }; }; }' is not assignable to type '{ a: { b: { c(): { d: string; }; }; }; }'.
+ Types of property 'a' are incompatible.
+ Type '{ b: { c(): { d: number; }; }; }' is not assignable to type '{ b: { c(): { d: string; }; }; }'.
+ Types of property 'b' are incompatible.
+ Type '{ c(): { d: number; }; }' is not assignable to type '{ c(): { d: string; }; }'.
+ Types of property 'c' are incompatible.
+ Type '() => { d: number; }' is not assignable to type '() => { d: string; }'.
+ Type '{ d: number; }' is not assignable to type '{ d: string; }'.
+ Types of property 'd' are incompatible.
+ Type 'number' is not assignable to type 'string'.
+
+[WILDCARD]/tests/error_003_typescript.ts:20:1
+
+20 x = y;
+ ^