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

Unified Diff: pkg/analysis_server/tool/spec/codegen_dart_protocol.dart

Issue 1852473002: Fix generated server code to be strong mode compliant (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 | « pkg/analysis_server/tool/spec/api.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/tool/spec/codegen_dart_protocol.dart
diff --git a/pkg/analysis_server/tool/spec/codegen_dart_protocol.dart b/pkg/analysis_server/tool/spec/codegen_dart_protocol.dart
index 02855a69bd26ce9a7be7ba2b2536bbfb7ecdd065..15a5a4808623ab34650c1a06998f4904eecf4993 100644
--- a/pkg/analysis_server/tool/spec/codegen_dart_protocol.dart
+++ b/pkg/analysis_server/tool/spec/codegen_dart_protocol.dart
@@ -970,7 +970,7 @@ class CodegenProtocolVisitor extends DartCodegenVisitor with CodeGenerator {
if (!valueCode.isIdentity) {
result.write(', valueDecoder: ${valueCode.asClosure}');
}
- result.write(')');
+ result.write(') as ${dartType(type)}');
return result.toString();
});
}
@@ -980,7 +980,7 @@ class CodegenProtocolVisitor extends DartCodegenVisitor with CodeGenerator {
return new FromJsonFunction('jsonDecoder.decodeList');
} else {
return new FromJsonSnippet((String jsonPath, String json) =>
- 'jsonDecoder.decodeList($jsonPath, $json, ${itemCode.asClosure})');
+ 'jsonDecoder.decodeList($jsonPath, $json, ${itemCode.asClosure}) as ${dartType(type)}');
Paul Berry 2016/03/31 18:30:44 Would it be possible to avoid the type cast by mak
}
} else if (type is TypeUnion) {
List<String> decoders = <String>[];
« no previous file with comments | « pkg/analysis_server/tool/spec/api.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698