diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bb9fde..1ae3eb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.7.11 - 2018-04-09 + +* Dart 2 fix. + ## 0.7.10 - 2018-02-22 * Small performance tweak for DDC. diff --git a/lib/grpc_generator.dart b/lib/grpc_generator.dart index 7a7ec32..e1eaa6c 100644 --- a/lib/grpc_generator.dart +++ b/lib/grpc_generator.dart @@ -250,10 +250,11 @@ class _GrpcMethod { if (_clientStreaming) return; out.addBlock( - '$_serverReturnType ${_dartName}_Pre(ServiceCall call, Future<$_requestType> request) async${_serverStreaming ? '*' : ''} {', + '$_serverReturnType ${_dartName}_Pre(ServiceCall call, Future request) async${_serverStreaming ? '*' : ''} {', '}', () { if (_serverStreaming) { - out.println('yield* $_dartName(call, await request);'); + out.println( + 'yield* $_dartName(call, (await request) as $_requestType);'); } else { out.println('return $_dartName(call, await request);'); } diff --git a/pubspec.yaml b/pubspec.yaml index 127215d..b7597ff 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: protoc_plugin -version: 0.7.10 +version: 0.7.11 author: Dart Team description: Protoc compiler plugin to generate Dart code homepage: https://github.com/dart-lang/dart-protoc-plugin diff --git a/test/file_generator_test.dart b/test/file_generator_test.dart index 66bd9ce..2106147 100644 --- a/test/file_generator_test.dart +++ b/test/file_generator_test.dart @@ -593,13 +593,12 @@ abstract class TestServiceBase extends Service { (Output value) => value.writeToBuffer())); } - Future unary_Pre(ServiceCall call, Future request) async { + Future unary_Pre(ServiceCall call, Future request) async { return unary(call, await request); } - Stream serverStreaming_Pre( - ServiceCall call, Future request) async* { - yield* serverStreaming(call, await request); + Stream serverStreaming_Pre(ServiceCall call, Future request) async* { + yield* serverStreaming(call, (await request) as Input); } Future unary(ServiceCall call, Input request);