mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-04 12:07:51 +00:00
fixes #23129
(cherry picked from commit 62c5b8b287)
This commit is contained in:
@@ -1173,7 +1173,12 @@ proc produceSym(g: ModuleGraph; c: PContext; typ: PType; kind: TTypeAttachedOp;
|
||||
# bug #19205: Do not forget to also copy the hidden type field:
|
||||
genTypeFieldCopy(a, typ, result.ast[bodyPos], d, src)
|
||||
|
||||
if not a.canRaise: incl result.flags, sfNeverRaises
|
||||
if not a.canRaise:
|
||||
incl result.flags, sfNeverRaises
|
||||
result.ast[pragmasPos] = newNodeI(nkPragma, info)
|
||||
result.ast[pragmasPos].add newTree(nkExprColonExpr,
|
||||
newIdentNode(g.cache.getIdent("raises"), info), newNodeI(nkBracket, info))
|
||||
|
||||
completePartialOp(g, idgen.module, typ, kind, result)
|
||||
|
||||
|
||||
|
||||
16
tests/effects/thooks.nim
Normal file
16
tests/effects/thooks.nim
Normal file
@@ -0,0 +1,16 @@
|
||||
discard """
|
||||
matrix: "--warningAsError:Effect"
|
||||
"""
|
||||
|
||||
import std/isolation
|
||||
|
||||
# bug #23129
|
||||
type
|
||||
Thing = object
|
||||
x: string
|
||||
|
||||
proc send(x: string) =
|
||||
let wrapper = Thing(x: x)
|
||||
discard isolate(wrapper)
|
||||
|
||||
send("la")
|
||||
Reference in New Issue
Block a user