1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
=== tests/cases/compiler/localImportNameVsGlobalName.ts ===
module Keyboard {
>Keyboard : typeof Keyboard
export enum Key { UP, DOWN, LEFT, RIGHT }
>Key : Key
>UP : Key.UP
>DOWN : Key.DOWN
>LEFT : Key.LEFT
>RIGHT : Key.RIGHT
}
module App {
>App : typeof App
import Key = Keyboard.Key;
>Key : typeof Key
>Keyboard : typeof Keyboard
>Key : Key
export function foo(key: Key): void {}
>foo : (key: Key) => void
>key : Key
foo(Key.UP);
>foo(Key.UP) : void
>foo : (key: Key) => void
>Key.UP : Key.UP
>Key : typeof Key
>UP : Key.UP
foo(Key.DOWN);
>foo(Key.DOWN) : void
>foo : (key: Key) => void
>Key.DOWN : Key.DOWN
>Key : typeof Key
>DOWN : Key.DOWN
foo(Key.LEFT);
>foo(Key.LEFT) : void
>foo : (key: Key) => void
>Key.LEFT : Key.LEFT
>Key : typeof Key
>LEFT : Key.LEFT
}
|