Skip to content

Conversation

amayers
Copy link
Contributor

@amayers amayers commented Jul 15, 2025

https://square.slack.com/archives/CBZJ5V163/p1751313246347059
UI-8947

When you have a screen with a model type of ActionModel<MyWorkflow.State, MyWorkflow.Action>, you were unable to use a let or computed var property on your state model, and reference it on that screen. If you did you would get a compiler error of Cannot assign to property: 'enableDoneButton' is a 'let' constant, even if you were only trying to read the property.

Checklist

  • Unit Tests - There aren't any tests of ObservableModel in the codebase currently. As I'm not very familiar with this codebase, I don't know how to really make a useful test here.
  • UI Tests
  • Snapshot Tests (iOS only)
  • I have made corresponding changes to the documentation

@amayers amayers requested a review from watt July 15, 2025 13:11
@amayers amayers requested review from a team as code owners July 15, 2025 13:11
@amayers amayers merged commit ab3afe8 into square:main Jul 15, 2025
14 of 15 checks passed
@amayers amayers deleted the observable_model_read branch July 15, 2025 14:55
@jamieQ
Copy link
Contributor

jamieQ commented Jul 15, 2025

i think a reasonable test for this would just be an example that previously did not compile, but then does after the change

@jamieQ
Copy link
Contributor

jamieQ commented Jul 16, 2025

for visibility, i believe this is the issue we ran into: swiftlang/swift#56385

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

Successfully merging this pull request may close these issues.

4 participants