Skip to content

[SR-5515] popFirst error message is silly #48087

@mattneub

Description

@mattneub
Previous ID SR-5515
Radar None
Original Reporter @mattneub
Type Bug
Environment

Xcode Version 9.0 beta 3 (9M174d)

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

md5: a87fa35be4ed517d2c1b701a237232de

Issue Description:

var arr = [1,2,3]
arr.popFirst()  // cannot use mutating member on immutable value: 'arr' is immutable

That's a silly error message. `arr` is not immutable in any normal sense. The problem is actually that popFirst doesn't operate on an Array at all (something I've always found rather weird, but there it is).

Metadata

Metadata

Assignees

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