156 lines
1.9 KiB
Text
156 lines
1.9 KiB
Text
=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/anyAssignableToEveryType.ts ===
|
|
var a: any;
|
|
>a : any
|
|
|
|
class C {
|
|
>C : C
|
|
|
|
foo: string;
|
|
>foo : string
|
|
}
|
|
var ac: C;
|
|
>ac : C
|
|
>C : C
|
|
|
|
interface I {
|
|
>I : I
|
|
|
|
foo: string;
|
|
>foo : string
|
|
}
|
|
var ai: I;
|
|
>ai : I
|
|
>I : I
|
|
|
|
enum E { A }
|
|
>E : E
|
|
>A : E
|
|
|
|
var ae: E;
|
|
>ae : E
|
|
>E : E
|
|
|
|
var b: number = a;
|
|
>b : number
|
|
>a : any
|
|
|
|
var c: string = a;
|
|
>c : string
|
|
>a : any
|
|
|
|
var d: boolean = a;
|
|
>d : boolean
|
|
>a : any
|
|
|
|
var e: Date = a;
|
|
>e : Date
|
|
>Date : Date
|
|
>a : any
|
|
|
|
var f: any = a;
|
|
>f : any
|
|
>a : any
|
|
|
|
var g: void = a;
|
|
>g : void
|
|
>a : any
|
|
|
|
var h: Object = a;
|
|
>h : Object
|
|
>Object : Object
|
|
>a : any
|
|
|
|
var i: {} = a;
|
|
>i : {}
|
|
>a : any
|
|
|
|
var j: () => {} = a;
|
|
>j : () => {}
|
|
>a : any
|
|
|
|
var k: Function = a;
|
|
>k : Function
|
|
>Function : Function
|
|
>a : any
|
|
|
|
var l: (x: number) => string = a;
|
|
>l : (x: number) => string
|
|
>x : number
|
|
>a : any
|
|
|
|
ac = a;
|
|
>ac = a : any
|
|
>ac : C
|
|
>a : any
|
|
|
|
ai = a;
|
|
>ai = a : any
|
|
>ai : I
|
|
>a : any
|
|
|
|
ae = a;
|
|
>ae = a : any
|
|
>ae : E
|
|
>a : any
|
|
|
|
var m: number[] = a;
|
|
>m : number[]
|
|
>a : any
|
|
|
|
var n: { foo: string } = a;
|
|
>n : { foo: string; }
|
|
>foo : string
|
|
>a : any
|
|
|
|
var o: <T>(x: T) => T = a;
|
|
>o : <T>(x: T) => T
|
|
>T : T
|
|
>x : T
|
|
>T : T
|
|
>T : T
|
|
>a : any
|
|
|
|
var p: Number = a;
|
|
>p : Number
|
|
>Number : Number
|
|
>a : any
|
|
|
|
var q: String = a;
|
|
>q : String
|
|
>String : String
|
|
>a : any
|
|
|
|
function foo<T, U /*extends T*/, V extends Date>(x: T, y: U, z: V) {
|
|
>foo : <T, U, V extends Date>(x: T, y: U, z: V) => void
|
|
>T : T
|
|
>U : U
|
|
>V : V
|
|
>Date : Date
|
|
>x : T
|
|
>T : T
|
|
>y : U
|
|
>U : U
|
|
>z : V
|
|
>V : V
|
|
|
|
x = a;
|
|
>x = a : any
|
|
>x : T
|
|
>a : any
|
|
|
|
y = a;
|
|
>y = a : any
|
|
>y : U
|
|
>a : any
|
|
|
|
z = a;
|
|
>z = a : any
|
|
>z : V
|
|
>a : any
|
|
}
|
|
|
|
//function foo<T, U extends T, V extends Date>(x: T, y: U, z: V) {
|
|
// x = a;
|
|
// y = a;
|
|
// z = a;
|
|
//}
|