File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -213,10 +213,14 @@ object NameKinds {
213213 safePrefix + info.num
214214 }
215215
216- /** Generate fresh unique name of this kind with given prefix name */
216+ /** Generate fresh unique term name of this kind with given prefix name */
217217 def fresh (prefix : TermName = EmptyTermName )(implicit ctx : Context ): TermName =
218218 ctx.freshNames.newName(prefix, this )
219219
220+ /** Generate fresh unique type name of this kind with given prefix name */
221+ def fresh (prefix : TypeName )(implicit ctx : Context ): TypeName =
222+ fresh(prefix.toTermName).toTypeName
223+
220224 uniqueNameKinds(separator) = this
221225 }
222226
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import Trees._
99import Constants ._
1010import Scopes ._
1111import ProtoTypes ._
12- import NameKinds .WildcardParamName
12+ import NameKinds .UniqueName
1313import annotation .unchecked
1414import util .Positions ._
1515import util .{Stats , SimpleIdentityMap }
@@ -242,7 +242,7 @@ object Inferencing {
242242 if (bounds.hi <:< bounds.lo || bounds.hi.classSymbol.is(Final ) || fromScala2x)
243243 tvar.instantiate(fromBelow = false )
244244 else {
245- val wildCard = ctx.newPatternBoundSymbol(WildcardParamName .fresh().toTypeName , bounds, pos)
245+ val wildCard = ctx.newPatternBoundSymbol(UniqueName .fresh(tvar.origin.paramName) , bounds, pos)
246246 tvar.instantiateWith(wildCard.typeRef)
247247 patternBound += wildCard
248248 }
Original file line number Diff line number Diff line change @@ -11,10 +11,10 @@ object Test {
1111 // -- [E007] Type Mismatch Error: tests/neg/gadt-eval.scala:10:6 ------------------
1212 // 10 | (eval(a), eval(a))
1313 // | ^^^^^^^^^^^^^^^^^^
14- // | found: (_ $1, _ $1)
14+ // | found: (A $1, A $1)
1515 // | required: T
1616 // |
17- // | where: T is a type in method eval which is an alias of (_ $1, _$2 )
17+ // | where: T is a type in method eval which is an alias of (A $1, B$1 )
1818 }
1919
2020 def eval2 [T ](e : Exp [T ]): T = e match {
You can’t perform that action at this time.
0 commit comments