-
-
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
Expressions in type definitions are evaluated before type parameters are bound #1969
Comments
surely this is another good example of generic early evaluation syndrom similar to #5540 |
This issue has been automatically marked as stale because it has not had recent activity. If you think it is still a valid issue, write a comment below; otherwise it will be closed. Thank you for your contributions. |
using type ZeroGenerator = object
proc next(g:ZeroGenerator):int = 0
type TripleLike[Generator] = tuple
a,b: typeof(new(Generator)[].next())
c: typeof(default(Generator).next()) |
Seems to work now probably because of #23983 |
metagn
added a commit
to metagn/Nim
that referenced
this issue
Aug 29, 2024
closes nim-lang#1969, closes nim-lang#7737, closes nim-lang#11838, closes nim-lang#12283, closes nim-lang#14053, closes nim-lang#16118, closes nim-lang#19670, closes nim-lang#22645
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm not sure if this is intended behavior or a bug. There is a workaround, but it's somewhat awkward: you can compute extra types in constructor/initializer routines, though this may lead to extraneous type parameters. e.g this:
becomes this:
The text was updated successfully, but these errors were encountered: