@@ -120,7 +120,7 @@ protected TypeMapperBase(LanguageConfig config)
120120 Config = config ;
121121 }
122122
123- public virtual string MapType ( TypeInfo type , bool isNotNull = false )
123+ public virtual string MapType ( TypeInfo type , bool isNotNull = false , bool forReturn = false )
124124 {
125125 if ( type . IsPointer )
126126 {
@@ -142,7 +142,8 @@ public virtual string MapType(TypeInfo type, bool isNotNull = false)
142142 TypeCategory . Handle => Config . UseTypedHandles && TypeInfo . IsClassHandle ( type . Name )
143143 ? ( type . Name == "Object" ? "Prop" : type . Name )
144144 : Config . NumberType ,
145- TypeCategory . Hash => Config . HashType ,
145+ // Hash parameters accept string | number, but return type is always number
146+ TypeCategory . Hash => forReturn ? Config . NumberType : Config . HashType ,
146147 TypeCategory . String => isNotNull ? Config . StringType : Config . StringType + Config . NullableStringSuffix ,
147148 TypeCategory . Vector2 => Config . Vector2Type ,
148149 TypeCategory . Vector3 => Config . Vector3Type ,
@@ -298,7 +299,7 @@ public virtual string BuildCombinedReturnType(TypeInfo returnType, IEnumerable<T
298299 // Helper to add nullable suffix for class handle return types
299300 string MapReturnType ( TypeInfo type )
300301 {
301- var mapped = MapType ( type ) ;
302+ var mapped = MapType ( type , forReturn : true ) ;
302303 // Class handle return types can be null (invalid handle returns 0)
303304 // Non-class handles (Prompt, ScrHandle) are just numbers
304305 if ( type . Category == TypeCategory . Handle && Config . UseTypedHandles && TypeInfo . IsClassHandle ( type . Name ) )
0 commit comments