adds a test case

This commit is contained in:
ringabout
2025-12-23 22:59:55 +08:00
parent 7fc4a55819
commit 6f1e9752c5

View File

@@ -0,0 +1,29 @@
discard """
nimout: '''
tisolaterefc.nim(20, 20) Warning: 'string' containing garbage-collected types cannot be isolated in refc [GcIsolated]
tisolaterefc.nim(21, 25) Warning: 'ptr string' containing garbage-collected types cannot be isolated in refc [GcIsolated]
tisolaterefc.nim(22, 20) Warning: 'Foo' containing garbage-collected types cannot be isolated in refc [GcIsolated]
tisolaterefc.nim(23, 25) Warning: 'ptr Foo' containing garbage-collected types cannot be isolated in refc [GcIsolated]
'''
matrix: "--mm:refc"
"""
import std/isolation
type
Foo = object
id: ptr string
proc foo() =
var x = Foo()
var m = "24e"
var s1 = isolate(m)
var s2 = isolate(addr m)
var s3 = isolate(x)
var s4 = isolate(addr x)
discard s1
discard s2
discard s3
discard s4
foo()