-
-
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 #10073 #10080
fix #10073 #10080
Conversation
looks like this PR helps a bit, but still fails in following case: proc foo[N: static int](dims: array[N, int]): auto =
const N1 = N
let temp = N # works
let temp2 = (a:N)
temp2
echo foo([1, 2]) # now is ok
doAssert foo([1, 2]) == (a:2) # Error: type mismatch: got <tuple[a: static[int](2)], tuple[a: int]>
|
|
=> we can discuss that here: https://github.com/nim-lang/Nim/issues/10085 |
/cc @Araq removing the WIP label to unblock this PR, the workaround for clients is simple enough (add |
That doesn't help much.
|
that unblocks #10070 (otherwise I'd need to change the test )
there's a test that relies on it, see #9046 (./tests/vm/tissues.nim) added by @LemonBoy
not sure I understand that point; I assumed by the time it reaches codegen, |
But |
I still dont' understand; how is that different from behavior of const Foo1 = 10
proc fun(foo4: bool, Foo5: static bool) =
const Foo2 = 11
let foo3 = 12
let a = (Foo1, Foo2, foo3, foo4, Foo5) # works
echo a
fun(true, true) the expression in which |
A more proper fix has been pushed here: #10218 |
thanks a bunch @zah I verified it also passes this: #10080 (comment) ; closing this in favor of your PR |
static int
element #10073links
static int
when used in tuple #9043 and PR Fix for VM codegen with static[T] types #9046