@@ -71,7 +71,11 @@ abstract private class GeneratedType extends ValueOrRefType, GeneratedElement {
71
71
}
72
72
73
73
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 "
75
79
}
76
80
77
81
private string stubAttributes ( ) {
@@ -100,9 +104,10 @@ abstract private class GeneratedType extends ValueOrRefType, GeneratedElement {
100
104
stubMembers ( assembly ) + "}\n\n"
101
105
or
102
106
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"
106
111
)
107
112
}
108
113
@@ -669,6 +674,12 @@ private string stubDefaultValue(Parameter p) {
669
674
else result = ""
670
675
}
671
676
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
+
672
683
private string stubExplicitImplementation ( Member c ) {
673
684
if exists ( c .( Virtualizable ) .getExplicitlyImplementedInterface ( ) )
674
685
then result = stubClassName ( c .( Virtualizable ) .getExplicitlyImplementedInterface ( ) ) + "."
@@ -748,7 +759,8 @@ private string stubMember(Member m, Assembly assembly) {
748
759
then
749
760
result =
750
761
" " + stubModifiers ( m ) + "event " + stubClassName ( m .( Event ) .getType ( ) ) +
751
- " " + stubExplicitImplementation ( m ) + m .getName ( ) + ";\n"
762
+ " " + stubExplicitImplementation ( m ) + m .getName ( ) + stubEventAccessors ( m ) +
763
+ "\n"
752
764
else
753
765
if m instanceof GeneratedType
754
766
then result = m .( GeneratedType ) .getStub ( assembly ) + "\n"
0 commit comments