I get the error "Type annotation missing in pattern" when declaring a variable as follows:
var total
What is type annotation?
Type annotation is the following:
var total:Int
The ":Int" is the type annotation. This must be used when you don't set a value (thus having an implied type) at the time of declaration.
If you were to define your variable as follows:
var total = 9
You would no longer need to explicitly annotate the type at the time of declaration.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With