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

Unified Diff: lib/src/compiler/element_helpers.dart

Issue 2016483002: Enable strong mode in DDC, fix all warnings/errors (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 7 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/compiler/code_generator.dart ('k') | lib/src/compiler/js_metalet.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/compiler/element_helpers.dart
diff --git a/lib/src/compiler/element_helpers.dart b/lib/src/compiler/element_helpers.dart
index a5d95d8328dab6388df1344b0c2b8f490ddd0f64..5af5470fa11a0d8f7ebec7bc3624610ec38a0108 100644
--- a/lib/src/compiler/element_helpers.dart
+++ b/lib/src/compiler/element_helpers.dart
@@ -18,7 +18,8 @@ import 'package:analyzer/dart/element/element.dart'
import 'package:analyzer/dart/element/type.dart'
show DartType, InterfaceType, ParameterizedType;
import 'package:analyzer/src/dart/element/type.dart' show DynamicTypeImpl;
-import 'package:analyzer/src/generated/constant.dart' show DartObject;
+import 'package:analyzer/src/generated/constant.dart'
+ show DartObject, DartObjectImpl;
class Tuple2<T0, T1> {
final T0 e0;
@@ -28,8 +29,10 @@ class Tuple2<T0, T1> {
/*=T*/ fillDynamicTypeArgs/*<T extends DartType>*/(/*=T*/ t) {
if (t is ParameterizedType) {
- var dyn = new List.filled(t.typeArguments.length, DynamicTypeImpl.instance);
- return t.substitute2(dyn, t.typeArguments);
+ var pt = t as ParameterizedType;
+ var dyn = new List<DartType>.filled(
+ pt.typeArguments.length, DynamicTypeImpl.instance);
+ return pt.substitute2(dyn, pt.typeArguments) as dynamic/*=T*/;
}
return t;
}
@@ -47,7 +50,7 @@ class Tuple2<T0, T1> {
///
/// (v) => v.type.name == 'Deprecated' && v.type.element.library.isDartCore
///
-DartObject findAnnotation(Element element, bool test(DartObject value)) {
+DartObject findAnnotation(Element element, bool test(DartObjectImpl value)) {
for (var metadata in element.metadata) {
var value = metadata.constantValue;
if (value != null && test(value)) return value;
@@ -116,5 +119,5 @@ ExecutableElement getFunctionBodyElement(FunctionBody body) {
///
/// If we match the annotation for the `@MyAnnotation('FooBar')` this will
/// return the string 'FooBar'.
-String getAnnotationName(Element element, bool match(DartObject value)) =>
+String getAnnotationName(Element element, bool match(DartObjectImpl value)) =>
findAnnotation(element, match)?.getField('name')?.toStringValue();
« no previous file with comments | « lib/src/compiler/code_generator.dart ('k') | lib/src/compiler/js_metalet.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698