diff --git a/pkgs/swift2objc/lib/src/parser/_core/token_list.dart b/pkgs/swift2objc/lib/src/parser/_core/token_list.dart index c2e38fdc4..8939d1036 100644 --- a/pkgs/swift2objc/lib/src/parser/_core/token_list.dart +++ b/pkgs/swift2objc/lib/src/parser/_core/token_list.dart @@ -28,6 +28,8 @@ class TokenList { '?(': ['?', '('], '?)': ['?', ')'], '?, ': ['?', ', '], + ') -> ': [')', '->'], + '?) -> ': ['?', ')', '->'], }; final list = []; diff --git a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_function_declaration.dart b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_function_declaration.dart index e0c71bdc5..27a4e35b5 100644 --- a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_function_declaration.dart +++ b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_function_declaration.dart @@ -20,7 +20,8 @@ GlobalFunctionDeclaration parseGlobalFunctionDeclaration( id: parseSymbolId(globalFunctionSymbolJson), name: parseSymbolName(globalFunctionSymbolJson), returnType: _parseFunctionReturnType(globalFunctionSymbolJson, symbolgraph), - params: _parseFunctionParams(globalFunctionSymbolJson, symbolgraph), + params: parseFunctionParams( + globalFunctionSymbolJson['declarationFragments'], symbolgraph), ); } @@ -33,12 +34,81 @@ MethodDeclaration parseMethodDeclaration( id: parseSymbolId(methodSymbolJson), name: parseSymbolName(methodSymbolJson), returnType: _parseFunctionReturnType(methodSymbolJson, symbolgraph), - params: _parseFunctionParams(methodSymbolJson, symbolgraph), + params: parseFunctionParams( + methodSymbolJson['declarationFragments'], symbolgraph), hasObjCAnnotation: parseSymbolHasObjcAnnotation(methodSymbolJson), isStatic: isStatic, ); } +List parseFunctionParams( + Json declarationFragments, + ParsedSymbolgraph symbolgraph, +) { + // `declarationFragments` describes each part of the initializer declaration, + // things like the `func` keyword, brackets, spaces, etc. We only care about + // the parameter fragments here, and they always appear in this order: + // [ + // ..., '(', + // externalParam, ' ', internalParam, ': ', type..., ', ' + // externalParam, ': ', type..., ', ' + // externalParam, ' ', internalParam, ': ', type..., ')' + // ] + // Note: `internalParam` may or may not exist. + // + // The following loop attempts to extract parameters from this flat array + // while making sure the parameter fragments have the expected order. + + final parameters = []; + + var tokens = TokenList(declarationFragments); + final openParen = tokens.indexWhere((tok) => matchFragment(tok, 'text', '(')); + if (openParen != -1) { + tokens = tokens.slice(openParen + 1); + String? consume(String kind) { + if (tokens.isEmpty) return null; + final token = tokens[0]; + tokens = tokens.slice(1); + return getSpellingForKind(token, kind); + } + + final malformedInitializerException = Exception( + 'Malformed initializer at ${declarationFragments.path}', + ); + while (true) { + final externalParam = consume('externalParam'); + if (externalParam == null) throw malformedInitializerException; + + var sep = consume('text'); + String? internalParam; + if (sep == ' ') { + internalParam = consume('internalParam'); + if (internalParam == null) throw malformedInitializerException; + sep = consume('text'); + } + + if (sep != ': ') throw malformedInitializerException; + final (type, remainingTokens) = parseType(symbolgraph, tokens); + tokens = remainingTokens; + + parameters.add(Parameter( + name: externalParam, + internalName: internalParam, + type: type, + )); + + final end = consume('text'); + if (end == ')') break; + if (end != ', ') throw malformedInitializerException; + } + if (!(tokens.isEmpty || consume('text') == '->')) { + throw malformedInitializerException; + } + } + + return parameters; +} + ReferredType _parseFunctionReturnType( Json methodSymbolJson, ParsedSymbolgraph symbolgraph, @@ -49,29 +119,3 @@ ReferredType _parseFunctionReturnType( assert(unparsed.isEmpty, '$returnJson\n\n$returnType\n\n$unparsed\n'); return returnType; } - -List _parseFunctionParams( - Json methodSymbolJson, - ParsedSymbolgraph symbolgraph, -) { - final paramList = methodSymbolJson['functionSignature']['parameters']; - - if (!paramList.exists) return []; - - return paramList - .map( - (param) => Parameter( - name: param['name'].get(), - internalName: param['internalName'].get(), - type: _parseParamType(param, symbolgraph), - ), - ) - .toList(); -} - -ReferredType _parseParamType( - Json paramSymbolJson, - ParsedSymbolgraph symbolgraph, -) => - parseTypeAfterSeparator( - TokenList(paramSymbolJson['declarationFragments']), symbolgraph); diff --git a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_initializer_declaration.dart b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_initializer_declaration.dart index 7f7dabb33..6d5b725a7 100644 --- a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_initializer_declaration.dart +++ b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_initializer_declaration.dart @@ -1,10 +1,8 @@ -import '../../../ast/_core/shared/parameter.dart'; import '../../../ast/declarations/compounds/members/initializer_declaration.dart'; import '../../_core/json.dart'; import '../../_core/parsed_symbolgraph.dart'; -import '../../_core/token_list.dart'; import '../../_core/utils.dart'; -import '../parse_type.dart'; +import 'parse_function_declaration.dart'; InitializerDeclaration parseInitializerDeclaration( Json initializerSymbolJson, @@ -23,7 +21,7 @@ InitializerDeclaration parseInitializerDeclaration( return InitializerDeclaration( id: id, - params: parseInitializerParams(declarationFragments, symbolgraph), + params: parseFunctionParams(declarationFragments, symbolgraph), hasObjCAnnotation: parseSymbolHasObjcAnnotation(initializerSymbolJson), isOverriding: parseIsOverriding(initializerSymbolJson), isFailable: parseIsFailableInit(id, declarationFragments), @@ -32,69 +30,3 @@ InitializerDeclaration parseInitializerDeclaration( bool parseIsFailableInit(String id, Json declarationFragments) => matchFragment(declarationFragments[1], 'text', '?('); - -List parseInitializerParams( - Json declarationFragments, - ParsedSymbolgraph symbolgraph, -) { - // `declarationFragments` describes each part of the initializer declaration, - // things like `init` keyword, brackets, spaces, etc. We only care about the - // parameter fragments here, and they always appear in this order: - // [ - // ..., '(', - // externalParam, ' ', internalParam, ': ', type..., ', ' - // externalParam, ': ', type..., ', ' - // externalParam, ' ', internalParam, ': ', type..., ')' - // ] - // Note: `internalParam` may or may not exist. - // - // The following loop attempts to extract parameters from this flat array - // while making sure the parameter fragments have the expected order. - - final parameters = []; - - var tokens = TokenList(declarationFragments); - final openParen = tokens.indexWhere((tok) => matchFragment(tok, 'text', '(')); - if (openParen != -1) { - tokens = tokens.slice(openParen + 1); - String? consume(String kind) { - if (tokens.isEmpty) return null; - final token = tokens[0]; - tokens = tokens.slice(1); - return getSpellingForKind(token, kind); - } - - final malformedInitializerException = Exception( - 'Malformed initializer at ${declarationFragments.path}', - ); - while (true) { - final externalParam = consume('externalParam'); - if (externalParam == null) throw malformedInitializerException; - - var sep = consume('text'); - String? internalParam; - if (sep == ' ') { - internalParam = consume('internalParam'); - if (internalParam == null) throw malformedInitializerException; - sep = consume('text'); - } - - if (sep != ': ') throw malformedInitializerException; - final (type, remainingTokens) = parseType(symbolgraph, tokens); - tokens = remainingTokens; - - parameters.add(Parameter( - name: externalParam, - internalName: internalParam, - type: type, - )); - - final end = consume('text'); - if (end == ')') break; - if (end != ', ') throw malformedInitializerException; - } - if (!tokens.isEmpty) throw malformedInitializerException; - } - - return parameters; -} diff --git a/pkgs/swift2objc/lib/src/transformer/transformers/transform_function.dart b/pkgs/swift2objc/lib/src/transformer/transformers/transform_function.dart index ad1480a1e..eebfbbc69 100644 --- a/pkgs/swift2objc/lib/src/transformer/transformers/transform_function.dart +++ b/pkgs/swift2objc/lib/src/transformer/transformers/transform_function.dart @@ -112,21 +112,17 @@ MethodDeclaration _transformFunction( return transformedMethod; } -List _generateStatements( - FunctionDeclaration originalFunction, - MethodDeclaration transformedMethod, - UniqueNamer globalNamer, - TransformationMap transformationMap, { - required String Function(String arguments) originalCallGenerator, -}) { - final argumentsList = []; +String generateInvocationParams(UniqueNamer localNamer, + List originalParams, List transformedParams) { + assert(originalParams.length == transformedParams.length); - for (var i = 0; i < originalFunction.params.length; i++) { - final originalParam = originalFunction.params[i]; - final transformedParam = transformedMethod.params[i]; + final argumentsList = []; + for (var i = 0; i < originalParams.length; i++) { + final originalParam = originalParams[i]; + final transformedParam = transformedParams[i]; - final transformedParamName = - transformedParam.internalName ?? transformedParam.name; + final transformedParamName = localNamer + .makeUnique(transformedParam.internalName ?? transformedParam.name); final (unwrappedParamValue, unwrappedType) = maybeUnwrapValue( transformedParam.type, @@ -135,13 +131,23 @@ List _generateStatements( assert(unwrappedType.sameAs(originalParam.type)); - var methodCallArg = '${originalParam.name}: $unwrappedParamValue'; - - argumentsList.add(methodCallArg); + argumentsList.add(originalParam.name == '_' + ? unwrappedParamValue + : '${originalParam.name}: $unwrappedParamValue'); } + return argumentsList.join(', '); +} - final arguments = argumentsList.join(', '); - +List _generateStatements( + FunctionDeclaration originalFunction, + MethodDeclaration transformedMethod, + UniqueNamer globalNamer, + TransformationMap transformationMap, { + required String Function(String arguments) originalCallGenerator, +}) { + final localNamer = UniqueNamer(); + final arguments = generateInvocationParams( + localNamer, originalFunction.params, transformedMethod.params); final originalMethodCall = originalCallGenerator(arguments); if (originalFunction.returnType.sameAs(transformedMethod.returnType)) { @@ -152,11 +158,12 @@ List _generateStatements( throw UnimplementedError('Generic types are not implemented yet'); } - final methodCallStmt = 'let result = $originalMethodCall'; + final resultName = localNamer.makeUnique('result'); + final methodCallStmt = 'let $resultName = $originalMethodCall'; final (wrappedResult, wrapperType) = maybeWrapValue( originalFunction.returnType, - 'result', + resultName, globalNamer, transformationMap, ); diff --git a/pkgs/swift2objc/lib/src/transformer/transformers/transform_initializer.dart b/pkgs/swift2objc/lib/src/transformer/transformers/transform_initializer.dart index 795c65531..08a065bbd 100644 --- a/pkgs/swift2objc/lib/src/transformer/transformers/transform_initializer.dart +++ b/pkgs/swift2objc/lib/src/transformer/transformers/transform_initializer.dart @@ -6,8 +6,8 @@ import '../../ast/_core/shared/parameter.dart'; import '../../ast/declarations/compounds/members/initializer_declaration.dart'; import '../../ast/declarations/compounds/members/property_declaration.dart'; import '../_core/unique_namer.dart'; -import '../_core/utils.dart'; import '../transform.dart'; +import 'transform_function.dart'; import 'transform_referred_type.dart'; InitializerDeclaration transformInitializer( @@ -54,30 +54,9 @@ List _generateInitializerStatements( PropertyDeclaration wrappedClassInstance, InitializerDeclaration transformedInitializer, ) { - final argumentsList = []; final localNamer = UniqueNamer(); - - for (var i = 0; i < originalInitializer.params.length; i++) { - final originalParam = originalInitializer.params[i]; - final transformedParam = transformedInitializer.params[i]; - - final transformedParamName = localNamer - .makeUnique(transformedParam.internalName ?? transformedParam.name); - - final (unwrappedParamValue, unwrappedType) = maybeUnwrapValue( - transformedParam.type, - transformedParamName, - ); - - assert(unwrappedType.sameAs(originalParam.type)); - - var methodCallArg = '${originalParam.name}: $unwrappedParamValue'; - - argumentsList.add(methodCallArg); - } - - final arguments = argumentsList.join(', '); - + final arguments = generateInvocationParams( + localNamer, originalInitializer.params, transformedInitializer.params); final instanceConstruction = '${wrappedClassInstance.type.swiftType}($arguments)'; if (originalInitializer.isFailable) { diff --git a/pkgs/swift2objc/pubspec.yaml b/pkgs/swift2objc/pubspec.yaml index 5b9755140..a0b28fcef 100644 --- a/pkgs/swift2objc/pubspec.yaml +++ b/pkgs/swift2objc/pubspec.yaml @@ -22,5 +22,6 @@ environment: sdk: '>=3.3.0 <4.0.0' dev_dependencies: + args: ^2.6.0 dart_flutter_team_lints: ^2.0.0 test: ^1.21.1 diff --git a/pkgs/swift2objc/test/integration/classes_and_initializers_input.swift b/pkgs/swift2objc/test/integration/classes_and_initializers_input.swift index 46977f5ab..cfe87560f 100644 --- a/pkgs/swift2objc/test/integration/classes_and_initializers_input.swift +++ b/pkgs/swift2objc/test/integration/classes_and_initializers_input.swift @@ -9,6 +9,11 @@ public class MyClass { self.customProperty = customProperty } + public init(label1 name1: Int, label2: Int, _ name3: Int) { + self.representableProperty = name1 + self.customProperty = MyOtherClass() + } + public init?(outerLabel x: Int) { if x == 0 { return nil diff --git a/pkgs/swift2objc/test/integration/classes_and_initializers_output.swift b/pkgs/swift2objc/test/integration/classes_and_initializers_output.swift index 142114857..7387672d9 100644 --- a/pkgs/swift2objc/test/integration/classes_and_initializers_output.swift +++ b/pkgs/swift2objc/test/integration/classes_and_initializers_output.swift @@ -42,5 +42,9 @@ import Foundation } } + @objc init(label1 name1: Int, label2: Int, _ name3: Int) { + wrappedInstance = MyClass(label1: name1, label2: label2, name3) + } + } diff --git a/pkgs/swift2objc/test/integration/classes_and_methods_input.swift b/pkgs/swift2objc/test/integration/classes_and_methods_input.swift index 448d22be2..c238a3546 100644 --- a/pkgs/swift2objc/test/integration/classes_and_methods_input.swift +++ b/pkgs/swift2objc/test/integration/classes_and_methods_input.swift @@ -1,7 +1,7 @@ import Foundation public class MyClass { - public func myMethod(label1 param1: Int, param2: MyOtherClass) -> MyOtherClass { + public func myMethod(label1 param1: Int, param2: MyOtherClass, _ param3: Int) -> MyOtherClass { return MyOtherClass() } diff --git a/pkgs/swift2objc/test/integration/classes_and_methods_output.swift b/pkgs/swift2objc/test/integration/classes_and_methods_output.swift index 283f898ab..e7bb6938d 100644 --- a/pkgs/swift2objc/test/integration/classes_and_methods_output.swift +++ b/pkgs/swift2objc/test/integration/classes_and_methods_output.swift @@ -18,8 +18,8 @@ import Foundation self.wrappedInstance = wrappedInstance } - @objc public func myMethod(label1 param1: Int, param2: MyOtherClassWrapper) -> MyOtherClassWrapper { - let result = wrappedInstance.myMethod(label1: param1, param2: param2.wrappedInstance) + @objc public func myMethod(label1 param1: Int, param2: MyOtherClassWrapper, _ param3: Int) -> MyOtherClassWrapper { + let result = wrappedInstance.myMethod(label1: param1, param2: param2.wrappedInstance, param3) return MyOtherClassWrapper(result) } diff --git a/pkgs/swift2objc/test/integration/integration_test.dart b/pkgs/swift2objc/test/integration/integration_test.dart index e762ce9cb..81b5400b2 100644 --- a/pkgs/swift2objc/test/integration/integration_test.dart +++ b/pkgs/swift2objc/test/integration/integration_test.dart @@ -2,40 +2,57 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// Tests that every *_input.swift in this directory produces *_output.swift. +// Also tests that the generated output compiles without errors. + +// This test is run in the usual way through dart test, but can also be run +// standalone, passing flags to run specific integration tests and to regenerate +// the expected outputs: +// dart test/integration/integration_test.dart --regen +// dart test/integration/integration_test.dart --regen nested_types +// dart test/integration/integration_test.dart nested_types structs_and_methods + import 'dart:io'; +import 'package:args/args.dart'; import 'package:logging/logging.dart'; import 'package:path/path.dart' as path; import 'package:swift2objc/swift2objc.dart'; import 'package:test/test.dart'; -const regenerateExpectedOutputs = false; +void main([List? args]) { + const inputSuffix = '_input.swift'; + const outputSuffix = '_output.swift'; -void main() { - Logger.root.onRecord.listen((record) { - stderr.writeln('${record.level.name}: ${record.message}'); - }); - - group('Integration tests', () { - const inputSuffix = '_input.swift'; - const outputSuffix = '_output.swift'; + final thisDir = path.join(Directory.current.path, 'test/integration'); + final tempDir = path.join(thisDir, 'temp'); - final thisDir = path.join(Directory.current.path, 'test/integration'); - final tempDir = path.join(thisDir, 'temp'); - - final names = []; + var regen = false; + final testNames = []; + if (args != null) { + final p = ArgParser()..addFlag('regen', callback: (value) => regen = value); + testNames.addAll(p.parse(args).rest); + } + if (testNames.isEmpty) { for (final entity in Directory(thisDir).listSync()) { final filename = path.basename(entity.path); if (filename.endsWith(inputSuffix)) { - names.add(filename.substring(0, filename.length - inputSuffix.length)); + testNames + .add(filename.substring(0, filename.length - inputSuffix.length)); } } + } + + Logger.root.onRecord.listen((record) { + stderr.writeln('${record.level.name}: ${record.message}'); + }); - for (final name in names) { + group('Integration tests', () { + for (final name in testNames) { test(name, () async { final inputFile = path.join(thisDir, '$name$inputSuffix'); final expectedOutputFile = path.join(thisDir, '$name$outputSuffix'); - final actualOutputFile = regenerateExpectedOutputs + final actualOutputFile = regen ? expectedOutputFile : path.join(tempDir, '$name$outputSuffix'); diff --git a/pkgs/swift2objc/test/integration/structs_and_initializers_input.swift b/pkgs/swift2objc/test/integration/structs_and_initializers_input.swift index fa505854d..d41f5c364 100644 --- a/pkgs/swift2objc/test/integration/structs_and_initializers_input.swift +++ b/pkgs/swift2objc/test/integration/structs_and_initializers_input.swift @@ -1,14 +1,19 @@ import Foundation public class MyStruct { - let representableProperty: Int - let customProperty: MyOtherStruct + public let representableProperty: Int + public let customProperty: MyOtherStruct public init(outerLabel representableProperty: Int, customProperty: MyOtherStruct) { self.representableProperty = representableProperty self.customProperty = customProperty } + public init(label1 name1: Int, label2: Int, _ name3: Int) { + self.representableProperty = name1 + self.customProperty = MyOtherStruct() + } + public init?(outerLabel x: Int) { if x == 0 { return nil diff --git a/pkgs/swift2objc/test/integration/structs_and_initializers_output.swift b/pkgs/swift2objc/test/integration/structs_and_initializers_output.swift index 72a7109fd..923d83a04 100644 --- a/pkgs/swift2objc/test/integration/structs_and_initializers_output.swift +++ b/pkgs/swift2objc/test/integration/structs_and_initializers_output.swift @@ -14,6 +14,18 @@ import Foundation @objc public class MyStructWrapper: NSObject { var wrappedInstance: MyStruct + @objc public var customProperty: MyOtherStructWrapper { + get { + MyOtherStructWrapper(wrappedInstance.customProperty) + } + } + + @objc public var representableProperty: Int { + get { + wrappedInstance.representableProperty + } + } + init(_ wrappedInstance: MyStruct) { self.wrappedInstance = wrappedInstance } @@ -30,5 +42,9 @@ import Foundation } } + @objc init(label1 name1: Int, label2: Int, _ name3: Int) { + wrappedInstance = MyStruct(label1: name1, label2: label2, name3) + } + } diff --git a/pkgs/swift2objc/test/integration/structs_and_methods_input.swift b/pkgs/swift2objc/test/integration/structs_and_methods_input.swift index 6e756855e..c9e6e178b 100644 --- a/pkgs/swift2objc/test/integration/structs_and_methods_input.swift +++ b/pkgs/swift2objc/test/integration/structs_and_methods_input.swift @@ -1,7 +1,7 @@ import Foundation public struct MyStruct { - public func myMethod(label1 param1: Int, param2: MyOtherStruct) -> MyOtherStruct { + public func myMethod(label1 param1: Int, param2: MyOtherStruct, _ param3: Int) -> MyOtherStruct { return MyOtherStruct() } diff --git a/pkgs/swift2objc/test/integration/structs_and_methods_output.swift b/pkgs/swift2objc/test/integration/structs_and_methods_output.swift index b7a81cab1..c8600c9ee 100644 --- a/pkgs/swift2objc/test/integration/structs_and_methods_output.swift +++ b/pkgs/swift2objc/test/integration/structs_and_methods_output.swift @@ -18,8 +18,8 @@ import Foundation self.wrappedInstance = wrappedInstance } - @objc public func myMethod(label1 param1: Int, param2: MyOtherStructWrapper) -> MyOtherStructWrapper { - let result = wrappedInstance.myMethod(label1: param1, param2: param2.wrappedInstance) + @objc public func myMethod(label1 param1: Int, param2: MyOtherStructWrapper, _ param3: Int) -> MyOtherStructWrapper { + let result = wrappedInstance.myMethod(label1: param1, param2: param2.wrappedInstance, param3) return MyOtherStructWrapper(result) } diff --git a/pkgs/swift2objc/test/unit/parse_initializer_param_test.dart b/pkgs/swift2objc/test/unit/parse_function_param_test.dart similarity index 93% rename from pkgs/swift2objc/test/unit/parse_initializer_param_test.dart rename to pkgs/swift2objc/test/unit/parse_function_param_test.dart index f6d1f9603..e6ca95fed 100644 --- a/pkgs/swift2objc/test/unit/parse_initializer_param_test.dart +++ b/pkgs/swift2objc/test/unit/parse_function_param_test.dart @@ -9,7 +9,7 @@ import 'package:swift2objc/src/ast/_core/shared/referred_type.dart'; import 'package:swift2objc/src/ast/declarations/built_in/built_in_declaration.dart'; import 'package:swift2objc/src/parser/_core/json.dart'; import 'package:swift2objc/src/parser/_core/parsed_symbolgraph.dart'; -import 'package:swift2objc/src/parser/parsers/declaration_parsers/parse_initializer_declaration.dart'; +import 'package:swift2objc/src/parser/parsers/declaration_parsers/parse_function_declaration.dart'; import 'package:test/test.dart'; void main() { @@ -63,7 +63,7 @@ void main() { ''', )); - final outputParams = parseInitializerParams(json, emptySymbolgraph); + final outputParams = parseFunctionParams(json, emptySymbolgraph); final expectedParams = [ Parameter( @@ -118,7 +118,7 @@ void main() { ''', )); - final outputParams = parseInitializerParams(json, emptySymbolgraph); + final outputParams = parseFunctionParams(json, emptySymbolgraph); final expectedParams = [ Parameter( @@ -158,7 +158,7 @@ void main() { ''', )); - final outputParams = parseInitializerParams(json, emptySymbolgraph); + final outputParams = parseFunctionParams(json, emptySymbolgraph); final expectedParams = [ Parameter( @@ -180,7 +180,7 @@ void main() { ''', )); - final outputParams = parseInitializerParams(json, emptySymbolgraph); + final outputParams = parseFunctionParams(json, emptySymbolgraph); expectEqualParams(outputParams, []); }); @@ -206,7 +206,7 @@ void main() { )); expect( - () => parseInitializerParams(json, emptySymbolgraph), + () => parseFunctionParams(json, emptySymbolgraph), throwsA(isA()), ); }); @@ -226,7 +226,7 @@ void main() { )); expect( - () => parseInitializerParams(json, emptySymbolgraph), + () => parseFunctionParams(json, emptySymbolgraph), throwsA(isA()), ); }); @@ -249,7 +249,7 @@ void main() { )); expect( - () => parseInitializerParams(json, emptySymbolgraph), + () => parseFunctionParams(json, emptySymbolgraph), throwsA(isA()), ); });