Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/typer/Implicits.scala
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ trait ImplicitRunInfo:
companions ++= iscopeRefs(t.underlying)
end addCompanions

def addPath(pre: Type): Unit = pre.dealias match
def addPath(pre: Type): Unit = pre.dealias.normalized match
Copy link
Contributor

@EugeneFlesselle EugeneFlesselle Apr 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you still think we need this given our earlier findings ?

case pre: ThisType if pre.cls.is(Module) && pre.cls.isStaticOwner =>
addPath(pre.cls.sourceModule.termRef)
case pre: TermRef if !isExcluded(pre.symbol) =>
Expand Down Expand Up @@ -817,7 +817,7 @@ trait ImplicitRunInfo:
else AndType.make(apply(lo), apply(hi))
case u => apply(u)

def apply(t: Type) = t.dealias match
def apply(t: Type) = t.dealias.normalized match
case t: TypeRef =>
if t.symbol.isClass || isAnchor(t.symbol) then t else applyToUnderlying(t)
case t: TypeVar => apply(t.underlying)
Expand Down
8 changes: 8 additions & 0 deletions tests/pos/i20136/A_1.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package a

trait Expr:
type Value
object Expr:
type Of[V] = Expr { type Value = V }
type ExtractValue[E <: Expr] = E match
case Expr.Of[v] => v
8 changes: 8 additions & 0 deletions tests/pos/i20136/B_2.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package a

trait TC[E <: Expr]:
type Elem = Expr.ExtractValue[E]
class BIExpr extends Expr:
type Value = BigInt
class Foo extends TC[BIExpr]:
val v: Elem = 0