Changeset 16481


Ignore:
Timestamp:
01/02/19 19:38:48 (3 weeks ago)
Author:
gkronber
Message:

#2520: fixed StorableSerializer of old persistence to make the old persistence unit test succeed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2520_PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableSerializer.cs

    r16462 r16481  
    7070    /// </returns>
    7171    public bool CanSerialize(Type type) {
     72      if (type.IsEnum || type.IsValueType) return false; // there are other more specific serializers for enums and structs
    7273      var markedStorable = StorableReflection.HasStorableTypeAttribute(type);
    7374      if (GetConstructor(type) == null)
    74         if (markedStorable)
     75        if (markedStorable && !type.IsInterface)
    7576          throw new Exception("[Storable] type has no default constructor and no [StorableConstructor]");
    7677        else
    7778          return false;
    7879      if (!StorableReflection.IsEmptyOrStorableType(type, true))
    79         if (markedStorable)
     80        if (markedStorable && !type.IsInterface)
    8081          throw new Exception("[Storable] type has non emtpy, non [Storable] base classes");
    8182        else
Note: See TracChangeset for help on using the changeset viewer.