[dart2js] Migrate ir/element_map.dart

Change-Id: I5b00914f7963658446099ca31a5a38aec09437e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247465
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
diff --git a/pkg/compiler/lib/src/ir/element_map.dart b/pkg/compiler/lib/src/ir/element_map.dart
index 51f1e6f..6b61632 100644
--- a/pkg/compiler/lib/src/ir/element_map.dart
+++ b/pkg/compiler/lib/src/ir/element_map.dart
@@ -2,8 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// @dart = 2.10
-
 import 'package:kernel/ast.dart' as ir;
 import 'package:kernel/core_types.dart' as ir;
 
@@ -54,16 +52,16 @@
   /// [node].
   TypeVariableEntity getTypeVariable(ir.TypeParameter node);
 
-  CommonElements /*!*/ get commonElements;
+  CommonElements get commonElements;
   DiagnosticReporter get reporter;
   ir.CoreTypes get coreTypes;
-  InterfaceType /*!*/ getThisType(covariant ClassEntity cls);
-  InterfaceType getSuperType(covariant ClassEntity cls);
+  InterfaceType getThisType(covariant ClassEntity cls);
+  InterfaceType? getSuperType(covariant ClassEntity cls);
   OrderedTypeSet getOrderedTypeSet(covariant ClassEntity cls);
   Iterable<InterfaceType> getInterfaces(covariant ClassEntity cls);
-  InterfaceType asInstanceOf(InterfaceType type, ClassEntity cls);
+  InterfaceType? asInstanceOf(InterfaceType type, ClassEntity cls);
   DartType substByContext(DartType type, InterfaceType context);
-  FunctionType getCallType(InterfaceType type);
+  FunctionType? getCallType(InterfaceType type);
   int getHierarchyDepth(covariant ClassEntity cls);
   DartType getTypeVariableBound(IndexedTypeVariable typeVariable);
   List<Variance> getTypeVariableVariances(covariant ClassEntity cls);
diff --git a/pkg/compiler/lib/src/kernel/element_map_impl.dart b/pkg/compiler/lib/src/kernel/element_map_impl.dart
index 0b5dcb1..192973e 100644
--- a/pkg/compiler/lib/src/kernel/element_map_impl.dart
+++ b/pkg/compiler/lib/src/kernel/element_map_impl.dart
@@ -782,7 +782,7 @@
   InterfaceType asInstanceOf(InterfaceType type, ClassEntity cls) {
     assert(checkFamily(cls));
     OrderedTypeSet orderedTypeSet = getOrderedTypeSet(type.element);
-    InterfaceType supertype =
+    InterfaceType /*?*/ supertype =
         orderedTypeSet.asInstanceOf(cls, getHierarchyDepth(cls));
     if (supertype != null) {
       supertype = substByContext(supertype, type);
@@ -1345,13 +1345,13 @@
         constructor, KConstructorDataImpl(node, functionNode));
   }
 
-  FunctionEntity getMethodInternal(ir.Procedure node) {
+  FunctionEntity getMethodInternal(ir.Procedure /*!*/ node) {
     // [_getMethodCreate] inserts the created function in [methodMap] so we
     // don't need to use ??= here.
     return methodMap[node] ?? _getMethodCreate(node);
   }
 
-  FunctionEntity _getMethodCreate(ir.Procedure node) {
+  FunctionEntity /*!*/ _getMethodCreate(ir.Procedure node) {
     assert(
         !envIsClosed,
         "Environment of $this is closed. Trying to create "