Skip to content

Commit 40c329b

Browse files
committed
Revert "Reallow ill-kinded but JavaDefined parents (scala#5010)"
This reverts commit 1fe1232 as it was an incorrect diagnosis. The only existing testcase was written when AbstractListModel had no parameter, so change the testcase instead. We could alternatively infer type arguments (see scala/bug#11111), but that seems typically unhelpful.
1 parent 1fe1232 commit 40c329b

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1524,8 +1524,7 @@ class Typer extends Namer
15241524
ctx.error(i"$psym is extended twice", tree.pos)
15251525
seenParents += psym
15261526
if (tree.isType) {
1527-
if (!psym.is(JavaDefined))
1528-
checkSimpleKinded(result) // Not needed for constructor calls, as type arguments will be inferred.
1527+
checkSimpleKinded(result) // Not needed for constructor calls, as type arguments will be inferred.
15291528
if (psym.is(Trait) && !cls.is(Trait) && !cls.superClass.isSubClass(psym))
15301529
result = maybeCall(result, psym, psym.primaryConstructor.info)
15311530
}

tests/run/t3613.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ class Boopy {
22
private val s = new Schnuck
33
def observer : PartialFunction[ Any, Unit ] = s.observer
44

5-
private class Schnuck extends javax.swing.AbstractListModel {
5+
private class Schnuck extends javax.swing.AbstractListModel[Nothing] {
66
model =>
77
val observer : PartialFunction[ Any, Unit ] = {
88
case "Boopy" => fireIntervalAdded( model, 0, 1 )

0 commit comments

Comments
 (0)