diff --git a/pkgs/swift2objc/lib/src/ast/_core/shared/referred_type.dart b/pkgs/swift2objc/lib/src/ast/_core/shared/referred_type.dart index 9bbd4080b..af2c1dd50 100644 --- a/pkgs/swift2objc/lib/src/ast/_core/shared/referred_type.dart +++ b/pkgs/swift2objc/lib/src/ast/_core/shared/referred_type.dart @@ -2,6 +2,7 @@ // 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. +import '../interfaces/compound_declaration.dart'; import '../../ast_node.dart'; import '../interfaces/declaration.dart'; import '../interfaces/nestable_declaration.dart'; @@ -76,6 +77,9 @@ class GenericType extends AstNode implements ReferredType { final String name; + /// type constraints the generic type might have + final List> constraints; + @override bool get isObjCRepresentable => false; @@ -84,11 +88,9 @@ class GenericType extends AstNode implements ReferredType { @override bool sameAs(ReferredType other) => other is GenericType && other.id == id; - - const GenericType({ - required this.id, - required this.name, - }); + + const GenericType( + {required this.id, required this.name, this.constraints = const []}); @override String toString() => name; diff --git a/pkgs/swift2objc/lib/src/ast/declarations/built_in/built_in_declaration.dart b/pkgs/swift2objc/lib/src/ast/declarations/built_in/built_in_declaration.dart index cfee5d6a0..226957d1a 100644 --- a/pkgs/swift2objc/lib/src/ast/declarations/built_in/built_in_declaration.dart +++ b/pkgs/swift2objc/lib/src/ast/declarations/built_in/built_in_declaration.dart @@ -7,6 +7,7 @@ import '../../_core/interfaces/objc_annotatable.dart'; import '../../ast_node.dart'; /// Describes a built-in Swift type (e.g Int, String, etc). +/// TODO(https://github.com/dart-lang/native/issues/1827): Include builtin protocols like `Hashable`, `Numeric` class BuiltInDeclaration extends AstNode implements Declaration, ObjCAnnotatable { @override diff --git a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_compound_declaration.dart b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_compound_declaration.dart index cf3e9a27a..8278daf7f 100644 --- a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_compound_declaration.dart +++ b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_compound_declaration.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import '../../../ast/_core/interfaces/compound_declaration.dart'; +import '../../../ast/_core/shared/referred_type.dart'; import '../../../ast/_core/interfaces/nestable_declaration.dart'; import '../../../ast/declarations/compounds/class_declaration.dart'; import '../../../ast/declarations/compounds/members/initializer_declaration.dart'; @@ -12,6 +13,7 @@ import '../../../ast/declarations/compounds/struct_declaration.dart'; import '../../_core/parsed_symbolgraph.dart'; import '../../_core/utils.dart'; import '../parse_declarations.dart'; +import '../utils/parse_generics.dart'; typedef CompoundTearOff = T Function({ required String id, @@ -19,6 +21,7 @@ typedef CompoundTearOff = T Function({ required List properties, required List methods, required List initializers, + required List typeParams, required List nestedDeclarations, }); @@ -37,11 +40,17 @@ T _parseCompoundDeclaration( methods: [], properties: [], initializers: [], + typeParams: [], nestedDeclarations: [], ); compoundSymbol.declaration = compound; + final typeParams = parseTypeParams(compoundSymbol.json, symbolgraph); + compound.typeParams.addAll( + typeParams + ); + final memberDeclarations = compoundRelations .where( (relation) { @@ -77,6 +86,7 @@ T _parseCompoundDeclaration( .whereType() .dedupeBy((m) => m.fullName), ); + compound.nestedDeclarations.addAll( memberDeclarations.whereType(), ); 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 b02ede83f..b761159d5 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 @@ -2,29 +2,36 @@ // 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. +import '../../../ast/_core/interfaces/compound_declaration.dart'; +import '../../../ast/_core/interfaces/declaration.dart'; import '../../../ast/_core/shared/parameter.dart'; import '../../../ast/_core/shared/referred_type.dart'; import '../../../ast/declarations/compounds/members/method_declaration.dart'; import '../../../ast/declarations/globals/globals.dart'; import '../../_core/json.dart'; import '../../_core/parsed_symbolgraph.dart'; -import '../../_core/token_list.dart'; import '../../_core/utils.dart'; +import '../parse_declarations.dart'; +import '../utils/parse_generics.dart'; +import '../../_core/token_list.dart'; import '../parse_type.dart'; GlobalFunctionDeclaration parseGlobalFunctionDeclaration( Json globalFunctionSymbolJson, ParsedSymbolgraph symbolgraph, ) { - final info = parseFunctionInfo( - globalFunctionSymbolJson['declarationFragments'], symbolgraph); +// final info = parseFunctionInfo( +// globalFunctionSymbolJson['declarationFragments'], symbolgraph); return GlobalFunctionDeclaration( id: parseSymbolId(globalFunctionSymbolJson), name: parseSymbolName(globalFunctionSymbolJson), returnType: _parseFunctionReturnType(globalFunctionSymbolJson, symbolgraph), - params: info.params, - throws: info.throws, - async: info.async, + // params: info.params, + // throws: info.throws, + // async: info.async, + params: _parseFunctionParams(globalFunctionSymbolJson, symbolgraph), + typeParams: + parseTypeParams(globalFunctionSymbolJson, symbolgraph) ); } @@ -33,18 +40,118 @@ MethodDeclaration parseMethodDeclaration( ParsedSymbolgraph symbolgraph, { bool isStatic = false, }) { - final info = - parseFunctionInfo(methodSymbolJson['declarationFragments'], symbolgraph); +// final info = +// parseFunctionInfo(methodSymbolJson['declarationFragments'], symbolgraph); return MethodDeclaration( - id: parseSymbolId(methodSymbolJson), - name: parseSymbolName(methodSymbolJson), - returnType: _parseFunctionReturnType(methodSymbolJson, symbolgraph), - params: info.params, - hasObjCAnnotation: parseSymbolHasObjcAnnotation(methodSymbolJson), - isStatic: isStatic, - throws: info.throws, - async: info.async, - mutating: info.mutating); + id: parseSymbolId(methodSymbolJson), + name: parseSymbolName(methodSymbolJson), + returnType: _parseFunctionReturnType(methodSymbolJson, symbolgraph), + params: _parseFunctionParams(methodSymbolJson, symbolgraph), + hasObjCAnnotation: parseSymbolHasObjcAnnotation(methodSymbolJson), + typeParams: parseTypeParams(methodSymbolJson, symbolgraph), + isStatic: isStatic, +// params: info.params, +// throws: info.throws, +// async: info.async, +// mutating: info.mutating + ); +} + +ReferredType _parseFunctionReturnType( + Json methodSymbolJson, + ParsedSymbolgraph symbolgraph, +) { + final returnJson = methodSymbolJson['functionSignature']['returns'][0]; + + // if it is a type generic it may not even have a spelling + if (returnJson['spelling'].get() == null) { + // check if the item is a generic registered + try { + final type = returnJson['spelling'].get(); + final generics = methodSymbolJson['swiftGenerics']['parameters']; + if (generics.map((e) => e['name'].get()).contains(type)) { + // generic located + return parseDeclGenericType(methodSymbolJson['swiftGenerics'], type, + symbolgraph, methodSymbolJson); + } + } on Exception catch (e) { + // continue + } + } else if (returnJson['spelling'].get() == '()') { + // This means there's no return type + return null; + } + +// final returnTypeId = returnJson['preciseIdentifier'].get(); + +// final returnTypeSymbol = symbolgraph.symbols[returnTypeId]; + +// if (returnTypeSymbol == null) { +// throw Exception( +// 'The method at path "${methodSymbolJson.path}" has a return type that ' +// 'does not exist among parsed symbols.', +// ); +// } + +// final returnTypeDeclaration = parseDeclaration( +// returnTypeSymbol, +// symbolgraph, +// ); + +// return returnTypeDeclaration.asDeclaredType; + final returnJson = + TokenList(methodSymbolJson['functionSignature']['returns']); + final (returnType, unparsed) = parseType(symbolgraph, returnJson); + 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( + // TODO: Add parameter type generic parsing + (param) => Parameter( + name: param['name'].get(), + internalName: param['internalName'].get(), + type: _parseParamType(param, symbolgraph, methodSymbolJson: methodSymbolJson), + ), + ) + .toList(); +} + +ReferredType _parseParamType( + Json paramSymbolJson, + ParsedSymbolgraph symbolgraph, + {Json? methodSymbolJson} +) { + final fragments = paramSymbolJson['declarationFragments']; + + var typeDeclFragment = fragments + .firstJsonWhereKey('kind', 'typeIdentifier'); + + if (methodSymbolJson != null) { + if (methodSymbolJson['swiftGenerics'].get?>() != null) { + if (methodSymbolJson['swiftGenerics']['parameters'].map( + (e) => e['name'].get() + ).contains(typeDeclFragment['spelling'].get())) { + return parseDeclGenericType(methodSymbolJson['swiftGenerics'], + typeDeclFragment['spelling'].get(), symbolgraph, + methodSymbolJson); + } + } + } + + final paramTypeId = typeDeclFragment['preciseIdentifier'] + .get(); + + return parseTypeFromId(paramTypeId, symbolgraph); } typedef ParsedFunctionInfo = ({ @@ -162,14 +269,3 @@ ParsedFunctionInfo parseFunctionInfo( mutating: prefixAnnotations.contains('mutating') ); } - -ReferredType _parseFunctionReturnType( - Json methodSymbolJson, - ParsedSymbolgraph symbolgraph, -) { - final returnJson = - TokenList(methodSymbolJson['functionSignature']['returns']); - final (returnType, unparsed) = parseType(symbolgraph, returnJson); - assert(unparsed.isEmpty, '$returnJson\n\n$returnType\n\n$unparsed\n'); - return returnType; -} diff --git a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_variable_declaration.dart b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_variable_declaration.dart index 23a3fee39..3dd0a902e 100644 --- a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_variable_declaration.dart +++ b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_variable_declaration.dart @@ -10,6 +10,7 @@ import '../../_core/parsed_symbolgraph.dart'; import '../../_core/token_list.dart'; import '../../_core/utils.dart'; +/// TODO: Support for generic types: Requires larger scope PropertyDeclaration parsePropertyDeclaration( Json propertySymbolJson, ParsedSymbolgraph symbolgraph, { diff --git a/pkgs/swift2objc/lib/src/parser/parsers/parse_declarations.dart b/pkgs/swift2objc/lib/src/parser/parsers/parse_declarations.dart index af3f8e443..e875d6859 100644 --- a/pkgs/swift2objc/lib/src/parser/parsers/parse_declarations.dart +++ b/pkgs/swift2objc/lib/src/parser/parsers/parse_declarations.dart @@ -42,6 +42,7 @@ Declaration parseDeclaration( final symbolType = symbolJson['kind']['identifier'].get(); + // TODO(https://github.com/dart-lang/native/issues/1828): Support protocols parsedSymbol.declaration = switch (symbolType) { 'swift.class' => parseClassDeclaration(parsedSymbol, symbolgraph), 'swift.struct' => parseStructDeclaration(parsedSymbol, symbolgraph), diff --git a/pkgs/swift2objc/lib/src/parser/parsers/utils/parse_generics.dart b/pkgs/swift2objc/lib/src/parser/parsers/utils/parse_generics.dart new file mode 100644 index 000000000..2b2ce7695 --- /dev/null +++ b/pkgs/swift2objc/lib/src/parser/parsers/utils/parse_generics.dart @@ -0,0 +1,60 @@ +import '../../../ast/_core/interfaces/compound_declaration.dart'; +import '../../../ast/_core/interfaces/declaration.dart'; +import '../../../ast/_core/shared/referred_type.dart'; +import '../../_core/json.dart'; +import '../../_core/parsed_symbolgraph.dart'; +import '../parse_declarations.dart'; + + +List parseTypeParams( + Json declarationSymbolJson, + ParsedSymbolgraph symbolgraph, +) { + // get type params + final genericInfo = declarationSymbolJson['swiftGenerics']; + + final parameters = genericInfo['parameters']; + + if (genericInfo.jsonWithKeyExists('constraints')) { + return parameters.map((e) { + return parseDeclGenericType(genericInfo, e['name'].get(), + symbolgraph, declarationSymbolJson); + }).toList(); + } else { + // how to make a good id for generic types + return parameters + .map((e) => GenericType( + id: e['name'].get(), name: e['name'].get())) + .toList(); + } +} + +GenericType parseDeclGenericType(Json genericInfo, String name, + ParsedSymbolgraph symbolgraph, + Json declSymbolJson, {String? id}) { + final constraintsDesc = genericInfo['constraints'].where( + (element) => element['lhs'].get() == name); + + return GenericType( + id: id ?? name, + name: name, + constraints: constraintsDesc.map((c) { + final constraintId = c['rhsPrecise'].get(); + + final constraintTypeSymbol = symbolgraph.symbols[constraintId]; + + if (constraintTypeSymbol == null) { + throw Exception( + 'The type constraint at path "${declSymbolJson.path}"' + ' has a return type that does not exist among parsed symbols.', + ); + } + + final constraintDeclaration = parseDeclaration( + constraintTypeSymbol, + symbolgraph, + ) as CompoundDeclaration; + + return constraintDeclaration.asDeclaredType; + }).toList()); +} diff --git a/pkgs/swift2objc/test/unit/parse_type_generics_test.dart b/pkgs/swift2objc/test/unit/parse_type_generics_test.dart new file mode 100644 index 000000000..01aa006cd --- /dev/null +++ b/pkgs/swift2objc/test/unit/parse_type_generics_test.dart @@ -0,0 +1,55 @@ +import 'package:path/path.dart' as p; +import 'package:swift2objc/src/ast/_core/interfaces/compound_declaration.dart'; +import 'package:swift2objc/src/ast/_core/interfaces/function_declaration.dart'; +import 'package:swift2objc/src/ast/declarations/compounds/class_declaration.dart'; +import 'package:swift2objc/src/parser/_core/parsed_symbolgraph.dart'; +import 'package:swift2objc/src/parser/_core/utils.dart'; +import 'package:swift2objc/src/parser/parsers/parse_declarations.dart'; +import 'package:swift2objc/src/parser/parsers/parse_relations_map.dart'; +import 'package:swift2objc/src/parser/parsers/parse_symbols_map.dart'; +import 'package:test/test.dart'; + +void main() { + + group('General Test: Functions', () { + final inputFile = p.join(p.current, 'test', 'unit', 'type_generics', + 'funcs.symbols.json'); + final inputJson = readJsonFile(inputFile); + final symbolgraph = ParsedSymbolgraph( + parseSymbolsMap(inputJson), + parseRelationsMap(inputJson), + ); + final declarations = parseDeclarations(symbolgraph); + final functionDeclarations = declarations.whereType(); + + test('Basic Type Generics', () { + final firstTestDecl = functionDeclarations.firstWhere((d) => d.name == 'basicFunc'); + final secondTestDecl = functionDeclarations.firstWhere((d) => d.name == 'basicGenericFunc'); + + assert(firstTestDecl.typeParams.isEmpty); + assert(secondTestDecl.typeParams.isNotEmpty); + }); + }); + + + group('General Test: Compounds', () { + final inputFile = p.join(p.current, 'test', 'unit', 'type_generics', + 'compound.symbols.json'); + final inputJson = readJsonFile(inputFile); + final symbolgraph = ParsedSymbolgraph( + parseSymbolsMap(inputJson), + parseRelationsMap(inputJson), + ); + print(symbolgraph.symbols.values.map((m) => parseDeclaration(m, symbolgraph))); + final declarations = parseDeclarations(symbolgraph); + final compoundDeclarations = declarations.whereType(); + + test('Classes', () { + final classDeclarations = compoundDeclarations + .whereType(); + + final firstTest = classDeclarations.firstWhere((d) => d.name == 'A'); + assert(firstTest.typeParams.first.name == 'T'); + }); + }); +} \ No newline at end of file diff --git a/pkgs/swift2objc/test/unit/type_generics/compound.symbols.json b/pkgs/swift2objc/test/unit/type_generics/compound.symbols.json new file mode 100644 index 000000000..11cee9a7a --- /dev/null +++ b/pkgs/swift2objc/test/unit/type_generics/compound.symbols.json @@ -0,0 +1,1511 @@ +{ + "metadata": { + "formatVersion": { + "major": 0, + "minor": 6, + "patch": 0 + }, + "generator": "Apple Swift version 6.0.3 (swiftlang-6.0.3.1.10 clang-1600.0.30.1)" + }, + "module": { + "name": "funcs_symbolgraph_module", + "platform": { + "architecture": "arm64", + "vendor": "apple", + "operatingSystem": { + "name": "macosx", + "minimumVersion": { + "major": 15, + "minor": 0 + } + } + } + }, + "symbols": [ + { + "kind": { + "identifier": "swift.property", + "displayName": "Instance Property" + }, + "identifier": { + "precise": "s:24funcs_symbolgraph_module1CC1bxvp", + "interfaceLanguage": "swift" + }, + "pathComponents": [ + "C", + "b" + ], + "names": { + "title": "b", + "subHeading": [ + { + "kind": "keyword", + "spelling": "var" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "b" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "T", + "preciseIdentifier": "s:24funcs_symbolgraph_module1CC1Txmfp" + } + ] + }, + "declarationFragments": [ + { + "kind": "keyword", + "spelling": "var" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "b" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "T", + "preciseIdentifier": "s:24funcs_symbolgraph_module1CC1Txmfp" + } + ], + "accessLevel": "public", + "location": { + "uri": "file://funcs.swift", + "position": { + "line": 10, + "character": 15 + } + } + }, + { + "kind": { + "identifier": "swift.struct", + "displayName": "Structure" + }, + "identifier": { + "precise": "s:24funcs_symbolgraph_module1EV", + "interfaceLanguage": "swift" + }, + "pathComponents": [ + "E" + ], + "names": { + "title": "E", + "navigator": [ + { + "kind": "identifier", + "spelling": "E" + } + ], + "subHeading": [ + { + "kind": "keyword", + "spelling": "struct" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "E" + } + ] + }, + "swiftGenerics": { + "parameters": [ + { + "name": "U", + "index": 0, + "depth": 0 + } + ] + }, + "declarationFragments": [ + { + "kind": "keyword", + "spelling": "struct" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "E" + }, + { + "kind": "text", + "spelling": "<" + }, + { + "kind": "genericParameter", + "spelling": "U" + }, + { + "kind": "text", + "spelling": ">" + } + ], + "accessLevel": "public", + "location": { + "uri": "file://funcs.swift", + "position": { + "line": 21, + "character": 14 + } + } + }, + { + "kind": { + "identifier": "swift.class", + "displayName": "Class" + }, + "identifier": { + "precise": "s:24funcs_symbolgraph_module1CC", + "interfaceLanguage": "swift" + }, + "pathComponents": [ + "C" + ], + "names": { + "title": "C", + "navigator": [ + { + "kind": "identifier", + "spelling": "C" + } + ], + "subHeading": [ + { + "kind": "keyword", + "spelling": "class" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "C" + } + ] + }, + "swiftGenerics": { + "parameters": [ + { + "name": "T", + "index": 0, + "depth": 0 + } + ], + "constraints": [ + { + "kind": "conformance", + "lhs": "T", + "rhs": "Hashable", + "rhsPrecise": "s:SH" + } + ] + }, + "declarationFragments": [ + { + "kind": "keyword", + "spelling": "class" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "C" + }, + { + "kind": "text", + "spelling": "<" + }, + { + "kind": "genericParameter", + "spelling": "T" + }, + { + "kind": "text", + "spelling": "> " + }, + { + "kind": "keyword", + "spelling": "where" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "typeIdentifier", + "spelling": "T" + }, + { + "kind": "text", + "spelling": " : " + }, + { + "kind": "typeIdentifier", + "spelling": "Hashable", + "preciseIdentifier": "s:SH" + } + ], + "accessLevel": "public", + "location": { + "uri": "file://funcs.swift", + "position": { + "line": 8, + "character": 13 + } + } + }, + { + "kind": { + "identifier": "swift.method", + "displayName": "Instance Method" + }, + "identifier": { + "precise": "s:24funcs_symbolgraph_module1EV1e1m1nyx_qd__tlF", + "interfaceLanguage": "swift" + }, + "pathComponents": [ + "E", + "e(m:n:)" + ], + "names": { + "title": "e(m:n:)", + "subHeading": [ + { + "kind": "keyword", + "spelling": "func" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "e" + }, + { + "kind": "text", + "spelling": "<" + }, + { + "kind": "genericParameter", + "spelling": "V" + }, + { + "kind": "text", + "spelling": ">(" + }, + { + "kind": "externalParam", + "spelling": "m" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "U", + "preciseIdentifier": "s:24funcs_symbolgraph_module1EV1Uxmfp" + }, + { + "kind": "text", + "spelling": ", " + }, + { + "kind": "externalParam", + "spelling": "n" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "V", + "preciseIdentifier": "s:24funcs_symbolgraph_module1EV1e1m1nyx_qd__tlF1VL_qd__mfp" + }, + { + "kind": "text", + "spelling": ")" + } + ] + }, + "functionSignature": { + "parameters": [ + { + "name": "m", + "declarationFragments": [ + { + "kind": "identifier", + "spelling": "m" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "U", + "preciseIdentifier": "s:24funcs_symbolgraph_module1EV1Uxmfp" + } + ] + }, + { + "name": "n", + "declarationFragments": [ + { + "kind": "identifier", + "spelling": "n" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "V", + "preciseIdentifier": "s:24funcs_symbolgraph_module1EV1e1m1nyx_qd__tlF1VL_qd__mfp" + } + ] + } + ], + "returns": [ + { + "kind": "text", + "spelling": "()" + } + ] + }, + "swiftGenerics": { + "parameters": [ + { + "name": "U", + "index": 0, + "depth": 0 + }, + { + "name": "V", + "index": 0, + "depth": 1 + } + ] + }, + "declarationFragments": [ + { + "kind": "keyword", + "spelling": "func" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "e" + }, + { + "kind": "text", + "spelling": "<" + }, + { + "kind": "genericParameter", + "spelling": "V" + }, + { + "kind": "text", + "spelling": ">(" + }, + { + "kind": "externalParam", + "spelling": "m" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "U", + "preciseIdentifier": "s:24funcs_symbolgraph_module1EV1Uxmfp" + }, + { + "kind": "text", + "spelling": ", " + }, + { + "kind": "externalParam", + "spelling": "n" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "V", + "preciseIdentifier": "s:24funcs_symbolgraph_module1EV1e1m1nyx_qd__tlF1VL_qd__mfp" + }, + { + "kind": "text", + "spelling": ")" + } + ], + "accessLevel": "public", + "location": { + "uri": "file://funcs.swift", + "position": { + "line": 22, + "character": 16 + } + } + }, + { + "kind": { + "identifier": "swift.method", + "displayName": "Instance Method" + }, + "identifier": { + "precise": "s:24funcs_symbolgraph_module1CC1a1myx_tF", + "interfaceLanguage": "swift" + }, + "pathComponents": [ + "C", + "a(m:)" + ], + "names": { + "title": "a(m:)", + "subHeading": [ + { + "kind": "keyword", + "spelling": "func" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "a" + }, + { + "kind": "text", + "spelling": "(" + }, + { + "kind": "externalParam", + "spelling": "m" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "T", + "preciseIdentifier": "s:24funcs_symbolgraph_module1CC1Txmfp" + }, + { + "kind": "text", + "spelling": ")" + } + ] + }, + "functionSignature": { + "parameters": [ + { + "name": "m", + "declarationFragments": [ + { + "kind": "identifier", + "spelling": "m" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "T", + "preciseIdentifier": "s:24funcs_symbolgraph_module1CC1Txmfp" + } + ] + } + ], + "returns": [ + { + "kind": "text", + "spelling": "()" + } + ] + }, + "swiftGenerics": { + "parameters": [ + { + "name": "T", + "index": 0, + "depth": 0 + } + ], + "constraints": [ + { + "kind": "conformance", + "lhs": "T", + "rhs": "Hashable", + "rhsPrecise": "s:SH" + } + ] + }, + "declarationFragments": [ + { + "kind": "keyword", + "spelling": "func" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "a" + }, + { + "kind": "text", + "spelling": "(" + }, + { + "kind": "externalParam", + "spelling": "m" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "T", + "preciseIdentifier": "s:24funcs_symbolgraph_module1CC1Txmfp" + }, + { + "kind": "text", + "spelling": ")" + } + ], + "accessLevel": "public", + "location": { + "uri": "file://funcs.swift", + "position": { + "line": 9, + "character": 16 + } + } + }, + { + "kind": { + "identifier": "swift.init", + "displayName": "Initializer" + }, + "identifier": { + "precise": "s:24funcs_symbolgraph_module1CC1bACyxGx_tcfc", + "interfaceLanguage": "swift" + }, + "pathComponents": [ + "C", + "init(b:)" + ], + "names": { + "title": "init(b:)", + "subHeading": [ + { + "kind": "keyword", + "spelling": "init" + }, + { + "kind": "text", + "spelling": "(" + }, + { + "kind": "externalParam", + "spelling": "b" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "T", + "preciseIdentifier": "s:24funcs_symbolgraph_module1CC1Txmfp" + }, + { + "kind": "text", + "spelling": ")" + } + ] + }, + "functionSignature": { + "parameters": [ + { + "name": "b", + "declarationFragments": [ + { + "kind": "identifier", + "spelling": "b" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "T", + "preciseIdentifier": "s:24funcs_symbolgraph_module1CC1Txmfp" + } + ] + } + ] + }, + "swiftGenerics": { + "parameters": [ + { + "name": "T", + "index": 0, + "depth": 0 + } + ], + "constraints": [ + { + "kind": "conformance", + "lhs": "T", + "rhs": "Hashable", + "rhsPrecise": "s:SH" + } + ] + }, + "declarationFragments": [ + { + "kind": "keyword", + "spelling": "init" + }, + { + "kind": "text", + "spelling": "(" + }, + { + "kind": "externalParam", + "spelling": "b" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "T", + "preciseIdentifier": "s:24funcs_symbolgraph_module1CC1Txmfp" + }, + { + "kind": "text", + "spelling": ")" + } + ], + "accessLevel": "public", + "location": { + "uri": "file://funcs.swift", + "position": { + "line": 12, + "character": 11 + } + } + }, + { + "kind": { + "identifier": "swift.class", + "displayName": "Class" + }, + "identifier": { + "precise": "s:24funcs_symbolgraph_module1AC", + "interfaceLanguage": "swift" + }, + "pathComponents": [ + "A" + ], + "names": { + "title": "A", + "navigator": [ + { + "kind": "identifier", + "spelling": "A" + } + ], + "subHeading": [ + { + "kind": "keyword", + "spelling": "class" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "A" + } + ] + }, + "swiftGenerics": { + "parameters": [ + { + "name": "T", + "index": 0, + "depth": 0 + } + ] + }, + "declarationFragments": [ + { + "kind": "keyword", + "spelling": "class" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "A" + }, + { + "kind": "text", + "spelling": "<" + }, + { + "kind": "genericParameter", + "spelling": "T" + }, + { + "kind": "text", + "spelling": ">" + } + ], + "accessLevel": "public", + "location": { + "uri": "file://funcs.swift", + "position": { + "line": 0, + "character": 13 + } + } + }, + { + "kind": { + "identifier": "swift.method", + "displayName": "Instance Method" + }, + "identifier": { + "precise": "s:24funcs_symbolgraph_module1DCAASjRzSjR_rlE1e1m1n1oyx_q_qd__tSlRd__lF", + "interfaceLanguage": "swift" + }, + "pathComponents": [ + "D", + "e(m:n:o:)" + ], + "names": { + "title": "e(m:n:o:)", + "subHeading": [ + { + "kind": "keyword", + "spelling": "func" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "e" + }, + { + "kind": "text", + "spelling": "<" + }, + { + "kind": "genericParameter", + "spelling": "V" + }, + { + "kind": "text", + "spelling": ">(" + }, + { + "kind": "externalParam", + "spelling": "m" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "T", + "preciseIdentifier": "s:24funcs_symbolgraph_module1DCAASjRzSjR_rlE1Txmfp" + }, + { + "kind": "text", + "spelling": ", " + }, + { + "kind": "externalParam", + "spelling": "n" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "U", + "preciseIdentifier": "s:24funcs_symbolgraph_module1DCAASjRzSjR_rlE1Uq_mfp" + }, + { + "kind": "text", + "spelling": ", " + }, + { + "kind": "externalParam", + "spelling": "o" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "V", + "preciseIdentifier": "s:24funcs_symbolgraph_module1DCAASjRzSjR_rlE1e1m1n1oyx_q_qd__tSlRd__lF1VL_qd__mfp" + }, + { + "kind": "text", + "spelling": ")" + } + ] + }, + "functionSignature": { + "parameters": [ + { + "name": "m", + "declarationFragments": [ + { + "kind": "identifier", + "spelling": "m" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "T", + "preciseIdentifier": "s:24funcs_symbolgraph_module1DCAASjRzSjR_rlE1Txmfp" + } + ] + }, + { + "name": "n", + "declarationFragments": [ + { + "kind": "identifier", + "spelling": "n" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "U", + "preciseIdentifier": "s:24funcs_symbolgraph_module1DCAASjRzSjR_rlE1Uq_mfp" + } + ] + }, + { + "name": "o", + "declarationFragments": [ + { + "kind": "identifier", + "spelling": "o" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "V", + "preciseIdentifier": "s:24funcs_symbolgraph_module1DCAASjRzSjR_rlE1e1m1n1oyx_q_qd__tSlRd__lF1VL_qd__mfp" + } + ] + } + ], + "returns": [ + { + "kind": "text", + "spelling": "()" + } + ] + }, + "swiftGenerics": { + "parameters": [ + { + "name": "T", + "index": 0, + "depth": 0 + }, + { + "name": "U", + "index": 1, + "depth": 0 + }, + { + "name": "V", + "index": 0, + "depth": 1 + } + ], + "constraints": [ + { + "kind": "conformance", + "lhs": "T", + "rhs": "Numeric", + "rhsPrecise": "s:Sj" + }, + { + "kind": "conformance", + "lhs": "U", + "rhs": "Numeric", + "rhsPrecise": "s:Sj" + }, + { + "kind": "conformance", + "lhs": "V", + "rhs": "Collection", + "rhsPrecise": "s:Sl" + } + ] + }, + "swiftExtension": { + "extendedModule": "funcs_symbolgraph_module", + "typeKind": "swift.class", + "constraints": [ + { + "kind": "conformance", + "lhs": "T", + "rhs": "Numeric", + "rhsPrecise": "s:Sj" + }, + { + "kind": "conformance", + "lhs": "U", + "rhs": "Numeric", + "rhsPrecise": "s:Sj" + } + ] + }, + "declarationFragments": [ + { + "kind": "keyword", + "spelling": "func" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "e" + }, + { + "kind": "text", + "spelling": "<" + }, + { + "kind": "genericParameter", + "spelling": "V" + }, + { + "kind": "text", + "spelling": ">(" + }, + { + "kind": "externalParam", + "spelling": "m" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "T", + "preciseIdentifier": "s:24funcs_symbolgraph_module1DCAASjRzSjR_rlE1Txmfp" + }, + { + "kind": "text", + "spelling": ", " + }, + { + "kind": "externalParam", + "spelling": "n" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "U", + "preciseIdentifier": "s:24funcs_symbolgraph_module1DCAASjRzSjR_rlE1Uq_mfp" + }, + { + "kind": "text", + "spelling": ", " + }, + { + "kind": "externalParam", + "spelling": "o" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "V", + "preciseIdentifier": "s:24funcs_symbolgraph_module1DCAASjRzSjR_rlE1e1m1n1oyx_q_qd__tSlRd__lF1VL_qd__mfp" + }, + { + "kind": "text", + "spelling": ") " + }, + { + "kind": "keyword", + "spelling": "where" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "typeIdentifier", + "spelling": "V" + }, + { + "kind": "text", + "spelling": " : " + }, + { + "kind": "typeIdentifier", + "spelling": "Collection", + "preciseIdentifier": "s:Sl" + } + ], + "accessLevel": "public", + "location": { + "uri": "file://funcs.swift", + "position": { + "line": 30, + "character": 9 + } + } + }, + { + "kind": { + "identifier": "swift.class", + "displayName": "Class" + }, + "identifier": { + "precise": "s:24funcs_symbolgraph_module1DC", + "interfaceLanguage": "swift" + }, + "pathComponents": [ + "D" + ], + "names": { + "title": "D", + "navigator": [ + { + "kind": "identifier", + "spelling": "D" + } + ], + "subHeading": [ + { + "kind": "keyword", + "spelling": "class" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "D" + } + ] + }, + "swiftGenerics": { + "parameters": [ + { + "name": "T", + "index": 0, + "depth": 0 + }, + { + "name": "U", + "index": 1, + "depth": 0 + } + ] + }, + "declarationFragments": [ + { + "kind": "keyword", + "spelling": "class" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "D" + }, + { + "kind": "text", + "spelling": "<" + }, + { + "kind": "genericParameter", + "spelling": "T" + }, + { + "kind": "text", + "spelling": ", " + }, + { + "kind": "genericParameter", + "spelling": "U" + }, + { + "kind": "text", + "spelling": ">" + } + ], + "accessLevel": "public", + "location": { + "uri": "file://funcs.swift", + "position": { + "line": 17, + "character": 13 + } + } + }, + { + "kind": { + "identifier": "swift.method", + "displayName": "Instance Method" + }, + "identifier": { + "precise": "s:24funcs_symbolgraph_module1AC1a1myx_tF", + "interfaceLanguage": "swift" + }, + "pathComponents": [ + "A", + "a(m:)" + ], + "names": { + "title": "a(m:)", + "subHeading": [ + { + "kind": "keyword", + "spelling": "func" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "a" + }, + { + "kind": "text", + "spelling": "(" + }, + { + "kind": "externalParam", + "spelling": "m" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "T", + "preciseIdentifier": "s:24funcs_symbolgraph_module1AC1Txmfp" + }, + { + "kind": "text", + "spelling": ")" + } + ] + }, + "functionSignature": { + "parameters": [ + { + "name": "m", + "declarationFragments": [ + { + "kind": "identifier", + "spelling": "m" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "T", + "preciseIdentifier": "s:24funcs_symbolgraph_module1AC1Txmfp" + } + ] + } + ], + "returns": [ + { + "kind": "text", + "spelling": "()" + } + ] + }, + "swiftGenerics": { + "parameters": [ + { + "name": "T", + "index": 0, + "depth": 0 + } + ] + }, + "declarationFragments": [ + { + "kind": "keyword", + "spelling": "func" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "a" + }, + { + "kind": "text", + "spelling": "(" + }, + { + "kind": "externalParam", + "spelling": "m" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "T", + "preciseIdentifier": "s:24funcs_symbolgraph_module1AC1Txmfp" + }, + { + "kind": "text", + "spelling": ")" + } + ], + "accessLevel": "public", + "location": { + "uri": "file://funcs.swift", + "position": { + "line": 1, + "character": 16 + } + } + }, + { + "kind": { + "identifier": "swift.struct", + "displayName": "Structure" + }, + "identifier": { + "precise": "s:24funcs_symbolgraph_module1BV", + "interfaceLanguage": "swift" + }, + "pathComponents": [ + "B" + ], + "names": { + "title": "B", + "navigator": [ + { + "kind": "identifier", + "spelling": "B" + } + ], + "subHeading": [ + { + "kind": "keyword", + "spelling": "struct" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "B" + } + ] + }, + "swiftGenerics": { + "parameters": [ + { + "name": "T", + "index": 0, + "depth": 0 + } + ], + "constraints": [ + { + "kind": "conformance", + "lhs": "T", + "rhs": "Hashable", + "rhsPrecise": "s:SH" + } + ] + }, + "declarationFragments": [ + { + "kind": "keyword", + "spelling": "struct" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "B" + }, + { + "kind": "text", + "spelling": "<" + }, + { + "kind": "genericParameter", + "spelling": "T" + }, + { + "kind": "text", + "spelling": "> " + }, + { + "kind": "keyword", + "spelling": "where" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "typeIdentifier", + "spelling": "T" + }, + { + "kind": "text", + "spelling": " : " + }, + { + "kind": "typeIdentifier", + "spelling": "Hashable", + "preciseIdentifier": "s:SH" + } + ], + "accessLevel": "public", + "location": { + "uri": "file://funcs.swift", + "position": { + "line": 4, + "character": 14 + } + } + } + ], + "relationships": [ + { + "kind": "memberOf", + "source": "s:24funcs_symbolgraph_module1CC1a1myx_tF", + "target": "s:24funcs_symbolgraph_module1CC" + }, + { + "kind": "memberOf", + "source": "s:24funcs_symbolgraph_module1CC1bACyxGx_tcfc", + "target": "s:24funcs_symbolgraph_module1CC" + }, + { + "kind": "memberOf", + "source": "s:24funcs_symbolgraph_module1DCAASjRzSjR_rlE1e1m1n1oyx_q_qd__tSlRd__lF", + "target": "s:24funcs_symbolgraph_module1DC" + }, + { + "kind": "memberOf", + "source": "s:24funcs_symbolgraph_module1AC1a1myx_tF", + "target": "s:24funcs_symbolgraph_module1AC" + }, + { + "kind": "memberOf", + "source": "s:24funcs_symbolgraph_module1EV1e1m1nyx_qd__tlF", + "target": "s:24funcs_symbolgraph_module1EV" + }, + { + "kind": "memberOf", + "source": "s:24funcs_symbolgraph_module1CC1bxvp", + "target": "s:24funcs_symbolgraph_module1CC" + } + ] +} \ No newline at end of file diff --git a/pkgs/swift2objc/test/unit/type_generics/funcs.symbols.json b/pkgs/swift2objc/test/unit/type_generics/funcs.symbols.json new file mode 100644 index 000000000..c48d8553e --- /dev/null +++ b/pkgs/swift2objc/test/unit/type_generics/funcs.symbols.json @@ -0,0 +1,1212 @@ +{ + "metadata": { + "formatVersion": { + "major": 0, + "minor": 6, + "patch": 0 + }, + "generator": "Apple Swift version 6.0.3 (swiftlang-6.0.3.1.10 clang-1600.0.30.1)" + }, + "module": { + "name": "primitive_symbolgraph_module", + "platform": { + "architecture": "arm64", + "vendor": "apple", + "operatingSystem": { + "name": "macosx", + "minimumVersion": { + "major": 15, + "minor": 0 + } + } + } + }, + "symbols": [ + { + "kind": { + "identifier": "swift.protocol", + "displayName": "Protocol" + }, + "identifier": { + "precise": "s:28primitive_symbolgraph_module1AP", + "interfaceLanguage": "swift" + }, + "pathComponents": [ + "A" + ], + "names": { + "title": "A", + "navigator": [ + { + "kind": "identifier", + "spelling": "A" + } + ], + "subHeading": [ + { + "kind": "keyword", + "spelling": "protocol" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "A" + } + ] + }, + "declarationFragments": [ + { + "kind": "keyword", + "spelling": "protocol" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "A" + } + ], + "accessLevel": "public", + "location": { + "uri": "file://types.swift", + "position": { + "line": 0, + "character": 16 + } + } + }, + { + "kind": { + "identifier": "swift.func", + "displayName": "Function" + }, + "identifier": { + "precise": "s:28primitive_symbolgraph_module7myFunc21myx_tAA1ARzlF", + "interfaceLanguage": "swift" + }, + "pathComponents": [ + "myFunc2(m:)" + ], + "names": { + "title": "myFunc2(m:)", + "subHeading": [ + { + "kind": "keyword", + "spelling": "func" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "myFunc2" + }, + { + "kind": "text", + "spelling": "<" + }, + { + "kind": "genericParameter", + "spelling": "T" + }, + { + "kind": "text", + "spelling": ">(" + }, + { + "kind": "externalParam", + "spelling": "m" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "T", + "preciseIdentifier": "s:28primitive_symbolgraph_module7myFunc21myx_tAA1ARzlF1TL_xmfp" + }, + { + "kind": "text", + "spelling": ")" + } + ] + }, + "functionSignature": { + "parameters": [ + { + "name": "m", + "declarationFragments": [ + { + "kind": "identifier", + "spelling": "m" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "T", + "preciseIdentifier": "s:28primitive_symbolgraph_module7myFunc21myx_tAA1ARzlF1TL_xmfp" + } + ] + } + ], + "returns": [ + { + "kind": "text", + "spelling": "()" + } + ] + }, + "swiftGenerics": { + "parameters": [ + { + "name": "T", + "index": 0, + "depth": 0 + } + ], + "constraints": [ + { + "kind": "conformance", + "lhs": "T", + "rhs": "A", + "rhsPrecise": "s:28primitive_symbolgraph_module1AP" + } + ] + }, + "declarationFragments": [ + { + "kind": "keyword", + "spelling": "func" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "myFunc2" + }, + { + "kind": "text", + "spelling": "<" + }, + { + "kind": "genericParameter", + "spelling": "T" + }, + { + "kind": "text", + "spelling": ">(" + }, + { + "kind": "externalParam", + "spelling": "m" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "T", + "preciseIdentifier": "s:28primitive_symbolgraph_module7myFunc21myx_tAA1ARzlF1TL_xmfp" + }, + { + "kind": "text", + "spelling": ") " + }, + { + "kind": "keyword", + "spelling": "where" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "typeIdentifier", + "spelling": "T" + }, + { + "kind": "text", + "spelling": " : " + }, + { + "kind": "typeIdentifier", + "spelling": "A", + "preciseIdentifier": "s:28primitive_symbolgraph_module1AP" + } + ], + "accessLevel": "public", + "location": { + "uri": "file://types.swift", + "position": { + "line": 15, + "character": 12 + } + } + }, + { + "kind": { + "identifier": "swift.func", + "displayName": "Function" + }, + "identifier": { + "precise": "s:28primitive_symbolgraph_module7myFunc31mq_x_tAA1ARzAaDR_r0_lF", + "interfaceLanguage": "swift" + }, + "pathComponents": [ + "myFunc3(m:)" + ], + "names": { + "title": "myFunc3(m:)", + "subHeading": [ + { + "kind": "keyword", + "spelling": "func" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "myFunc3" + }, + { + "kind": "text", + "spelling": "<" + }, + { + "kind": "genericParameter", + "spelling": "T" + }, + { + "kind": "text", + "spelling": ", " + }, + { + "kind": "genericParameter", + "spelling": "U" + }, + { + "kind": "text", + "spelling": ">(" + }, + { + "kind": "externalParam", + "spelling": "m" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "T", + "preciseIdentifier": "s:28primitive_symbolgraph_module7myFunc31mq_x_tAA1ARzAaDR_r0_lF1TL_xmfp" + }, + { + "kind": "text", + "spelling": ") -> " + }, + { + "kind": "typeIdentifier", + "spelling": "U", + "preciseIdentifier": "s:28primitive_symbolgraph_module7myFunc31mq_x_tAA1ARzAaDR_r0_lF1UL_q_mfp" + } + ] + }, + "functionSignature": { + "parameters": [ + { + "name": "m", + "declarationFragments": [ + { + "kind": "identifier", + "spelling": "m" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "T", + "preciseIdentifier": "s:28primitive_symbolgraph_module7myFunc31mq_x_tAA1ARzAaDR_r0_lF1TL_xmfp" + } + ] + } + ], + "returns": [ + { + "kind": "typeIdentifier", + "spelling": "U" + } + ] + }, + "swiftGenerics": { + "parameters": [ + { + "name": "T", + "index": 0, + "depth": 0 + }, + { + "name": "U", + "index": 1, + "depth": 0 + } + ], + "constraints": [ + { + "kind": "conformance", + "lhs": "T", + "rhs": "A", + "rhsPrecise": "s:28primitive_symbolgraph_module1AP" + }, + { + "kind": "conformance", + "lhs": "U", + "rhs": "A", + "rhsPrecise": "s:28primitive_symbolgraph_module1AP" + } + ] + }, + "declarationFragments": [ + { + "kind": "keyword", + "spelling": "func" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "myFunc3" + }, + { + "kind": "text", + "spelling": "<" + }, + { + "kind": "genericParameter", + "spelling": "T" + }, + { + "kind": "text", + "spelling": ", " + }, + { + "kind": "genericParameter", + "spelling": "U" + }, + { + "kind": "text", + "spelling": ">(" + }, + { + "kind": "externalParam", + "spelling": "m" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "T", + "preciseIdentifier": "s:28primitive_symbolgraph_module7myFunc31mq_x_tAA1ARzAaDR_r0_lF1TL_xmfp" + }, + { + "kind": "text", + "spelling": ") -> " + }, + { + "kind": "typeIdentifier", + "spelling": "U", + "preciseIdentifier": "s:28primitive_symbolgraph_module7myFunc31mq_x_tAA1ARzAaDR_r0_lF1UL_q_mfp" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "keyword", + "spelling": "where" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "typeIdentifier", + "spelling": "T" + }, + { + "kind": "text", + "spelling": " : " + }, + { + "kind": "typeIdentifier", + "spelling": "A", + "preciseIdentifier": "s:28primitive_symbolgraph_module1AP" + }, + { + "kind": "text", + "spelling": ", " + }, + { + "kind": "typeIdentifier", + "spelling": "U" + }, + { + "kind": "text", + "spelling": " : " + }, + { + "kind": "typeIdentifier", + "spelling": "A", + "preciseIdentifier": "s:28primitive_symbolgraph_module1AP" + } + ], + "accessLevel": "public", + "location": { + "uri": "file://types.swift", + "position": { + "line": 19, + "character": 12 + } + } + }, + { + "kind": { + "identifier": "swift.func", + "displayName": "Function" + }, + "identifier": { + "precise": "s:28primitive_symbolgraph_module16basicGenericFunc1myx_tlF", + "interfaceLanguage": "swift" + }, + "pathComponents": [ + "basicGenericFunc(m:)" + ], + "names": { + "title": "basicGenericFunc(m:)", + "subHeading": [ + { + "kind": "keyword", + "spelling": "func" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "basicGenericFunc" + }, + { + "kind": "text", + "spelling": "<" + }, + { + "kind": "genericParameter", + "spelling": "U" + }, + { + "kind": "text", + "spelling": ">(" + }, + { + "kind": "externalParam", + "spelling": "m" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "U", + "preciseIdentifier": "s:28primitive_symbolgraph_module16basicGenericFunc1myx_tlF1UL_xmfp" + }, + { + "kind": "text", + "spelling": ")" + } + ] + }, + "functionSignature": { + "parameters": [ + { + "name": "m", + "declarationFragments": [ + { + "kind": "identifier", + "spelling": "m" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "U", + "preciseIdentifier": "s:28primitive_symbolgraph_module16basicGenericFunc1myx_tlF1UL_xmfp" + } + ] + } + ], + "returns": [ + { + "kind": "text", + "spelling": "()" + } + ] + }, + "swiftGenerics": { + "parameters": [ + { + "name": "U", + "index": 0, + "depth": 0 + } + ] + }, + "declarationFragments": [ + { + "kind": "keyword", + "spelling": "func" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "basicGenericFunc" + }, + { + "kind": "text", + "spelling": "<" + }, + { + "kind": "genericParameter", + "spelling": "U" + }, + { + "kind": "text", + "spelling": ">(" + }, + { + "kind": "externalParam", + "spelling": "m" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "U", + "preciseIdentifier": "s:28primitive_symbolgraph_module16basicGenericFunc1myx_tlF1UL_xmfp" + }, + { + "kind": "text", + "spelling": ")" + } + ], + "accessLevel": "public", + "location": { + "uri": "file://types.swift", + "position": { + "line": 8, + "character": 12 + } + } + }, + { + "kind": { + "identifier": "swift.func", + "displayName": "Function" + }, + "identifier": { + "precise": "s:28primitive_symbolgraph_module6myFunc1myx_tAA1ARzlF", + "interfaceLanguage": "swift" + }, + "pathComponents": [ + "myFunc(m:)" + ], + "names": { + "title": "myFunc(m:)", + "subHeading": [ + { + "kind": "keyword", + "spelling": "func" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "myFunc" + }, + { + "kind": "text", + "spelling": "<" + }, + { + "kind": "genericParameter", + "spelling": "T" + }, + { + "kind": "text", + "spelling": ">(" + }, + { + "kind": "externalParam", + "spelling": "m" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "T", + "preciseIdentifier": "s:28primitive_symbolgraph_module6myFunc1myx_tAA1ARzlF1TL_xmfp" + }, + { + "kind": "text", + "spelling": ")" + } + ] + }, + "functionSignature": { + "parameters": [ + { + "name": "m", + "declarationFragments": [ + { + "kind": "identifier", + "spelling": "m" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "T", + "preciseIdentifier": "s:28primitive_symbolgraph_module6myFunc1myx_tAA1ARzlF1TL_xmfp" + } + ] + } + ], + "returns": [ + { + "kind": "text", + "spelling": "()" + } + ] + }, + "swiftGenerics": { + "parameters": [ + { + "name": "T", + "index": 0, + "depth": 0 + } + ], + "constraints": [ + { + "kind": "conformance", + "lhs": "T", + "rhs": "A", + "rhsPrecise": "s:28primitive_symbolgraph_module1AP" + } + ] + }, + "declarationFragments": [ + { + "kind": "keyword", + "spelling": "func" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "myFunc" + }, + { + "kind": "text", + "spelling": "<" + }, + { + "kind": "genericParameter", + "spelling": "T" + }, + { + "kind": "text", + "spelling": ">(" + }, + { + "kind": "externalParam", + "spelling": "m" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "T", + "preciseIdentifier": "s:28primitive_symbolgraph_module6myFunc1myx_tAA1ARzlF1TL_xmfp" + }, + { + "kind": "text", + "spelling": ") " + }, + { + "kind": "keyword", + "spelling": "where" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "typeIdentifier", + "spelling": "T" + }, + { + "kind": "text", + "spelling": " : " + }, + { + "kind": "typeIdentifier", + "spelling": "A", + "preciseIdentifier": "s:28primitive_symbolgraph_module1AP" + } + ], + "accessLevel": "public", + "location": { + "uri": "file://types.swift", + "position": { + "line": 12, + "character": 12 + } + } + }, + { + "kind": { + "identifier": "swift.func", + "displayName": "Function" + }, + "identifier": { + "precise": "s:28primitive_symbolgraph_module9basicFunc1mySS_tF", + "interfaceLanguage": "swift" + }, + "pathComponents": [ + "basicFunc(m:)" + ], + "names": { + "title": "basicFunc(m:)", + "subHeading": [ + { + "kind": "keyword", + "spelling": "func" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "basicFunc" + }, + { + "kind": "text", + "spelling": "(" + }, + { + "kind": "externalParam", + "spelling": "m" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "String", + "preciseIdentifier": "s:SS" + }, + { + "kind": "text", + "spelling": ")" + } + ] + }, + "functionSignature": { + "parameters": [ + { + "name": "m", + "declarationFragments": [ + { + "kind": "identifier", + "spelling": "m" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "String", + "preciseIdentifier": "s:SS" + } + ] + } + ], + "returns": [ + { + "kind": "text", + "spelling": "()" + } + ] + }, + "declarationFragments": [ + { + "kind": "keyword", + "spelling": "func" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "basicFunc" + }, + { + "kind": "text", + "spelling": "(" + }, + { + "kind": "externalParam", + "spelling": "m" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "String", + "preciseIdentifier": "s:SS" + }, + { + "kind": "text", + "spelling": ")" + } + ], + "accessLevel": "public", + "location": { + "uri": "file://types.swift", + "position": { + "line": 4, + "character": 12 + } + } + }, + { + "kind": { + "identifier": "swift.func", + "displayName": "Function" + }, + "identifier": { + "precise": "s:28primitive_symbolgraph_module7myFunc41m1uyx_q_tAA1ARzAaER_r0_lF", + "interfaceLanguage": "swift" + }, + "pathComponents": [ + "myFunc4(m:u:)" + ], + "names": { + "title": "myFunc4(m:u:)", + "subHeading": [ + { + "kind": "keyword", + "spelling": "func" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "myFunc4" + }, + { + "kind": "text", + "spelling": "<" + }, + { + "kind": "genericParameter", + "spelling": "T" + }, + { + "kind": "text", + "spelling": ", " + }, + { + "kind": "genericParameter", + "spelling": "U" + }, + { + "kind": "text", + "spelling": ">(" + }, + { + "kind": "externalParam", + "spelling": "m" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "T", + "preciseIdentifier": "s:28primitive_symbolgraph_module7myFunc41m1uyx_q_tAA1ARzAaER_r0_lF1TL_xmfp" + }, + { + "kind": "text", + "spelling": ", " + }, + { + "kind": "externalParam", + "spelling": "u" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "U", + "preciseIdentifier": "s:28primitive_symbolgraph_module7myFunc41m1uyx_q_tAA1ARzAaER_r0_lF1UL_q_mfp" + }, + { + "kind": "text", + "spelling": ")" + } + ] + }, + "functionSignature": { + "parameters": [ + { + "name": "m", + "declarationFragments": [ + { + "kind": "identifier", + "spelling": "m" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "T", + "preciseIdentifier": "s:28primitive_symbolgraph_module7myFunc41m1uyx_q_tAA1ARzAaER_r0_lF1TL_xmfp" + } + ] + }, + { + "name": "u", + "declarationFragments": [ + { + "kind": "identifier", + "spelling": "u" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "U", + "preciseIdentifier": "s:28primitive_symbolgraph_module7myFunc41m1uyx_q_tAA1ARzAaER_r0_lF1UL_q_mfp" + } + ] + } + ], + "returns": [ + { + "kind": "text", + "spelling": "()" + } + ] + }, + "swiftGenerics": { + "parameters": [ + { + "name": "T", + "index": 0, + "depth": 0 + }, + { + "name": "U", + "index": 1, + "depth": 0 + } + ], + "constraints": [ + { + "kind": "conformance", + "lhs": "T", + "rhs": "A", + "rhsPrecise": "s:28primitive_symbolgraph_module1AP" + }, + { + "kind": "conformance", + "lhs": "U", + "rhs": "A", + "rhsPrecise": "s:28primitive_symbolgraph_module1AP" + } + ] + }, + "declarationFragments": [ + { + "kind": "keyword", + "spelling": "func" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "identifier", + "spelling": "myFunc4" + }, + { + "kind": "text", + "spelling": "<" + }, + { + "kind": "genericParameter", + "spelling": "T" + }, + { + "kind": "text", + "spelling": ", " + }, + { + "kind": "genericParameter", + "spelling": "U" + }, + { + "kind": "text", + "spelling": ">(" + }, + { + "kind": "externalParam", + "spelling": "m" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "T", + "preciseIdentifier": "s:28primitive_symbolgraph_module7myFunc41m1uyx_q_tAA1ARzAaER_r0_lF1TL_xmfp" + }, + { + "kind": "text", + "spelling": ", " + }, + { + "kind": "externalParam", + "spelling": "u" + }, + { + "kind": "text", + "spelling": ": " + }, + { + "kind": "typeIdentifier", + "spelling": "U", + "preciseIdentifier": "s:28primitive_symbolgraph_module7myFunc41m1uyx_q_tAA1ARzAaER_r0_lF1UL_q_mfp" + }, + { + "kind": "text", + "spelling": ") " + }, + { + "kind": "keyword", + "spelling": "where" + }, + { + "kind": "text", + "spelling": " " + }, + { + "kind": "typeIdentifier", + "spelling": "T" + }, + { + "kind": "text", + "spelling": " : " + }, + { + "kind": "typeIdentifier", + "spelling": "A", + "preciseIdentifier": "s:28primitive_symbolgraph_module1AP" + }, + { + "kind": "text", + "spelling": ", " + }, + { + "kind": "typeIdentifier", + "spelling": "U" + }, + { + "kind": "text", + "spelling": " : " + }, + { + "kind": "typeIdentifier", + "spelling": "A", + "preciseIdentifier": "s:28primitive_symbolgraph_module1AP" + } + ], + "accessLevel": "public", + "location": { + "uri": "file://types.swift", + "position": { + "line": 23, + "character": 12 + } + } + } + ], + "relationships": [] +} \ No newline at end of file