My take at limiting the `T` inside the `SomeObject` definition
type
SomeObject[T : SomeNumber] = object
val: T
#ex3
template test3(typ: typedesc = float) : untyped =
echo "type is ", $typ
let res = 10.typ
SomeObject[typ](val: res)
#doesn't work
echo test3(pointer)
#works
echo test3()
echo test3(int)
echo test3(float)
echo test3(byte)
Run
- typedesc with subtype won't compile when returning objects vitreo12
- Re: typedesc with subtype won't compile when returning ob... GordonBGood
- Re: typedesc with subtype won't compile when returnin... vitreo12
- Re: typedesc with subtype won't compile when retu... lucian
