make tests green again

This commit is contained in:
Araq 2018-08-13 23:16:03 +02:00
commit f91a181f58
8 changed files with 18 additions and 55 deletions

View file

@ -9,7 +9,6 @@ discard """
type
MyPointer = distinct pointer
MyString = distinct string
MyStringNotNil = distinct (string not nil)
MyInt = distinct int
proc foo(a: MyPointer) =
@ -26,20 +25,6 @@ p = cast[MyPointer](nil)
p = nil.MyPointer
p = nil
var c: MyString
c = "Test".MyString
c = nil.MyString
c = nil
p = nil
doAssert(compiles(c = p) == false)
var n: MyStringNotNil = "Test".MyStringNotNil # Cannot prove warning ...
n = "Test".MyStringNotNil
doAssert(compiles(n = nil.MyStringNotNil) == false)
doAssert(compiles(n = nil.MyStringNotNil) == false)
doAssert(compiles(n = nil) == false)
var i: MyInt
i = 1.MyInt
doAssert(compiles(i = nil) == false)