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-8342] Type of expression is ambiguous without more context #50870

Open
an0 mannequin opened this issue Jul 22, 2018 · 1 comment
Open

[SR-8342] Type of expression is ambiguous without more context #50870

an0 mannequin opened this issue Jul 22, 2018 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself type checker Area → compiler: Semantic analysis

Comments

@an0
Copy link
Mannequin

an0 mannequin commented Jul 22, 2018

Previous ID SR-8342
Radar None
Original Reporter @an0
Type Bug

Attachment: Download

Environment

Xcode 10.0 beta 4

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, TypeChecker
Assignee None
Priority Medium

md5: cb476c66ad3295fee2b17d692fdffa10

Issue Description:

Hard to describe in words. Run Test target(⌘U) of the sample project to see.

@belkadan
Copy link
Contributor

Reduced:

func test<T: Equatable>(_ a: T, _ b: T) {}

enum Token: Equatable {

  case plus

  case invalidNumber(String)
  case invalidOperator(Character) // String is OK, Character not.

  static func tokenize(_ text: String) -> [Token] {
    return []
  }

  static func testX() {
    test(Token.tokenize(""), [.plus, .invalidOperator("&"), .invalidNumber("b")])
  }
}

@rudkx, any ideas?

@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 type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

1 participant