Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Kotlin] Support for optional scalars. #6115

Merged
merged 1 commit into from
Sep 18, 2020

Conversation

paulovap
Copy link
Collaborator

More information on #6014

@paulovap paulovap force-pushed the kotlin_scalar_optional branch 2 times, most recently from 491582f to ed71f40 Compare September 13, 2020 20:10
src/idl_gen_kotlin.cpp Outdated Show resolved Hide resolved
@aardappel
Copy link
Collaborator

LGTM!

@aardappel
Copy link
Collaborator

@CasperN ?

auto base_type = field.value.type.base_type;

auto r_type = GenTypeGet(field.value.type);
if (field.IsScalarOptional() ||
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you not need to check for required fields?

I'm hoping field.optional is enough to determine whether the output field is optional or not - (though we're already inconsistent around vectors as nonpresense is null in C++/Rust but empty-vector in swift)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you not need to check for required fields?

Scalar fields can't have required attribute.
@aardappel Merge it?

@aardappel aardappel merged commit 6228b66 into google:master Sep 18, 2020
ivannp pushed a commit to ivannp/flatbuffers that referenced this pull request Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants