Skip to content

Commit 8e14a34

Browse files
committed
Only keep denotation for methods in IntegrateMap
1 parent 9d9e180 commit 8e14a34

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3862,7 +3862,7 @@ object Types extends TypeUtils {
38623862
if tp.prefix eq pre then tp
38633863
else
38643864
pre match
3865-
case ref: ParamRef if (ref.binder eq self) && tp.symbol.exists =>
3865+
case ref: ParamRef if (ref.binder eq self) && tp.symbol.exists && tp.symbol.is(Method) =>
38663866
NamedType(pre, tp.name, tp.denot.asSeenFrom(pre))
38673867
case _ =>
38683868
tp.derivedSelect(pre)

tests/pos/i23217.scala

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
trait HasA[T]:
2+
type A = T
3+
4+
object Test1:
5+
def foo1(h: HasA[?])(a: h.A): Unit = {}
6+
7+
def foo2(h1: HasA[?])(a1: h1.A): Unit =
8+
foo1(h1)(a1)
9+
10+
def foo3(h1: HasA[?], a1: h1.A): Unit =
11+
foo1(h1)(a1)
12+
13+
object Test2:
14+
def bar1(h: HasA[?], a: h.A): Unit = {}
15+
16+
def bar2(h1: HasA[?], a1: h1.A): Unit =
17+
bar1(h1, a1)
18+
19+
def foo3(h1: HasA[?])(a1: h1.A): Unit =
20+
bar2(h1, a1)

0 commit comments

Comments
 (0)