Skip to content

Commit f4faa43

Browse files
authored
remove type piracy from == defined in Compiler (JuliaLang#56541)
`Compiler.:(==)` is now identical to `Base.:(==)`, so the following `==` methods defined in typelattice.jl are considered type piracy: https://github.com/JuliaLang/julia/blob/1edc6f1b7752ed67059020ba7ce174dffa225954/Compiler/src/typelattice.jl#L194-L197 In fact, loading `Compiler` as a standard library with this code can sometimes result in errors like the following: ```julia julia> using Compiler julia> Int == Core.Const(1) ERROR: MethodError: ==(::Type{Int64}, ::Core.Const) is ambiguous. ... ``` Since these `==` definitions no longer seem necessary, this commit simply removes them to resolve the issue. @nanosoldier `runbenchmarks("inference", vs=":master")`
1 parent 088b88a commit f4faa43

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

src/typelattice.jl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,6 @@ struct NotFound end
191191

192192
const NOT_FOUND = NotFound()
193193

194-
const CompilerTypes = Union{Const, Conditional, MustAlias, NotFound, PartialStruct}
195-
==(x::CompilerTypes, y::CompilerTypes) = x === y
196-
==(x::Type, y::CompilerTypes) = false
197-
==(x::CompilerTypes, y::Type) = false
198-
199194
#################
200195
# lattice logic #
201196
#################

0 commit comments

Comments
 (0)