parser support for 'not nil' annotation
This commit is contained in:
parent
2a2f41ee98
commit
538699a281
2 changed files with 63 additions and 52 deletions
15
tests/reject/tnotnil.nim
Normal file
15
tests/reject/tnotnil.nim
Normal file
|
|
@ -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
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue