diff --git a/sourcepawn/compiler/sc1.c b/sourcepawn/compiler/sc1.c index 154e33c4..e152c5c9 100644 --- a/sourcepawn/compiler/sc1.c +++ b/sourcepawn/compiler/sc1.c @@ -4223,6 +4223,9 @@ static void parse_function_type(functag_t *type) continue; } + // Account for strings. + fix_char_size(&decl); + funcarg_t *arg = &type->args[type->argcount++]; arg->tagcount = 1; arg->tags[0] = decl.type.tag; diff --git a/sourcepawn/compiler/tests/ok-typedef-func-chars.sp b/sourcepawn/compiler/tests/ok-typedef-func-chars.sp new file mode 100644 index 00000000..36f8753c --- /dev/null +++ b/sourcepawn/compiler/tests/ok-typedef-func-chars.sp @@ -0,0 +1,26 @@ +enum Action: {} +functag public Action:OldFuncTag( String:someString[128] ); +typedef NewFuncTag = function Action ( char someString[128] ); + +native UseOldFuncTag( OldFuncTag func ); +native UseNewFuncTag( NewFuncTag func ); + +public OnPluginStart() +{ + // fine + UseOldFuncTag( MyOldFunc ); + // also fine + UseOldFuncTag( MyNewFunc ); + + // error 100: function prototypes do not match + UseNewFuncTag( MyOldFunc ); + // error 100: function prototypes do not match + UseNewFuncTag( MyNewFunc ); +} + +public Action:MyOldFunc( String:someString[128] ) +{ +} +public Action MyNewFunc( char someString[128] ) +{ +}