From 417821fdd7eb82d0ebbd9ea1e920d4b27fb5c1b7 Mon Sep 17 00:00:00 2001 From: Aaron Riekenberg Date: Fri, 28 Apr 2023 12:10:01 -0500 Subject: [PATCH] Only generate @kotlin.ExperimentalUnsigned annotation on create*Vector methods having an unsigned array type parameter. (#7881) Co-authored-by: Derek Bailey --- src/idl_gen_kotlin.cpp | 5 +++-- tests/DictionaryLookup/LongFloatEntry.kt | 1 - tests/DictionaryLookup/LongFloatMap.kt | 1 - tests/MyGame/Example/Ability.kt | 1 - tests/MyGame/Example/Any.kt | 1 - tests/MyGame/Example/AnyAmbiguousAliases.kt | 1 - tests/MyGame/Example/AnyUniqueAliases.kt | 1 - tests/MyGame/Example/Color.kt | 1 - tests/MyGame/Example/LongEnum.kt | 1 - tests/MyGame/Example/Monster.kt | 9 ++++++++- tests/MyGame/Example/Race.kt | 1 - tests/MyGame/Example/Referrable.kt | 1 - tests/MyGame/Example/Stat.kt | 1 - tests/MyGame/Example/StructOfStructs.kt | 1 - tests/MyGame/Example/StructOfStructsOfStructs.kt | 1 - tests/MyGame/Example/Test.kt | 1 - tests/MyGame/Example/TestSimpleTableWithEnum.kt | 1 - tests/MyGame/Example/TypeAliases.kt | 1 - tests/MyGame/Example/Vec3.kt | 1 - tests/MyGame/Example2/Monster.kt | 1 - tests/MyGame/InParentNamespace.kt | 1 - tests/MyGame/MonsterExtra.kt | 1 - tests/optional_scalars/OptionalByte.kt | 1 - tests/optional_scalars/ScalarStuff.kt | 1 - tests/union_vector/Attacker.kt | 1 - tests/union_vector/BookReader.kt | 1 - tests/union_vector/Character.kt | 1 - tests/union_vector/FallingTub.kt | 1 - tests/union_vector/Gadget.kt | 1 - tests/union_vector/HandFan.kt | 1 - tests/union_vector/Movie.kt | 2 +- tests/union_vector/Rapunzel.kt | 1 - 32 files changed, 12 insertions(+), 33 deletions(-) diff --git a/src/idl_gen_kotlin.cpp b/src/idl_gen_kotlin.cpp index 4ca75e3d0..71b9db5c6 100644 --- a/src/idl_gen_kotlin.cpp +++ b/src/idl_gen_kotlin.cpp @@ -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", [&]() { diff --git a/tests/DictionaryLookup/LongFloatEntry.kt b/tests/DictionaryLookup/LongFloatEntry.kt index c9be31d8b..bf1a0f4b4 100644 --- a/tests/DictionaryLookup/LongFloatEntry.kt +++ b/tests/DictionaryLookup/LongFloatEntry.kt @@ -19,7 +19,6 @@ import java.nio.ByteOrder import kotlin.math.sign @Suppress("unused") -@kotlin.ExperimentalUnsignedTypes class LongFloatEntry : Table() { fun __init(_i: Int, _bb: ByteBuffer) { diff --git a/tests/DictionaryLookup/LongFloatMap.kt b/tests/DictionaryLookup/LongFloatMap.kt index 32467ddb2..816382a40 100644 --- a/tests/DictionaryLookup/LongFloatMap.kt +++ b/tests/DictionaryLookup/LongFloatMap.kt @@ -19,7 +19,6 @@ import java.nio.ByteOrder import kotlin.math.sign @Suppress("unused") -@kotlin.ExperimentalUnsignedTypes class LongFloatMap : Table() { fun __init(_i: Int, _bb: ByteBuffer) { diff --git a/tests/MyGame/Example/Ability.kt b/tests/MyGame/Example/Ability.kt index a3e17bef1..dc2b0b864 100644 --- a/tests/MyGame/Example/Ability.kt +++ b/tests/MyGame/Example/Ability.kt @@ -19,7 +19,6 @@ import java.nio.ByteOrder import kotlin.math.sign @Suppress("unused") -@kotlin.ExperimentalUnsignedTypes class Ability : Struct() { fun __init(_i: Int, _bb: ByteBuffer) { diff --git a/tests/MyGame/Example/Any.kt b/tests/MyGame/Example/Any.kt index 8b900723a..d7dd7bbe1 100644 --- a/tests/MyGame/Example/Any.kt +++ b/tests/MyGame/Example/Any.kt @@ -3,7 +3,6 @@ package MyGame.Example @Suppress("unused") -@kotlin.ExperimentalUnsignedTypes class Any_ private constructor() { companion object { const val NONE: UByte = 0u diff --git a/tests/MyGame/Example/AnyAmbiguousAliases.kt b/tests/MyGame/Example/AnyAmbiguousAliases.kt index 404309654..c38923b9e 100644 --- a/tests/MyGame/Example/AnyAmbiguousAliases.kt +++ b/tests/MyGame/Example/AnyAmbiguousAliases.kt @@ -3,7 +3,6 @@ package MyGame.Example @Suppress("unused") -@kotlin.ExperimentalUnsignedTypes class AnyAmbiguousAliases private constructor() { companion object { const val NONE: UByte = 0u diff --git a/tests/MyGame/Example/AnyUniqueAliases.kt b/tests/MyGame/Example/AnyUniqueAliases.kt index 8be0cc826..2db45a6c2 100644 --- a/tests/MyGame/Example/AnyUniqueAliases.kt +++ b/tests/MyGame/Example/AnyUniqueAliases.kt @@ -3,7 +3,6 @@ package MyGame.Example @Suppress("unused") -@kotlin.ExperimentalUnsignedTypes class AnyUniqueAliases private constructor() { companion object { const val NONE: UByte = 0u diff --git a/tests/MyGame/Example/Color.kt b/tests/MyGame/Example/Color.kt index 61a313e63..0af56e1ee 100644 --- a/tests/MyGame/Example/Color.kt +++ b/tests/MyGame/Example/Color.kt @@ -6,7 +6,6 @@ package MyGame.Example * Composite components of Monster color. */ @Suppress("unused") -@kotlin.ExperimentalUnsignedTypes class Color private constructor() { companion object { const val Red: UByte = 1u diff --git a/tests/MyGame/Example/LongEnum.kt b/tests/MyGame/Example/LongEnum.kt index 328c9c4f2..ecb5aabf9 100644 --- a/tests/MyGame/Example/LongEnum.kt +++ b/tests/MyGame/Example/LongEnum.kt @@ -3,7 +3,6 @@ package MyGame.Example @Suppress("unused") -@kotlin.ExperimentalUnsignedTypes class LongEnum private constructor() { companion object { const val LongOne: ULong = 2UL diff --git a/tests/MyGame/Example/Monster.kt b/tests/MyGame/Example/Monster.kt index eae51e0fd..4631ae0f9 100644 --- a/tests/MyGame/Example/Monster.kt +++ b/tests/MyGame/Example/Monster.kt @@ -22,7 +22,6 @@ import kotlin.math.sign * an example documentation comment: "monster object" */ @Suppress("unused") -@kotlin.ExperimentalUnsignedTypes class Monster : Table() { fun __init(_i: Int, _bb: ByteBuffer) { @@ -1019,6 +1018,7 @@ class Monster : Table() { builder.slot(3) } fun addInventory(builder: FlatBufferBuilder, inventory: Int) = builder.addOffset(5, inventory, 0) + @kotlin.ExperimentalUnsignedTypes fun createInventoryVector(builder: FlatBufferBuilder, data: UByteArray) : Int { builder.startVector(1, data.size, 1) for (i in data.size - 1 downTo 0) { @@ -1052,6 +1052,7 @@ class Monster : Table() { fun startTestarrayoftablesVector(builder: FlatBufferBuilder, numElems: Int) = builder.startVector(4, numElems, 4) fun addEnemy(builder: FlatBufferBuilder, enemy: Int) = builder.addOffset(12, enemy, 0) fun addTestnestedflatbuffer(builder: FlatBufferBuilder, testnestedflatbuffer: Int) = builder.addOffset(13, testnestedflatbuffer, 0) + @kotlin.ExperimentalUnsignedTypes fun createTestnestedflatbufferVector(builder: FlatBufferBuilder, data: UByteArray) : Int { builder.startVector(1, data.size, 1) for (i in data.size - 1 downTo 0) { @@ -1094,6 +1095,7 @@ class Monster : Table() { fun addTestarrayofsortedstruct(builder: FlatBufferBuilder, testarrayofsortedstruct: Int) = builder.addOffset(29, testarrayofsortedstruct, 0) fun startTestarrayofsortedstructVector(builder: FlatBufferBuilder, numElems: Int) = builder.startVector(8, numElems, 4) fun addFlex(builder: FlatBufferBuilder, flex: Int) = builder.addOffset(30, flex, 0) + @kotlin.ExperimentalUnsignedTypes fun createFlexVector(builder: FlatBufferBuilder, data: UByteArray) : Int { builder.startVector(1, data.size, 1) for (i in data.size - 1 downTo 0) { @@ -1134,6 +1136,7 @@ class Monster : Table() { fun startVectorOfReferrablesVector(builder: FlatBufferBuilder, numElems: Int) = builder.startVector(4, numElems, 4) fun addSingleWeakReference(builder: FlatBufferBuilder, singleWeakReference: ULong) = builder.addLong(36, singleWeakReference.toLong(), 0) fun addVectorOfWeakReferences(builder: FlatBufferBuilder, vectorOfWeakReferences: Int) = builder.addOffset(37, vectorOfWeakReferences, 0) + @kotlin.ExperimentalUnsignedTypes fun createVectorOfWeakReferencesVector(builder: FlatBufferBuilder, data: ULongArray) : Int { builder.startVector(8, data.size, 8) for (i in data.size - 1 downTo 0) { @@ -1153,6 +1156,7 @@ class Monster : Table() { fun startVectorOfStrongReferrablesVector(builder: FlatBufferBuilder, numElems: Int) = builder.startVector(4, numElems, 4) fun addCoOwningReference(builder: FlatBufferBuilder, coOwningReference: ULong) = builder.addLong(39, coOwningReference.toLong(), 0) fun addVectorOfCoOwningReferences(builder: FlatBufferBuilder, vectorOfCoOwningReferences: Int) = builder.addOffset(40, vectorOfCoOwningReferences, 0) + @kotlin.ExperimentalUnsignedTypes fun createVectorOfCoOwningReferencesVector(builder: FlatBufferBuilder, data: ULongArray) : Int { builder.startVector(8, data.size, 8) for (i in data.size - 1 downTo 0) { @@ -1163,6 +1167,7 @@ class Monster : Table() { fun startVectorOfCoOwningReferencesVector(builder: FlatBufferBuilder, numElems: Int) = builder.startVector(8, numElems, 8) fun addNonOwningReference(builder: FlatBufferBuilder, nonOwningReference: ULong) = builder.addLong(41, nonOwningReference.toLong(), 0) fun addVectorOfNonOwningReferences(builder: FlatBufferBuilder, vectorOfNonOwningReferences: Int) = builder.addOffset(42, vectorOfNonOwningReferences, 0) + @kotlin.ExperimentalUnsignedTypes fun createVectorOfNonOwningReferencesVector(builder: FlatBufferBuilder, data: ULongArray) : Int { builder.startVector(8, data.size, 8) for (i in data.size - 1 downTo 0) { @@ -1176,6 +1181,7 @@ class Monster : Table() { fun addAnyAmbiguousType(builder: FlatBufferBuilder, anyAmbiguousType: UByte) = builder.addByte(45, anyAmbiguousType.toByte(), 0) fun addAnyAmbiguous(builder: FlatBufferBuilder, anyAmbiguous: Int) = builder.addOffset(46, anyAmbiguous, 0) fun addVectorOfEnums(builder: FlatBufferBuilder, vectorOfEnums: Int) = builder.addOffset(47, vectorOfEnums, 0) + @kotlin.ExperimentalUnsignedTypes fun createVectorOfEnumsVector(builder: FlatBufferBuilder, data: UByteArray) : Int { builder.startVector(1, data.size, 1) for (i in data.size - 1 downTo 0) { @@ -1186,6 +1192,7 @@ class Monster : Table() { fun startVectorOfEnumsVector(builder: FlatBufferBuilder, numElems: Int) = builder.startVector(1, numElems, 1) fun addSignedEnum(builder: FlatBufferBuilder, signedEnum: Byte) = builder.addByte(48, signedEnum, -1) fun addTestrequirednestedflatbuffer(builder: FlatBufferBuilder, testrequirednestedflatbuffer: Int) = builder.addOffset(49, testrequirednestedflatbuffer, 0) + @kotlin.ExperimentalUnsignedTypes fun createTestrequirednestedflatbufferVector(builder: FlatBufferBuilder, data: UByteArray) : Int { builder.startVector(1, data.size, 1) for (i in data.size - 1 downTo 0) { diff --git a/tests/MyGame/Example/Race.kt b/tests/MyGame/Example/Race.kt index 9cf885723..6f770a3c9 100644 --- a/tests/MyGame/Example/Race.kt +++ b/tests/MyGame/Example/Race.kt @@ -3,7 +3,6 @@ package MyGame.Example @Suppress("unused") -@kotlin.ExperimentalUnsignedTypes class Race private constructor() { companion object { const val None: Byte = -1 diff --git a/tests/MyGame/Example/Referrable.kt b/tests/MyGame/Example/Referrable.kt index 064d3e72d..55dc603de 100644 --- a/tests/MyGame/Example/Referrable.kt +++ b/tests/MyGame/Example/Referrable.kt @@ -19,7 +19,6 @@ import java.nio.ByteOrder import kotlin.math.sign @Suppress("unused") -@kotlin.ExperimentalUnsignedTypes class Referrable : Table() { fun __init(_i: Int, _bb: ByteBuffer) { diff --git a/tests/MyGame/Example/Stat.kt b/tests/MyGame/Example/Stat.kt index 44a6fbc91..d5f09baed 100644 --- a/tests/MyGame/Example/Stat.kt +++ b/tests/MyGame/Example/Stat.kt @@ -19,7 +19,6 @@ import java.nio.ByteOrder import kotlin.math.sign @Suppress("unused") -@kotlin.ExperimentalUnsignedTypes class Stat : Table() { fun __init(_i: Int, _bb: ByteBuffer) { diff --git a/tests/MyGame/Example/StructOfStructs.kt b/tests/MyGame/Example/StructOfStructs.kt index 89fd831f6..e7a27a231 100644 --- a/tests/MyGame/Example/StructOfStructs.kt +++ b/tests/MyGame/Example/StructOfStructs.kt @@ -19,7 +19,6 @@ import java.nio.ByteOrder import kotlin.math.sign @Suppress("unused") -@kotlin.ExperimentalUnsignedTypes class StructOfStructs : Struct() { fun __init(_i: Int, _bb: ByteBuffer) { diff --git a/tests/MyGame/Example/StructOfStructsOfStructs.kt b/tests/MyGame/Example/StructOfStructsOfStructs.kt index 24bd1cfad..5fb1a1ef5 100644 --- a/tests/MyGame/Example/StructOfStructsOfStructs.kt +++ b/tests/MyGame/Example/StructOfStructsOfStructs.kt @@ -19,7 +19,6 @@ import java.nio.ByteOrder import kotlin.math.sign @Suppress("unused") -@kotlin.ExperimentalUnsignedTypes class StructOfStructsOfStructs : Struct() { fun __init(_i: Int, _bb: ByteBuffer) { diff --git a/tests/MyGame/Example/Test.kt b/tests/MyGame/Example/Test.kt index c910b3e04..c2ce96e9b 100644 --- a/tests/MyGame/Example/Test.kt +++ b/tests/MyGame/Example/Test.kt @@ -19,7 +19,6 @@ import java.nio.ByteOrder import kotlin.math.sign @Suppress("unused") -@kotlin.ExperimentalUnsignedTypes class Test : Struct() { fun __init(_i: Int, _bb: ByteBuffer) { diff --git a/tests/MyGame/Example/TestSimpleTableWithEnum.kt b/tests/MyGame/Example/TestSimpleTableWithEnum.kt index 17d90c631..2b6edbb27 100644 --- a/tests/MyGame/Example/TestSimpleTableWithEnum.kt +++ b/tests/MyGame/Example/TestSimpleTableWithEnum.kt @@ -19,7 +19,6 @@ import java.nio.ByteOrder import kotlin.math.sign @Suppress("unused") -@kotlin.ExperimentalUnsignedTypes class TestSimpleTableWithEnum : Table() { fun __init(_i: Int, _bb: ByteBuffer) { diff --git a/tests/MyGame/Example/TypeAliases.kt b/tests/MyGame/Example/TypeAliases.kt index 4bd596417..bf6914a95 100644 --- a/tests/MyGame/Example/TypeAliases.kt +++ b/tests/MyGame/Example/TypeAliases.kt @@ -19,7 +19,6 @@ import java.nio.ByteOrder import kotlin.math.sign @Suppress("unused") -@kotlin.ExperimentalUnsignedTypes class TypeAliases : Table() { fun __init(_i: Int, _bb: ByteBuffer) { diff --git a/tests/MyGame/Example/Vec3.kt b/tests/MyGame/Example/Vec3.kt index 59a431d7a..9e1f89ed8 100644 --- a/tests/MyGame/Example/Vec3.kt +++ b/tests/MyGame/Example/Vec3.kt @@ -19,7 +19,6 @@ import java.nio.ByteOrder import kotlin.math.sign @Suppress("unused") -@kotlin.ExperimentalUnsignedTypes class Vec3 : Struct() { fun __init(_i: Int, _bb: ByteBuffer) { diff --git a/tests/MyGame/Example2/Monster.kt b/tests/MyGame/Example2/Monster.kt index dad657fec..9822b081b 100644 --- a/tests/MyGame/Example2/Monster.kt +++ b/tests/MyGame/Example2/Monster.kt @@ -19,7 +19,6 @@ import java.nio.ByteOrder import kotlin.math.sign @Suppress("unused") -@kotlin.ExperimentalUnsignedTypes class Monster : Table() { fun __init(_i: Int, _bb: ByteBuffer) { diff --git a/tests/MyGame/InParentNamespace.kt b/tests/MyGame/InParentNamespace.kt index 2116626c9..445057e98 100644 --- a/tests/MyGame/InParentNamespace.kt +++ b/tests/MyGame/InParentNamespace.kt @@ -19,7 +19,6 @@ import java.nio.ByteOrder import kotlin.math.sign @Suppress("unused") -@kotlin.ExperimentalUnsignedTypes class InParentNamespace : Table() { fun __init(_i: Int, _bb: ByteBuffer) { diff --git a/tests/MyGame/MonsterExtra.kt b/tests/MyGame/MonsterExtra.kt index cdc889110..cb0274daa 100644 --- a/tests/MyGame/MonsterExtra.kt +++ b/tests/MyGame/MonsterExtra.kt @@ -19,7 +19,6 @@ import java.nio.ByteOrder import kotlin.math.sign @Suppress("unused") -@kotlin.ExperimentalUnsignedTypes class MonsterExtra : Table() { fun __init(_i: Int, _bb: ByteBuffer) { diff --git a/tests/optional_scalars/OptionalByte.kt b/tests/optional_scalars/OptionalByte.kt index 1379cd105..7a8788631 100644 --- a/tests/optional_scalars/OptionalByte.kt +++ b/tests/optional_scalars/OptionalByte.kt @@ -3,7 +3,6 @@ package optional_scalars @Suppress("unused") -@kotlin.ExperimentalUnsignedTypes class OptionalByte private constructor() { companion object { const val None: Byte = 0 diff --git a/tests/optional_scalars/ScalarStuff.kt b/tests/optional_scalars/ScalarStuff.kt index bcc99d9bd..76bbb7275 100644 --- a/tests/optional_scalars/ScalarStuff.kt +++ b/tests/optional_scalars/ScalarStuff.kt @@ -19,7 +19,6 @@ import java.nio.ByteOrder import kotlin.math.sign @Suppress("unused") -@kotlin.ExperimentalUnsignedTypes class ScalarStuff : Table() { fun __init(_i: Int, _bb: ByteBuffer) { diff --git a/tests/union_vector/Attacker.kt b/tests/union_vector/Attacker.kt index 60a2fa1a5..bd51612ae 100644 --- a/tests/union_vector/Attacker.kt +++ b/tests/union_vector/Attacker.kt @@ -17,7 +17,6 @@ import java.nio.ByteOrder import kotlin.math.sign @Suppress("unused") -@kotlin.ExperimentalUnsignedTypes class Attacker : Table() { fun __init(_i: Int, _bb: ByteBuffer) { diff --git a/tests/union_vector/BookReader.kt b/tests/union_vector/BookReader.kt index ddeb09dda..87dff7328 100644 --- a/tests/union_vector/BookReader.kt +++ b/tests/union_vector/BookReader.kt @@ -17,7 +17,6 @@ import java.nio.ByteOrder import kotlin.math.sign @Suppress("unused") -@kotlin.ExperimentalUnsignedTypes class BookReader : Struct() { fun __init(_i: Int, _bb: ByteBuffer) { diff --git a/tests/union_vector/Character.kt b/tests/union_vector/Character.kt index 302b7e50f..2e80a35f1 100644 --- a/tests/union_vector/Character.kt +++ b/tests/union_vector/Character.kt @@ -1,7 +1,6 @@ // automatically generated by the FlatBuffers compiler, do not modify @Suppress("unused") -@kotlin.ExperimentalUnsignedTypes class Character_ private constructor() { companion object { const val NONE: UByte = 0u diff --git a/tests/union_vector/FallingTub.kt b/tests/union_vector/FallingTub.kt index 0f167250a..43e477a39 100644 --- a/tests/union_vector/FallingTub.kt +++ b/tests/union_vector/FallingTub.kt @@ -17,7 +17,6 @@ import java.nio.ByteOrder import kotlin.math.sign @Suppress("unused") -@kotlin.ExperimentalUnsignedTypes class FallingTub : Struct() { fun __init(_i: Int, _bb: ByteBuffer) { diff --git a/tests/union_vector/Gadget.kt b/tests/union_vector/Gadget.kt index c537a4f30..4fb3b1007 100644 --- a/tests/union_vector/Gadget.kt +++ b/tests/union_vector/Gadget.kt @@ -1,7 +1,6 @@ // automatically generated by the FlatBuffers compiler, do not modify @Suppress("unused") -@kotlin.ExperimentalUnsignedTypes class Gadget private constructor() { companion object { const val NONE: UByte = 0u diff --git a/tests/union_vector/HandFan.kt b/tests/union_vector/HandFan.kt index c432d22de..afae3142c 100644 --- a/tests/union_vector/HandFan.kt +++ b/tests/union_vector/HandFan.kt @@ -17,7 +17,6 @@ import java.nio.ByteOrder import kotlin.math.sign @Suppress("unused") -@kotlin.ExperimentalUnsignedTypes class HandFan : Table() { fun __init(_i: Int, _bb: ByteBuffer) { diff --git a/tests/union_vector/Movie.kt b/tests/union_vector/Movie.kt index 87488dade..d346dfcb9 100644 --- a/tests/union_vector/Movie.kt +++ b/tests/union_vector/Movie.kt @@ -17,7 +17,6 @@ import java.nio.ByteOrder import kotlin.math.sign @Suppress("unused") -@kotlin.ExperimentalUnsignedTypes class Movie : Table() { fun __init(_i: Int, _bb: ByteBuffer) { @@ -99,6 +98,7 @@ class Movie : Table() { fun addMainCharacterType(builder: FlatBufferBuilder, mainCharacterType: UByte) = builder.addByte(0, mainCharacterType.toByte(), 0) fun addMainCharacter(builder: FlatBufferBuilder, mainCharacter: Int) = builder.addOffset(1, mainCharacter, 0) fun addCharactersType(builder: FlatBufferBuilder, charactersType: Int) = builder.addOffset(2, charactersType, 0) + @kotlin.ExperimentalUnsignedTypes fun createCharactersTypeVector(builder: FlatBufferBuilder, data: UByteArray) : Int { builder.startVector(1, data.size, 1) for (i in data.size - 1 downTo 0) { diff --git a/tests/union_vector/Rapunzel.kt b/tests/union_vector/Rapunzel.kt index d51402a25..e3296e193 100644 --- a/tests/union_vector/Rapunzel.kt +++ b/tests/union_vector/Rapunzel.kt @@ -17,7 +17,6 @@ import java.nio.ByteOrder import kotlin.math.sign @Suppress("unused") -@kotlin.ExperimentalUnsignedTypes class Rapunzel : Struct() { fun __init(_i: Int, _bb: ByteBuffer) {