File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -2222,13 +2222,15 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] w
22222222 /** Returns last check's debug mode, if explicitly enabled. */
22232223 def lastTrace (): String = " "
22242224
2225+ /** Does `tycon` have a field with type `tparam`? Special cased for `scala.*:`
2226+ * as that type is artificially added to tuples. */
22252227 private def typeparamCorrespondsToField (tycon : Type , tparam : TypeParamInfo ): Boolean =
22262228 productSelectorTypes(tycon, null ).exists {
22272229 case tp : TypeRef =>
22282230 tp.designator.eq(tparam) // Bingo!
22292231 case _ =>
22302232 false
2231- }
2233+ } || tycon.derivesFrom(defn. PairClass )
22322234
22332235 /** Is `tp` an empty type?
22342236 *
Original file line number Diff line number Diff line change 1+ object Test {
2+ type DU [A <: Tuple ] <: Tuple = A match {
3+ case Unit => Unit
4+ case Unit *: tl => DU [tl]
5+ case hd *: tl => hd *: DU [tl]
6+ }
7+
8+ (1 , 2 ): DU [Int *: Int *: Unit ]
9+ }
You can’t perform that action at this time.
0 commit comments