Closed
Description
/cc @cooldome #13347 introduced a regression:
isNamedTuple(MyGenericTuple[int]) is now false
Example
type Foo3[T] = tuple[x:int, y: T]
echo isNamedTuple(Foo3[int8])
Current Output
false
Expected Output
true
Additional Information
- root cause of CI failure for replace old problematic isNamedTuple implementation by TypeTrait isNamedTuple in dollars.nim #13347
- regression introduced in distinctBase type trait for distinct types #13031
- the old implementation i wrote didn't have this issue:
proc isNamedTuple(T: typedesc): bool =
when T isnot tuple: result = false
else:
var t: T
for name, _ in t.fieldPairs:
when name == "Field0":
return compiles(t.Field0)
else:
return true
return false
however it had subtle issues so #13031 is good, but the code in semmagic.nim needs to fix this
Metadata
Metadata
Assignees
Labels
No labels