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

Static property (mehtod) added by ExtensionMacro is not visible to compiler #68515

Open
red-beeard opened this issue Sep 14, 2023 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. swift macro Feature → declarations: Swift `macro` declarations

Comments

@red-beeard
Copy link

red-beeard commented Sep 14, 2023

Description
When I try to access a static property (function) from another file, I get an error: "Type 'TypeName' has no member 'member'".

Steps to reproduce

  1. Create a macro that generates a static property or method
  2. Attach the macro to the model
  3. Access a static method or property from another file

Expected behavior
The code compiles without errors.

Снимок экрана 2023-09-14 в 12 49 35 Снимок экрана 2023-09-14 в 12 49 55

Environment

  • Swift compiler version info swift-driver version: 1.87.1 Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1) Target: x86_64-apple-macosx13.0
  • Xcode version info: Xcode 15.0 Build version 15A240d
  • Deployment target: iOS 17.0

Additional context

Swift forum topic
A demo that reproduces this problem

@red-beeard red-beeard added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels labels Sep 14, 2023
@ahoppen ahoppen added swift macro Feature → declarations: Swift `macro` declarations bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. and removed bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels labels Sep 23, 2023
@red-beeard
Copy link
Author

Still reproduce with environment

  • Swift compiler version info: 1.87.3 Apple Swift version 5.9.2 (swiftlang-5.9.2.2.51 clang-1500.1.0.2.2) Target: arm64-apple-macosx14.0
  • Xcode version info: Xcode 15.1 Build version 15C5042i
  • Deployment target: iOS 17.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. swift macro Feature → declarations: Swift `macro` declarations
Projects
None yet
Development

No branches or pull requests

2 participants