32 lines
558 B
Text
32 lines
558 B
Text
|
=== tests/cases/compiler/assignmentCompatForEnums.ts ===
|
||
|
enum TokenType { One, Two };
|
||
|
>TokenType : TokenType
|
||
|
>One : TokenType
|
||
|
>Two : TokenType
|
||
|
|
||
|
var list = {};
|
||
|
>list : {}
|
||
|
>{} : {}
|
||
|
|
||
|
|
||
|
function returnType(): TokenType { return null; }
|
||
|
>returnType : () => TokenType
|
||
|
>TokenType : TokenType
|
||
|
|
||
|
function foo() {
|
||
|
>foo : () => void
|
||
|
|
||
|
var x = returnType();
|
||
|
>x : TokenType
|
||
|
>returnType() : TokenType
|
||
|
>returnType : () => TokenType
|
||
|
|
||
|
var x: TokenType = list['one'];
|
||
|
>x : TokenType
|
||
|
>TokenType : TokenType
|
||
|
>list['one'] : any
|
||
|
>list : {}
|
||
|
}
|
||
|
|
||
|
|