mirror of
https://github.com/nim-lang/Nim.git
synced 2026-05-02 03:54:44 +00:00
enable vtable implementation for C++ and make it an experimental feature (#23004)
follow up https://github.com/nim-lang/Nim/pull/22991 - [x] turning it into an experimental feature --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
discard """
|
||||
matrix: "--mm:arc --multimethods:on -u:nimPreviewVtables; --mm:refc --multimethods:on -u:nimPreviewVtables"
|
||||
matrix: "--mm:arc --multimethods:on -d:nimInternalNonVtablesTesting; --mm:refc --multimethods:on -d:nimInternalNonVtablesTesting"
|
||||
output: '''wow2
|
||||
X 1
|
||||
X 3'''
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
discard """
|
||||
matrix: "--mm:arc -u:nimPreviewVtables"
|
||||
matrix: "--mm:arc -d:nimInternalNonVtablesTesting"
|
||||
output: '''
|
||||
do nothing
|
||||
'''
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
discard """
|
||||
targets: "c cpp"
|
||||
"""
|
||||
|
||||
type FooBase = ref object of RootObj
|
||||
dummy: int
|
||||
type Foo = ref object of FooBase
|
||||
@@ -15,5 +19,6 @@ method bar(x: Foo2, a: float32) =
|
||||
proc test() =
|
||||
var x = new Foo2
|
||||
x.bar(2.3)
|
||||
doAssert x.value <= 2.3
|
||||
|
||||
test()
|
||||
Reference in New Issue
Block a user