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-9297] Cannot convert value of the same type #51768

Open
krzyzanowskim opened this issue Nov 19, 2018 · 2 comments
Open

[SR-9297] Cannot convert value of the same type #51768

krzyzanowskim opened this issue Nov 19, 2018 · 2 comments
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

@krzyzanowskim
Copy link
Contributor

Previous ID SR-9297
Radar None
Original Reporter @krzyzanowskim
Type Bug
Environment

Apple Swift version 4.2.1 (swiftlang-1000.11.42 clang-1000.11.45.1)
Target: x86_64-apple-darwin18.2.0

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

md5: 6fa93bf768ce4734c0883e41f61a1dd2

Issue Description:

The compiler throws this error:

/ProjectCoordinator.swift:154:48: error: cannot convert value of type 'P.T' (associated type of protocol 'ProjectProvider') to expected argument type 'P.T' (associated type of protocol 'ProjectProvider')
        return projectProvider.canDelete(node: node)
                                               ^
/ProjectProvider.swift:12:20: note: associated type 'T' of protocol 'ProjectProvider' declared here
    associatedtype T: Equatable & NodeData
                   ^
/ProjectProvider.swift:12:20: note: associated type 'T' of protocol 'ProjectProvider' declared here
    associatedtype T: Equatable & NodeData

and I don't fully understand what's wrong with the type while the type constraints are the same (as shown in the error message)

@belkadan
Copy link
Contributor

cc @xedin and @rudkx, who might have seen this before.

Can you share the project, or reproduce in a smaller example?

@rudkx
Copy link
Member

rudkx commented Nov 26, 2018

In cases where we complain that a value of type T cannot be converted to a value of type T it often turns out to be due to a bad diagnostic that is flagging the wrong issue.

If you can provide a project that reproduces the issue we can suggest a workaround and look at fixing the problem.

@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

3 participants