replaces doAssert false with raiseAssert for unreachable branches, which works better with strictdefs (#22436)

replaces `doAssert false` with `raiseAssert`, which works better with strictdefs
This commit is contained in:
ringabout
2023-08-10 20:26:40 +08:00
committed by GitHub
parent 8523b543d6
commit 7be2e2bef5
21 changed files with 34 additions and 42 deletions

View File

@@ -94,7 +94,7 @@ proc specializeResetT(p: BProc, accessor: Rope, typ: PType) =
of ctInt8, ctInt16, ctInt32, ctInt64:
lineCg(p, cpsStmts, "$1 = 0;$n", [accessor])
else:
doAssert false, "unexpected set type kind"
raiseAssert "unexpected set type kind"
of {tyNone, tyEmpty, tyNil, tyUntyped, tyTyped, tyGenericInvocation,
tyGenericParam, tyOrdinal, tyRange, tyOpenArray, tyForward, tyVarargs,
tyUncheckedArray, tyProxy, tyBuiltInTypeClass, tyUserTypeClass,