Files
Nim/tests/generics/t21252.nim
ringabout 9db9b8ce57 adds regression tests (#25906)
closes #22842, closes #21252, closes #19312, 
closes #16956, closes #16416, closes #14913, closes #13296,
closes #12424, closes #10902, closes #9892, closes #9617
2026-06-13 11:06:51 +08:00

36 lines
801 B
Nim

discard """
output: '''done'''
"""
# Issue #21252: Compiler SIGSEGV when not instantiating generic proc correctly
# https://github.com/nim-lang/Nim/issues/21252
type
Addr = object
layerIdx: int
type Msg0 = object
address: Addr
selSample: tuple[inArrays: seq[seq[float64]], target: seq[float64], gradientStrength: float64]
type WeightUpdate = object
address: Addr
proc workerThread[
layer0StimulusWidth: static int
]() =
discard
proc z*[
layer0StimulusWidth: static int,
nUnitsPerLayer: static seq[int],
targetLen: static int
]() =
workerThread[layer0StimulusWidth]()
when isMainModule:
const layer0StimulusWidth: int = 5*29
const nUnitsPerLayer: seq[int] = @[50, 5]
const targetLen: int = 5
z[layer0StimulusWidth, nUnitsPerLayer, targetLen]()
echo "done"