Skip to content

Commit cfa00d3

Browse files
committed
revert the Base.infer_return_type part of the change for this PR
1 parent 024075a commit cfa00d3

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/internals.jl

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,7 @@ module Internals
22

33
import StableTasks: @spawn, @spawnat, @fetch, @fetchfrom, StableTask, AtomicRef
44

5-
# * use `Base.infer_return_type` in preference to `Core.Compiler.return_type`
6-
# * safe conservative fallback to `Any`, which is subtyped by each type
75
if (
8-
isdefined(Base, :infer_return_type) &&
9-
applicable(Base.infer_return_type, identity, Tuple{})
10-
)
11-
infer_return_type(@nospecialize f::Any) = Base.infer_return_type(f, Tuple{})
12-
elseif (
136
(@isdefined Core) &&
147
(Core isa Module) &&
158
isdefined(Core, :Compiler) &&
@@ -19,6 +12,7 @@ elseif (
1912
)
2013
infer_return_type(@nospecialize f::Any) = Core.Compiler.return_type(f, Tuple{})
2114
else
15+
# safe conservative fallback to `Any`, which is subtyped by each type
2216
infer_return_type(@nospecialize f::Any) = Any
2317
end
2418

0 commit comments

Comments
 (0)