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

Unified Diff: pkg/analyzer/lib/src/task/strong_mode.dart

Issue 1434983006: tweak FunctionTypeImpl to support generic methods (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: format & sort Created 5 years, 1 month 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/analyzer/lib/src/task/strong_mode.dart
diff --git a/pkg/analyzer/lib/src/task/strong_mode.dart b/pkg/analyzer/lib/src/task/strong_mode.dart
index 2edea6a8ef79088935eee5c65523b3cec41927d4..c3716adcc0b22c848270f28947239856ce1523e3 100644
--- a/pkg/analyzer/lib/src/task/strong_mode.dart
+++ b/pkg/analyzer/lib/src/task/strong_mode.dart
@@ -27,11 +27,11 @@ void setParameterType(PropertyAccessorElement element, DartType type) {
//
// Update the type of the setter to reflect the new parameter type.
//
+ // TODO(jmesserly): why is this necessary? The function type should always
Brian Wilkerson 2015/11/13 18:56:16 Good question! I don't know. Does anything break i
Jennifer Messerly 2015/11/13 19:04:46 Yeah, I was planning to give it a shot right after
Brian Wilkerson 2015/11/13 20:17:14 Sounds good. Certainly not necessary before landin
+ // delegate to the orginal element.
FunctionType functionType = element.type;
if (functionType is FunctionTypeImpl) {
- element.type =
- new FunctionTypeImpl(element, functionType.prunedTypedefs)
- ..typeArguments = functionType.typeArguments;
+ element.type = new FunctionTypeImpl(element);
} else {
assert(false);
}
@@ -53,11 +53,12 @@ void setReturnType(ExecutableElement element, DartType type) {
// Update the return type of the element, which is stored in two places:
// directly in the element and indirectly in the type of the element.
//
+ // TODO(jmesserly): why is this necessary? The function type should always
+ // delegate to the orginal element.
element.returnType = type;
FunctionType functionType = element.type;
if (functionType is FunctionTypeImpl) {
- element.type = new FunctionTypeImpl(element, functionType.prunedTypedefs)
- ..typeArguments = functionType.typeArguments;
+ element.type = new FunctionTypeImpl(element);
} else {
assert(false);
}

Powered by Google App Engine
This is Rietveld 408576698