mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-14 19:16:17 -06:00
Fix implement interface codefix for synthetic member symbols (#35718)
This commit is contained in:
parent
2eb60c2cb2
commit
aef2e0a238
@ -34,7 +34,7 @@ namespace ts.codefix {
|
||||
}
|
||||
|
||||
function symbolPointsToNonPrivateMember (symbol: Symbol) {
|
||||
return !(getModifierFlags(symbol.valueDeclaration) & ModifierFlags.Private);
|
||||
return !symbol.valueDeclaration || !(getModifierFlags(symbol.valueDeclaration) & ModifierFlags.Private);
|
||||
}
|
||||
|
||||
function addMissingDeclarations(
|
||||
|
||||
30
tests/cases/fourslash/codefixClassImplementInterface_omit.ts
Normal file
30
tests/cases/fourslash/codefixClassImplementInterface_omit.ts
Normal file
@ -0,0 +1,30 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
////interface One {
|
||||
//// a: number;
|
||||
//// b: string;
|
||||
////}
|
||||
////
|
||||
////interface Two extends Omit<One, "a"> {
|
||||
//// c: boolean;
|
||||
////}
|
||||
////
|
||||
////class TwoStore implements Two {[| |]}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'Two'",
|
||||
newFileContent:
|
||||
`interface One {
|
||||
a: number;
|
||||
b: string;
|
||||
}
|
||||
|
||||
interface Two extends Omit<One, "a"> {
|
||||
c: boolean;
|
||||
}
|
||||
|
||||
class TwoStore implements Two {
|
||||
c: boolean;
|
||||
b: string;
|
||||
}`,
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user