Skip to content

Commit f34cf80

Browse files
committed
Merge branch 'YuichiNukiyama-change_unexposed_error_message'
2 parents 542a2a0 + 7fb0e15 commit f34cf80

34 files changed

Lines changed: 354 additions & 211 deletions

‎src/compiler/checker.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,11 +1313,10 @@ namespace ts {
13131313
else if (namespace === unknownSymbol) {
13141314
return namespace;
13151315
}
1316-
13171316
symbol = getSymbol(getExportsOfSymbol(namespace), right.text, meaning);
13181317
if (!symbol) {
13191318
if (!ignoreErrors) {
1320-
error(right, Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace), declarationNameToString(right));
1319+
error(right, Diagnostics.Namespace_0_has_no_exported_member_1, getFullyQualifiedName(namespace), declarationNameToString(right));
13211320
}
13221321
return undefined;
13231322
}

‎src/compiler/diagnosticMessages.json‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1951,6 +1951,11 @@
19511951
"category": "Error",
19521952
"code": 2693
19531953
},
1954+
"Namespace '{0}' has no exported member '{1}'.": {
1955+
"category": "Error",
1956+
"code": 2694
1957+
},
1958+
19541959
"Import declaration '{0}' is using private name '{1}'.": {
19551960
"category": "Error",
19561961
"code": 4000

‎tests/baselines/reference/aliasBug.errors.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
tests/cases/compiler/aliasBug.ts(17,15): error TS2305: Module 'foo.bar.baz' has no exported member 'bar'.
1+
tests/cases/compiler/aliasBug.ts(17,15): error TS2694: Namespace 'foo.bar.baz' has no exported member 'bar'.
22

33

44
==== tests/cases/compiler/aliasBug.ts (1 errors) ====
@@ -20,7 +20,7 @@ tests/cases/compiler/aliasBug.ts(17,15): error TS2305: Module 'foo.bar.baz' has
2020
var p2: foo.Provide;
2121
var p3:booz.bar;
2222
~~~
23-
!!! error TS2305: Module 'foo.bar.baz' has no exported member 'bar'.
23+
!!! error TS2694: Namespace 'foo.bar.baz' has no exported member 'bar'.
2424
var p22 = new provide.Provide();
2525
}
2626

‎tests/baselines/reference/aliasErrors.errors.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ tests/cases/compiler/aliasErrors.ts(13,12): error TS1003: Identifier expected.
44
tests/cases/compiler/aliasErrors.ts(14,12): error TS1003: Identifier expected.
55
tests/cases/compiler/aliasErrors.ts(15,12): error TS1003: Identifier expected.
66
tests/cases/compiler/aliasErrors.ts(16,12): error TS2503: Cannot find namespace 'undefined'.
7-
tests/cases/compiler/aliasErrors.ts(26,15): error TS2305: Module 'foo.bar.baz' has no exported member 'bar'.
7+
tests/cases/compiler/aliasErrors.ts(26,15): error TS2694: Namespace 'foo.bar.baz' has no exported member 'bar'.
88

99

1010
==== tests/cases/compiler/aliasErrors.ts (7 errors) ====
@@ -47,7 +47,7 @@ tests/cases/compiler/aliasErrors.ts(26,15): error TS2305: Module 'foo.bar.baz' h
4747
var p2: foo.Provide;
4848
var p3:booz.bar;
4949
~~~
50-
!!! error TS2305: Module 'foo.bar.baz' has no exported member 'bar'.
50+
!!! error TS2694: Namespace 'foo.bar.baz' has no exported member 'bar'.
5151
var p22 = new provide.Provide();
5252
}
5353

