-
-
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
User-defined typeclasses or type aliases in generic procs cannot be distinct #24337
Comments
!nim c type Array2d[W, H: static[int]] = array[H, array[W, int]]
proc normal(a: Array2d, b: Array2d) =
echo len(a), ", ", len(b)
proc dist(a: Array2d, b: distinct Array2d) =
echo len(a), ", ", len(b)
proc doubleDist(a: distinct Array2d, b: distinct Array2d) =
echo len(a), ", ", len(b)
proc explicit[A, B: distinct Array2d](a: A, b: B) =
echo len(a), ", ", len(b)
let a = [[0, 1]]
let b = [[0, 1, 2]]
explicit(a, b)
doubleDist(a, b)
dist(a, b)
normal(a, b) |
🐧 Linux bisect by @ringabout (member)devel 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("Array2d"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("W"),
newIdentNode("H"),
nnkBracketExpr.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkBracketExpr.newTree(
newIdentNode("array"),
newIdentNode("H"),
nnkBracketExpr.newTree(
newIdentNode("array"),
newIdentNode("W"),
newIdentNode("int")
)
)
)
),
nnkProcDef.newTree(
newIdentNode("normal"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("Array2d"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("Array2d"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("a")
),
newLit(", "),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("b")
)
)
)
),
nnkProcDef.newTree(
newIdentNode("dist"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("Array2d"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
nnkDistinctTy.newTree(
newIdentNode("Array2d")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("a")
),
newLit(", "),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("b")
)
)
)
),
nnkProcDef.newTree(
newIdentNode("doubleDist"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkDistinctTy.newTree(
newIdentNode("Array2d")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
nnkDistinctTy.newTree(
newIdentNode("Array2d")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("a")
),
newLit(", "),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("b")
)
)
)
),
nnkProcDef.newTree(
newIdentNode("explicit"),
newEmptyNode(),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("A"),
newIdentNode("B"),
nnkDistinctTy.newTree(
newIdentNode("Array2d")
),
newEmptyNode()
)
),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("A"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("B"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("a")
),
newLit(", "),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("b")
)
)
)
),
nnkLetSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("a"),
newEmptyNode(),
nnkBracket.newTree(
nnkBracket.newTree(
newLit(0),
newLit(1)
)
)
)
),
nnkLetSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("b"),
newEmptyNode(),
nnkBracket.newTree(
nnkBracket.newTree(
newLit(0),
newLit(1),
newLit(2)
)
)
)
),
nnkCall.newTree(
newIdentNode("explicit"),
newIdentNode("a"),
newIdentNode("b")
),
nnkCall.newTree(
newIdentNode("doubleDist"),
newIdentNode("a"),
newIdentNode("b")
),
nnkCall.newTree(
newIdentNode("dist"),
newIdentNode("a"),
newIdentNode("b")
),
nnkCall.newTree(
newIdentNode("normal"),
newIdentNode("a"),
newIdentNode("b")
)
) stable 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("Array2d"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("W"),
newIdentNode("H"),
nnkBracketExpr.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkBracketExpr.newTree(
newIdentNode("array"),
newIdentNode("H"),
nnkBracketExpr.newTree(
newIdentNode("array"),
newIdentNode("W"),
newIdentNode("int")
)
)
)
),
nnkProcDef.newTree(
newIdentNode("normal"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("Array2d"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("Array2d"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("a")
),
newLit(", "),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("b")
)
)
)
),
nnkProcDef.newTree(
newIdentNode("dist"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("Array2d"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
nnkDistinctTy.newTree(
newIdentNode("Array2d")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("a")
),
newLit(", "),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("b")
)
)
)
),
nnkProcDef.newTree(
newIdentNode("doubleDist"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkDistinctTy.newTree(
newIdentNode("Array2d")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
nnkDistinctTy.newTree(
newIdentNode("Array2d")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("a")
),
newLit(", "),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("b")
)
)
)
),
nnkProcDef.newTree(
newIdentNode("explicit"),
newEmptyNode(),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("A"),
newIdentNode("B"),
nnkDistinctTy.newTree(
newIdentNode("Array2d")
),
newEmptyNode()
)
),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("A"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("B"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("a")
),
newLit(", "),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("b")
)
)
)
),
nnkLetSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("a"),
newEmptyNode(),
nnkBracket.newTree(
nnkBracket.newTree(
newLit(0),
newLit(1)
)
)
)
),
nnkLetSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("b"),
newEmptyNode(),
nnkBracket.newTree(
nnkBracket.newTree(
newLit(0),
newLit(1),
newLit(2)
)
)
)
),
nnkCall.newTree(
newIdentNode("explicit"),
newIdentNode("a"),
newIdentNode("b")
),
nnkCall.newTree(
newIdentNode("doubleDist"),
newIdentNode("a"),
newIdentNode("b")
),
nnkCall.newTree(
newIdentNode("dist"),
newIdentNode("a"),
newIdentNode("b")
),
nnkCall.newTree(
newIdentNode("normal"),
newIdentNode("a"),
newIdentNode("b")
)
) 2.0.10 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("Array2d"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("W"),
newIdentNode("H"),
nnkBracketExpr.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkBracketExpr.newTree(
newIdentNode("array"),
newIdentNode("H"),
nnkBracketExpr.newTree(
newIdentNode("array"),
newIdentNode("W"),
newIdentNode("int")
)
)
)
),
nnkProcDef.newTree(
newIdentNode("normal"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("Array2d"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("Array2d"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("a")
),
newLit(", "),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("b")
)
)
)
),
nnkProcDef.newTree(
newIdentNode("dist"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("Array2d"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
nnkDistinctTy.newTree(
newIdentNode("Array2d")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("a")
),
newLit(", "),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("b")
)
)
)
),
nnkProcDef.newTree(
newIdentNode("doubleDist"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkDistinctTy.newTree(
newIdentNode("Array2d")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
nnkDistinctTy.newTree(
newIdentNode("Array2d")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("a")
),
newLit(", "),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("b")
)
)
)
),
nnkProcDef.newTree(
newIdentNode("explicit"),
newEmptyNode(),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("A"),
newIdentNode("B"),
nnkDistinctTy.newTree(
newIdentNode("Array2d")
),
newEmptyNode()
)
),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("A"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("B"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("a")
),
newLit(", "),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("b")
)
)
)
),
nnkLetSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("a"),
newEmptyNode(),
nnkBracket.newTree(
nnkBracket.newTree(
newLit(0),
newLit(1)
)
)
)
),
nnkLetSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("b"),
newEmptyNode(),
nnkBracket.newTree(
nnkBracket.newTree(
newLit(0),
newLit(1),
newLit(2)
)
)
)
),
nnkCall.newTree(
newIdentNode("explicit"),
newIdentNode("a"),
newIdentNode("b")
),
nnkCall.newTree(
newIdentNode("doubleDist"),
newIdentNode("a"),
newIdentNode("b")
),
nnkCall.newTree(
newIdentNode("dist"),
newIdentNode("a"),
newIdentNode("b")
),
nnkCall.newTree(
newIdentNode("normal"),
newIdentNode("a"),
newIdentNode("b")
)
) 2.0.0 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("Array2d"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("W"),
newIdentNode("H"),
nnkBracketExpr.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkBracketExpr.newTree(
newIdentNode("array"),
newIdentNode("H"),
nnkBracketExpr.newTree(
newIdentNode("array"),
newIdentNode("W"),
newIdentNode("int")
)
)
)
),
nnkProcDef.newTree(
newIdentNode("normal"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("Array2d"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("Array2d"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("a")
),
newLit(", "),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("b")
)
)
)
),
nnkProcDef.newTree(
newIdentNode("dist"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("Array2d"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
nnkDistinctTy.newTree(
newIdentNode("Array2d")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("a")
),
newLit(", "),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("b")
)
)
)
),
nnkProcDef.newTree(
newIdentNode("doubleDist"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkDistinctTy.newTree(
newIdentNode("Array2d")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
nnkDistinctTy.newTree(
newIdentNode("Array2d")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("a")
),
newLit(", "),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("b")
)
)
)
),
nnkProcDef.newTree(
newIdentNode("explicit"),
newEmptyNode(),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("A"),
newIdentNode("B"),
nnkDistinctTy.newTree(
newIdentNode("Array2d")
),
newEmptyNode()
)
),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("A"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("B"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("a")
),
newLit(", "),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("b")
)
)
)
),
nnkLetSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("a"),
newEmptyNode(),
nnkBracket.newTree(
nnkBracket.newTree(
newLit(0),
newLit(1)
)
)
)
),
nnkLetSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("b"),
newEmptyNode(),
nnkBracket.newTree(
nnkBracket.newTree(
newLit(0),
newLit(1),
newLit(2)
)
)
)
),
nnkCall.newTree(
newIdentNode("explicit"),
newIdentNode("a"),
newIdentNode("b")
),
nnkCall.newTree(
newIdentNode("doubleDist"),
newIdentNode("a"),
newIdentNode("b")
),
nnkCall.newTree(
newIdentNode("dist"),
newIdentNode("a"),
newIdentNode("b")
),
nnkCall.newTree(
newIdentNode("normal"),
newIdentNode("a"),
newIdentNode("b")
)
) 1.6.20 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("Array2d"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("W"),
newIdentNode("H"),
nnkBracketExpr.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkBracketExpr.newTree(
newIdentNode("array"),
newIdentNode("H"),
nnkBracketExpr.newTree(
newIdentNode("array"),
newIdentNode("W"),
newIdentNode("int")
)
)
)
),
nnkProcDef.newTree(
newIdentNode("normal"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("Array2d"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("Array2d"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("a")
),
newLit(", "),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("b")
)
)
)
),
nnkProcDef.newTree(
newIdentNode("dist"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("Array2d"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
nnkDistinctTy.newTree(
newIdentNode("Array2d")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("a")
),
newLit(", "),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("b")
)
)
)
),
nnkProcDef.newTree(
newIdentNode("doubleDist"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkDistinctTy.newTree(
newIdentNode("Array2d")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
nnkDistinctTy.newTree(
newIdentNode("Array2d")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("a")
),
newLit(", "),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("b")
)
)
)
),
nnkProcDef.newTree(
newIdentNode("explicit"),
newEmptyNode(),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("A"),
newIdentNode("B"),
nnkDistinctTy.newTree(
newIdentNode("Array2d")
),
newEmptyNode()
)
),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("A"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("B"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("a")
),
newLit(", "),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("b")
)
)
)
),
nnkLetSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("a"),
newEmptyNode(),
nnkBracket.newTree(
nnkBracket.newTree(
newLit(0),
newLit(1)
)
)
)
),
nnkLetSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("b"),
newEmptyNode(),
nnkBracket.newTree(
nnkBracket.newTree(
newLit(0),
newLit(1),
newLit(2)
)
)
)
),
nnkCall.newTree(
newIdentNode("explicit"),
newIdentNode("a"),
newIdentNode("b")
),
nnkCall.newTree(
newIdentNode("doubleDist"),
newIdentNode("a"),
newIdentNode("b")
),
nnkCall.newTree(
newIdentNode("dist"),
newIdentNode("a"),
newIdentNode("b")
),
nnkCall.newTree(
newIdentNode("normal"),
newIdentNode("a"),
newIdentNode("b")
)
) 1.4.8 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("Array2d"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("W"),
newIdentNode("H"),
nnkBracketExpr.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkBracketExpr.newTree(
newIdentNode("array"),
newIdentNode("H"),
nnkBracketExpr.newTree(
newIdentNode("array"),
newIdentNode("W"),
newIdentNode("int")
)
)
)
),
nnkProcDef.newTree(
newIdentNode("normal"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("Array2d"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("Array2d"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("a")
),
newLit(", "),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("b")
)
)
)
),
nnkProcDef.newTree(
newIdentNode("dist"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("Array2d"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
nnkDistinctTy.newTree(
newIdentNode("Array2d")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("a")
),
newLit(", "),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("b")
)
)
)
),
nnkProcDef.newTree(
newIdentNode("doubleDist"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkDistinctTy.newTree(
newIdentNode("Array2d")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
nnkDistinctTy.newTree(
newIdentNode("Array2d")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("a")
),
newLit(", "),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("b")
)
)
)
),
nnkProcDef.newTree(
newIdentNode("explicit"),
newEmptyNode(),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("A"),
newIdentNode("B"),
nnkDistinctTy.newTree(
newIdentNode("Array2d")
),
newEmptyNode()
)
),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("A"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("B"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("a")
),
newLit(", "),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("b")
)
)
)
),
nnkLetSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("a"),
newEmptyNode(),
nnkBracket.newTree(
nnkBracket.newTree(
newLit(0),
newLit(1)
)
)
)
),
nnkLetSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("b"),
newEmptyNode(),
nnkBracket.newTree(
nnkBracket.newTree(
newLit(0),
newLit(1),
newLit(2)
)
)
)
),
nnkCall.newTree(
newIdentNode("explicit"),
newIdentNode("a"),
newIdentNode("b")
),
nnkCall.newTree(
newIdentNode("doubleDist"),
newIdentNode("a"),
newIdentNode("b")
),
nnkCall.newTree(
newIdentNode("dist"),
newIdentNode("a"),
newIdentNode("b")
),
nnkCall.newTree(
newIdentNode("normal"),
newIdentNode("a"),
newIdentNode("b")
)
) 1.2.18 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("Array2d"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("W"),
newIdentNode("H"),
nnkBracketExpr.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkBracketExpr.newTree(
newIdentNode("array"),
newIdentNode("H"),
nnkBracketExpr.newTree(
newIdentNode("array"),
newIdentNode("W"),
newIdentNode("int")
)
)
)
),
nnkProcDef.newTree(
newIdentNode("normal"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("Array2d"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("Array2d"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("a")
),
newLit(", "),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("b")
)
)
)
),
nnkProcDef.newTree(
newIdentNode("dist"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("Array2d"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
nnkDistinctTy.newTree(
newIdentNode("Array2d")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("a")
),
newLit(", "),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("b")
)
)
)
),
nnkProcDef.newTree(
newIdentNode("doubleDist"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkDistinctTy.newTree(
newIdentNode("Array2d")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
nnkDistinctTy.newTree(
newIdentNode("Array2d")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("a")
),
newLit(", "),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("b")
)
)
)
),
nnkProcDef.newTree(
newIdentNode("explicit"),
newEmptyNode(),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("A"),
newIdentNode("B"),
nnkDistinctTy.newTree(
newIdentNode("Array2d")
),
newEmptyNode()
)
),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("A"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("B"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("a")
),
newLit(", "),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("b")
)
)
)
),
nnkLetSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("a"),
newEmptyNode(),
nnkBracket.newTree(
nnkBracket.newTree(
newLit(0),
newLit(1)
)
)
)
),
nnkLetSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("b"),
newEmptyNode(),
nnkBracket.newTree(
nnkBracket.newTree(
newLit(0),
newLit(1),
newLit(2)
)
)
)
),
nnkCall.newTree(
newIdentNode("explicit"),
newIdentNode("a"),
newIdentNode("b")
),
nnkCall.newTree(
newIdentNode("doubleDist"),
newIdentNode("a"),
newIdentNode("b")
),
nnkCall.newTree(
newIdentNode("dist"),
newIdentNode("a"),
newIdentNode("b")
),
nnkCall.newTree(
newIdentNode("normal"),
newIdentNode("a"),
newIdentNode("b")
)
) 1.0.10 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("Array2d"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("W"),
newIdentNode("H"),
nnkBracketExpr.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkBracketExpr.newTree(
newIdentNode("array"),
newIdentNode("H"),
nnkBracketExpr.newTree(
newIdentNode("array"),
newIdentNode("W"),
newIdentNode("int")
)
)
)
),
nnkProcDef.newTree(
newIdentNode("normal"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("Array2d"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("Array2d"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("a")
),
newLit(", "),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("b")
)
)
)
),
nnkProcDef.newTree(
newIdentNode("dist"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("Array2d"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
nnkDistinctTy.newTree(
newIdentNode("Array2d")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("a")
),
newLit(", "),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("b")
)
)
)
),
nnkProcDef.newTree(
newIdentNode("doubleDist"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkDistinctTy.newTree(
newIdentNode("Array2d")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
nnkDistinctTy.newTree(
newIdentNode("Array2d")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("a")
),
newLit(", "),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("b")
)
)
)
),
nnkProcDef.newTree(
newIdentNode("explicit"),
newEmptyNode(),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("A"),
newIdentNode("B"),
nnkDistinctTy.newTree(
newIdentNode("Array2d")
),
newEmptyNode()
)
),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("A"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("B"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("a")
),
newLit(", "),
nnkCall.newTree(
newIdentNode("len"),
newIdentNode("b")
)
)
)
),
nnkLetSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("a"),
newEmptyNode(),
nnkBracket.newTree(
nnkBracket.newTree(
newLit(0),
newLit(1)
)
)
)
),
nnkLetSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("b"),
newEmptyNode(),
nnkBracket.newTree(
nnkBracket.newTree(
newLit(0),
newLit(1),
newLit(2)
)
)
)
),
nnkCall.newTree(
newIdentNode("explicit"),
newIdentNode("a"),
newIdentNode("b")
),
nnkCall.newTree(
newIdentNode("doubleDist"),
newIdentNode("a"),
newIdentNode("b")
),
nnkCall.newTree(
newIdentNode("dist"),
newIdentNode("a"),
newIdentNode("b")
),
nnkCall.newTree(
newIdentNode("normal"),
newIdentNode("a"),
newIdentNode("b")
)
) Stats
🤖 Bug found in |
IMO the solution is to add a type binding layer when matching |
Description
When defining a custom type alias or type class, the
distinct
keyword in argument position seems to not do anything as implied in the manual. It neither works with explicit nor implicit generics.Nim Version
Nim Compiler Version 2.2.0 [Windows: amd64]
Compiled at 2024-10-02
Copyright (c) 2006-2024 by Andreas Rumpf
Current Output
Expected Output
Known Workarounds
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: