Make -> sugar an inline method#24728
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
now thats fixed |
15b7d6c to
69e9222
Compare
69e9222 to
f3da9d9
Compare
| inline def runtimeChecked: x.type @RuntimeChecked = x: @RuntimeChecked | ||
|
|
||
| // extension method sugar --------------------------------------------- | ||
| extension[A] (inline self: A) |
There was a problem hiding this comment.
I believe it's better to put it in the package object scala instead.
There was a problem hiding this comment.
scala package is really only for exporting forwarders is it not?
-> is an additional sugar
|
@bishabosha might be worth a rebase, we're entering 3.10. |
f3da9d9 to
6567d1d
Compare
|
@Gedochao rebased |
7dc413f to
830590e
Compare
|
potential problem, it looks like in 830590e that trying to import from Predef explicitly will bias in favor of |
Must wait for 3.10.0
currently it is transparent inline, to avoid inline proxy objects appearing in capture sets and breaking type checking.now it follows the design:
based on #25175
requires to introduce the change in src-bootstrapped (until rebootstrapping)
fixes #24715