File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -668,8 +668,12 @@ static void jl_compilation_sig(
668
668
also matching all other TypeConstructors. This means neither
669
669
Type{TC} nor TypeConstructor is more specific.
670
670
*/
671
- if (!* newparams ) * newparams = jl_svec_copy (tt -> parameters );
672
- jl_svecset (* newparams , i , jl_type_type );
671
+ // don't apply this heuristic if the argument is called (issue #36783)
672
+ int iscalled = i_arg > 0 && i_arg <= 8 && (definition -> called & (1 << (i_arg - 1 )));
673
+ if (!iscalled ) {
674
+ if (!* newparams ) * newparams = jl_svec_copy (tt -> parameters );
675
+ jl_svecset (* newparams , i , jl_type_type );
676
+ }
673
677
}
674
678
else if (jl_is_type_type (jl_tparam0 (elt )) &&
675
679
// try to give up on specializing type parameters for Type{Type{Type{...}}}
@@ -874,14 +878,15 @@ JL_DLLEXPORT int jl_isa_compileable_sig(
874
878
}
875
879
876
880
if (jl_is_type_type (jl_unwrap_unionall (elt ))) {
881
+ int iscalled = i_arg > 0 && i_arg <= 8 && (definition -> called & (1 << (i_arg - 1 )));
877
882
if (jl_types_equal (elt , (jl_value_t * )jl_type_type )) {
878
- if (very_general_type (decl_i ))
883
+ if (! iscalled && very_general_type (decl_i ))
879
884
continue ;
880
885
if (i >= nargs && definition -> isva )
881
886
continue ;
882
887
return 0 ;
883
888
}
884
- if (very_general_type (decl_i ))
889
+ if (! iscalled && very_general_type (decl_i ))
885
890
return 0 ;
886
891
if (!jl_is_datatype (elt ))
887
892
return 0 ;
You can’t perform that action at this time.
0 commit comments