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 #11147 from Microsoft/classic_at_types
Have classic module resolution use @types as a fallback
- Loading branch information
Showing
6 changed files
with
167 additions
and
25 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,18 @@ | ||
//// [tests/cases/conformance/typings/typingsLookupAmd.ts] //// | ||
|
||
//// [index.d.ts] | ||
|
||
export declare class A {} | ||
|
||
//// [index.d.ts] | ||
import {A} from "a"; | ||
export declare class B extends A {} | ||
|
||
//// [foo.ts] | ||
import {B} from "b"; | ||
|
||
|
||
//// [foo.js] | ||
define(["require", "exports"], function (require, exports) { | ||
"use strict"; | ||
}); |
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,17 @@ | ||
=== /x/y/foo.ts === | ||
import {B} from "b"; | ||
>B : Symbol(B, Decl(foo.ts, 0, 8)) | ||
|
||
=== /node_modules/@types/a/index.d.ts === | ||
|
||
export declare class A {} | ||
>A : Symbol(A, Decl(index.d.ts, 0, 0)) | ||
|
||
=== /x/node_modules/@types/b/index.d.ts === | ||
import {A} from "a"; | ||
>A : Symbol(A, Decl(index.d.ts, 0, 8)) | ||
|
||
export declare class B extends A {} | ||
>B : Symbol(B, Decl(index.d.ts, 0, 20)) | ||
>A : Symbol(A, Decl(index.d.ts, 0, 8)) | ||
|
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,59 @@ | ||
[ | ||
"======== Resolving module 'b' from '/x/y/foo.ts'. ========", | ||
"Module resolution kind is not specified, using 'Classic'.", | ||
"File '/x/y/b.ts' does not exist.", | ||
"File '/x/y/b.d.ts' does not exist.", | ||
"File '/x/b.ts' does not exist.", | ||
"File '/x/b.d.ts' does not exist.", | ||
"File '/b.ts' does not exist.", | ||
"File '/b.d.ts' does not exist.", | ||
"File '/x/y/node_modules/@types/b.ts' does not exist.", | ||
"File '/x/y/node_modules/@types/b.d.ts' does not exist.", | ||
"File '/x/y/node_modules/@types/b/package.json' does not exist.", | ||
"File '/x/y/node_modules/@types/b/index.ts' does not exist.", | ||
"File '/x/y/node_modules/@types/b/index.d.ts' does not exist.", | ||
"File '/x/node_modules/@types/b.ts' does not exist.", | ||
"File '/x/node_modules/@types/b.d.ts' does not exist.", | ||
"File '/x/node_modules/@types/b/package.json' does not exist.", | ||
"File '/x/node_modules/@types/b/index.ts' does not exist.", | ||
"File '/x/node_modules/@types/b/index.d.ts' exist - use it as a name resolution result.", | ||
"======== Module name 'b' was successfully resolved to '/x/node_modules/@types/b/index.d.ts'. ========", | ||
"======== Resolving module 'a' from '/x/node_modules/@types/b/index.d.ts'. ========", | ||
"Module resolution kind is not specified, using 'Classic'.", | ||
"File '/x/node_modules/@types/b/a.ts' does not exist.", | ||
"File '/x/node_modules/@types/b/a.d.ts' does not exist.", | ||
"File '/x/node_modules/@types/a.ts' does not exist.", | ||
"File '/x/node_modules/@types/a.d.ts' does not exist.", | ||
"File '/x/node_modules/a.ts' does not exist.", | ||
"File '/x/node_modules/a.d.ts' does not exist.", | ||
"File '/x/a.ts' does not exist.", | ||
"File '/x/a.d.ts' does not exist.", | ||
"File '/a.ts' does not exist.", | ||
"File '/a.d.ts' does not exist.", | ||
"File '/x/node_modules/@types/b/node_modules/@types/a.ts' does not exist.", | ||
"File '/x/node_modules/@types/b/node_modules/@types/a.d.ts' does not exist.", | ||
"File '/x/node_modules/@types/b/node_modules/@types/a/package.json' does not exist.", | ||
"File '/x/node_modules/@types/b/node_modules/@types/a/index.ts' does not exist.", | ||
"File '/x/node_modules/@types/b/node_modules/@types/a/index.d.ts' does not exist.", | ||
"File '/x/node_modules/@types/node_modules/@types/a.ts' does not exist.", | ||
"File '/x/node_modules/@types/node_modules/@types/a.d.ts' does not exist.", | ||
"File '/x/node_modules/@types/node_modules/@types/a/package.json' does not exist.", | ||
"File '/x/node_modules/@types/node_modules/@types/a/index.ts' does not exist.", | ||
"File '/x/node_modules/@types/node_modules/@types/a/index.d.ts' does not exist.", | ||
"File '/x/node_modules/@types/a.ts' does not exist.", | ||
"File '/x/node_modules/@types/a.d.ts' does not exist.", | ||
"File '/x/node_modules/@types/a/package.json' does not exist.", | ||
"File '/x/node_modules/@types/a/index.ts' does not exist.", | ||
"File '/x/node_modules/@types/a/index.d.ts' does not exist.", | ||
"File '/node_modules/@types/a.ts' does not exist.", | ||
"File '/node_modules/@types/a.d.ts' does not exist.", | ||
"File '/node_modules/@types/a/package.json' does not exist.", | ||
"File '/node_modules/@types/a/index.ts' does not exist.", | ||
"File '/node_modules/@types/a/index.d.ts' exist - use it as a name resolution result.", | ||
"======== Module name 'a' was successfully resolved to '/node_modules/@types/a/index.d.ts'. ========", | ||
"======== Resolving type reference directive 'a', containing file '/__inferred type names__.ts', root directory '/node_modules/@types'. ========", | ||
"Resolving with primary search path '/node_modules/@types'", | ||
"File '/node_modules/@types/a/package.json' does not exist.", | ||
"File '/node_modules/@types/a/index.d.ts' exist - use it as a name resolution result.", | ||
"======== Type reference directive 'a' was successfully resolved to '/node_modules/@types/a/index.d.ts', primary: true. ========" | ||
] |
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,17 @@ | ||
=== /x/y/foo.ts === | ||
import {B} from "b"; | ||
>B : typeof B | ||
|
||
=== /node_modules/@types/a/index.d.ts === | ||
|
||
export declare class A {} | ||
>A : A | ||
|
||
=== /x/node_modules/@types/b/index.d.ts === | ||
import {A} from "a"; | ||
>A : typeof A | ||
|
||
export declare class B extends A {} | ||
>B : B | ||
>A : A | ||
|
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,14 @@ | ||
// @traceResolution: true | ||
// @noImplicitReferences: true | ||
// @currentDirectory: / | ||
// @module: amd | ||
|
||
// @filename: /node_modules/@types/a/index.d.ts | ||
export declare class A {} | ||
|
||
// @filename: /x/node_modules/@types/b/index.d.ts | ||
import {A} from "a"; | ||
export declare class B extends A {} | ||
|
||
// @filename: /x/y/foo.ts | ||
import {B} from "b"; |