File tree 1 file changed +11
-6
lines changed
1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -304,18 +304,20 @@ func (res *CheckResult) checkDuplicateVars(variableName parser.Variable, decl pa
304
304
}
305
305
}
306
306
307
- func (res * CheckResult ) checkFnCall (fnCall parser.FnCall , requiredType string ) {
308
- resolution , ok := Builtins [ fnCall . Caller . Name ]
309
- if ok {
310
- resolution , ok := resolution .( VarOriginFnCallResolution )
311
- if ok {
307
+ func (res * CheckResult ) checkFnCall (fnCall parser.FnCall ) string {
308
+ returnType := TypeAny
309
+
310
+ if resolution , ok := Builtins [ fnCall . Caller . Name ]; ok {
311
+ if resolution , ok := resolution .( VarOriginFnCallResolution ); ok {
312
312
res .fnCallResolution [fnCall .Caller ] = resolution
313
- res . assertHasType ( & fnCall , requiredType , resolution .Return )
313
+ returnType = resolution .Return
314
314
}
315
315
}
316
316
317
317
// this must come after resolution
318
318
res .checkFnCallArity (& fnCall )
319
+
320
+ return returnType
319
321
}
320
322
321
323
func (res * CheckResult ) checkExpression (lit parser.ValueExpr , requiredType string ) {
@@ -381,6 +383,9 @@ func (res *CheckResult) checkTypeOf(lit parser.ValueExpr, typeHint string) strin
381
383
case * parser.StringLiteral :
382
384
return TypeString
383
385
386
+ case * parser.FnCall :
387
+ return res .checkFnCall (* lit )
388
+
384
389
default :
385
390
return TypeAny
386
391
}
You can’t perform that action at this time.
0 commit comments