276 lines
2.9 KiB
Text
276 lines
2.9 KiB
Text
=== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfAny.ts ===
|
|
// every type is a subtype of any, no errors expected
|
|
|
|
interface I {
|
|
>I : I
|
|
|
|
[x: string]: any;
|
|
>x : string
|
|
|
|
foo: any;
|
|
>foo : any
|
|
}
|
|
|
|
|
|
interface I2 {
|
|
>I2 : I2
|
|
|
|
[x: string]: any;
|
|
>x : string
|
|
|
|
foo: number;
|
|
>foo : number
|
|
}
|
|
|
|
|
|
interface I3 {
|
|
>I3 : I3
|
|
|
|
[x: string]: any;
|
|
>x : string
|
|
|
|
foo: string;
|
|
>foo : string
|
|
}
|
|
|
|
|
|
interface I4 {
|
|
>I4 : I4
|
|
|
|
[x: string]: any;
|
|
>x : string
|
|
|
|
foo: boolean;
|
|
>foo : boolean
|
|
}
|
|
|
|
|
|
interface I5 {
|
|
>I5 : I5
|
|
|
|
[x: string]: any;
|
|
>x : string
|
|
|
|
foo: Date;
|
|
>foo : Date
|
|
>Date : Date
|
|
}
|
|
|
|
|
|
interface I6 {
|
|
>I6 : I6
|
|
|
|
[x: string]: any;
|
|
>x : string
|
|
|
|
foo: RegExp;
|
|
>foo : RegExp
|
|
>RegExp : RegExp
|
|
}
|
|
|
|
|
|
interface I7 {
|
|
>I7 : I7
|
|
|
|
[x: string]: any;
|
|
>x : string
|
|
|
|
foo: { bar: number };
|
|
>foo : { bar: number; }
|
|
>bar : number
|
|
}
|
|
|
|
|
|
interface I8 {
|
|
>I8 : I8
|
|
|
|
[x: string]: any;
|
|
>x : string
|
|
|
|
foo: number[];
|
|
>foo : number[]
|
|
}
|
|
|
|
|
|
interface I9 {
|
|
>I9 : I9
|
|
|
|
[x: string]: any;
|
|
>x : string
|
|
|
|
foo: I8;
|
|
>foo : I8
|
|
>I8 : I8
|
|
}
|
|
|
|
class A { foo: number; }
|
|
>A : A
|
|
>foo : number
|
|
|
|
interface I10 {
|
|
>I10 : I10
|
|
|
|
[x: string]: any;
|
|
>x : string
|
|
|
|
foo: A;
|
|
>foo : A
|
|
>A : A
|
|
}
|
|
|
|
class A2<T> { foo: T; }
|
|
>A2 : A2<T>
|
|
>T : T
|
|
>foo : T
|
|
>T : T
|
|
|
|
interface I11 {
|
|
>I11 : I11
|
|
|
|
[x: string]: any;
|
|
>x : string
|
|
|
|
foo: A2<number>;
|
|
>foo : A2<number>
|
|
>A2 : A2<T>
|
|
}
|
|
|
|
|
|
interface I12 {
|
|
>I12 : I12
|
|
|
|
[x: string]: any;
|
|
>x : string
|
|
|
|
foo: (x) => number;
|
|
>foo : (x: any) => number
|
|
>x : any
|
|
}
|
|
|
|
|
|
interface I13 {
|
|
>I13 : I13
|
|
|
|
[x: string]: any;
|
|
>x : string
|
|
|
|
foo: <T>(x:T) => T;
|
|
>foo : <T>(x: T) => T
|
|
>T : T
|
|
>x : T
|
|
>T : T
|
|
>T : T
|
|
}
|
|
|
|
|
|
enum E { A }
|
|
>E : E
|
|
>A : E
|
|
|
|
interface I14 {
|
|
>I14 : I14
|
|
|
|
[x: string]: any;
|
|
>x : string
|
|
|
|
foo: E;
|
|
>foo : E
|
|
>E : E
|
|
}
|
|
|
|
|
|
function f() { }
|
|
>f : typeof f
|
|
|
|
module f {
|
|
>f : typeof f
|
|
|
|
export var bar = 1;
|
|
>bar : number
|
|
}
|
|
interface I15 {
|
|
>I15 : I15
|
|
|
|
[x: string]: any;
|
|
>x : string
|
|
|
|
foo: typeof f;
|
|
>foo : typeof f
|
|
>f : typeof f
|
|
}
|
|
|
|
|
|
class c { baz: string }
|
|
>c : c
|
|
>baz : string
|
|
|
|
module c {
|
|
>c : typeof c
|
|
|
|
export var bar = 1;
|
|
>bar : number
|
|
}
|
|
interface I16 {
|
|
>I16 : I16
|
|
|
|
[x: string]: any;
|
|
>x : string
|
|
|
|
foo: typeof c;
|
|
>foo : typeof c
|
|
>c : typeof c
|
|
}
|
|
|
|
|
|
interface I17<T> {
|
|
>I17 : I17<T>
|
|
>T : T
|
|
|
|
[x: string]: any;
|
|
>x : string
|
|
|
|
foo: T;
|
|
>foo : T
|
|
>T : T
|
|
}
|
|
|
|
|
|
interface I18<T, U> {
|
|
>I18 : I18<T, U>
|
|
>T : T
|
|
>U : U
|
|
|
|
[x: string]: any;
|
|
>x : string
|
|
|
|
foo: U;
|
|
>foo : U
|
|
>U : U
|
|
}
|
|
//interface I18<T, U extends T> {
|
|
// [x: string]: any;
|
|
// foo: U;
|
|
//}
|
|
|
|
|
|
interface I19 {
|
|
>I19 : I19
|
|
|
|
[x: string]: any;
|
|
>x : string
|
|
|
|
foo: Object;
|
|
>foo : Object
|
|
>Object : Object
|
|
}
|
|
|
|
|
|
interface I20 {
|
|
>I20 : I20
|
|
|
|
[x: string]: any;
|
|
>x : string
|
|
|
|
foo: {};
|
|
>foo : {}
|
|
}
|