diff options
author | ringabout <43030857+ringabout@users.noreply.github.com> | 2022-11-03 15:46:16 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-03 15:46:16 +0800 |
commit | c4e5dab4197ce57af03c5eaa6117b738279fa537 (patch) | |
tree | a9df84b105c6eede8ce20bf12215f7471b5096f4 /tests/objects/tobject_default_value.nim | |
parent | 6b1e353aa109756cefc961c8a91d1df49912ab51 (diff) | |
download | Nim-c4e5dab4197ce57af03c5eaa6117b738279fa537.tar.gz |
fixes #20740; fixes pre-existing field visibility issues and removes `efSkipFieldVisibilityCheck` (#20741)
fixes #20740 pre-existing field visibility and refactoring
Diffstat (limited to 'tests/objects/tobject_default_value.nim')
-rw-r--r-- | tests/objects/tobject_default_value.nim | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/objects/tobject_default_value.nim b/tests/objects/tobject_default_value.nim index 975a1e146..85be43daa 100644 --- a/tests/objects/tobject_default_value.nim +++ b/tests/objects/tobject_default_value.nim @@ -3,7 +3,7 @@ discard """ targets: "c cpp js" """ -import std/[times, tables] +import std/[times, tables, macros] type Guess = object @@ -457,5 +457,25 @@ template main {.dirty.} = var d = default(Bar) doAssert d.t == 0 + block: # bug #20740 + block: + proc foo(x: static DateTime = Datetime()) = + discard + + foo() + + block: + macro foo(x: static DateTime) = + discard x + + macro foo2: untyped = + var x = DateTime() + + result = quote do: + foo(`x`) + + foo2() + + static: main() main() |