File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -131,8 +131,11 @@ object Applications {
131
131
else productSelectorTypes(tp, NoSourcePosition )
132
132
133
133
def productSelectorTypes (tp : Type , errorPos : SrcPos )(using Context ): List [Type ] = {
134
- val sels = for (n <- Iterator .from(0 )) yield extractorMemberType(tp, nme.selectorName(n), errorPos)
135
- sels.takeWhile(_.exists).toList
134
+ if tp.isError then
135
+ Nil
136
+ else
137
+ val sels = for (n <- Iterator .from(0 )) yield extractorMemberType(tp, nme.selectorName(n), errorPos)
138
+ sels.takeWhile(_.exists).toList
136
139
}
137
140
138
141
def tupleComponentTypes (tp : Type )(using Context ): List [Type ] =
@@ -218,7 +221,7 @@ object Applications {
218
221
val isProduct = args match
219
222
case x :: xs => x.isInstanceOf [untpd.NamedArg ] || xs.nonEmpty
220
223
case _ => false
221
- if isProduct && ! tp.derivesFrom(defn.SeqClass ) && ! tp.isError then
224
+ if isProduct && ! tp.derivesFrom(defn.SeqClass ) then
222
225
productUnapplySelectors(tp).getOrElse:
223
226
// There are unapplys with return types which have `get` and `_1, ..., _n`
224
227
// as members, but which are not subtypes of Product. So `productUnapplySelectors`
You can’t perform that action at this time.
0 commit comments