Skip to content

Commit 6bf934c

Browse files
aherlihytgodzik
authored andcommitted
Move error check into productSelectorTypes
1 parent 8524b69 commit 6bf934c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,11 @@ object Applications {
124124
}
125125

126126
def productSelectorTypes(tp: Type, errorPos: SrcPos)(using Context): List[Type] = {
127-
val sels = for (n <- Iterator.from(0)) yield extractorMemberType(tp, nme.selectorName(n), errorPos)
128-
sels.takeWhile(_.exists).toList
127+
if tp.isError then
128+
Nil
129+
else
130+
val sels = for (n <- Iterator.from(0)) yield extractorMemberType(tp, nme.selectorName(n), errorPos)
131+
sels.takeWhile(_.exists).toList
129132
}
130133

131134
def tupleComponentTypes(tp: Type)(using Context): List[Type] =

0 commit comments

Comments
 (0)