Drop redundant Widen operator from RHS of subtyping rule#130
Open
nikitabobko wants to merge 1 commit into
Open
Drop redundant Widen operator from RHS of subtyping rule#130nikitabobko wants to merge 1 commit into
nikitabobko wants to merge 1 commit into
Conversation
Statement 1: if (Widen(X) <: Widen(Y)) is true expression then Widen(X) <: Y stays true expression
Statement 2: There is no such X and Y that the both following expressions evaluate to true
Widen(X) <: Widen(Y) is false
Widen(X) <: Y is true
In general case, statement 2 is not valid
In our specific case where Widen is defined the way it's defined,
statement 2 is valid
Given that in our case statement 1 and statement 2 are both valid, Widen
is redundant in the RHS and confuses readers
Informally: the intention is to make the widened type more appealing for
the overload resolution, so only LHS should be widened
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Statement 1. if (Widen(X) <: Widen(Y)) is true expression then Widen(X) <: Y stays true expression
Statement 2. There is no such X and Y that the both following expressions evaluate to true
In general case, statement 2 is not valid. In our specific case where Widen is defined the way it's defined, statement 2 is valid
Given that in our case statement 1 and statement 2 are both valid, Widen is redundant in the RHS and confuses readers
Informally: the intention is to make the widened type more appealing for
the overload resolution, so only LHS should be widened