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:
ringabout
2023-11-30 21:05:45 +08:00
committed by GitHub
parent 9140f8e221
commit b5f5b74fc8
15 changed files with 42 additions and 24 deletions

View File

@@ -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'''

View File

@@ -1,5 +1,5 @@
discard """
matrix: "--mm:arc -u:nimPreviewVtables"
matrix: "--mm:arc -d:nimInternalNonVtablesTesting"
output: '''
do nothing
'''

View File

@@ -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()