Fix semfold handling of {.str/int/bool-define.} (#13964)

This commit is contained in:
Oscar Nihlgård 2020-04-13 14:22:33 +02:00 • committed by GitHub
commit 255698deee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 0 deletions

View file

@ -16,3 +16,15 @@ doAssert booldef
doAssert not booldef2
doAssert intdef == 2
doAssert strdef == "foobar"
# Intentionally not defined from command line
const booldef3 {.booldefine.} = true
const intdef2 {.intdefine.} = 1
const strdef2 {.strdefine.} = "abc"
type T = object
when booldef3:
field1: int
when intdef2 == 1:
field2: int
when strdef2 == "abc":
field3: int