Skip to content

Commit 43a9803

Browse files
authored
Make PEvents and PTypes serializable in java (#726)
1 parent 5f96108 commit 43a9803

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Src/PCompiler/CompilerCore/Backend/Java/EventGenerator.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ private void WriteEventDecl(PEvent e)
5151
var payloadType = argType.TypeName;
5252
var payloadRefType = argType.ReferenceTypeName;
5353

54-
WriteLine($"public static class {eventName} extends {Constants.PEventsClass}<{payloadRefType}> {{");
54+
WriteLine($"public static class {eventName} extends {Constants.PEventsClass}<{payloadRefType}> implements Serializable {{");
5555

5656
var hasPayload = !(argType is TypeManager.JType.JVoid);
5757
if (hasPayload)

Src/PCompiler/CompilerCore/Backend/Java/TypesGenerator.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ private void WriteNamedTupleDecl(NamedTupleType t)
109109
}
110110

111111
var tname = Names.NameForNamedTuple(t);
112-
WriteLine($"public static class {tname} implements {Constants.PValueClass}<{tname}> {{");
112+
WriteLine($"public static class {tname} implements {Constants.PValueClass}<{tname}>, Serializable {{");
113113
WriteLine($"// {t.CanonicalRepresentation}");
114114

115115
WriteNamedTupleFields(fields);

0 commit comments

Comments
 (0)