2 // generic.cs: Support classes for generics to reduce differences from GMCS
5 // Raja R Harinath <rharinath@novell.com>
7 // Copyright 2006 Novell, Inc.
10 using System.Reflection;
11 using System.Reflection.Emit;
12 using System.Collections;
23 public enum SpecialConstraint
30 public abstract class GenericTypeParameterBuilder : Type
34 public class InternalsVisibleToAttribute
36 public string AssemblyName;
39 class ConstraintChecker
41 public static bool CheckConstraints (EmitContext ec, MethodBase a, MethodBase b, Location loc)
43 throw new NotSupportedException ();
47 public abstract class GenericConstraints
49 public bool HasConstructorConstraint {
50 get { throw new NotImplementedException (); }
53 public bool HasValueTypeConstraint {
54 get { throw new NotImplementedException (); }
57 public bool HasClassConstraint {
58 get { throw new NotImplementedException (); }
61 public bool HasReferenceTypeConstraint {
62 get { throw new NotImplementedException (); }
65 public abstract string TypeParameter {
69 public bool IsReferenceType {
70 get { throw new NotSupportedException (); }
73 public bool IsValueType {
74 get { throw new NotSupportedException (); }
77 public Type[] InterfaceConstraints {
78 get { throw new NotSupportedException (); }
81 public Type ClassConstraint {
82 get { throw new NotSupportedException (); }
85 public Type EffectiveBaseClass {
86 get { throw new NotSupportedException (); }
90 public class Constraints : GenericConstraints
92 public Constraints (string name, ArrayList constraints, Location loc)
96 public Constraints Clone ()
98 throw new NotImplementedException ();
101 public Location Location {
102 get { return Location.Null; }
105 public override string TypeParameter {
106 get { throw new NotImplementedException (); }
109 public void VerifyClsCompliance ()
114 public class TypeParameter : MemberCore, IMemberContainer
116 public TypeParameter (DeclSpace parent, DeclSpace decl, string name,
117 Constraints constraints, Attributes attrs, Variance variance, Location loc)
118 : base (parent, new MemberName (name, loc), attrs)
120 throw new NotImplementedException ();
123 public static string GetSignatureForError (TypeParameter[] tp)
125 throw new NotImplementedException ();
128 public void ErrorInvalidVariance (MemberCore mc, Variance v)
132 public static TypeParameter FindTypeParameter (TypeParameter[] all, string name)
134 throw new NotImplementedException ();
141 public override bool Define ()
146 public void Define (Type t)
150 public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder cb, PredefinedAttributes pa)
152 throw new NotImplementedException ();
155 public override AttributeTargets AttributeTargets {
156 get { throw new NotImplementedException (); }
159 public override string[] ValidAttributeTargets {
161 return new string [] { "type parameter" };
165 public Constraints Constraints {
171 public override string DocCommentHeader {
172 get { throw new NotImplementedException (); }
175 public bool Resolve (DeclSpace ds)
177 throw new NotImplementedException ();
180 public bool DefineType (IResolveContext ec)
182 throw new NotImplementedException ();
185 public bool DefineType (IResolveContext ec, MethodBuilder builder,
186 MethodInfo implementing, bool is_override)
188 throw new NotImplementedException ();
191 public bool CheckDependencies ()
193 throw new NotImplementedException ();
196 public bool UpdateConstraints (IResolveContext ec, Constraints new_constraints)
198 throw new NotImplementedException ();
206 get { throw new NotImplementedException (); }
209 string IMemberContainer.Name {
210 get { throw new NotImplementedException (); }
213 public Variance Variance {
214 get { throw new NotImplementedException (); }
217 MemberCache IMemberContainer.BaseCache {
218 get { throw new NotImplementedException (); }
221 bool IMemberContainer.IsInterface {
222 get { throw new NotImplementedException (); }
225 MemberList IMemberContainer.GetMembers (MemberTypes mt, BindingFlags bf)
227 throw new NotImplementedException ();
230 public bool IsSubclassOf (Type t)
232 throw new NotImplementedException ();
235 public MemberList FindMembers (MemberTypes mt, BindingFlags bf,
236 MemberFilter filter, object criteria)
238 throw new NotImplementedException ();
241 public void SetConstraints (GenericTypeParameterBuilder type)
243 throw new NotImplementedException ();
247 public class TypeParameterExpr : TypeExpr
249 public TypeParameterExpr (TypeParameter type_parameter, Location loc)
251 throw new NotImplementedException ();
254 protected override TypeExpr DoResolveAsTypeStep (IResolveContext ec)
259 public TypeParameter TypeParameter {
261 throw new NotImplementedException ();
266 public class TypeParameterName : SimpleName
268 Attributes attributes;
271 public TypeParameterName (string name, Attributes attrs, Location loc)
272 : this (name, attrs, Variance.None, loc)
276 public TypeParameterName (string name, Attributes attrs, Variance variance, Location loc)
280 this.variance = variance;
283 public Attributes OptAttributes {
289 public Variance Variance {
296 public class GenericTypeExpr : TypeExpr
298 public GenericTypeExpr (DeclSpace t, Location l)
300 throw new NotImplementedException ();
303 public GenericTypeExpr (Type t, TypeArguments args, Location l)
305 throw new NotImplementedException ();
308 protected override TypeExpr DoResolveAsTypeStep (IResolveContext ec)
310 throw new NotImplementedException ();
313 public bool CheckConstraints (IResolveContext ec)
315 throw new NotImplementedException ();
318 public TypeArguments TypeArguments {
319 get { throw new NotImplementedException (); }
322 public bool VerifyVariantTypeParameters (IResolveContext rc)
324 throw new NotImplementedException ();
328 public class GenericMethod : DeclSpace
330 public GenericMethod (NamespaceEntry ns, DeclSpace parent, MemberName name,
331 Expression return_type, ParametersCompiled parameters)
332 : base (ns, parent, name, null)
334 throw new NotImplementedException ();
337 public override TypeBuilder DefineType ()
339 throw new NotImplementedException ();
342 public override bool Define ()
344 throw new NotImplementedException ();
347 public bool DefineType (EmitContext ec, MethodBuilder mb,
348 MethodInfo implementing, bool is_override)
350 throw new NotImplementedException ();
353 public void EmitAttributes ()
355 throw new NotImplementedException ();
358 internal static void Error_ParameterNameCollision (Location loc, string name, string collisionWith)
362 public override MemberCache MemberCache {
363 get { throw new NotImplementedException (); }
366 public override AttributeTargets AttributeTargets {
368 return AttributeTargets.Method | AttributeTargets.ReturnValue;
372 public override string DocCommentHeader {
376 public new void VerifyClsCompliance ()
378 throw new NotImplementedException ();
382 public class TypeArguments
386 public TypeArguments ()
388 args = new ArrayList ();
391 public TypeArguments (params Expression[] types)
393 args = new ArrayList (types);
396 public void Add (Expression type)
400 public void Add (TypeArguments new_args)
404 public bool Resolve (IResolveContext ec)
406 throw new NotImplementedException ();
409 public Type[] Arguments {
410 get { throw new NotImplementedException (); }
419 public TypeParameterName[] GetDeclarations ()
421 throw new NotImplementedException ();
424 public string GetSignatureForError ()
426 throw new NotImplementedException ();
429 public TypeArguments Clone ()
431 throw new NotImplementedException ();
435 public class TypeInferenceContext
437 public Type[] InferredTypeArguments;
439 public void AddCommonTypeBound (Type type)
441 throw new NotImplementedException ();
444 public void ExactInference (Type u, Type v)
446 throw new NotImplementedException ();
449 public Type InflateGenericArgument (Type t)
451 throw new NotImplementedException ();
454 public bool FixAllTypes ()
460 partial class TypeManager
462 public static Variance CheckTypeVariance (Type type, Variance v, MemberCore mc)
467 public static bool IsVariantOf (Type a, Type b)
472 public static TypeContainer LookupGenericTypeContainer (Type t)
474 throw new NotImplementedException ();