Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(643)

Unified Diff: lib/src/options.dart

Issue 1028793002: Transitive inference using SCC (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: cl comments Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/checker/resolver.dart ('k') | test/checker/inferred_type_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/options.dart
diff --git a/lib/src/options.dart b/lib/src/options.dart
index cb7d88beb1591ab299b7fb71af99dacbdcdab1f1..9547faa13461dee0ffa212062dd6460c9b47adfd 100644
--- a/lib/src/options.dart
+++ b/lib/src/options.dart
@@ -34,19 +34,16 @@ class ResolverOptions {
///
/// const A = B;
///
- /// We can infer the type of `A` based on the type of `B`. The current
- /// implementation of this inference is limited to ensure the answer is
- /// deterministic when applying inference on library cycles. In the example
- /// above, `A` is inferred to have `B`'s declared type if they are both in the
- /// same library cycle. However, if `B`'s definition is not in the same
- /// connected component as `A`, we use `B`'s inferred type instead.
+ /// We can infer the type of `A` based on the type of `B`. The inference
+ /// algorithm determines what variables depend on others, and computes types
+ /// by visiting the variable dependency graph in topological order. This
+ /// ensures that the inferred type is deterministic when applying inference on
+ /// library cycles.
///
- /// Because this might be surprising to users, this is turned off by default.
- /// In the future, inference might track dependencies between variables in
- /// more detail so that, in the example above, we can use `B`'s inferred type
- /// always.
+ /// When this feature is turned off, we don't use the type of `B` to infer the
+ /// type of `A`, even if `B` has a declared type.
final bool inferTransitively;
- static const inferTransitivelyDefault = false;
+ static const inferTransitivelyDefault = true;
/// Restrict inference of fields and top-levels to those that are final and
/// const.
« no previous file with comments | « lib/src/checker/resolver.dart ('k') | test/checker/inferred_type_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698