Skip to content

Commit f597c9a

Browse files
committed
Handle special case of duplicate type constraints
1 parent 42fcfad commit f597c9a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

csharp/ql/src/Stubs/Stubs.qll

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,11 @@ private string stubConstraints(TypeParameterConstraints tpc, int i) {
534534
or
535535
tpc.hasUnmanagedTypeConstraint() and result = "unmanaged" and i = 0
536536
or
537-
tpc.hasValueTypeConstraint() and result = "struct" and i = 0
537+
tpc.hasValueTypeConstraint() and
538+
result = "struct" and
539+
i = 0 and
540+
not tpc.hasUnmanagedTypeConstraint() and
541+
not stubClassName(tpc.getATypeConstraint().(Class)) = "System.Enum"
538542
or
539543
tpc.hasRefTypeConstraint() and result = "class" and i = 0
540544
or

0 commit comments

Comments
 (0)