mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-10 15:16:28 +00:00
Only generate @kotlin.ExperimentalUnsigned annotation on create*Vector methods having an unsigned array type parameter. (#7881)
Co-authored-by: Derek Bailey <derekbailey@google.com>
This commit is contained in:
@@ -289,7 +289,6 @@ class KotlinGenerator : public BaseGenerator {
|
||||
GenerateComment(enum_def.doc_comment, writer, &comment_config);
|
||||
|
||||
writer += "@Suppress(\"unused\")";
|
||||
writer += "@kotlin.ExperimentalUnsignedTypes";
|
||||
writer += "class " + namer_.Type(enum_def) + " private constructor() {";
|
||||
writer.IncrementIdentLevel();
|
||||
|
||||
@@ -495,7 +494,6 @@ class KotlinGenerator : public BaseGenerator {
|
||||
writer.SetValue("superclass", fixed ? "Struct" : "Table");
|
||||
|
||||
writer += "@Suppress(\"unused\")";
|
||||
writer += "@kotlin.ExperimentalUnsignedTypes";
|
||||
writer += "class {{struct_name}} : {{superclass}}() {\n";
|
||||
|
||||
writer.IncrementIdentLevel();
|
||||
@@ -703,6 +701,9 @@ class KotlinGenerator : public BaseGenerator {
|
||||
writer.SetValue("root", GenMethod(vector_type));
|
||||
writer.SetValue("cast", CastToSigned(vector_type));
|
||||
|
||||
if (IsUnsigned(vector_type.base_type)) {
|
||||
writer += "@kotlin.ExperimentalUnsignedTypes";
|
||||
}
|
||||
GenerateFun(
|
||||
writer, method_name, params, "Int",
|
||||
[&]() {
|
||||
|
||||
Reference in New Issue
Block a user