Skip to content

Only keep denotation for methods in IntegrateMap #23226

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 1 commit into from
May 21, 2025
Merged
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
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 @@ -3862,7 +3862,7 @@ object Types extends TypeUtils {
if tp.prefix eq pre then tp
else
pre match
case ref: ParamRef if (ref.binder eq self) && tp.symbol.exists =>
case ref: ParamRef if (ref.binder eq self) && tp.symbol.exists && tp.symbol.is(Method) =>
NamedType(pre, tp.name, tp.denot.asSeenFrom(pre))
case _ =>
tp.derivedSelect(pre)
Expand Down
20 changes: 20 additions & 0 deletions tests/pos/i23217.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
trait HasA[T]:
type A = T

object Test1:
def foo1(h: HasA[?])(a: h.A): Unit = {}

def foo2(h1: HasA[?])(a1: h1.A): Unit =
foo1(h1)(a1)

def foo3(h1: HasA[?], a1: h1.A): Unit =
foo1(h1)(a1)

object Test2:
def bar1(h: HasA[?], a: h.A): Unit = {}

def bar2(h1: HasA[?], a1: h1.A): Unit =
bar1(h1, a1)

def foo3(h1: HasA[?])(a1: h1.A): Unit =
bar2(h1, a1)
Loading