@@ -1585,25 +1585,25 @@ function return_type_tfunc(interp::AbstractInterpreter, argtypes::Vector{Any}, s
1585
1585
if isa (rt, Const)
1586
1586
# output was computed to be constant
1587
1587
return Const (typeof (rt. val))
1588
+ end
1589
+ rt = widenconst (rt)
1590
+ if rt === Bottom || (isconcretetype (rt) && ! iskindtype (rt))
1591
+ # output cannot be improved so it is known for certain
1592
+ return Const (rt)
1593
+ elseif ! isempty (sv. pclimitations)
1594
+ # conservatively express uncertainty of this result
1595
+ # in two ways: both as being a subtype of this, and
1596
+ # because of LimitedAccuracy causes
1597
+ return Type{<: rt }
1598
+ elseif (isa (tt, Const) || isconstType (tt)) &&
1599
+ (isa (aft, Const) || isconstType (aft))
1600
+ # input arguments were known for certain
1601
+ # XXX : this doesn't imply we know anything about rt
1602
+ return Const (rt)
1603
+ elseif isType (rt)
1604
+ return Type{rt}
1588
1605
else
1589
- inaccurate = nothing
1590
- rt isa LimitedAccuracy && (inaccurate = rt. causes; rt = rt. typ)
1591
- rt = widenconst (rt)
1592
- if hasuniquerep (rt) || rt === Bottom
1593
- # output type was known for certain
1594
- return Const (rt)
1595
- elseif inaccurate != = nothing
1596
- return LimitedAccuracy (Type{<: rt }, inaccurate)
1597
- elseif (isa (tt, Const) || isconstType (tt)) &&
1598
- (isa (aft, Const) || isconstType (aft))
1599
- # input arguments were known for certain
1600
- # XXX : this doesn't imply we know anything about rt
1601
- return Const (rt)
1602
- elseif isType (rt)
1603
- return Type{rt}
1604
- else
1605
- return Type{<: rt }
1606
- end
1606
+ return Type{<: rt }
1607
1607
end
1608
1608
end
1609
1609
end
0 commit comments