File tree 4 files changed +8
-4
lines changed
4 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -200,7 +200,7 @@ object desugar {
200
200
paramss.mapConserve {
201
201
case TypeDefs (tparams) => tparams.mapConserve(mapTypeParam)
202
202
case ValDefs (vparams) => vparams.mapConserve(mapTermParam)
203
- case _ => ??? // impossible
203
+ case _ => unreachable()
204
204
}
205
205
206
206
/** 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 {
215
215
paramss.map {
216
216
case TypeSymbols (params) => params.map(param => TypeDef (param).withSpan(param.span))
217
217
case TermSymbols (params) => params.map(param => ValDef (param).withSpan(param.span))
218
- case _ => ???
218
+ case _ => unreachable()
219
219
},
220
220
TypeTree (resultType),
221
221
rhs),
Original file line number Diff line number Diff line change 1
- package dotty .tools .dotc
1
+ package dotty .tools
2
+ package dotc
2
3
package transform
3
4
package init
4
5
@@ -101,7 +102,7 @@ object Potentials {
101
102
case Some ((parentCls, pots)) =>
102
103
val rebased : Potentials = outerPots.flatMap { Potentials .asSeenFrom(pots, _) }
103
104
resolveOuter(parentCls, rebased, cls)
104
- case None => ??? // impossible
105
+ case None => unreachable()
105
106
}
106
107
}
107
108
}
Original file line number Diff line number Diff line change @@ -50,4 +50,7 @@ package object tools {
50
50
type WrappedResult [T ] = resultWrapper.WrappedResult [T ]
51
51
def WrappedResult [T ](x : T ) = resultWrapper.wrap(x)
52
52
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)
53
56
}
You can’t perform that action at this time.
0 commit comments