mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-04 10:54:42 +00:00
adds support for noDecl in constructor (#22811)
Notice the test wouldnt link before
This commit is contained in:
@@ -16,6 +16,7 @@ ___
|
||||
777
|
||||
10
|
||||
123
|
||||
()
|
||||
'''
|
||||
"""
|
||||
|
||||
@@ -106,4 +107,12 @@ proc init =
|
||||
n.x = 123
|
||||
echo n.x
|
||||
|
||||
init()
|
||||
init()
|
||||
|
||||
#tests that the ctor is not declared with nodecl.
|
||||
#nodelc also prevents the creation of a default one when another is created.
|
||||
type Foo {.exportc.} = object
|
||||
|
||||
proc makeFoo(): Foo {.used, constructor, nodecl.} = discard
|
||||
|
||||
echo $Foo()
|
||||
Reference in New Issue
Block a user