diff --git a/compiler/src/dotty/tools/dotc/core/Symbols.scala b/compiler/src/dotty/tools/dotc/core/Symbols.scala index d783780f593d..0fe9076eab8c 100644 --- a/compiler/src/dotty/tools/dotc/core/Symbols.scala +++ b/compiler/src/dotty/tools/dotc/core/Symbols.scala @@ -282,14 +282,15 @@ trait Symbols { this: Context => val tparamBuf = new mutable.ListBuffer[TypeSymbol] val trefBuf = new mutable.ListBuffer[TypeRef] for (name <- names) { - val tparam = newNakedSymbol[TypeName](owner.coord) + val tparam = newSymbol( + owner, name, flags | owner.typeParamCreationFlags, NoType, coord = owner.coord) tparamBuf += tparam trefBuf += TypeRef(owner.thisType, tparam) } val tparams = tparamBuf.toList val bounds = boundsFn(trefBuf.toList) - for ((name, tparam, bound) <- names.lazyZip(tparams).lazyZip(bounds)) - tparam.denot = SymDenotation(tparam, owner, name, flags | owner.typeParamCreationFlags, bound) + for (tparam, bound) <- tparams.lazyZip(bounds) do + tparam.info = bound tparams } diff --git a/tests/pos/i7744.scala b/tests/pos/i7744.scala new file mode 100644 index 000000000000..342f4b470d25 --- /dev/null +++ b/tests/pos/i7744.scala @@ -0,0 +1 @@ +class A[F[_], X <: F[Int]](x: X) extends AnyVal \ No newline at end of file