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-14727] Failed to produce diagnostic when extending SceneBuilder to have buildEither #57077

Open
swift-ci opened this issue Jun 5, 2021 · 1 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 type checker Area → compiler: Semantic analysis

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Jun 5, 2021

Previous ID SR-14727
Radar rdar://problem/79092863
Original Reporter cherryblossom (JIRA User)
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI, TypeChecker
Assignee None
Priority Medium

md5: 7f6940a232b02903ccf0e07df643b735

Issue Description:

This probably isn't the right way to do it and I'm pretty new to result builders, but this shouldn't cause a compiler error.

import SwiftUI

struct S: Scene {
  var body: some Scene {
    if true {
      WindowGroup {}
    } else {
      WindowGroup {}
    }
  }
}

extension SceneBuilder {
  static func buildEither<S: Scene>(first component: S) -> some Scene {
    component
  }

  static func buildEither<S: Scene>(second component: S) -> some Scene {
    component
  }
}

Compiling with

@typesanitizer
Copy link

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 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 type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

2 participants