Package observation seems to collide with SwiftUI @Observable.
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- swift
- Domain
- mobile-dev
Research direction
Start with the minimal reproduction using SwiftUI, ModelsDSTU2, and ModelsR4, and confirm the ambiguous Observation error when declaring an @Observable class. Trace the conflicting package declarations and verify that the reproduction compiles without the workaround of moving associated code into a separate extension file.
Written by the indexing model from the issue text.
Description
I think I'm going crazy here but after importing
import ModelsDSTU2
import ModelsR4
in a project it stops compiling with some obscure errors. From what I can make out, it seems the classes defined in the package clash with the SwiftUI @Observable macro:
/var/folders/rt/5jrx9dk91r17__4r2tm3m01w0000gn/T/swift-generated-sources/@__swiftmacro_6cardya13HKDataManager10ObservablefMe_.swift:1:26 'Observation' is ambiguous for type lookup in this context
A minimal reproduction of this error:
import SwiftUI
import ModelsDSTU2
import ModelsR4
@Observable class TestClass {}
The quickest work around has been to move all associated code to a separate file in an extension.
- Dominant language
- Swift
- Stars
- 209
- Forks
- 36
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apple/FHIRModels
-
apple/FHIRModels#45 · 1 reaction · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
apple/FHIRModels#44 · 1 comment · 1 reaction ·
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 52/100
apple/FHIRModels#42 ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
apple/FHIRModels#41 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
apple/FHIRModels#40 · 6 comments ·
All issues in apple/FHIRModels
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
type: docs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
googleapis/google-cloud-swift#971 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bitcoindevkit/bdk-ffi#1125 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mozilla-mobile/firefox-ios#35743 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
manaflow-ai/cmux#13417 ·