X Tutup
The Wayback Machine - https://web.archive.org/web/20221220164941/https://github.com/google/flatbuffers/pull/6115
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

@paulovap paulovap commented Sep 13, 2020

More information on #6014

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

aardappel commented Sep 14, 2020

LGTM!

@aardappel
Copy link
Collaborator

aardappel commented Sep 14, 2020

@CasperN ?

auto base_type = field.value.type.base_type;

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

@CasperN CasperN Sep 14, 2020

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

@vglavnyy vglavnyy Sep 18, 2020

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
3 checks passed
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.

None yet

4 participants
X Tutup