[front end] Change Template class to extend Code. This is part of a series of CLs that will standardize CFE error reporting to always use `codeFoo.withArguments(...)` when reporting errors that take arguments and `codeFoo` when reporting errors that don't take arguments, rather than `templateFoo.withArguments(...)` when reporting errors that take arguments and `messageFoo` when reporting errors that don't take arguments. This change will have two advantages: - It will lend greater consistency to the CFE codebase, by allowing the same `code...` objects to be used both to name error codes (e.g., in test expectations) and to report errors. This will allow everything associated with a certain error code to be found using a single invocation of "Find References" in the editor, rather than having to search separately for uses of the code and the message or template. - It should hopefully make the experience of writing code that reports errors more pleasant, since it will no longer be necessary to look up an error to see whether it takes arguments before using it; instead, the developer will be able to type the name of the message `code...` declaration, and then use autocompletion to see whether `.withArguments(...)` is required. In this CL, the `Template` class is changed so that it extends `Code`. In follow up CLs, this will allow the `Template` objects to serve the dual role of being either a template or an error code, in much the same way that for errors that don't take arguments, the `MessageCode` objects serve the dual role of being either an error code or an error message. Change-Id: I2e25419e47d2b0b601488b929ab5415d7039abea Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/443002 Reviewed-by: Johnni Winther <johnniwinther@google.com> Commit-Queue: Paul Berry <paulberry@google.com> https://dart.googlesource.com/sdk/+/21f365f5928a82d33c0f3c225063034d7a379505
diff --git a/DEPS b/DEPS index 8b9c766..3fddbda 100644 --- a/DEPS +++ b/DEPS
@@ -229,7 +229,7 @@ ] deps = { - 'flutter/engine/src/flutter/third_party/dart': Var('dart_git') + '/sdk' + '@' + '446346a21a1892983dfd53ff48c699592a28ef75', + 'flutter/engine/src/flutter/third_party/dart': Var('dart_git') + '/sdk' + '@' + '21f365f5928a82d33c0f3c225063034d7a379505', 'flutter': Var('flutter_git') + '/mirrors/flutter' + '@' + 'd6153d1d3c21f60d9aeec8b3df9991ec16dd50f3',
diff --git a/commits.json b/commits.json index 4bd85c6..15da465 100644 --- a/commits.json +++ b/commits.json
@@ -1,4 +1,4 @@ { "flutter":"d6153d1d3c21f60d9aeec8b3df9991ec16dd50f3", - "flutter/engine/src/flutter/third_party/dart":"446346a21a1892983dfd53ff48c699592a28ef75" + "flutter/engine/src/flutter/third_party/dart":"21f365f5928a82d33c0f3c225063034d7a379505" } \ No newline at end of file