-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10930 from RyanCavanaugh/release-2.0
Cherry-pick #10929 to release-2.0
- Loading branch information
Showing
4 changed files
with
47 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
tests/cases/conformance/externalModules/a.ts(7,14): error TS2686: Identifier 'Foo' must be imported from a module | ||
|
||
|
||
==== tests/cases/conformance/externalModules/a.ts (1 errors) ==== | ||
/// <reference path="foo.d.ts" /> | ||
import * as ff from './foo'; | ||
|
||
let y: Foo; // OK in type position | ||
y.foo(); | ||
let z: Foo.SubThing; // OK in ns position | ||
let x: any = Foo; // Not OK in value position | ||
~~~ | ||
!!! error TS2686: Identifier 'Foo' must be imported from a module | ||
|
||
==== tests/cases/conformance/externalModules/foo.d.ts (0 errors) ==== | ||
|
||
declare class Thing { | ||
foo(): number; | ||
} | ||
declare namespace Thing { | ||
interface SubThing { } | ||
} | ||
export = Thing; | ||
export as namespace Foo; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters