Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #20588 #21101

Closed
wants to merge 1 commit into from
Closed

fix #20588 #21101

wants to merge 1 commit into from

Conversation

bung87
Copy link
Collaborator

@bung87 bung87 commented Dec 15, 2022

fix #20588

from my point of view auto is not suitable as function call

@@ -3024,6 +3024,8 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}, expectedType: PType
of nkCall, nkInfix, nkPrefix, nkPostfix, nkCommand, nkCallStrLit:
# check if it is an expression macro:
checkMinSonsLen(n, 1, c.config)
if n[0].kind == nkIdent and n[0].ident.id == ord(wAuto):
Copy link
Member

@Araq Araq Dec 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't know at this point that auto was not redefined to be a proc overriding system.auto. Stop hacking special cases into the compiler. This a fix for semConv and it needs to check for more than just auto. For example untyped(4) or typed("abc) are likewise illegal constructs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow,I debug into serveral places haven't found it goes to semConv, I'll create a fix in next PR.

@bung87 bung87 closed this Dec 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error: internal error: getTypeDescAux(tyFromExpr) when using auto + arc, works with refc
2 participants