diff --git a/pkg/compiler/lib/src/inferrer/builder_kernel.dart b/pkg/compiler/lib/src/inferrer/builder_kernel.dart index c995cfba2d2..416db2dba0b 100644 --- a/pkg/compiler/lib/src/inferrer/builder_kernel.dart +++ b/pkg/compiler/lib/src/inferrer/builder_kernel.dart @@ -48,12 +48,12 @@ class KernelTypeGraphBuilder extends ir.Visitor { final GlobalTypeInferenceElementData _memberData; final bool _inGenerativeConstructor; - LocalsHandler _locals; + LocalsHandler _locals; final SideEffectsBuilder _sideEffectsBuilder; - final Map> _breaksFor = - >{}; - final Map> _continuesFor = - >{}; + final Map>> _breaksFor = + >>{}; + final Map>> _continuesFor = + >>{}; TypeInformation _returnType; final Set _capturedVariables = new Set(); @@ -90,7 +90,7 @@ class KernelTypeGraphBuilder extends ir.Visitor { FieldInitializationScope fieldScope = _inGenerativeConstructor ? new FieldInitializationScope(_types) : null; - _locals = new LocalsHandler( + _locals = new LocalsHandler( _inferrer, _types, _options, _analyzedNode, fieldScope); } @@ -522,7 +522,7 @@ class KernelTypeGraphBuilder extends ir.Visitor { continueTargets.forEach(_clearBreaksAndContinues); } else { LocalsHandler saved = _locals; - List localsToMerge = []; + List> localsToMerge = >[]; bool hasDefaultCase = false; for (ir.SwitchCase switchCase in node.cases) { @@ -944,8 +944,12 @@ class KernelTypeGraphBuilder extends ir.Visitor { void _setupBreaksAndContinues(JumpTarget target) { if (target == null) return; - if (target.isContinueTarget) _continuesFor[target] = []; - if (target.isBreakTarget) _breaksFor[target] = []; + if (target.isContinueTarget) { + _continuesFor[target] = >[]; + } + if (target.isBreakTarget) { + _breaksFor[target] = >[]; + } } void _clearBreaksAndContinues(JumpTarget element) { @@ -953,15 +957,15 @@ class KernelTypeGraphBuilder extends ir.Visitor { _breaksFor.remove(element); } - List _getBreaks(JumpTarget target) { - List list = [_locals]; + List> _getBreaks(JumpTarget target) { + List> list = >[_locals]; if (target == null) return list; if (!target.isBreakTarget) return list; return list..addAll(_breaksFor[target]); } - List _getLoopBackEdges(JumpTarget target) { - List list = [_locals]; + List> _getLoopBackEdges(JumpTarget target) { + List> list = >[_locals]; if (target == null) return list; if (!target.isContinueTarget) return list; return list..addAll(_continuesFor[target]); @@ -1463,7 +1467,7 @@ class KernelTypeGraphBuilder extends ir.Visitor { // We don't put the closure in the work queue of the // inferrer, because it will share information with its enclosing // method, like for example the types of local variables. - LocalsHandler closureLocals = + LocalsHandler closureLocals = new LocalsHandler.from(_locals, node, useOtherTryBlock: false); KernelTypeGraphBuilder visitor = new KernelTypeGraphBuilder( _options, diff --git a/pkg/compiler/lib/src/js_backend/namer.dart b/pkg/compiler/lib/src/js_backend/namer.dart index 4ce047a0eea..1f202ede10e 100644 --- a/pkg/compiler/lib/src/js_backend/namer.dart +++ b/pkg/compiler/lib/src/js_backend/namer.dart @@ -1102,7 +1102,7 @@ class Namer { } jsAst.Name _disambiguateGlobalMember(MemberEntity element) { - return _disambiguateGlobal(element, _proposeNameForMember); + return _disambiguateGlobal(element, _proposeNameForMember); } jsAst.Name _disambiguateGlobalType(Entity element) { @@ -1112,8 +1112,8 @@ class Namer { /// Returns the disambiguated name for a top-level or static element. /// /// The resulting name is unique within the global-member namespace. - jsAst.Name _disambiguateGlobal( - Entity element, String proposeName(Entity element)) { + jsAst.Name _disambiguateGlobal( + T element, String proposeName(T element)) { // TODO(asgerf): We can reuse more short names if we disambiguate with // a separate namespace for each of the global holder objects. jsAst.Name newName = userGlobals[element]; diff --git a/pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart b/pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart index 88f2c2d3308..905c3bd8b8a 100644 --- a/pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart +++ b/pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart @@ -616,7 +616,7 @@ class ProgramBuilder { List statics = memberElements .where((e) => !e.isField) .cast() - .map(_buildStaticMethod) + .map(_buildStaticMethod) .toList(); if (library == _commonElements.interceptorsLibrary) { diff --git a/pkg/compiler/lib/src/source_file_provider.dart b/pkg/compiler/lib/src/source_file_provider.dart index 35e75ebf14b..7b4f019d79f 100644 --- a/pkg/compiler/lib/src/source_file_provider.dart +++ b/pkg/compiler/lib/src/source_file_provider.dart @@ -144,7 +144,7 @@ abstract class SourceFileProvider implements CompilerInput { relativizeUri(Uri uri) => relativize(cwd, uri, isWindows); - SourceFile getUtf8SourceFile(Uri resourceUri) { + SourceFile> getUtf8SourceFile(Uri resourceUri) { return utf8SourceFiles[resourceUri]; } diff --git a/pkg/compiler/lib/src/ssa/codegen.dart b/pkg/compiler/lib/src/ssa/codegen.dart index 1e94b010712..6709e7ef1e4 100644 --- a/pkg/compiler/lib/src/ssa/codegen.dart +++ b/pkg/compiler/lib/src/ssa/codegen.dart @@ -2423,7 +2423,7 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor { void generateThrowWithHelper(FunctionEntity helper, argument, {SourceInformation sourceInformation}) { js.Expression jsHelper = _emitter.staticFunctionAccess(helper); - List arguments = []; + List arguments = []; if (argument is List) { argument.forEach((instruction) { use(instruction); diff --git a/pkg/compiler/lib/src/ssa/nodes.dart b/pkg/compiler/lib/src/ssa/nodes.dart index 04c906fe783..30764a9e1c1 100644 --- a/pkg/compiler/lib/src/ssa/nodes.dart +++ b/pkg/compiler/lib/src/ssa/nodes.dart @@ -1555,7 +1555,7 @@ class HCreate extends HInstruction { /// we have to register the instantiated type in the code generator. The /// [instructionType] of this node is not enough, because we also need the /// type arguments. See also [SsaFromAstMixin.currentInlinedInstantiations]. - List instantiatedTypes; + List instantiatedTypes; /// If this node creates a closure class, [callMethod] is the call method of /// the closure class. @@ -1759,7 +1759,7 @@ class HInvokeStatic extends HInvoke { /// contains the type(s) used in the (Dart) `New` expression(s). The /// [instructionType] of this node is not enough, because we also need the /// type arguments. See also [SsaFromAstMixin.currentInlinedInstantiations]. - List instantiatedTypes; + List instantiatedTypes; /** The first input must be the target. */ HInvokeStatic(this.element, inputs, AbstractValue type, this.typeArguments, diff --git a/pkg/compiler/lib/src/ssa/variable_allocator.dart b/pkg/compiler/lib/src/ssa/variable_allocator.dart index 7575c22fba6..3bb3c85482a 100644 --- a/pkg/compiler/lib/src/ssa/variable_allocator.dart +++ b/pkg/compiler/lib/src/ssa/variable_allocator.dart @@ -550,9 +550,9 @@ class VariableNamer { if (instruction is HCheck) { // Special case this instruction to use the name of its // input if it has one. - var temp = instruction; + HInstruction temp = instruction; do { - temp = temp.checkedInput; + temp = (temp as HCheck).checkedInput; name = names.ownName[temp]; } while (name == null && temp is HCheck); if (name != null) return addAllocatedName(instruction, name); diff --git a/pkg/compiler/lib/src/util/setlet.dart b/pkg/compiler/lib/src/util/setlet.dart index 08195f051e5..62ccde09549 100644 --- a/pkg/compiler/lib/src/util/setlet.dart +++ b/pkg/compiler/lib/src/util/setlet.dart @@ -138,7 +138,7 @@ class Setlet extends SetBase { while (copyTo < CAPACITY) _contents[copyTo++] = null; } else { _contents = new Set() - ..addAll(_contents) + ..addAll((_contents as List).cast()) ..add(element); _extra = _MARKER; } diff --git a/pkg/js_ast/lib/src/builder.dart b/pkg/js_ast/lib/src/builder.dart index 8366dd040d8..1de3981b7d6 100644 --- a/pkg/js_ast/lib/src/builder.dart +++ b/pkg/js_ast/lib/src/builder.dart @@ -1254,7 +1254,7 @@ class MiniJsParser { VariableDeclarationList finishVariableDeclarationList( Declaration firstVariable) { - var initialization = []; + var initialization = []; void declare(Declaration declaration) { Expression initializer = null;