diff options
Diffstat (limited to 'tests/objects/tobject3.nim')
-rw-r--r-- | tests/objects/tobject3.nim | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/objects/tobject3.nim b/tests/objects/tobject3.nim index 15dd8ea24..9ff1743ce 100644 --- a/tests/objects/tobject3.nim +++ b/tests/objects/tobject3.nim @@ -1,3 +1,10 @@ +discard """ + output: '''TBar2 +TFoo +''' +""" + +## XXX this output needs to be adapted for VCC which produces different results. # It turned out that it's hard to generate correct for these two test cases at # the same time. @@ -57,3 +64,32 @@ var aa = makeWindow() thisCausesError(dd, aa) +# bug #5892 +type + Foo6 = distinct array[4, float32] + AnotherFoo = distinct array[4, float32] + + AbstractAnimationSampler* = ref object of RootObj + + AnimationSampler*[T] = ref object of AbstractAnimationSampler + sampleImpl: proc(s: AnimationSampler[T], p: float): T + + ArrayAnimationSampler*[T] = ref object of AnimationSampler[T] + +proc newArrayAnimationSampler*[T](): ArrayAnimationSampler[T] = + result.new() + result.sampleImpl = nil + +discard newArrayAnimationSampler[Foo6]() +discard newArrayAnimationSampler[AnotherFoo]() + +type + DefaultIsNone* = pointer | ptr | ref | proc {.nimcall.} | cstring | cstringArray + OptionKind* {.pure.} = enum None, Some + OptionA* [T] = object of RootObj + when T is DefaultIsNone: + value: T + else: + value: T + kind: OptionKind + SomeA* [T] = object of OptionA[T] |