From 8922063bd84e9109a5ba493188f201ebda74f66d Mon Sep 17 00:00:00 2001 From: Neelesh Chandola Date: Tue, 15 Jan 2019 12:38:12 +0530 Subject: typed/untyped return type is invalid for everything except templates and macros (#10275) --- tests/proc/tillegalreturntype.nim | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/proc/tillegalreturntype.nim (limited to 'tests/proc') diff --git a/tests/proc/tillegalreturntype.nim b/tests/proc/tillegalreturntype.nim new file mode 100644 index 000000000..be9e2147e --- /dev/null +++ b/tests/proc/tillegalreturntype.nim @@ -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 -- cgit 1.4.1-2-gfad0