Skip to content

Commit 37ad96b

Browse files
atsushienojonpryor
authored andcommitted
[generator] fix enum managed return type. (dotnet#76)
6d161a2 caused (either regressed or exposed) another issue that generator didn't resole the return values for enums to be EnumSymbol which gives explicit cast from int to enum for the output expressions. This returns managed_type (which should be enum name) for enumified return value (IsEnumified = true).
1 parent 1de80b7 commit 37ad96b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/generator/ReturnValue.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public string GetGenericReturn (CodeGenerationOptions opt, string name, Dictiona
118118

119119
public bool Validate (CodeGenerationOptions opt, GenericParameterDefinitionList type_params)
120120
{
121-
sym = SymbolTable.Lookup (java_type, type_params);
121+
sym = (IsEnumified ? SymbolTable.Lookup (managed_type, type_params) : null) ?? SymbolTable.Lookup (java_type, type_params);
122122
if (sym == null) {
123123
Report.Warning (0, Report.WarningReturnValue + 0, "Unknown return type {0} {1}.", java_type, opt.ContextString);
124124
return false;

0 commit comments

Comments
 (0)