Nim icon indicating copy to clipboard operation
Nim copied to clipboard

fix #7955 fully specialized generic failed at array construction

Open bung87 opened this issue 2 years ago • 2 comments

fix #7955

related: #7956 (test case covered by t4799_2.nim t4799_3.nim )

TODO: [typ1, base, typ2] should be CT error

bung87 avatar Sep 21 '22 04:09 bung87

Feel free to change the test case but beware that important packages keep working. :-)

Araq avatar Sep 21 '22 06:09 Araq

Feel free to change the test case but beware that important packages keep working. :-)

okay, I'll do that, also previous behavior assuming developer want fill element same as previous type, after this the error message should change, do you have suggesstion what's the message would like ?

bung87 avatar Sep 21 '22 07:09 bung87

found commonType just works fine, the problem is when the result[i] goes to fitNode -> paramTypesMatchAux -> typeRel, it doesn't count commonSuperClass as commonType did.

bung87 avatar Oct 15 '22 17:10 bung87

Sorry but that's just hacking stuff together until the test case works and nothing else breaks. What is a tfCommonType flag? It's certainly not a property of the type system.

Araq avatar Oct 21 '22 07:10 Araq

the semArrayConstr query the common base type of elements and take it as element type. if this patch does not work as expected then I assuming the test case is invalid.

bung87 avatar Oct 21 '22 07:10 bung87

succeed by https://github.com/nim-lang/Nim/pull/20612

bung87 avatar Oct 21 '22 13:10 bung87