Help us understand the problem. What is going on with this article?

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

More than 1 year has passed since last update.

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

環境

  • 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]

原因と対処方法

原因

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

対処方法

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

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away