File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 3535 Base. @pure pass_by_value (T) = isbitstype (T)
3636end
3737
38+ if VERSION >= v " 1.8.0-DEV.1460"
39+ # Restriction from https://github.com/JuliaLang/julia/pull/43953
40+ Base. @pure pass_by_value_ret (T) = isbitstype (T)
41+ else
42+ Base. @pure pass_by_value_ret (T) = pass_by_value (T)
43+ end
44+
3845Base. @pure is_singleton (@nospecialize (T)) = isdefined (T, :instance )
3946# Base.@pure get_instance(@nospecialize(T)) = Base.getfield(T, :instance)
4047
6168
6269# Convert return type and generates cfunction signatures
6370Base. @pure map_rettype (T) =
64- (pass_by_value (T) || T === Any || is_singleton (T)) ? T : Ref{T}
71+ (pass_by_value_ret (T) || T === Any || is_singleton (T)) ? T : Ref{T}
6572Base. @pure function map_cfunc_argtype (T)
6673 if is_singleton (T)
6774 return Ref{T}
Original file line number Diff line number Diff line change 8181 @test identityF64Int (1 ) === 1.0
8282 @test identityF64Int (1.0 ) === 1.0
8383end
84+
85+ struct InlineRefStruct
86+ x:: Vector{Int}
87+ end
88+
89+ @testset " Inline struct with Ref" begin
90+ f = @inferred FunctionWrapper {InlineRefStruct,Tuple{InlineRefStruct}} (identity)
91+ v = InlineRefStruct ([1 , 2 , 3 ])
92+ @test @inferred (f (v)) === v
93+ end
You can’t perform that action at this time.
0 commit comments