File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed
src/compiler/scala/tools/nsc/typechecker Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -480,6 +480,8 @@ trait Contexts { self: Analyzer =>
480
480
// SI-8245 `isLazy` need to skip lazy getters to ensure `return` binds to the right place
481
481
c.enclMethod = if (isDefDef && ! owner.isLazy) c else enclMethod
482
482
483
+ if (tree != outer.tree) c(TypeConstructorAllowed ) = false
484
+
483
485
registerContext(c.asInstanceOf [analyzer.Context ])
484
486
debuglog(" [context] ++ " + c.unit + " / " + tree.summaryString)
485
487
c
Original file line number Diff line number Diff line change
1
+ t8869.scala:5: error: class Option takes type parameters
2
+ def value: TC[({type l1[x] = Option})#l1] = ??? // error not reported!
3
+ ^
4
+ t8869.scala:7: error: class Option takes type parameters
5
+ type l2[x] = Option // error correctly reported
6
+ ^
7
+ two errors found
Original file line number Diff line number Diff line change
1
+ class TC [T [_]] {
2
+ def identity [A ](a : T [A ]): T [A ] = a
3
+ }
4
+ object Test {
5
+ def value : TC [({type l1 [x] = Option })# l1] = ??? // error not reported!
6
+
7
+ type l2 [x] = Option // error correctly reported
8
+ def value1 : TC [l2] = ???
9
+ }
10
+
You can’t perform that action at this time.
0 commit comments