Skip to content

Commit ca117e4

Browse files
authored
[nim/en] Fixed instantiation of the reference object (#5234)
1 parent 0dba59d commit ca117e4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

nim.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,11 @@ type
129129
130130
var
131131
defaultHouse = House() # initialize with default values
132-
defaultRoom = new Room() # create new instance of ref object
133-
sesameHouse = House(address: "123 Sesame St.", rooms: @[defaultRoom])
132+
defaultRoom = Room() # create new instance of ref object with default values
133+
134+
# Create and initialize instances with given values
135+
sesameRoom = Room(windows: 4, doors: 2)
136+
sesameHouse = House(address: "123 Sesame St.", rooms: @[sesameRoom])
134137
135138
# Enumerations allow a type to have one of a limited number of values
136139

0 commit comments

Comments
 (0)