diff options
author | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2013-11-21 05:30:15 -0800 |
---|---|---|
committer | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2013-11-21 05:30:15 -0800 |
commit | d1ded66f9c0bf487cd584a053047495e1f5c1894 (patch) | |
tree | 693e6031293aa24bc2b6dab9b2e8c6d193fe14df | |
parent | 9684f80bd3d52191f0dbea0afde2787bc7b6346d (diff) | |
parent | 33a086b97a5a7763acbf70e42edadace4d4cff95 (diff) | |
download | scala-d1ded66f9c0bf487cd584a053047495e1f5c1894.tar.gz scala-d1ded66f9c0bf487cd584a053047495e1f5c1894.tar.bz2 scala-d1ded66f9c0bf487cd584a053047495e1f5c1894.zip |
Merge pull request #3173 from retronym/topic/classOf-type-apply
Handle TypeApply(fun, ...) for symbol-less funs
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 2 | ||||
-rw-r--r-- | test/files/neg/class-of-double-targs.check | 4 | ||||
-rw-r--r-- | test/files/neg/class-of-double-targs.scala | 3 |
3 files changed, 8 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index fa704adde2..8594309818 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -5051,7 +5051,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper // @M: fun is typed in TAPPmode because it is being applied to its actual type parameters val fun1 = typed(fun, mode.forFunMode | TAPPmode) - val tparams = fun1.symbol.typeParams + val tparams = if (fun1.symbol == null) Nil else fun1.symbol.typeParams //@M TODO: val undets_fun = context.undetparams ? // "do args first" (by restoring the context.undetparams) in order to maintain context.undetparams on the function side. diff --git a/test/files/neg/class-of-double-targs.check b/test/files/neg/class-of-double-targs.check new file mode 100644 index 0000000000..f7e2094f97 --- /dev/null +++ b/test/files/neg/class-of-double-targs.check @@ -0,0 +1,4 @@ +class-of-double-targs.scala:2: error: expression of type Class[Int](classOf[scala.Int]) does not take type parameters. + classOf[Int][Int] + ^ +one error found diff --git a/test/files/neg/class-of-double-targs.scala b/test/files/neg/class-of-double-targs.scala new file mode 100644 index 0000000000..26a2fa8381 --- /dev/null +++ b/test/files/neg/class-of-double-targs.scala @@ -0,0 +1,3 @@ +object Test { + classOf[Int][Int] +} |