Alexandre Rocha Lima e Marcondes <alexandre@psl-pr.softwarelivre.org>
Rafael Teixeira <rafaelteixeirabr@hotmail.com>
* block.cs, statements.cs, expression.cs: Fix ForEach when iterating fields
* Some Test fixes
svn path=/trunk/mcs/; revision=51431
+2005-10-07 Maverson Eduardo Schulze Rosa <maverson@gmail.com>
+ Alexandre Rocha Lima e Marcondes <alexandre@psl-pr.softwarelivre.org>
+ Rafael Teixeira <rafaelteixeirabr@hotmail.com>
+
+ * block.cs, statements.cs, expression.cs: Fix ForEach when iterating fields
+
2005-10-05 Aldo Monteiro <aldo@psl-pr.softwarelivre.org>
* ecore.cs : Created a public property (Id) to access externally the field
2005-09-26 Maverson Eduardo Schulze Rosa <maverson@gmail.com>
Alexandre Rocha Lima e Marcondes <alexandre@psl-pr.softwarelivre.org>
- * mb-parser.jay: Fix For Each when using fields as the variable used
+ * mb-parser.jay: Fix ForEach when using fields as the variable used
to iterate through the elements.
* expression.cs: Created new LocalVariableReference EmitAssign used in
for each with non Static fields.
Sub New()
Dim arr() As Integer = {1, 2, 3}
For Each index In arr
- Console.WriteLine(index)
Next
End Sub
End If
End Sub
-End Module
\ No newline at end of file
+End Module
Sub main()
Dim c As New C1()
- If c.index <> "c" Then
+ If not c.index.Equals("c") Then
Throw New Exception("#FEC1")
End If
End Sub
if (vi.VariableType == null)
continue;
- vi.LocalBuilder = ig.DeclareLocal (vi.VariableType);
+ if (vi.Alias == null)
+ vi.LocalBuilder = ig.DeclareLocal (vi.VariableType);
- if (CodeGen.SymbolWriter != null)
+ if (CodeGen.SymbolWriter != null && vi.LocalBuilder != null)
vi.LocalBuilder.SetLocalSymInfo (name);
if (constants == null)
break;
}
}
- Console.WriteLine("teste Maverson");
+
if ((fb.ModFlags & Modifiers.STATIC) != 0) {
source.Emit (ec);
ig.Emit (OpCodes.Stsfld, fb.FieldBuilder);
//part of source assign emmited before this.
ILGenerator ig = ec.ig;
VariableInfo vi = VariableInfo;
-
+
vi.Assigned = true;
-
source.Emit (ec);
if ((fb.ModFlags & Modifiers.STATIC) != 0)
ig.Emit (OpCodes.Stsfld, fb.FieldBuilder);
if (expr == null)
return false;
+ if ( variable.VariableInfo.Alias != null )
+ {
+ FieldBase fb = variable.VariableInfo.GetFieldAlias(ec);
+
+ if ( fb == null )
+ {
+ Report.Error (451, loc,"Name '" + variable.VariableInfo.Name + "' is not declared.");
+ return false;
+ }
+ else
+ type = fb.Type;
+ }
+
var_type = ec.DeclSpace.ResolveType (type, false, loc);
if (var_type == null)
return false;
return false;
}
- if ( variable.VariableInfo.Alias != null )
- {
- if ( variable.VariableInfo.GetFieldAlias(ec) == null )
- {
- Report.Error (451, loc,"Name '" + variable.VariableInfo.Name + "' is not declared.");
- return false;
- }
- }
-
if (expr.Type.IsArray) {
array_type = expr.Type;
element_type = array_type.GetElementType ();