Closed NHDaly closed 2 years ago
The right way to test that julia can type infer a function's return type is to use the @inferred macro from Test, not @code_typed.
@inferred
Test
@code_typed
This expands to a call to Base.return_types() and checks that the function returned a value with the same exact concrete type that julia inferred.
Base.return_types()
This lets us drop the dependencies on Compat, which were broken in more recent versions of julia
The right way to test that julia can type infer a function's return type is to use the
@inferred
macro fromTest
, not@code_typed
.This expands to a call to
Base.return_types()
and checks that the function returned a value with the same exact concrete type that julia inferred.This lets us drop the dependencies on Compat, which were broken in more recent versions of julia