fixes #837
This commit is contained in:
parent
5ab3542c18
commit
326bdae8ca
6 changed files with 61 additions and 16 deletions
|
|
@ -1,5 +1,9 @@
|
|||
|
||||
# It turned out that it's hard to generate correct for these two test cases at
|
||||
# the same time.
|
||||
|
||||
type
|
||||
TFoo = ref object of TObject
|
||||
TFoo = ref object of RootObj
|
||||
Data: int
|
||||
TBar = ref object of TFoo
|
||||
nil
|
||||
|
|
@ -26,3 +30,30 @@ var b: TBar2
|
|||
new(b)
|
||||
|
||||
Foo(b)
|
||||
|
||||
# bug #837
|
||||
type
|
||||
PView* = ref TView
|
||||
TView* {.inheritable.} = object
|
||||
data: int
|
||||
|
||||
PWindow* = ref TWindow
|
||||
TWindow* = object of TView
|
||||
data3: int
|
||||
|
||||
PDesktop* = ref TDesktop
|
||||
TDesktop* = object of TView
|
||||
data2: int
|
||||
|
||||
proc makeDesktop(): PDesktop = new(TDesktop)
|
||||
|
||||
proc makeWindow(): PWindow = new(TWindow)
|
||||
|
||||
proc thisCausesError(a: var PView, b: PView) =
|
||||
discard
|
||||
|
||||
var dd = makeDesktop()
|
||||
var aa = makeWindow()
|
||||
|
||||
thisCausesError(dd, aa)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue