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 @@ -2193,13 +2193,15 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] w
2193
2193
/** Returns last check's debug mode, if explicitly enabled. */
2194
2194
def lastTrace (): String = " "
2195
2195
2196
+ /** Does `tycon` has a field with type `tparam`? Special cased for `scala.*:`
2197
+ * as that type is artificially added to tuples. */
2196
2198
private def typeparamCorrespondsToField (tycon : Type , tparam : TypeParamInfo ): Boolean =
2197
2199
productSelectorTypes(tycon, null ).exists {
2198
2200
case tp : TypeRef =>
2199
2201
tp.designator.eq(tparam) // Bingo!
2200
2202
case _ =>
2201
2203
false
2202
- }
2204
+ } || tycon.derivesFrom(defn. PairClass )
2203
2205
2204
2206
/** Is `tp` an empty type?
2205
2207
*
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