fixes #2355
This commit is contained in:
parent
bd56d36326
commit
165619552a
2 changed files with 16 additions and 1 deletions
14
tests/notnil/tnotnil_in_objconstr.nim
Normal file
14
tests/notnil/tnotnil_in_objconstr.nim
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
discard """
|
||||
errormsg: "field not initialized: bar"
|
||||
line: "13"
|
||||
"""
|
||||
|
||||
# bug #2355
|
||||
type
|
||||
Foo = object
|
||||
foo: string not nil
|
||||
bar: string not nil
|
||||
|
||||
# Create instance without initializaing the `bar` field
|
||||
var f = Foo(foo: "foo")
|
||||
echo f.bar.isNil # true
|
||||
Loading…
Add table
Add a link
Reference in a new issue