-
-
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
Cannot infer the value of static parameters in certain cases (regression 2.1.1 → 2.2.0) #24708
Comments
Happens in Still bisecting just in case there's a deeper issue |
!nim c type Matrix[m, n: static int] = array[m * n, float]
func `[]`(A: Matrix, i, j: int): float =
A[A.n * i + j]
func `[]`(A: var Matrix, i, j: int): var float =
A[A.n * i + j]
func `*`[m, n, p: static int](A: Matrix[m, n], B: Matrix[n, p]): Matrix[m, p] =
for i in 0 ..< m:
for k in 0 ..< p:
for j in 0 ..< n:
result[i, k] += A[i, j] * B[j, k]
let A: Matrix[2, 2] = [-1, 1, 0, -1]
echo(A * A) |
🐧 Linux bisect by @metagn (collaborator)devel 👎 FAILOutput
Filesize stable 👎 FAILOutput
Filesize 2.2.2 👎 FAILOutput
Filesize 2.0.0 👍 OKOutput
Filesize 1.6.20 👍 OKOutput
Filesize 1.4.8 👎 FAILOutput
Filesize 1.2.18 👎 FAILOutput
Filesize 1.0.10 👎 FAILOutput
Filesize #ccc7c45d7 ➡️ 🐛Diagnosticsryan mcconnell introduced a bug at
The bug is in the files:
The bug can be in the commits: (Diagnostics sometimes off-by-one). Stats
🤖 Bug found in |
Description
The following program works correctly in Nim 2.1.1:
However, in Nim 2.2.0 it fails to compile with the error shown below.
Nim Version
Current Output
Expected Output
Known Workarounds
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: