fixes #7637; assignments are not allowed to slice object; minor breaking change
This commit is contained in:
parent
14046d975d
commit
85ea9593b3
5 changed files with 46 additions and 15 deletions
|
|
@ -1,9 +1,7 @@
|
|||
discard """
|
||||
output: '''tbObj of TC false
|
||||
false
|
||||
output: '''tbObj of TC true
|
||||
true
|
||||
5
|
||||
false'''
|
||||
5'''
|
||||
"""
|
||||
|
||||
# bug #1053
|
||||
|
|
@ -20,10 +18,10 @@ type
|
|||
proc test(p: TA) =
|
||||
#echo "p of TB ", p of TB
|
||||
if p of TB:
|
||||
var tbObj = TB(p)
|
||||
#var tbObj = TB(p)
|
||||
|
||||
# tbObj is actually no longer compatible with TC:
|
||||
echo "tbObj of TC ", tbObj of TC
|
||||
echo "tbObj of TC ", p of TC
|
||||
|
||||
var v = TC()
|
||||
v.a = 1
|
||||
|
|
@ -48,8 +46,8 @@ proc isMyObject(obj: TObject) =
|
|||
|
||||
asd.x = 5
|
||||
|
||||
var asdCopy = TObject(asd)
|
||||
echo asdCopy of MyObject
|
||||
#var asdCopy = TObject(asd)
|
||||
#echo asdCopy of MyObject
|
||||
|
||||
isMyObject(asd)
|
||||
isMyObject(asdCopy)
|
||||
#isMyObject(asdCopy)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue