Skip to content

Commit

Permalink
Merge pull request #53 from alaviss/features/reduced-union-size
Browse files Browse the repository at this point in the history
uniontraits: remove RootObj from inheritance chain
  • Loading branch information
alaviss authored Sep 6, 2023
2 parents 5b6be04 + b829c52 commit 9bb2395
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion union.nimble
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Package

version = "0.1.5"
version = "0.2.0"
author = "Leorize"
description = "Anonymous unions in Nim"
license = "MIT"
Expand Down
3 changes: 2 additions & 1 deletion union/uniontraits.nim
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ import std/options
import typeutils

type
Union*[T] {.pure.} = object of RootObj
Union*[T] {.pure, inheritable.} = object
## Base type of which all unions inherit from.
##
## It has no properties other than being a typeclass for matching unions.
empty: byte ## Empty field, used to appease codegen

UnionTy* = distinct NimNode
## A distinct NimNode representing the type of an Union object.
Expand Down

0 comments on commit 9bb2395

Please sign in to comment.