Skip to content

[SR-13936] Misleading diagnostic on trying to initialize CGRect with with Float values. #56333

@swift-ci

Description

@swift-ci
Previous ID SR-13936
Radar rdar://problem/71991529
Original Reporter miramirror (JIRA User)
Type Bug

Attachment: Download

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

md5: a3d485f2aa1d2e53ccf0a2f7f88c81eb

Issue Description:

When initiating a CGRect with Float type variables:

let rect = CGRect(x: float, y: float, width: float, height: float)

the error message says:

argument passed to call that takes no arguments

The "Fix" option is simply removing (x: float, y: float, width: float, height: float), which isn't correct and confuses programmers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfdiagnostics QoIBug: Diagnostics Quality of Implementationtype checkerArea → compiler: Semantic analysis

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions