Author: marek
Date: 2007-08-31 12:20:08 -0400 (Fri, 31 Aug 2007)
New Revision: 85139
Modified:
trunk/mcs/mcs/ChangeLog
trunk/mcs/mcs/anonymous.cs
trunk/mcs/mcs/ecore.cs
trunk/mcs/mcs/expression.cs
trunk/mcs/mcs/statement.cs
Log:
2007-08-31 Marek Safar <[EMAIL PROTECTED]>
* anonymous.cs: Use shorter type prefix.
* ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
when exist.
* expression.cs (LocalVariableReference.DoResolveBase): Don't capture
variables when probing is on.
* statement.cs (LocaLInfo.Clone): Clone correctly resolved and
unresolved variables.
(TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
handle transparent identifiers.
Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog 2007-08-31 15:40:53 UTC (rev 85138)
+++ trunk/mcs/mcs/ChangeLog 2007-08-31 16:20:08 UTC (rev 85139)
@@ -1,3 +1,18 @@
+2007-08-31 Marek Safar <[EMAIL PROTECTED]>
+
+ * anonymous.cs: Use shorter type prefix.
+
+ * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
+ when exist.
+
+ * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
+ variables when probing is on.
+
+ * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
+ unresolved variables.
+ (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
+ handle transparent identifiers.
+
2007-08-26 Marek Safar <[EMAIL PROTECTED]>
* attribute.cs (IsClsCompliant): Add nullable types test.
Modified: trunk/mcs/mcs/anonymous.cs
===================================================================
--- trunk/mcs/mcs/anonymous.cs 2007-08-31 15:40:53 UTC (rev 85138)
+++ trunk/mcs/mcs/anonymous.cs 2007-08-31 16:20:08 UTC (rev 85139)
@@ -1856,7 +1856,7 @@
public class AnonymousTypeClass : CompilerGeneratedClass
{
static int types_counter;
- public const string ClassNamePrefix = "<>__AnonymousType";
+ public const string ClassNamePrefix = "<>__AnonType";
public const string SignatureForError = "anonymous type";
static readonly IntConstant FNV_prime = new IntConstant
(16777619, Location.Null);
Modified: trunk/mcs/mcs/ecore.cs
===================================================================
--- trunk/mcs/mcs/ecore.cs 2007-08-31 15:40:53 UTC (rev 85138)
+++ trunk/mcs/mcs/ecore.cs 2007-08-31 16:20:08 UTC (rev 85139)
@@ -2298,6 +2298,13 @@
else
return pref.Resolve (ec);
}
+
+ Expression expr =
current_block.Toplevel.GetTransparentIdentifier (Name);
+ if (expr != null) {
+ if (right_side != null)
+ return expr.ResolveLValue (ec,
right_side, loc);
+ return expr.Resolve (ec);
+ }
}
//
Modified: trunk/mcs/mcs/expression.cs
===================================================================
--- trunk/mcs/mcs/expression.cs 2007-08-31 15:40:53 UTC (rev 85138)
+++ trunk/mcs/mcs/expression.cs 2007-08-31 16:20:08 UTC (rev 85139)
@@ -3642,9 +3642,12 @@
return null;
}
- ScopeInfo scope =
local_info.Block.CreateScopeInfo ();
- variable = scope.AddLocal (local_info);
- type = variable.Type;
+ if (!ec.IsInProbingMode)
+ {
+ ScopeInfo scope =
local_info.Block.CreateScopeInfo ();
+ variable = scope.AddLocal (local_info);
+ type = variable.Type;
+ }
}
return this;
@@ -8916,6 +8919,13 @@
this.loc = loc;
this.initializer = initializer;
}
+
+ public AnonymousTypeParameter (Parameter parameter)
+ {
+ this.Name = parameter.Name;
+ this.loc = parameter.Location;
+ this.initializer = new SimpleName (Name, loc);
+ }
protected override void CloneTo (CloneContext clonectx,
Expression target)
{
Modified: trunk/mcs/mcs/statement.cs
===================================================================
--- trunk/mcs/mcs/statement.cs 2007-08-31 15:40:53 UTC (rev 85138)
+++ trunk/mcs/mcs/statement.cs 2007-08-31 16:20:08 UTC (rev 85139)
@@ -1431,8 +1431,18 @@
public LocalInfo Clone (CloneContext clonectx)
{
- // Only this kind is created by the parser.
- return new LocalInfo (Type.Clone (clonectx), Name,
clonectx.LookupBlock (Block), Location);
+ //
+ // Variables in anonymous block are not resolved yet
+ //
+ if (VariableType == null)
+ return new LocalInfo (Type.Clone (clonectx),
Name, clonectx.LookupBlock (Block), Location);
+
+ //
+ // Variables in method block are resolved
+ //
+ LocalInfo li = new LocalInfo (null, Name,
clonectx.LookupBlock (Block), Location);
+ li.VariableType = VariableType;
+ return li;
}
}
@@ -2497,6 +2507,11 @@
return true;
}
+ public virtual Expression GetTransparentIdentifier (string name)
+ {
+ return null;
+ }
+
void ProcessParameters ()
{
int n = parameters.Count;
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches