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-7003] Poor diagnostics when attempting to access members on unfulfilled generic type #49551

Closed
hamishknight opened this issue Feb 14, 2018 · 2 comments
Assignees
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

@hamishknight
Copy link
Collaborator

Previous ID SR-7003
Radar rdar://problem/51203824
Original Reporter @hamishknight
Type Bug
Status Resolved
Resolution Done
Environment

Swift version 4.1-dev (LLVM b1f1b1f5b8, Clang d8b11579e8, Swift 66d2b75329)
Target: x86_64-apple-darwin17.4.0

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

md5: bf91ca14b2ba91f148d908e42f1b23df

Issue Description:

The following code raises some nonsensical error messages:

struct E<T> {
  static var foo: String { return "" }
  var bar: String { return "" }
  static func baz() -> String { return "" }
  func qux() -> String { return "" }
}

let q: Any = E.foo      // Value of type 'String' does not conform to specified type 'Any'
let q1: Any = E().bar   // Value of type 'String' does not conform to specified type 'Any'
let q2: Any = E.baz()   // Value of type 'String' does not conform to specified type 'Any'
let q3: Any = E().qux() // Value of type 'String' does not conform to specified type 'Any'

I would expect the error message "Generic parameter 'T' could not be inferred" instead.

@belkadan
Copy link
Contributor

cc @xedin

@xedin
Copy link
Member

xedin commented May 31, 2019

Fixed by #25149

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
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

3 participants