diff options
author | andri lim <jangko128@gmail.com> | 2017-11-19 19:12:26 +0700 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-11-19 13:12:26 +0100 |
commit | b174e9f42a359e185c5178d22d21887b5cb35ac3 (patch) | |
tree | fcb375a80e35094372434a730ec6ed47d05dd4f7 /tests | |
parent | 035f0fb023d4b8fddc838eb9b11b1385afa7e25e (diff) | |
download | Nim-b174e9f42a359e185c5178d22d21887b5cb35ac3.tar.gz |
fixes #5521 object variants superclass trigger bad codegen (#6120)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/types/tinheritref.nim | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/tests/types/tinheritref.nim b/tests/types/tinheritref.nim index ecd62a06f..00af0538d 100644 --- a/tests/types/tinheritref.nim +++ b/tests/types/tinheritref.nim @@ -1,5 +1,7 @@ discard """ - output: "23" + output: '''23 +1.5 +''' """ # bug #554, #179 @@ -25,3 +27,24 @@ type var it: TKeysIterator[int, string] = nil +#bug #5521 +type + Texture = enum + Smooth + Coarse + + FruitBase = object of RootObj + color: int + case kind: Texture + of Smooth: + skin: float64 + of Coarse: + grain: int + + Apple = object of FruitBase + width: int + taste: float64 + +var x = Apple(kind: Smooth, skin: 1.5) +var u = x.skin +echo u |