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

Unified Diff: pkg/compiler/lib/src/js_backend/patch_resolver.dart

Issue 2535213003: Support patched generic methods. (Closed)
Patch Set: Add tests for renaming. Created 4 years 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 | « pkg/compiler/lib/src/elements/elements.dart ('k') | pkg/compiler/lib/src/patch_parser.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_backend/patch_resolver.dart
diff --git a/pkg/compiler/lib/src/js_backend/patch_resolver.dart b/pkg/compiler/lib/src/js_backend/patch_resolver.dart
index 17a4a4e33edba1d436a1fad8c427aafefde7e5e8..10f30c581ac22bf5b67070ff98afe66702a36296 100644
--- a/pkg/compiler/lib/src/js_backend/patch_resolver.dart
+++ b/pkg/compiler/lib/src/js_backend/patch_resolver.dart
@@ -106,10 +106,24 @@ class PatchResolverTask extends CompilerTask {
void checkMatchingPatchSignatures(
FunctionElement origin, FunctionElement patch) {
// TODO(johnniwinther): Show both origin and patch locations on errors.
+ FunctionExpression originTree = origin.node;
FunctionSignature originSignature = origin.functionSignature;
FunctionExpression patchTree = patch.node;
FunctionSignature patchSignature = patch.functionSignature;
+ if ('${originTree.typeVariables}' != '${patchTree.typeVariables}') {
+ reporter.withCurrentElement(patch, () {
+ Node errorNode = patchTree.typeVariables != null
+ ? patchTree.typeVariables
+ : patchTree;
+ reporter.reportError(
+ reporter.createMessage(
+ errorNode,
+ MessageKind.PATCH_TYPE_VARIABLES_MISMATCH,
+ {'methodName': origin.name}),
+ [reporter.createMessage(origin, MessageKind.THIS_IS_THE_METHOD)]);
+ });
+ }
if (originSignature.type.returnType != patchSignature.type.returnType) {
reporter.withCurrentElement(patch, () {
Node errorNode =
« no previous file with comments | « pkg/compiler/lib/src/elements/elements.dart ('k') | pkg/compiler/lib/src/patch_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698