apple / apple/FHIRModels

Package observation seems to collide with SwiftUI @Observable.

Open
#31 1 comment 1 reaction 0 assignees View on GitHub
bug
Dominant language
Swift
Stars
209
Forks
36
PR merge metrics
No merged PRs in 30d

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.