typed/untyped return type is invalid for everything except templates and macros (#10275)

This commit is contained in:
Neelesh Chandola 2019-01-15 12:38:12 +05:30 • committed by Andreas Rumpf
commit 8922063bd8
3 changed files with 17 additions and 5 deletions

View 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