File tree 1 file changed +6
-0
lines changed
compiler/src/dotty/tools/dotc/typer
1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -3854,6 +3854,12 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
3854
3854
gadts.println(i " Member selection healed by GADT approximation " )
3855
3855
tree.cast(gadtApprox)
3856
3856
else tree
3857
+ else if tree.tpe.derivesFrom(defn.PairClass ) && ! defn.isTupleNType(tree.tpe.widenDealias) then
3858
+ // If this is a generic tuple we need to cast it to make the TupleN/ members accessible.
3859
+ // This only works for generic tuples of know size up to 22.
3860
+ defn.tupleTypes(tree.tpe.widenTermRefExpr, Definitions .MaxTupleArity ) match
3861
+ case Some (elems) => tree.cast(defn.tupleType(elems))
3862
+ case None => tree
3857
3863
else tree // other adaptations for selections are handled in typedSelect
3858
3864
case _ if ctx.mode.is(Mode .ImplicitsEnabled ) && tree.tpe.isValueType =>
3859
3865
checkConversionsSpecific(pt, tree.srcPos)
You can’t perform that action at this time.
0 commit comments