@@ -63,7 +63,6 @@ namespace ts.codefix {
63
63
const visibilityModifier = createVisibilityModifier ( getEffectiveModifierFlags ( declaration ) ) ;
64
64
const modifiers = visibilityModifier ? factory . createNodeArray ( [ visibilityModifier ] ) : undefined ;
65
65
const type = checker . getWidenedType ( checker . getTypeOfSymbolAtLocation ( symbol , enclosingDeclaration ) ) ;
66
- const optional = ! ! ( symbol . flags & SymbolFlags . Optional ) ;
67
66
const ambient = ! ! ( enclosingDeclaration . flags & NodeFlags . Ambient ) || isAmbient ;
68
67
const quotePreference = getQuotePreference ( sourceFile , preferences ) ;
69
68
@@ -83,7 +82,7 @@ namespace ts.codefix {
83
82
/*decorators*/ undefined ,
84
83
modifiers ,
85
84
name ,
86
- optional ? factory . createToken ( SyntaxKind . QuestionToken ) : undefined ,
85
+ /*questionOrExclamationToken*/ undefined ,
87
86
typeNode ,
88
87
/*initializer*/ undefined ) ) ;
89
88
break ;
@@ -158,14 +157,14 @@ namespace ts.codefix {
158
157
}
159
158
else {
160
159
Debug . assert ( declarations . length === signatures . length , "Declarations and signatures should match count" ) ;
161
- addClassElement ( createMethodImplementingSignatures ( checker , context , enclosingDeclaration , signatures , name , optional , modifiers , quotePreference , body ) ) ;
160
+ addClassElement ( createMethodImplementingSignatures ( checker , context , enclosingDeclaration , signatures , name , /* optional*/ false , modifiers , quotePreference , body ) ) ;
162
161
}
163
162
}
164
163
break ;
165
164
}
166
165
167
166
function outputMethod ( quotePreference : QuotePreference , signature : Signature , modifiers : NodeArray < Modifier > | undefined , name : PropertyName , body ?: Block ) : void {
168
- const method = createSignatureDeclarationFromSignature ( SyntaxKind . MethodDeclaration , context , quotePreference , signature , body , name , modifiers , optional , enclosingDeclaration , importAdder ) ;
167
+ const method = createSignatureDeclarationFromSignature ( SyntaxKind . MethodDeclaration , context , quotePreference , signature , body , name , modifiers , /* optional*/ false , enclosingDeclaration , importAdder ) ;
169
168
if ( method ) addClassElement ( method ) ;
170
169
}
171
170
}
0 commit comments