This commit is contained in:
Andreas Rumpf 2019-05-28 22:00:01 +02:00 • committed by GitHub
commit e68adca0c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 2 deletions

View file

@ -0,0 +1,25 @@
discard """
output: '''Inh
45'''
"""
type
Base = ref object of RootObj
field: int
Inh = ref object of Base
# bug #6777
method foo(b: Base): var int {.base.} =
echo "Base"
result = b.field
method foo(b: Inh): var int =
echo "Inh"
result = b.field
var x: Base
var y = Inh(field: 45)
x = y
echo foo(x)