new feature: package level objects
This commit is contained in:
parent
7889692523
commit
c17f6c7837
9 changed files with 93 additions and 11 deletions
19
tests/package_level_objects/tusefoo2.nim
Normal file
19
tests/package_level_objects/tusefoo2.nim
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
discard """
|
||||
output: '''compiles'''
|
||||
"""
|
||||
|
||||
# Test that the object type does not need to be resolved at all:
|
||||
|
||||
type
|
||||
mypackage.Foo = object
|
||||
Other = proc (inp: Foo)
|
||||
|
||||
Node = ref object
|
||||
external: ptr Foo
|
||||
data: string
|
||||
|
||||
var x: Node
|
||||
new(x)
|
||||
x.data = "compiles"
|
||||
|
||||
echo x.data
|
||||
Loading…
Add table
Add a link
Reference in a new issue