-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
bugSomething isn't workingSomething isn't working
Description
In Constantine the following type used to be deserializable.
https://github.com/mratsim/constantine/blob/023e690/tests/t_ec_sage_template.nim#L95-L100
type
TestVector*[EC: ECP_ShortW_Aff] = object
id: int
P: EC
scalar: matchingScalar(EC)
Q: ECIt now breaks mratsim/constantine#113

The stacktrace points to getTypeInst
nim-serialization/serialization/object_serialization.nim
Lines 98 to 104 in 4e2ffe3
| for field in recordFields(typeImpl): | |
| if field.readPragma("dontSerialize") != nil: | |
| continue | |
| let | |
| fieldType = field.typ | |
| FieldTypeSym = getTypeInst(fieldType) |
/home/beta/Programming/Nim/constantine/tests/t_ec_sage_bls12_377.nim(18, 28) template/generic instantiation of `run_scalar_mul_test_vs_sage` from here
/home/beta/Programming/Nim/constantine/tests/t_ec_sage_template.nim(192, 26) template/generic instantiation of `loadVectors` from here
/home/beta/Programming/Nim/constantine/tests/t_ec_sage_template.nim(178, 16) template/generic instantiation of `loadFile` from here
/home/beta/.nimble/pkgs/serialization-0.1.0/serialization.nim(96, 11) template/generic instantiation of `readValue` from here
/home/beta/.nimble/pkgs/serialization-0.1.0/serialization.nim(46, 9) template/generic instantiation of `readValue` from here
/home/beta/.nimble/pkgs/json_serialization-0.1.0/json_serialization/reader.nim(497, 11) template/generic instantiation of `totalSerializedFields` from here
/home/beta/.nimble/pkgs/serialization-0.1.0/serialization/object_serialization.nim(179, 36) template/generic instantiation of `totalSerializedFieldsImpl` from here
/home/beta/.nimble/pkgs/serialization-0.1.0/serialization/object_serialization.nim(176, 26) template/generic instantiation of `enumAllSerializedFields` from here
/home/beta/.nimble/pkgs/serialization-0.1.0/serialization/object_serialization.nim(153, 32) template/generic instantiation of `enumAllSerializedFieldsImpl` from here
/home/beta/.nimble/pkgs/serialization-0.1.0/serialization/object_serialization.nim(104, 33) Error: cannot instantiate TestVector
got: <EC: ECP_ShortW_Aff>
but expected: <EC: ECP_ShortW_Aff>
Another instance of nim-lang/RFCs#44
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working