Nim
Nim copied to clipboard
fix #7955 fully specialized generic failed at array construction
fix #7955
related: #7956 (test case covered by t4799_2.nim t4799_3.nim )
TODO:
[typ1, base, typ2]
should be CT error
Feel free to change the test case but beware that important packages keep working. :-)
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 ?
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.
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.
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.
succeed by https://github.com/nim-lang/Nim/pull/20612