mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-16 14:25:56 +00:00
Branches: main
Mark Java RTTI classes as implementing java.io.Serializable to
enable serialization of existentially typed values.
java/runtime/DuExistInfo.java:
java/runtime/DuExistLocn.java:
java/runtime/DuFunctorDesc.java:
java/runtime/DuPtagLayout.java:
java/runtime/EnumFunctorDesc.java:
java/runtime/ForeignEnumFunctorDesc.java:
java/runtime/MethodPtr.java:
java/runtime/NotagFunctorDesc.java:
java/runtime/PseudoTypeInfo.java:
java/runtime/ReservedAddrFunctorDesc.java:
java/runtime/Sectag_Locn.java:
java/runtime/TypeClassConstraint.java:
java/runtime/TypeClassDeclStruct.java:
java/runtime/TypeClassId.java:
java/runtime/TypeClassMethod.java:
java/runtime/TypeCtorInfo_Struct.java:
java/runtime/TypeCtorRep.java:
java/runtime/TypeFunctors.java:
java/runtime/TypeInfo_Struct.java:
java/runtime/TypeLayout.java:
As above.
TypeCtorInfo_Struct.unify() cannot rely on the uniqueness of
TypeCtorInfo_Struct instances, as deserialisation will create new
copies.
33 lines
939 B
Java
33 lines
939 B
Java
//
|
|
// Copyright (C) 2004 The University of Melbourne.
|
|
// This file may only be copied under the terms of the GNU Library General
|
|
// Public License - see the file COPYING.LIB in the Mercury distribution.
|
|
//
|
|
|
|
package jmercury.runtime;
|
|
|
|
// This corresponds to the C type MR_TypeClassConstraint
|
|
// in runtime/mercury_type_info.h.
|
|
|
|
public class TypeClassConstraint implements java.io.Serializable {
|
|
public TypeClassDeclStruct tc_constr_type_class;
|
|
public PseudoTypeInfo tc_constr_arg_ptis[];
|
|
|
|
public TypeClassConstraint()
|
|
{
|
|
}
|
|
|
|
public void init(TypeClassDeclStruct type_class,
|
|
// XXX Object[] should be PseudoTypeInfo[],
|
|
// but mlds_to_java.m generates Object[] since
|
|
// init_array/1 doesn't give type info
|
|
Object[] ptis)
|
|
{
|
|
tc_constr_type_class = type_class;
|
|
tc_constr_arg_ptis = new PseudoTypeInfo[ptis.length];
|
|
for (int i = 0; i < ptis.length; i++) {
|
|
tc_constr_arg_ptis[i] = (PseudoTypeInfo) ptis[i];
|
|
}
|
|
}
|
|
}
|