File tree Expand file tree Collapse file tree 3 files changed +15
-2
lines changed
src/compiler/scala/tools/nsc/typechecker Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -870,13 +870,13 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
870
870
871
871
def adaptType (): Tree = {
872
872
// @M When not typing a type constructor (!context.inTypeConstructorAllowed)
873
- // or raw type (tree.symbol.isJavaDefined && context.unit.isJava) , types must be of kind *,
873
+ // or raw type, types must be of kind *,
874
874
// and thus parameterized types must be applied to their type arguments
875
875
// @M TODO: why do kind-* tree's have symbols, while higher-kinded ones don't?
876
876
def properTypeRequired = (
877
877
tree.hasSymbolField
878
878
&& ! context.inTypeConstructorAllowed
879
- && ! (tree.symbol.isJavaDefined && context.unit.isJava)
879
+ && ! context.unit.isJava
880
880
)
881
881
// @M: don't check tree.tpe.symbol.typeParams. check tree.tpe.typeParams!!!
882
882
// (e.g., m[Int] --> tree.tpe.symbol.typeParams.length == 1, tree.tpe.typeParams.length == 0!)
Original file line number Diff line number Diff line change
1
+ object Client {
2
+ def foo : Any = new Test ().foo
3
+ }
Original file line number Diff line number Diff line change
1
+ public class Test {
2
+ // Raw type over a Scala type constructor
3
+ public scala .Function1 foo () { return null ; }
4
+ // scalac reported:
5
+ // % scalac-hash v2.11.2 -d /tmp sandbox/{Test.java,Client.scala}
6
+ // sandbox/Test.java:2: error: trait Function1 takes type parameters
7
+ // public scala.Function1 foo() { return null; }
8
+ // ^
9
+ // one error found
10
+ }
You can’t perform that action at this time.
0 commit comments