Skip to content

Conversation

@abeln
Copy link
Contributor

@abeln abeln commented Feb 14, 2019

Change the definition of lub so that:

  • lub(C, {Null, Nothing}) = C if C is a reference type
  • lub(C, {Null, Nothing}) = Object if C is a value type (as before)

This allows us to generate more efficient code, and it better
matches the user's expectations.

Change the definition of lub so that:
  - lub(C, {Null, Nothing}) = C if C is a reference type
  - lub(C, {Null, Nothing}) = Object if C is a value type (as before)

This allows us to generate more efficient code, and it better
matches the user's expectations.
@abeln abeln requested a review from odersky February 14, 2019 19:00
}
}
def erasedLub(tp1: Type, tp2: Type)(implicit ctx: Context): Type = {
// After erasure, C | {Null, Nothing} is just C, if C is a reference type.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The diff is misleading: I only added the check at the start, but since the pattern matching expressions is no longer at the top level the whole thing is highlighted.

@odersky odersky merged commit 1e74e9d into scala:master Feb 15, 2019
@ghost ghost removed the stat:needs review label Feb 15, 2019
@abeln abeln deleted the erase-bottom branch March 4, 2019 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants