Typeinfo Mk 2

Run Settings
LanguageNim
Language Version
Run Command
import typeinfo type Parent = object of RootObj x: int Child = object of Parent y: string type CustomAny* = object value: pointer rawType: pointer proc customToAny*[T](x: var T): CustomAny {.inline.} = result = cast[CustomAny](toAny(x)) proc compareRuntimeTypes[A, B](a: var A, b: var B): bool = result = customToAny(a).rawType == customToAny(b).rawType var x = Parent(x: 4) var y = Child(x: 4, y:"Hello") var z = Parent(x: 6) echo compareRuntimeTypes(x, y) echo compareRuntimeTypes(x, z)
Editor Settings
Theme
Key bindings
Full width
Lines