Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4683,7 +4683,8 @@ namespace ts {
else if (isJSDocPropertyTag(declaration)
|| isPropertyAccessExpression(declaration)
|| isIdentifier(declaration)
|| isMethodDeclaration(declaration) && !isObjectLiteralMethod(declaration)) {
|| (isMethodDeclaration(declaration) && !isObjectLiteralMethod(declaration))
|| isMethodSignature(declaration)) {
// TODO: Mimics old behavior from incorrect usage of getWidenedTypeForVariableLikeDeclaration, but seems incorrect
type = tryGetTypeFromEffectiveTypeNode(declaration) || anyType;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//// [methodSignatureHandledDeclarationKindForSymbol.ts]
interface Foo {
bold(): string;
}

interface Foo {
bold: string;
}



//// [methodSignatureHandledDeclarationKindForSymbol.js]
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
=== tests/cases/compiler/methodSignatureHandledDeclarationKindForSymbol.ts ===
interface Foo {
>Foo : Symbol(Foo, Decl(methodSignatureHandledDeclarationKindForSymbol.ts, 0, 0), Decl(methodSignatureHandledDeclarationKindForSymbol.ts, 2, 1))

bold(): string;
>bold : Symbol(Foo.bold, Decl(methodSignatureHandledDeclarationKindForSymbol.ts, 0, 15), Decl(methodSignatureHandledDeclarationKindForSymbol.ts, 4, 15))
}

interface Foo {
>Foo : Symbol(Foo, Decl(methodSignatureHandledDeclarationKindForSymbol.ts, 0, 0), Decl(methodSignatureHandledDeclarationKindForSymbol.ts, 2, 1))

bold: string;
>bold : Symbol(Foo.bold, Decl(methodSignatureHandledDeclarationKindForSymbol.ts, 0, 15), Decl(methodSignatureHandledDeclarationKindForSymbol.ts, 4, 15))
}


Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
=== tests/cases/compiler/methodSignatureHandledDeclarationKindForSymbol.ts ===
interface Foo {
>Foo : Foo

bold(): string;
>bold : string
}

interface Foo {
>Foo : Foo

bold: string;
>bold : string
}


Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
interface Foo {
bold(): string;
}

interface Foo {
bold: string;
}