[
https://issues.apache.org/jira/browse/THRIFT-5712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17813896#comment-17813896
]
Paul Wilkinson commented on THRIFT-5712:
----------------------------------------
The protocol tests expect to write null values to all of the primitive types.
Is this expected behaviour in thrift? I have implemented the primitive types as
non-nullable.
{quote}Future<void> primitiveNullTest(Primitive primitive) async {
primitive.write(null);
protocol.writeMessageEnd();
await protocol.transport.flush();
protocol.readMessageBegin();
var output = primitive.read();
expect(output, primitive.defaultValue);
}{quote}
Example tests:
{quote}test('Test I64 null', () async {
await primitiveNullTest(getPrimitive(TType.I64));
});
test('Test double null', () async {
await primitiveNullTest(getPrimitive(TType.DOUBLE));
});{quote}
> Add Dart 3 compatibility
> ------------------------
>
> Key: THRIFT-5712
> URL: https://issues.apache.org/jira/browse/THRIFT-5712
> Project: Thrift
> Issue Type: Improvement
> Components: Dart - Compiler
> Affects Versions: 0.18.1
> Reporter: Vlad Koronnov
> Priority: Major
>
> Dart project generated by thrift has constraints in pubspec.yaml
>
> {code:java}
> name: dart_client
> version: 0.0.1
> description: Autogenerated by Thrift Compiler
> environment:
> sdk: '>=2.12.0 <3.0.0' {code}
>
>
> And generated code uses uninitialized variables, which can't be used with
> sound null safety, required by Dart 3.0
--
This message was sent by Atlassian Jira
(v8.20.10#820010)