make 'not nil' experimental
This commit is contained in:
parent
cc0ca43743
commit
599b5d6dcb
14 changed files with 27 additions and 16 deletions
|
|
@ -3,6 +3,7 @@ discard """
|
|||
"""
|
||||
|
||||
# bug #6682
|
||||
{.experimental: "notnil".}
|
||||
|
||||
type
|
||||
Fields = enum
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ discard """
|
|||
line: 22
|
||||
errormsg: "type mismatch"
|
||||
"""
|
||||
|
||||
{.experimental: "notnil".}
|
||||
type
|
||||
PObj = ref TObj not nil
|
||||
TObj = object
|
||||
|
|
@ -15,8 +15,8 @@ type
|
|||
proc p(x: string not nil): int =
|
||||
result = 45
|
||||
|
||||
proc q(x: MyString) = nil
|
||||
proc q2(x: string) = nil
|
||||
proc q(x: MyString) = discard
|
||||
proc q2(x: string) = discard
|
||||
|
||||
q2(nil)
|
||||
q(nil)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ discard """
|
|||
"""
|
||||
|
||||
import strutils
|
||||
|
||||
{.experimental: "notnil".}
|
||||
|
||||
type
|
||||
TObj = object
|
||||
|
|
@ -18,13 +18,13 @@ proc q(s: superstring) =
|
|||
echo s
|
||||
|
||||
proc p2() =
|
||||
var a: string = "I am not nil"
|
||||
var a: string = "I am not nil"
|
||||
q(a) # but this should and does not
|
||||
|
||||
p2()
|
||||
|
||||
proc q(x: pointer not nil) =
|
||||
nil
|
||||
discard
|
||||
|
||||
proc p() =
|
||||
var x: pointer
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ discard """
|
|||
"""
|
||||
|
||||
import strutils
|
||||
|
||||
{.experimental: "notnil".}
|
||||
|
||||
type
|
||||
TObj = object
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ discard """
|
|||
|
||||
# bug #584
|
||||
# Testprogram for 'not nil' check
|
||||
|
||||
{.experimental: "notnil".}
|
||||
const testWithResult = true
|
||||
|
||||
type
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ discard ""
|
|||
type
|
||||
TObj = ref object
|
||||
|
||||
{.experimental: "notnil".}
|
||||
|
||||
proc check(a: TObj not nil) =
|
||||
echo repr(a)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ discard """
|
|||
"""
|
||||
|
||||
# bug #2216
|
||||
{.experimental: "notnil".}
|
||||
|
||||
type
|
||||
A[T] = ref object
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ discard """
|
|||
errormsg: "fields not initialized: bar"
|
||||
line: "13"
|
||||
"""
|
||||
|
||||
{.experimental: "notnil".}
|
||||
# bug #2355
|
||||
type
|
||||
Foo = object
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue