Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

Commit

Permalink
Sync from internal repo. (#101)
Browse files Browse the repository at this point in the history
* Dart 2 fix.
  • Loading branch information
jakobr-google authored Apr 9, 2018
1 parent 491b18a commit 415d7bd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.7.11 - 2018-04-09

* Dart 2 fix.

## 0.7.10 - 2018-02-22

* Small performance tweak for DDC.
Expand Down
5 changes: 3 additions & 2 deletions lib/grpc_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);');
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: protoc_plugin
version: 0.7.10
version: 0.7.11
author: Dart Team <[email protected]>
description: Protoc compiler plugin to generate Dart code
homepage: https://github.com/dart-lang/dart-protoc-plugin
Expand Down
7 changes: 3 additions & 4 deletions test/file_generator_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -593,13 +593,12 @@ abstract class TestServiceBase extends Service {
(Output value) => value.writeToBuffer()));
}
Future<Output> unary_Pre(ServiceCall call, Future<Input> request) async {
Future<Output> unary_Pre(ServiceCall call, Future request) async {
return unary(call, await request);
}
Stream<Output> serverStreaming_Pre(
ServiceCall call, Future<Input> request) async* {
yield* serverStreaming(call, await request);
Stream<Output> serverStreaming_Pre(ServiceCall call, Future request) async* {
yield* serverStreaming(call, (await request) as Input);
}
Future<Output> unary(ServiceCall call, Input request);
Expand Down

0 comments on commit 415d7bd

Please sign in to comment.