diff --git a/source/lib/compiler.ts b/source/lib/compiler.ts index 3ca4e21d..5f58cda6 100644 --- a/source/lib/compiler.ts +++ b/source/lib/compiler.ts @@ -59,6 +59,7 @@ const expectErrorDiagnosticCodesToIgnore = new Set([ DiagnosticCode.AcceptsTooFewArgumentsToBeUsedAsDecoratorHere, DiagnosticCode.PropertyDoesNotExistOnTypeDidYouMean, DiagnosticCode.ErrorIsOfTypeUnknown, + DiagnosticCode.TwoDifferentTypesSameName, ]); type IgnoreDiagnosticResult = 'preserve' | 'ignore' | Location; diff --git a/source/lib/interfaces.ts b/source/lib/interfaces.ts index f2c56883..c9aab8b8 100644 --- a/source/lib/interfaces.ts +++ b/source/lib/interfaces.ts @@ -58,6 +58,7 @@ export enum DiagnosticCode { IndexSignatureOnlyPermitsReading = 2542, NoOverloadExpectsCountOfArguments = 2575, ThisContextOfTypeNotAssignableToMethodOfThisType = 2684, + TwoDifferentTypesSameName = 2719, Type1IsMissingPropertiesFromType2Variant1 = 2739, Type1IsMissingPropertiesFromType2Variant2 = 2740, PropertyMissingInType1ButRequiredInType2 = 2741, diff --git a/source/test/fixtures/expect-error/missing-diagnostic-code/index.test-d.ts b/source/test/fixtures/expect-error/missing-diagnostic-code/index.test-d.ts index 5b6a7d59..5b716875 100644 --- a/source/test/fixtures/expect-error/missing-diagnostic-code/index.test-d.ts +++ b/source/test/fixtures/expect-error/missing-diagnostic-code/index.test-d.ts @@ -6,3 +6,16 @@ expectError(one('foo', 'bar')); // 'Found an error that tsd does not currently support (`ts2304`), consider creating an issue on GitHub.' expectError(undeclared = one('foo', 'bar')); + +// ts2719 +interface T {} +declare const a: T; +expectError(class Foo { + x: T; + constructor(a: T) { + this.x = a; + } + fn() { + this.x = a; + } +})