Chromium Code Reviews| 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>[]; |