dart-lang / dart-lang/language
Cascade operator: The expression here has a type of 'void', and therefore can't be used.
Open
bug
- Dominant language
- TeX
- Stars
- 2.9k
- Forks
- 239
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 14
Description
Consider the following code
```
model
..sendByEmail.value = false
..onChange = () => setState(() {});
model
..onChange = () => setState(() {})
..sendByEmail.value = false;
```
The first case compiles but the second does not.
`onChange` is a `typedef VoidCallback = void Function();`
`sendByEmail` is an object.
Is this the intended behavior?
Contributor guide
Assessment
This issue has not been assessed yet.