File tree Expand file tree Collapse file tree 3 files changed +41
-7
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 3 files changed +41
-7
lines changed Original file line number Diff line number Diff line change @@ -661,15 +661,9 @@ trait ImplicitRunInfo:
661661 case t : TypeLambda =>
662662 for p <- t.paramRefs do partSeen += p
663663 traverseChildren(t)
664- case t : MatchType =>
665- traverseChildren(t)
666- traverse(t.normalized)
667- case MatchType .InDisguise (mt)
668- if ! t.isInstanceOf [LazyRef ] // skip recursive applications (eg. Tuple.Map)
669- =>
670- traverse(mt)
671664 case t =>
672665 traverseChildren(t)
666+ traverse(t.normalized)
673667 catch case ex : Throwable => handleRecursive(" collectParts of" , t.show, ex)
674668
675669 def apply (tp : Type ): collection.Set [Type ] =
Original file line number Diff line number Diff line change 1+ trait ThingWithPart { type Part }
2+ type PartField [A ] = ThingWithPart { type Part = A }
3+ type ExtractPart [B ] = B match { case PartField [a] => a }
4+
5+ trait TC [C ]
6+ object TC :
7+ def tcForOptionPart [D ](implicit tc : TC [ExtractPart [D ]]): TC [Option [ExtractPart [D ]]] = new {}
8+
9+ class Value
10+ object Value :
11+ implicit val tcValue : TC [Value ] = new {}
12+
13+ class ValuePartHolder extends ThingWithPart { type Part = Value }
14+
15+ class Test :
16+ def t1 : Unit =
17+ val tc = TC .tcForOptionPart[ValuePartHolder ]
Original file line number Diff line number Diff line change 1+ sealed trait DFTypeAny
2+
3+ sealed trait DFTuple [T <: NonEmptyTuple ] extends DFTypeAny
4+
5+ sealed trait DFBit extends DFTypeAny
6+
7+ sealed trait DFValOf [T ]
8+
9+ type Of [T ] <: DFTypeAny = T match
10+ case DFTypeAny => T & DFTypeAny
11+ case Product => FromProduct [T ]
12+
13+ type JUSTVAL [T ] = DFValOf [Of [T ]]
14+
15+ type FromProduct [T <: Product ] <: DFTypeAny = T match
16+ case NonEmptyTuple => DFTuple [Tuple .Map [T , JUSTVAL ]]
17+
18+ trait Width2 [T ]
19+
20+ object Width2 :
21+ inline given [T ]: Width2 [T ] = new Width2 [T ] {}
22+
23+ val x = summon[Width2 [Of [(DFBit , DFBit )]]]
You can’t perform that action at this time.
0 commit comments