-
-
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
scope based symbol resolution; fixes generic sandwich problem; fix #13747, #17965, #13970: declarations at non-module scope now work with generics #18050
Conversation
status as of e425f0c: nim CI passes, 3 packages broken |
71ff07d
to
8c4cf3f
Compare
Very interesting solution but I don't really understand what it implies for the spec. Please write an RFC or at least patch the manual to reflect your approach. |
This does not actually fix #11225 from what I can tell. |
8c4cf3f
to
cf10455
Compare
compiler/debugutils.nim
Outdated
@@ -4,7 +4,23 @@ Utilities to help with debugging nim compiler. | |||
Experimental API, subject to change. | |||
]## | |||
|
|||
#[ |
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'll revert the changes to this file once the rest of the PR is accepted; I don't want to keep adding/reverting those locally (these changes make debugging easier)
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.
As I said, please explain your solution, somewhere.
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.
it's on my short-list TODO list
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.
Friendly ping.
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.
d557746
to
c365213
Compare
c365213
to
ad2c750
Compare
ad2c750
to
fea7ab0
Compare
02e906f
to
68a42b6
Compare
…0519T113112 fix zero_functional for nim-lang/Nim#18050
PTAL, all important_packages now pass (each package that needed patching involved a tiny patch, typically adding a mixin, and the patch made sense in each case) |
Sorry, I missed this remark. The change must first be opt-in regardless. |
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. |
this PR fixes long standing major usability issues with generics
note
proc test(f: TFoo2) = echo "2"
would be hidden; that was an artifact of moving it at block scope; after this PR, it now works properly and doesn't ignore these even if at block scopeExample 1
before PR
(eg: devel 1.5.1: 7f077a7)
nim r main
passesnim r main
makes theval == 1
assert fail if you uncommentconst val = 2
nim r main
works again if you moveconst val = 2; bar(0)
at block or proc scope.after PR
Error: undeclared identifier: 'val'
mixin val
, the CT errors go awayconst val = 2
is uncommented) is used regardless whether it's at module scope, block scope or proc scopeExample 2
(related to zevv/npeg#33 and mratsim/Arraymancer#508)
similar to Example 1 but with:
before PR
NPegException
is not defined in stack.nimafter PR:
mixin NPegException
insidestack.grow
Example 3
(related to status-im/nim-stint#107)
before PR:
string
string
after PR:
int
float
Example 4
(related to #13747)
before PR
CT error:
Error: undeclared identifier: 'foo'
even though it was mixed inafter PR
works
future work
CI failures
all the PR's i sent are forward and backward compatible
items
iterator #11167)pkg "pixie", useHead = false
=>pkg "pixie", useHead = true
to take effect)