Skip to content

Commit

Permalink
Normalize for underlyingClassRef
Browse files Browse the repository at this point in the history
Test scala#15827 with a classpath dependency
  • Loading branch information
EugeneFlesselle committed Apr 14, 2024
1 parent 17777db commit 4523dcb
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/Types.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1584,7 +1584,7 @@ object Types extends TypeUtils {
* a class, the class type ref, otherwise NoType.
* @param refinementOK If `true` we also skip refinements.
*/
def underlyingClassRef(refinementOK: Boolean)(using Context): Type = dealias match {
def underlyingClassRef(refinementOK: Boolean)(using Context): Type = dealiasNormalized match {
case tp: TypeRef =>
if (tp.symbol.isClass) tp
else if (tp.symbol.isAliasType) tp.underlying.underlyingClassRef(refinementOK)
Expand Down
2 changes: 1 addition & 1 deletion compiler/test/dotc/pos-test-pickling.blacklist
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ i9999.scala
i6505.scala
i15158.scala
i15155.scala
i15827.scala
i15827a.scala
i17149.scala
tuple-fold.scala
mt-redux-norm.perspective.scala
Expand Down
File renamed without changes.
7 changes: 7 additions & 0 deletions tests/pos/i15827b/A_1.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

case class Foo()

type T = Tuple.Elem[(Foo, Any), 0]

val x = new T() // ok

2 changes: 2 additions & 0 deletions tests/pos/i15827b/B_2.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

val y = new T() // error before changes

0 comments on commit 4523dcb

Please sign in to comment.