typed/untyped return type is invalid for everything except templates and macros (#10275)
This commit is contained in:
parent
c8ba9ffdba
commit
8922063bd8
3 changed files with 17 additions and 5 deletions
12
tests/proc/tillegalreturntype.nim
Normal file
12
tests/proc/tillegalreturntype.nim
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
discard """
|
||||
cmd: "nim check $file"
|
||||
errmsg: ""
|
||||
nimout: '''tillegalreturntype.nim(8, 11) Error: return type 'typed' is only valid for macros and templates
|
||||
tillegalreturntype.nim(11, 11) Error: return type 'untyped' is only valid for macros and templates'''
|
||||
"""
|
||||
|
||||
proc x(): typed =
|
||||
discard
|
||||
|
||||
proc y(): untyped =
|
||||
discard
|
||||
Loading…
Add table
Add a link
Reference in a new issue