mirror of
https://github.com/nim-lang/Nim.git
synced 2026-08-27 09:01:37 +00:00
Prevent the construction of recursive tyStatic types (#9256)
Fixes #9255
(cherry picked from commit b8d2f79ef0)
This commit is contained in:
13
tests/statictypes/t9255.nim
Normal file
13
tests/statictypes/t9255.nim
Normal file
@@ -0,0 +1,13 @@
|
||||
discard """
|
||||
errormsg: '''
|
||||
type mismatch: got <static[proc (a0: int): string{.noSideEffect, gcsafe, locks: 0.}](bar)>
|
||||
'''
|
||||
line: 13
|
||||
"""
|
||||
|
||||
macro fun(a: static float): untyped =
|
||||
discard
|
||||
|
||||
when isMainModule:
|
||||
proc bar(a0: int): string = discard
|
||||
fun(bar)
|
||||
Reference in New Issue
Block a user