dart-lang / dart-lang/language

Cascade operator: The expression here has a type of 'void', and therefore can't be used.

Open
#609 9 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.