Example #1
0
        public override bool IsAssignableFrom(Type c)
        {
            ProjectingType otherType = c as ProjectingType;

            if (otherType == null || Projector != otherType.Projector)
            {
                return(false);
            }

            return(UnderlyingType.IsAssignableFrom(otherType.UnderlyingType));
        }
Example #2
0
        public override bool IsAssignableFrom([NotNullWhen(true)] Type?c)
        {
            ProjectingType?otherType = c as ProjectingType;

            if (otherType == null || Projector != otherType.Projector)
            {
                return(false);
            }

            return(UnderlyingType.IsAssignableFrom(otherType.UnderlyingType));
        }
Example #3
0
 internal override MutableItem?ResolveToStObj(IActivityMonitor monitor, StObjObjectEngineMap collector)
 {
     if (_resolved != UnresolvedMarker)
     {
         return(_resolved);
     }
     if (Type == null && !IsOptional)
     {
         Error(monitor, $"Type can not be null since the {KindName} is not optional");
         return(_resolved = null);
     }
     Debug.Assert(Type != null || IsOptional);
     if (Type != null && !UnderlyingType.IsAssignableFrom(Type))
     {
         Error(monitor, $"Type '{Type.FullName}' is not compatible with the {KindName} type ('{UnderlyingType.FullName}')");
         return(_resolved = null);
     }
     return(_resolved = base.ResolveToStObj(monitor, collector));
 }