There was an error while loading. Please reload this page.
1 parent fad20c2 commit 4c6d9f9Copy full SHA for 4c6d9f9
1 file changed
teal/check/context.tl
@@ -2362,24 +2362,7 @@ end
2362
2363
function Context:infer_lambda_parameters(node: Node, expected: FunctionType)
2364
-- safety first
2365
- if not expected then
2366
- return
2367
- end
2368
-
2369
- -- normalize expected type safely
2370
- expected = self:to_structural(expected)
2371
2372
- -- unwrap PolyType (common in Teal)
2373
- if expected is PolyType then
2374
- expected = expected.types[1]
2375
2376
2377
- -- must be function after normalization
2378
- if not (expected is FunctionType) then
2379
2380
2381
2382
- if expected.typename ~= "function" then
+ if not expected or expected.typename ~= "function" then
2383
return
2384
end
2385
0 commit comments