edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/AstGenerator.cs;C853491
File: AstGenerator.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/AstGenerator.cs;C853491  (server)    6/2/2009 6:08 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/AstGenerator.cs;AstGen1
@@ -17,52 +17,49 @@
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
 using System.Diagnostics;
-using System.IO;
-using System.Dynamic;
-using System.Text;
 using System.Threading;
+using IronRuby.Builtins;
+using IronRuby.Compiler.Generation;
+using IronRuby.Runtime;
 using Microsoft.Scripting;
-using Microsoft.Scripting.Actions;
-using Microsoft.Scripting.Runtime;
+using Microsoft.Scripting.Generation;
 using Microsoft.Scripting.Utils;
-using IronRuby.Builtins;
-using IronRuby.Runtime;
-using IronRuby.Runtime.Calls;
-using IronRuby.Compiler.Generation;
+using AstUtils = Microsoft.Scripting.Ast.Utils;
+using MSA = System.Linq.Expressions;
 
 namespace IronRuby.Compiler.Ast {
     using Ast = System.Linq.Expressions.Expression;
-    using AstUtils = Microsoft.Scripting.Ast.Utils;
-    using MSA = System.Linq.Expressions;
-
-    internal class AstGenerator {
+    
+    internal sealed class AstGenerator {
         private static int _UniqueId;
 
         private readonly RubyContext/*!*/ _context;
         private readonly RubyCompilerOptions/*!*/ _compilerOptions;
-        private readonly SourceUnit/*!*/ _sourceUnit;
         private readonly MSA.SymbolDocumentInfo _document;
         private readonly RubyEncoding/*!*/ _encoding;
         private readonly Profiler _profiler;
+        private readonly bool _printInteractiveResult;
         private readonly bool _debugCompiler;
         private readonly bool _debugMode;
         private readonly bool _traceEnabled;
         private readonly bool _savingToDisk;
 
-        internal AstGenerator(RubyCompilerOptions/*!*/ options, SourceUnit/*!*/ sourceUnit, RubyEncoding/*!*/ encoding,
-            bool debugCompiler, bool debugMode, bool traceEnabled, bool profilerEnabled, bool savingToDisk) {
+        private MSA.Expression _sourcePathConstant; // lazy
 
-            Assert.NotNull(options, encoding, sourceUnit);
-            _context = (RubyContext)sourceUnit.LanguageContext;
+        internal AstGenerator(RubyContext/*!*/ context, RubyCompilerOptions/*!*/ options, MSA.SymbolDocumentInfo document, RubyEncoding/*!*/ encoding,
+            bool printInteractiveResult) {
+
+            Assert.NotNull(context, options, encoding);
+            _context = context;
             _compilerOptions = options;
-            _debugCompiler = debugCompiler;
-            _debugMode = debugMode;
-            _traceEnabled = traceEnabled;
-            _sourceUnit = sourceUnit;
-            _document = sourceUnit.Document;
+            _debugCompiler = Snippets.Shared.SaveSnippets;
+            _debugMode = context.DomainManager.Configuration.DebugMode;
+            _traceEnabled = context.RubyOptions.EnableTracing;
+            _document = document;
             _encoding = encoding;
-            _profiler = profilerEnabled ? Profiler.Instance : null;
-            _savingToDisk = savingToDisk;
+            _profiler = context.RubyOptions.Profile ? Profiler.Instance : null;
+            _savingToDisk = context.RubyOptions.SavePath != null;
+            _printInteractiveResult = printInteractiveResult;
         }
 
         public RubyCompilerOptions/*!*/ CompilerOptions { 
@@ -89,10 +86,27 @@
             get { return _savingToDisk; }
         }
 
-        public SourceUnit/*!*/ SourceUnit {
-            get { return _sourceUnit; }
+        public string SourcePath {
+            get { return _document != null ? _document.FileName : null; }
         }
 
+        public MSA.SymbolDocumentInfo Document {
+            get { return _document; }
+        }
+
+        public bool PrintInteractiveResult {
+            get { return _printInteractiveResult; }
+        }
+
+        public MSA.Expression/*!*/ SourcePathConstant {
+            get {
+                if (_sourcePathConstant == null) {
+                    _sourcePathConstant = Ast.Constant(SourcePath, typeof(string));
+                }
+                return _sourcePathConstant;
+            }
+        }
+
         public RubyEncoding/*!*/ Encoding {
             get { return _encoding; }
         }
@@ -101,6 +115,8 @@
             get { return _context; }
         }
 
+        internal Action<Expression, MSA.DynamicExpression> CallSiteCreated { get; set; }
+
         #region Lexical Scopes
 
         public abstract class LexicalScope {
@@ -287,26 +303,17 @@
             }
 
             // TODO: super call
-            // non-null if !IsTopLevelCode
+            // null for top-level code
             public string MethodName {
                 get { return _methodName; }
             }
 
             // TODO: super call
-            // non-null if !IsTopLevelCode
+            // null for top-level code
             public Parameters Parameters {
                 get { return _parameters; }
             }
 
-            // non-null if !IsTopLevelCode
-            public MSA.Expression CurrentMethodVariable {
-                get { return _currentMethodVariable; }
-            }
-
-            public bool IsTopLevelCode {
-                get { return _parentMethod == null; }
-            }
-
             public MethodScope(
                 ScopeBuilder/*!*/ builder,
                 MSA.Expression/*!*/ selfVariable,
@@ -352,13 +359,10 @@
         private LoopScope _currentLoop;
         private RescueScope _currentRescue;
         private VariableScope _currentVariableScope;
+
+        // inner-most module (available only if we enter a module declaration in the current AST, not available in eval'd code or in a method):
         private ModuleScope _currentModule;
 
-        // inner-most module (not reset by method definition):
-        public ModuleScope CurrentModule {
-            get { return _currentModule; }
-        }
-
         // inner-most method frame:
         public MethodScope/*!*/ CurrentMethod {
             get {
@@ -407,14 +411,6 @@
             get { return _currentVariableScope.Builder; }
         }
 
-        public ModuleScope GetCurrentNonSingletonModule() {
-            ModuleScope scope = CurrentModule;
-            while (scope != null && scope.IsSingleton) {
-                scope = scope.ParentModule;
-            }
-            return scope;
-        }
-
         #endregion
 
         #region Entering and Leaving Lexical Scopes
@@ -787,7 +783,11 @@
         }
 
         internal MSA.Expression/*!*/ AddDebugInfo(MSA.Expression/*!*/ expression, SourceSpan location) {
-            return Microsoft.Scripting.Ast.Utils.AddDebugInfo(expression, _document, location.Start, location.End);
+            if (_document != null) {
+                return AstUtils.AddDebugInfo(expression, _document, location.Start, location.End);
+            } else {
+                return expression;
+            }
         }
 
         internal MSA.Expression/*!*/ DebugMarker(string/*!*/ marker) {
@@ -798,9 +798,6 @@
             return _debugCompiler ? AstFactory.Block(Methods.X.OpCall(AstUtils.Constant(marker)), expression) : expression;
         }
 
-        internal virtual void TraceCallSite(Expression/*!*/ expression, MSA.DynamicExpression/*!*/ callSite) {
-        }
-
         internal MSA.Expression/*!*/ TryCatchAny(MSA.Expression/*!*/ tryBody, MSA.Expression/*!*/ catchBody) {
             var variable = CurrentScope.DefineHiddenVariable("#value", tryBody.Type);
 
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Ast/BlockDefinition.cs;C853491
File: BlockDefinition.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Ast/BlockDefinition.cs;C853491  (server)    6/2/2009 6:38 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Ast/BlockDefinition.cs;AstGen1
@@ -132,8 +132,8 @@
                 int firstStatementLine = _body.Count > 0 ? _body.First.Location.Start.Line : Location.End.Line;
                 int lastStatementLine = _body.Count > 0 ? _body.Last.Location.End.Line : Location.End.Line;
 
-                traceCall = Methods.TraceBlockCall.OpCall(scopeVariable, blockParameter, Ast.Convert(AstUtils.Constant(gen.SourceUnit.Path), typeof(string)), AstUtils.Constant(firstStatementLine));
-                traceReturn = Methods.TraceBlockReturn.OpCall(scopeVariable, blockParameter, Ast.Convert(AstUtils.Constant(gen.SourceUnit.Path), typeof(string)), AstUtils.Constant(lastStatementLine));
+                traceCall = Methods.TraceBlockCall.OpCall(scopeVariable, blockParameter, gen.SourcePathConstant, AstUtils.Constant(firstStatementLine));
+                traceReturn = Methods.TraceBlockReturn.OpCall(scopeVariable, blockParameter, gen.SourcePathConstant, AstUtils.Constant(lastStatementLine));
             } else {
                 traceCall = traceReturn = Ast.Empty();
             }
@@ -178,7 +178,7 @@
                 gen.CurrentSelfVariable,
                 BlockDispatcher.CreateLambda(
                     body,
-                    RubyExceptionData.EncodeMethodName(gen.SourceUnit, gen.CurrentMethod.MethodName, Location), 
+                    RubyExceptionData.EncodeMethodName(gen.CurrentMethod.MethodName, gen.SourcePath, Location), 
                     new ReadOnlyCollection<MSA.ParameterExpression>(parameters),
                     parameterCount,
                     attributes
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Ast/Declarations/MethodDeclaration.cs;C853491
File: MethodDeclaration.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Ast/Declarations/MethodDeclaration.cs;C853491  (server)    6/2/2009 6:30 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Ast/Declarations/MethodDeclaration.cs;AstGen1
@@ -84,11 +84,10 @@
         }
 
         private MSA.Expression/*!*/ TransformBody(AstGenerator/*!*/ gen, MSA.Expression/*!*/ methodDefinitionVariable) {
-            string encodedName = RubyExceptionData.EncodeMethodName(gen.SourceUnit, _name, Location);
+            string encodedName = RubyExceptionData.EncodeMethodName(_name, gen.SourcePath, Location);
             
             ScopeBuilder scope = new ScopeBuilder();
-            MSA.Expression parentScope = gen.CurrentScopeVariable;
-
+            
             MSA.ParameterExpression[] parameters = DefineParameters(gen, scope);
             MSA.Expression currentMethodVariable = scope.DefineHiddenVariable("#method", typeof(RubyMethodInfo));
             MSA.Expression rfcVariable = scope.DefineHiddenVariable("#rfc", typeof(RuntimeFlowControl));
@@ -125,13 +124,13 @@
             if (gen.TraceEnabled) {
                 traceCall = Methods.TraceMethodCall.OpCall(
                     scopeVariable, 
-                    Ast.Convert(AstUtils.Constant(gen.SourceUnit.Path), typeof(string)), 
+                    gen.SourcePathConstant, 
                     AstUtils.Constant(Location.Start.Line)
                 );
 
                 traceReturn = Methods.TraceMethodReturn.OpCall(
                     gen.CurrentScopeVariable,
-                    Ast.Convert(AstUtils.Constant(gen.SourceUnit.Path), typeof(string)),
+                    gen.SourcePathConstant,
                     AstUtils.Constant(Location.End.Line)
                 );
             } else {
@@ -147,7 +146,7 @@
                 Ast.Assign(currentMethodVariable, methodDefinitionVariable),
                 Ast.Assign(rfcVariable, Methods.CreateRfcForMethod.OpCall(AstUtils.Convert(blockParameter, typeof(Proc)))),
                 Ast.Assign(scopeVariable, Methods.CreateMethodScope.OpCall(
-                    scope.VisibleVariables(), parentScope, currentMethodVariable, rfcVariable, selfParameter, blockParameter,
+                    scope.VisibleVariables(), currentMethodVariable, rfcVariable, selfParameter, blockParameter,
                     EnterInterpretedFrameExpression.Instance
                 )),
             
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Ast/Expressions/MethodCall.cs;C853491
File: MethodCall.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Ast/Expressions/MethodCall.cs;C853491  (server)    6/2/2009 7:23 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Ast/Expressions/MethodCall.cs;AstGen1
@@ -109,7 +109,9 @@
             }
 
             var dynamicSite = callBuilder.MakeCallAction(methodName, hasImplicitSelf);
-            gen.TraceCallSite(node, dynamicSite);
+            if (gen.CallSiteCreated != null) {
+                gen.CallSiteCreated(node, dynamicSite);
+            }
 
             MSA.Expression result = gen.DebugMark(dynamicSite, methodName);
 
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Ast/Expressions/SuperCall.cs;C759835
File: SuperCall.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Ast/Expressions/SuperCall.cs;C759835  (server)    6/2/2009 7:10 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Ast/Expressions/SuperCall.cs;AstGen1
@@ -40,10 +40,6 @@
         }
 
         internal override MSA.Expression/*!*/ TransformRead(AstGenerator/*!*/ gen) {
-            if (gen.CurrentMethod.IsTopLevelCode && gen.CurrentBlock == null && !gen.CompilerOptions.IsEval) {
-                return Ast.Throw(Methods.MakeTopLevelSuperException.OpCall());
-            }
-
             // invoke super member action:
             CallBuilder callBuilder = new CallBuilder(gen);
 
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyContext.cs;C926894
File: RubyContext.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyContext.cs;C926894  (server)    6/2/2009 6:34 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyContext.cs;AstGen1
@@ -1805,14 +1805,11 @@
         internal Expression<T>/*!*/ TransformTree<T>(SourceUnitTree/*!*/ ast, SourceUnit/*!*/ sourceUnit, RubyCompilerOptions/*!*/ options) {
             return ast.Transform<T>(
                 new AstGenerator(
+                    this,
                     options,
-                    sourceUnit,
+                    sourceUnit.Document,
                     ast.Encoding,
-                    Snippets.Shared.SaveSnippets,
-                    DomainManager.Configuration.DebugMode,
-                    RubyOptions.EnableTracing,
-                    RubyOptions.Profile,
-                    RubyOptions.SavePath != null
+                    sourceUnit.Kind == SourceCodeKind.InteractiveCode
                 )
             );
         }
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyExceptionData.cs;C927503
File: RubyExceptionData.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyExceptionData.cs;C927503  (server)    6/2/2009 6:30 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyExceptionData.cs;AstGen1
@@ -266,9 +266,9 @@
         private const string RubyMethodPrefix = "\u2111\u211c;";
         private static int _Id = 0;
 
-        internal static string/*!*/ EncodeMethodName(SourceUnit sourceUnit, string/*!*/ methodName, SourceSpan location) {
+        internal static string/*!*/ EncodeMethodName(string/*!*/ methodName, string sourcePath, SourceSpan location) {
             // encodes line number, file name into the method name
-            string fileName = sourceUnit != null && sourceUnit.HasPath ? Path.GetFileName(sourceUnit.Path) : String.Empty;
+            string fileName = sourcePath != null ? Path.GetFileName(sourcePath) : null;
             return String.Format(RubyMethodPrefix + "{0};{1};{2};{3}", methodName, fileName, location.IsValid ? location.Start.Line : 0,
                 Interlocked.Increment(ref _Id));
         }
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyOps.cs;C927503
File: RubyOps.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyOps.cs;C927503  (server)    6/2/2009 6:09 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyOps.cs;AstGen1
@@ -89,11 +89,11 @@
         }
 
         [Emitted]
-        public static RubyMethodScope/*!*/ CreateMethodScope(LocalsDictionary/*!*/ locals, RubyScope/*!*/ parent,
+        public static RubyMethodScope/*!*/ CreateMethodScope(LocalsDictionary/*!*/ locals, 
             RubyMethodInfo/*!*/ methodDefinition, RuntimeFlowControl/*!*/ rfc, object selfObject, Proc blockParameter,
             InterpretedFrame interpretedFrame) {
 
-            RubyMethodScope scope = new RubyMethodScope(parent, methodDefinition, blockParameter, rfc, selfObject);
+            RubyMethodScope scope = new RubyMethodScope(methodDefinition.DeclaringScope, methodDefinition, blockParameter, rfc, selfObject);
             scope.SetDebugName("method " + methodDefinition.DefinitionName + ((blockParameter != null) ? "&" : null));
 
             scope.Frame = locals;
@@ -481,13 +481,13 @@
 
             if (instanceOwner != null) {
                 SetMethod(scope.RubyContext, instanceMethod = 
-                    new RubyMethodInfo(ast, clrMethod, instanceOwner, name, mandatory, optional, hasUnsplatParameter, instanceFlags)
+                    new RubyMethodInfo(ast, clrMethod, scope, instanceOwner, name, mandatory, optional, hasUnsplatParameter, instanceFlags)
                 );
             }
 
             if (singletonOwner != null) {
                 SetMethod(scope.RubyContext, singletonMethod =
-                    new RubyMethodInfo(ast, clrMethod, singletonOwner, name, mandatory, optional, hasUnsplatParameter, singletonFlags)
+                    new RubyMethodInfo(ast, clrMethod, scope, singletonOwner, name, mandatory, optional, hasUnsplatParameter, singletonFlags)
                 );
             }
 
@@ -1650,11 +1650,6 @@
         #region Class Variables
 
         [Emitted]
-        public static object GetObjectClassVariable(RubyScope/*!*/ scope, string/*!*/ name) {
-            return GetClassVariableInternal(scope.RubyContext.ObjectClass, name);
-        }
-
-        [Emitted]
         public static object GetClassVariable(RubyScope/*!*/ scope, string/*!*/ name) {
             // owner is the first module in scope:
             RubyModule owner = scope.GetInnerMostModuleForClassVariableLookup();
@@ -1670,13 +1665,6 @@
         }
 
         [Emitted]
-        public static object TryGetObjectClassVariable(RubyScope/*!*/ scope, string/*!*/ name) {
-            object value;
-            scope.RubyContext.ObjectClass.TryGetClassVariable(name, out value);
-            return value;
-        }
-
-        [Emitted]
         public static object TryGetClassVariable(RubyScope/*!*/ scope, string/*!*/ name) {
             object value;
             // owner is the first module in scope:
@@ -1685,12 +1673,6 @@
         }
 
         [Emitted]
-        public static bool IsDefinedObjectClassVariable(RubyScope/*!*/ scope, string/*!*/ name) {
-            object value;
-            return scope.RubyContext.ObjectClass.TryResolveClassVariable(name, out value) != null;
-        }
-
-        [Emitted]
         public static bool IsDefinedClassVariable(RubyScope/*!*/ scope, string/*!*/ name) {
             // owner is the first module in scope:
             RubyModule owner = scope.GetInnerMostModuleForClassVariableLookup();
@@ -1699,11 +1681,6 @@
         }
 
         [Emitted]
-        public static object SetObjectClassVariable(object value, RubyScope/*!*/ scope, string/*!*/ name) {
-            return SetClassVariableInternal(scope.RubyContext.ObjectClass, name, value);
-        }
-
-        [Emitted]
         public static object SetClassVariable(object value, RubyScope/*!*/ scope, string/*!*/ name) {
             return SetClassVariableInternal(scope.GetInnerMostModuleForClassVariableLookup(), name, value);
         }
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/CallSiteTracer.cs;C802160
File: CallSiteTracer.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/CallSiteTracer.cs;C802160  (server)    6/2/2009 6:34 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/CallSiteTracer.cs;AstGen1
@@ -56,7 +56,11 @@
 
             var context = (RubyContext)sourceUnit.LanguageContext;
             var siteNodes = new Dictionary<MSA.DynamicExpression, SourceSpan>();
-            var generator = new TraceAstGenerator(siteNodes, context, options, sourceUnit, ast.Encoding);
+
+            var generator = new AstGenerator(context, options, sourceUnit.Document, ast.Encoding, false) {
+                CallSiteCreated = (expression, callSite) => siteNodes.Add(callSite, expression.Location)
+            };
+
             var lambda = ast.Transform<T>(generator);
 
             return (MSA.Expression<T>)new CallSiteTraceInjector(siteNodes, sourceId).Visit(lambda);
@@ -101,20 +105,6 @@
             }
         }
 
-        private sealed class TraceAstGenerator : AstGenerator {
-            private readonly Dictionary<MSA.DynamicExpression, SourceSpan>/*!*/ _sites;
-
-            public TraceAstGenerator(Dictionary<MSA.DynamicExpression, SourceSpan>/*!*/ sites,
-                RubyContext/*!*/ context, RubyCompilerOptions/*!*/ options, SourceUnit/*!*/ sourceUnit, RubyEncoding/*!*/ encoding)
-                : base(options, sourceUnit, encoding, false, context.DomainManager.Configuration.DebugMode, false, false, false) {
-                _sites = sites;
-            }
-
-            internal override void TraceCallSite(Expression/*!*/ expression, MSA.DynamicExpression/*!*/ callSite) {
-                _sites.Add(callSite, expression.Location);
-            }
-        }
-
         private sealed class CallSiteTraceInjector : MSA.ExpressionVisitor {
             private readonly Dictionary<MSA.DynamicExpression, SourceSpan>/*!*/ _sites;
             private readonly int _sourceId;
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/RubyMethodInfo.cs;C858237
File: RubyMethodInfo.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/RubyMethodInfo.cs;C858237  (server)    6/2/2009 6:56 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/RubyMethodInfo.cs;AstGen1
@@ -42,6 +42,7 @@
 
         private readonly Delegate/*!*/ _method;
         private readonly string/*!*/ _definitionName;
+        private readonly RubyScope/*!*/ _declaringScope;
 
         private readonly int _mandatoryParamCount;
         private readonly int _optionalParamCount;  
@@ -52,9 +53,10 @@
         public int MandatoryParamCount { get { return _mandatoryParamCount; } }
         public int OptionalParamCount { get { return _optionalParamCount; } }
         public bool HasUnsplatParameter { get { return _hasUnsplatParameter; } }
+        public RubyScope/*!*/ DeclaringScope { get { return _declaringScope; } }
 
         // method:
-        internal RubyMethodInfo(object/*!*/ ast, Delegate/*!*/ method, RubyModule/*!*/ declaringModule, 
+        internal RubyMethodInfo(object/*!*/ ast, Delegate/*!*/ method, RubyScope/*!*/ declaringScope, RubyModule/*!*/ declaringModule, 
             string/*!*/ definitionName, int mandatory, int optional, bool hasUnsplatParameter, RubyMemberFlags flags)
             : base(flags, declaringModule) {
             Assert.NotNull(ast, method, declaringModule, definitionName);
@@ -65,10 +67,11 @@
             _optionalParamCount = optional;
             _hasUnsplatParameter = hasUnsplatParameter;
             _definitionName = definitionName;
+            _declaringScope = declaringScope;
         }
 
         protected internal override RubyMemberInfo/*!*/ Copy(RubyMemberFlags flags, RubyModule/*!*/ module) {
-            return new RubyMethodInfo(_ast, _method, module, _definitionName, _mandatoryParamCount, _optionalParamCount, 
+            return new RubyMethodInfo(_ast, _method, _declaringScope, module, _definitionName, _mandatoryParamCount, _optionalParamCount, 
                 _hasUnsplatParameter, flags
             );
         }
===================================================================
