mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-12 14:23:45 +00:00
19 lines
402 B
Nim
19 lines
402 B
Nim
discard """
|
|
errormsg: "The Foo type requires the following fields to be initialized: bar, baz"
|
|
line: "17"
|
|
"""
|
|
{.experimental: "notnil".}
|
|
# bug #2355
|
|
type
|
|
Base = object of RootObj
|
|
baz: ref int not nil
|
|
|
|
Foo = object of Base
|
|
foo: ref int
|
|
bar: ref int not nil
|
|
|
|
var x: ref int = new(int)
|
|
# Create instance without initializing the `bar` field
|
|
var f = Foo(foo: x)
|
|
echo f.bar.isNil # true
|