-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 issue #13063 #19165
Fix issue #13063 #19165
Conversation
@treeform
type Foo = object
template `?`(a: Foo, b: untyped): untyped = 123
type Bar = object
x1: int
var b: Bar
echo b?x
Is is correct to treat type Foo = object
template `.`(a: Foo, b: untyped): untyped = 123
type Bar = object
x1: int
var b: Bar
echo b.x differently than type Foo = object
template `?`(a: Foo, b: untyped): untyped = 123
type Bar = object
x1: int
var b: Bar
echo b?x ? Are we deciding to treat it differently because it is overloading the already heavily used dot operator? What if the user tried to make a dot override, but they made a typo. Wouldn't the override error message be useful then? Should both errors be output? Like:
I just reread #13063 and it states: in addition to the above errmsg Error: type mismatch: got ... The times I have debugged the compiler, I've really needed a debugger. However, if you set a breakpoint somwhere, it will get hit a bazillion times before it gets to the point where the sample code of interest is being compiled. type Foo = object
template `.`(a: Foo, b: untyped): untyped = 123
type Bar = object
x1: int
var b: Bar
echo b.x # put your cursor here and then hit F5 to start the debugger The debugger will now skip that breakpoint until module |
Should errors for The dot operator is really nice but because it shows up in every error now, makes me not want to use it. |
This pull request has been automatically marked as stale because it has not had recent activity. If you think it is still a valid PR, please rebase it on the latest devel; otherwise it will be closed. Thank you for your contributions. |
#13063 is fixed now (I think), so should be fine to close. |
No description provided.