mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 11:24:29 -05:00
Add additional test to ensure merging more than augmentations still works
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
tests/cases/conformance/ambient/testB.ts(1,22): error TS2305: Module '"*.foo"' has no exported member 'onlyInA'.
|
||||
tests/cases/conformance/ambient/testB.ts(1,31): error TS2305: Module '"*.foo"' has no exported member 'alsoOnlyInA'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/ambient/types.ts (0 errors) ====
|
||||
declare module "*.foo" {
|
||||
let everywhere: string;
|
||||
}
|
||||
|
||||
|
||||
==== tests/cases/conformance/ambient/testA.ts (0 errors) ====
|
||||
import { everywhere, onlyInA, alsoOnlyInA } from "a.foo";
|
||||
declare module "a.foo" {
|
||||
let onlyInA: number;
|
||||
}
|
||||
|
||||
==== tests/cases/conformance/ambient/testB.ts (2 errors) ====
|
||||
import { everywhere, onlyInA, alsoOnlyInA } from "b.foo"; // Error
|
||||
~~~~~~~
|
||||
!!! error TS2305: Module '"*.foo"' has no exported member 'onlyInA'.
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2305: Module '"*.foo"' has no exported member 'alsoOnlyInA'.
|
||||
declare module "a.foo" {
|
||||
let alsoOnlyInA: number;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
//// [tests/cases/conformance/ambient/ambientDeclarationsPatterns_merging2.ts] ////
|
||||
|
||||
//// [types.ts]
|
||||
declare module "*.foo" {
|
||||
let everywhere: string;
|
||||
}
|
||||
|
||||
|
||||
//// [testA.ts]
|
||||
import { everywhere, onlyInA, alsoOnlyInA } from "a.foo";
|
||||
declare module "a.foo" {
|
||||
let onlyInA: number;
|
||||
}
|
||||
|
||||
//// [testB.ts]
|
||||
import { everywhere, onlyInA, alsoOnlyInA } from "b.foo"; // Error
|
||||
declare module "a.foo" {
|
||||
let alsoOnlyInA: number;
|
||||
}
|
||||
|
||||
//// [types.js]
|
||||
//// [testA.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
//// [testB.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
@@ -0,0 +1,34 @@
|
||||
=== tests/cases/conformance/ambient/types.ts ===
|
||||
declare module "*.foo" {
|
||||
>"*.foo" : Symbol("*.foo", Decl(types.ts, 0, 0))
|
||||
|
||||
let everywhere: string;
|
||||
>everywhere : Symbol(everywhere, Decl(types.ts, 1, 5))
|
||||
}
|
||||
|
||||
|
||||
=== tests/cases/conformance/ambient/testA.ts ===
|
||||
import { everywhere, onlyInA, alsoOnlyInA } from "a.foo";
|
||||
>everywhere : Symbol(everywhere, Decl(testA.ts, 0, 8))
|
||||
>onlyInA : Symbol(onlyInA, Decl(testA.ts, 0, 20))
|
||||
>alsoOnlyInA : Symbol(alsoOnlyInA, Decl(testA.ts, 0, 29))
|
||||
|
||||
declare module "a.foo" {
|
||||
>"a.foo" : Symbol("a.foo", Decl(testA.ts, 0, 57), Decl(types.ts, 0, 0), Decl(testB.ts, 0, 57))
|
||||
|
||||
let onlyInA: number;
|
||||
>onlyInA : Symbol(onlyInA, Decl(testA.ts, 2, 5))
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/ambient/testB.ts ===
|
||||
import { everywhere, onlyInA, alsoOnlyInA } from "b.foo"; // Error
|
||||
>everywhere : Symbol(everywhere, Decl(testB.ts, 0, 8))
|
||||
>onlyInA : Symbol(onlyInA, Decl(testB.ts, 0, 20))
|
||||
>alsoOnlyInA : Symbol(alsoOnlyInA, Decl(testB.ts, 0, 29))
|
||||
|
||||
declare module "a.foo" {
|
||||
>"a.foo" : Symbol("a.foo", Decl(testA.ts, 0, 57), Decl(types.ts, 0, 0), Decl(testB.ts, 0, 57))
|
||||
|
||||
let alsoOnlyInA: number;
|
||||
>alsoOnlyInA : Symbol(alsoOnlyInA, Decl(testB.ts, 2, 5))
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
=== tests/cases/conformance/ambient/types.ts ===
|
||||
declare module "*.foo" {
|
||||
>"*.foo" : typeof import("*.foo")
|
||||
|
||||
let everywhere: string;
|
||||
>everywhere : string
|
||||
}
|
||||
|
||||
|
||||
=== tests/cases/conformance/ambient/testA.ts ===
|
||||
import { everywhere, onlyInA, alsoOnlyInA } from "a.foo";
|
||||
>everywhere : string
|
||||
>onlyInA : number
|
||||
>alsoOnlyInA : number
|
||||
|
||||
declare module "a.foo" {
|
||||
>"a.foo" : typeof import("a.foo")
|
||||
|
||||
let onlyInA: number;
|
||||
>onlyInA : number
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/ambient/testB.ts ===
|
||||
import { everywhere, onlyInA, alsoOnlyInA } from "b.foo"; // Error
|
||||
>everywhere : string
|
||||
>onlyInA : any
|
||||
>alsoOnlyInA : any
|
||||
|
||||
declare module "a.foo" {
|
||||
>"a.foo" : typeof import("a.foo")
|
||||
|
||||
let alsoOnlyInA: number;
|
||||
>alsoOnlyInA : number
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
// @filename: types.ts
|
||||
declare module "*.foo" {
|
||||
let everywhere: string;
|
||||
}
|
||||
|
||||
|
||||
// @filename: testA.ts
|
||||
import { everywhere, onlyInA, alsoOnlyInA } from "a.foo";
|
||||
declare module "a.foo" {
|
||||
let onlyInA: number;
|
||||
}
|
||||
|
||||
// @filename: testB.ts
|
||||
import { everywhere, onlyInA, alsoOnlyInA } from "b.foo"; // Error
|
||||
declare module "a.foo" {
|
||||
let alsoOnlyInA: number;
|
||||
}
|
||||
Reference in New Issue
Block a user