File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -433,10 +433,22 @@ private string stubConstraints(TypeParameterConstraints tpc) {
433433}
434434
435435private string stubTypeParameterConstraints ( TypeParameter tp ) {
436- exists ( TypeParameterConstraints tpc | tpc = tp .getConstraints ( ) |
437- result =
438- " where " + tp .getName ( ) + ": " + strictconcat ( string s | s = stubConstraints ( tpc ) | s , ", " )
439- )
436+ if
437+ tp .getDeclaringGeneric ( ) .( Virtualizable ) .isOverride ( ) or
438+ tp .getDeclaringGeneric ( ) .( Virtualizable ) .implementsExplicitInterface ( )
439+ then
440+ if tp .getConstraints ( ) .hasValueTypeConstraint ( )
441+ then result = " where " + tp .getName ( ) + ": struct"
442+ else
443+ if tp .getConstraints ( ) .hasRefTypeConstraint ( )
444+ then result = " where " + tp .getName ( ) + ": class"
445+ else result = ""
446+ else
447+ exists ( TypeParameterConstraints tpc | tpc = tp .getConstraints ( ) |
448+ result =
449+ " where " + tp .getName ( ) + ": " +
450+ strictconcat ( string s | s = stubConstraints ( tpc ) | s , ", " )
451+ )
440452}
441453
442454private string stubTypeParametersConstraints ( Declaration d ) {
You can’t perform that action at this time.
0 commit comments