+ //
+ // Different context is needed when resolving type container base
+ // types. Type names come from the parent scope but type parameter
+ // names from the container scope.
+ //
+ struct BaseContext : IResolveContext
+ {
+ TypeContainer tc;
+
+ public BaseContext (TypeContainer tc)
+ {
+ this.tc = tc;
+ }
+
+ #region IResolveContext Members
+
+ public DeclSpace DeclContainer {
+ get { return tc.Parent; }
+ }
+
+ public bool IsInObsoleteScope {
+ get { return tc.IsInObsoleteScope; }
+ }
+
+ public bool IsInUnsafeScope {
+ get { return tc.IsInUnsafeScope; }
+ }
+
+ public FullNamedExpression LookupNamespaceOrType (string name, Location loc, bool ignore_cs0104)
+ {
+ return tc.Parent.LookupNamespaceOrType (name, loc, ignore_cs0104);
+ }
+
+ public DeclSpace GenericDeclContainer {
+ get { return tc.GenericDeclContainer; }
+ }
+
+ #endregion
+ }
+