So I’m writing a program, as a developer would - ‘with Xcode.’
Code produced an error.
The key values were swapped. The parameters suggested were ‘optional parameters variables.’
- “var name: TYPE? = (default)”
- var name0: TYPE
=============================
name0 = “super cool” ‘Name is not yet declared at this point
provided with x - incorrect argument replace ExampleStruct(name:”supercool”)
should be x - incorrect argument replace ExampleStruct(name0:”supercool”)
============================= In swift, there is a procedural prioritization within the constructor calling process.
Application calls constructor. Constructor provides constructor signature. Signature requires parameters & throws an error if the params are not in appropriate order. - “got it compiler; thank you, very much”
Typically, when this occurs, defaults will be suggested. Often the variable type. Ie String, Bool.
such as: StructName(param1:Int64, param2:Bool)
(Recently, I have seen a decline in @Apple’s performance in many vectors.)
As stated before, the key value pairs were out of sequence. The optionals were suggested instead of the required parameters.
This leads me to believe that there is an order of operations in the calling procedure that is being mismanaged.
I.e. regular expression, matching with optional. This confuses these with [forced, required] parameters, and the mismanagement of ‘key: value’ pairs.
- this is a superficial prognosis and would like to know if anyone has any insight as to why this may occur.
Could it be a configuration setting? Is it possibly the network I connected to bumped into something. Etc..
I appreciate any and all feedback.
Please take into consideration the Apple developer forum, guidelines before posting comments.
#dev_div