Skip to content

Commit

Permalink
Fix NativeFunc
Browse files Browse the repository at this point in the history
  • Loading branch information
liamappelbe committed Sep 26, 2024
1 parent a3a1f0a commit ea91c39
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkgs/ffigen/lib/src/code_generator/func_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,12 @@ class NativeFunc extends Type {
}

@override
String getCType(Writer w, {bool writeArgumentNames = true}) =>
'${w.ffiLibraryPrefix}.NativeFunction<'
'${type.getCType(w, writeArgumentNames: writeArgumentNames)}>';
String getCType(Writer w, {bool writeArgumentNames = true}) {
final funcType = _type is FunctionType
? _type.getCType(w, writeArgumentNames: writeArgumentNames)
: _type.getCType(w);
return '${w.ffiLibraryPrefix}.NativeFunction<$funcType>';
}

@override
String getFfiDartType(Writer w, {bool writeArgumentNames = true}) =>
Expand Down

0 comments on commit ea91c39

Please sign in to comment.