Closed
Description
The following will give a type error:
void showError() { ... }
SomeType someMethod(){
return foo.bar().first.then((blah)=>blah, onError: (error) => showError());
}
This is because showError
returns void
when SomeType
is expected.
To fix one simply needs to do remove the fat arrow:
void showError() { ... }
SomeType someMethod(){
return foo.bar().first.then((blah)=>blah, onError: (error) { showError();});
}
This is a pain and the void
return type of showError
should be interpreted as returning null
.