Skip to content

Commit cdfcbc1

Browse files
committed
Merge pull request #890 from dotty-staging/fix-#879
Fix #879
2 parents ac34748 + 125831b commit cdfcbc1

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
10271027
*/
10281028
def ensureConstrCall(cls: ClassSymbol, parents: List[Tree])(implicit ctx: Context): List[Tree] = {
10291029
val firstParent :: otherParents = parents
1030-
if (firstParent.isType && !(cls is Trait))
1030+
if (firstParent.isType && !(cls is Trait) && !cls.is(JavaDefined))
10311031
typed(untpd.New(untpd.TypedSplice(firstParent), Nil)) :: otherParents
10321032
else parents
10331033
}

tests/pos/java-interop/i879.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class Foo {
2+
Foo(int i) {
3+
}
4+
}
5+
6+
7+
class Bar extends Foo {
8+
Bar() {
9+
super(10);
10+
}
11+
}

0 commit comments

Comments
 (0)