diff options
author | Araq <rumpf_a@web.de> | 2012-11-25 23:40:42 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2012-11-25 23:40:42 +0100 |
commit | 538699a2810017981b4cb8b6994c0da0afeb0452 (patch) | |
tree | 0fd22b5b811c110136f7876e86ab79abd4559d23 /tests/reject/tnotnil.nim | |
parent | 2a2f41ee98fa2bb65a9ac313eb6d084e34d99316 (diff) | |
download | Nim-538699a2810017981b4cb8b6994c0da0afeb0452.tar.gz |
parser support for 'not nil' annotation
Diffstat (limited to 'tests/reject/tnotnil.nim')
-rw-r--r-- | tests/reject/tnotnil.nim | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/reject/tnotnil.nim b/tests/reject/tnotnil.nim new file mode 100644 index 000000000..8676aedf8 --- /dev/null +++ b/tests/reject/tnotnil.nim @@ -0,0 +1,15 @@ +discard """ + line: 11 + errormgs: "type mismatch" +""" + +type + PObj = ref TObj not nil + TObj = object + x: int + +var x: PObj = nil + +proc p(x: string not nil): int = + result = 45 + |