Skip to content

Commit

Permalink
[ffigen] More fixes for large integration test (#1585)
Browse files Browse the repository at this point in the history
  • Loading branch information
liamappelbe authored Sep 23, 2024
1 parent 12bc10a commit 99971af
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions pkgs/ffigen/lib/src/code_generator/objc_block.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,16 @@ class ObjCBlock extends BindingType {
required bool returnsRetained,
required ObjCBuiltInFunctions builtInFunctions,
}) {
final usr = _getBlockUsr(returnType, params, returnsRetained);
final renamedParams = [
for (var i = 0; i < params.length; ++i)
Parameter(
name: 'arg$i',
type: params[i].type,
objCConsumed: params[i].objCConsumed,
),
];

final usr = _getBlockUsr(returnType, renamedParams, returnsRetained);

final oldBlock = bindingsIndex.getSeenObjCBlock(usr);
if (oldBlock != null) {
Expand All @@ -30,9 +39,9 @@ class ObjCBlock extends BindingType {

final block = ObjCBlock._(
usr: usr,
name: _getBlockName(returnType, params.map((a) => a.type)),
name: _getBlockName(returnType, renamedParams.map((a) => a.type)),
returnType: returnType,
params: params,
params: renamedParams,
returnsRetained: returnsRetained,
builtInFunctions: builtInFunctions,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ ObjCBlock parseObjCBlock(clang_types.CXType cxtype) {
for (var i = 0; i < numArgs; ++i) {
final type = clang.clang_getArgType(blk, i);
params.add(Parameter(
name: 'arg$i',
type: type.toCodeGenType(),
objCConsumed: false,
));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ void main() {
'candidateListTouchBarItem',
'hyphenationFactor',
'tag',
'title',
};
final interfaceFilter = DeclarationFilters(
shouldInclude: randInclude,
Expand Down

0 comments on commit 99971af

Please sign in to comment.