-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Emit mixin forwarders as ordinary, non-bridge methods again #23942
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
a0a98ec
fix: do not emit mixin forwarders for inline accessors
hamzaremmal 63e2904
Revert "Don't emit mixin forwarders as final"
sjrd ff15bed
Revert "Emit mixin forwarders as bridges"
sjrd 7efbac6
Add test case for #19270.
sjrd f99dba2
Emit Java generic signatures for mixin forwarders.
sjrd d7c0248
Mixins were not the only bridges. Bridges must actually not be final.
sjrd c38c317
chore: drop Mixin forwarders related MiMA filters
hamzaremmal f4330f0
fix: disable MiMa for non-bootstrapped scala-library, reference compi…
hamzaremmal 17c93cc
chore: update `scala-parallel-collection`
jchyb aa267b2
fix: avoid #23961 in the `sbt-bridge`
hamzaremmal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Submodule scala-parallel-collections
updated
114 files
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
public class A_2 extends C<String> { } |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class B[A] | ||
sealed trait T[A] { | ||
def overloaded(that: List[T[A]]): T[A] = that.head | ||
def overloaded(that: List[B[A]]): B[A] = that.head | ||
} | ||
abstract class C[A] extends T[A] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
public class A_2 extends C { } |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
trait T { this: U => | ||
def m: Int | ||
} | ||
trait U { | ||
def m: Int = ??? | ||
} | ||
abstract class C extends U with T |
18 changes: 18 additions & 0 deletions
18
tests/pos/mixin-generic-extended-by-java/ExtensionId_1.scala
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
trait Extension | ||
|
||
class ClassicActorSystemProvider | ||
|
||
/** | ||
* Identifies an Extension | ||
* Lookup of Extensions is done by object identity, so the Id must be the same wherever it's used, | ||
* otherwise you'll get the same extension loaded multiple times. | ||
*/ | ||
trait ExtensionId[T <: Extension] { | ||
|
||
def get(system: ClassicActorSystemProvider): T = ??? | ||
} | ||
|
||
/** | ||
* Java API for ExtensionId | ||
*/ | ||
abstract class AbstractExtensionId[T <: Extension] extends ExtensionId[T] |
8 changes: 8 additions & 0 deletions
8
tests/pos/mixin-generic-extended-by-java/JavaExtension_2.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
public class JavaExtension_2 { | ||
static class TestExtensionId extends AbstractExtensionId<TestExtension> { | ||
} | ||
|
||
static class TestExtension implements Extension { | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// scalajs: --skip | ||
|
||
trait T { | ||
def foo(x: Int): Int = x + 1 | ||
} | ||
|
||
class C extends T | ||
|
||
object Test { | ||
def main(args: Array[String]): Unit = { | ||
println("i19270") | ||
val m = classOf[C].getDeclaredMethod("foo", classOf[Int]) | ||
assert(m.getDeclaringClass() == classOf[C], m.getDeclaringClass()) | ||
assert(!m.isBridge(), "foo should not have the ACC_BRIDGE flag") | ||
assert(!m.isSynthetic(), "foo should not have the ACC_SYNTHETIC flag") | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// scalajs: --skip | ||
|
||
trait Foo { | ||
def getFoo() = "foo" | ||
} | ||
|
||
class Sub extends Foo { | ||
def getBar() = "bar" | ||
} | ||
|
||
object Test { | ||
def main(args: Array[String]): Unit = { | ||
val ms = classOf[Sub].getDeclaredMethods | ||
assert(ms forall (x => !x.isBridge), ms mkString " ") | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
trait EventLike | ||
|
||
trait GrandParent: | ||
def changed: EventLike | ||
|
||
trait HasChanged extends GrandParent: | ||
override def changed: EventLike | ||
|
||
abstract class Parent extends GrandParent: | ||
object changed extends EventLike | ||
|
||
class Child extends Parent with HasChanged | ||
|
||
object Test: | ||
def main(args: Array[String]): Unit = | ||
val child = Child() | ||
println(child.changed) | ||
println((child: HasChanged).changed) | ||
end Test |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Why not None