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

SwiftUI TextField with format: .measurement failed to produce diagnostic #59477

Open
simonseyer opened this issue Jun 15, 2022 · 0 comments
Open
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 failed to produce diagnostic Bug → internal error: Failed to produce diagnostic for expression SwiftUI Flag: Related to (but not an issue with) SwiftUI type checker Area → compiler: Semantic analysis

Comments

@simonseyer
Copy link

Describe the bug
When compiling the following code:

import SwiftUI

struct ContentView: View {
    @State var value = Measurement<UnitMass>(value: 0, unit: .kilograms)
    
    var body: some View {
        TextField("", value: $value, format: .measurement)
    }
}

the compilation fails with:

Test.swift:6:25: error: failed to produce diagnostic for expression; please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project
    var body: some View {

To Reproduce
Compile the code above with swiftc or in Xcode.

Expected behavior
Compilation succeeds (or produces an actionable error)

Environment (please complete the following information):

  • OS: macOS 12.4 (21F79)
  • Xcode Version/Tag/Branch:
    • swift-driver version: 1.45.2 Apple Swift version 5.6.1 (swiftlang-5.6.0.323.66 clang-1316.0.20.12)
    • swift-driver version: 1.55.1 Apple Swift version 5.7 (swiftlang-5.7.0.113.202 clang-1400.0.16.2)
@simonseyer simonseyer added the bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. label Jun 15, 2022
@simonseyer simonseyer changed the title SwiftUI TextField with format: .measurement failed to produce diagnostic SwiftUI TextField with format: .measurement failed to produce diagnostic Jun 15, 2022
@AnthonyLatsis AnthonyLatsis added diagnostics QoI Bug: Diagnostics Quality of Implementation failed to produce diagnostic Bug → internal error: Failed to produce diagnostic for expression compiler The Swift compiler in itself type checker Area → compiler: Semantic analysis SwiftUI Flag: Related to (but not an issue with) SwiftUI labels Dec 22, 2022
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 failed to produce diagnostic Bug → internal error: Failed to produce diagnostic for expression SwiftUI Flag: Related to (but not an issue with) SwiftUI type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

2 participants