Skip to content

Commit f71d684

Browse files
committed
C#: Use explicit typing for enums in the stub generator.
1 parent 9ff9412 commit f71d684

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

csharp/ql/src/Stubs/Stubs.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ abstract private class GeneratedType extends Type, GeneratedElement {
160160

161161
private string stubBaseTypesString() {
162162
if this instanceof Enum
163-
then result = ""
163+
then result = " : " + this.(Enum).getUnderlyingType().toStringWithTypes()
164164
else
165165
if exists(this.getAnInterestingBaseType())
166166
then
@@ -726,7 +726,7 @@ pragma[noinline]
726726
private string stubEnumConstant(EnumConstant ec, Assembly assembly) {
727727
ec instanceof GeneratedMember and
728728
ec.getALocation() = assembly and
729-
result = " " + escapeIfKeyword(ec.getName()) + "=" + ec.getValue() + ",\n"
729+
result = " " + escapeIfKeyword(ec.getName()) + " = " + ec.getValue() + ",\n"
730730
}
731731

732732
pragma[noinline]

0 commit comments

Comments
 (0)