In class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine:
[mcs.git] / mcs / generic-mcs.cs
blob35be74a66624ca0afaa8a673544da5f1f2235aad
1 //
2 // generic.cs: Support classes for generics to reduce differences from GMCS
3 //
4 // Author:
5 // Raja R Harinath <rharinath@novell.com>
6 //
7 // Copyright 2006 Novell, Inc.
8 //
9 using System;
10 using System.Reflection;
11 using System.Reflection.Emit;
12 using System.Collections;
14 namespace Mono.CSharp
16 public enum Variance
18 None,
19 Covariant,
20 Contravariant
23 public enum SpecialConstraint
25 Constructor,
26 ReferenceType,
27 ValueType
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 {
66 get;
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)
133 // MemberContainer
136 public override bool Define ()
138 return true;
141 public void Define (Type t)
145 public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder cb, PredefinedAttributes pa)
147 throw new NotImplementedException ();
150 public override AttributeTargets AttributeTargets {
151 get { throw new NotImplementedException (); }
154 public override string[] ValidAttributeTargets {
155 get {
156 return new string [] { "type parameter" };
160 public Constraints Constraints {
161 get {
162 return null;
166 public override string DocCommentHeader {
167 get { throw new NotImplementedException (); }
170 public bool Resolve (DeclSpace ds)
172 throw new NotImplementedException ();
175 public bool DefineType (IResolveContext ec)
177 throw new NotImplementedException ();
180 public bool DefineType (IResolveContext ec, MethodBuilder builder,
181 MethodInfo implementing, bool is_override)
183 throw new NotImplementedException ();
186 public bool CheckDependencies ()
188 throw new NotImplementedException ();
191 public bool UpdateConstraints (IResolveContext ec, Constraints new_constraints)
193 throw new NotImplementedException ();
197 // IMemberContainer
200 public Type Type {
201 get { throw new NotImplementedException (); }
204 string IMemberContainer.Name {
205 get { throw new NotImplementedException (); }
208 public Variance Variance {
209 get { throw new NotImplementedException (); }
212 MemberCache IMemberContainer.BaseCache {
213 get { throw new NotImplementedException (); }
216 bool IMemberContainer.IsInterface {
217 get { throw new NotImplementedException (); }
220 MemberList IMemberContainer.GetMembers (MemberTypes mt, BindingFlags bf)
222 throw new NotImplementedException ();
225 public bool IsSubclassOf (Type t)
227 throw new NotImplementedException ();
230 public MemberList FindMembers (MemberTypes mt, BindingFlags bf,
231 MemberFilter filter, object criteria)
233 throw new NotImplementedException ();
236 public void SetConstraints (GenericTypeParameterBuilder type)
238 throw new NotImplementedException ();
242 public class TypeParameterExpr : TypeExpr
244 public TypeParameterExpr (TypeParameter type_parameter, Location loc)
246 throw new NotImplementedException ();
249 protected override TypeExpr DoResolveAsTypeStep (IResolveContext ec)
251 return null;
254 public TypeParameter TypeParameter {
255 get {
256 throw new NotImplementedException ();
261 public class TypeParameterName : SimpleName
263 Attributes attributes;
264 Variance variance;
266 public TypeParameterName (string name, Attributes attrs, Location loc)
267 : this (name, attrs, Variance.None, loc)
271 public TypeParameterName (string name, Attributes attrs, Variance variance, Location loc)
272 : base (name, loc)
274 attributes = attrs;
275 this.variance = variance;
278 public Attributes OptAttributes {
279 get {
280 return attributes;
284 public Variance Variance {
285 get {
286 return variance;
291 public class GenericTypeExpr : TypeExpr
293 public GenericTypeExpr (DeclSpace t, Location l)
295 throw new NotImplementedException ();
298 public GenericTypeExpr (Type t, TypeArguments args, Location l)
300 throw new NotImplementedException ();
303 protected override TypeExpr DoResolveAsTypeStep (IResolveContext ec)
305 throw new NotImplementedException ();
308 public bool CheckConstraints (IResolveContext ec)
310 throw new NotImplementedException ();
313 public TypeArguments TypeArguments {
314 get { throw new NotImplementedException (); }
317 public bool VerifyVariantTypeParameters (IResolveContext rc)
319 throw new NotImplementedException ();
323 public class GenericMethod : DeclSpace
325 public GenericMethod (NamespaceEntry ns, DeclSpace parent, MemberName name,
326 Expression return_type, ParametersCompiled parameters)
327 : base (ns, parent, name, null)
329 throw new NotImplementedException ();
332 public override TypeBuilder DefineType ()
334 throw new NotImplementedException ();
337 public override bool Define ()
339 throw new NotImplementedException ();
342 public bool DefineType (EmitContext ec, MethodBuilder mb,
343 MethodInfo implementing, bool is_override)
345 throw new NotImplementedException ();
348 public void EmitAttributes ()
350 throw new NotImplementedException ();
353 internal static void Error_ParameterNameCollision (Location loc, string name, string collisionWith)
357 public override MemberCache MemberCache {
358 get { throw new NotImplementedException (); }
361 public override AttributeTargets AttributeTargets {
362 get {
363 return AttributeTargets.Method | AttributeTargets.ReturnValue;
367 public override string DocCommentHeader {
368 get { return "M:"; }
371 public new void VerifyClsCompliance ()
373 throw new NotImplementedException ();
377 public class TypeArguments
379 ArrayList args;
381 public TypeArguments ()
383 args = new ArrayList ();
386 public TypeArguments (params Expression[] types)
388 args = new ArrayList (types);
391 public void Add (Expression type)
395 public void Add (TypeArguments new_args)
399 public bool Resolve (IResolveContext ec)
401 throw new NotImplementedException ();
404 public Type[] Arguments {
405 get { throw new NotImplementedException (); }
408 public int Count {
409 get {
410 return args.Count;
414 public TypeParameterName[] GetDeclarations ()
416 throw new NotImplementedException ();
419 public string GetSignatureForError ()
421 throw new NotImplementedException ();
424 public TypeArguments Clone ()
426 throw new NotImplementedException ();
430 public class TypeInferenceContext
432 public void ExactInference (Type u, Type v)
434 throw new NotImplementedException ();
437 public Type InflateGenericArgument (Type t)
439 throw new NotImplementedException ();
443 partial class TypeManager
445 public static Variance CheckTypeVariance (Type type, Variance v, MemberCore mc)
447 return v;
450 public static bool IsVariantOf (Type a, Type b)
452 return false;
455 public static TypeContainer LookupGenericTypeContainer (Type t)
457 throw new NotImplementedException ();