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

Unified Diff: pkg/analysis_server/lib/src/services/correction/util.dart

Issue 2618653002: Issue 28261. Add support for implementing generic methods in Quick Fix. (Closed)
Patch Set: Created 3 years, 11 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/analysis_server/lib/src/services/correction/util.dart
diff --git a/pkg/analysis_server/lib/src/services/correction/util.dart b/pkg/analysis_server/lib/src/services/correction/util.dart
index d5eeeb0aba3443b26d6cfcd39dc06589ff45d40f..dc8b040d8df575e478d331e8d3d1c5e0f05c78bf 100644
--- a/pkg/analysis_server/lib/src/services/correction/util.dart
+++ b/pkg/analysis_server/lib/src/services/correction/util.dart
@@ -699,6 +699,8 @@ class CorrectionUtils {
*/
ClassElement targetClassElement;
+ ExecutableElement targetExecutableElement;
+
LibraryElement _library;
String _buffer;
String _endOfLine;
@@ -1500,13 +1502,15 @@ class CorrectionUtils {
}
/**
- * Checks if [type] is visible at [targetOffset].
+ * Checks if [type] is visible in [targetExecutableElement] or
+ * [targetClassElement].
*/
bool _isTypeVisible(DartType type) {
if (type is TypeParameterType) {
TypeParameterElement parameterElement = type.element;
Element parameterClassElement = parameterElement.enclosingElement;
- return identical(parameterClassElement, targetClassElement);
+ return identical(parameterClassElement, targetExecutableElement) ||
+ identical(parameterClassElement, targetClassElement);
}
return true;
}

Powered by Google App Engine
This is Rietveld 408576698