LoginSignup
1
0

More than 5 years have passed since last update.

Cannot assign to immutable expression of type '[Int].Type'

Posted at

過去に出会ったエラーメッセージとその対処方法備忘録

環境

  • XCode
  • Swift4.2

エラーメッセージ

Cannot assign to immutable expression of type '[Int].Type'

エラー発生コード

let indices[Int] = [0,1,3,0,3,2]

対処済みコード

let indices:[Int] = [0,1,3,0,3,2]

原因と対処方法

原因

今回はコロンの記述漏れによる文法の誤りが原因。

対処方法

文法の誤りがないか確認し、文法に誤りがある場合正しく修正する。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0