diff --git a/.github/workflows/functional-tests.yml b/.github/workflows/functional-tests.yml index adfbb6b5b6..cc3558bee4 100644 --- a/.github/workflows/functional-tests.yml +++ b/.github/workflows/functional-tests.yml @@ -244,7 +244,7 @@ jobs: - name: Install Dart SDK run: | DART_RELEASE_CHANNEL=stable - DART_VERSION=2.12.0 + DART_VERSION=2.13.3 wget -nv https://storage.googleapis.com/dart-archive/channels/${DART_RELEASE_CHANNEL}/release/${DART_VERSION}/linux_packages/dart_${DART_VERSION}-1_amd64.deb sudo apt -y install ./dart_${DART_VERSION}-1_amd64.deb - name: Build and run functional tests @@ -276,8 +276,8 @@ jobs: uses: actions/cache@v2 with: path: ~/dart_sdk - key: ${{ runner.os }}-dart-2.12.0-stable - restore-keys: ${{ runner.os }}-dart-2.12.0-stable + key: ${{ runner.os }}-dart-2.13.3-stable + restore-keys: ${{ runner.os }}-dart-2.13.3-stable - name: Install CMake uses: jwlawson/actions-setup-cmake@v1.7 with: @@ -289,7 +289,7 @@ jobs: export DART_ROOT=${HOME}/dart_sdk export DART_BIN=${DART_ROOT}/bin export PATH=${PATH}:${PWD}/depot_tools:${DART_BIN} - DART_VERSION=2.12.0 + DART_VERSION=2.13.3 if [ ! -d "${DART_ROOT}/bin" ]; then sudo apt install -y python2 sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1 @@ -364,7 +364,7 @@ jobs: - name: Install Dart SDK run: | DART_RELEASE_CHANNEL=stable - DART_VERSION=2.12.0 + DART_VERSION=2.13.3 wget -nv https://storage.googleapis.com/dart-archive/channels/${DART_RELEASE_CHANNEL}/release/${DART_VERSION}/linux_packages/dart_${DART_VERSION}-1_amd64.deb sudo apt -y install ./dart_${DART_VERSION}-1_amd64.deb - name: Build and run functional tests diff --git a/CHANGELOG.md b/CHANGELOG.md index 602045c367..1a66846f5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,12 @@ # Gluecodium project Release Notes ## Unreleased +### Features: + * Added support for type aliases (typedefs) in Dart ### Bug fixes: * Fixed violation of referential equality invariant for some cases of interface inheritance. +### Breaking changes: + * Generated Dart code now requires minimum Dart version 2.13.0. ## 10.2.1 Release date: 2021-11-01 diff --git a/functional-tests/functional/dart/main.dart b/functional-tests/functional/dart/main.dart index 38bdd6805d..0ac4f23e4a 100644 --- a/functional-tests/functional/dart/main.dart +++ b/functional-tests/functional/dart/main.dart @@ -67,6 +67,7 @@ import "test/StaticIntMethods_test.dart" as StaticIntMethodsTests; import "test/StaticStringMethods_test.dart" as StaticStringMethodsTests; import "test/StructsWithConstants_test.dart" as StructsWithConstantsTests; import "test/StructsWithMethods_test.dart" as StructsWithMethodsTests; +import "test/TypeAliases_test.dart" as TypeAliasesTests; final _allTests = [ BlobsTests.main, @@ -113,7 +114,8 @@ final _allTests = [ StaticIntMethodsTests.main, StaticStringMethodsTests.main, StructsWithConstantsTests.main, - StructsWithMethodsTests.main + StructsWithMethodsTests.main, + TypeAliasesTests.main ]; String _getLibraryPath(String nativeLibraryName) { diff --git a/functional-tests/functional/dart/pubspec.yaml.in b/functional-tests/functional/dart/pubspec.yaml.in index fc0e3241aa..c110503b17 100644 --- a/functional-tests/functional/dart/pubspec.yaml.in +++ b/functional-tests/functional/dart/pubspec.yaml.in @@ -1,6 +1,6 @@ name: FunctionalDartTests environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=2.13.0 <3.0.0' dependencies: test: functional: diff --git a/functional-tests/functional/dart/test/TypeAliases_test.dart b/functional-tests/functional/dart/test/TypeAliases_test.dart new file mode 100644 index 0000000000..35037d22b8 --- /dev/null +++ b/functional-tests/functional/dart/test/TypeAliases_test.dart @@ -0,0 +1,53 @@ +// ------------------------------------------------------------------------------------------------- +// Copyright (C) 2016-2021 HERE Europe B.V. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// SPDX-License-Identifier: Apache-2.0 +// License-Filename: LICENSE +// +// ------------------------------------------------------------------------------------------------- + +import "package:test/test.dart"; +import "package:functional/test.dart"; +import "../test_suite.dart"; + +final _testSuite = TestSuite("Type Aliases"); + +void main() { + _testSuite.test("Type alias to struct", () { + final result = StaticTypedefExampleStructTypedef("nonsense"); + + expect(result is StaticTypedefExampleStruct, isTrue); + expect(result.exampleString, "nonsense"); + }); + _testSuite.test("Type alias used by a function", () { + final result = StaticTypedef.returnIntTypedef(2); + + expect(result is int, isTrue); + expect(result, 3); + }); + _testSuite.test("Type alias points to a type alias", () { + final result = StaticTypedef.returnNestedIntTypedef(4); + + expect(result is int, isTrue); + expect(result, 5); + }); + _testSuite.test("Type alias from type collection", () { + final result = StaticTypedef.returnTypedefPointFromTypeCollection(PointTypedef(1.0, 3.0)); + + expect(result is Point, isTrue); + expect(result.x, 1.0); + expect(result.y, 3.0); + }); +} diff --git a/gluecodium/src/main/java/com/here/gluecodium/generator/dart/DartGenerator.kt b/gluecodium/src/main/java/com/here/gluecodium/generator/dart/DartGenerator.kt index b24a56b34f..43475442b3 100644 --- a/gluecodium/src/main/java/com/here/gluecodium/generator/dart/DartGenerator.kt +++ b/gluecodium/src/main/java/com/here/gluecodium/generator/dart/DartGenerator.kt @@ -165,7 +165,7 @@ internal class DartGenerator : Generator { .sortedBy { ffiNameResolver.resolveName(it) } val generatedFiles = dartFilteredModel.topElements.flatMap { - listOfNotNull( + listOf( generateDart( it, dartResolvers, dartNameResolver, listOf(importsCollector, declarationImportsCollector), exportsCollector, typeRepositoriesCollector, generatorPredicates.predicates, descendantInterfaces @@ -195,15 +195,15 @@ internal class DartGenerator : Generator { typeRepositoriesCollector: MutableList, predicates: Map Boolean>, descendantInterfaces: Map> - ): GeneratedFile? { - val contentTemplateName = selectTemplate(rootElement) ?: return null + ): GeneratedFile { + val contentTemplateName = selectTemplate(rootElement) val packagePath = rootElement.path.head.joinToString(separator = "/") val fileName = dartNameResolver.resolveFileName(rootElement) val filePath = "$packagePath/$fileName" val relativePath = "$SRC_DIR_SUFFIX/$filePath.dart" - val allTypes = LimeTypeHelper.getAllTypes(rootElement).filterNot { it is LimeTypeAlias } + val allTypes = LimeTypeHelper.getAllTypes(rootElement) val nonExternalTypes = allTypes.filter { it.external?.dart == null } val freeConstants = (rootElement as? LimeTypesCollection)?.constants ?: emptyList() val allSymbols = @@ -512,7 +512,7 @@ internal class DartGenerator : Generator { is LimeEnumeration -> "dart/DartEnumeration" is LimeException -> "dart/DartException" is LimeLambda -> "dart/DartLambda" - is LimeTypeAlias -> null + is LimeTypeAlias -> "dart/DartTypeAlias" else -> throw GluecodiumExecutionException( "Unsupported top-level element: " + limeElement::class.java.name diff --git a/gluecodium/src/main/java/com/here/gluecodium/generator/dart/DartImportResolver.kt b/gluecodium/src/main/java/com/here/gluecodium/generator/dart/DartImportResolver.kt index 58d416d0f4..a156ba5238 100644 --- a/gluecodium/src/main/java/com/here/gluecodium/generator/dart/DartImportResolver.kt +++ b/gluecodium/src/main/java/com/here/gluecodium/generator/dart/DartImportResolver.kt @@ -54,12 +54,12 @@ internal class DartImportResolver( } private fun resolveTypeImports(limeType: LimeType): List = - when (val actualType = limeType.actualType) { - is LimeBasicType -> resolveBasicTypeImports(actualType) - is LimeGenericType -> resolveGenericTypeImports(actualType) + when (limeType) { + is LimeBasicType -> resolveBasicTypeImports(limeType) + is LimeGenericType -> resolveGenericTypeImports(limeType) else -> listOfNotNull( - createImport(actualType), - resolveExternalImport(actualType, IMPORT_PATH_NAME, useAlias = true) + createImport(limeType), + resolveExternalImport(limeType, IMPORT_PATH_NAME, useAlias = true) ) } diff --git a/gluecodium/src/main/java/com/here/gluecodium/generator/dart/DartImportsCollector.kt b/gluecodium/src/main/java/com/here/gluecodium/generator/dart/DartImportsCollector.kt index bf39d12cab..71e3a36d32 100644 --- a/gluecodium/src/main/java/com/here/gluecodium/generator/dart/DartImportsCollector.kt +++ b/gluecodium/src/main/java/com/here/gluecodium/generator/dart/DartImportsCollector.kt @@ -25,7 +25,12 @@ import com.here.gluecodium.model.lime.LimeClass import com.here.gluecodium.model.lime.LimeContainerWithInheritance internal class DartImportsCollector(importsResolver: ImportsResolver) : - GenericImportsCollector(importsResolver, collectTypeRefImports = true, parentTypeFilter = { true }) { + GenericImportsCollector( + importsResolver, + collectTypeRefImports = true, + parentTypeFilter = { true }, + collectTypeAliasImports = true + ) { override fun collectParentTypeRefs(limeContainer: LimeContainerWithInheritance) = when (limeContainer) { diff --git a/gluecodium/src/main/java/com/here/gluecodium/generator/dart/DartNameResolver.kt b/gluecodium/src/main/java/com/here/gluecodium/generator/dart/DartNameResolver.kt index cb670e9af2..9b3efb1b8e 100644 --- a/gluecodium/src/main/java/com/here/gluecodium/generator/dart/DartNameResolver.kt +++ b/gluecodium/src/main/java/com/here/gluecodium/generator/dart/DartNameResolver.kt @@ -44,7 +44,6 @@ import com.here.gluecodium.model.lime.LimeReturnType import com.here.gluecodium.model.lime.LimeSet import com.here.gluecodium.model.lime.LimeStruct import com.here.gluecodium.model.lime.LimeType -import com.here.gluecodium.model.lime.LimeTypeAlias import com.here.gluecodium.model.lime.LimeTypeRef import com.here.gluecodium.model.lime.LimeTypesCollection import com.here.gluecodium.model.lime.LimeValue @@ -80,7 +79,6 @@ internal class DartNameResolver( is LimeValue -> resolveValue(element) is LimeGenericType -> resolveGenericType(element) is LimeTypeRef -> resolveTypeRefName(element) - is LimeTypeAlias -> resolveName(element.typeRef) is LimeType -> resolveTypeName(element) is LimeNamedElement -> getPlatformName(element) else -> @@ -221,11 +219,11 @@ internal class DartNameResolver( private fun resolveTypeRefName(limeTypeRef: LimeTypeRef, ignoreDuplicates: Boolean = false): String { val typeName = resolveName(limeTypeRef.type) - val importPath = limeTypeRef.type.actualType.external?.dart?.get(IMPORT_PATH_NAME) + val importPath = limeTypeRef.type.external?.dart?.get(IMPORT_PATH_NAME) val alias = when { importPath != null -> computeAlias(importPath) ignoreDuplicates -> null - duplicateNames.contains(typeName) -> limeTypeRef.type.actualType.path.head.joinToString("_") + duplicateNames.contains(typeName) -> limeTypeRef.type.path.head.joinToString("_") else -> null } val suffix = if (limeTypeRef.isNullable) "?" else "" @@ -258,7 +256,7 @@ internal class DartNameResolver( private fun buildDuplicateNames() = limeReferenceMap.values .filterIsInstance() - .filterNot { it is LimeTypesCollection || it is LimeTypeAlias || it is LimeGenericType || it is LimeBasicType } + .filterNot { it is LimeTypesCollection || it is LimeGenericType || it is LimeBasicType } .filter { it.external?.dart == null } .groupBy { resolveTypeName(it) } .filterValues { it.size > 1 } diff --git a/gluecodium/src/main/resources/templates/dart/DartClass.mustache b/gluecodium/src/main/resources/templates/dart/DartClass.mustache index fbcaccf5fa..a5979bb948 100644 --- a/gluecodium/src/main/resources/templates/dart/DartClass.mustache +++ b/gluecodium/src/main/resources/templates/dart/DartClass.mustache @@ -48,6 +48,9 @@ abstract class {{resolveName}}{{!! {{/ifPredicate}} } +{{#typeAliases}} +{{>dart/DartTypeAlias}} +{{/typeAliases}} {{#enumerations}} {{>dart/DartEnumeration}} {{/enumerations}} diff --git a/gluecodium/src/main/resources/templates/dart/DartInterface.mustache b/gluecodium/src/main/resources/templates/dart/DartInterface.mustache index 47113ba7d9..bbc680e03e 100644 --- a/gluecodium/src/main/resources/templates/dart/DartInterface.mustache +++ b/gluecodium/src/main/resources/templates/dart/DartInterface.mustache @@ -64,6 +64,9 @@ abstract class {{resolveName}}{{!! {{/ifPredicate}} } +{{#typeAliases}} +{{>dart/DartTypeAlias}} +{{/typeAliases}} {{#enumerations}} {{>dart/DartEnumeration}} {{/enumerations}} diff --git a/gluecodium/src/main/resources/templates/dart/DartPubspec.mustache b/gluecodium/src/main/resources/templates/dart/DartPubspec.mustache index 9ec1c6b416..0d8ac082d6 100644 --- a/gluecodium/src/main/resources/templates/dart/DartPubspec.mustache +++ b/gluecodium/src/main/resources/templates/dart/DartPubspec.mustache @@ -20,7 +20,7 @@ !}} name: {{libraryName}} environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=2.13.0 <3.0.0' dependencies: ffi: intl: diff --git a/gluecodium/src/main/resources/templates/dart/DartStruct.mustache b/gluecodium/src/main/resources/templates/dart/DartStruct.mustache index 9fd9b9a81b..a815126037 100644 --- a/gluecodium/src/main/resources/templates/dart/DartStruct.mustache +++ b/gluecodium/src/main/resources/templates/dart/DartStruct.mustache @@ -70,6 +70,9 @@ class {{resolveName}}{{#if external.dart.converter}}Internal{{/if}} { } {{/unlessPredicate}} +{{#typeAliases}} +{{>dart/DartTypeAlias}} +{{/typeAliases}} {{#enumerations}} {{>dart/DartEnumeration}} {{/enumerations}} diff --git a/gluecodium/src/main/resources/templates/dart/DartTypeAlias.mustache b/gluecodium/src/main/resources/templates/dart/DartTypeAlias.mustache new file mode 100644 index 0000000000..375c53e632 --- /dev/null +++ b/gluecodium/src/main/resources/templates/dart/DartTypeAlias.mustache @@ -0,0 +1,22 @@ +{{!! + ! + ! Copyright (C) 2016-2021 HERE Europe B.V. + ! + ! Licensed under the Apache License, Version 2.0 (the "License"); + ! you may not use this file except in compliance with the License. + ! You may obtain a copy of the License at + ! + ! http://www.apache.org/licenses/LICENSE-2.0 + ! + ! Unless required by applicable law or agreed to in writing, software + ! distributed under the License is distributed on an "AS IS" BASIS, + ! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ! See the License for the specific language governing permissions and + ! limitations under the License. + ! + ! SPDX-License-Identifier: Apache-2.0 + ! License-Filename: LICENSE + ! + !}} +{{>dart/DartDocumentation}}{{>dart/DartAttributes}} +typedef {{resolveName visibility}}{{resolveName}} = {{resolveName typeRef}}; diff --git a/gluecodium/src/main/resources/templates/dart/DartTypes.mustache b/gluecodium/src/main/resources/templates/dart/DartTypes.mustache index bd200ce469..94620a5ff4 100644 --- a/gluecodium/src/main/resources/templates/dart/DartTypes.mustache +++ b/gluecodium/src/main/resources/templates/dart/DartTypes.mustache @@ -18,6 +18,9 @@ ! License-Filename: LICENSE ! !}} +{{#typeAliases}} +{{>dart/DartTypeAlias}} +{{/typeAliases}} {{#enumerations}} {{>dart/DartEnumeration}} {{/enumerations}} diff --git a/gluecodium/src/test/resources/smoke/typedefs/output/dart/lib/src/smoke/type_defs.dart b/gluecodium/src/test/resources/smoke/typedefs/output/dart/lib/src/smoke/type_defs.dart index 45ebdf4a89..368a08d23f 100644 --- a/gluecodium/src/test/resources/smoke/typedefs/output/dart/lib/src/smoke/type_defs.dart +++ b/gluecodium/src/test/resources/smoke/typedefs/output/dart/lib/src/smoke/type_defs.dart @@ -10,20 +10,26 @@ abstract class TypeDefs { /// @nodoc @Deprecated("Does nothing") void release(); - static double methodWithPrimitiveTypeDef(double input) => $prototype.methodWithPrimitiveTypeDef(input); - static List methodWithComplexTypeDef(List input) => $prototype.methodWithComplexTypeDef(input); - static double returnNestedIntTypeDef(double input) => $prototype.returnNestedIntTypeDef(input); - static TypeDefs_TestStruct returnTestStructTypeDef(TypeDefs_TestStruct input) => $prototype.returnTestStructTypeDef(input); - static TypeDefs_TestStruct returnNestedStructTypeDef(TypeDefs_TestStruct input) => $prototype.returnNestedStructTypeDef(input); - static Point returnTypeDefPointFromTypeCollection(Point input) => $prototype.returnTypeDefPointFromTypeCollection(input); - List get primitiveTypeProperty; - set primitiveTypeProperty(List value); + static TypeDefs_PrimitiveTypeDef methodWithPrimitiveTypeDef(TypeDefs_PrimitiveTypeDef input) => $prototype.methodWithPrimitiveTypeDef(input); + static TypeDefs_ComplexTypeDef methodWithComplexTypeDef(TypeDefs_ComplexTypeDef input) => $prototype.methodWithComplexTypeDef(input); + static TypeDefs_NestedIntTypeDef returnNestedIntTypeDef(TypeDefs_NestedIntTypeDef input) => $prototype.returnNestedIntTypeDef(input); + static TypeDefs_TestStructTypeDef returnTestStructTypeDef(TypeDefs_TestStructTypeDef input) => $prototype.returnTestStructTypeDef(input); + static TypeDefs_NestedStructTypeDef returnNestedStructTypeDef(TypeDefs_NestedStructTypeDef input) => $prototype.returnNestedStructTypeDef(input); + static PointTypeDef returnTypeDefPointFromTypeCollection(PointTypeDef input) => $prototype.returnTypeDefPointFromTypeCollection(input); + List get primitiveTypeProperty; + set primitiveTypeProperty(List value); /// @nodoc @visibleForTesting static dynamic $prototype = TypeDefs$Impl(Pointer.fromAddress(0)); } +typedef TypeDefs_NestedIntTypeDef = TypeDefs_PrimitiveTypeDef; +typedef TypeDefs_PrimitiveTypeDef = double; +typedef TypeDefs_StructArray = List; +typedef TypeDefs_ComplexTypeDef = TypeDefs_StructArray; +typedef TypeDefs_TestStructTypeDef = TypeDefs_TestStruct; +typedef TypeDefs_NestedStructTypeDef = TypeDefs_TestStructTypeDef; class TypeDefs_StructHavingAliasFieldDefinedBelow { - double field; + TypeDefs_PrimitiveTypeDef field; TypeDefs_StructHavingAliasFieldDefinedBelow(this.field); } // TypeDefs_StructHavingAliasFieldDefinedBelow "private" section, not exported. @@ -167,7 +173,7 @@ class TypeDefs$Impl extends __lib.NativeBase implements TypeDefs { TypeDefs$Impl(Pointer handle) : super(handle); @override void release() {} - double methodWithPrimitiveTypeDef(double input) { + TypeDefs_PrimitiveTypeDef methodWithPrimitiveTypeDef(TypeDefs_PrimitiveTypeDef input) { final _methodWithPrimitiveTypeDefFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction('library_smoke_TypeDefs_methodWithPrimitiveTypeDef__Double')); final _inputHandle = (input); final __resultHandle = _methodWithPrimitiveTypeDefFfi(__lib.LibraryContext.isolateId, _inputHandle); @@ -176,7 +182,7 @@ class TypeDefs$Impl extends __lib.NativeBase implements TypeDefs { } finally { } } - List methodWithComplexTypeDef(List input) { + TypeDefs_ComplexTypeDef methodWithComplexTypeDef(TypeDefs_ComplexTypeDef input) { final _methodWithComplexTypeDefFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction Function(Int32, Pointer), Pointer Function(int, Pointer)>('library_smoke_TypeDefs_methodWithComplexTypeDef__ListOf_smoke_TypeDefs_TestStruct')); final _inputHandle = foobarListofSmokeTypedefsTeststructToFfi(input); final __resultHandle = _methodWithComplexTypeDefFfi(__lib.LibraryContext.isolateId, _inputHandle); @@ -187,7 +193,7 @@ class TypeDefs$Impl extends __lib.NativeBase implements TypeDefs { foobarListofSmokeTypedefsTeststructReleaseFfiHandle(__resultHandle); } } - double returnNestedIntTypeDef(double input) { + TypeDefs_NestedIntTypeDef returnNestedIntTypeDef(TypeDefs_NestedIntTypeDef input) { final _returnNestedIntTypeDefFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction('library_smoke_TypeDefs_returnNestedIntTypeDef__Double')); final _inputHandle = (input); final __resultHandle = _returnNestedIntTypeDefFfi(__lib.LibraryContext.isolateId, _inputHandle); @@ -196,7 +202,7 @@ class TypeDefs$Impl extends __lib.NativeBase implements TypeDefs { } finally { } } - TypeDefs_TestStruct returnTestStructTypeDef(TypeDefs_TestStruct input) { + TypeDefs_TestStructTypeDef returnTestStructTypeDef(TypeDefs_TestStructTypeDef input) { final _returnTestStructTypeDefFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction Function(Int32, Pointer), Pointer Function(int, Pointer)>('library_smoke_TypeDefs_returnTestStructTypeDef__TestStruct')); final _inputHandle = smokeTypedefsTeststructToFfi(input); final __resultHandle = _returnTestStructTypeDefFfi(__lib.LibraryContext.isolateId, _inputHandle); @@ -207,7 +213,7 @@ class TypeDefs$Impl extends __lib.NativeBase implements TypeDefs { smokeTypedefsTeststructReleaseFfiHandle(__resultHandle); } } - TypeDefs_TestStruct returnNestedStructTypeDef(TypeDefs_TestStruct input) { + TypeDefs_NestedStructTypeDef returnNestedStructTypeDef(TypeDefs_NestedStructTypeDef input) { final _returnNestedStructTypeDefFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction Function(Int32, Pointer), Pointer Function(int, Pointer)>('library_smoke_TypeDefs_returnNestedStructTypeDef__TestStruct')); final _inputHandle = smokeTypedefsTeststructToFfi(input); final __resultHandle = _returnNestedStructTypeDefFfi(__lib.LibraryContext.isolateId, _inputHandle); @@ -218,7 +224,7 @@ class TypeDefs$Impl extends __lib.NativeBase implements TypeDefs { smokeTypedefsTeststructReleaseFfiHandle(__resultHandle); } } - Point returnTypeDefPointFromTypeCollection(Point input) { + PointTypeDef returnTypeDefPointFromTypeCollection(PointTypeDef input) { final _returnTypeDefPointFromTypeCollectionFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction Function(Int32, Pointer), Pointer Function(int, Pointer)>('library_smoke_TypeDefs_returnTypeDefPointFromTypeCollection__Point')); final _inputHandle = smokeTypecollectionPointToFfi(input); final __resultHandle = _returnTypeDefPointFromTypeCollectionFfi(__lib.LibraryContext.isolateId, _inputHandle); @@ -230,7 +236,7 @@ class TypeDefs$Impl extends __lib.NativeBase implements TypeDefs { } } @override - List get primitiveTypeProperty { + List get primitiveTypeProperty { final _getFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction Function(Pointer, Int32), Pointer Function(Pointer, int)>('library_smoke_TypeDefs_primitiveTypeProperty_get')); final _handle = this.handle; final __resultHandle = _getFfi(_handle, __lib.LibraryContext.isolateId); @@ -241,7 +247,7 @@ class TypeDefs$Impl extends __lib.NativeBase implements TypeDefs { } } @override - set primitiveTypeProperty(List value) { + set primitiveTypeProperty(List value) { final _setFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction, Int32, Pointer), void Function(Pointer, int, Pointer)>('library_smoke_TypeDefs_primitiveTypeProperty_set__ListOf_Double')); final _valueHandle = foobarListofDoubleToFfi(value); final _handle = this.handle;