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

Unified Diff: pkg/code_transformers/lib/src/dart_sdk.dart

Issue 451493002: Use as dynamic to get rid of warnigns in code_transformers (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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 | « no previous file | pkg/pkg.status » ('j') | pkg/pkg.status » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/code_transformers/lib/src/dart_sdk.dart
diff --git a/pkg/code_transformers/lib/src/dart_sdk.dart b/pkg/code_transformers/lib/src/dart_sdk.dart
index cdf8ec3dbdb43e698df92f1f1a57a2379d7b1078..5dfcab848905e2668c682aa32832a07eab6477ae 100644
--- a/pkg/code_transformers/lib/src/dart_sdk.dart
+++ b/pkg/code_transformers/lib/src/dart_sdk.dart
@@ -108,14 +108,20 @@ class DartSourceProxy implements UriAnnotatedSource {
return new DartSourceProxy(source, uri);
}
+ // Note: to support both analyzer versions <0.22.0 and analyzer >=0.22.0, we
+ // implement both `resolveRelative` and `resolveRelativeUri`. Only one of them
+ // is available at a time in the analyzer package, so we use the `as dynamic`
+ // in these methods to hide warnings for the code that is missing. These APIs
+ // are invoked from the analyzer itself, so we don't expect them to cause
+ // failures.
Source resolveRelative(Uri relativeUri) {
// Assume that the type can be accessed via this URI, since these
// should only be parts for dart core files.
- return wrap(_proxy.resolveRelative(relativeUri), uri);
+ return wrap((_proxy as dynamic).resolveRelative(relativeUri), uri);
}
Uri resolveRelativeUri(Uri relativeUri) {
- return _proxy.resolveRelativeUri(relativeUri);
+ return (_proxy as dynamic).resolveRelativeUri(relativeUri);
}
bool exists() => _proxy.exists();
« no previous file with comments | « no previous file | pkg/pkg.status » ('j') | pkg/pkg.status » ('J')

Powered by Google App Engine
This is Rietveld 408576698