summary refs log tree commit diff stats
path: root/tests/run/tobjasgn.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2013-09-10 22:04:12 +0200
committerAraq <rumpf_a@web.de>2013-09-10 22:04:12 +0200
commit275c7ccf82e03622258c135890c0419e70ee0884 (patch)
tree986a3e9a990c26dc9b0ad6fedbbdfd1ac49f3d9d /tests/run/tobjasgn.nim
parent138db5a85d1cb613d126241139471e849150ca05 (diff)
downloadNim-275c7ccf82e03622258c135890c0419e70ee0884.tar.gz
fixes #575
Diffstat (limited to 'tests/run/tobjasgn.nim')
-rw-r--r--tests/run/tobjasgn.nim39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/run/tobjasgn.nim b/tests/run/tobjasgn.nim
new file mode 100644
index 000000000..5f411063f
--- /dev/null
+++ b/tests/run/tobjasgn.nim
@@ -0,0 +1,39 @@
+discard """
+  output: '''0
+pre test a:test b:1 c:2 haha:3
+assignment test a:test b:1 c:2 haha:3
+'''
+"""
+
+type TSomeObj = object of TObject
+  Variable: int
+ 
+var a = TSomeObj()
+ 
+echo a.Variable.`$`
+
+# bug #575
+
+type
+  Something = object of Tobject
+    a: string
+    b, c: int32
+
+type
+  Other = object of Something
+    haha: int
+
+proc `$`(x: Other): string =
+  result = "a:" & x.a & " b:" & $x.b & " c:" & $x.c & " haha:" & $x.haha
+
+var
+  t: Other
+
+t.a = "test"
+t.b = 1
+t.c = 2
+t.haha = 3
+
+echo "pre test ", $t
+var x = t
+echo "assignment test ", x
Fredrik Høisæther Rasch <fredrik.rasch@gmail.com> 2017-08-08 21:37:37 +0200 Added Windows and VCC build artifacts to gitignore' href='/ahoang/Nim/commit/.gitignore?h=devel&id=fe0f10f6b42d8bad08b17e38917209a81619e3b6'>fe0f10f6b ^
0879f0b0a ^
0879f0b0a ^
1b1bb284d ^
0879f0b0a ^

5263d9d6f ^
93e03144f ^
1b1bb284d ^





2f48dbd16 ^
0879f0b0a ^
180ab350d ^
d20a8ac68 ^
b2e486b23 ^
9af85fb69 ^
1b1bb284d ^
1dd9ec85b ^
f2f16f645 ^






ca4b971bc ^
f2f16f645 ^


f04b502cf ^

9b29436f6 ^
f04b502cf ^

5a4122dc9 ^
809a4a77a ^

e9b665f33 ^

c60bb9464 ^
e9b665f33 ^

f04b502cf ^
1b1bb284d ^
809a4a77a ^

b77ae66e8 ^
93cd98dd1 ^
5263d9d6f ^



035f0fb02 ^
8d2953e80 ^
035f0fb02 ^

8d2953e80 ^
e9b665f33 ^
a5ecbf823 ^


4a720394b ^



88b5dd336 ^
c5c6bae2a ^

e5ae7ceaa ^
6e4cd3e5b ^

e5ae7ceaa ^

1b54be777 ^
567691220 ^

58282547f ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99