File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -2160,7 +2160,17 @@ func (c *Checker) getExplicitTypeOfSymbol(symbol *ast.Symbol, diagnostic *ast.Di
2160
2160
}
2161
2161
2162
2162
func (c * Checker ) isDeclarationWithExplicitTypeAnnotation (node * ast.Node ) bool {
2163
- return (ast .IsVariableDeclaration (node ) || ast .IsPropertyDeclaration (node ) || ast .IsPropertySignatureDeclaration (node ) || ast .IsParameter (node )) && node .Type () != nil
2163
+ return (ast .IsVariableDeclaration (node ) || ast .IsPropertyDeclaration (node ) || ast .IsPropertySignatureDeclaration (node ) || ast .IsParameter (node )) && node .Type () != nil ||
2164
+ c .isExpandoPropertyFunctionWithReturnTypeAnnotation (node )
2165
+ }
2166
+
2167
+ func (c * Checker ) isExpandoPropertyFunctionWithReturnTypeAnnotation (node * ast.Node ) bool {
2168
+ if ast .IsBinaryExpression (node ) {
2169
+ if expr := node .AsBinaryExpression ().Right ; ast .IsFunctionLike (expr ) && expr .Type () != nil {
2170
+ return true
2171
+ }
2172
+ }
2173
+ return false
2164
2174
}
2165
2175
2166
2176
func (c * Checker ) hasTypePredicateOrNeverReturnType (sig * Signature ) bool {
You can’t perform that action at this time.
0 commit comments