diff options
author | ringabout <43030857+ringabout@users.noreply.github.com> | 2023-08-10 20:26:40 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-10 14:26:40 +0200 |
commit | 7be2e2bef545e68ac3d88876fe7073a033fbb5f4 (patch) | |
tree | 377a900fa6cdde8063bc8d234de04876381a7a9c /compiler/pipelines.nim | |
parent | 8523b543d6034d8545a4db256bff83b73c927033 (diff) | |
download | Nim-7be2e2bef545e68ac3d88876fe7073a033fbb5f4.tar.gz |
replaces `doAssert false` with `raiseAssert` for unreachable branches, which works better with strictdefs (#22436)
replaces `doAssert false` with `raiseAssert`, which works better with strictdefs
Diffstat (limited to 'compiler/pipelines.nim')
-rw-r--r-- | compiler/pipelines.nim | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/compiler/pipelines.nim b/compiler/pipelines.nim index 7bde76d5f..8517cd942 100644 --- a/compiler/pipelines.nim +++ b/compiler/pipelines.nim @@ -44,8 +44,7 @@ proc processPipeline(graph: ModuleGraph; semNode: PNode; bModule: PPassContext): of EvalPass, InterpreterPass: result = interpreterCode(bModule, semNode) of NonePass: - result = nil - doAssert false, "use setPipeLinePass to set a proper PipelinePass" + raiseAssert "use setPipeLinePass to set a proper PipelinePass" proc processImplicitImports(graph: ModuleGraph; implicits: seq[string], nodeKind: TNodeKind, m: PSym, ctx: PContext, bModule: PPassContext, idgen: IdGenerator, @@ -133,8 +132,7 @@ proc processPipelineModule*(graph: ModuleGraph; module: PSym; idgen: IdGenerator of SemPass: nil of NonePass: - doAssert false, "use setPipeLinePass to set a proper PipelinePass" - nil + raiseAssert "use setPipeLinePass to set a proper PipelinePass" if stream == nil: let filename = toFullPathConsiderDirty(graph.config, fileIdx) @@ -208,7 +206,7 @@ proc processPipelineModule*(graph: ModuleGraph; module: PSym; idgen: IdGenerator when not defined(leanCompiler): discard closeJson(graph, bModule, finalNode) of NonePass: - doAssert false, "use setPipeLinePass to set a proper PipelinePass" + raiseAssert "use setPipeLinePass to set a proper PipelinePass" if graph.config.backend notin {backendC, backendCpp, backendObjc}: # We only write rod files here if no C-like backend is active. |