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

Unified Diff: pkg/compiler/lib/src/kernel/element_adapter.dart

Issue 2685673004: Handle Creates and Returns annotations in KernelBehaviorBuilder (Closed)
Patch Set: Created 3 years, 10 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
Index: pkg/compiler/lib/src/kernel/element_adapter.dart
diff --git a/pkg/compiler/lib/src/kernel/element_adapter.dart b/pkg/compiler/lib/src/kernel/element_adapter.dart
index f456ec4b2819408ae0827c86bcda20449365c8ed..6f3048ece34bd6af0d2183a159cbe4bc53f567be 100644
--- a/pkg/compiler/lib/src/kernel/element_adapter.dart
+++ b/pkg/compiler/lib/src/kernel/element_adapter.dart
@@ -246,7 +246,7 @@ abstract class KernelElementAdapterMixin implements KernelElementAdapter {
// the `ForeignResolver`.
// TODO(johnniwinther): Cache the result to avoid redundant lookups?
native.TypeLookup typeLookup({bool resolveAsRaw: true}) {
- return (String typeName) {
+ DartType lookup(String typeName, {bool required}) {
DartType findIn(Uri uri) {
LibraryEntity library = elementEnvironment.lookupLibrary(uri);
if (library != null) {
@@ -270,8 +270,15 @@ abstract class KernelElementAdapterMixin implements KernelElementAdapter {
type ??= findIn(Uris.dart_svg);
type ??= findIn(Uris.dart_web_audio);
type ??= findIn(Uris.dart_web_gl);
+ if (type == null && required) {
+ reporter.reportErrorMessage(CURRENT_ELEMENT_SPANNABLE,
+ MessageKind.GENERIC, {'text': "Type '$typeName' not found."});
+ }
return type;
- };
+ }
+
+ ;
Siggi Cherem (dart-lang) 2017/02/09 21:01:35 delete `;` :)
Johnni Winther 2017/02/10 09:38:24 Done.
+ return lookup;
}
String _getStringArgument(ir.StaticInvocation node, int index) {
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend_serialization.dart ('k') | pkg/compiler/lib/src/kernel/world_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698