-
-
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
Using generic static[int] as parameter in another static[...] parameter #4990
Comments
Seems just another static[T] bug. |
Possibly the same bug, maybe a different one: type
Foo*[A: static[int], B: static[int], TokenType: enum, EofToken: static[TokenType]] = object
curIndex: int
MyEnum = enum
meA, meB
Bar = Foo[2, 3, MyEnum, meA]
proc next*[A: static[int], B: static[int], TokenType: enum,
EofToken: static[TokenType]](f: Foo[A, B, TokenType, EofToken],
a: static[(array[A, int], array[B, int])]): TokenType =
TokenType(a[0][f.curIndex])
const
a = [1, 2]
b = [3, 4, 5]
template next*(bar: Bar): MyEnum =
next(Foo[2, 3, MyEnum, meA](bar), (a, b))
let bar = Bar(curIndex: 0)
echo bar.next() Yields:
The interesting thing is that this only happens if |
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. |
This yields:
Is this a bug or is it impossible to get working?
The text was updated successfully, but these errors were encountered: