public static IEnumerable<TemplateIntermediateType> SearchForClassDerivatives(TemplateIntermediateType t, ResolutionContext ctxt)
		{
			if (!(t is ClassType || t is InterfaceType))
				throw new ArgumentException ("t is expected to be a class or an interface, not " + (t != null ? t.ToString () : "null"));

			var f = new ClassInterfaceDerivativeFinder (ctxt);

			f.typeNodeToFind = t.Definition;
			var bt = t;
			while (bt != null) {
				f.alreadyResolvedClasses.Add (bt.Definition);
				bt = DResolver.StripMemberSymbols (bt.Base) as TemplateIntermediateType;
			}

			var filter = MemberFilter.Classes;
			if (t is InterfaceType) // -> Only interfaces can inherit interfaces. Interfaces cannot be subclasses of classes.
				filter |= MemberFilter.Interfaces;

			f.IterateThroughScopeLayers (t.Definition.Location, filter);

			return f.results; // return them.
		}
Exemplo n.º 2
0
		public ClassType(DClassLike dc, ISyntaxRegion td, 
			TemplateIntermediateType baseType, InterfaceType[] baseInterfaces = null,
			IEnumerable<TemplateParameterSymbol> deducedTypes = null)
			: base(dc, td, baseType, baseInterfaces, deducedTypes)
		{}
Exemplo n.º 3
0
		public ClassType(DClassLike dc, ISyntaxRegion td, 
			TemplateIntermediateType baseType, InterfaceType[] baseInterfaces,
			ReadOnlyCollection<TemplateParameterSymbol> deducedTypes)
			: base(dc, td, baseType, baseInterfaces, deducedTypes)
		{}
Exemplo n.º 4
0
 public ClassType(DClassLike dc, ISyntaxRegion td,
                  TemplateIntermediateType baseType, InterfaceType[] baseInterfaces = null,
                  IEnumerable <TemplateParameterSymbol> deducedTypes = null)
     : base(dc, td, baseType, baseInterfaces, deducedTypes)
 {
 }
Exemplo n.º 5
0
 public ClassType(DClassLike dc, ISyntaxRegion td,
                  TemplateIntermediateType baseType, InterfaceType[] baseInterfaces,
                  ReadOnlyCollection <TemplateParameterSymbol> deducedTypes)
     : base(dc, td, baseType, baseInterfaces, deducedTypes)
 {
 }