-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Make -> sugar an inline method
#24728
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
base: main
Are you sure you want to change the base?
Conversation
|
I made it [error] -- [E007] Type Mismatch Error: .../library/src/scala/collection/package.scala:71:16
[error] 71 | else Some(t.head -> t.tail)
[error] | ^^^^^^^^^^^^^^^^
[error] | Found: (A^'s1, C^{y$proxy1})
[error] | Required: (A, C)
[error] |
[error] | Note that capability y$proxy1 is not included in capture set {}.
[error] |---------------------------------------------------------------------------
[error] |Inline stack trace
[error] |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[error] |This location contains code that was inlined from Predef.scala:616
[error] 616 | inline def -> [B](y: B): (A, B) = (self, y)
[error] | ^^^^^^^^^
[error] ---------------------------------------------------------------------------
[error] |
[error] | longer explanation available when compiling with `-explain` |
73da792 to
e62b7ae
Compare
|
|
||
| // extension method sugar --------------------------------------------- | ||
| extension[A] (self: A) | ||
| transparent inline def -> [B](y: B): (A, B) = (self, y) |
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.
This should really be a non-transparent. If it bothers CC, then CC must adapt.
Making this transparent inline has a huge cost in terms of compatibility guarantees. That should be avoided basically at all cost.
ok then lets say blocked by #24729 |
e62b7ae to
15b7d6c
Compare
Must wait for 3.10.0 currently it is transparent inline, to avoid inline proxy objects appearing in capture sets and breaking type checking.
15b7d6c to
69e9222
Compare
Must wait for 3.10.0
currently it is transparent inline, to avoid inline proxy objects appearing in capture sets and breaking type checking.
fixes #24715