Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hasCustomPragma stops working after typedesc is copied #23564

Open
etan-status opened this issue May 3, 2024 · 0 comments
Open

hasCustomPragma stops working after typedesc is copied #23564

etan-status opened this issue May 3, 2024 · 0 comments

Comments

@etan-status
Copy link
Contributor

Description

import std/macros

template p {.pragma.}

func foo[T0](v: T0): bool =
  type T = T0
  T.hasCustomPragma(p)

type X {.p.} = object
echo $foo(X())

Nim Version

% nim -v
Nim Compiler Version 2.0.5 [MacOSX: amd64]
Compiled at 2024-05-03
Copyright (c) 2006-2023 by Andreas Rumpf

git hash: fcb8461efab2ef7bdd976f82af8c7d1390f502ac
active boot switches: -d:release
% nim -v      
Nim Compiler Version 1.6.20 [MacOSX: amd64]
Compiled at 2024-04-29
Copyright (c) 2006-2023 by Andreas Rumpf

git hash: 19fdbfc173bfccb64cb64e0a963e69f52f71fc73
active boot switches: -d:release

Current Output

false

Expected Output

true

Possible Solution

On T0, hasCustomPragma works fine. It's only broken on type T = T0.

Additional Information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant