Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When unidirectionally merging symbols, do so recursively
- Loading branch information
1 parent
d69f9f3
commit 973c3ca
Showing
5 changed files
with
97 additions
and
4 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
18 changes: 18 additions & 0 deletions
18
tests/baselines/reference/ambientDeclarationsPatterns_merging3.errors.txt
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/ambient/test.ts(6,6): error TS2339: Property 'a' does not exist on type 'OhNo'. | ||
|
||
|
||
==== tests/cases/conformance/ambient/types.ts (0 errors) ==== | ||
declare module "*.foo" { | ||
export interface OhNo { star: string } | ||
} | ||
|
||
==== tests/cases/conformance/ambient/test.ts (1 errors) ==== | ||
declare module "a.foo" { | ||
export interface OhNo { a: string } | ||
} | ||
import { OhNo } from "b.foo" | ||
declare let ohno: OhNo; | ||
ohno.a // oh no | ||
~ | ||
!!! error TS2339: Property 'a' does not exist on type 'OhNo'. | ||
|
21 changes: 21 additions & 0 deletions
21
tests/baselines/reference/ambientDeclarationsPatterns_merging3.js
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,21 @@ | ||
//// [tests/cases/conformance/ambient/ambientDeclarationsPatterns_merging3.ts] //// | ||
|
||
//// [types.ts] | ||
declare module "*.foo" { | ||
export interface OhNo { star: string } | ||
} | ||
|
||
//// [test.ts] | ||
declare module "a.foo" { | ||
export interface OhNo { a: string } | ||
} | ||
import { OhNo } from "b.foo" | ||
declare let ohno: OhNo; | ||
ohno.a // oh no | ||
|
||
|
||
//// [types.js] | ||
//// [test.js] | ||
"use strict"; | ||
exports.__esModule = true; | ||
ohno.a; // oh no |
27 changes: 27 additions & 0 deletions
27
tests/baselines/reference/ambientDeclarationsPatterns_merging3.symbols
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,27 @@ | ||
=== tests/cases/conformance/ambient/types.ts === | ||
declare module "*.foo" { | ||
>"*.foo" : Symbol("*.foo", Decl(types.ts, 0, 0)) | ||
|
||
export interface OhNo { star: string } | ||
>OhNo : Symbol(OhNo, Decl(types.ts, 0, 24)) | ||
>star : Symbol(OhNo.star, Decl(types.ts, 1, 25)) | ||
} | ||
|
||
=== tests/cases/conformance/ambient/test.ts === | ||
declare module "a.foo" { | ||
>"a.foo" : Symbol("a.foo", Decl(test.ts, 0, 0), Decl(types.ts, 0, 0)) | ||
|
||
export interface OhNo { a: string } | ||
>OhNo : Symbol(OhNo, Decl(test.ts, 0, 24), Decl(types.ts, 0, 24)) | ||
>a : Symbol(OhNo.a, Decl(test.ts, 1, 25)) | ||
} | ||
import { OhNo } from "b.foo" | ||
>OhNo : Symbol(OhNo, Decl(test.ts, 3, 8)) | ||
|
||
declare let ohno: OhNo; | ||
>ohno : Symbol(ohno, Decl(test.ts, 4, 11)) | ||
>OhNo : Symbol(OhNo, Decl(test.ts, 3, 8)) | ||
|
||
ohno.a // oh no | ||
>ohno : Symbol(ohno, Decl(test.ts, 4, 11)) | ||
|
26 changes: 26 additions & 0 deletions
26
tests/baselines/reference/ambientDeclarationsPatterns_merging3.types
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,26 @@ | ||
=== tests/cases/conformance/ambient/types.ts === | ||
declare module "*.foo" { | ||
>"*.foo" : typeof import("*.foo") | ||
|
||
export interface OhNo { star: string } | ||
>star : string | ||
} | ||
|
||
=== tests/cases/conformance/ambient/test.ts === | ||
declare module "a.foo" { | ||
>"a.foo" : typeof import("a.foo") | ||
|
||
export interface OhNo { a: string } | ||
>a : string | ||
} | ||
import { OhNo } from "b.foo" | ||
>OhNo : any | ||
|
||
declare let ohno: OhNo; | ||
>ohno : OhNo | ||
|
||
ohno.a // oh no | ||
>ohno.a : any | ||
>ohno : OhNo | ||
>a : any | ||
|