bugfix: 'not nil' and 'shared' types
This commit is contained in:
parent
0916137287
commit
8948a97151
5 changed files with 23 additions and 5 deletions
|
|
@ -1,5 +1,5 @@
|
|||
discard """
|
||||
line: 11
|
||||
line: 22
|
||||
errormgs: "type mismatch"
|
||||
"""
|
||||
|
||||
|
|
@ -7,9 +7,17 @@ type
|
|||
PObj = ref TObj not nil
|
||||
TObj = object
|
||||
x: int
|
||||
|
||||
MyString = string not nil
|
||||
|
||||
var x: PObj = nil
|
||||
#var x: PObj = nil
|
||||
|
||||
proc p(x: string not nil): int =
|
||||
result = 45
|
||||
|
||||
proc q(x: MyString) = nil
|
||||
proc q2(x: string) = nil
|
||||
|
||||
q2(nil)
|
||||
q(nil)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue