Skip to content

Fix isJavaOverride test #17096

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 1 commit into from
Mar 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion compiler/src/dotty/tools/dotc/transform/ElimRepeated.scala
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ class ElimRepeated extends MiniPhase with InfoTransformer { thisPhase =>
* signatures of a Java varargs method and a Scala varargs override are not the same.
*/
private def overridesJava(sym: Symbol)(using Context) =
sym.owner.info.baseClasses.drop(1).exists { bc =>
sym.memberCanMatchInheritedSymbols
&& sym.owner.info.baseClasses.drop(1).exists { bc =>
bc.is(JavaDefined) && {
val other = bc.info.nonPrivateDecl(sym.name)
other.hasAltWith { alt =>
Expand Down
2 changes: 2 additions & 0 deletions tests/pos/i17066/Bar.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Bar extends Foo:
def this(xs: String*) = this()
3 changes: 3 additions & 0 deletions tests/pos/i17066/Foo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
public class Foo {
public Foo(String... xs) { }
}