summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authormetagn <metagngn@gmail.com>2024-09-18 23:45:19 +0300
committerGitHub <noreply@github.com>2024-09-18 22:45:19 +0200
commit00ac961ab18c6c8cba9fd2bdad8390816dec1ec8 (patch)
treed141f2c65f85d9185324fa6eb2f9d4dc99b10bed /tests
parent0c3573e4a0628bbaa8b09dcd854bdc2702948bbc (diff)
downloadNim-00ac961ab18c6c8cba9fd2bdad8390816dec1ec8.tar.gz
require `not nil` to be on the same line after a type (#24134)
fixes #23565
Diffstat (limited to 'tests')
-rw-r--r--tests/parser/tbinarynotindented.nim3
-rw-r--r--tests/parser/tbinarynotsameline.nim10
2 files changed, 13 insertions, 0 deletions
diff --git a/tests/parser/tbinarynotindented.nim b/tests/parser/tbinarynotindented.nim
new file mode 100644
index 000000000..8d124aade
--- /dev/null
+++ b/tests/parser/tbinarynotindented.nim
@@ -0,0 +1,3 @@
+type Foo = ref int
+  not nil #[tt.Error
+  ^ invalid indentation]#
diff --git a/tests/parser/tbinarynotsameline.nim b/tests/parser/tbinarynotsameline.nim
new file mode 100644
index 000000000..ca417e023
--- /dev/null
+++ b/tests/parser/tbinarynotsameline.nim
@@ -0,0 +1,10 @@
+# issue #23565
+
+func foo: bool =
+  true
+
+const bar = block:
+  type T = int
+  not foo()
+
+doAssert not bar