@@ -71,7 +71,11 @@ abstract private class GeneratedType extends ValueOrRefType, GeneratedElement {
7171 }
7272
7373 private string stubPartialModifier ( ) {
74- if count ( Assembly a | this .getALocation ( ) = a ) > 1 then result = "partial " else result = ""
74+ if
75+ count ( Assembly a | this .getALocation ( ) = a ) <= 1 or
76+ this instanceof Enum
77+ then result = ""
78+ else result = "partial "
7579 }
7680
7781 private string stubAttributes ( ) {
@@ -100,9 +104,10 @@ abstract private class GeneratedType extends ValueOrRefType, GeneratedElement {
100104 stubMembers ( assembly ) + "}\n\n"
101105 or
102106 result =
103- this .stubComment ( ) + this .stubAttributes ( ) + stubAccessibility ( this ) + this .stubKeyword ( ) +
104- " " + stubClassName ( this .( DelegateType ) .getReturnType ( ) ) + " " + this .getUndecoratedName ( )
105- + stubGenericArguments ( this ) + "(" + stubParameters ( this ) + ");\n\n"
107+ this .stubComment ( ) + this .stubAttributes ( ) + stubUnsafe ( this ) + stubAccessibility ( this ) +
108+ this .stubKeyword ( ) + " " + stubClassName ( this .( DelegateType ) .getReturnType ( ) ) + " " +
109+ this .getUndecoratedName ( ) + stubGenericArguments ( this ) + "(" + stubParameters ( this ) +
110+ ");\n\n"
106111 )
107112 }
108113
@@ -669,6 +674,12 @@ private string stubDefaultValue(Parameter p) {
669674 else result = ""
670675}
671676
677+ private string stubEventAccessors ( Event e ) {
678+ if exists ( e .( Virtualizable ) .getExplicitlyImplementedInterface ( ) )
679+ then result = " { add => throw null; remove => throw null; }"
680+ else result = ";"
681+ }
682+
672683private string stubExplicitImplementation ( Member c ) {
673684 if exists ( c .( Virtualizable ) .getExplicitlyImplementedInterface ( ) )
674685 then result = stubClassName ( c .( Virtualizable ) .getExplicitlyImplementedInterface ( ) ) + "."
@@ -748,7 +759,8 @@ private string stubMember(Member m, Assembly assembly) {
748759 then
749760 result =
750761 " " + stubModifiers ( m ) + "event " + stubClassName ( m .( Event ) .getType ( ) ) +
751- " " + stubExplicitImplementation ( m ) + m .getName ( ) + ";\n"
762+ " " + stubExplicitImplementation ( m ) + m .getName ( ) + stubEventAccessors ( m ) +
763+ "\n"
752764 else
753765 if m instanceof GeneratedType
754766 then result = m .( GeneratedType ) .getStub ( assembly ) + "\n"
0 commit comments