forked from nim-lang/Nim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make binary
not
not parse complex expressions on right side (nim-la…
…ng#22078) * binary `not` only parses simple expressions fixes nim-lang#16324 * switch to primary
- Loading branch information
Showing
3 changed files
with
25 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# issue #16324 | ||
|
||
{.push experimental: "notnil".} | ||
|
||
block: | ||
type Foo = ref object | ||
value: int | ||
|
||
proc newFoo1(): Foo not nil = # This compiles | ||
return Foo(value: 1) | ||
|
||
proc newFoo2(): Foo not nil {.inline.} = # This does not | ||
return Foo(value: 1) | ||
|
||
doAssert newFoo1().value == 1 | ||
doAssert newFoo2().value == 1 | ||
|
||
{.pop.} |