Skip to content

Commit 07fa870

Browse files
Merge pull request #4277 from dotty-staging/simplify-tastytrees
Simplify Tasty Trees
2 parents 1f67c00 + b8856f7 commit 07fa870

File tree

3 files changed

+139
-168
lines changed

3 files changed

+139
-168
lines changed

compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ object ProtoTypes {
126126
val mbr = if (privateOK) tp1.member(name) else tp1.nonPrivateMember(name)
127127
def qualifies(m: SingleDenotation) =
128128
memberProto.isRef(defn.UnitClass) ||
129-
compat.normalizedCompatible(NamedType(tp1, name, m), memberProto)
129+
tp1.isValueType && compat.normalizedCompatible(NamedType(tp1, name, m), memberProto)
130130
// Note: can't use `m.info` here because if `m` is a method, `m.info`
131131
// loses knowledge about `m`'s default arguments.
132132
mbr match { // hasAltWith inlined for performance

tests/neg/hkprefix.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class Lambda[T] { class Tp }
2+
3+
object Test {
4+
def f(x: Lambda # Tp) = ??? // error
5+
}

0 commit comments

Comments
 (0)