Skip to content

Commit

Permalink
add changelog entry, fix double not nil bug
Browse files Browse the repository at this point in the history
  • Loading branch information
metagn committed Sep 3, 2022
1 parent f028f7e commit 6395a7c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@
need to convert to `string`. On the JS backend, this is translated directly
to a `switch` statement.

- `foo a = b` now means `foo(a = b)` rather than `foo(a) = b`. This is consistent
with the existing behavior of `foo a, b = c` meaning `foo(a, b = c)`.
This decision was made with the assumption that the old syntax was used rarely;
if your code used the old syntax, please be aware of this change.

## Compiler changes

- The `gc` switch has been renamed to `mm` ("memory management") in order to reflect the
Expand Down
4 changes: 1 addition & 3 deletions compiler/parser.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1393,9 +1393,7 @@ proc parseTypeDefValue(p: var Parser): PNode =
result = parseTypeClass(p)
else:
result = simpleExpr(p, pmTypeDef)
if p.tok.tokType == tkNot:
result = binaryNot(p, result)
else:
if p.tok.tokType != tkNot:
if result.kind == nkCommand:
var isFirstParam = false
while p.tok.tokType == tkComma:
Expand Down
3 changes: 3 additions & 0 deletions tests/parser/tdoublenotnil.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
when false:
type Foo = Bar not nil not nil #[tt.Error
^ invalid indentation]#

0 comments on commit 6395a7c

Please sign in to comment.