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

[SR-13470] Misleading error message when two modules define the same property wrapper type #55912

Closed
sharplet opened this issue Aug 28, 2020 · 2 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation property wrappers Feature: property wrappers type checker Area → compiler: Semantic analysis

Comments

@sharplet
Copy link

Previous ID SR-13470
Radar None
Original Reporter @sharplet
Type Bug
Status Resolved
Resolution Done
Environment
% xcodebuild -version
Xcode 12.0
Build version 12A8189n

% swift --version
Apple Swift version 5.3 (swiftlang-1200.0.28.1 clang-1200.0.30.1)
Target: x86_64-apple-darwin20.0.0
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI, PropertyWrappers, TypeChecker
Assignee @theblixguy
Priority Medium

md5: c00c259a296359cbc996c3803bea28e2

Issue Description:

I'm experimenting with offering an @ObservedObject implementation in my module for use outside of SwiftUI. However, when both my module and SwiftUI are imported in the same file, this misleading error message is produced:

Sources/App/ProfileViewController.swift:7:3: error: unknown attribute 'ObservedObject'
  @ObservedObject var viewModel: ProfileViewModel
  ^

It's still possible to use the module name to disambiguate, but the existing diagnostic is misleading.

@theblixguy
Copy link
Collaborator

Thanks for reporting! I have opened a PR to offer better diagnostics: #33688

@theblixguy
Copy link
Collaborator

@sharplet This is now fixed on master. Please verify using next available trunk snapshot from swift.org and mark the ticket as resolved![]( Thank you)

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
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. compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation property wrappers Feature: property wrappers type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

2 participants