pkg:compiler - enable and fix prefer_final_fields lint

Change-Id: I042f6047c2c10490121398027489217c6291425d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211622
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
This commit is contained in:
Kevin Moore 2021-09-24 21:37:39 +00:00 committed by commit-bot@chromium.org
parent 4daa1ed206
commit 70533ae7fa
88 changed files with 298 additions and 340 deletions

View file

@ -14,3 +14,4 @@ analyzer:
linter:
rules:
- annotate_overrides
- prefer_final_fields

View file

@ -29,8 +29,8 @@ class MetricsBase implements Metrics {
String get namespace => '';
// TODO(sra): Make these late final fields.
List<Metric> _primary = [];
List<Metric> _secondary = [];
final List<Metric> _primary = [];
final List<Metric> _secondary = [];
/// Setter method that is usually called in a subclass constructor to define
/// the primary metrics.

View file

@ -88,7 +88,7 @@ abstract class Compiler {
api.CompilerOutput get outputProvider => _outputProvider;
List<CodeLocation> _userCodeLocations = <CodeLocation>[];
final List<CodeLocation> _userCodeLocations = <CodeLocation>[];
JClosedWorld backendClosedWorldForTesting;
DataSourceIndices closedWorldIndicesForTesting;

View file

@ -246,7 +246,7 @@ class IntConstantValue extends NumConstantValue {
// Caching IntConstantValues representing -2 through 10 so that we don't have
// to create new ones every time those values are used.
static Map<BigInt, IntConstantValue> _cachedValues = {};
static final Map<BigInt, IntConstantValue> _cachedValues = {};
@override
double get doubleValue => intValue.toDouble();

View file

@ -343,7 +343,7 @@ class DeferredLoadTask extends CompilerTask {
final Compiler compiler;
KernelToElementMap _elementMap;
final KernelToElementMap _elementMap;
@override
final _DeferredLoadTaskMetrics metrics = _DeferredLoadTaskMetrics();

View file

@ -56,10 +56,10 @@ class ImportSetLattice {
/// Index of deferred imports that defines the canonical order used by the
/// operations below.
Map<ImportEntity, _DeferredImport> _importIndex = {};
final Map<ImportEntity, _DeferredImport> _importIndex = {};
/// The canonical instance representing the empty import set.
ImportSet _emptySet = ImportSet.empty();
final ImportSet _emptySet = ImportSet.empty();
/// The [ImportSet] representing the main output unit.
ImportSet _mainSet;

View file

@ -502,7 +502,7 @@ class DumpInfoTask extends CompilerTask implements InfoReporter {
bool get shouldEmitText => !useBinaryFormat;
// TODO(sigmund): delete the stack once we stop emitting the source text.
List<_CodeData> _stack = [];
final List<_CodeData> _stack = [];
void enterNode(jsAst.Node node, int start) {
var data = _nodeData[node];
data?.start = start;
@ -682,7 +682,7 @@ class DumpInfoTask extends CompilerTask implements InfoReporter {
/// Helper class to store what dump-info will show for a piece of code.
// TODO(sigmund): delete once we no longer emit text by default.
class _CodeData extends CodeSpan {
StringBuffer _text = StringBuffer();
final StringBuffer _text = StringBuffer();
@override
String get text => '$_text';
int get length => end - start;

View file

@ -54,7 +54,7 @@ abstract class EntityMapBase<E extends _Indexed> {
bool _closed = false;
int _size = 0;
List<E> _list = <E>[];
final List<E> _list = <E>[];
/// Returns the [index]th entity in the map.
E getEntity(int index) => _list[index];
@ -113,7 +113,7 @@ class EntityMap<E extends _Indexed> extends EntityMapBase<E> {
/// corresponding data object of type [D].
abstract class EntityDataMapBase<E extends _Indexed, D>
extends EntityMapBase<E> {
List<D> _data = <D>[];
final List<D> _data = <D>[];
/// Returns the data object stored for the [index]th entity.
D getData(E entity) {
@ -184,7 +184,7 @@ class EntityDataMap<E extends _Indexed, D> extends EntityDataMapBase<E, D> {
/// corresponding data object of type [D] and an environment of type [V].
abstract class EntityDataEnvMapBase<E extends _Indexed, D, V>
extends EntityDataMapBase<E, D> {
List<V> _env = <V>[];
final List<V> _env = <V>[];
/// Returns the environment object stored for the [index]th entity.
V getEnv(E entity) {

View file

@ -129,7 +129,7 @@ abstract class DartType {
///
/// This is used to compute the equivalence relation on types coinductively.
class _Assumptions {
Map<FunctionTypeVariable, Set<FunctionTypeVariable>> _assumptionMap =
final Map<FunctionTypeVariable, Set<FunctionTypeVariable>> _assumptionMap =
<FunctionTypeVariable, Set<FunctionTypeVariable>>{};
void _addAssumption(FunctionTypeVariable a, FunctionTypeVariable b) {
@ -1054,7 +1054,7 @@ abstract class DartTypeSubstitutionVisitor<A>
DartTypes get dartTypes;
// The input type is a DAG and we must preserve the sharing.
Map<DartType, DartType> _map = Map.identity();
final Map<DartType, DartType> _map = Map.identity();
DartType _mapped(DartType oldType, DartType newType) {
assert(_map[oldType] == null);

View file

@ -1130,7 +1130,7 @@ class InferrerEngine {
/// Indirect calls share the same dynamic call site information node. This
/// cache holds that shared dynamic call node for a given selector.
Map<Selector, DynamicCallSiteTypeInformation> _sharedCalls = {};
final Map<Selector, DynamicCallSiteTypeInformation> _sharedCalls = {};
/// For a given selector, return a shared dynamic call site that will be used
/// to combine the results of multiple dynamic calls in the program via

View file

@ -206,7 +206,7 @@ abstract class CodePositionMap {
/// Registry for mapping [js.Node]s to their [CodePosition].
class CodePositionRecorder implements CodePositionMap {
Map<js.Node, CodePosition> _codePositionMap =
final Map<js.Node, CodePosition> _codePositionMap =
Map<js.Node, CodePosition>.identity();
void registerPositions(
@ -1339,12 +1339,12 @@ class JavaScriptTracer extends js.BaseVisitor {
}
class Coverage {
Set<js.Node> _nodesWithInfo = {};
final Set<js.Node> _nodesWithInfo = {};
int _nodesWithInfoCount = 0;
Set<js.Node> _nodesWithoutInfo = {};
final Set<js.Node> _nodesWithoutInfo = {};
int _nodesWithoutInfoCount = 0;
Map<Type, int> _nodesWithoutInfoCountByType = {};
Set<js.Node> _nodesWithoutOffset = {};
final Map<Type, int> _nodesWithoutInfoCountByType = {};
final Set<js.Node> _nodesWithoutOffset = {};
int _nodesWithoutOffsetCount = 0;
void registerNodeWithInfo(js.Node node) {

View file

@ -362,7 +362,7 @@ class SourceMapEntry {
/// Map from line/column pairs to lists of [T] elements.
class LineColumnMap<T> {
Map<int, Map<int, List<T>>> _map = {};
final Map<int, Map<int, List<T>>> _map = {};
/// Returns the list of elements associated with ([line],[column]).
List<T> _getList(int line, int column) {

View file

@ -8,18 +8,19 @@ import '../common/names.dart';
import 'modular.dart';
class IrAnnotationData {
Map<ir.Class, String> _nativeClassNames = {};
Set<ir.Member> _nativeMembers = {};
Map<ir.Member, String> _nativeMemberNames = {};
Map<ir.Member, List<String>> _createsAnnotations = {};
Map<ir.Member, List<String>> _returnsAnnotations = {};
final Map<ir.Class, String> _nativeClassNames = {};
final Set<ir.Member> _nativeMembers = {};
final Map<ir.Member, String> _nativeMemberNames = {};
final Map<ir.Member, List<String>> _createsAnnotations = {};
final Map<ir.Member, List<String>> _returnsAnnotations = {};
Map<ir.Library, String> _jsInteropLibraryNames = {};
Map<ir.Class, String> _jsInteropClassNames = {};
Set<ir.Class> _anonymousJsInteropClasses = {};
Map<ir.Member, String> _jsInteropMemberNames = {};
final Map<ir.Library, String> _jsInteropLibraryNames = {};
final Map<ir.Class, String> _jsInteropClassNames = {};
final Set<ir.Class> _anonymousJsInteropClasses = {};
final Map<ir.Member, String> _jsInteropMemberNames = {};
Map<ir.Member, List<PragmaAnnotationData>> _memberPragmaAnnotations = {};
final Map<ir.Member, List<PragmaAnnotationData>> _memberPragmaAnnotations =
{};
// Returns the text from the `@Native(<text>)` annotation of [node], if any.
String getNativeClassName(ir.Class node) => _nativeClassNames[node];

View file

@ -34,7 +34,7 @@ abstract class VariableScopeModel {
}
class VariableScopeModelImpl implements VariableScopeModel {
Map<ir.TreeNode, VariableScope> _scopeMap = {};
final Map<ir.TreeNode, VariableScope> _scopeMap = {};
Set<ir.VariableDeclaration> _assignedVariables;
VariableScope createScopeFor(ir.TreeNode node) {

View file

@ -56,11 +56,13 @@ class ScopeModelBuilder extends ir.Visitor<EvaluationComplexity>
/// Keep track of the mutated local variables so that we don't need to box
/// non-mutated variables. We know these are only VariableDeclarations because
/// type variable types and `this` types can't be mutated!
Set<ir.VariableDeclaration> _mutatedVariables = Set<ir.VariableDeclaration>();
final Set<ir.VariableDeclaration> _mutatedVariables =
Set<ir.VariableDeclaration>();
/// The set of variables that are accessed in some form, whether they are
/// mutated or not.
Set<ir.Node /* ir.VariableDeclaration | TypeParameterTypeWithContext */ >
final Set<
ir.Node /* ir.VariableDeclaration | TypeParameterTypeWithContext */ >
_capturedVariables = Set<ir.Node>();
/// If true, the visitor is currently traversing some nodes that are inside a

View file

@ -74,7 +74,7 @@ abstract class StaticTypeVisitor extends StaticTypeBase {
Map<ir.Expression, TypeMap> typeMapsForTesting;
// TODO(johnniwinther): Change the key to `InstanceGet` when the old method
// invocation encoding is no longer used.
Map<ir.Expression, RuntimeTypeUseData> _pendingRuntimeTypeUseData = {};
final Map<ir.Expression, RuntimeTypeUseData> _pendingRuntimeTypeUseData = {};
final ir.ClassHierarchy hierarchy;
@ -124,7 +124,7 @@ abstract class StaticTypeVisitor extends StaticTypeBase {
bool completes(ir.DartType type) => type != const DoesNotCompleteType();
Set<ir.VariableDeclaration> _currentVariables;
Set<ir.VariableDeclaration> _invalidatedVariables =
final Set<ir.VariableDeclaration> _invalidatedVariables =
Set<ir.VariableDeclaration>();
TypeMap _typeMapBase = const TypeMap();

View file

@ -737,7 +737,7 @@ class BackendImpacts {
BackendImpact(globalClasses: [_commonElements.closureClass]);
}
Map<int, BackendImpact> _genericInstantiation = {};
final Map<int, BackendImpact> _genericInstantiation = {};
BackendImpact getGenericInstantiation(int typeArgumentCount) =>
_genericInstantiation[typeArgumentCount] ??= BackendImpact(staticUses: [

View file

@ -104,7 +104,7 @@ abstract class BackendUsageBuilder {
}
class BackendUsageBuilderImpl implements BackendUsageBuilder {
FrontendStrategy _frontendStrategy;
final FrontendStrategy _frontendStrategy;
// TODO(johnniwinther): Remove the need for these.
Setlet<FunctionEntity> _globalFunctionDependencies;
Setlet<ClassEntity> _globalClassDependencies;

View file

@ -32,7 +32,7 @@ import '../util/util.dart' show Setlet;
/// [Enqueuer] which is specific to code generation.
class CodegenEnqueuer extends EnqueuerImpl {
final String name;
Set<ClassEntity> _recentClasses = Setlet();
final Set<ClassEntity> _recentClasses = Setlet();
bool _recentConstants = false;
final CodegenWorldBuilderImpl _worldBuilder;
final WorkItemBuilder _workItemBuilder;

View file

@ -11,7 +11,7 @@ class FrequencyBasedNamer extends Namer
_FieldNamingRegistry fieldRegistry;
List<TokenName> tokens = [];
Map<NamingScope, TokenScope> _tokenScopes = {};
final Map<NamingScope, TokenScope> _tokenScopes = {};
@override
String get genericInstantiationPrefix => r'$I';

View file

@ -359,7 +359,8 @@ class OneShotInterceptorData {
return interceptors;
}
Map<Selector, Map<String, OneShotInterceptor>> _oneShotInterceptors = {};
final Map<Selector, Map<String, OneShotInterceptor>> _oneShotInterceptors =
{};
/// A set of specialized versions of the [getInterceptorMethod].
///
@ -370,7 +371,7 @@ class OneShotInterceptorData {
Iterable<SpecializedGetInterceptor> get specializedGetInterceptors =>
_specializedGetInterceptors.values;
Map<String, SpecializedGetInterceptor> _specializedGetInterceptors = {};
final Map<String, SpecializedGetInterceptor> _specializedGetInterceptors = {};
jsAst.Name registerOneShotInterceptor(
Selector selector, ModularNamer namer, JClosedWorld closedWorld) {

View file

@ -251,7 +251,7 @@ class MinifyNamer extends Namer
/// Remember bad hashes to avoid using a the same character with long numbers
/// for frequent hashes. For example, `closure` is a very common name.
Map<int, int> _badNames = {};
final Map<int, int> _badNames = {};
/// If we can't find a hash based name in the three-letter space, then base
/// the name on a letter and a counter.
@ -360,7 +360,8 @@ class _ConstructorBodyNamingScope {
}
abstract class _MinifyConstructorBodyNamer implements Namer {
Map<ClassEntity, _ConstructorBodyNamingScope> _constructorBodyScopes = {};
final Map<ClassEntity, _ConstructorBodyNamingScope> _constructorBodyScopes =
{};
@override
jsAst.Name constructorBodyName(ConstructorBodyEntity method) {

View file

@ -873,7 +873,7 @@ enum TypeVisitorState {
}
class TypeVisitor extends DartTypeVisitor<void, TypeVisitorState> {
Set<FunctionTypeVariable> _visitedFunctionTypeVariables = {};
final Set<FunctionTypeVariable> _visitedFunctionTypeVariables = {};
final void Function(ClassEntity entity, {TypeVisitorState state}) onClass;
final void Function(TypeVariableEntity entity, {TypeVisitorState state})

View file

@ -440,8 +440,8 @@ int indexTypeVariable(
}
class _RulesetEntry {
Set<InterfaceType> _supertypes = {};
Map<TypeVariableType, DartType> _typeVariables = {};
final Set<InterfaceType> _supertypes = {};
final Map<TypeVariableType, DartType> _typeVariables = {};
bool get isEmpty => _supertypes.isEmpty && _typeVariables.isEmpty;
bool get isNotEmpty => _supertypes.isNotEmpty || _typeVariables.isNotEmpty;

View file

@ -216,7 +216,7 @@ class StringReferenceFinalizerImpl implements StringReferenceFinalizer {
/// Maps the recipe (type expression) to the references with the same recipe.
/// Much of the algorithm's state is stored in the _ReferenceSet objects.
Map<StringConstantValue, _ReferenceSet> _referencesByString = {};
final Map<StringConstantValue, _ReferenceSet> _referencesByString = {};
StringReferenceFinalizerImpl(this._minify,
{this.shortestSharedLength =

View file

@ -236,7 +236,7 @@ class TypeReferenceFinalizerImpl implements TypeReferenceFinalizer {
/// Maps the recipe (type expression) to the references with the same recipe.
/// Much of the algorithm's state is stored in the _ReferenceSet objects.
Map<TypeRecipe, _ReferenceSet> _referencesByRecipe = {};
final Map<TypeRecipe, _ReferenceSet> _referencesByRecipe = {};
TypeReferenceFinalizerImpl(
this._emitter, this._commonElements, this._recipeEncoder, this._minify) {

View file

@ -233,8 +233,8 @@ class _DartTypeKindVisitor implements DartTypeVisitor<int, Null> {
class _DartTypeOrdering extends DartTypeVisitor<int, DartType> {
final _ConstantOrdering _constantOrdering;
DartType _root;
List<FunctionTypeVariable> _leftFunctionTypeVariables = [];
List<FunctionTypeVariable> _rightFunctionTypeVariables = [];
final List<FunctionTypeVariable> _leftFunctionTypeVariables = [];
final List<FunctionTypeVariable> _rightFunctionTypeVariables = [];
_DartTypeOrdering(this._constantOrdering);
int compare(DartType a, DartType b) {

View file

@ -98,15 +98,16 @@ class MetadataCollector implements jsAst.TokenFinalizer {
final RecipeEncoder _rtiRecipeEncoder;
/// A map used to canonicalize the entries of metadata.
Map<OutputUnit, Map<String, List<BoundMetadataEntry>>> _metadataMap = {};
final Map<OutputUnit, Map<String, List<BoundMetadataEntry>>> _metadataMap =
{};
/// A map with a token for a lists of JS expressions, one token for each
/// output unit. Once finalized, the entries represent types including
/// function types and typedefs.
Map<OutputUnit, _MetadataList> _typesTokens = {};
final Map<OutputUnit, _MetadataList> _typesTokens = {};
/// A map used to canonicalize the entries of types.
Map<OutputUnit, Map<DartType, List<BoundMetadataEntry>>> _typesMap = {};
final Map<OutputUnit, Map<DartType, List<BoundMetadataEntry>>> _typesMap = {};
MetadataCollector(this.reporter, this._emitter, this._rtiRecipeEncoder);

View file

@ -165,7 +165,7 @@ class ProgramBuilder {
ClassEntity get _jsInteropInterceptor =>
_commonElements.jsJavaScriptObjectClass;
List<StubMethod> _jsInteropIsChecks = [];
final List<StubMethod> _jsInteropIsChecks = [];
final Set<TypeCheck> _jsInteropTypeChecks = {};
Program buildProgram({bool storeFunctionTypesInMetadata = false}) {

View file

@ -585,7 +585,7 @@ class FragmentEmitter {
final CodegenWorld _codegenWorld;
RecipeEncoder _recipeEncoder;
RulesetEncoder _rulesetEncoder;
DeferredHolderExpressionFinalizer _holderFinalizer;
final DeferredHolderExpressionFinalizer _holderFinalizer;
ClassHierarchy get _classHierarchy => _closedWorld.classHierarchy;
CommonElements get _commonElements => _closedWorld.commonElements;

View file

@ -174,16 +174,16 @@ class ClosureDataBuilder {
final AnnotationsData _annotationsData;
/// Map of the scoping information that corresponds to a particular entity.
Map<MemberEntity, ScopeInfo> _scopeMap = {};
Map<ir.TreeNode, CapturedScope> _capturedScopesMap = {};
final Map<MemberEntity, ScopeInfo> _scopeMap = {};
final Map<ir.TreeNode, CapturedScope> _capturedScopesMap = {};
// Indicates the type variables (if any) that are captured in a given
// Signature function.
Map<MemberEntity, CapturedScope> _capturedScopeForSignatureMap = {};
final Map<MemberEntity, CapturedScope> _capturedScopeForSignatureMap = {};
Map<ir.LocalFunction, ClosureRepresentationInfo>
final Map<ir.LocalFunction, ClosureRepresentationInfo>
_localClosureRepresentationMap = {};
Map<MemberEntity, MemberEntity> _enclosingMembers = {};
final Map<MemberEntity, MemberEntity> _enclosingMembers = {};
ClosureDataBuilder(this._elementMap, this._annotationsData);

View file

@ -115,15 +115,15 @@ class JsKernelToElementMap implements JsToElementMap, IrToElementMap {
final Map<ir.TreeNode, Local> localFunctionMap = {};
/// Map from members to the call methods created for their nested closures.
Map<IndexedMember, List<IndexedFunction>> _nestedClosureMap = {};
final Map<IndexedMember, List<IndexedFunction>> _nestedClosureMap = {};
/// NativeData is need for computation of the default super class and
/// parameter ordering.
NativeData nativeData;
Map<IndexedFunction, JGeneratorBody> _generatorBodies = {};
final Map<IndexedFunction, JGeneratorBody> _generatorBodies = {};
Map<IndexedClass, List<IndexedMember>> _injectedClassMembers = {};
final Map<IndexedClass, List<IndexedMember>> _injectedClassMembers = {};
LateOutputUnitDataBuilder lateOutputUnitDataBuilder;

View file

@ -771,7 +771,8 @@ class _TypeConverter implements DartTypeVisitor<DartType, _EntityConverter> {
final DartTypes _dartTypes;
final bool allowFreeVariables;
Map<FunctionTypeVariable, FunctionTypeVariable> _functionTypeVariables = {};
final Map<FunctionTypeVariable, FunctionTypeVariable> _functionTypeVariables =
{};
_TypeConverter(this._dartTypes, {this.allowFreeVariables = false});

View file

@ -109,7 +109,7 @@ class KernelToElementMapImpl implements KernelToElementMap, IrToElementMap {
final Map<ir.TreeNode, Local> localFunctionMap = {};
BehaviorBuilder _nativeBehaviorBuilder;
FrontendStrategy _frontendStrategy;
final FrontendStrategy _frontendStrategy;
Map<KMember, Map<ir.Expression, TypeMap>> typeMapsForTesting;

View file

@ -54,8 +54,8 @@ class KernelFrontendStrategy extends FrontendStrategy {
final NativeBasicDataBuilderImpl nativeBasicDataBuilder =
NativeBasicDataBuilderImpl();
NativeBasicData _nativeBasicData;
CompilerOptions _options;
CompilerTask _compilerTask;
final CompilerOptions _options;
final CompilerTask _compilerTask;
KernelToElementMapImpl _elementMap;
RuntimeTypesNeedBuilder _runtimeTypesNeedBuilder;

View file

@ -28,7 +28,7 @@ class BaseNativeClassFinder implements NativeClassFinder {
final KElementEnvironment _elementEnvironment;
final NativeBasicData _nativeBasicData;
Map<String, ClassEntity> _tagOwner = {};
final Map<String, ClassEntity> _tagOwner = {};
BaseNativeClassFinder(this._elementEnvironment, this._nativeBasicData);

View file

@ -23,7 +23,7 @@ abstract class AbstractDataSink extends DataSinkMixin implements DataSink {
List<String> _tags;
/// Map of [_MemberData] object for serialized kernel member nodes.
Map<ir.Member, _MemberData> _memberData = {};
final Map<ir.Member, _MemberData> _memberData = {};
IndexedSink<String> _stringIndex;
IndexedSink<Uri> _uriIndex;
@ -31,7 +31,7 @@ abstract class AbstractDataSink extends DataSinkMixin implements DataSink {
IndexedSink<ImportEntity> _importIndex;
IndexedSink<ConstantValue> _constantIndex;
Map<Type, IndexedSink> _generalCaches = {};
final Map<Type, IndexedSink> _generalCaches = {};
EntityWriter _entityWriter = const EntityWriter();
CodegenWriter _codegenWriter;

View file

@ -25,7 +25,7 @@ abstract class AbstractDataSource extends DataSourceMixin
IndexedSource<ImportEntity> _importIndex;
IndexedSource<ConstantValue> _constantIndex;
Map<Type, IndexedSource> _generalCaches = {};
final Map<Type, IndexedSource> _generalCaches = {};
ir.Member _currentMemberContext;
_MemberData _currentMemberData;

View file

@ -117,7 +117,7 @@ JsClosedWorld deserializeClosedWorldFromSource(
}
class _StringInterner implements ir.StringInterner, StringInterner {
Map<String, String> _map = {};
final Map<String, String> _map = {};
@override
String internString(String string) {

View file

@ -706,7 +706,7 @@ class KernelSsaGraphBuilder extends ir.Visitor<void> with ir.VisitorVoidMixin {
// Locals for function type parameters that can be forwarded, in argument
// position order.
List<Local> _functionTypeParameterLocals = [];
final List<Local> _functionTypeParameterLocals = [];
/// Builds a generative constructor.
///
@ -6600,7 +6600,7 @@ class TryCatchFinallyBuilder {
}
class KernelTypeBuilder extends TypeBuilder {
JsToElementMap _elementMap;
final JsToElementMap _elementMap;
KernelTypeBuilder(KernelSsaGraphBuilder builder, this._elementMap)
: super(builder);
@ -6885,7 +6885,7 @@ class InlineDataCache {
InlineDataCache(
{this.enableUserAssertions = false, this.omitImplicitCasts = false});
Map<FunctionEntity, InlineData> _cache = {};
final Map<FunctionEntity, InlineData> _cache = {};
InlineData getInlineData(JsToElementMap elementMap, FunctionEntity function) {
return _cache[function] ??= InlineWeeder.computeInlineData(

View file

@ -707,8 +707,8 @@ class ClassHierarchyBuilder {
return false;
}
Map<ClassEntity, _InheritedInThisClassCache> _inheritedInThisClassCacheMap =
{};
final Map<ClassEntity, _InheritedInThisClassCache>
_inheritedInThisClassCacheMap = {};
/// Returns `true` if a `this` expression in [thisClass] can target a member
/// declared in [memberHoldingClass].
@ -720,7 +720,8 @@ class ClassHierarchyBuilder {
return cache.isInheritedInThisClassOf(this, memberHoldingClass, thisClass);
}
Map<ClassEntity, _InheritedInSubtypeCache> _inheritedInSubtypeCacheMap = {};
final Map<ClassEntity, _InheritedInSubtypeCache> _inheritedInSubtypeCacheMap =
{};
bool isInheritedInSubtypeOf(ClassEntity x, ClassEntity y) {
_InheritedInSubtypeCache cache =

View file

@ -203,7 +203,7 @@ class ClassHierarchyNode {
}
/// The nodes for the direct subclasses of [cls].
List<ClassHierarchyNode> _directSubclasses = [];
final List<ClassHierarchyNode> _directSubclasses = [];
ClassHierarchyNode(this.parentNode, this.cls, this.hierarchyDepth) {
if (parentNode != null) {

View file

@ -604,7 +604,7 @@ class CodegenWorldBuilderImpl extends WorldBuilderBase
}
class CodegenWorldImpl implements CodegenWorld {
JClosedWorld _closedWorld;
final JClosedWorld _closedWorld;
final Map<MemberEntity, MemberUsage> _liveMemberUsage;

View file

@ -339,7 +339,7 @@ class ResolutionWorldBuilderImpl extends WorldBuilderBase
final Set<Local> _genericLocalFunctions = {};
Set<MemberEntity> _processedMembers = {};
final Set<MemberEntity> _processedMembers = {};
bool get isClosed => _closed;

View file

@ -164,7 +164,7 @@ class WorldImpactBuilderImpl extends WorldImpact implements WorldImpactBuilder {
class StagedWorldImpactBuilder implements WorldImpactBuilder {
final bool collectImpacts;
WorldImpactBuilderImpl _currentBuilder;
List<WorldImpactBuilderImpl> _builders = [];
final List<WorldImpactBuilderImpl> _builders = [];
StagedWorldImpactBuilder({this.collectImpacts = false});

View file

@ -141,7 +141,7 @@ class DynamicVisitor extends StaticTypeVisitorBase {
final bool Function(Uri uri) analyzedUrisFilter;
Map _expectedJson = {};
Map<String, Map<String, List<DiagnosticMessage>>> _actualMessages = {};
final Map<String, Map<String, List<DiagnosticMessage>>> _actualMessages = {};
DynamicVisitor(this.reporter, this.component, this._allowedListPath,
this.analyzedUrisFilter)

View file

@ -134,7 +134,7 @@ class CodeDataInterpreter implements DataInterpreter<String> {
const CodeDataInterpreter();
String _clean(String code) => code.replaceAll(_re, '');
static RegExp _re = RegExp(r'[\n\r]\s*');
static final RegExp _re = RegExp(r'[\n\r]\s*');
@override
String isAsExpected(String actualData, String expectedData) {

View file

@ -140,10 +140,12 @@ void flavorStringTests() {
flavorStringTest(['--no-sf1', '--sf3', '--sf4'], 'sf2');
flavorStringTest(['--no-sf1', '--no-sf2', '--sf3', '--sf4', '--cf1'], 'cf1');
flavorStringTest(['--cf1'], 'sf1, sf2, no-sf3, no-sf4, cf1');
flavorStringTest(['--no-sf1', '--no-sf2', '--sf3', '--sf4', '--no-cf3'], 'no-cf3');
flavorStringTest(
['--no-sf1', '--no-sf2', '--sf3', '--sf4', '--no-cf3'], 'no-cf3');
flavorStringTest(['--no-cf3'], 'sf1, sf2, no-sf3, no-sf4, no-cf3');
flavorStringTest(['--no-sf1', '--no-sf2', '--sf3', '--sf4', '--cf1',
'--no-cf3'], 'cf1, no-cf3');
flavorStringTest(
['--no-sf1', '--no-sf2', '--sf3', '--sf4', '--cf1', '--no-cf3'],
'cf1, no-cf3');
}
void main() {

View file

@ -4,14 +4,14 @@
// @dart = 2.7
import 'package:expect/expect.dart';
import 'package:compiler/src/common_elements.dart';
import 'package:compiler/src/deferred_load/output_unit.dart';
import 'package:compiler/src/elements/entities.dart';
import 'package:compiler/src/js/js.dart' as js;
import 'package:compiler/src/js_backend/namer.dart';
import 'package:compiler/src/js_emitter/model.dart';
import 'package:compiler/src/js_model/js_strategy.dart';
import 'package:compiler/src/js/js.dart' as js;
import 'package:expect/expect.dart';
ClassEntity lookupClass(JElementEnvironment elementEnvironment, String name) {
ClassEntity cls =
@ -111,10 +111,10 @@ class ProgramLookup {
class LibraryData {
final Library library;
Map<ClassEntity, ClassData> _classMap = {};
Map<FunctionEntity, StaticMethod> _methodMap = {};
Map<FieldEntity, Field> _fieldMap = {};
Map<FieldEntity, StaticField> _staticFieldMap = {};
final Map<ClassEntity, ClassData> _classMap = {};
final Map<FunctionEntity, StaticMethod> _methodMap = {};
final Map<FieldEntity, Field> _fieldMap = {};
final Map<FieldEntity, StaticField> _staticFieldMap = {};
LibraryData(this.library, Fragment fragment) {
for (Class cls in library.classes) {
@ -178,10 +178,10 @@ class LibraryData {
class ClassData {
final Class cls;
Map<FunctionEntity, Method> _methodMap = {};
Map<FieldEntity, Field> _fieldMap = {};
Map<FieldEntity, StaticField> _staticFieldMap = {};
Map<FieldEntity, StubMethod> _checkedSetterMap = {};
final Map<FunctionEntity, Method> _methodMap = {};
final Map<FieldEntity, Field> _fieldMap = {};
final Map<FieldEntity, StaticField> _staticFieldMap = {};
final Map<FieldEntity, StubMethod> _checkedSetterMap = {};
ClassData(this.cls) {
if (cls != null) {

View file

@ -54,16 +54,14 @@ returnDyn6() {
}
/*member: returnDyn7b:Union([exact=JSString], [exact=JSUInt31])*/
returnDyn7b(
/*Union([exact=JSString], [exact=JSUInt31])*/ x) {
returnDyn7b(/*Union([exact=JSString], [exact=JSUInt31])*/ x) {
return x;
}
/*member: returnDyn7:Union([exact=JSString], [exact=JSUInt31])*/
returnDyn7() {
dynamic a = "foo";
if (a. /*Value([exact=JSString], value: "foo")*/ length
/*invoke: [subclass=JSInt]*/ ==
if (a. /*Value([exact=JSString], value: "foo")*/ length /*invoke: [subclass=JSInt]*/ ==
3) {
a = 52;
}
@ -72,15 +70,13 @@ returnDyn7() {
}
/*member: returnDyn8:Union([exact=JSString], [exact=JSUInt31])*/
returnDyn8(
/*Union([exact=JSString], [exact=JSUInt31])*/ x) {
returnDyn8(/*Union([exact=JSString], [exact=JSUInt31])*/ x) {
return x;
}
/*member: test8:Union(null, [exact=JSString], [exact=JSUInt31])*/ test8() {
dynamic a = "foo";
if (a. /*Value([exact=JSString], value: "foo")*/ length
/*invoke: [subclass=JSInt]*/ ==
if (a. /*Value([exact=JSString], value: "foo")*/ length /*invoke: [subclass=JSInt]*/ ==
3) {
a = 52;
}
@ -89,16 +85,14 @@ returnDyn8(
}
/*member: returnDyn9:Union([exact=JSString], [exact=JSUInt31])*/
returnDyn9(
/*Union([exact=JSString], [exact=JSUInt31])*/ x) {
returnDyn9(/*Union([exact=JSString], [exact=JSUInt31])*/ x) {
return x;
}
/*member: test9:[null]*/
test9() {
dynamic a = "foo";
if (a. /*Value([exact=JSString], value: "foo")*/ length
/*invoke: [subclass=JSInt]*/ ==
if (a. /*Value([exact=JSString], value: "foo")*/ length /*invoke: [subclass=JSInt]*/ ==
3) {
a = 52;
}
@ -112,8 +106,7 @@ test9() {
/*member: test10:[null]*/
test10() {
dynamic a = "foo";
if (a. /*Value([exact=JSString], value: "foo")*/ length
/*invoke: [subclass=JSInt]*/ ==
if (a. /*Value([exact=JSString], value: "foo")*/ length /*invoke: [subclass=JSInt]*/ ==
3) {
a = 52;
}

View file

@ -39,9 +39,8 @@ class Class1 {
/*member: instanceAssignPlus:[subclass=JSPositiveInt]*/
instanceAssignPlus() {
var c = new Class1();
return c.
/*[exact=Class1]*/ /*update: [exact=Class1]*/ field
/*invoke: [subclass=JSPositiveInt]*/ += 42;
return c. /*[exact=Class1]*/ /*update: [exact=Class1]*/ field /*invoke: [subclass=JSPositiveInt]*/ +=
42;
}
/*member: Class2.:[exact=Class2]*/
@ -53,9 +52,8 @@ class Class2 {
/*member: instanceAssignAnd:[exact=JSUInt31]*/
instanceAssignAnd() {
var c = new Class2();
return c.
/*[exact=Class2]*/ /*update: [exact=Class2]*/ field
/*invoke: [exact=JSUInt31]*/ &= 42;
return c. /*[exact=Class2]*/ /*update: [exact=Class2]*/ field /*invoke: [exact=JSUInt31]*/ &=
42;
}
/*member: assignIndexPlus:[subclass=JSPositiveInt]*/
@ -88,9 +86,8 @@ assignIndexInc() {
/*member: assignIndexDec:[subclass=JSInt]*/
assignIndexDec() {
var i = [87];
return
/*invoke: [subclass=JSInt]*/ --i
/*Container([exact=JSExtendableArray], element: [subclass=JSInt], length: 1)*/
/*update: Container([exact=JSExtendableArray], element: [subclass=JSInt], length: 1)*/
[0];
return /*invoke: [subclass=JSInt]*/ --i
/*Container([exact=JSExtendableArray], element: [subclass=JSInt], length: 1)*/
/*update: Container([exact=JSExtendableArray], element: [subclass=JSInt], length: 1)*/
[0];
}

View file

@ -30,9 +30,7 @@ main() {
/*member: A1.:[exact=A1]*/
class A1 {
/*member: A1.x1:Value([exact=JSString], value: "s")*/
x1(
/*Value([exact=JSString], value: "s")*/ p) =>
p;
x1(/*Value([exact=JSString], value: "s")*/ p) => p;
}
/*member: test1:[null]*/
@ -78,9 +76,7 @@ test4() {
/*member: A5.:[exact=A5]*/
class A5 {
/*member: A5.x5:Union([exact=JSNumNotInt], [exact=JSUInt31])*/
x5(
/*Union([exact=JSNumNotInt], [exact=JSUInt31])*/ p) =>
p;
x5(/*Union([exact=JSNumNotInt], [exact=JSUInt31])*/ p) => p;
}
/*member: test5:[null]*/
@ -92,9 +88,7 @@ test5() {
/*member: A6.:[exact=A6]*/
class A6 {
/*member: A6.x6:Union([exact=JSNumNotInt], [exact=JSUInt31])*/
x6(
/*Union([exact=JSNumNotInt], [exact=JSUInt31])*/ p) =>
p;
x6(/*Union([exact=JSNumNotInt], [exact=JSUInt31])*/ p) => p;
}
/*member: test6:[null]*/
@ -106,8 +100,8 @@ test6() {
/*member: A7.:[exact=A7]*/
class A7 {
/*member: A7.x7:[empty]*/
x7(
/*Union([exact=JSString], [exact=JSUInt31])*/ p) => /*invoke: [exact=A7]*/ x7("x");
x7(/*Union([exact=JSString], [exact=JSUInt31])*/ p) => /*invoke: [exact=A7]*/ x7(
"x");
}
/*member: test7:[null]*/
@ -118,8 +112,7 @@ test7() {
/*member: A8.:[exact=A8]*/
class A8 {
/*member: A8.x8:[empty]*/
x8(
/*Union([exact=JSString], [subclass=JsLinkedHashMap])*/ p) =>
x8(/*Union([exact=JSString], [subclass=JsLinkedHashMap])*/ p) =>
/*invoke: [exact=A8]*/ x8("x");
}
@ -144,8 +137,7 @@ test9() {
/*member: A10.:[exact=A10]*/
class A10 {
/*member: A10.x10:[empty]*/ x10(
/*[exact=JSUInt31]*/ p1,
/*member: A10.x10:[empty]*/ x10(/*[exact=JSUInt31]*/ p1,
/*[exact=JSUInt31]*/ p2) => /*invoke: [exact=A10]*/ x10(p1, p2);
}
@ -157,8 +149,7 @@ test10() {
/*member: A11.:[exact=A11]*/
class A11 {
/*member: A11.x11:[empty]*/
x11(
/*[exact=JSUInt31]*/ p1,
x11(/*[exact=JSUInt31]*/ p1,
/*[exact=JSUInt31]*/ p2) => /*invoke: [exact=A11]*/ x11(p1, p2);
}
@ -176,8 +167,7 @@ test11() {
/*member: A12.:[exact=A12]*/
class A12 {
/*member: A12.x12:[empty]*/
x12(
/*Union([exact=JSString], [exact=JSUInt31])*/ p1,
x12(/*Union([exact=JSString], [exact=JSUInt31])*/ p1,
/*Union([exact=JSString], [exact=JSUInt31])*/ p2) =>
/*invoke: [exact=A12]*/ x12(1, 2);
}
@ -190,8 +180,7 @@ test12() {
/*member: A13.:[exact=A13]*/
class A13 {
/*member: A13.x13:[exact=JSUInt31]*/
x13(
/*Value([exact=JSString], value: "x")*/ p1,
x13(/*Value([exact=JSString], value: "x")*/ p1,
[/*[exact=JSUInt31]*/ p2 = 1]) =>
1;
}
@ -205,9 +194,7 @@ test13() {
/*member: A14.:[exact=A14]*/
class A14 {
/*member: A14.x14:[exact=JSUInt31]*/
x14(
/*Union([exact=JSNumNotInt], [exact=JSUInt31])*/ p) =>
1;
x14(/*Union([exact=JSNumNotInt], [exact=JSUInt31])*/ p) => 1;
}
/*member: f14:[exact=JSUInt31]*/
@ -237,8 +224,7 @@ test15() {
/*member: A16.:[exact=A16]*/
class A16 {
/*member: A16.x16:[exact=JSUInt31]*/
x16(
/*Value([exact=JSString], value: "x")*/ p1,
x16(/*Value([exact=JSString], value: "x")*/ p1,
[/*[exact=JSBool]*/ p2 = true]) =>
1;
}
@ -297,8 +283,7 @@ test18() {
/*member: A19.:[exact=A19]*/
class A19 {
/*member: A19.x19:[empty]*/
x19(
/*Union([exact=JSString], [exact=JSUInt31])*/ p1,
x19(/*Union([exact=JSString], [exact=JSUInt31])*/ p1,
/*Union([exact=JSString], [exact=JSUInt31])*/ p2) =>
/*invoke: [subclass=A19]*/ x19(p1, p2);
}

View file

@ -55,11 +55,10 @@ foo2(int /*[exact=JSUInt31]*/ choice) {
for (int i = 0;
i /*invoke: [subclass=JSPositiveInt]*/ != 3;
i /*invoke: [subclass=JSPositiveInt]*/ ++) {
methods. /*invoke: [exact=JSExtendableArray]*/ add(
/*[null]*/ (int
/*spec.[null|subclass=Object]*/
/*prod.[null|subclass=JSInt]*/
x) {
methods. /*invoke: [exact=JSExtendableArray]*/ add(/*[null]*/ (int
/*spec.[null|subclass=Object]*/
/*prod.[null|subclass=JSInt]*/
x) {
res = x;
sum = x /*invoke: [null|subclass=JSInt]*/ + i;
});

View file

@ -58,9 +58,9 @@ test1() {
anotherInt1 = otherDict1
/*Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSString], [exact=JSUInt31]), map: {stringTwo: Value([exact=JSString], value: "anotherString"), intTwo: [exact=JSUInt31]})*/
['intTwo'];
dynamic1 = dictionaryA1
/*Map([subclass=JsLinkedHashMap], key: [null|subclass=Object], value: [null|subclass=Object])*/ [
'int'];
dynamic1 =
dictionaryA1 /*Map([subclass=JsLinkedHashMap], key: [null|subclass=Object], value: [null|subclass=Object])*/ [
'int'];
nullOrInt1 = dictionaryB1
/*Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt], [exact=JSString], [exact=JSUInt31]), map: {string: Value([exact=JSString], value: "aString"), int: [exact=JSUInt31], double: [exact=JSNumNotInt], list: Container([exact=JSExtendableArray], element: [null|subclass=Object], length: null), stringTwo: Value([null|exact=JSString], value: "anotherString"), intTwo: [null|exact=JSUInt31]})*/
['intTwo'];

View file

@ -584,7 +584,9 @@ class A22 {
/*update: [exact=A22]*/ f22a = 42;
/*update: [exact=A22]*/ f22b = /*[exact=A22]*/ f22a == null
? 42
: /*[exact=A22]*/ f22c == null ? 41 : 43;
: /*[exact=A22]*/ f22c == null
? 41
: 43;
/*update: [exact=A22]*/ f22c = 'foo';
}
}
@ -648,10 +650,9 @@ class A24 {
/*member: A24.:[exact=A24]*/
A24() : f24d = 42 {
/*[subclass=A24]*/ /*update: [subclass=A24]*/ f24a
/*invoke: [subclass=JSPositiveInt]*/ ++;
/*[subclass=A24]*/ /*update: [subclass=A24]*/ f24b
/*invoke: [subclass=JSPositiveInt]*/ += 42;
/*[subclass=A24]*/ /*update: [subclass=A24]*/ f24a /*invoke: [subclass=JSPositiveInt]*/ ++;
/*[subclass=A24]*/ /*update: [subclass=A24]*/ f24b /*invoke: [subclass=JSPositiveInt]*/ +=
42;
var f24f = 'foo';
this. /*update: [subclass=A24]*/ f24f = f24f;
}
@ -720,8 +721,7 @@ test26() {
new A26(). /*update: [exact=A26]*/ f26 = <dynamic>[new B26(), new A26()]
/*Container([exact=JSExtendableArray], element: Union([exact=A26], [exact=B26]), length: 2)*/
[0]
. /*Union([exact=A26], [exact=B26])*/ f26
/*invoke: [subclass=JSPositiveInt]*/ +
. /*Union([exact=A26], [exact=B26])*/ f26 /*invoke: [subclass=JSPositiveInt]*/ +
42;
}

View file

@ -24,8 +24,7 @@ class ViewCardComponent extends AppView<CardComponent> {
@pragma('dart2js:noInline')
set ng_title(String /*Value([exact=JSString], value: "foo")*/ value) {
if (/*invoke: [exact=ViewCardComponent]*/ checkBinding(
/*[exact=ViewCardComponent]*/ _title,
value)) {
/*[exact=ViewCardComponent]*/ _title, value)) {
/*[exact=ViewCardComponent]*/ ctx
. /*update: [null|exact=CardComponent]*/ title = value;
/*update: [exact=ViewCardComponent]*/ _title = value;
@ -33,8 +32,7 @@ class ViewCardComponent extends AppView<CardComponent> {
}
/*member: ViewCardComponent.checkBinding:Value([exact=JSBool], value: true)*/
checkBinding(
/*Value([null|exact=JSString], value: "foo")*/ a,
checkBinding(/*Value([null|exact=JSString], value: "foo")*/ a,
/*Value([exact=JSString], value: "foo")*/ b) =>
true;
}
@ -53,8 +51,7 @@ class ViewCardComponent2 extends AppView<CardComponent2> {
@pragma('dart2js:noInline')
set ng_title(String /*Value([exact=JSString], value: "bar")*/ value) {
if (/*invoke: [exact=ViewCardComponent2]*/ checkBinding(
/*[exact=ViewCardComponent2]*/ _title,
value)) {
/*[exact=ViewCardComponent2]*/ _title, value)) {
/*[exact=ViewCardComponent2]*/ ctx
. /*update: [null|exact=CardComponent2]*/ title = value;
/*update: [exact=ViewCardComponent2]*/ _title = value;
@ -62,8 +59,7 @@ class ViewCardComponent2 extends AppView<CardComponent2> {
}
/*member: ViewCardComponent2.checkBinding:Value([exact=JSBool], value: true)*/
checkBinding(
/*Value([null|exact=JSString], value: "bar")*/ a,
checkBinding(/*Value([null|exact=JSString], value: "bar")*/ a,
/*Value([exact=JSString], value: "bar")*/ b) =>
true;
}

View file

@ -783,8 +783,7 @@ class C {
/*member: C.[]=:[null]*/
operator []=(
/*[exact=JSUInt31]*/ index,
/*[subclass=JSPositiveInt]*/ value) {}
/*[exact=JSUInt31]*/ index, /*[subclass=JSPositiveInt]*/ value) {}
/*member: C.returnInt5:[subclass=JSPositiveInt]*/
returnInt5() => /*invoke: [subclass=JSPositiveInt]*/ ++this /*[exact=C]*/ /*update: [exact=C]*/ [
@ -809,8 +808,7 @@ testCascade2() {
return new CascadeHelper()
.. /*update: [exact=CascadeHelper]*/ a = "hello"
.. /*update: [exact=CascadeHelper]*/ b = 42
.. /*[exact=CascadeHelper]*/ i
/*invoke: [subclass=JSPositiveInt]*/ /*update: [exact=CascadeHelper]*/ +=
.. /*[exact=CascadeHelper]*/ i /*invoke: [subclass=JSPositiveInt]*/ /*update: [exact=CascadeHelper]*/ +=
1;
}

View file

@ -9,8 +9,7 @@
/// _disabled_.
/*member: foo:Value([null|exact=JSBool], value: true)*/
foo(
/*Union([exact=JSBool], [exact=JSString], [exact=JSUInt31])*/ x,
foo(/*Union([exact=JSBool], [exact=JSString], [exact=JSUInt31])*/ x,
[/*Value([null|exact=JSBool], value: true)*/ y]) =>
y;

View file

@ -15,20 +15,18 @@ main() {
listIndexPostfixIncrement() {
var list = [0];
return list
/*Container([exact=JSExtendableArray], element: [subclass=JSPositiveInt], length: 1)*/
/*update: Container([exact=JSExtendableArray], element: [subclass=JSPositiveInt], length: 1)*/
[0]
/*invoke: [subclass=JSPositiveInt]*/ ++;
/*Container([exact=JSExtendableArray], element: [subclass=JSPositiveInt], length: 1)*/
/*update: Container([exact=JSExtendableArray], element: [subclass=JSPositiveInt], length: 1)*/
[0] /*invoke: [subclass=JSPositiveInt]*/ ++;
}
/*member: listIndexPostfixDecrement:[subclass=JSInt]*/
listIndexPostfixDecrement() {
var list = [0];
return list
/*Container([exact=JSExtendableArray], element: [subclass=JSInt], length: 1)*/
/*update: Container([exact=JSExtendableArray], element: [subclass=JSInt], length: 1)*/
[0]
/*invoke: [subclass=JSInt]*/ --;
/*Container([exact=JSExtendableArray], element: [subclass=JSInt], length: 1)*/
/*update: Container([exact=JSExtendableArray], element: [subclass=JSInt], length: 1)*/
[0] /*invoke: [subclass=JSInt]*/ --;
}
/*member: Super1.:[exact=Super1]*/

View file

@ -44,9 +44,8 @@ class JsInteropClass {
jsInteropClass() {
JsInteropClass cls = new JsInteropClass();
return cls. /*update: [null|subclass=JavaScriptObject]*/ setter =
cls. /*[null|subclass=JavaScriptObject]*/ getter
/*invoke: [null|subclass=JSInt]*/ +
cls. /*invoke: [subclass=JavaScriptObject]*/ method(0)
/*invoke: [subclass=JSInt]*/ +
cls. /*[null|subclass=JavaScriptObject]*/ getter /*invoke: [null|subclass=JSInt]*/ +
cls. /*invoke: [subclass=JavaScriptObject]*/ method(
0) /*invoke: [subclass=JSInt]*/ +
10;
}

View file

@ -103,8 +103,7 @@ class Class4 {}
/*member: _promotedAndIfThen:[null]*/
_promotedAndIfThen(
/*Union([exact=Class4], [exact=JSUInt31])*/ o,
/*[exact=JSBool]*/ c) {
/*Union([exact=Class4], [exact=JSUInt31])*/ o, /*[exact=JSBool]*/ c) {
if (o is Class4 && c) {
o. /*invoke: [exact=Class4]*/ toString();
}
@ -125,8 +124,7 @@ class Class5 {}
/*member: _promotedAndIfThenElse:[null]*/
_promotedAndIfThenElse(
/*Union([exact=Class5], [exact=JSUInt31])*/ o,
/*[exact=JSBool]*/ c) {
/*Union([exact=Class5], [exact=JSUInt31])*/ o, /*[exact=JSBool]*/ c) {
if (o is Class5 && c) {
o. /*invoke: [exact=Class5]*/ toString();
} else {
@ -151,8 +149,7 @@ class Class6 {}
/*member: _promotedNotAndIfThenElse:[null]*/
_promotedNotAndIfThenElse(
/*Union([exact=Class6], [exact=JSUInt31])*/ o,
/*[exact=JSBool]*/ c) {
/*Union([exact=Class6], [exact=JSUInt31])*/ o, /*[exact=JSBool]*/ c) {
if (o is! Class6 && c) {
o. /*invoke: Union([exact=Class6], [exact=JSUInt31])*/ toString();
} else {
@ -175,8 +172,7 @@ class Class7 {}
/*member: _promotedOrIfThen:[null]*/
_promotedOrIfThen(
/*Union([exact=Class7], [exact=JSUInt31])*/ o,
/*[exact=JSBool]*/ c) {
/*Union([exact=Class7], [exact=JSUInt31])*/ o, /*[exact=JSBool]*/ c) {
if (o is Class7 || c) {
o. /*invoke: Union([exact=Class7], [exact=JSUInt31])*/ toString();
}
@ -197,8 +193,7 @@ class Class8 {}
/*member: _promotedOrIfThenElse:[null]*/
_promotedOrIfThenElse(
/*Union([exact=Class8], [exact=JSUInt31])*/ o,
/*[exact=JSBool]*/ c) {
/*Union([exact=Class8], [exact=JSUInt31])*/ o, /*[exact=JSBool]*/ c) {
if (o is Class8 || c) {
o. /*invoke: Union([exact=Class8], [exact=JSUInt31])*/ toString();
} else {
@ -223,8 +218,7 @@ class Class9 {}
/*member: _promotedNotOrIfThenElse:[null]*/
_promotedNotOrIfThenElse(
/*Union([exact=Class9], [exact=JSUInt31])*/ o,
/*[exact=JSBool]*/ c) {
/*Union([exact=Class9], [exact=JSUInt31])*/ o, /*[exact=JSBool]*/ c) {
if (o is! Class9 || c) {
o. /*invoke: Union([exact=Class9], [exact=JSUInt31])*/ toString();
} else {
@ -269,8 +263,7 @@ promotedNotNotIfThen() {
class Class11 {}
/*member: _promotedParenNotIfThenElse:[null]*/
_promotedParenNotIfThenElse(
/*Union([exact=Class11], [exact=JSUInt31])*/ o) {
_promotedParenNotIfThenElse(/*Union([exact=Class11], [exact=JSUInt31])*/ o) {
if (!(o is Class11)) {
// TODO(johnniwinther): Use negative type knowledge to show that the
// receiver must be [exact=JSUInt31].

View file

@ -21,37 +21,32 @@ class A {
operator []=(/*[empty]*/ index, /*[subclass=JSNumber]*/ value) {}
/*member: A.returnDynamic1:Union([exact=JSString], [exact=JSUInt31])*/
returnDynamic1() => /*[subclass=A]*/ /*update: [subclass=A]*/ foo
/*invoke: Union([exact=JSString], [exact=JSUInt31])*/ --;
returnDynamic1() => /*[subclass=A]*/ /*update: [subclass=A]*/ foo /*invoke: Union([exact=JSString], [exact=JSUInt31])*/ --;
/*member: A.returnNum1:[subclass=JSNumber]*/
returnNum1() => /*invoke: Union([exact=JSString], [exact=JSUInt31])*/ --
/*[subclass=A]*/ /*update: [subclass=A]*/ foo;
returnNum1() => /*invoke: Union([exact=JSString], [exact=JSUInt31])*/ -- /*[subclass=A]*/ /*update: [subclass=A]*/ foo;
/*member: A.returnNum2:[subclass=JSNumber]*/
returnNum2() => /*[subclass=A]*/ /*update: [subclass=A]*/ foo
/*invoke: Union([exact=JSString], [exact=JSUInt31])*/ -= 42;
returnNum2() => /*[subclass=A]*/ /*update: [subclass=A]*/ foo /*invoke: Union([exact=JSString], [exact=JSUInt31])*/ -=
42;
/*member: A.returnDynamic2:Union([exact=JSString], [exact=JSUInt31])*/
returnDynamic2() => this
/*[subclass=A]*/ /*update: [subclass=A]*/ [index]
/*invoke: Union([exact=JSString], [exact=JSUInt31])*/ --;
returnDynamic2() => this /*[subclass=A]*/ /*update: [subclass=A]*/ [
index] /*invoke: Union([exact=JSString], [exact=JSUInt31])*/ --;
/*member: A.returnNum3:[subclass=JSNumber]*/
returnNum3() => /*invoke: Union([exact=JSString], [exact=JSUInt31])*/ --this
/*[subclass=A]*/ /*update: [subclass=A]*/ [index];
returnNum3() => /*invoke: Union([exact=JSString], [exact=JSUInt31])*/ --this /*[subclass=A]*/ /*update: [subclass=A]*/ [
index];
/*member: A.returnNum4:[subclass=JSNumber]*/
returnNum4() => this
/*[subclass=A]*/ /*update: [subclass=A]*/ [index]
/*invoke: Union([exact=JSString], [exact=JSUInt31])*/ -= 42;
returnNum4() => this /*[subclass=A]*/ /*update: [subclass=A]*/ [
index] /*invoke: Union([exact=JSString], [exact=JSUInt31])*/ -= 42;
/*member: A.returnEmpty3:[empty]*/
returnEmpty3() {
dynamic a = this;
return a. /*[subclass=A]*/ /*update: [subclass=A]*/
bar
/*invoke: [empty]*/ --;
bar /*invoke: [empty]*/ --;
}
/*member: A.returnEmpty1:[empty]*/
@ -64,8 +59,8 @@ class A {
/*member: A.returnEmpty2:[empty]*/
returnEmpty2() {
dynamic a = this;
return a. /*[subclass=A]*/ /*update: [subclass=A]*/ bar
/*invoke: [empty]*/ -= 42;
return a. /*[subclass=A]*/ /*update: [subclass=A]*/ bar /*invoke: [empty]*/ -=
42;
}
}
@ -90,8 +85,8 @@ class B extends A {
super.foo /*invoke: Value([exact=JSString], value: "string")*/ -= 42;
/*member: B.returnString2:Value([exact=JSString], value: "string")*/
returnString2() => super[index]
/*invoke: Value([exact=JSString], value: "string")*/ --;
returnString2() =>
super[index] /*invoke: Value([exact=JSString], value: "string")*/ --;
/*member: B.returnDynamic3:[empty]*/
returnDynamic3() =>
@ -99,8 +94,8 @@ class B extends A {
--super[index];
/*member: B.returnDynamic4:[empty]*/
returnDynamic4() => super[index]
/*invoke: Value([exact=JSString], value: "string")*/ -= 42;
returnDynamic4() =>
super[index] /*invoke: Value([exact=JSString], value: "string")*/ -= 42;
}
/*member: main:[null]*/

View file

@ -88,11 +88,10 @@ instanceFieldPrefixInc() {
if (c. /*[exact=Class1]*/ field1 == null) {
c. /*update: [exact=Class1]*/ field1 = 0;
}
return
/*invoke: [null|subclass=JSPositiveInt]*/ ++c.
/*[exact=Class1]*/
/*update: [exact=Class1]*/
field1;
return /*invoke: [null|subclass=JSPositiveInt]*/ ++c.
/*[exact=Class1]*/
/*update: [exact=Class1]*/
field1;
}
////////////////////////////////////////////////////////////////////////////////
@ -111,11 +110,10 @@ instanceFieldPrefixDec() {
if (c. /*[exact=Class2]*/ field2 == null) {
c. /*update: [exact=Class2]*/ field2 = 0;
}
return
/*invoke: [null|subclass=JSInt]*/ --c.
/*[exact=Class2]*/
/*update: [exact=Class2]*/
field2;
return /*invoke: [null|subclass=JSInt]*/ --c.
/*[exact=Class2]*/
/*update: [exact=Class2]*/
field2;
}
////////////////////////////////////////////////////////////////////////////////
@ -134,11 +132,10 @@ conditionalInstanceFieldPrefixInc() {
if (c. /*[exact=Class3]*/ field3 == null) {
c. /*update: [exact=Class3]*/ field3 = 0;
}
return
/*invoke: [null|subclass=JSPositiveInt]*/ ++c?.
/*[exact=Class3]*/
/*update: [exact=Class3]*/
field3;
return /*invoke: [null|subclass=JSPositiveInt]*/ ++c?.
/*[exact=Class3]*/
/*update: [exact=Class3]*/
field3;
}
////////////////////////////////////////////////////////////////////////////////
@ -157,9 +154,8 @@ conditionalInstanceFieldPrefixDec() {
if (c. /*[exact=Class4]*/ field4 == null) {
c. /*update: [exact=Class4]*/ field4 = 0;
}
return
/*invoke: [null|subclass=JSInt]*/ --c?.
/*[exact=Class4]*/
/*update: [exact=Class4]*/
field4;
return /*invoke: [null|subclass=JSInt]*/ --c?.
/*[exact=Class4]*/
/*update: [exact=Class4]*/
field4;
}

View file

@ -59,7 +59,8 @@ emptyTryFinally() {
/*member: _emptyTryCatchFinally:[exact=JSUInt31]*/
_emptyTryCatchFinally(/*[exact=JSUInt31]*/ o) {
try {} catch (e) {} finally {}
try {} catch (e) {
} finally {}
return o;
}

View file

@ -145,23 +145,19 @@ class TypeMaskIrComputer extends IrDataExtractor<String> {
node is ir.FunctionDeclaration) {
ClosureRepresentationInfo info = _closureDataLookup.getClosureInfo(node);
return getMemberValue(info.callMethod);
} else if (
node is ir.InstanceInvocation ||
} else if (node is ir.InstanceInvocation ||
node is ir.InstanceGetterInvocation ||
node is ir.DynamicInvocation ||
node is ir.FunctionInvocation ||
node is ir.EqualsNull ||
node is ir.EqualsCall) {
return getTypeMaskValue(result.typeOfReceiver(node));
} else if (
node is ir.InstanceGet ||
} else if (node is ir.InstanceGet ||
node is ir.DynamicGet ||
node is ir.InstanceTearOff ||
node is ir.FunctionTearOff) {
return getTypeMaskValue(result.typeOfReceiver(node));
} else if (
node is ir.InstanceSet ||
node is ir.DynamicSet) {
} else if (node is ir.InstanceSet || node is ir.DynamicSet) {
return getTypeMaskValue(result.typeOfReceiver(node));
} else if (node is ir.ForInStatement) {
if (id.kind == IdKind.iterator) {

View file

@ -328,16 +328,16 @@ runNegativeTest(
entryPoint: entryPoint,
memorySourceFiles: sources,
diagnosticHandler: collector);
Expect.isFalse(result.isSuccess,
"Expected compile time error(s) for\n$subTest");
Expect.isFalse(
result.isSuccess, "Expected compile time error(s) for\n$subTest");
List<String> expected =
subTest.expectedErrors.map((error) => 'MessageKind.' + error).toList();
List<String> actual =
collector.errors.map((error) => error.messageKind.toString()).toList();
expected.sort();
actual.sort();
Expect.listEquals(expected, actual,
"Unexpected compile time error(s) for\n$subTest");
Expect.listEquals(
expected, actual, "Unexpected compile time error(s) for\n$subTest");
}
class SubTest {

View file

@ -26,8 +26,7 @@ main(List<String> args) {
Directory dataDir = new Directory.fromUri(Platform.script.resolve('data'));
bool strict = args.contains('-s');
await checkTests(dataDir, new OptimizationDataComputer(strict: strict),
options: [Flags.disableInlining],
args: args);
options: [Flags.disableInlining], args: args);
});
}

View file

@ -9,7 +9,7 @@
class A<T> {
@pragma('dart2js:noInline')
m() {
return /*needsSignature*/(T t, String s) {};
return /*needsSignature*/ (T t, String s) {};
}
}

View file

@ -9,7 +9,7 @@
class A<T> {
@pragma('dart2js:noInline')
m() {
return /*needsSignature*/(T t, String s) {};
return /*needsSignature*/ (T t, String s) {};
}
}

View file

@ -47,7 +47,9 @@ main() {
/*needsArgs,needsSignature,selectors=[Selector(call, call, arity=0, types=1)]*/
method8<T extends Class2a<num>>() => null;
/*needsArgs,needsSignature,selectors=[Selector(call, call, arity=0, types=1)]*/method9<T>() => null;
/*needsArgs,needsSignature,selectors=[Selector(call, call, arity=0, types=1)]*/ method9<
T>() =>
null;
dynamic f1 = method1;
dynamic f2 = method2;

View file

@ -15,7 +15,7 @@ class B<S> {
F<S> c;
method() {
return /*spec.needsSignature*/() {
return /*spec.needsSignature*/ () {
c = f;
};
}

View file

@ -15,7 +15,7 @@ class B<S> {
F<S> c;
method() {
return /*spec.needsSignature*/() {
return /*spec.needsSignature*/ () {
c = f;
};
}

View file

@ -13,7 +13,7 @@ import 'package:expect/expect.dart';
/*spec.member: method:implicit=[method.T],indirect,needsArgs*/
/*prod.member: method:needsArgs*/
method<T>() {
return /*spec.needsSignature*/() => <T, int>{};
return /*spec.needsSignature*/ () => <T, int>{};
}
@pragma('dart2js:noInline')

View file

@ -8,17 +8,17 @@ import 'package:expect/expect.dart';
class Class1 {
method1() {
/*needsArgs,needsSignature*/num local<T>(num n) => null;
/*needsArgs,needsSignature*/ num local<T>(num n) => null;
return local;
}
method2() {
/*needsArgs,needsSignature*/num local<T>(int n) => null;
/*needsArgs,needsSignature*/ num local<T>(int n) => null;
return local;
}
method3() {
/*needsArgs,needsSignature*/int local<T>(num n) => null;
/*needsArgs,needsSignature*/ int local<T>(num n) => null;
return local;
}
}
@ -46,7 +46,7 @@ class Class4 {
/*prod.member: Class4.method6:needsArgs,selectors=[Selector(call, method6, arity=0, types=1)]*/
/*spec.member: Class4.method6:direct,explicit=[method6.T*],needsArgs,selectors=[Selector(call, method6, arity=0, types=1)]*/
method6<T>() {
/*needsSignature*/num local(num n, T t) => null;
/*needsSignature*/ num local(num n, T t) => null;
return local;
}
}
@ -69,24 +69,24 @@ method8<T>() {
/*spec.member: method9:direct,explicit=[method9.T*],needsArgs*/
/*prod.member: method9:needsArgs*/
method9<T>() {
/*needsSignature*/num local(num n, T t) => null;
/*needsSignature*/ num local(num n, T t) => null;
return local;
}
method10() {
/*spec.direct,explicit=[local.T*],needsArgs,needsSignature*/
/*prod.needsArgs,needsSignature*/num local<T>(T n) => null;
/*prod.needsArgs,needsSignature*/ num local<T>(T n) => null;
return local;
}
method11() {
/*needsArgs,needsSignature*/T local<T>(num n) => null;
/*needsArgs,needsSignature*/ T local<T>(num n) => null;
return local;
}
method12() {
/*spec.direct,explicit=[local.T*],needsArgs,needsSignature*/
/*prod.needsArgs,needsSignature*/num local<T>(num n, T t) => null;
/*prod.needsArgs,needsSignature*/ num local<T>(num n, T t) => null;
return local;
}

View file

@ -14,12 +14,12 @@ class Class1 {
}
method2() {
/*needsSignature*/num local(int n) => null;
/*needsSignature*/ num local(int n) => null;
return local;
}
method3() {
/*needsSignature*/Object local(num n) => null;
/*needsSignature*/ Object local(num n) => null;
return local;
}
}
@ -47,7 +47,7 @@ class Class3<T> {
/*prod.class: Class4:needsArgs*/
class Class4<T> {
method6() {
/*needsSignature*/num local(num n, T t) => null;
/*needsSignature*/ num local(num n, T t) => null;
return local;
}
}

View file

@ -14,7 +14,8 @@ class Class1 {
}
method2() {
/*needsArgs,needsInst=[<dynamic>,<num*>,<num*>],needsSignature*/num local<T>(int n) => null;
/*needsArgs,needsInst=[<dynamic>,<num*>,<num*>],needsSignature*/ num
local<T>(int n) => null;
return local;
}
@ -48,7 +49,7 @@ class Class4 {
/*prod.member: Class4.method6:needsArgs,selectors=[Selector(call, method6, arity=0, types=1)]*/
/*spec.member: Class4.method6:direct,explicit=[method6.T*],needsArgs,selectors=[Selector(call, method6, arity=0, types=1)]*/
method6<T>() {
/*needsSignature*/num local(num n, T t) => null;
/*needsSignature*/ num local(num n, T t) => null;
return local;
}
}
@ -71,7 +72,7 @@ method8<T>() {
/*spec.member: method9:direct,explicit=[method9.T*],needsArgs*/
/*prod.member: method9:needsArgs*/
method9<T>() {
/*needsSignature*/num local(num n, T t) => null;
/*needsSignature*/ num local(num n, T t) => null;
return local;
}
@ -90,7 +91,7 @@ method11() {
method12() {
/*spec.direct,explicit=[local.T*],needsArgs,needsSignature*/
/*prod.needsArgs,needsSignature*/num local<T>(num n, T t) => null;
/*prod.needsArgs,needsSignature*/ num local<T>(num n, T t) => null;
return local;
}

View file

@ -95,7 +95,7 @@ main() {
/*needsSignature*/
({int x, bool y, List<Map> z, classesFunc v}) {} is dynamicFunc);
Expect.isTrue(/*needsSignature*/(
Expect.isTrue(/*needsSignature*/ (
{okWithClassesFunc_1 f1,
okWithGenericsFunc_1 f2,
okWithDynamicFunc_1 f3}) {} is funcFunc);

View file

@ -39,17 +39,15 @@ typedef okWithT1_4({D a});
main() {
Expect.isTrue(/*needsSignature*/ ({A a}) {} is t1);
Expect.isTrue(/*needsSignature*/ ({B a}) {} is t1);
Expect.isTrue(
/*needsSignature*/ ({C a}) {} is t1);
Expect.isTrue(
/*needsSignature*/ ({D a}) {} is t1);
Expect.isTrue(/*needsSignature*/ ({C a}) {} is t1);
Expect.isTrue(/*needsSignature*/ ({D a}) {} is t1);
Expect.isTrue(/*needsSignature*/ ({Object a}) {} is t1);
Expect.isTrue(/*needsSignature*/ ({var a}) {} is t1);
Expect.isTrue(/*needsSignature*/ ({A c}) {} is t2);
Expect.isTrue(/*needsSignature*/ ({B c}) {} is t2);
Expect.isTrue(/*needsSignature*/ ({C c}) {} is t2);
Expect.isTrue(/*needsSignature*/({D c}) {} is t2);
Expect.isTrue(/*needsSignature*/ ({D c}) {} is t2);
Expect.isTrue(/*needsSignature*/ ({Object c}) {} is t2);
Expect.isTrue(/*needsSignature*/ ({var c}) {} is t2);
@ -58,49 +56,49 @@ main() {
Expect.isTrue(/*needsSignature*/ ({Object i}) {} is t3);
Expect.isTrue(/*needsSignature*/ ({var i}) {} is t3);
Expect.isTrue(/*needsSignature*/({A v}) {} is t4);
Expect.isTrue(/*needsSignature*/({B v}) {} is t4);
Expect.isTrue(/*needsSignature*/({C v}) {} is t4);
Expect.isTrue(/*needsSignature*/({D v}) {} is t4);
Expect.isTrue(/*needsSignature*/ ({A v}) {} is t4);
Expect.isTrue(/*needsSignature*/ ({B v}) {} is t4);
Expect.isTrue(/*needsSignature*/ ({C v}) {} is t4);
Expect.isTrue(/*needsSignature*/ ({D v}) {} is t4);
Expect.isTrue(/*needsSignature*/ ({Object v}) {} is t4);
Expect.isTrue(/*needsSignature*/ ({var v}) {} is t4);
Expect.isTrue(/*needsSignature*/({num v}) {} is t4);
Expect.isTrue(/*needsSignature*/({int v}) {} is t4);
Expect.isTrue(/*needsSignature*/({Map v}) {} is t4);
Expect.isTrue(/*needsSignature*/({Map<List<Map<List, List<int>>>, List> v}) {} is t4);
Expect.isTrue(/*needsSignature*/({List v}) {} is t4);
Expect.isTrue(/*needsSignature*/({t8 v}) {} is t4);
Expect.isTrue(/*needsSignature*/({t7 v}) {} is t4);
Expect.isTrue(/*needsSignature*/ ({num v}) {} is t4);
Expect.isTrue(/*needsSignature*/ ({int v}) {} is t4);
Expect.isTrue(/*needsSignature*/ ({Map v}) {} is t4);
Expect.isTrue(
/*needsSignature*/ ({Map<List<Map<List, List<int>>>, List> v}) {} is t4);
Expect.isTrue(/*needsSignature*/ ({List v}) {} is t4);
Expect.isTrue(/*needsSignature*/ ({t8 v}) {} is t4);
Expect.isTrue(/*needsSignature*/ ({t7 v}) {} is t4);
Expect.isTrue(/*needsSignature*/ ({Map m}) {} is t5);
Expect.isTrue(/*needsSignature*/({Map<List, t8> m}) {} is t5);
Expect.isTrue(/*needsSignature*/ ({Map<List, t8> m}) {} is t5);
Expect.isTrue(/*needsSignature*/ ({Object m}) {} is t5);
Expect.isTrue(/*needsSignature*/ ({var m}) {} is t5);
Expect.isTrue(/*needsSignature*/({Map<List, List> m}) {} is t5);
Expect.isTrue(/*needsSignature*/({Map<int, t8> m}) {} is t5);
Expect.isTrue(/*needsSignature*/ ({Map<List, List> m}) {} is t5);
Expect.isTrue(/*needsSignature*/ ({Map<int, t8> m}) {} is t5);
Expect.isTrue(/*needsSignature*/ ({Map<num, num> m}) {} is t6);
Expect.isTrue(/*needsSignature*/({Map<int, int> m}) {} is t6);
Expect.isTrue(/*needsSignature*/ ({Map<int, int> m}) {} is t6);
Expect.isTrue(/*needsSignature*/ ({Map m}) {} is t6);
Expect.isTrue(/*needsSignature*/ ({Object m}) {} is t6);
Expect.isTrue(/*needsSignature*/ ({var m}) {} is t6);
Expect.isTrue(/*needsSignature*/({okWithT1_1 f}) {} is t7);
Expect.isTrue(/*needsSignature*/ ({okWithT1_1 f}) {} is t7);
Expect.isTrue(/*needsSignature*/ ({okWithT1_2 f}) {} is t7);
Expect.isTrue(/*needsSignature*/ ({okWithT1_3 f}) {} is t7);
Expect.isTrue(/*needsSignature*/ ({okWithT1_4 f}) {} is t7);
Expect.isTrue(/*needsSignature*/ ({A a}) {} is t8);
Expect.isTrue(/*needsSignature*/ ({B a}) {} is t8);
Expect.isTrue(
/*needsSignature*/ ({C a}) {} is t8);
Expect.isTrue(
/*needsSignature*/ ({D a}) {} is t8);
Expect.isTrue(/*needsSignature*/ ({C a}) {} is t8);
Expect.isTrue(/*needsSignature*/ ({D a}) {} is t8);
Expect.isTrue(/*needsSignature*/ ({Object a}) {} is t8);
Expect.isTrue(/*needsSignature*/ ({var a}) {} is t8);
Expect.isTrue(/*needsSignature*/({num a}) {} is t8);
Expect.isTrue(/*needsSignature*/({int a}) {} is t8);
Expect.isTrue(/*needsSignature*/({Map a}) {} is t8);
Expect.isTrue(/*needsSignature*/({Map<List<Map<List, List<int>>>, List> a}) {} is t8);
Expect.isTrue(/*needsSignature*/({List a}) {} is t8);
Expect.isTrue(/*needsSignature*/ ({num a}) {} is t8);
Expect.isTrue(/*needsSignature*/ ({int a}) {} is t8);
Expect.isTrue(/*needsSignature*/ ({Map a}) {} is t8);
Expect.isTrue(
/*needsSignature*/ ({Map<List<Map<List, List<int>>>, List> a}) {} is t8);
Expect.isTrue(/*needsSignature*/ ({List a}) {} is t8);
}

View file

@ -96,7 +96,8 @@ class CodeLinesColumnBlock extends DiffColumnBlock {
/// A list of columns that should align in output.
class DiffBlock {
final DiffKind kind;
Map<DiffColumn, DiffColumnBlock> _columns = <DiffColumn, DiffColumnBlock>{};
final Map<DiffColumn, DiffColumnBlock> _columns =
<DiffColumn, DiffColumnBlock>{};
DiffBlock(this.kind);

View file

@ -10,8 +10,8 @@ main() {
promotedCascade(dynamic value) {
if (/*dynamic*/ value is List<String>) {
value = '[${(
/*List<String>*/ value.. /*invoke: [List<String>]->void*/ sort()). /*invoke: [List<String>]->String*/ join(',')}]';
value =
'[${(/*List<String>*/ value.. /*invoke: [List<String>]->void*/ sort()). /*invoke: [List<String>]->String*/ join(',')}]';
}
return /*dynamic*/ value;
}

View file

@ -15,8 +15,8 @@ effectivelyFinalFunctionTyped() {
Function f = (int i) => /*spec.int*/ i;
/*spec.int Function(int)*/ f
. /*spec.invoke: [int Function(int)]->int*/ call(0);
(/*spec.int Function(int)*/ f.call)
/*spec.invoke: [int Function(int)]->int*/ (0);
(/*spec.int Function(int)*/ f
.call) /*spec.invoke: [int Function(int)]->int*/ (0);
}
effectivelyFinalGenericFunctionTyped(T Function<T>(T) g) {
@ -35,8 +35,8 @@ effectivelyFinalDynamicallyTyped() {
/*spec.List<int>*/ list /*spec.[List<int>]->int*/
[0] /*spec.invoke: [int]->int*/ +
0;
(/*spec.List<int>*/ list.contains)
/*spec.invoke: [bool Function(Object)]->bool*/ (0);
(/*spec.List<int>*/ list
.contains) /*spec.invoke: [bool Function(Object)]->bool*/ (0);
/*spec.List<int>*/ list
/*spec.update: [List<int>]->void*/ /*spec.[List<int>]->int*/
[0] /*spec.invoke: [int]->int*/ ++;
@ -48,8 +48,8 @@ effectivelyFinalPartiallyTyped() {
/*spec.List<int>*/ list /*spec.[List<int>]->int*/
[0] /*spec.invoke: [int]->int*/ +
0;
(/*spec.List<int>*/ list.contains)
/*spec.invoke: [bool Function(Object)]->bool*/ (0);
(/*spec.List<int>*/ list
.contains) /*spec.invoke: [bool Function(Object)]->bool*/ (0);
/*spec.List<int>*/ list
/*spec.update: [List<int>]->void*/ /*spec.[List<int>]->int*/
[0] /*spec.invoke: [int]->int*/ ++;

View file

@ -18,9 +18,7 @@ main() {
for1(dynamic c) {
if (/*dynamic*/ c is Class) {
/*Class*/ c.next;
for (/*Class*/ c.next;
/*dynamic*/ c != null;
/*dynamic*/ c.next) {
for (/*Class*/ c.next; /*dynamic*/ c != null; /*dynamic*/ c.next) {
/*dynamic*/ c.next;
if (/*dynamic*/ c is Class) {
/*Class*/ c.next;
@ -34,9 +32,7 @@ for1(dynamic c) {
for2(dynamic c) {
if (/*dynamic*/ c is Class) {
/*Class*/ c.next;
for (/*Class*/ c.next;
/*Class*/ c != null;
/*Class*/ c.next) {
for (/*Class*/ c.next; /*Class*/ c != null; /*Class*/ c.next) {
/*Class*/ c.next;
}
/*Class*/ c.next;

View file

@ -11,8 +11,7 @@ class Class {
}
class SubClass extends Class {
SubClass(Type componentType) : super(
/*Type*/ componentType);
SubClass(Type componentType) : super(/*Type*/ componentType);
}
method1(Class c, Type type, [o]) {

View file

@ -55,8 +55,7 @@ whileNext(Class c) {
}
whileNextGeneric(GenericClass<int> c) {
while (
/*GenericClass<int>*/ c != null) {
while (/*GenericClass<int>*/ c != null) {
c = /*GenericClass<int>*/ c.next;
}
return /*GenericClass<int>*/ c;

View file

@ -41,10 +41,9 @@ method3(Class c, Type type, [o]) {
c = new SubClass(String);
}
/*{c:[{true:SubClass},{false:Class}|SubClass,Class]}*/ c;
print(
/*{c:[{true:SubClass},{false:Class}|SubClass,Class]}*/ type ==
/*{c:[{true:SubClass},{false:Class}|SubClass,Class]}*/ c
?.componentType);
print(/*{c:[{true:SubClass},{false:Class}|SubClass,Class]}*/ type ==
/*{c:[{true:SubClass},{false:Class}|SubClass,Class]}*/ c
?.componentType);
}
}
}

View file

@ -12,7 +12,8 @@ import "dart:io";
main() async {
// Compile Dill
var sdkPath = getSdkPath();
if (!sdkPath.contains("ReleaseX64")) sdkPath = path.join(sdkPath, "ReleaseX64", "dart-sdk");
if (!sdkPath.contains("ReleaseX64"))
sdkPath = path.join(sdkPath, "ReleaseX64", "dart-sdk");
var scriptPath = Platform.script.path;
var pkgPath = path.dirname(
path.dirname(path.dirname(path.dirname(path.dirname(scriptPath)))));

View file

@ -132,7 +132,9 @@ main(List<String> args) async {
Future subProcess(List<String> baseOptions, List<String> additionalOptions,
String outputPrefix) async {
List<String> options = []..addAll(baseOptions)..addAll(additionalOptions);
List<String> options = []
..addAll(baseOptions)
..addAll(additionalOptions);
print(
'${outputPrefix}Command: ${Platform.resolvedExecutable} ${options.join(' ')}');
Process process = await Process.start(Platform.resolvedExecutable, options,

View file

@ -167,7 +167,12 @@ _showProgress(newUsed, newCapacity, oldUsed, oldCapacity) {
const mega = 1024 * 1024;
_writeNumber(sb, before, now, {color: false}) {
if (color) sb.write(before < now ? _RED : before > now ? _GREEN : '');
if (color)
sb.write(before < now
? _RED
: before > now
? _GREEN
: '');
var string;
if (now < 1024) {
string = ' ${now}b';