mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Fixed JSDoc checking on enum members (#61184)
This commit is contained in:
@@ -47166,7 +47166,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
|
||||
checkCollisionsForDeclarationName(node, node.name);
|
||||
checkExportsOnMergedDeclarations(node);
|
||||
node.members.forEach(checkEnumMember);
|
||||
node.members.forEach(checkSourceElement);
|
||||
|
||||
if (compilerOptions.erasableSyntaxOnly && !(node.flags & NodeFlags.Ambient)) {
|
||||
error(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
|
||||
@@ -48367,6 +48367,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
return checkTypeAliasDeclaration(node as TypeAliasDeclaration);
|
||||
case SyntaxKind.EnumDeclaration:
|
||||
return checkEnumDeclaration(node as EnumDeclaration);
|
||||
case SyntaxKind.EnumMember:
|
||||
return checkEnumMember(node as EnumMember);
|
||||
case SyntaxKind.ModuleDeclaration:
|
||||
return checkModuleDeclaration(node as ModuleDeclaration);
|
||||
case SyntaxKind.ImportDeclaration:
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
//// [tests/cases/conformance/jsdoc/jsdocLinkTag9.ts] ////
|
||||
|
||||
=== /a.ts ===
|
||||
export interface A {}
|
||||
>A : Symbol(A, Decl(a.ts, 0, 0))
|
||||
|
||||
=== /b.ts ===
|
||||
import type { A } from "./a";
|
||||
>A : Symbol(A, Decl(b.ts, 0, 13))
|
||||
|
||||
export enum Enum {
|
||||
>Enum : Symbol(Enum, Decl(b.ts, 0, 29))
|
||||
|
||||
/**
|
||||
* {@link A}
|
||||
*/
|
||||
EnumValue,
|
||||
>EnumValue : Symbol(Enum.EnumValue, Decl(b.ts, 2, 18))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
//// [tests/cases/conformance/jsdoc/jsdocLinkTag9.ts] ////
|
||||
|
||||
=== /a.ts ===
|
||||
|
||||
export interface A {}
|
||||
|
||||
=== /b.ts ===
|
||||
import type { A } from "./a";
|
||||
>A : A
|
||||
> : ^
|
||||
|
||||
export enum Enum {
|
||||
>Enum : Enum
|
||||
> : ^^^^
|
||||
|
||||
/**
|
||||
* {@link A}
|
||||
*/
|
||||
EnumValue,
|
||||
>EnumValue : Enum.EnumValue
|
||||
> : ^^^^^^^^^^^^^^
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
// @strict: true
|
||||
// @noUnusedLocals: true
|
||||
// @noEmit: true
|
||||
|
||||
// @filename: /a.ts
|
||||
export interface A {}
|
||||
|
||||
// @filename: /b.ts
|
||||
import type { A } from "./a";
|
||||
|
||||
export enum Enum {
|
||||
/**
|
||||
* {@link A}
|
||||
*/
|
||||
EnumValue,
|
||||
}
|
||||
Reference in New Issue
Block a user