make 'not nil' experimental

This commit is contained in:
Andreas Rumpf 2018-05-01 10:48:46 +02:00 • committed by Araq
commit 599b5d6dcb
14 changed files with 27 additions and 16 deletions

View file

@ -3,6 +3,7 @@ discard """
"""
# bug #6682
{.experimental: "notnil".}
type
Fields = enum

View file

@ -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)

View file

@ -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

View file

@ -4,7 +4,7 @@ discard """
"""
import strutils
{.experimental: "notnil".}
type
TObj = object

View file

@ -5,7 +5,7 @@ discard """
# bug #584
# Testprogram for 'not nil' check
{.experimental: "notnil".}
const testWithResult = true
type

View file

@ -2,6 +2,8 @@ discard ""
type
TObj = ref object
{.experimental: "notnil".}
proc check(a: TObj not nil) =
echo repr(a)

View file

@ -3,6 +3,7 @@ discard """
"""
# bug #2216
{.experimental: "notnil".}
type
A[T] = ref object

View file

@ -2,7 +2,7 @@ discard """
errormsg: "fields not initialized: bar"
line: "13"
"""
{.experimental: "notnil".}
# bug #2355
type
Foo = object