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

Unified Diff: lib/src/options.dart

Issue 988743003: Make inference defaults consts for easy tweaking (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: 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 | « no previous file | lib/src/testing.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 377477b39df022c0ca0a5d1da32940d53b59085f..6d36335cb2c70af264419f600eccbf1463e1f54e 100644
--- a/lib/src/options.dart
+++ b/lib/src/options.dart
@@ -25,7 +25,7 @@ class ResolverOptions {
/// Whether to infer return types and field types from overriden members.
final bool inferFromOverrides;
- static const bool INFER_FROM_OVERRIDES_DEFAULT = false;
+ static const INFER_FROM_OVERRIDES_DEFAULT = false;
/// Whether to infer types for consts and static fields by looking at
/// identifiers on the RHS. For example, in a constant declaration like:
@@ -37,6 +37,7 @@ class ResolverOptions {
/// defined in a different library than `A`. Because this might be surprising
/// to users, this is turned off by default.
final bool inferStaticsFromIdentifiers;
+ static const INFER_STATICS_FROM_IDENTIFIERS_DEFAULT = false;
Siggi Cherem (dart-lang) 2015/03/06 19:21:20 BTW - I think we are moving away from using ALL_CA
vsm 2015/03/06 20:38:16 Done on lowerCamelCase. Didn't break these into a
/// Whether to ignore ordering issues and do a best effort in inference. When
/// false, inference of top-levels and statics is limited to only consider
@@ -49,17 +50,19 @@ class ResolverOptions {
/// implementation of inference in the future, which should handle all
/// ordering concerns.
final bool inferInNonStableOrder;
+ static const INFER_IN_NON_STABLE_ORDER = false;
/// Restrict inference of fields and top-levels to those that are final and
/// const.
final bool onlyInferConstsAndFinalFields;
+ static const ONLY_INFER_CONSTS_AND_FINAL_FIELDS = false;
ResolverOptions({this.useMultiPackage: false, this.packageRoot: 'packages/',
this.packagePaths: const <String>[],
this.inferFromOverrides: INFER_FROM_OVERRIDES_DEFAULT,
- this.inferStaticsFromIdentifiers: false,
- this.inferInNonStableOrder: false,
- this.onlyInferConstsAndFinalFields: false});
+ this.inferStaticsFromIdentifiers: INFER_STATICS_FROM_IDENTIFIERS_DEFAULT,
+ this.inferInNonStableOrder: INFER_IN_NON_STABLE_ORDER,
+ this.onlyInferConstsAndFinalFields: ONLY_INFER_CONSTS_AND_FINAL_FIELDS});
}
// TODO(vsm): Merge RulesOptions and TypeOptions
@@ -208,9 +211,9 @@ class CompilerOptions implements RulesOptions, ResolverOptions, JSCodeOptions {
this.useMultiPackage: false, this.packageRoot: 'packages/',
this.packagePaths: const <String>[],
this.inferFromOverrides: ResolverOptions.INFER_FROM_OVERRIDES_DEFAULT,
- this.inferStaticsFromIdentifiers: false,
- this.inferInNonStableOrder: false,
- this.onlyInferConstsAndFinalFields: false,
+ this.inferStaticsFromIdentifiers: ResolverOptions.INFER_STATICS_FROM_IDENTIFIERS_DEFAULT,
+ this.inferInNonStableOrder: ResolverOptions.INFER_IN_NON_STABLE_ORDER,
+ this.onlyInferConstsAndFinalFields: ResolverOptions.ONLY_INFER_CONSTS_AND_FINAL_FIELDS,
Siggi Cherem (dart-lang) 2015/03/06 19:21:20 might need to run the formatter :)
vsm 2015/03/06 20:38:16 I did - it seems to prefer this?
this.nonnullableTypes: TypeOptions.NONNULLABLE_TYPES, this.help: false,
this.useMockSdk: false, this.dartSdkPath, this.logLevel: Level.SEVERE,
this.emitSourceMaps: true, this.entryPointFile: null,
@@ -284,13 +287,15 @@ final ArgParser argParser = new ArgParser()
defaultsTo: ResolverOptions.INFER_FROM_OVERRIDES_DEFAULT)
..addFlag('infer-transitively',
help: 'Infer consts/fields from definitions in other libraries',
- defaultsTo: false)
+ defaultsTo: ResolverOptions.INFER_STATICS_FROM_IDENTIFIERS_DEFAULT)
..addFlag('infer-only-finals',
- help: 'Do not infer non-const or non-final fields', defaultsTo: false)
+ help: 'Do not infer non-const or non-final fields',
+ defaultsTo: ResolverOptions.ONLY_INFER_CONSTS_AND_FINAL_FIELDS)
..addFlag('infer-eagerly',
help: 'experimental: allows a non-stable order of transitive inference on'
' consts and fields. This is used to test for possible inference with a '
- 'proper implementation in the future.', defaultsTo: false)
+ 'proper implementation in the future.',
+ defaultsTo: ResolverOptions.INFER_IN_NON_STABLE_ORDER)
// input/output options
..addOption('out', abbr: 'o', help: 'Output directory', defaultsTo: null)
« no previous file with comments | « no previous file | lib/src/testing.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698