File tree Expand file tree Collapse file tree 4 files changed +8
-4
lines changed Expand file tree Collapse file tree 4 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -200,7 +200,7 @@ object desugar {
200200 paramss.mapConserve {
201201 case TypeDefs (tparams) => tparams.mapConserve(mapTypeParam)
202202 case ValDefs (vparams) => vparams.mapConserve(mapTermParam)
203- case _ => ??? // impossible
203+ case _ => unreachable()
204204 }
205205
206206 /** 1. Expand context bounds to evidence params. E.g.,
Original file line number Diff line number Diff line change @@ -215,7 +215,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
215215 paramss.map {
216216 case TypeSymbols (params) => params.map(param => TypeDef (param).withSpan(param.span))
217217 case TermSymbols (params) => params.map(param => ValDef (param).withSpan(param.span))
218- case _ => ???
218+ case _ => unreachable()
219219 },
220220 TypeTree (resultType),
221221 rhs),
Original file line number Diff line number Diff line change 1- package dotty .tools .dotc
1+ package dotty .tools
2+ package dotc
23package transform
34package init
45
@@ -101,7 +102,7 @@ object Potentials {
101102 case Some ((parentCls, pots)) =>
102103 val rebased : Potentials = outerPots.flatMap { Potentials .asSeenFrom(pots, _) }
103104 resolveOuter(parentCls, rebased, cls)
104- case None => ??? // impossible
105+ case None => unreachable()
105106 }
106107 }
107108 }
Original file line number Diff line number Diff line change @@ -50,4 +50,7 @@ package object tools {
5050 type WrappedResult [T ] = resultWrapper.WrappedResult [T ]
5151 def WrappedResult [T ](x : T ) = resultWrapper.wrap(x)
5252 def result [T ](using x : WrappedResult [T ]): T = resultWrapper.unwrap(x)
53+
54+ def unreachable (x : Any = " << this case was declared unreachable >>" ): Nothing =
55+ throw new MatchError (x)
5356}
You can’t perform that action at this time.
0 commit comments