Flags flags;
ReadOnlyContext ro_context;
+ LocalBuilder builder;
public LocalInfo (Expression type, string name, Block block, Location l)
{
public LocalInfo (DeclSpace ds, Block block, Location l)
{
- VariableType = ds.TypeBuilder;
+ VariableType = ds.IsGeneric ? ds.CurrentType : ds.TypeBuilder;
Block = block;
Location = l;
}
var = theblock.ScopeInfo.GetCapturedVariable (this);
if (var == null) {
- LocalBuilder builder;
if (Pinned)
//
// This is needed to compile on both .NET 1.x and .NET 2.x
}
}
+ public void EmitSymbolInfo (EmitContext ec, string name)
+ {
+ if (builder != null)
+ ec.DefineLocalVariable (name, builder);
+ }
+
public bool IsThisAssigned (EmitContext ec, Location loc)
{
if (VariableInfo == null)
DoEmit (ec);
ec.Mark (EndLocation, true);
- if (emit_debug_info && is_lexical_block)
- ec.EndScope ();
+ if (emit_debug_info) {
+ if (is_lexical_block)
+ ec.EndScope ();
+
+ if (variables != null) {
+ foreach (DictionaryEntry de in variables) {
+ string name = (string) de.Key;
+ LocalInfo vi = (LocalInfo) de.Value;
+
+ vi.EmitSymbolInfo (ec, name);
+ }
+ }
+ }
ec.CurrentBlock = prev_block;
}
return false;
if (!Convert.ImplicitConversionExists (ec, e, expr_type)) {
- e.Error_ValueCannotBeConverted (e.Location, expr_type, false);
+ e.Error_ValueCannotBeConverted (ec, e.Location, expr_type, false);
return false;
}
TypeManager.CSharpName (t), TypeManager.CSharpSignature (mi));
return false;
}
+
+ // Always prefer generics enumerators
+ if (TypeManager.IsGenericType(mi.ReturnType))
+ continue;
+
Report.SymbolRelatedToPreviousError (result);
Report.SymbolRelatedToPreviousError (mi);
Report.Warning (278, 2, loc, "`{0}' contains ambiguous implementation of `{1}' pattern. Method `{2}' is ambiguous with method `{3}'",