We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
julia> g(args...) = h(args...) g (generic function with 1 method) julia> h(f, args...) = f(args...) h (generic function with 1 method) julia> f(T, y) = g(getfield, g(tuple, T, y), 1) f (generic function with 1 method) julia> @code_typed f(AbstractFloat, 1) CodeInfo( 1 ─ %1 = Main.tuple::Const(tuple, false) │ %2 = (%1)(T, y)::Tuple{DataType,Int64} │ %3 = Main.getfield::Const(getfield, false) │ %4 = (%3)(%2, 1)::DataType └── return %4 ) => DataType julia> k(T, y) = getfield(tuple(T, y), 1) k (generic function with 1 method) julia> @code_typed k(AbstractFloat, 1) CodeInfo( 1 ─ return AbstractFloat ) => Type{AbstractFloat} julia> versioninfo() Julia Version 1.1.0-DEV.843 Commit a0bc8fdb75 (2018-12-08 18:35 UTC) Platform Info: OS: macOS (x86_64-apple-darwin17.5.0) CPU: Intel(R) Core(TM) i7-7920HQ CPU @ 3.10GHz WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
MWE from Cassette; I'd like the output of f(...) to be inferred as Type{AbstractFloat} (the same as k(...))
f(...)
Type{AbstractFloat}
k(...)
The text was updated successfully, but these errors were encountered:
To be more clear:
julia> @code_typed optimize=false f(AbstractFloat, 1) CodeInfo( 1 ─ %1 = (Main.g)(Main.tuple, T, y)::Tuple{DataType,Int64} │ %2 = (Main.g)(Main.getfield, %1, 1)::DataType └── return %2 ) => DataType julia> @code_typed optimize=false k(AbstractFloat, 1) CodeInfo( 1 ─ %1 = (Main.tuple)(T, y)::PartialTuple(Tuple{DataType,Int64}, Any[Const(AbstractFloat, false), Int64]) │ %2 = (Main.getfield)(%1, 1)::Const(AbstractFloat, false) └── return %2 ) => Type{AbstractFloat}
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
MWE from Cassette; I'd like the output of
f(...)
to be inferred asType{AbstractFloat}
(the same ask(...)
)The text was updated successfully, but these errors were encountered: