File: apparentTypeSupertype.symbols

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (22 lines) | stat: -rw-r--r-- 1,055 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
=== tests/cases/conformance/types/typeRelationships/apparentType/apparentTypeSupertype.ts ===
// subtype checks use the apparent type of the target type
// S is a subtype of a type T, and T is a supertype of S, if one of the following is true, where S' denotes the apparent type (section 3.8.1) of S:

class Base {
>Base : Symbol(Base, Decl(apparentTypeSupertype.ts, 0, 0))

    x: string;
>x : Symbol(Base.x, Decl(apparentTypeSupertype.ts, 3, 12))
}

// is String (S) a subtype of U extends String (T)? Would only be true if we used the apparent type of U (T)
class Derived<U extends String> extends Base { // error
>Derived : Symbol(Derived, Decl(apparentTypeSupertype.ts, 5, 1))
>U : Symbol(U, Decl(apparentTypeSupertype.ts, 8, 14))
>String : Symbol(String, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>Base : Symbol(Base, Decl(apparentTypeSupertype.ts, 0, 0))

    x: U;
>x : Symbol(Derived.x, Decl(apparentTypeSupertype.ts, 8, 46))
>U : Symbol(U, Decl(apparentTypeSupertype.ts, 8, 14))
}