Revert "Handle record types with when statements"

This reverts commit dfd6e349a6.
This commit is contained in:
Zahary Karadjov 2021-02-18 23:08:21 +02:00
parent 32fce5df8d
commit 261de741b7
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
1 changed files with 5 additions and 6 deletions

View File

@ -131,15 +131,14 @@ macro enumAllSerializedFieldsImpl(T: type, body: untyped): untyped =
result.add quote do: result.add quote do:
block: block:
when compiles(type(`field`)): `fieldNameDefs`
`fieldNameDefs`
type FieldType {.inject, used.} = type(`field`) type FieldType {.inject, used.} = type(`field`)
template fieldCaseDiscriminator: auto {.used.} = `discriminator` template fieldCaseDiscriminator: auto {.used.} = `discriminator`
template fieldCaseBranches: auto {.used.} = `branches` template fieldCaseBranches: auto {.used.} = `branches`
`body` `body`
i += 1 i += 1