mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-14 23:33:28 +00:00
* fix megatest newlines * still allow missing trailing newline for now but in a more strict way than before
29 lines
302 B
Nim
29 lines
302 B
Nim
discard """
|
|
output: '''
|
|
|
|
|
|
|
|
'''
|
|
"""
|
|
|
|
type Bar = object
|
|
s1, s2: string
|
|
|
|
proc initBar(): Bar = discard
|
|
|
|
var a: array[5, Bar]
|
|
a[0].s1 = "hey"
|
|
a[0] = initBar()
|
|
echo a[0].s1
|
|
|
|
type Foo = object
|
|
b: Bar
|
|
var f: Foo
|
|
f.b.s1 = "hi"
|
|
f.b = initBar()
|
|
echo f.b.s1
|
|
|
|
var ad = addr f.b
|
|
ad[] = initBar()
|
|
echo ad[].s1
|