Add testcase for #16897 (#16917)

This commit is contained in:
Clyybber
2021-02-02 21:43:02 +01:00
committed by GitHub
parent 7b9b76d840
commit e4ad0ae5c4

View File

@@ -467,3 +467,36 @@ block misc_issues:
# anyway and will be an error soon.
var a: Cat = Cat()
a.sayHello()
# bug #16897
type
Fp[N: static int, T] = object
big: array[N, T]
type
QuadraticExt* = concept x
## Quadratic Extension concept (like complex)
type BaseField = auto
x.c0 is BaseField
x.c1 is BaseField
var address = pointer(nil)
proc prod(r: var QuadraticExt, b: QuadraticExt) =
if address == nil:
address = unsafeAddr b
prod(r, b)
else:
assert address == unsafeAddr b
type
Fp2[N: static int, T] {.byref.} = object
c0, c1: Fp[N, T]
# This should be passed by reference,
# but concepts do not respect the 24 bytes rule
# or `byref` pragma.
var r, b: Fp2[6, uint64]
prod(r, b)