3 ms·
I would be interested to read how they made it work, given that it seems to violate the principle of type-stability. Did they just implement the slow runtime ty
by rcthompson 6y ago
I would be interested to read how they made it work, given that it seems to violate the principle of type-stability. Did they just implement the slow runtime type check, or did they do something clever?
- dklend122 6y agoI think it's parsed specially, but I could be wrong. Definitely no runtime check
- improbable22 6y agoIt goes to `literal_pow`, one way to check is to overload this: Base.literal_pow(::typeof(^), x::Int, ::Val{n}) where {n} = (println("power $n"); float(x)^n) pow = -5 2^-5 # yes 2^pow # no, hence an error