-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix #24912 #24913
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
base: devel
Are you sure you want to change the base?
fix #24912 #24913
Conversation
not technically necessary but I isolated a bit from tparser_generator. |
Seems like both the first and the last commits will work for addressing the issue. I think the first commit is a work around, but it is simpler. The last commit delays conversions and I've thought to trial overload resolution before but since it's expensive it has been better to just avoid it. Not this time. I also don't know yet if delaying |
compiler/semcall.nim
Outdated
# repeat the overload resolution, | ||
# this time enabling all the diagnostic output (this should fail again) | ||
result = semOverloadedCall(c, n, nOrig, filter, flags + {efExplain}) | ||
elif efNoUndeclared notin flags: | ||
result = nil | ||
notFoundError(c, n, errors) | ||
if efPreferNilResult notin flags: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe reuse efNoUndeclared
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure about this one either. Another option might be to pass through errorsEnabled
as it is in resolveOverloads
and see if disabling the errors with this flag has bad side effects, but that doesn't sound great either. I'll use efNoUndeclared
instead if I end up sticking with this.
edit: yea not sure how I missed that one
#24912
Although this appears to work as far as I know the method is kinda dumb, frankly. I know the dot expression can have complexities but I have wondered a couple times why the compiler doesn't often transform the call similar to this and toss it into
semDirectOp
. If anyone cares to enlighten me I'll listen.Right now this checks for
tyTyepDescr
explicitly but I'm thinking that it would make more sense to check if the field access is looking at aproc
type, but maybe I'll commit again and check that out after I see how this goes.