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 @@ -2219,13 +2219,15 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] w
2219
2219
/** Returns last check's debug mode, if explicitly enabled. */
2220
2220
def lastTrace (): String = " "
2221
2221
2222
+ /** Does `tycon` have a field with type `tparam`? Special cased for `scala.*:`
2223
+ * as that type is artificially added to tuples. */
2222
2224
private def typeparamCorrespondsToField (tycon : Type , tparam : TypeParamInfo ): Boolean =
2223
2225
productSelectorTypes(tycon, null ).exists {
2224
2226
case tp : TypeRef =>
2225
2227
tp.designator.eq(tparam) // Bingo!
2226
2228
case _ =>
2227
2229
false
2228
- }
2230
+ } || tycon.derivesFrom(defn. PairClass )
2229
2231
2230
2232
/** Is `tp` an empty type?
2231
2233
*
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