mirror of
https://github.com/nim-lang/Nim.git
synced 2026-08-29 10:01:39 +00:00
fixes #23524 ```nim proc isAnalysableFieldAccess*(orig: PNode; owner: PSym): bool = ... result = n.kind == nkSym and n.sym.owner == owner and {sfGlobal, sfThread, sfCursor} * n.sym.flags == {} and (n.sym.kind != skParam or isSinkParam(n.sym)) ``` In `isAnalysableFieldAccess`, globals, cursors are already rejected
This commit is contained in:
@@ -727,3 +727,18 @@ block: # bug #23505
|
||||
|
||||
discard init(C)
|
||||
|
||||
block: # bug #23524
|
||||
type MyType = object
|
||||
a: int
|
||||
|
||||
proc `=destroy`(typ: MyType) = discard
|
||||
|
||||
var t1 = MyType(a: 100)
|
||||
var t2 = t1 # Should be a copy?
|
||||
|
||||
proc main() =
|
||||
t2 = t1
|
||||
doAssert t1.a == 100
|
||||
doAssert t2.a == 100
|
||||
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user