-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Use transparent inline in the library #8756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use transparent inline in the library #8756
Conversation
8447ab2
to
a8a1a4a
Compare
And add deprecation warnings for old syntax
a8a1a4a
to
2548798
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -8,7 +8,7 @@ object DottyPredef { | |||
assertFail(message) | |||
} | |||
|
|||
inline final def assert(inline assertion: Boolean) <: Unit = { | |||
transparent inline final def assert(inline assertion: Boolean): Unit = { | |||
if (!assertion) | |||
assertFail() | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I miss something here, what is the purpose of making this white box, as the result type is Unit
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you write assert(false) the inclined expression becomes of type Nothing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is like a ??? With a message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this should be supported thought
Co-Authored-By: Jens <[email protected]>
The first commit contains the interesting changes. The second only updates the syntax in the tests to make sure that the new version works properly.