Swift Error: Variable used within its own initial value

后端 未结 4 1423
灰色年华
灰色年华 2020-12-24 01:37

When I\'m initializing an instance of an entity I\'m getting the error Variable used within its own initial value.

Here is the code throwing the error:<

4条回答
  •  攒了一身酷
    2020-12-24 02:22

    You are declaring a constant named word, and trying to use the argument with the same name to initialize it. The compiler tries to use the just declared constant to assign its own initial value, instead of using the argument.

提交回复
热议问题