Files
Nim/tests/errmsgs/t24974.nim
Andreas Rumpf 431e01eaf2 system.nim refactorings for IC (#25295)
Generally useful refactoring as it produces better code.

(cherry picked from commit 0f7b378467)
2025-11-22 13:32:24 +01:00

23 lines
475 B
Nim

discard """
exitcode: 1
output: '''
t24974.nim(22) t24974
t24974.nim(19) d
t24974.nim(16) s
assertions.nim(45) failedAssertImpl
assertions.nim(40) raiseAssert
fatal.nim(53) sysFatal
Error: unhandled exception: t24974.nim(16, 26) `false` [AssertionDefect]
'''
"""
type B = seq[array[1, byte]]
proc s(_: var B): bool = doAssert false
proc d(): B =
var k: B
if s(k): discard
quit 0
k
for _ in [0]: discard d()