Skip to content

Commit f7d28ee

Browse files
authored
Port TS PR 60566 (@import * as namespace cannot be used with @implements) (#1260)
1 parent 0d266e6 commit f7d28ee

File tree

3 files changed

+2
-30
lines changed

3 files changed

+2
-30
lines changed

internal/ast/utilities.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3032,7 +3032,7 @@ func IsJSDocSingleCommentNode(node *Node) bool {
30323032
}
30333033

30343034
func IsValidTypeOnlyAliasUseSite(useSite *Node) bool {
3035-
return useSite.Flags&NodeFlagsAmbient != 0 ||
3035+
return useSite.Flags&(NodeFlagsAmbient|NodeFlagsJSDoc) != 0 ||
30363036
IsPartOfTypeQuery(useSite) ||
30373037
isIdentifierInNonEmittingHeritageClause(useSite) ||
30383038
isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(useSite) ||

testdata/baselines/reference/submodule/conformance/importTag23.errors.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/b.js(5,18): error TS1361: 'NS' cannot be used as a value because it was imported using 'import type'.
21
/b.js(6,14): error TS2420: Class 'C' incorrectly implements interface 'I'.
32
Property 'foo' is missing in type 'C' but required in type 'I'.
43

@@ -8,15 +7,12 @@
87
foo(): void;
98
}
109

11-
==== /b.js (2 errors) ====
10+
==== /b.js (1 errors) ====
1211
/**
1312
* @import * as NS from './a'
1413
*/
1514

1615
/** @implements {NS.I} */
17-
~~
18-
!!! error TS1361: 'NS' cannot be used as a value because it was imported using 'import type'.
19-
!!! related TS1376 /b.js:2:17: 'NS' was imported here.
2016
export class C {}
2117
~
2218
!!! error TS2420: Class 'C' incorrectly implements interface 'I'.

testdata/baselines/reference/submoduleAccepted/conformance/importTag23.errors.txt.diff

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)