parent
62c113ebc7
commit
83e715c5b6
5 changed files with 46 additions and 15 deletions
|
|
@ -98,13 +98,13 @@ expression: fun1(default(Mystring), "asdf")
|
|||
|
||||
|
||||
## line 100
|
||||
block:
|
||||
when true:
|
||||
# bug #11061 Type mismatch error "first type mismatch at" points to wrong argument/position
|
||||
# Note: the error msg now gives correct position for mismatched argument
|
||||
type
|
||||
A = object of RootObj
|
||||
B = object of A
|
||||
|
||||
block:
|
||||
proc f(b: B) = discard
|
||||
proc f(a: A) = discard
|
||||
|
||||
|
|
@ -163,7 +163,7 @@ block:
|
|||
var foo = ""
|
||||
f(foo, a0 = 12)
|
||||
|
||||
block:
|
||||
when true:
|
||||
type Mystring = string
|
||||
type MyInt = int
|
||||
proc fun1(a1: MyInt, a2: Mystring) = discard
|
||||
|
|
|
|||
|
|
@ -28,11 +28,11 @@ expression: foo 1
|
|||
|
||||
|
||||
# line 30
|
||||
|
||||
type Foo = object
|
||||
block: # issue #13182
|
||||
proc myproc(a: int): string = $("myproc", a)
|
||||
proc foo(args: varargs[string, myproc]): string = $args
|
||||
type Foo = object
|
||||
|
||||
proc foo(i: Foo): string = "in foo(i)"
|
||||
static: doAssert foo(Foo()) == "in foo(i)"
|
||||
static: doAssert foo(1) == """["(\"myproc\", 1)"]"""
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ ptr Foo
|
|||
(member: 123.456)
|
||||
(member: "hello world", x: ...)
|
||||
(member: 123.456, x: ...)
|
||||
0
|
||||
false
|
||||
'''
|
||||
joinable: false
|
||||
"""
|
||||
|
|
@ -78,3 +80,31 @@ block t7905:
|
|||
|
||||
foobarRec("hello world")
|
||||
foobarRec(123.456'f64)
|
||||
|
||||
# bug #5170
|
||||
|
||||
when true:
|
||||
type Foo = object
|
||||
bar: bool
|
||||
|
||||
type Bar = object
|
||||
sameBody: string
|
||||
|
||||
var b0: Bar
|
||||
b0.sameBody = "abc"
|
||||
|
||||
block:
|
||||
type Foo = object
|
||||
baz: int
|
||||
|
||||
type Bar = object
|
||||
sameBody: string
|
||||
|
||||
var b1: Bar
|
||||
b1.sameBody = "def"
|
||||
|
||||
var f2: Foo
|
||||
echo f2.baz
|
||||
|
||||
var f1: Foo
|
||||
echo f1.bar
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue