File tree Expand file tree Collapse file tree 4 files changed +32
-3
lines changed
src/compiler/scala/tools/nsc Expand file tree Collapse file tree 4 files changed +32
-3
lines changed Original file line number Diff line number Diff line change @@ -189,7 +189,7 @@ abstract class TreeBrowsers {
189189 }
190190 }
191191
192- jTree.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener () {
192+ jTree.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener {
193193 def valueChanged (e : javax.swing.event.TreeSelectionEvent ): Unit = {
194194 textArea.setText(e.getPath().getLastPathComponent().toString)
195195 infoPanel.update(e.getPath().getLastPathComponent())
Original file line number Diff line number Diff line change @@ -1587,7 +1587,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
15871587 val decodedtpt = app.callee
15881588 val argssAreTrivial = argss == Nil || argss == ListOfNil
15891589
1590- // we cannot avoid cyclic references with `initialize` here, because when type macros arrive,
1590+ // we cannot avoid cyclic references with `initialize` here, because when type macros arrive [sic] ,
15911591 // we'll have to check the probe for isTypeMacro anyways.
15921592 // therefore I think it's reasonable to trade a more specific "inherits itself" error
15931593 // for a generic, yet understandable "cyclic reference" error
@@ -1599,7 +1599,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
15991599
16001600 def cookIfNeeded (tpt : Tree ) = if (context.unit.isJava) tpt modifyType rawToExistential else tpt
16011601 cookIfNeeded(if (probe.isTrait || inMixinPosition) {
1602- if (! argssAreTrivial ) {
1602+ if (! argss.isEmpty ) {
16031603 if (probe.isTrait) ConstrArgsInParentWhichIsTraitError (encodedtpt, probe)
16041604 else () // a class in a mixin position - this warrants an error in `validateParentClasses`
16051605 // therefore here we do nothing, e.g. don't check that the # of ctor arguments
Original file line number Diff line number Diff line change 1+ t6805.scala:4: error: trait T is a trait; does not take constructor arguments
2+ class C extends T() // error
3+ ^
4+ t6805.scala:7: error: trait T is a trait; does not take constructor arguments
5+ class Y extends X with T() // error
6+ ^
7+ t6805.scala:10: error: trait T is a trait; does not take constructor arguments
8+ def t: T = new T() {} // error
9+ ^
10+ t6805.scala:11: error: trait T is abstract; cannot be instantiated
11+ def u: T = new T() // error
12+ ^
13+ t6805.scala:12: error: trait T is a trait; does not take constructor arguments
14+ def v: T = new X with T() // error
15+ ^
16+ 5 errors
Original file line number Diff line number Diff line change 1+
2+ trait T
3+
4+ class C extends T () // error
5+
6+ class X
7+ class Y extends X with T () // error
8+
9+ object funcs {
10+ def t : T = new T () {} // error
11+ def u : T = new T () // error
12+ def v : T = new X with T () // error
13+ }
You can’t perform that action at this time.
0 commit comments