To reproduce:
function f<T>(anon n: u64) -> T {
let v: T = n as! T
return v
}
function main() {
let value: f64 = f<f64>(1u64)
println("{}", value)
}
Error message:
runtime/Jakt/TypeCasts.h:23:12: error: 'double' is not a class type
return dynamic_cast<CopyConst<InputType, OutputType>*>(&input);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
runtime/Jakt/TypeCasts.h:50:12: note: in instantiation of function template specialization 'Jakt::is<double, const unsigned long>' requested here
VERIFY(is<OutputType>(input));
^
runtime/Jakt/Assertions.h:13:20: note: expanded from macro 'VERIFY'
# define VERIFY assert
^
build/Test-Generic-Return-Float.cpp:9:14: note: in instantiation of function template specialization 'Jakt::verify_cast<double, const unsigned long>' requested here
const T v = (verify_cast<T>((n)));
^
build/Test-Generic-Return-Float.cpp:16:19: note: in instantiation of function template specialization 'Jakt::f<double>' requested here
const f64 value = f<f64>(static_cast<u64>(1ULL));
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too