Comments (6)
Sorry, I meant to report this in the language repository... will do.
from sdk.
This world the way it does because the upper bound operation on StateKey<_AState>
and StateKey<_BState>
is StateKey<U>
where U
is the upper bound of _AState
and _BState
.
Those two are different classes, so the algorithm falls through to the part that tries to give a common super-interface.
And since State<A>
and State<B>
are different interfaces, they are not the answer. Instead it seems Diagnosticable
is the nearest unique shared superinterface.
from sdk.
OK, so it's WAI. Thanks for explaining!
from sdk.
I'll add a comment here, just to check out the behavior of a proposed update to the underlying algorithm.
The proposal is about modifying the UP
algorithm in dart-lang/language#3282 such that it finds the least common superclass rather than supertype. (OK, it's "standard" rather than "least", as usual).
With that proposal we do get the desired result:
UP(StateKey<_AState>, StateKey<_BState>) ==
StateKey<UP(_AState, _BState)> ==
// Standard common superclass of `_AState` and `_Bstate` is `State`,
// superinterface of `_AState`/`_BState` at `State` is `State<A>`/`State<B>`.
StateKey<UP(State<A>, State<B>)> ==
StateKey<State<UP(A, B)>> ==
StateKey<State<StatefulWidget>>
from sdk.
Yes, the issue you identify at the beginning of that report is what I was seeing here. So I will re-open this issue. Thanks!
from sdk.
Hi @lukehutch!
I'm afraid it is still correct to describe this issue as reporting on a behavior which is specified. That is, there is nothing to fix here from the perspective of the SDK repository.
The issue dart-lang/language#3282 in the language repository is a proposal about changing the behavior of the UP
algorithm. In other words, a future version of Dart could have a specification that allows it to behave in the way I described, if that proposal is accepted.
So we could move this issue to the language repository and consider it to be a request for a change similar to the one in dart-lang/language#3282, but it would then basically be a duplicate of that issue.
Perhaps you could write a comment on dart-lang/language#3282 referring to this issue as an example case for that change, and then close this one again?
from sdk.
Related Issues (20)
- dart2wasm fails inside sync* functions with a switch statement HOT 6
- Analyzer Feedback from IntelliJ
- Analyzer Feedback from IntelliJ
- Analyzer quick-fix: Add import with `show`.
- File operations hang forever after opening unrelated named pipe HOT 4
- Support dart fix for unused_shown_name
- [CP] dart2wasm async and sync* fixes to stable HOT 3
- Extension instance vs static member conflict HOT 2
- Some of the backlog computations aren't processed by the CFE under certain conditions HOT 1
- [native_assets] Hot restart native libs HOT 2
- `dart pub deps` does not work while `dart pub get` failed HOT 1
- [CP] [dart2wasm] Only perform compile-time lookup in constant list if index is in-bounds HOT 5
- is not workAnalyzer Feedback from IntelliJ HOT 1
- const_finder/ast_from_binary is crashing during dill parsing while running flutter icon tree shaking HOT 2
- Allow dart2wasm to interop with other wasm code & provide wasm data structures (e.g. in `dart:wasm`) HOT 3
- [CP] [dart2wasm] Remove experimental warning for dart compile wasm and make `dart compile --help` show the wasm subcommand HOT 4
- Analyzer Feedback from IntelliJ
- [DAP] `--pause-isolates-on-start` and `--pause-isolates-on-exit` flags are not set for attach workflows HOT 4
- [DAP] `--pause-isolates-on-start` flag is not respected for web refreshes HOT 1
- Switch Expressions conversion assist should use logical-or when multiple cases share a body HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sdk.