File: localImportNameVsGlobalName.types

package info (click to toggle)
node-typescript 2.1.5-1~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 203,960 kB
  • sloc: sh: 11; makefile: 5
file content (46 lines) | stat: -rw-r--r-- 841 bytes parent folder | download | duplicates (2)
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
46
=== 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
>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
}