Skip to content

Commit

Permalink
Make PEvents and PTypes serializable in java (#726)
Browse files Browse the repository at this point in the history
  • Loading branch information
mchadalavada authored and aman-goel committed May 6, 2024
1 parent d79c62f commit 885c818
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Src/PCompiler/CompilerCore/Backend/Java/EventGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private void WriteEventDecl(PEvent e)
var payloadType = argType.TypeName;
var payloadRefType = argType.ReferenceTypeName;

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

var hasPayload = !(argType is TypeManager.JType.JVoid);
if (hasPayload)
Expand Down
2 changes: 1 addition & 1 deletion Src/PCompiler/CompilerCore/Backend/Java/TypesGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ private void WriteNamedTupleDecl(NamedTupleType t)
}

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

WriteNamedTupleFields(fields);
Expand Down

0 comments on commit 885c818

Please sign in to comment.