Skip to content

Commit 179a9a1

Browse files
authored
more conservative promote_rule for Some (#58836)
1 parent fd52126 commit 179a9a1

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

base/some.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ end
1414

1515
Some(::Type{T}) where {T} = Some{Type{T}}(T)
1616

17-
promote_rule(::Type{Some{T}}, ::Type{Some{S}}) where {T, S<:T} = Some{T}
18-
1917
nonnothingtype(@nospecialize(T::Type)) = typesplit(T, Nothing)
2018
promote_rule(T::Type{Nothing}, S::Type) = Union{S, Nothing}
2119
function promote_rule(T::Type{>:Nothing}, S::Type)

test/some.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## promote()
44

55
@test promote_type(Some{Int}, Some{Float64}) == Some
6-
@test promote_type(Some{Int}, Some{Real}) == Some{Real}
6+
@test promote_type(Some{Int}, Some{Real}) == Some
77
@test promote_type(Some{Int}, Nothing) == Union{Some{Int},Nothing}
88

99
## convert()

0 commit comments

Comments
 (0)