-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
Description
VM breaks at trying to execute volume
procedure:
type
Vec3*[T: SomeNumber] {.bycopy.} = tuple[x, y, z: T]
func volume*[T](v: Vec3[T]): T =
when T is SomeUnsignedInt:
v.x * v.y * v.z
else:
abs (v.x * v.y * v.z)
type
Matrix3*[C: static Vec3[uint], T] = object
cells: array[C.area, T]
let m = Matrix3[(1.uint, 1.uint, 1.uint), uint](cells: [0.uint])
Nim Version
1.6.8
Current Output
/usercode/in.nim(7, 15) Error: cannot generate VM code for *
Expected Output
Successful compilation.
Possible Solution
No response
Additional Information
Changing 'volume' func to template fixes the problem, so, breaking probably happens on procedure boundaries.
Metadata
Metadata
Assignees
Labels
No labels