You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I strongly suspect this explains a few of other issues related to untped ...
EDIT: indeed, it's root cause for #14827 plus other issues listed there.
an untyped param is incorrectly reported as typed (nnkSym) when the caller is overloaded
callsite on the other hand correctly reports the AST as untyped
this is the root cause for the CI failure in #17156 when (undone in b81a987) when let checked = conditions was attempted in place of let checked = callsite()[1] (ie, callsite was required to make it work for the reduced example refs #17156 (comment)).
this is a bit tricky. What's probably happening is that when compiler semchecks check2(b3), since check2 is overloaded, it runs sigmatch to pick the correct overload, which (currently) involves sem-checking the params (b3); by that point b3 is a typed AST.
For some reason callsite is correct, so the compiler must be caching the original AST somewhere.
proposed solution
make sigmatch smarter so that it avoids semchecking a param that's untyped if it can determine it's ok to do so;
TODO: elaborate on details...
The text was updated successfully, but these errors were encountered:
timotheecour
changed the title
untyped param is typed when caller is overloadeduntyped param is typed when there's an overload with a typed param in same position
Feb 24, 2021
I strongly suspect this explains a few of other issues related to
untped
...EDIT: indeed, it's root cause for #14827 plus other issues listed there.
callsite
on the other hand correctly reports the AST as untypedthis is the root cause for the CI failure in #17156 when (undone in b81a987) when
let checked = conditions
was attempted in place oflet checked = callsite()[1]
(ie,callsite
was required to make it work for the reduced example refs #17156 (comment)).Example
Current Output
Expected Output
all Sym should be Ident
Additional Information
1.5.1 c274e67
this is a bit tricky. What's probably happening is that when compiler semchecks
check2(b3)
, sincecheck2
is overloaded, it runs sigmatch to pick the correct overload, which (currently) involves sem-checking the params (b3); by that point b3 is a typed AST.For some reason
callsite
is correct, so the compiler must be caching the original AST somewhere.proposed solution
make sigmatch smarter so that it avoids semchecking a param that's untyped if it can determine it's ok to do so;
TODO: elaborate on details...
The text was updated successfully, but these errors were encountered: