Skip to content

Mark AppliedType cachedSuper valid Nowhere when using provisional args #20527

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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: 3 additions & 1 deletion compiler/src/dotty/tools/dotc/core/Types.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4643,7 +4643,9 @@ object Types extends TypeUtils {
cachedSuper = tycon match
case tycon: HKTypeLambda => defn.AnyType
case tycon: TypeRef if tycon.symbol.isClass => tycon
case tycon: TypeProxy => tycon.superType.applyIfParameterized(args)
case tycon: TypeProxy =>
if validSuper != Nowhere && args.exists(_.isProvisional) then validSuper = Nowhere
tycon.superType.applyIfParameterized(args)
case _ => defn.AnyType
cachedSuper

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,5 +345,5 @@ object functors {
}

MonadFlatten.flattened(List(List(1, 2, 3), List(4, 5))) // ok, synthesizes (using ListMonad)
MonadFlatten.flattened(List(List(1, 2, 3), List(4, 5)))(using ListMonad) // error
MonadFlatten.flattened(List(List(1, 2, 3), List(4, 5)))(using ListMonad)
}
Loading