Open
Description
Nim Version
2.2
Description
Generic parameters can be given defaults, but actually using the default is evasive.
type Aaa[F: static int = 0] = object
echo default(Aaa[0]) # works
# echo default(Aaa[]) # error
# echo default(Aaa) # error
type Bbb[T = void] = object
echo default(Bbb[void])
# echo default(Bbb[]) # error
# echo default(Bbb) # error
# Skipping the second parameter works
type Ccc[T, X = void] = object
echo default(Ccc[void])
Not sure which syntax is most reasonable, but probably the one with []
.
Current Output
Expected Output
Known Workarounds
No response
Additional Information
No response
Metadata
Metadata
Assignees
Labels
No labels