The following code seems to confuse the compiler.
import typetraits
type
TFix[T] = distinct T
var t0 = cast[TFix[TFix[int]]](10)
var t1 = cast[TFix[TFix[float]]](69.69)
echo(t0.type.name)
echo(t1.type.name)
The following types are echoed.....
TFix[TFix[int]]
TFix[TFix[int]]
The second should be TFix[TFix[float]]
I have already filed a bug for this. I'm wondering if any of the experts(Zahary :-)) have any comments on this. Should the compiler be able to support this?
Should the compiler be able to support this?
It doesn't make too much sense, but it should be allowed for generic programming.
This should be working for the actors lib also.
TActor[TIn, TOut] = object{.pure, final.}
i: TChannel[TTask[TIn, TOut]]
t: TThread[ptr TActor[TIn, TOut]]