mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 05:50:30 +00:00
fix when statements in inheritable generic objects (#13667) [backport]
(cherry picked from commit 51bd442b88)
This commit is contained in:
committed by
narimiran
parent
17ae3016c7
commit
6f79408576
@@ -82,3 +82,14 @@ proc newArrayAnimationSampler*[T](): ArrayAnimationSampler[T] =
|
||||
|
||||
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]
|
||||
|
||||
Reference in New Issue
Block a user