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

[SR-15435] Extracting view from Gauge view initializer causes unknown error. #57741

Open
swift-ci opened this issue Nov 4, 2021 · 0 comments
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

@swift-ci
Copy link
Collaborator

swift-ci commented Nov 4, 2021

Previous ID SR-15435
Radar None
Original Reporter BenMcEnulty (JIRA User)
Type Bug
Additional Detail from JIRA
Votes 0
Component/s
Labels Bug
Assignee None
Priority Medium

md5: 2cefec8b795466261f7f6fd74f37b25d

Issue Description:

This code compiles:

import SwiftUI
struct GaugeSample: View {
 var body: some View {
  Gauge(value: 7, in: 0...10) {
   Text("Label")
  } currentValueLabel: {
   Text("7")
  } minimumValueLabel: {
   Text("0").foregroundColor(.red)
  } maximumValueLabel: {
   Text("10").foregroundColor(.green)
  }
 }
}

But if I try to extract the view from either minimumValueLabel or maximumValueLabel I get "Failed to produce diagnostic for expression"

import SwiftUI
struct GaugeSample: View {
 var body: some View {
  Gauge(value: 7, in: 0...10) {
   Text("Label")
  } currentValueLabel: {
   Text("7")
  } minimumValueLabel: {
   ExtractedView()
  } maximumValueLabel: {
   Text("10").foregroundColor(.green) 
  }
 }
}
struct ExtractedView: View {
 var body: some View {
  Text("0").foregroundColor(.red)
 }
}

It is unique to minimumValueLabel and maximumValueLabel. Extracting out the view from currentValueLabel does not cause this error.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added SwiftUI Flag: Related to (but not an issue with) SwiftUI 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 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