Open
Description
Say I have this:
void main() {
int combined = 0;
combined += foo();
combined += bar();
print(combined);
}
Both foo
and bar
have red squigglies because they are undefined.
Luckily I can get help, so in the quick fix menu for foo
I choose "Create function 'foo'" and this code is inserted:
num foo() {
}
This leaves me with another error on that line though: "A value of type 'num' can't be assigned to a variable of type 'int'."
Why wasn't the added code
int foo() {
}
?
Asking for quick fixes on bar
I notice that I'm also given the option to "Add a null check (!)" which doesn't really make sense. Doing it (so I now have combined += bar()!;
and still the same error of bar being undefined) I still have that option and picking it unsurprisingly gives me combined += bar()!!;
and I can just keep going. I also had this option on foo
btw.