diff options
author | Aaron Riekenberg <aaron.riekenberg@target.com> | 2023-04-28 12:10:01 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-28 17:10:01 +0000 |
commit | 417821fdd7eb82d0ebbd9ea1e920d4b27fb5c1b7 (patch) | |
tree | f009d6b66e486f873aa24d3b388c4db84f6d9ef3 /tests | |
parent | c192ab423b5dc63f467a2ad32bab6bc883d44dbe (diff) | |
download | flatbuffers-417821fdd7eb82d0ebbd9ea1e920d4b27fb5c1b7.tar.gz flatbuffers-417821fdd7eb82d0ebbd9ea1e920d4b27fb5c1b7.tar.bz2 flatbuffers-417821fdd7eb82d0ebbd9ea1e920d4b27fb5c1b7.zip |
Only generate @kotlin.ExperimentalUnsigned annotation on create*Vector methods having an unsigned array type parameter. (#7881)
Co-authored-by: Derek Bailey <derekbailey@google.com>
Diffstat (limited to 'tests')
31 files changed, 9 insertions, 31 deletions
diff --git a/tests/DictionaryLookup/LongFloatEntry.kt b/tests/DictionaryLookup/LongFloatEntry.kt index c9be31d8..bf1a0f4b 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 32467ddb..816382a4 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 a3e17bef..dc2b0b86 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 8b900723..d7dd7bbe 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 40430965..c38923b9 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 8be0cc82..2db45a6c 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 61a313e6..0af56e1e 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 328c9c4f..ecb5aabf 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 eae51e0f..4631ae0f 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 9cf88572..6f770a3c 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 064d3e72..55dc603d 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 44a6fbc9..d5f09bae 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 89fd831f..e7a27a23 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 24bd1cfa..5fb1a1ef 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 c910b3e0..c2ce96e9 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 17d90c63..2b6edbb2 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 4bd59641..bf6914a9 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 59a431d7..9e1f89ed 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 dad657fe..9822b081 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 2116626c..445057e9 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 cdc88911..cb0274da 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 1379cd10..7a878863 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 bcc99d9b..76bbb727 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 60a2fa1a..bd51612a 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 ddeb09dd..87dff732 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 302b7e50..2e80a35f 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 0f167250..43e477a3 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 c537a4f3..4fb3b100 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 c432d22d..afae3142 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 87488dad..d346dfcb 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 d51402a2..e3296e19 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) { |