Skip to content

Commit a172638

Browse files
authored
Only keep denotation for methods in IntegrateMap (#23226)
2 parents a44cf26 + 8e14a34 commit a172638

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
@@ -3863,7 +3863,7 @@ object Types extends TypeUtils {
38633863
if tp.prefix eq pre then tp
38643864
else
38653865
pre match
3866-
case ref: ParamRef if (ref.binder eq self) && tp.symbol.exists =>
3866+
case ref: ParamRef if (ref.binder eq self) && tp.symbol.exists && tp.symbol.is(Method) =>
38673867
NamedType(pre, tp.name, tp.denot.asSeenFrom(pre))
38683868
case _ =>
38693869
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)