‎tests/baselines/reference/bluebirdStaticThis.errors.txt‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
tests/cases/compiler/bluebirdStaticThis.ts(5,15): error TS2420: Class 'Promise<R>' incorrectly implements interface 'Thenable<R>'.
22
Property 'then' is missing in type 'Promise<R>'.
3-
tests/cases/compiler/bluebirdStaticThis.ts(22,51): error TS2305: Module 'Promise' has no exported member 'Resolver'.
4-
tests/cases/compiler/bluebirdStaticThis.ts(57,109): error TS2305: Module 'Promise' has no exported member 'Inspection'.
5-
tests/cases/compiler/bluebirdStaticThis.ts(58,91): error TS2305: Module 'Promise' has no exported member 'Inspection'.
6-
tests/cases/compiler/bluebirdStaticThis.ts(59,91): error TS2305: Module 'Promise' has no exported member 'Inspection'.
7-
tests/cases/compiler/bluebirdStaticThis.ts(60,73): error TS2305: Module 'Promise' has no exported member 'Inspection'.
3+
tests/cases/compiler/bluebirdStaticThis.ts(22,51): error TS2694: Namespace 'Promise' has no exported member 'Resolver'.
4+
tests/cases/compiler/bluebirdStaticThis.ts(57,109): error TS2694: Namespace 'Promise' has no exported member 'Inspection'.
5+
tests/cases/compiler/bluebirdStaticThis.ts(58,91): error TS2694: Namespace 'Promise' has no exported member 'Inspection'.
6+
tests/cases/compiler/bluebirdStaticThis.ts(59,91): error TS2694: Namespace 'Promise' has no exported member 'Inspection'.
7+
tests/cases/compiler/bluebirdStaticThis.ts(60,73): error TS2694: Namespace 'Promise' has no exported member 'Inspection'.
88

99

1010
==== tests/cases/compiler/bluebirdStaticThis.ts (6 errors) ====
@@ -34,7 +34,7 @@ tests/cases/compiler/bluebirdStaticThis.ts(60,73): error TS2305: Module 'Promise
3434

3535
static defer<R>(dit: typeof Promise): Promise.Resolver<R>;
3636
~~~~~~~~
37-
!!! error TS2305: Module 'Promise' has no exported member 'Resolver'.
37+
!!! error TS2694: Namespace 'Promise' has no exported member 'Resolver'.
3838

3939
static cast<R>(dit: typeof Promise, value: Promise.Thenable<R>): Promise<R>;
4040
static cast<R>(dit: typeof Promise, value: R): Promise<R>;
@@ -71,16 +71,16 @@ tests/cases/compiler/bluebirdStaticThis.ts(60,73): error TS2305: Module 'Promise
7171

7272
static settle<R>(dit: typeof Promise, values: Promise.Thenable<Promise.Thenable<R>[]>): Promise<Promise.Inspection<R>[]>;
7373
~~~~~~~~~~
74-
!!! error TS2305: Module 'Promise' has no exported member 'Inspection'.
74+
!!! error TS2694: Namespace 'Promise' has no exported member 'Inspection'.
7575
static settle<R>(dit: typeof Promise, values: Promise.Thenable<R[]>): Promise<Promise.Inspection<R>[]>;
7676
~~~~~~~~~~
77-
!!! error TS2305: Module 'Promise' has no exported member 'Inspection'.
77+
!!! error TS2694: Namespace 'Promise' has no exported member 'Inspection'.
7878
static settle<R>(dit: typeof Promise, values: Promise.Thenable<R>[]): Promise<Promise.Inspection<R>[]>;
7979
~~~~~~~~~~
80-
!!! error TS2305: Module 'Promise' has no exported member 'Inspection'.
80+
!!! error TS2694: Namespace 'Promise' has no exported member 'Inspection'.
8181
static settle<R>(dit: typeof Promise, values: R[]): Promise<Promise.Inspection<R>[]>;
8282
~~~~~~~~~~
83-
!!! error TS2305: Module 'Promise' has no exported member 'Inspection'.
83+
!!! error TS2694: Namespace 'Promise' has no exported member 'Inspection'.
8484

8585
static any<R>(dit: typeof Promise, values: Promise.Thenable<Promise.Thenable<R>[]>): Promise<R>;
8686
static any<R>(dit: typeof Promise, values: Promise.Thenable<R[]>): Promise<R>;

‎tests/baselines/reference/complicatedPrivacy.errors.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
tests/cases/compiler/complicatedPrivacy.ts(11,24): error TS1054: A 'get' accessor cannot have parameters.
22
tests/cases/compiler/complicatedPrivacy.ts(35,5): error TS1170: A computed property name in a type literal must directly refer to a built-in symbol.
33
tests/cases/compiler/complicatedPrivacy.ts(35,6): error TS2304: Cannot find name 'number'.
4-
tests/cases/compiler/complicatedPrivacy.ts(73,55): error TS2305: Module 'mglo5' has no exported member 'i6'.
4+
tests/cases/compiler/complicatedPrivacy.ts(73,55): error TS2694: Namespace 'mglo5' has no exported member 'i6'.
55

