Skip to content

[SR-2228] Unhelpful error message for lack of label in String.init(describing:) #44835

@xwu

Description

@xwu
Previous ID SR-2228
Radar None
Original Reporter @xwu
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler, Standard Library
Labels Bug, DiagnosticsQoI
Assignee @harlanhaskins
Priority Medium

md5: e65357ba7b425d2f6a0f8b634b7197a0

Issue Description:

After implementation of `LosslessStringConvertible`, non-lossless string conversions require the argument label `describing`. However, this is not what the errors tell you. For example, in a Playground, write:

```
let bar = [1 as Float, 2, 3]
String(bar[0..<2]) // error: ambiguous reference to member '..<'
```

And if you write instead:

```
let bar = [1 as Float, 2, 3]
let baz = String(bar[0..<2]) // error: type of expression is ambiguous without more context
```

Metadata

Metadata

Assignees

Labels

bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfdiagnostics QoIBug: Diagnostics Quality of Implementationstandard libraryArea: Standard library umbrella

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions