Skip to content

[SR-15746] Incorrect expected argument type displayed in error message #58023

@AnthonyLatsis

Description

@AnthonyLatsis
Previous ID SR-15746
Radar None
Original Reporter @AnthonyLatsis
Type Bug
Environment

Swift version 5.6-dev (LLVM 7b20e61dd04138a, Swift ab0577a91f0b152)

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

md5: b54a35bf020183fecb5284cf34b550ce

Issue Description:

protocol P {}
class Class {}

func foo<U>(_: U) where U: P & Class {}

do {
  // error: global function 'foo' requires that 'Class' conform to 'P'
  // error: cannot convert value of type 'Bool' to expected argument type 'Class'
  foo(false)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselftype checkerArea → compiler: Semantic analysis

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions