File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
src/compiler/scala/tools/nsc/typechecker Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -611,6 +611,9 @@ trait Namers extends MethodSynthesis {
611611 }
612612
613613 class CompleterWrapper (completer : TypeCompleter ) extends TypeCompleter {
614+ // override important when completer.isInstanceOf[PolyTypeCompleter]!
615+ override val typeParams = completer.typeParams
616+
614617 val tree = completer.tree
615618
616619 override def complete (sym : Symbol ): Unit = {
Original file line number Diff line number Diff line change 1+ object Foo {
2+ // spurious error if:
3+ // - this definition precedes that of apply (which is overloaded with the synthetic one derived from the case class)
4+ // - AND `Foo.apply` is explicitly applied to `[A]` (no error if `[A]` is inferred)
5+ //
6+ def referToPolyOverloadedApply [A ]: Foo [A ] = Foo .apply[A ](" bla" )
7+ // ^
8+ // found : String("bla")
9+ // required: Int
10+
11+ def apply [A ](x : Int ): Foo [A ] = ???
12+ }
13+ case class Foo [A ](x : String ) // must be polymorphic
You can’t perform that action at this time.
0 commit comments