66

77
==== tests/cases/compiler/complicatedPrivacy.ts (4 errors) ====
@@ -85,7 +85,7 @@ tests/cases/compiler/complicatedPrivacy.ts(73,55): error TS2305: Module 'mglo5'
8585

8686
export class c_pr implements mglo5.i5, mglo5.i6 {
8787
~~
88-
!!! error TS2305: Module 'mglo5' has no exported member 'i6'.
88+
!!! error TS2694: Namespace 'mglo5' has no exported member 'i6'.
8989
f1() {
9090
return "Hello";
9191
}

‎tests/baselines/reference/exportSpecifierReferencingOuterDeclaration3.errors.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
tests/cases/compiler/exportSpecifierReferencingOuterDeclaration3.ts(6,30): error TS2305: Module 'X' has no exported member 'bar'.
1+
tests/cases/compiler/exportSpecifierReferencingOuterDeclaration3.ts(6,30): error TS2694: Namespace 'X' has no exported member 'bar'.
22

33

44
==== tests/cases/compiler/exportSpecifierReferencingOuterDeclaration3.ts (1 errors) ====
@@ -9,5 +9,5 @@ tests/cases/compiler/exportSpecifierReferencingOuterDeclaration3.ts(6,30): error
99
export function foo(): X.foo;
1010
export function bar(): X.bar; // error
1111
~~~
12-
!!! error TS2305: Module 'X' has no exported member 'bar'.
12+
!!! error TS2694: Namespace 'X' has no exported member 'bar'.
1313
}

‎tests/baselines/reference/exportSpecifierReferencingOuterDeclaration4.errors.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2_B.ts(4,34): error TS2305: Module 'X' has no exported member 'bar'.
1+
tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2_B.ts(4,34): error TS2694: Namespace 'X' has no exported member 'bar'.
22

33

44
==== tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2_A.ts (0 errors) ====
@@ -10,4 +10,4 @@ tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2_B.ts(4,34): err
1010
export declare function foo(): X.foo;
1111
export declare function bar(): X.bar; // error
1212
~~~
13-
!!! error TS2305: Module 'X' has no exported member 'bar'.
13+
!!! error TS2694: Namespace 'X' has no exported member 'bar'.

‎tests/baselines/reference/genericFunduleInModule.errors.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
tests/cases/compiler/genericFunduleInModule.ts(8,10): error TS2305: Module 'A' has no exported member 'B'.
1+
tests/cases/compiler/genericFunduleInModule.ts(8,10): error TS2694: Namespace 'A' has no exported member 'B'.
22

33

44
==== tests/cases/compiler/genericFunduleInModule.ts (1 errors) ====
@@ -11,5 +11,5 @@ tests/cases/compiler/genericFunduleInModule.ts(8,10): error TS2305: Module 'A' h
1111

1212
var b: A.B;
1313
~
14-
!!! error TS2305: Module 'A' has no exported member 'B'.
14+
!!! error TS2694: Namespace 'A' has no exported member 'B'.
1515
A.B(1);

‎tests/baselines/reference/genericFunduleInModule2.errors.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
tests/cases/compiler/genericFunduleInModule2.ts(11,10): error TS2305: Module 'A' has no exported member 'B'.
1+
tests/cases/compiler/genericFunduleInModule2.ts(11,10): error TS2694: Namespace 'A' has no exported member 'B'.
22

33

44
==== tests/cases/compiler/genericFunduleInModule2.ts (1 errors) ====
@@ -14,5 +14,5 @@ tests/cases/compiler/genericFunduleInModule2.ts(11,10): error TS2305: Module 'A'
1414

1515
var b: A.B;
1616
~
17-
!!! error TS2305: Module 'A' has no exported member 'B'.
17+
!!! error TS2694: Namespace 'A' has no exported member 'B'.
1818
A.B(1);

0 commit comments

Comments
 (0)