4 ms·
I’ve noticed that when editing the ContentView in SwiftUI, errors will sometimes be attached to a totally unrelated line (OTOH, forgetting to unwrap an optional
by stirner 7y ago
I’ve noticed that when editing the ContentView in SwiftUI, errors will sometimes be attached to a totally unrelated line (OTOH, forgetting to unwrap an optional returned by NumberFormatter.string() showed
type of expression is ambiguous without more context
on a straightforward Text() expression halfway up the file). The only way to find the actual source of the error is to undo every change until the error disappears, and coupled with sluggish compilation times this becomes a real pain. I hope they address this issue as part of their improvements.
- msbarnett 7y agoThis is literally given as an example in the article. No hope required.
- deleted 7y ago[deleted]
- stirner 7y agoOh wow, you’re right, at the very top. Skimmed right over that. Thanks for pointing it out. I guess SwiftUI exacerbates the problem since expressions are necessarily very deeply nested.
- msbarnett 7y agoThe last example in the SwiftUI section is also an “ambiguous type expression” example with a fairly complex nested view. It seems to be a problematic diagnostic they have particularly focused on resolving.