mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Accepted baselines.
This commit is contained in:
@@ -1,33 +1,33 @@
|
||||
=== tests/cases/compiler/callSignatureFunctionOverload.ts ===
|
||||
var foo: {
|
||||
>foo : { (name: string): string; (name: 'order'): string; (name: 'content'): string; (name: 'done'): string; }
|
||||
>foo : { (name: string): string; (name: "order"): string; (name: "content"): string; (name: "done"): string; }
|
||||
|
||||
(name: string): string;
|
||||
>name : string
|
||||
|
||||
(name: 'order'): string;
|
||||
>name : 'order'
|
||||
>name : "order"
|
||||
|
||||
(name: 'content'): string;
|
||||
>name : 'content'
|
||||
>name : "content"
|
||||
|
||||
(name: 'done'): string;
|
||||
>name : 'done'
|
||||
>name : "done"
|
||||
}
|
||||
|
||||
var foo2: {
|
||||
>foo2 : { (name: string): string; (name: 'order'): string; (name: 'order'): string; (name: 'done'): string; }
|
||||
>foo2 : { (name: string): string; (name: "order"): string; (name: "order"): string; (name: "done"): string; }
|
||||
|
||||
(name: string): string;
|
||||
>name : string
|
||||
|
||||
(name: 'order'): string;
|
||||
>name : 'order'
|
||||
>name : "order"
|
||||
|
||||
(name: 'order'): string;
|
||||
>name : 'order'
|
||||
>name : "order"
|
||||
|
||||
(name: 'done'): string;
|
||||
>name : 'done'
|
||||
>name : "done"
|
||||
}
|
||||
|
||||
|
||||
@@ -19,27 +19,27 @@ class Derived3 extends Base { biz() { } }
|
||||
>biz : () => void
|
||||
|
||||
function foo(tagName: 'canvas'): Derived1;
|
||||
>foo : { (tagName: 'canvas'): Derived1; (tagName: 'div'): Derived2; (tagName: 'span'): Derived3; (tagName: string): Base; }
|
||||
>tagName : 'canvas'
|
||||
>foo : { (tagName: "canvas"): Derived1; (tagName: "div"): Derived2; (tagName: "span"): Derived3; (tagName: string): Base; }
|
||||
>tagName : "canvas"
|
||||
>Derived1 : Derived1
|
||||
|
||||
function foo(tagName: 'div'): Derived2;
|
||||
>foo : { (tagName: 'canvas'): Derived1; (tagName: 'div'): Derived2; (tagName: 'span'): Derived3; (tagName: string): Base; }
|
||||
>tagName : 'div'
|
||||
>foo : { (tagName: "canvas"): Derived1; (tagName: "div"): Derived2; (tagName: "span"): Derived3; (tagName: string): Base; }
|
||||
>tagName : "div"
|
||||
>Derived2 : Derived2
|
||||
|
||||
function foo(tagName: 'span'): Derived3;
|
||||
>foo : { (tagName: 'canvas'): Derived1; (tagName: 'div'): Derived2; (tagName: 'span'): Derived3; (tagName: string): Base; }
|
||||
>tagName : 'span'
|
||||
>foo : { (tagName: "canvas"): Derived1; (tagName: "div"): Derived2; (tagName: "span"): Derived3; (tagName: string): Base; }
|
||||
>tagName : "span"
|
||||
>Derived3 : Derived3
|
||||
|
||||
function foo(tagName: string): Base;
|
||||
>foo : { (tagName: 'canvas'): Derived1; (tagName: 'div'): Derived2; (tagName: 'span'): Derived3; (tagName: string): Base; }
|
||||
>foo : { (tagName: "canvas"): Derived1; (tagName: "div"): Derived2; (tagName: "span"): Derived3; (tagName: string): Base; }
|
||||
>tagName : string
|
||||
>Base : Base
|
||||
|
||||
function foo(tagName: any): Base {
|
||||
>foo : { (tagName: 'canvas'): Derived1; (tagName: 'div'): Derived2; (tagName: 'span'): Derived3; (tagName: string): Base; }
|
||||
>foo : { (tagName: "canvas"): Derived1; (tagName: "div"): Derived2; (tagName: "span"): Derived3; (tagName: string): Base; }
|
||||
>tagName : any
|
||||
>Base : Base
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ interface B extends A {
|
||||
>A : A
|
||||
|
||||
(key:'foo'):string;
|
||||
>key : 'foo'
|
||||
>key : "foo"
|
||||
}
|
||||
|
||||
var b:B;
|
||||
@@ -32,7 +32,7 @@ interface A {
|
||||
>A : A
|
||||
|
||||
(x: 'A1'): string;
|
||||
>x : 'A1'
|
||||
>x : "A1"
|
||||
|
||||
(x: string): void;
|
||||
>x : string
|
||||
@@ -43,21 +43,21 @@ interface B extends A {
|
||||
>A : A
|
||||
|
||||
(x: 'B1'): number;
|
||||
>x : 'B1'
|
||||
>x : "B1"
|
||||
}
|
||||
|
||||
interface A {
|
||||
>A : A
|
||||
|
||||
(x: 'A2'): boolean;
|
||||
>x : 'A2'
|
||||
>x : "A2"
|
||||
}
|
||||
|
||||
interface B {
|
||||
>B : B
|
||||
|
||||
(x: 'B2'): string[];
|
||||
>x : 'B2'
|
||||
>x : "B2"
|
||||
}
|
||||
|
||||
interface C1 extends B {
|
||||
@@ -65,7 +65,7 @@ interface C1 extends B {
|
||||
>B : B
|
||||
|
||||
(x: 'C1'): number[];
|
||||
>x : 'C1'
|
||||
>x : "C1"
|
||||
}
|
||||
|
||||
interface C2 extends B {
|
||||
@@ -73,7 +73,7 @@ interface C2 extends B {
|
||||
>B : B
|
||||
|
||||
(x: 'C2'): boolean[];
|
||||
>x : 'C2'
|
||||
>x : "C2"
|
||||
}
|
||||
|
||||
interface C extends C1, C2 {
|
||||
@@ -82,7 +82,7 @@ interface C extends C1, C2 {
|
||||
>C2 : C2
|
||||
|
||||
(x: 'C'): string;
|
||||
>x : 'C'
|
||||
>x : "C"
|
||||
}
|
||||
|
||||
var c: C;
|
||||
|
||||
@@ -3,13 +3,13 @@ interface Foo {
|
||||
>Foo : Foo
|
||||
|
||||
(x: 'a'): number;
|
||||
>x : 'a'
|
||||
>x : "a"
|
||||
|
||||
(x: string): any;
|
||||
>x : string
|
||||
|
||||
new (x: 'a'): any;
|
||||
>x : 'a'
|
||||
>x : "a"
|
||||
|
||||
new (x: string): Object;
|
||||
>x : string
|
||||
|
||||
@@ -17,20 +17,20 @@ class C {
|
||||
>y : any
|
||||
|
||||
public bar(x: 'hi');
|
||||
>bar : { (x: 'hi'): any; (x: string): any; (x: number, y: string): any; }
|
||||
>x : 'hi'
|
||||
>bar : { (x: "hi"): any; (x: string): any; (x: number, y: string): any; }
|
||||
>x : "hi"
|
||||
|
||||
public bar(x: string);
|
||||
>bar : { (x: 'hi'): any; (x: string): any; (x: number, y: string): any; }
|
||||
>bar : { (x: "hi"): any; (x: string): any; (x: number, y: string): any; }
|
||||
>x : string
|
||||
|
||||
public bar(x: number, y: string);
|
||||
>bar : { (x: 'hi'): any; (x: string): any; (x: number, y: string): any; }
|
||||
>bar : { (x: "hi"): any; (x: string): any; (x: number, y: string): any; }
|
||||
>x : number
|
||||
>y : string
|
||||
|
||||
public bar(x: any, y?: any) { }
|
||||
>bar : { (x: 'hi'): any; (x: string): any; (x: number, y: string): any; }
|
||||
>bar : { (x: "hi"): any; (x: string): any; (x: number, y: string): any; }
|
||||
>x : any
|
||||
>y : any
|
||||
|
||||
@@ -49,20 +49,20 @@ class C {
|
||||
>y : any
|
||||
|
||||
public static bar(x: 'hi');
|
||||
>bar : { (x: 'hi'): any; (x: string): any; (x: number, y: string): any; }
|
||||
>x : 'hi'
|
||||
>bar : { (x: "hi"): any; (x: string): any; (x: number, y: string): any; }
|
||||
>x : "hi"
|
||||
|
||||
public static bar(x: string);
|
||||
>bar : { (x: 'hi'): any; (x: string): any; (x: number, y: string): any; }
|
||||
>bar : { (x: "hi"): any; (x: string): any; (x: number, y: string): any; }
|
||||
>x : string
|
||||
|
||||
public static bar(x: number, y: string);
|
||||
>bar : { (x: 'hi'): any; (x: string): any; (x: number, y: string): any; }
|
||||
>bar : { (x: "hi"): any; (x: string): any; (x: number, y: string): any; }
|
||||
>x : number
|
||||
>y : string
|
||||
|
||||
public static bar(x: any, y?: any) { }
|
||||
>bar : { (x: 'hi'): any; (x: string): any; (x: number, y: string): any; }
|
||||
>bar : { (x: "hi"): any; (x: string): any; (x: number, y: string): any; }
|
||||
>x : any
|
||||
>y : any
|
||||
}
|
||||
@@ -88,22 +88,22 @@ class D<T> {
|
||||
>y : any
|
||||
|
||||
public bar(x: 'hi');
|
||||
>bar : { (x: 'hi'): any; (x: string): any; (x: T, y: T): any; }
|
||||
>x : 'hi'
|
||||
>bar : { (x: "hi"): any; (x: string): any; (x: T, y: T): any; }
|
||||
>x : "hi"
|
||||
|
||||
public bar(x: string);
|
||||
>bar : { (x: 'hi'): any; (x: string): any; (x: T, y: T): any; }
|
||||
>bar : { (x: "hi"): any; (x: string): any; (x: T, y: T): any; }
|
||||
>x : string
|
||||
|
||||
public bar(x: T, y: T);
|
||||
>bar : { (x: 'hi'): any; (x: string): any; (x: T, y: T): any; }
|
||||
>bar : { (x: "hi"): any; (x: string): any; (x: T, y: T): any; }
|
||||
>x : T
|
||||
>T : T
|
||||
>y : T
|
||||
>T : T
|
||||
|
||||
public bar(x: any, y?: any) { }
|
||||
>bar : { (x: 'hi'): any; (x: string): any; (x: T, y: T): any; }
|
||||
>bar : { (x: "hi"): any; (x: string): any; (x: T, y: T): any; }
|
||||
>x : any
|
||||
>y : any
|
||||
|
||||
@@ -122,20 +122,20 @@ class D<T> {
|
||||
>y : any
|
||||
|
||||
public static bar(x: 'hi');
|
||||
>bar : { (x: 'hi'): any; (x: string): any; (x: number, y: string): any; }
|
||||
>x : 'hi'
|
||||
>bar : { (x: "hi"): any; (x: string): any; (x: number, y: string): any; }
|
||||
>x : "hi"
|
||||
|
||||
public static bar(x: string);
|
||||
>bar : { (x: 'hi'): any; (x: string): any; (x: number, y: string): any; }
|
||||
>bar : { (x: "hi"): any; (x: string): any; (x: number, y: string): any; }
|
||||
>x : string
|
||||
|
||||
public static bar(x: number, y: string);
|
||||
>bar : { (x: 'hi'): any; (x: string): any; (x: number, y: string): any; }
|
||||
>bar : { (x: "hi"): any; (x: string): any; (x: number, y: string): any; }
|
||||
>x : number
|
||||
>y : string
|
||||
|
||||
public static bar(x: any, y?: any) { }
|
||||
>bar : { (x: 'hi'): any; (x: string): any; (x: number, y: string): any; }
|
||||
>bar : { (x: "hi"): any; (x: string): any; (x: number, y: string): any; }
|
||||
>x : any
|
||||
>y : any
|
||||
|
||||
|
||||
@@ -22,23 +22,23 @@ interface MyDoc { // Document
|
||||
>MyDoc : MyDoc
|
||||
|
||||
createElement(tagName: string): Base;
|
||||
>createElement : { (tagName: string): Base; (tagName: 'canvas'): Derived1; (tagName: 'div'): Derived2; (tagName: 'span'): Derived3; }
|
||||
>createElement : { (tagName: string): Base; (tagName: "canvas"): Derived1; (tagName: "div"): Derived2; (tagName: "span"): Derived3; }
|
||||
>tagName : string
|
||||
>Base : Base
|
||||
|
||||
createElement(tagName: 'canvas'): Derived1;
|
||||
>createElement : { (tagName: string): Base; (tagName: 'canvas'): Derived1; (tagName: 'div'): Derived2; (tagName: 'span'): Derived3; }
|
||||
>tagName : 'canvas'
|
||||
>createElement : { (tagName: string): Base; (tagName: "canvas"): Derived1; (tagName: "div"): Derived2; (tagName: "span"): Derived3; }
|
||||
>tagName : "canvas"
|
||||
>Derived1 : Derived1
|
||||
|
||||
createElement(tagName: 'div'): Derived2;
|
||||
>createElement : { (tagName: string): Base; (tagName: 'canvas'): Derived1; (tagName: 'div'): Derived2; (tagName: 'span'): Derived3; }
|
||||
>tagName : 'div'
|
||||
>createElement : { (tagName: string): Base; (tagName: "canvas"): Derived1; (tagName: "div"): Derived2; (tagName: "span"): Derived3; }
|
||||
>tagName : "div"
|
||||
>Derived2 : Derived2
|
||||
|
||||
createElement(tagName: 'span'): Derived3;
|
||||
>createElement : { (tagName: string): Base; (tagName: 'canvas'): Derived1; (tagName: 'div'): Derived2; (tagName: 'span'): Derived3; }
|
||||
>tagName : 'span'
|
||||
>createElement : { (tagName: string): Base; (tagName: "canvas"): Derived1; (tagName: "div"): Derived2; (tagName: "span"): Derived3; }
|
||||
>tagName : "span"
|
||||
>Derived3 : Derived3
|
||||
|
||||
// + 100 more
|
||||
@@ -49,27 +49,27 @@ class D implements MyDoc {
|
||||
>MyDoc : MyDoc
|
||||
|
||||
createElement(tagName:string): Base;
|
||||
>createElement : { (tagName: string): Base; (tagName: 'canvas'): Derived1; (tagName: 'div'): Derived2; (tagName: 'span'): Derived3; }
|
||||
>createElement : { (tagName: string): Base; (tagName: "canvas"): Derived1; (tagName: "div"): Derived2; (tagName: "span"): Derived3; }
|
||||
>tagName : string
|
||||
>Base : Base
|
||||
|
||||
createElement(tagName: 'canvas'): Derived1;
|
||||
>createElement : { (tagName: string): Base; (tagName: 'canvas'): Derived1; (tagName: 'div'): Derived2; (tagName: 'span'): Derived3; }
|
||||
>tagName : 'canvas'
|
||||
>createElement : { (tagName: string): Base; (tagName: "canvas"): Derived1; (tagName: "div"): Derived2; (tagName: "span"): Derived3; }
|
||||
>tagName : "canvas"
|
||||
>Derived1 : Derived1
|
||||
|
||||
createElement(tagName: 'div'): Derived2;
|
||||
>createElement : { (tagName: string): Base; (tagName: 'canvas'): Derived1; (tagName: 'div'): Derived2; (tagName: 'span'): Derived3; }
|
||||
>tagName : 'div'
|
||||
>createElement : { (tagName: string): Base; (tagName: "canvas"): Derived1; (tagName: "div"): Derived2; (tagName: "span"): Derived3; }
|
||||
>tagName : "div"
|
||||
>Derived2 : Derived2
|
||||
|
||||
createElement(tagName: 'span'): Derived3;
|
||||
>createElement : { (tagName: string): Base; (tagName: 'canvas'): Derived1; (tagName: 'div'): Derived2; (tagName: 'span'): Derived3; }
|
||||
>tagName : 'span'
|
||||
>createElement : { (tagName: string): Base; (tagName: "canvas"): Derived1; (tagName: "div"): Derived2; (tagName: "span"): Derived3; }
|
||||
>tagName : "span"
|
||||
>Derived3 : Derived3
|
||||
|
||||
createElement(tagName:any): Base {
|
||||
>createElement : { (tagName: string): Base; (tagName: 'canvas'): Derived1; (tagName: 'div'): Derived2; (tagName: 'span'): Derived3; }
|
||||
>createElement : { (tagName: string): Base; (tagName: "canvas"): Derived1; (tagName: "div"): Derived2; (tagName: "span"): Derived3; }
|
||||
>tagName : any
|
||||
>Base : Base
|
||||
|
||||
|
||||
@@ -14,22 +14,22 @@ class C extends A {
|
||||
>foo : () => void
|
||||
}
|
||||
function foo(name: 'hi'): B;
|
||||
>foo : { (name: 'hi'): B; (name: 'bye'): C; (name: string): A; }
|
||||
>name : 'hi'
|
||||
>foo : { (name: "hi"): B; (name: "bye"): C; (name: string): A; }
|
||||
>name : "hi"
|
||||
>B : B
|
||||
|
||||
function foo(name: 'bye'): C;
|
||||
>foo : { (name: 'hi'): B; (name: 'bye'): C; (name: string): A; }
|
||||
>name : 'bye'
|
||||
>foo : { (name: "hi"): B; (name: "bye"): C; (name: string): A; }
|
||||
>name : "bye"
|
||||
>C : C
|
||||
|
||||
function foo(name: string): A;
|
||||
>foo : { (name: 'hi'): B; (name: 'bye'): C; (name: string): A; }
|
||||
>foo : { (name: "hi"): B; (name: "bye"): C; (name: string): A; }
|
||||
>name : string
|
||||
>A : A
|
||||
|
||||
function foo(name: any): A {
|
||||
>foo : { (name: 'hi'): B; (name: 'bye'): C; (name: string): A; }
|
||||
>foo : { (name: "hi"): B; (name: "bye"): C; (name: string): A; }
|
||||
>name : any
|
||||
>A : A
|
||||
|
||||
|
||||
@@ -16,22 +16,22 @@ class C extends A {
|
||||
>foo : () => void
|
||||
}
|
||||
function foo(name: 'hi'): B;
|
||||
>foo : { (name: 'hi'): B; (name: 'bye'): C; (name: string): A; }
|
||||
>name : 'hi'
|
||||
>foo : { (name: "hi"): B; (name: "bye"): C; (name: string): A; }
|
||||
>name : "hi"
|
||||
>B : B
|
||||
|
||||
function foo(name: 'bye'): C;
|
||||
>foo : { (name: 'hi'): B; (name: 'bye'): C; (name: string): A; }
|
||||
>name : 'bye'
|
||||
>foo : { (name: "hi"): B; (name: "bye"): C; (name: string): A; }
|
||||
>name : "bye"
|
||||
>C : C
|
||||
|
||||
function foo(name: string): A;
|
||||
>foo : { (name: 'hi'): B; (name: 'bye'): C; (name: string): A; }
|
||||
>foo : { (name: "hi"): B; (name: "bye"): C; (name: string): A; }
|
||||
>name : string
|
||||
>A : A
|
||||
|
||||
function foo(name: any): A {
|
||||
>foo : { (name: 'hi'): B; (name: 'bye'): C; (name: string): A; }
|
||||
>foo : { (name: "hi"): B; (name: "bye"): C; (name: string): A; }
|
||||
>name : any
|
||||
>A : A
|
||||
|
||||
|
||||
@@ -3,23 +3,23 @@ interface Base {
|
||||
>Base : Base
|
||||
|
||||
addEventListener(x: string): any;
|
||||
>addEventListener : { (x: string): any; (x: 'foo'): string; }
|
||||
>addEventListener : { (x: string): any; (x: "foo"): string; }
|
||||
>x : string
|
||||
|
||||
addEventListener(x: 'foo'): string;
|
||||
>addEventListener : { (x: string): any; (x: 'foo'): string; }
|
||||
>x : 'foo'
|
||||
>addEventListener : { (x: string): any; (x: "foo"): string; }
|
||||
>x : "foo"
|
||||
}
|
||||
interface Deriver extends Base {
|
||||
>Deriver : Deriver
|
||||
>Base : Base
|
||||
|
||||
addEventListener(x: string): any;
|
||||
>addEventListener : { (x: string): any; (x: 'bar'): string; }
|
||||
>addEventListener : { (x: string): any; (x: "bar"): string; }
|
||||
>x : string
|
||||
|
||||
addEventListener(x: 'bar'): string;
|
||||
>addEventListener : { (x: string): any; (x: 'bar'): string; }
|
||||
>x : 'bar'
|
||||
>addEventListener : { (x: string): any; (x: "bar"): string; }
|
||||
>x : "bar"
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
tests/cases/compiler/overloadOnConstInheritance2.ts(5,11): error TS2430: Interface 'Deriver' incorrectly extends interface 'Base'.
|
||||
Types of property 'addEventListener' are incompatible.
|
||||
Type '(x: 'bar') => string' is not assignable to type '{ (x: string): any; (x: 'foo'): string; }'.
|
||||
Type '(x: "bar") => string' is not assignable to type '{ (x: string): any; (x: "foo"): string; }'.
|
||||
tests/cases/compiler/overloadOnConstInheritance2.ts(6,5): error TS2382: Specialized overload signature is not assignable to any non-specialized signature.
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ tests/cases/compiler/overloadOnConstInheritance2.ts(6,5): error TS2382: Speciali
|
||||
~~~~~~~
|
||||
!!! error TS2430: Interface 'Deriver' incorrectly extends interface 'Base'.
|
||||
!!! error TS2430: Types of property 'addEventListener' are incompatible.
|
||||
!!! error TS2430: Type '(x: 'bar') => string' is not assignable to type '{ (x: string): any; (x: 'foo'): string; }'.
|
||||
!!! error TS2430: Type '(x: "bar") => string' is not assignable to type '{ (x: string): any; (x: "foo"): string; }'.
|
||||
addEventListener(x: 'bar'): string; // shouldn't need to redeclare the string overload
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
tests/cases/compiler/overloadOnConstInheritance3.ts(4,11): error TS2430: Interface 'Deriver' incorrectly extends interface 'Base'.
|
||||
Types of property 'addEventListener' are incompatible.
|
||||
Type '{ (x: 'bar'): string; (x: 'foo'): string; }' is not assignable to type '(x: string) => any'.
|
||||
Type '{ (x: "bar"): string; (x: "foo"): string; }' is not assignable to type '(x: string) => any'.
|
||||
tests/cases/compiler/overloadOnConstInheritance3.ts(6,5): error TS2382: Specialized overload signature is not assignable to any non-specialized signature.
|
||||
tests/cases/compiler/overloadOnConstInheritance3.ts(7,5): error TS2382: Specialized overload signature is not assignable to any non-specialized signature.
|
||||
|
||||
@@ -13,7 +13,7 @@ tests/cases/compiler/overloadOnConstInheritance3.ts(7,5): error TS2382: Speciali
|
||||
~~~~~~~
|
||||
!!! error TS2430: Interface 'Deriver' incorrectly extends interface 'Base'.
|
||||
!!! error TS2430: Types of property 'addEventListener' are incompatible.
|
||||
!!! error TS2430: Type '{ (x: 'bar'): string; (x: 'foo'): string; }' is not assignable to type '(x: string) => any'.
|
||||
!!! error TS2430: Type '{ (x: "bar"): string; (x: "foo"): string; }' is not assignable to type '(x: string) => any'.
|
||||
// shouldn't need to redeclare the string overload
|
||||
addEventListener(x: 'bar'): string;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -50,19 +50,19 @@ function foo4(x: any) { }
|
||||
>x : any
|
||||
|
||||
function foo5(x: 'a');
|
||||
>foo5 : { (x: 'a'): any; (x: 'a'): any; (x: string): any; }
|
||||
>x : 'a'
|
||||
>foo5 : { (x: "a"): any; (x: "a"): any; (x: string): any; }
|
||||
>x : "a"
|
||||
|
||||
function foo5(x: 'a');
|
||||
>foo5 : { (x: 'a'): any; (x: 'a'): any; (x: string): any; }
|
||||
>x : 'a'
|
||||
>foo5 : { (x: "a"): any; (x: "a"): any; (x: string): any; }
|
||||
>x : "a"
|
||||
|
||||
function foo5(x: string);
|
||||
>foo5 : { (x: 'a'): any; (x: 'a'): any; (x: string): any; }
|
||||
>foo5 : { (x: "a"): any; (x: "a"): any; (x: string): any; }
|
||||
>x : string
|
||||
|
||||
function foo5(x: any) { }
|
||||
>foo5 : { (x: 'a'): any; (x: 'a'): any; (x: string): any; }
|
||||
>foo5 : { (x: "a"): any; (x: "a"): any; (x: string): any; }
|
||||
>x : any
|
||||
|
||||
enum E { A }
|
||||
|
||||
@@ -11,8 +11,8 @@ interface B extends A {
|
||||
>A : A
|
||||
|
||||
(key:'foo'):string;
|
||||
>key : 'foo'
|
||||
>key : "foo"
|
||||
|
||||
(key:'bar'):string;
|
||||
>key : 'bar'
|
||||
>key : "bar"
|
||||
}
|
||||
|
||||
+51
-51
@@ -3,30 +3,30 @@
|
||||
// All the below should not be errors
|
||||
|
||||
function foo(x: 'a');
|
||||
>foo : { (x: 'a'): any; (x: string): any; }
|
||||
>x : 'a'
|
||||
>foo : { (x: "a"): any; (x: string): any; }
|
||||
>x : "a"
|
||||
|
||||
function foo(x: string);
|
||||
>foo : { (x: 'a'): any; (x: string): any; }
|
||||
>foo : { (x: "a"): any; (x: string): any; }
|
||||
>x : string
|
||||
|
||||
function foo(x: any) { }
|
||||
>foo : { (x: 'a'): any; (x: string): any; }
|
||||
>foo : { (x: "a"): any; (x: string): any; }
|
||||
>x : any
|
||||
|
||||
class C {
|
||||
>C : C
|
||||
|
||||
foo(x: 'a');
|
||||
>foo : { (x: 'a'): any; (x: string): any; }
|
||||
>x : 'a'
|
||||
>foo : { (x: "a"): any; (x: string): any; }
|
||||
>x : "a"
|
||||
|
||||
foo(x: string);
|
||||
>foo : { (x: 'a'): any; (x: string): any; }
|
||||
>foo : { (x: "a"): any; (x: string): any; }
|
||||
>x : string
|
||||
|
||||
foo(x: any) { }
|
||||
>foo : { (x: 'a'): any; (x: string): any; }
|
||||
>foo : { (x: "a"): any; (x: string): any; }
|
||||
>x : any
|
||||
}
|
||||
|
||||
@@ -35,20 +35,20 @@ class C2<T> {
|
||||
>T : T
|
||||
|
||||
foo(x: 'a');
|
||||
>foo : { (x: 'a'): any; (x: string): any; (x: T): any; }
|
||||
>x : 'a'
|
||||
>foo : { (x: "a"): any; (x: string): any; (x: T): any; }
|
||||
>x : "a"
|
||||
|
||||
foo(x: string);
|
||||
>foo : { (x: 'a'): any; (x: string): any; (x: T): any; }
|
||||
>foo : { (x: "a"): any; (x: string): any; (x: T): any; }
|
||||
>x : string
|
||||
|
||||
foo(x: T);
|
||||
>foo : { (x: 'a'): any; (x: string): any; (x: T): any; }
|
||||
>foo : { (x: "a"): any; (x: string): any; (x: T): any; }
|
||||
>x : T
|
||||
>T : T
|
||||
|
||||
foo(x: any) { }
|
||||
>foo : { (x: 'a'): any; (x: string): any; (x: T): any; }
|
||||
>foo : { (x: "a"): any; (x: string): any; (x: T): any; }
|
||||
>x : any
|
||||
}
|
||||
|
||||
@@ -58,20 +58,20 @@ class C3<T extends String> {
|
||||
>String : String
|
||||
|
||||
foo(x: 'a');
|
||||
>foo : { (x: 'a'): any; (x: string): any; (x: T): any; }
|
||||
>x : 'a'
|
||||
>foo : { (x: "a"): any; (x: string): any; (x: T): any; }
|
||||
>x : "a"
|
||||
|
||||
foo(x: string);
|
||||
>foo : { (x: 'a'): any; (x: string): any; (x: T): any; }
|
||||
>foo : { (x: "a"): any; (x: string): any; (x: T): any; }
|
||||
>x : string
|
||||
|
||||
foo(x: T);
|
||||
>foo : { (x: 'a'): any; (x: string): any; (x: T): any; }
|
||||
>foo : { (x: "a"): any; (x: string): any; (x: T): any; }
|
||||
>x : T
|
||||
>T : T
|
||||
|
||||
foo(x: any) { }
|
||||
>foo : { (x: 'a'): any; (x: string): any; (x: T): any; }
|
||||
>foo : { (x: "a"): any; (x: string): any; (x: T): any; }
|
||||
>x : any
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ interface I {
|
||||
>I : I
|
||||
|
||||
(x: 'a');
|
||||
>x : 'a'
|
||||
>x : "a"
|
||||
|
||||
(x: number);
|
||||
>x : number
|
||||
@@ -88,15 +88,15 @@ interface I {
|
||||
>x : string
|
||||
|
||||
foo(x: 'a');
|
||||
>foo : { (x: 'a'): any; (x: string): any; (x: number): any; }
|
||||
>x : 'a'
|
||||
>foo : { (x: "a"): any; (x: string): any; (x: number): any; }
|
||||
>x : "a"
|
||||
|
||||
foo(x: string);
|
||||
>foo : { (x: 'a'): any; (x: string): any; (x: number): any; }
|
||||
>foo : { (x: "a"): any; (x: string): any; (x: number): any; }
|
||||
>x : string
|
||||
|
||||
foo(x: number);
|
||||
>foo : { (x: 'a'): any; (x: string): any; (x: number): any; }
|
||||
>foo : { (x: "a"): any; (x: string): any; (x: number): any; }
|
||||
>x : number
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ interface I2<T> {
|
||||
>T : T
|
||||
|
||||
(x: 'a');
|
||||
>x : 'a'
|
||||
>x : "a"
|
||||
|
||||
(x: T);
|
||||
>x : T
|
||||
@@ -115,15 +115,15 @@ interface I2<T> {
|
||||
>x : string
|
||||
|
||||
foo(x: 'a');
|
||||
>foo : { (x: 'a'): any; (x: string): any; (x: T): any; }
|
||||
>x : 'a'
|
||||
>foo : { (x: "a"): any; (x: string): any; (x: T): any; }
|
||||
>x : "a"
|
||||
|
||||
foo(x: string);
|
||||
>foo : { (x: 'a'): any; (x: string): any; (x: T): any; }
|
||||
>foo : { (x: "a"): any; (x: string): any; (x: T): any; }
|
||||
>x : string
|
||||
|
||||
foo(x: T);
|
||||
>foo : { (x: 'a'): any; (x: string): any; (x: T): any; }
|
||||
>foo : { (x: "a"): any; (x: string): any; (x: T): any; }
|
||||
>x : T
|
||||
>T : T
|
||||
}
|
||||
@@ -134,7 +134,7 @@ interface I3<T extends String> {
|
||||
>String : String
|
||||
|
||||
(x: 'a');
|
||||
>x : 'a'
|
||||
>x : "a"
|
||||
|
||||
(x: string);
|
||||
>x : string
|
||||
@@ -144,49 +144,49 @@ interface I3<T extends String> {
|
||||
>T : T
|
||||
|
||||
foo(x: 'a');
|
||||
>foo : { (x: 'a'): any; (x: string): any; (x: T): any; }
|
||||
>x : 'a'
|
||||
>foo : { (x: "a"): any; (x: string): any; (x: T): any; }
|
||||
>x : "a"
|
||||
|
||||
foo(x: string);
|
||||
>foo : { (x: 'a'): any; (x: string): any; (x: T): any; }
|
||||
>foo : { (x: "a"): any; (x: string): any; (x: T): any; }
|
||||
>x : string
|
||||
|
||||
foo(x: T);
|
||||
>foo : { (x: 'a'): any; (x: string): any; (x: T): any; }
|
||||
>foo : { (x: "a"): any; (x: string): any; (x: T): any; }
|
||||
>x : T
|
||||
>T : T
|
||||
}
|
||||
|
||||
var a: {
|
||||
>a : { (x: string): any; (x: 'a'): any; (x: number): any; foo(x: string): any; foo(x: 'a'): any; foo(x: number): any; }
|
||||
>a : { (x: string): any; (x: "a"): any; (x: number): any; foo(x: string): any; foo(x: "a"): any; foo(x: number): any; }
|
||||
|
||||
(x: string);
|
||||
>x : string
|
||||
|
||||
(x: 'a');
|
||||
>x : 'a'
|
||||
>x : "a"
|
||||
|
||||
(x: number);
|
||||
>x : number
|
||||
|
||||
foo(x: string);
|
||||
>foo : { (x: string): any; (x: 'a'): any; (x: number): any; }
|
||||
>foo : { (x: string): any; (x: "a"): any; (x: number): any; }
|
||||
>x : string
|
||||
|
||||
foo(x: 'a');
|
||||
>foo : { (x: string): any; (x: 'a'): any; (x: number): any; }
|
||||
>x : 'a'
|
||||
>foo : { (x: string): any; (x: "a"): any; (x: number): any; }
|
||||
>x : "a"
|
||||
|
||||
foo(x: number);
|
||||
>foo : { (x: string): any; (x: 'a'): any; (x: number): any; }
|
||||
>foo : { (x: string): any; (x: "a"): any; (x: number): any; }
|
||||
>x : number
|
||||
}
|
||||
|
||||
var a2: {
|
||||
>a2 : { (x: 'a'): any; (x: string): any; <T>(x: T): any; foo(x: string): any; foo(x: 'a'): any; foo<T>(x: T): any; }
|
||||
>a2 : { (x: "a"): any; (x: string): any; <T>(x: T): any; foo(x: string): any; foo(x: "a"): any; foo<T>(x: T): any; }
|
||||
|
||||
(x: 'a');
|
||||
>x : 'a'
|
||||
>x : "a"
|
||||
|
||||
(x: string);
|
||||
>x : string
|
||||
@@ -197,25 +197,25 @@ var a2: {
|
||||
>T : T
|
||||
|
||||
foo(x: string);
|
||||
>foo : { (x: string): any; (x: 'a'): any; <T>(x: T): any; }
|
||||
>foo : { (x: string): any; (x: "a"): any; <T>(x: T): any; }
|
||||
>x : string
|
||||
|
||||
foo(x: 'a');
|
||||
>foo : { (x: string): any; (x: 'a'): any; <T>(x: T): any; }
|
||||
>x : 'a'
|
||||
>foo : { (x: string): any; (x: "a"): any; <T>(x: T): any; }
|
||||
>x : "a"
|
||||
|
||||
foo<T>(x: T);
|
||||
>foo : { (x: string): any; (x: 'a'): any; <T>(x: T): any; }
|
||||
>foo : { (x: string): any; (x: "a"): any; <T>(x: T): any; }
|
||||
>T : T
|
||||
>x : T
|
||||
>T : T
|
||||
}
|
||||
|
||||
var a3: {
|
||||
>a3 : { (x: 'a'): any; <T>(x: T): any; (x: string): any; foo(x: string): any; foo(x: 'a'): any; foo<T extends String>(x: T): any; }
|
||||
>a3 : { (x: "a"): any; <T>(x: T): any; (x: string): any; foo(x: string): any; foo(x: "a"): any; foo<T extends String>(x: T): any; }
|
||||
|
||||
(x: 'a');
|
||||
>x : 'a'
|
||||
>x : "a"
|
||||
|
||||
<T>(x: T);
|
||||
>T : T
|
||||
@@ -226,15 +226,15 @@ var a3: {
|
||||
>x : string
|
||||
|
||||
foo(x: string);
|
||||
>foo : { (x: string): any; (x: 'a'): any; <T extends String>(x: T): any; }
|
||||
>foo : { (x: string): any; (x: "a"): any; <T extends String>(x: T): any; }
|
||||
>x : string
|
||||
|
||||
foo(x: 'a');
|
||||
>foo : { (x: string): any; (x: 'a'): any; <T extends String>(x: T): any; }
|
||||
>x : 'a'
|
||||
>foo : { (x: string): any; (x: "a"): any; <T extends String>(x: T): any; }
|
||||
>x : "a"
|
||||
|
||||
foo<T extends String>(x: T);
|
||||
>foo : { (x: string): any; (x: 'a'): any; <T extends String>(x: T): any; }
|
||||
>foo : { (x: string): any; (x: "a"): any; <T extends String>(x: T): any; }
|
||||
>T : T
|
||||
>String : String
|
||||
>x : T
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
=== tests/cases/conformance/types/primitives/stringLiteral/stringLiteralType.ts ===
|
||||
var x: 'hi';
|
||||
>x : 'hi'
|
||||
>x : "hi"
|
||||
|
||||
function f(x: 'hi');
|
||||
>f : { (x: 'hi'): any; (x: string): any; }
|
||||
>x : 'hi'
|
||||
>f : { (x: "hi"): any; (x: string): any; }
|
||||
>x : "hi"
|
||||
|
||||
function f(x: string);
|
||||
>f : { (x: 'hi'): any; (x: string): any; }
|
||||
>f : { (x: "hi"): any; (x: string): any; }
|
||||
>x : string
|
||||
|
||||
function f(x: any) {
|
||||
>f : { (x: 'hi'): any; (x: string): any; }
|
||||
>f : { (x: "hi"): any; (x: string): any; }
|
||||
>x : any
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads01.ts(11,10): error TS2354: No best common type exists among return expressions.
|
||||
tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads01.ts(32,7): error TS2322: Type 'string' is not assignable to type '"string"'.
|
||||
tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads01.ts(33,7): error TS2322: Type 'string' is not assignable to type ''number''.
|
||||
tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads01.ts(33,7): error TS2322: Type 'string' is not assignable to type '"number"'.
|
||||
tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads01.ts(34,7): error TS2322: Type 'string' is not assignable to type '"boolean"'.
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads01.ts(34,
|
||||
!!! error TS2322: Type 'string' is not assignable to type '"string"'.
|
||||
const number: "number" = "number"
|
||||
~~~~~~
|
||||
!!! error TS2322: Type 'string' is not assignable to type ''number''.
|
||||
!!! error TS2322: Type 'string' is not assignable to type '"number"'.
|
||||
const boolean: "boolean" = "boolean"
|
||||
~~~~~~~
|
||||
!!! error TS2322: Type 'string' is not assignable to type '"boolean"'.
|
||||
|
||||
@@ -106,9 +106,9 @@ declare namespace Consts1 {
|
||||
declare const string: "string";
|
||||
declare const number: "number";
|
||||
declare const boolean: "boolean";
|
||||
declare const stringOrNumber: "string" | 'number';
|
||||
declare const stringOrNumber: "string" | "number";
|
||||
declare const stringOrBoolean: "string" | "boolean";
|
||||
declare const booleanOrNumber: 'number' | "boolean";
|
||||
declare const stringOrBooleanOrNumber: "string" | "boolean" | 'number';
|
||||
declare const booleanOrNumber: "number" | "boolean";
|
||||
declare const stringOrBooleanOrNumber: "string" | "boolean" | "number";
|
||||
declare namespace Consts2 {
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithSpecializedSignatures.ts(70,15): error TS2430: Interface 'I2' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a' are incompatible.
|
||||
Type '(x: string) => string' is not assignable to type '{ (x: 'a'): number; (x: string): number; }'.
|
||||
Type '(x: string) => string' is not assignable to type '{ (x: "a"): number; (x: string): number; }'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
~~
|
||||
!!! error TS2430: Interface 'I2' incorrectly extends interface 'Base2'.
|
||||
!!! error TS2430: Types of property 'a' are incompatible.
|
||||
!!! error TS2430: Type '(x: string) => string' is not assignable to type '{ (x: 'a'): number; (x: string): number; }'.
|
||||
!!! error TS2430: Type '(x: string) => string' is not assignable to type '{ (x: "a"): number; (x: string): number; }'.
|
||||
!!! error TS2430: Type 'string' is not assignable to type 'number'.
|
||||
// N's
|
||||
a: (x: string) => string; // error because base returns non-void;
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignaturesWithSpecializedSignatures.ts(70,15): error TS2430: Interface 'I2' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a' are incompatible.
|
||||
Type 'new (x: string) => string' is not assignable to type '{ new (x: 'a'): number; new (x: string): number; }'.
|
||||
Type 'new (x: string) => string' is not assignable to type '{ new (x: "a"): number; new (x: string): number; }'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
~~
|
||||
!!! error TS2430: Interface 'I2' incorrectly extends interface 'Base2'.
|
||||
!!! error TS2430: Types of property 'a' are incompatible.
|
||||
!!! error TS2430: Type 'new (x: string) => string' is not assignable to type '{ new (x: 'a'): number; new (x: string): number; }'.
|
||||
!!! error TS2430: Type 'new (x: string) => string' is not assignable to type '{ new (x: "a"): number; new (x: string): number; }'.
|
||||
!!! error TS2430: Type 'string' is not assignable to type 'number'.
|
||||
// N's
|
||||
a: new (x: string) => string; // error because base returns non-void;
|
||||
|
||||
@@ -19,22 +19,22 @@ class C {
|
||||
>C : C
|
||||
|
||||
foo(x: 'hi'): Derived1;
|
||||
>foo : { (x: 'hi'): Derived1; (x: 'bye'): Derived2; (x: string): Base; }
|
||||
>x : 'hi'
|
||||
>foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; }
|
||||
>x : "hi"
|
||||
>Derived1 : Derived1
|
||||
|
||||
foo(x: 'bye'): Derived2;
|
||||
>foo : { (x: 'hi'): Derived1; (x: 'bye'): Derived2; (x: string): Base; }
|
||||
>x : 'bye'
|
||||
>foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; }
|
||||
>x : "bye"
|
||||
>Derived2 : Derived2
|
||||
|
||||
foo(x: string): Base;
|
||||
>foo : { (x: 'hi'): Derived1; (x: 'bye'): Derived2; (x: string): Base; }
|
||||
>foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; }
|
||||
>x : string
|
||||
>Base : Base
|
||||
|
||||
foo(x) {
|
||||
>foo : { (x: 'hi'): Derived1; (x: 'bye'): Derived2; (x: string): Base; }
|
||||
>foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; }
|
||||
>x : any
|
||||
|
||||
return x;
|
||||
@@ -50,17 +50,17 @@ interface I {
|
||||
>I : I
|
||||
|
||||
foo(x: 'hi'): Derived1;
|
||||
>foo : { (x: 'hi'): Derived1; (x: 'bye'): Derived2; (x: string): Base; }
|
||||
>x : 'hi'
|
||||
>foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; }
|
||||
>x : "hi"
|
||||
>Derived1 : Derived1
|
||||
|
||||
foo(x: 'bye'): Derived2;
|
||||
>foo : { (x: 'hi'): Derived1; (x: 'bye'): Derived2; (x: string): Base; }
|
||||
>x : 'bye'
|
||||
>foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; }
|
||||
>x : "bye"
|
||||
>Derived2 : Derived2
|
||||
|
||||
foo(x: string): Base;
|
||||
>foo : { (x: 'hi'): Derived1; (x: 'bye'): Derived2; (x: string): Base; }
|
||||
>foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; }
|
||||
>x : string
|
||||
>Base : Base
|
||||
}
|
||||
@@ -69,20 +69,20 @@ var i: I;
|
||||
>I : I
|
||||
|
||||
var a: {
|
||||
>a : { foo(x: 'hi'): Derived1; foo(x: 'bye'): Derived2; foo(x: string): Base; }
|
||||
>a : { foo(x: "hi"): Derived1; foo(x: "bye"): Derived2; foo(x: string): Base; }
|
||||
|
||||
foo(x: 'hi'): Derived1;
|
||||
>foo : { (x: 'hi'): Derived1; (x: 'bye'): Derived2; (x: string): Base; }
|
||||
>x : 'hi'
|
||||
>foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; }
|
||||
>x : "hi"
|
||||
>Derived1 : Derived1
|
||||
|
||||
foo(x: 'bye'): Derived2;
|
||||
>foo : { (x: 'hi'): Derived1; (x: 'bye'): Derived2; (x: string): Base; }
|
||||
>x : 'bye'
|
||||
>foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; }
|
||||
>x : "bye"
|
||||
>Derived2 : Derived2
|
||||
|
||||
foo(x: string): Base;
|
||||
>foo : { (x: 'hi'): Derived1; (x: 'bye'): Derived2; (x: string): Base; }
|
||||
>foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; }
|
||||
>x : string
|
||||
>Base : Base
|
||||
|
||||
@@ -94,9 +94,9 @@ c = i;
|
||||
>i : I
|
||||
|
||||
c = a;
|
||||
>c = a : { foo(x: 'hi'): Derived1; foo(x: 'bye'): Derived2; foo(x: string): Base; }
|
||||
>c = a : { foo(x: "hi"): Derived1; foo(x: "bye"): Derived2; foo(x: string): Base; }
|
||||
>c : C
|
||||
>a : { foo(x: 'hi'): Derived1; foo(x: 'bye'): Derived2; foo(x: string): Base; }
|
||||
>a : { foo(x: "hi"): Derived1; foo(x: "bye"): Derived2; foo(x: string): Base; }
|
||||
|
||||
i = c;
|
||||
>i = c : C
|
||||
@@ -104,44 +104,44 @@ i = c;
|
||||
>c : C
|
||||
|
||||
i = a;
|
||||
>i = a : { foo(x: 'hi'): Derived1; foo(x: 'bye'): Derived2; foo(x: string): Base; }
|
||||
>i = a : { foo(x: "hi"): Derived1; foo(x: "bye"): Derived2; foo(x: string): Base; }
|
||||
>i : I
|
||||
>a : { foo(x: 'hi'): Derived1; foo(x: 'bye'): Derived2; foo(x: string): Base; }
|
||||
>a : { foo(x: "hi"): Derived1; foo(x: "bye"): Derived2; foo(x: string): Base; }
|
||||
|
||||
a = c;
|
||||
>a = c : C
|
||||
>a : { foo(x: 'hi'): Derived1; foo(x: 'bye'): Derived2; foo(x: string): Base; }
|
||||
>a : { foo(x: "hi"): Derived1; foo(x: "bye"): Derived2; foo(x: string): Base; }
|
||||
>c : C
|
||||
|
||||
a = i;
|
||||
>a = i : I
|
||||
>a : { foo(x: 'hi'): Derived1; foo(x: 'bye'): Derived2; foo(x: string): Base; }
|
||||
>a : { foo(x: "hi"): Derived1; foo(x: "bye"): Derived2; foo(x: string): Base; }
|
||||
>i : I
|
||||
|
||||
var r1: Derived1 = c.foo('hi');
|
||||
>r1 : Derived1
|
||||
>Derived1 : Derived1
|
||||
>c.foo('hi') : Derived1
|
||||
>c.foo : { (x: 'hi'): Derived1; (x: 'bye'): Derived2; (x: string): Base; }
|
||||
>c.foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; }
|
||||
>c : C
|
||||
>foo : { (x: 'hi'): Derived1; (x: 'bye'): Derived2; (x: string): Base; }
|
||||
>foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; }
|
||||
>'hi' : string
|
||||
|
||||
var r2: Derived2 = c.foo('bye');
|
||||
>r2 : Derived2
|
||||
>Derived2 : Derived2
|
||||
>c.foo('bye') : Derived2
|
||||
>c.foo : { (x: 'hi'): Derived1; (x: 'bye'): Derived2; (x: string): Base; }
|
||||
>c.foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; }
|
||||
>c : C
|
||||
>foo : { (x: 'hi'): Derived1; (x: 'bye'): Derived2; (x: string): Base; }
|
||||
>foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; }
|
||||
>'bye' : string
|
||||
|
||||
var r3: Base = c.foo('hm');
|
||||
>r3 : Base
|
||||
>Base : Base
|
||||
>c.foo('hm') : Base
|
||||
>c.foo : { (x: 'hi'): Derived1; (x: 'bye'): Derived2; (x: string): Base; }
|
||||
>c.foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; }
|
||||
>c : C
|
||||
>foo : { (x: 'hi'): Derived1; (x: 'bye'): Derived2; (x: string): Base; }
|
||||
>foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; }
|
||||
>'hm' : string
|
||||
|
||||
|
||||
@@ -19,10 +19,10 @@ class C {
|
||||
>C : C
|
||||
|
||||
constructor(x: 'hi');
|
||||
>x : 'hi'
|
||||
>x : "hi"
|
||||
|
||||
constructor(x: 'bye');
|
||||
>x : 'bye'
|
||||
>x : "bye"
|
||||
|
||||
constructor(x: string);
|
||||
>x : string
|
||||
@@ -44,11 +44,11 @@ interface I {
|
||||
>I : I
|
||||
|
||||
new(x: 'hi'): Derived1;
|
||||
>x : 'hi'
|
||||
>x : "hi"
|
||||
>Derived1 : Derived1
|
||||
|
||||
new(x: 'bye'): Derived2;
|
||||
>x : 'bye'
|
||||
>x : "bye"
|
||||
>Derived2 : Derived2
|
||||
|
||||
new(x: string): Base;
|
||||
@@ -60,14 +60,14 @@ var i: I;
|
||||
>I : I
|
||||
|
||||
var a: {
|
||||
>a : { new (x: 'hi'): Derived1; new (x: 'bye'): Derived2; new (x: string): Base; }
|
||||
>a : { new (x: "hi"): Derived1; new (x: "bye"): Derived2; new (x: string): Base; }
|
||||
|
||||
new(x: 'hi'): Derived1;
|
||||
>x : 'hi'
|
||||
>x : "hi"
|
||||
>Derived1 : Derived1
|
||||
|
||||
new(x: 'bye'): Derived2;
|
||||
>x : 'bye'
|
||||
>x : "bye"
|
||||
>Derived2 : Derived2
|
||||
|
||||
new(x: string): Base;
|
||||
@@ -82,18 +82,18 @@ c = i;
|
||||
>i : I
|
||||
|
||||
c = a;
|
||||
>c = a : { new (x: 'hi'): Derived1; new (x: 'bye'): Derived2; new (x: string): Base; }
|
||||
>c = a : { new (x: "hi"): Derived1; new (x: "bye"): Derived2; new (x: string): Base; }
|
||||
>c : C
|
||||
>a : { new (x: 'hi'): Derived1; new (x: 'bye'): Derived2; new (x: string): Base; }
|
||||
>a : { new (x: "hi"): Derived1; new (x: "bye"): Derived2; new (x: string): Base; }
|
||||
|
||||
i = a;
|
||||
>i = a : { new (x: 'hi'): Derived1; new (x: 'bye'): Derived2; new (x: string): Base; }
|
||||
>i = a : { new (x: "hi"): Derived1; new (x: "bye"): Derived2; new (x: string): Base; }
|
||||
>i : I
|
||||
>a : { new (x: 'hi'): Derived1; new (x: 'bye'): Derived2; new (x: string): Base; }
|
||||
>a : { new (x: "hi"): Derived1; new (x: "bye"): Derived2; new (x: string): Base; }
|
||||
|
||||
a = i;
|
||||
>a = i : I
|
||||
>a : { new (x: 'hi'): Derived1; new (x: 'bye'): Derived2; new (x: string): Base; }
|
||||
>a : { new (x: "hi"): Derived1; new (x: "bye"): Derived2; new (x: string): Base; }
|
||||
>i : I
|
||||
|
||||
var r1 = new C('hi');
|
||||
@@ -113,6 +113,6 @@ var r3: Base = new a('hm');
|
||||
>r3 : Base
|
||||
>Base : Base
|
||||
>new a('hm') : Base
|
||||
>a : { new (x: 'hi'): Derived1; new (x: 'bye'): Derived2; new (x: string): Base; }
|
||||
>a : { new (x: "hi"): Derived1; new (x: "bye"): Derived2; new (x: string): Base; }
|
||||
>'hm' : string
|
||||
|
||||
|
||||
Reference in New Issue
Block a user