1 2007-02-26 Marek Safar <marek.safar@gmail.com>
3 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
5 2007-02-20 Marek Safar <marek.safar@gmail.com>
8 * cs-parser.jay: Anonymous container starts at constructor declaration
9 and not at block beginning because it has to be usable in constructor
12 2007-02-18 Marek Safar <marek.safar@gmail.com>
14 A fix for bug #80493 by Atsushi Enomoto
15 * cs-parser.jay: Ignore invalid attribute target.
17 2007-02-15 Miguel de Icaza <miguel@novell.com>
19 * Remove the call to SetExpression for lambda expressions, we do
22 Remove expression tracking code as its not needed.
24 2007-02-11 Miguel de Icaza <miguel@novell.com>
26 * cs-parser.jay (lambda_expression_body): when the body is an
27 expression add a statement of the form:
29 contextual-return expression.
31 Where `contextual-return' is similar to `return', the difference
32 being that if the delegate that the lambda will be converted to
33 has a void return type, it will check that the result is a
34 ExpressionStatement and the result is a plain ret (no return
35 values on the stack). If the return type of the delegate is of a
36 given type, this turns into a return with a value and does the
37 regular checking to check that the computed value can be
38 implicitly converted to the delegate return.
40 2007-01-30 Miguel de Icaza <miguel@novell.com>
42 * cs-parser.jay (anonymous_method_expression): move the
43 before/after productions to the start_anonymous and end_anonymous
44 methods so the code can be reused for lambda functions.
46 (lambda_expression_body): wrap expressions implicitly into a
49 (block): factor out the setup/teardown of parsing a block so we
50 can reuse that in lambda_expression_body
52 (lambda_expression): use new anonymous method helper methods.
54 2007-01-29 Miguel de Icaza <miguel@novell.com>
56 * cs-parser.jay: oob_stack make it static (am guessing that is why
57 we no longer initialize it anymore) and reuse it across
60 2007-01-28 Miguel de Icaza <miguel@novell.com>
62 * cs-parser.jay (open_parens): Introduce new non-terminal that
63 abstracts OPEN_PARENS and OPEN_PARENS_LAMBDA as the later can now
64 be returned in places where types are followed by identifiers
65 (this is expected in declaration, fixed, using, foreach and catch
68 Use open_parens in those places, keep OPEN_PARENS in the
71 cs-parser.jay: New grammar bits for parsing lambda expressions.
73 2007-01-28 Raja R Harinath <rharinath@novell.com>
75 Fix #80534, gtest-309.cs
76 * generic.cs (UnifyType): Rename from InferType. Make unification
77 of generic insts simpler and don't insist on inferring all generic
78 parameters in a single generic inst unification.
80 (InferGenericInstance): Remove.
81 Analysis and initial patch by David Mitchell <dmitchell@logos.com>.
83 2007-01-20 Marek Safar <marek.safar@gmail.com>
85 * cs-parser.jay: Better parameter error handling.
87 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
88 Raja R Harinath <rharinath@novell.com>
90 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
91 Note the order in which accessors are declared in the source.
93 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
95 * generic.cs (TypeParameter.FindMembers): Use the generic
96 constraints, not the constraints to check for methods (first fix
99 2006-12-30 Marek Safar <marek.safar@gmail.com>
101 * cs-parser.jay: Better syntax errors handling.
103 2006-11-21 Marek Safar <marek.safar@gmail.com>
105 * cs-parser.jay: Tiny change to work with mcs tokenizer.
107 * cs-tokenizer.cs: Remove after unification with mcs.
109 2006-10-28 Marek Safar <marek.safar@gmail.com>
112 * generic.cs (ConstructedType.AsAccessible): Check accessibility of type
115 2006-10-26 Marek Safar <marek.safar@gmail.com>
118 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous methods.
120 2006-10-25 Brian Crowell <brian@fluggo.com>
123 * generic.cs (CheckConstraints): Allow generic parameters with
124 inheritance constraints to satisfy reference type constraints.
126 2006-10-09 Martin Baulig <martin@ximian.com>
129 (NullCoalescingOperator.DoResolve): Fix #78964; added gtest-294.cs.
131 2006-09-25 Martin Baulig <martin@ximian.com>
133 * class.cs: Remove after unification with mcs source.
135 2006-09-24 Raja R Harinath <harinath@gmail.com>
137 * convert.cs: Remove after unification with mcs source.
139 2006-09-24 Marek Safar <marek.safar@seznam.cz>
141 * class.cs (MemberBase.VerifyClsCompliance): When method has type
142 parameters verify them as well.
144 * generic.cs (Constraints.VerifyClsCompliance): Verify CLS-Compliance of
145 the type parameter constraints.
146 (Generics.VerifyClsCompliance): Ditto.
148 2006-09-24 Marek Safar <marek.safar@seznam.cz>
150 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
151 for anonymous block with out argument.
153 2006-09-24 Marek Safar <marek.safar@seznam.cz>
155 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
156 not used private events only.
158 2006-09-23 Marek Safar <marek.safar@seznam.cz>
160 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
162 * cs-parser.jay: Parse correctly cast of default (T).
164 * generic.cs (DefaultValueExpression.DoResolve): Check for void type.
165 Store original type via EmptyConstantCast.
167 2006-09-22 Martin Baulig <martin@ximian.com>
169 * delegate.cs: Removed; this file is now shared with mcs.
171 * attribute.cs: Removed; this file is now shared with mcs.
173 2006-09-22 Martin Baulig <martin@ximian.com>
175 * ecore.cs: Removed; this file is now shared with mcs.
177 2006-09-21 Marek Safar <marek.safar@seznam.cz>
179 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
181 * ecore.cs (NullCast): Derives from NullConstant.
183 * generic.cs (DefaultValueExpression): Fixed to cope with the constant
186 2006-09-21 Martin Baulig <martin@ximian.com>
188 * decl.cs: Removed; this file is now shared with mcs.
190 2006-09-21 Raja R Harinath <rharinath@novell.com>
192 * rootcontext.cs: Remove after unification with mcs source.
194 * report.cs: Remove after unification with mcs source.
195 * generic.cs (AddTypeParameter, LookupTypeParameter): Move to
197 (InitGenerics, CleanUpGenerics): Remove.
199 * support.cs: Remove after unification with mcs source.
201 2006-09-20 Raja R Harinath <rharinath@novell.com>
203 * codegen.cs: Remove after unification with mcs source.
205 2006-09-19 Martin Baulig <martin@ximian.com>
207 * expression.cs: Removed; this file is now shared with mcs.
209 2006-09-19 Martin Baulig <martin@ximian.com>
212 (TypeManager.IsEqual): Moved into ../mcs/typemanager.cs.
213 (TypeManager.DropGenericTypeArguments): Likewise.
214 (TypeManager.DropGenericMethodArguments): Likewise.
215 (TypeManager.GetTypeArguments): Likewise.
216 (TypeManager.HasGenericArguments): Likewise.
218 2006-09-19 Martin Baulig <martin@ximian.com>
220 * ecore.cs (PropertyExpr.InstanceResolve): Fix the CS1540 check.
222 2006-09-19 Martin Baulig <martin@ximian.com>
224 * typemanager.cs: Removed; this file is now shared with mcs.
226 2006-09-16 Raja R Harinath <rharinath@novell.com>
228 * Makefile (LOCAL_MCS_FLAGS): Use instead of PROFILE_MCS_FLAGS.
229 * AssemblyInfo.cs, driver.cs: Remove after unification with mcs source.
231 2006-09-16 Marek Safar <marek.safar@seznam.cz>
234 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
235 only if parent type is class.
236 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
239 2006-09-15 Marek Safar <marek.safar@seznam.cz>
242 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
244 * typemanager.cs(CSharpName): Converts NullType to null.
246 2006-09-15 Martin Baulig <martin@ximian.com>
248 * pending.cs: Removed; this file is now shared with mcs.
250 2006-09-15 Martin Baulig <martin@ximian.com>
252 * statement.cs: Removed; this file is now shared with mcs.
254 2006-09-15 Martin Baulig <martin@ximian.com>
256 * rootcontext.cs (RootContext.BrokenCircularDeps): Removed.
258 * driver.cs: Removed the `--broken-cycles' argument.
260 2006-09-15 Martin Baulig <martin@ximian.com>
262 * namespace.cs: Removed; this file is now shared with mcs.
264 2006-09-15 Martin Baulig <martin@ximian.com>
266 * decl.cs (MemberName): Minor code cleanups.
268 2006-09-15 Martin Baulig <martin@ximian.com>
270 * parameter.cs: Removed; this file is now shared with mcs.
272 2006-09-15 Martin Baulig <martin@ximian.com>
274 * enum.cs: Removed; this file is now shared with mcs.
276 2006-09-15 Martin Baulig <martin@ximian.com>
278 * Makefile: Define `GMCS_SOURCE'.
280 * flowanalysis.cs: Removed; this file is now shared with mcs.
282 2006-09-15 Martin Baulig <martin@ximian.com>
284 Removed modifiers.cs, literal.cs, location.cs, roottypes.cs,
285 assign.cs, const.cs, cfold.cs, constant.cs, symbolwriter.cs and
286 doc.cs - they are now shared with mcs.
288 * gmcs.exe.sources: Include these files from ../mcs/.
290 2006-09-15 Martin Baulig <martin@ximian.com>
292 * old-code.cs, gen-il.cs, gen-treedump.cs: Removed old stuff.
293 * g1.cs, sample-hello.cs, sample-stack.il: Likewise.
295 2006-09-14 Marek Safar <marek.safar@seznam.cz>
297 * assign.cs, ecore.cs, expression.cs: Share error message text.
298 * class.cs (FieldMember.Define): Check for variable of static type.
299 * decl.cs (check_type_parameter): Report correct type name.
300 * driver.cs (LoadAssembly): Uses error output for errors.
301 * generic.cs (Constraints.Resolve): Add check for constraint accessibility
302 (TypeArguments.Resolve): Static class cannot be used as an argument.
303 * statement.cs (ResolveMeta): Constants cannot be generic types.
305 2006-09-12 Martin Baulig <martin@ximian.com>
307 * generic.cs (TypeManager.IsIList): Moved into convert.cs.
309 * convert.cs (Convert.Array_To_IList): Moved here and correctly
310 implement it; fixes #79345.
312 2006-09-08 Marek Safar <marek.safar@seznam.cz>
314 * decl.cs (DeclSpace.SetParameterInfo): Check for nonexistent type
316 * expression.cs (TypeOf.GetAttributableValue): Check for open generic
318 * generic.cs: Improved error messages.
319 * typemanager.cs (RemoveGenericArity): Made public.
321 2006-09-08 Martin Baulig <martin@ximian.com>
323 * typemanager.cs (TypeManager.interlocked_type): New public field.
324 (TypeManager.int_interlocked_compare-exchange): New public field.
325 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
326 enumerator types here and call InitGenericCoreTypes().
327 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
328 after calling InitEnumUnderlyingTypes().
331 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
332 `classes_second_stage'.
334 2006-09-07 Marek Safar <marek.safar@seznam.cz>
336 * class.cs, generic.cs (GenericMethod.Define): Check for type parameter
338 * statement.cs (Block.Variables): Made public.
340 2006-09-07 Martin Baulig <martin@ximian.com>
343 (MainDriver): Revert r62663 from Marek; see #70506 for details.
345 2006-09-01 Martin Baulig <martin@ximian.com>
348 (TypeManager.IsIList): Also handle base classes and interfaces.
350 2006-09-01 Raja R Harinath <rharinath@novell.com>
353 * expression.cs (Invocation.MoreSpecific): Check for reference
356 2006-08-29 Miguel de Icaza <miguel@novell.com>
358 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
360 2006-08-17 Miguel de Icaza <miguel@novell.com>
362 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
363 #52019 and #79064, the use of the \uXXXX sequence in source code
364 to represent unicode characters.
366 2006-08-15 Marek Safar <marek.safar@seznam.cz>
368 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
370 * class.cs, ecore.cs, statement.cs: Merged to one error message.
372 2006-08-14 Raja R Harinath <rharinath@novell.com>
375 * cs-tokenizer.cs (parse_less_than): Allow '*' to appear in a type
376 parameter too. This only avoids a parse error -- the semantic
377 error is caught elsewhere.
379 2006-08-13 Miguel de Icaza <miguel@novell.com>
381 * assign.cs: Catch attempts to assign to a method groups in += and
384 2006-08-13 Marek Safar <marek.safar@seznam.cz>
387 * cs-parser.jay: Don't destroy current array type by typeof of array's.
389 2006-08-12 Marek Safar <marek.safar@seznam.cz>
391 * cs-parser.jay: Check whether a constraint clause has already been
392 specified for type parameter.
393 * generic.cs (Constraints): Exposed location.
395 2006-08-12 Marek Safar <marek.safar@seznam.cz>
397 * class.cs (Method.Define): Issue a warning when generic method looks like
399 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
401 * report.cs: New warning number.
403 2006-08-09 Marek Safar <marek.safar@seznam.cz>
405 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
407 * decl.cs (MemberCache.FindMembers): When container is interface we need to
408 search all base interfaces as a member can be ambiguous.
409 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
410 Constructor member type filter.
411 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
412 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
413 reporting for returned memberinfos.
414 * report.cs: Updated.
415 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
416 version to work on all runtimes.
417 (TypeManager.RealMemberLookup): Removed members filtering.
419 2006-08-08 Raja R Harinath <rharinath@novell.com>
421 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
422 (PropertyExpr.EmitAssign): Likewise.
423 * expression.cs (Indirection.EmitAssign): Likewise.
424 (LocalVariableReference.EmitAssign): Likewise.
425 (ParameterReference.EmitAssign): Likewise.
426 (Invocation.EmitArguments): Likewise.
427 (ArrayAccess.EmitAssign): Likewise.
428 (IndexerAccess.EmitAssign): Likewise.
429 (This.EmitAssign): Likewise.
430 (ConditionalLogicalOperator.Emit): Likewise.
433 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
434 instead of ArrayList. If the hashtable has a LocalBuilder, don't
435 leave it in after returning it.
436 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
438 2006-08-06 Marek Safar <marek.safar@seznam.cz>
440 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
443 2006-08-05 Marek Safar <marek.safar@seznam.cz>
445 * class.cs (TypeContainer.AddPartial): Add check for partial declarations
446 with different type names.
447 (TypeContainer.UpdateTypeParameterConstraints): Updated an error message.
449 2006-08-03 Raja R Harinath <rharinath@novell.com>
451 Fix cs0146-3.cs and cs0146-4.cs.
452 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
453 enclosing types don't depend on the current type.
455 2006-08-02 Raja R Harinath <rharinath@novell.com>
458 * class.cs (TypeContainer.DoDefineMembers): Use
459 FindBaseMemberWithSameName on Parent, since we're interested in
460 whether we hide inherited members or not.
461 (FindBaseMemberWithSameName): Make slightly more robust.
464 * codegen.cs (IResolveContext.GenericDeclContainer): New.
465 (EmitContext): Implement new interface requirement.
466 * namespace.cs (UsingEntry, LocalAliasEntry): Likewise.
467 * decl.cs (MemberCore): Likewise.
468 (DeclSpace.GenericDeclContainer): Rename from DeclContainer.
469 * ecore.cs (SimpleName.ResolveAsTypeTerminal): Use
470 ec.GenericDeclContainer to check for generic parameters.
471 (SimpleName.DoSimpleNameResolve): Likewise.
472 * generic.cs (TypeParameter.DeclContainer): Remove override.
474 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
475 declspaces for doppelgangers too.
476 (UsingEntry): Implement IResolveContext.
477 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
478 'this' as the resolve context.
479 (LocalAliasEntry): Likewise.
481 Implement parts of #77403
482 * roottypes.cs (RootDeclSpace): New. Used to represent the
483 toplevel declaration space. Each namespace declaration introduces
484 a "partial" root declaretion space.
485 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
486 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
487 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
488 from 'current_namespace.SlaveDeclSpace'.
489 (namespace_declaration): Likewise.
490 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
491 check. It can't happen now.
492 * decl.cs (DeclSpace.LookupType): Likewise.
493 * driver.cs (MainDriver): Sanity check.
495 2006-08-01 Raja R Harinath <rharinath@novell.com>
497 * decl.cs (DeclSpace.FindNestedType): Remove.
498 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
499 LookupTypeContainer to get the container of the nested type.
500 * class.cs (TypeContainer.FindNestedType): Make non-override.
502 2006-07-31 Raja R Harinath <rharinath@novell.com>
504 * decl.cs (DeclSpace.PartialContainer): Move field from ...
505 * class.cs (TypeContainer.PartialContainer): ... here.
506 (TypeContainer.AddBasesForPart): New helper.
507 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
509 * cs-parser.jay (current_class): Convert to DeclSpace.
510 (struct_declaration, interface_declaration, class_declaration):
511 Use AddBasesForPart instead of .Bases directly.
512 * const.cs, iterators.cs: Update to changes.
514 2006-07-28 Raja R Harinath <rharinath@novell.com>
516 * class.cs (TypeContainer.AddMemberType): Rename from
518 (TypeContainer.AddMember): Rename from AddToMemberContainer.
519 (AddTypeContainer): New. Combine AddClassOrStruct and
521 (AddPartial): Update. Add 'is_partial' argument.
522 * roottypes.cs: Update to changes.
523 * cs-parser.jay (push_current_class): New helper for handling
524 current_container and current_class.
525 (struct_declaration, interface_declaration, class_declaration):
528 2006-07-26 Raja R Harinath <rharinath@novell.com>
530 * roottypes.cs: Rename from tree.cs.
532 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
533 * tree.cs (Tree, ITreeDump): Remove types.
534 * rootcontext.cs (tree, Tree): Remove fields.
535 (root, ToplevelTypes): New.
536 * *.cs: Update to rename.
538 * tree.cs (Tree.RecordDecl): Remove.
539 (RootTypes.AddToTypeContainer): Record the toplevel type in its
541 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
543 2006-07-23 Raja R Harinath <harinath@gmail.com>
545 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
546 DoFlowAnalysis and OmitStructFlowAnalysis here.
547 (ec.With): Rename from WithUnsafe and generalize.
548 (ec.WithCheckState): Remove. All users can be handled by 'With'.
549 (ec.WithFlowAnalyis): New.
550 * ecore.cs, expression.cs, statement.cs: Update.
552 2006-07-22 Raja R Harinath <harinath@gmail.com>
554 * statement.cs (Block.ResolveMeta): Simplify slightly.
556 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
557 multiple boolean fields. Convert InUnsafe, constant_check_state,
558 check_state to flags.
559 (CheckState, ConstantCheckState): Update.
560 (InUnsafe): New read-only property.
561 (FlagsHandle): Rename from CheckStateHandle and convert to handle
563 (WithUnsafe): New helper similar to WithCheckState.
564 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
565 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
567 2006-07-21 Raja R Harinath <rharinath@novell.com>
569 Make comparisons use the same IL irrespective of whether they're
570 in a 'checked' or 'unchecked' context: one of the issues in #78899
571 * codegen.cs (EmitContext.CheckState): Make read-only property.
572 (EmitContext.ConstantCheckState): Likewise.
573 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
574 helper that implement a save/restore stack for CheckState
575 values. This is the only way to change check-state.
576 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
577 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
578 (CheckedExpr.EmitBranchable): New forwarding method.
579 (UnCheckedExpr): Likewise.
580 * statement.cs (Block.ResolveMeta): Use WithCheckState.
581 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
582 (Checked.Resolve, checked.DoEmit): Likewise.
584 2006-07-21 Martin Baulig <martin@ximian.com>
586 * generic.cs (TypeManager.InferType): When inferring an array
587 type, also allow IList<T> and ICollection<T>. Fixes #78900.
589 2006-07-21 Martin Baulig <martin@ximian.com>
591 * generic.cs (TypeManager.IsIEnumerable): Renamed into IsIList()
592 and allow IList`1 and all its base interfaces.
594 * convert.cs (Convert.ImplicitReferenceConversion): Allow
595 converting from an array-type of T to IList<T>.
597 2006-07-21 Martin Baulig <martin@ximian.com>
599 * ecore.cs (SimpleName.DoSimpleNameResolve): Added CS0307 check.
601 2006-07-20 Miguel de Icaza <miguel@novell.com>
603 * anonymous.cs: Cache the resolved anonymous delegate, and return
604 this so that the ResolveTopBlock is only triggered once, not
607 Currently we trigger ResolvetopBlock twice due to a first pass of
608 argument check compatibility, and a second pass that does the
611 2006-07-15 Marek Safar <marek.safar@seznam.cz>
613 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
615 * rootcontext.cs (Reset): Add helper_classes.
617 2006-07-15 Marek Safar <marek.safar@seznam.cz>
620 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
623 2006-07-13 Miguel de Icaza <miguel@novell.com>
625 * statement.cs (Lock): Handle expressions of type
626 TypeManager.null_type specially. Fixes #78770
628 2006-07-08 Marek Safar <marek.safar@seznam.cz>
630 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
633 2006-07-08 Marek Safar <marek.safar@seznam.cz>
635 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
636 for accessors as well.
637 * ecore.cs (EventExpr): Add AccessorTable.
639 2006-07-03 Martin Baulig <martin@ximian.com>
641 * ecore.cs (UnboxCast.Emit): Also use `Unbox_Any' for generic
642 instances of value types.
644 * convert.cs (Convert.ExplicitConversion): Correctly handle
645 object->nullable conversions.
647 2006-07-01 Marek Safar <marek.safar@seznam.cz>
650 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
651 for CS0122 where appropriate.
652 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
654 (Filter): Assembly can be null in the case of top level attributes.
656 2006-06-28 Raja R Harinath <rharinath@novell.com>
659 * generic.cs (TypeManager.InferParamsTypeArguments): If there are
660 no arguments, return 'false': nothing can be inferred.
662 2006-06-25 Marek Safar <marek.safar@seznam.cz>
666 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
667 is done at global level.
669 2006-06-24 Marek Safar <marek.safar@seznam.cz>
671 A fix for #77002, Implemented TypeForwarder support.
673 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
674 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Add TypeForwarder
676 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
677 * typemanager.cs (): Add type_forwarder_attr_type.
679 2006-06-24 Marek Safar <marek.safar@seznam.cz>
681 * report.cs: Add CS0469 warning.
683 2006-06-22 Martin Baulig <martin@ximian.com>
686 (TypeContainer.GetNormalBases): Also use ResolveAsBaseTerminal()
687 for interfaces; fixes #78686, which is a modification of #78380
688 with interfaces instead of classes.
690 2006-06-21 Martin Baulig <martin@ximian.com>
692 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
693 the `try'-block, so we also report CS0016 etc. there.
695 2006-06-21 Martin Baulig <martin@ximian.com>
697 * ecore.cs (FieldExpr.EmitAssign, FieldExpr.AddressOf): Correctly
698 handle SetAssigned() and SetMemberIsUsed() for generic types;
701 2006-06-21 Martin Baulig <martin@ximian.com>
704 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
706 2006-06-21 Martin Baulig <martin@ximian.com>
708 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
709 also report CS1686 for parameters.
711 2006-06-21 Martin Baulig <martin@ximian.com>
713 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
714 instead of an error if the value is not implicitly convertible to
715 the switch types; fixes #77964.
717 2006-06-21 Raja R Harinath <rharinath@novell.com>
720 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
721 FieldBuilder is null.
724 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
725 'left' and 'right' before error-checking.
727 2006-06-19 Martin Baulig <martin@ximian.com>
730 (Convert.ImplicitConversionStandard): Cleanup and correctly
731 implement nullable conversions.
732 (Convert.ImplicitStandardConversionExists): Likewise.
733 (Convert.ExplicitConversion): Likewise.
735 2006-06-19 Martin Baulig <martin@ximian.com>
738 (Nullable.Wrap.Create, Nullable.Unwrap.Create): New public static
739 methods; make the ctors protected.
741 2006-06-19 Martin Baulig <martin@ximian.com>
743 Fixed #78380; added gtest-273.cs.
746 (Expression.ResolveAsBaseTerminal): Move the constraint checking
747 into ResolveAsTypeTerminal().
750 (ConstraintChecker.HasDefaultConstructor): Use the non-cache based
751 TypeManager.FindMembers() to check for the default ctor.
753 2006-06-18 Marek Safar <marek.safar@seznam.cz>
755 * generic.cs: Fixed NullableInfo accessibility.
757 2006-06-16 Martin Baulig <martin@ximian.com>
760 (Constraints.InflatedConstraints.inflate): Correctly inflate
761 generic types; fixes #78400.
763 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
765 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
767 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
768 (FieldExpr.DoResolve): likewise.
769 (PropertyExpr.InstanceResolve): likewise.
770 (EventExpr.InstanceResolve): likewise.
772 2006-06-15 Martin Baulig <martin@ximian.com>
775 (SwitchLabel.ResolveAndReduce): Added `bool allow_nullable'
776 argument; always allow a `null' label if true.
777 (Switch.SwitchGoverningType): Take an `Expression expr' argument.
778 (Switch.TableSwitchEmit, Switch.SimpleSwitchEmit): Check whether
779 we have a `null' label and mark the new `null_target' label;
780 default to the `default' label.
781 (Switch.Resolve): Add support for nullable types. Fixes #78630.
783 2006-06-15 Martin Baulig <martin@ximian.com>
785 * class.cs (Operator.Define): Allow an implicit/explicit operator
786 to convert to/from a nullable value of the enclosing type.
788 * generic.cs (TypeManager.IsNullableTypeOf): New public method.
789 (Nullable.Unwrap, Nullable.Wrap): Make these classes public.
792 (Convert.ImplicitStandardConversionExists): Add support for lifted
793 implicit/explicit conversions.
794 (Convert.ImplicitConversionStandard): Likewise.
796 2006-06-13 Martin Baulig <martin@ximian.com>
798 * ecore.cs (SimpleName.DoSimpleNameResolve): Check whether we have
799 type arguments and create a ConstructedType if necessary. Fixes #78400.
801 2006-06-04 Marek Safar <marek.safar@seznam.cz>
803 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
804 attribute applicable tests for attribute argument.
806 2006-06-02 Raja R Harinath <rharinath@novell.com>
809 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
810 (Binary.OverloadResolve_PredefinedIntegral): New.
811 (Binary.OverloadResolve_PredefinedFloating): New.
812 (Binary.OverloadResolve_PredefinedString): New.
813 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
814 Follow the standard more closely, and treat numeric promotions in
815 terms of overload resolution.
816 (Binary.CheckShiftArguments): Simplify.
818 2006-06-01 Raja R Harinath <rharinath@novell.com>
820 * flowanalysis.cs (MyBitVector): Simplify representation.
821 (MyBitVector.Clone): Avoid allocating BitArray.
822 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
823 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
824 (*): Update. Change all references to MyBitVector.And and
825 MyBitVector.Or to &= and |=.
827 2006-05-31 Raja R Harinath <rharinath@novell.com>
829 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
830 Use bne.un instead of ceq+brfalse.
833 * typemanager.cs (IsUnmanagedType): Disallow generic types and
836 2006-05-29 Raja R Harinath <rharinath@novell.com>
839 * cs-parser.jay (formal_parameter_list): Extend the pattern below
840 to param arguments too.
842 2006-05-26 Miguel de Icaza <miguel@novell.com>
844 * cs-parser.jay: Catch another parsing form for arglist being
845 followed by other arguments. Fixes #78313.
847 2006-05-25 Raja R Harinath <rharinath@novell.com>
850 * expression.cs (Binary.DoResolve): Use Nullable.LiftedBinaryOperator
851 also when one of the operands is a null literal.
852 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality): Rewrite
853 to improve clarity, and generate slightly better code.
855 2006-05-24 Raja R Harinath <rharinath@novell.com>
857 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
858 checking of out parameters to ...
859 (FlowBranchingToplevel.Merge): ... here.
860 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
861 set, propagate the origin upward, and only complain if there was
863 (FlowBranchingException.AddContinueOrigin): Likewise.
864 (FlowBranchingException.AddReturnOrigin): Likewise.
865 (FlowBranchingException.AddGotoOrigin): Likewise.
867 2006-05-23 Raja R Harinath <rharinath@novell.com>
869 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
870 unreachable, skip it.
871 (FlowBranchingException.Merge): Always propagate jumps, even if
872 the finally block renders subsequent code unreachable.
874 2006-05-18 Raja R Harinath <rharinath@novell.com>
877 * statement.cs (Goto.Resolve): Move responsibility for resolving
878 'goto' to FlowBranching.AddGotoOrigin.
879 (Goto.SetResolvedTarget): New. Callback to set the
880 LabeledStatement that's the target of the goto.
881 (Goto.DoEmit): Use Leave instead of Br when crossing an
882 unwind-protect boundary.
883 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
884 LookupLabel and adjust to new semantics.
885 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
886 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
887 Goto.SetResolvedTarget to update target.
888 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
889 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
890 AddBreakOrigin & co. Delay propagation until ...
891 (FlowBranchingException.Merge): ... this.
893 * statement.cs (Block.Resolve): Always depend on flow-branching to
894 determine unreachability. Kill workaround that originally emitted
895 only one statement after an "unreachable" label (see infloop in
898 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
899 This is still "wrong", but anything better would probably need a
900 multi-pass algorithm.
901 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
902 usage vector. Force current usage vector to be reachable, to
903 optimistically signify backward jumps.
904 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
906 (FlowBranchingLabeled.Merge): New. If no backward jump was
907 detected, return the original salted-away usage vector instead,
908 updated with appropriate changes. Print unreachable warning if
910 * statement.cs (Block.Resolve): Don't print unreachable warning on
913 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
915 * driver.cs: Pass filename without path to AssemblyBuilder's
916 AddResourceFile. Fixes bug #78407.
918 2006-05-17 Raja R Harinath <rharinath@novell.com>
920 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
921 * flowanalysis.cs (FlowBranchingLabeled): ... here.
922 (FlowBranching.MergeChild): Overwrite
923 reachability information from Labeled branchings too.
925 2006-05-16 Raja R Harinath <rharinath@novell.com>
927 * statement.cs (Goto.Resolve): Merge jump origins here ...
928 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
930 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
931 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
932 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
933 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
935 * statement.cs (Goto.Resolve): ... not here.
936 (Goto.Emit): Remove CS1632 check.
938 2006-05-14 Marek Safar <marek.safar@seznam.cz>
940 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
943 2006-05-11 Raja R Harinath <rharinath@novell.com>
945 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
946 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
947 (FlowBranchingException.Label): Likewise.
949 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
951 (MyBitVector.Or): Use it to avoid losing information (Count).
952 (FlowBranching.MergeOrigins): Likewise.
954 * flowanalysis.cs (UsageVector.IsDirty): Remove.
955 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
956 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
957 (UsageVector.ToString): Simplify.
958 (UsageVector.MergeSiblings): Move here from ...
959 (FlowBranching.Merge): ... here.
960 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
963 2006-05-10 Raja R Harinath <rharinath@novell.com>
965 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
966 null bitvector is treated as all-true.
968 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
969 (MyBitVector): Rationalize invariants. 'vector != null' implies
970 that we have our own copy of the bitvector. Otherwise,
971 'InheritsFrom == null' implies all inherited bits are true.
973 2006-05-09 Marek Safar <marek.safar@seznam.cz>
975 * statement.cs (LocalInfo): Add IsConstant.
976 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
977 local variable for constants.
979 2006-05-09 Raja R Harinath <rharinath@novell.com>
981 * flowanalysis.cs (MyBitVector.Empty): New.
982 (MyBitVector): Don't allow InheritedFrom to be null.
983 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
984 (UsageVector, FlowBranching): Update to changes.
986 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
987 recursion. The 'Parent == null' condition isn't sufficient for
989 (FlowBranching.AddBreakOrigin): Likewise.
990 (FlowBranching.AddContinueOrigin): Likewise.
991 (FlowBranching.AddReturnOrigin): Likewise.
992 (FlowBranching.StealFinallyClauses): Likewise.
993 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
994 (FlowBranching.CheckOutParameters): Likewise.
995 (FlowBranchingToplevel): Terminate all the above recursions here.
996 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
997 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
999 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
1001 (FlowBranchingToplevel): New. Empty for now.
1002 (FlowBranching.MergeTopBlock): Update.
1003 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
1004 branching for the anonymous delegate.
1005 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
1007 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
1008 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
1009 information at the start of the merge. Reorganize.
1011 2006-05-07 Marek Safar <marek.safar@seznam.cz>
1013 * class.cs (MethodData.Define): Method cannot implement interface accessor.
1015 2006-05-07 Marek Safar <marek.safar@seznam.cz>
1017 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
1018 to newly introduced ctor.
1020 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
1021 message to one place.
1022 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
1025 2006-05-07 Marek Safar <marek.safar@seznam.cz>
1027 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
1029 * ecore.cs (Expression.ResolveAsConstant): Updated.
1031 * statement.cs (ResolveMeta): Updated.
1033 2006-05-06 Marek Safar <marek.safar@seznam.cz>
1035 * cs-parser.jay: __arglist cannot be used in initializer.
1037 2006-05-06 Marek Safar <marek.safar@seznam.cz>
1040 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
1043 2006-05-05 Raja R Harinath <rharinath@novell.com>
1045 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
1046 (LabeledStatement): Add 'name' parameter.
1047 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
1048 (Block.AddLabel): Update to changes.
1049 * cs-parser.jay (labeled_statement): Likewise.
1051 * flowanalysis.cs (BranchingType.Labeled): New.
1052 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
1053 (FlowBranchingLabeled): New. Does nothing for now, but will
1054 eventually handle 'goto' flows.
1055 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
1056 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
1057 that's terminated ...
1058 (Block.Resolve): ... here.
1060 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
1061 (UsageVector.MergeFinallyOrigins): Likewise.
1062 (FlowBranching.InTryOrCatch): Likewise.
1063 (FlowBranching.AddFinallyVector): Likewise.
1064 (FlowBranchingException): Update to changes.
1067 * statement.cs (Return.Resolve): Move error checking to ...
1068 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
1069 (FlowBranchingException): Handle return origins like break and
1071 (FlowBranching.UsageVector.CheckOutParameters): Remove.
1073 2006-05-04 Marek Safar <marek.safar@seznam.cz>
1076 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
1079 2006-05-04 Marek Safar <marek.safar@seznam.cz>
1082 * class.cs (MethodData.Define): Do public accessor check only when method
1083 implements an interface.
1085 2006-05-04 Raja R Harinath <rharinath@novell.com>
1087 Remove special handling of 'break'
1088 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
1089 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
1090 (UsageVector.Break): Remove.
1091 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
1093 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
1095 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
1096 UsageVector.Breaks (). Don't set NeedsReturnLabel.
1098 2006-05-03 Marek Safar <marek.safar@seznam.cz>
1101 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
1102 be the interface member.
1104 2006-05-03 Marek Safar <marek.safar@seznam.cz>
1107 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
1108 for emitting small (int) values.
1110 2006-05-03 Raja R Harinath <rharinath@novell.com>
1113 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
1114 control-flow passes through the 'finally' after merging-in all the
1115 control-flows from 'try' and the 'catch' clauses.
1117 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
1118 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
1119 always true at the only non-recursive entry point.
1120 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
1121 FlowBranchingBreakable.
1122 (FlowBranchingLoop): Remove.
1123 * statement.cs (Return.DoResolve): Update to changes.
1126 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
1127 (FlowBranching.CreateBranching): Handle it: create a
1128 FlowBranchingContinuable.
1129 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
1130 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
1131 except that it handles the 'continue' command.
1132 (FlowBranching.UsageVector.MergeOrigins): Rename from
1134 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
1135 except that it overrides AddContinueOrigin.
1136 (FlowBranchingException): Override AddContinueOrigin, similar to
1138 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
1139 Create a new branching around the embedded statement.
1140 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
1141 control flow after the embedded statement.
1142 (Continue.Resolve): Move all error checking to AddContinueOrigin.
1144 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
1145 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
1146 FlowBranchingBreakable.
1147 (FlowBranchingSwitch): Remove.
1150 * statement.cs (Break.Resolve): Simplify. Move responsibility for
1151 error reporting to ...
1152 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
1153 Rename from 'AddBreakVector'. Add new location argument. Return
1154 a bool indicating whether the 'break' crosses an unwind-protect.
1155 (FlowBranchingException.AddBreakOrigin): Add.
1156 (FlowBranchingException.Merge): Propagate 'break's to surrounding
1157 flowbranching after updating with the effects of the 'finally'
1159 (FlowBranchingBreakable): New common base class for
1160 FlowBranchingLoop and FlowBranchingSwitch.
1162 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
1164 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
1166 2006-05-02 Raja R Harinath <rharinath@novell.com>
1168 * statement.cs (Do.Resolve): If the loop is infinite, set the
1170 (While.Resolve, For.Resolve): Set a barrier after the embedded
1171 statement. There's no direct control flow that goes from the end
1172 of the embedded statement to the end of the loop.
1173 * flowanalysis.cs (FlowBranching.Infinite): Remove.
1174 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
1175 above ensure that the reachability is correctly computed.
1177 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
1178 (UsageVector.MergeBreakOrigins): If the current path is
1179 unreachable, treat it as if all parameters/locals are initialized.
1180 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
1181 infinite loops before merging-in break origins.
1183 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
1184 (Reachability.Reachable): Split part into ...
1185 (Reachability.Unreachable): ... this. Simplify.
1186 (Reachability.IsUnreachable): Use 'Unreachable' instead.
1188 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
1189 (Reachability.SetThrowsSometimes): Likewise.
1190 (FlowBranchingBlock.MergeTopBlock): Don't compare against
1191 TriState.Always, use corresponding property.
1192 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
1193 (Block.Resolve): Likewise. Remove some redundant checks.
1195 2006-05-02 Raja R Harinath <harinath@gmail.com>
1197 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
1198 (Reachability.Meet): Don't bother checking AlwaysThrows --
1199 barrier is always set.
1200 (FlowBranchingBlock.Merge): Likewise.
1202 2006-05-01 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
1204 * attribute.cs: fixed_buffer_cache is declared only if NET_2_0 is
1205 defined, so it's references should also compile only for NET_2_0
1206 (as occurs in mcs version)
1208 2006-05-01 Raja R Harinath <harinath@gmail.com>
1210 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
1211 checks for unreachable.
1213 2006-05-01 Marek Safar <marek.safar@seznam.cz>
1216 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
1218 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
1219 whether field is really assigned.
1221 2006-04-30 Raja R Harinath <harinath@gmail.com>
1223 * flowanalysis.cs (Reachability): Make 4-argument constructor
1225 (Reachability.Meet): Rename from 'And'. Remove static variant.
1226 (Reachability.Always): Rename from the highly misleading
1227 'Reachability.Never'.
1228 (FlowBranching.Merge): Update to changes. Mark an impossible
1229 situation with a 'throw'.
1230 (*): Update to changes.
1232 2006-04-29 Raja R Harinath <harinath@gmail.com>
1234 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
1236 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
1237 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
1238 (*): Update to changes.
1239 * statement.cs: Update to changes.
1241 2006-04-28 Marek Safar <marek.safar@seznam.cz>
1244 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
1246 2006-04-28 Raja R Harinath <harinath@gmail.com>
1248 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
1251 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
1252 argument to two arguments: an usage-vector and a bool. Move call
1253 to FlowBranching.Merge () ...
1254 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
1256 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
1257 handling of loop and switch reachability to ...
1258 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
1260 2006-04-27 Raja R Harinath <harinath@gmail.com>
1262 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
1263 handling to FlowBranchingLoop.InLoop.
1264 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
1266 2006-04-26 Marek Safar <marek.safar@seznam.cz>
1269 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
1270 anonymous method is allowed from AnonymousContainer here.
1272 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
1274 2006-04-24 Raja R Harinath <rharinath@novell.com>
1277 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
1279 2006-04-23 Marek Safar <marek.safar@seznam.cz>
1282 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
1283 (DoubleConstant.Reduce): Ditto.
1285 2006-04-23 Raja R Harinath <rharinath@novell.com>
1287 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
1288 Remove 'lvalue_right_side' argument. Move parts to ...
1289 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
1290 (LocalVariable.DoResolveLValue): ... these.
1292 2006-04-21 Raja R Harinath <rharinath@novell.com>
1295 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
1296 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
1297 (LocalVariableReference.DoResolveBase): Use it to implement new
1299 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
1300 (Argument.Resolve): Simplify. Move CS1510 check ...
1301 * ecore.cs (Expression.ResolveLValue): ... here.
1302 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
1303 (PropertyExpr.DoResolveLValue): Likewise.
1304 (FieldExpr.Report_AssignToReadonly): Likewise.
1305 (FieldExpr.DoResolve): Add 'out_access' argument. Use
1306 LValueMemberAccess or LValueMemberOutAccess on instance depending
1308 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
1309 DoResolve as appropriate.
1311 2006-04-20 Raja R Harinath <rharinath@novell.com>
1314 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
1315 implicit conversions on 'out' and 'ref' arguments.
1317 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
1318 improve clarity. Remove dead code.
1321 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
1322 (Catch.Resolve): Resolve VarBlock if it exists.
1324 2006-04-19 Miguel de Icaza <miguel@novell.com>
1326 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
1327 twice, this was some residual code, the enumerator was emitted
1328 properly in the two branche of if later.
1332 Thanks to Martin for finding the source of the problem
1334 2006-04-19 Raja R Harinath <rharinath@novell.com>
1336 * expression.cs (Cast.ResolveLValue): Remove. The result of a
1337 cast is never an lvalue.
1338 (Cast.DoResolve, Cast.ResolveRest): Combine.
1339 (Argument.Emit): Simplify slightly. Move 'Expr is
1340 IMemoryLocation' check ...
1341 (Argument.Resolve): ... here.
1342 (Argument.Error_LValueRequired): Remove. Inline into only user.
1344 Simplifications. Fix cs0191-2.cs
1345 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
1346 CS1649 and CS1651 to ...
1347 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
1348 the actual selection of the error code and message to a lookup
1349 table. Add a dummy return value to simplify callsites.
1350 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
1351 readonly fields of other instances of the same type. Move CS0197
1353 * expression.cs (Argument.Resolve): ... here. Simplify code.
1354 Ensure that ec.InRefOutArgumentResolving is only set during LValue
1355 resolution of an out or ref argument. The code simplification
1356 above uses this invariant.
1358 2006-04-18 Raja R Harinath <rharinath@novell.com>
1360 Possibly fix #77752. Fix cs1690-[4-7].cs.
1361 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
1362 CheckMarshallByRefAccess. Drop parameter.
1363 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
1365 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
1367 * report.cs (AllWarnings): Add CS1690.
1368 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
1370 (LocalVariableReference.DoResolveBase): Update.
1372 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1374 * class.cs (MethodOrOperator): Moved common parts from method class.
1375 detect obsolete attributes.
1376 (Method.Define): Simplified as it reuses code from base.
1377 (Constructor.ValidAttributeTargets): Fixed issue found during
1379 (Destructor.ValidAttributeTargets): Fixed issue found during
1381 (Operator): Finished refactoring set off by #78020. Operator class is now
1382 ordinary method class.
1384 * anonymous.cs: Updated.
1386 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1388 * class.cs (Constructor.Emit): Don't emit the attributes twice.
1390 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1392 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
1393 detect obsolete attributes.
1394 (Method.CreateEmitContext): Moved to MethodOrOperator.
1396 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1399 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
1400 customized exception to make crash detection easier.
1401 (MethodOrOperator): Started to work on new base class for methods and
1403 (Method): Derives from MethodOrOperator.
1404 (Constructor.Emit): Emits its own attributes.
1405 (AbstractPropertyEventMethod.Emit): Ditto.
1406 (Operator): Derives from MethodOrOperator, will refactor fully in extra
1408 (Operator.Emit): It's temporary more tricky than should be.
1410 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
1412 * report.cs (InternalErrorException): Add ctor with inner exception.
1414 2006-04-08 Marek Safar <marek.safar@seznam.cz>
1417 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
1420 2006-04-07 Marek Safar <marek.safar@seznam.cz>
1423 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
1426 2006-04-06 Marek Safar <marek.safar@seznam.cz>
1428 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
1429 attribute is present and Guid not.
1430 (Interface.ApplyAttributeBuilder): Ditto.
1432 * attribute.cs: Add error message.
1434 2006-04-06 Marek Safar <marek.safar@seznam.cz>
1438 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
1439 sources (it's composite) so hold them in extra array as they are used in
1440 Emit phase only. It worked in the previous versions by mistake.
1441 (Attribute.Emit): Emit attribute for more owners when exist.
1443 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
1444 it has now different behaviour.
1446 2006-04-04 Marek Safar <marek.safar@seznam.cz>
1448 * constant.cs (Constant.IsDefaultInitializer): New method.
1450 * class.cs: Updated.
1452 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
1453 re-initialize default values. It saves KBs almost for every assembly.
1454 Thanks Zoltan for the idea.
1455 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
1456 (ArrayCreation.DoResolve): Resolve only once.
1457 (ArrayCreation.Emit): Emit static initializer only when it is faster.
1458 (ArrayCreation.GetAttributableValue): Cope with optimized values.
1460 2006-04-03 Zoltan Varga <vargaz@gmail.com>
1462 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
1465 2006-04-01 Marek Safar <marek.safar@seznam.cz>
1467 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
1468 in an embedded statement too.
1470 2006-04-01 Raja R Harinath <rharinath@novell.com>
1473 * typemanager.cs (IsNestedChildOf): Drop generic arguments before
1477 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
1480 * report.cs (SymbolRelatedToPreviousError): Drop generic type
1481 arguments before checking whether a type is reflected or not.
1484 * expression.cs (Invocation.IsApplicable): Ensure a generic method
1485 definition doesn't take part in overload resolution.
1486 (Invocation.IsParamsMethodApplicable): Likewise.
1487 (Invocation.OverloadResolve): When replacing a reflected override
1488 method with its base definition, ensure that type arguments are
1491 2006-04-01 Marek Safar <marek.safar@seznam.cz>
1495 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
1498 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
1500 2006-03-31 Marek Safar <marek.safar@seznam.cz>
1502 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
1505 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
1506 LocalTemporary change.
1508 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1510 (ClassOrStruct.DefineFieldInitializers): Implemented static field
1511 initializers optimization.
1512 (ClassOrStruct.TypeAttr): Moved from modifiers.
1513 (Constructor.CheckBase): Don't crash when static ctor has parameters.
1514 (FieldBase.ResolveInitializer): Resolves initializer.
1515 (FieldBase.HasDefaultInitializer): New property.
1517 * cs-parser.jay: Removed message.
1519 * expression.cs (CompilerGeneratedThis): New specialization.
1521 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1523 2006-03-28 Marek Safar <marek.safar@seznam.cz>
1525 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1527 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1529 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1530 be now EnumConstants only.
1532 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1534 * attribute.cs, driver.cs: Reset more caches.
1536 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1538 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1540 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1542 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1543 for easier reuse. Updated all overrides.
1544 (IntegralConstant): New base class for all integral constants.
1545 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1546 of the constant range, report custom error.
1547 (UIntConstant.Reduce): Fixed uint conversion.
1549 * ecore.cs, literal.cs: Reduce updates.
1551 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1555 * class.cs (Constructor.Define): Removed extra if for default ctors.
1556 A patch from Atsushi Enomoto.
1558 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1560 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1561 GetAttributableValue.
1563 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1566 * convert.cs (ImplicitConversionRequired): Error message moved to
1569 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1570 automatic implicit conversion of an output value.
1571 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1573 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1575 (TypeOf.GetAttributableValue): Add extra handling for object type.
1577 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1578 special error message.
1580 2006-03-25 Marek Safar <marek.safar@seznam.cz>
1582 * class.cs (Constructor.Emit): Don't crash when struct ctor is
1584 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1585 compatible with MS runtime.
1587 2006-03-23 Marek Safar <marek.safar@seznam.cz>
1589 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1590 attribute arguments here.
1592 * class.cs (Indexer.Define): The check was moved to attribute class.
1594 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1596 * expression.cs (StringConcat.Append): Reverted back to no warning state.
1598 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1600 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1602 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1605 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
1607 * doc-bootstrap.cs : fix build.
1609 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1611 * expression.cs (StringConcat.Append): Issue a warning when empty string
1614 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1616 * assign.cs (CompoundAssign.ResolveSource): Removed.
1618 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1621 * class.cs (TypeContainer.FindMethods): Removed.
1622 (TypeContainer.CheckMemberUsage): Made static.
1624 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1626 * constant.cs (CheckRange): Removed unused type argument.
1627 (CheckUnsigned): Removed unused type argument.
1629 * cs-parser.jay: Updated after MemberAccess clean up.
1630 Uses Length for empty string test.
1632 * cs-tokenizer.cs: Uses Length for empty string test.
1633 (IsCastToken): Made static.
1634 (is_hex): Made static.
1635 (real_type_suffix): Made static.
1637 * decl.cs (SetupCache): Made static.
1638 (OnGenerateDocComment): Removed unused ds argument.
1640 * delegate.cs (VerifyDelegate): Removed unused argument.
1642 * doc.cs: Uses Length for empty string test.
1644 * driver.cs: Uses Length for empty string test.
1646 * enum.cs (IsValidEnumType): Made static
1648 * expression.cs (EnumLiftUp): Removed unused argument.
1649 (ResolveMethodGroup): Ditto.
1650 (BetterConversion): Ditto.
1651 (GetVarargsTypes): Ditto.
1652 (UpdateIndices): Ditto.
1653 (ValidateInitializers): Ditto.
1654 (MemberAccess.ctor): Ditto.
1655 (GetIndexersForType): Ditto.
1657 * flowanalysis.cs: (MergeFinally): Removed unused argument.
1659 * iterators.cs: Updated after MemberAccess clean up.
1661 * location.cs: Uses Length for empty string test.
1663 * namespace.cs: Uses Length for empty string test.
1665 * report.cs (CheckWarningCode): Made static.
1667 * statement.cs (LabeledStatement): Removed unused argument.
1669 * typemanager.cs (FilterNone): Removed.
1671 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1673 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1676 * class.cs: Updated.
1678 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1680 * cs-parser.jay.cs: __arglist is not allowed for delegates.
1682 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1686 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
1688 (AnonymousMethod.ImplicitStandardConversionExists): New method.
1689 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1690 Add more error reporting; Fixed issue with params.
1692 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1694 * cs-parser.jay: AnonymousMethod requires host container.
1696 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1698 2006-03-18 Raja R Harinath <harinath@gmail.com>
1700 * class.cs: Change 'TypeContainer ds' constructor argument to
1701 'DeclSpace parent'. Some classes were missed below due to
1702 different naming convention.
1704 * class.cs (MemberCore.Parent): Delete. This makes the
1705 ParentContainer changes below enforceable by the compiler.
1707 Treat pointers to enclosing declaration space as 'DeclSpace', not
1709 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1710 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1712 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1714 (Block.AddThisVariable): Likewise.
1715 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1716 (AbstractPropertyEventMethod.Emit): Likewise.
1717 (AbstractPropertyEventMethod.EmitMethod): Likewise.
1718 (GetMethod.Define, SetMethod.Define): Likewise.
1719 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1720 (DelegateMethod.EmitMethod): Likewise.
1722 Fix regression test-partial-13.cs.
1723 Rationalize use of PartialContainer. Ensure that the partial
1724 class semantics can be tied to type-correctness, i.e., any
1725 violation will cause a compile error.
1726 * class.cs, const.cs: Access all fields that belong to class
1727 TypeContainer via ParentContainer. Arguments of EmitContexts and
1728 Resolve()-like functions still use 'Parent'.
1730 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1731 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1732 (PropertyMethod.CheckModifiers): Remove unused argument.
1733 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1736 2006-03-28 Raja R Harinath <rharinath@novell.com>
1738 * decl.cs (DeclSpace.LookupGeneric): Update to changes.
1740 2006-03-17 Raja R Harinath <harinath@gmail.com>
1742 Make semantics of PartialContainer simpler.
1743 * decl.cs (DeclSpace.IsPartial): Remove.
1744 * class.cs (TypeContainer.IsPartial): Likewise.
1745 (TypeContainer..ctor): Set PartialContainer to point to self.
1746 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1747 (TypeContainer.FindNestedType): Likewise.
1748 (MemberCore.ParentContainer): Simplify. Remove deprecation.
1750 2006-03-17 Marek Safar <marek.safar@seznam.cz>
1752 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
1754 2006-03-15 Marek Safar <marek.safar@seznam.cz>
1756 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
1759 2006-03-15 Marek Safar <marek.safar@seznam.cz>
1761 * class.cs (Operator.Define): An error for base conversion was not
1764 2006-03-13 Marek Safar <marek.safar@seznam.cz>
1766 A fix for #77593, #77574.
1768 * class.cs (MethodCore.CheckBase): Another if for operator.
1770 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1774 * expression.cs (VerifyArgumentsCompat): Reverted to double error
1775 reporting, it's more tricky than I thought.
1777 2006-03-09 Marek Safar <marek.safar@seznam.cz>
1779 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
1782 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
1783 (DelegateCreation.ImplicitStandardConversionExists): New method for just
1786 * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
1789 2006-03-04 Marek Safar <marek.safar@seznam.cz>
1793 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
1794 (Event.Define): ditto
1795 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1797 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1798 Removed redundant code and set NewSlot for Invoke method too.
1800 * parameter.cs (Parameters.ctor): Add custom, type ctor.
1801 (Parameters.MergeGenerated): New method. Use this method when you merge
1802 compiler generated argument with user arguments.
1804 2006-03-03 Marek Safar <marek.safar@seznam.cz>
1806 * attribute.cs (ResolveAsTypeTerminal): Removed.
1808 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1809 specialization for predefined types; 30% speed up.
1810 Finally placed obsolete check to right place.
1811 (Expression.ResolveType): Removed.
1813 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1814 Updated after ResolveType was removed.
1816 * expression.cs (Cast.ctor): Check void cast.
1817 (Binary.ResolveAsTypeTerminal): Is never type.
1818 (Conditional.ResolveAsTypeTerminal): Is never type.
1820 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1822 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1824 * rootcontext.cs (ResolveCore): Removed System.INullableValue.
1826 2006-03-23 Martin Baulig <martin@ximian.com>
1828 * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
1829 type check if either of the types is an open generic type.
1831 2006-03-23 Martin Baulig <martin@ximian.com>
1834 (Convert.ExplicitTypeParameterConversion): New method; implement
1835 explicit type parameter conversions.
1837 2006-03-23 Martin Baulig <martin@ximian.com>
1839 * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
1840 blindly allow all conversions if we do not have any constraints.
1842 2006-02-27 Marek Safar <marek.safar@seznam.cz>
1844 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1845 these two separated members to simplify the code.
1846 (Attribute.Resolve): Refactored to use new fields and methods.
1847 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1848 implemented obsolete attribute checking.
1849 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
1850 implemented obsolete checking again. It look line never ending quest ;-)
1851 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
1853 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
1855 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
1857 *class.cs (Property.Define): Add RegisterProperty call.
1859 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
1860 argument groups (only 2).
1862 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
1863 encoding expression to arguments.
1864 (Expression.ExprClassToResolveFlags): Just turned to property.
1866 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
1867 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
1868 optimized as well as implemented support for zero-length attributes.
1870 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
1871 Add caching of PropertyInfo's.
1873 2006-02-25 Marek Safar <marek.safar@seznam.cz>
1875 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
1876 error multiple times.
1878 2006-02-25 Marek Safar <marek.safar@seznam.cz>
1880 New partial class implementation.
1881 A fix for #77027, #77029, #77403
1883 * attribute.cs (Attributable): Made attributes protected.
1885 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
1886 the replacements of ClassPart and PartialContainer.
1887 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
1888 (TypeContainer.AddInterface): Ditto.
1889 (TypeContainer.AddPartial): The main method for partial classes. It checks
1890 for errors and merges ModFlags and attributes. At the end class is added to
1892 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
1894 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
1895 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
1896 from the rest of partial classes.
1897 (TypeContainer.GetClassBases): Simplified.
1898 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
1900 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
1901 (TypeContainer.HasExplicitLayout): Uses Flags now.
1902 (PartialContainer): Removed.
1903 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
1904 (StaticClass): Was merged with Class.
1905 (Class.GetClassBases): class and static class bases are verified here.
1906 (Class.TypeAttr): Added static attributes when class is static.
1907 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
1908 (MemberBase): In some cases we need to call parent container for partial
1909 class. It should be eliminated but it's not easy now.
1911 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
1913 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
1914 partial classed to accumulate class comments.
1915 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
1917 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
1919 * driver.cs (MainDriver): Tree.GetDecl was removed.
1921 * modifiers.cs (Modifiers): Add partial modifier.
1923 * tree.cs (Tree.decl): Removed.
1924 (RootTypes): Started to use this class more often for root types
1927 2006-03-23 Raja R Harinath <rharinath@novell.com>
1929 * generic.cs (TypeParameter.UpdateConstraints): Update
1930 'constraints' if null.
1932 2006-02-22 Marek Safar <marek.safar@seznam.cz>
1936 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
1937 external interface does not have an attribute.
1939 2006-02-22 Marek Safar <marek.safar@seznam.cz>
1941 Another prerequisites for new partial classs implementation.
1943 * attribute.cs (Attribute.Equal): Implemented.
1944 (Attribute.Emit): Changed as attributes can be applied more than twice.
1945 (Attributes.Emit): Check for duplicate attributes here.
1947 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
1948 as a parameter, clean-up.
1950 2006-02-11 Marek Safar <marek.safar@seznam.cz>
1954 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
1955 contains obsolete attribute check which can in some cases look for base
1956 type of current class which is not initialized yet.
1957 (TypeContainer.BaseType): Replacement of ptype.
1959 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
1961 2006-02-11 Marek Safar <marek.safar@seznam.cz>
1963 First of prerequisites for new partial classs implemention.
1965 * attribute.cs (Attributable): Extended by ResolveContext;
1966 Attributes finally have correct context for resolving in all cases.
1967 (AttachTo): Attribute owner is assigned here.
1969 * codegen.cs (IResolveContext): Introduce new interface to hold
1970 all information needed in resolving phase.
1971 (EmitContext): Implements IResolveContext; more clean-up needed here.
1973 * decl.cs (MemberCore): Implemented IResolveContext.
1975 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
1976 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
1977 parameter.cs, statement.cs, tree.cs, typemanager.cs:
1978 Refactored to use new IResolveContext instead of EmitContext; cleanup
1980 2006-03-22 Raja R Harinath <rharinath@novell.com>
1982 Support ParameterDefaultValueAttribute in gmcs. Also applied to
1983 mcs to keep code differences small.
1984 * attribute.cs (Attribute.GetParameterDefaultValue): New.
1985 * typemanager.cs (parameter_default_value_attribute_type): New.
1986 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
1989 2006-03-22 Martin Baulig <martin@ximian.com>
1992 (Nullable.NullableLiteral): Derive from `NullLiteral'.
1995 (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
1996 instead of the normal `NullLiteral'.
1998 2006-03-21 Martin Baulig <martin@ximian.com>
2001 * generic.cs (TypeManager.InferType): If `pt' is a generic
2002 parameter, don't check whether `pt == at'.
2004 2006-03-20 Raja R Harinath <rharinath@novell.com>
2007 * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
2008 (TypeParameter.Resolve): Update to change.
2009 (ConstraintChecker.CheckConstraints): Resolve type-argument
2010 constraints before use.
2012 2006-03-16 Martin Baulig <martin@ximian.com>
2015 (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
2016 and don't have any instance constructors, also lookup in the base class.
2017 (TypeManager.IsNullableValueType): New public method.
2019 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
2020 `BindingFlags.DeclaredOnly' flag and set `used_cache'.
2021 (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
2023 * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
2024 instead of just TypeManager.IsNullableType() to determine whether
2025 a lifted operator exists.
2026 (UnaryMutator.DoResolve): Likewise.
2027 (Conditional.DoResolve): Likewise.
2028 (Binary.DoResolve): A lifted operator only exists if both operands
2029 are valuetypes and at least one of them is a nullable type.
2031 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
2033 * iterator.cs : yield break is allowed in try statement which has
2034 catch clauses. Fixed bug #77767.
2036 2006-03-12 Martin Baulig <martin@ximian.com>
2038 * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
2039 private IsSignatureEqual() to compare types; see the comment in
2040 that method; fixes #77674.
2042 2006-03-10 Raja R Harinath <rharinath@novell.com>
2044 * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
2045 (Expression.ResolveAsTypeTerminal): Likewise.
2046 * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
2047 * expression.cs, generic.cs, iterators.cs: Likewise.
2048 * parameter.cs, statement.cs, typemanager.cs: Likewise.
2050 2006-03-09 Martin Baulig <martin@ximian.com>
2052 * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
2053 TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
2055 2006-03-09 Martin Baulig <martin@ximian.com>
2057 * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
2058 `prepared' flag is set.
2060 * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
2061 (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
2062 issues; see gtest-254.cs.
2064 2006-03-07 Martin Baulig <martin@ximian.com>
2066 * generic.cs (TypeManager.InferType): Allow infering
2067 `IEnumerable<T>' with an array of T; see gtest-251.cs.
2069 2006-03-06 Martin Baulig <martin@ximian.com>
2072 (TypeManager.InferType): Fix gtest-250.cs.
2075 (TypeManager.IsSubclassOf): Also check the base class.
2078 (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
2081 2006-03-01 Raja R Harinath <rharinath@novell.com>
2084 * expression.cs (ParameterReference.DoResolveBase): Change return
2086 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
2090 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
2093 * typemanager.cs (GetFullNameSignature): Don't nullref on
2094 protected accessors.
2096 2006-02-16 Martin Baulig <martin@ximian.com>
2099 (TypeManager.GetGenericFieldDefinition): New public method; use it
2100 instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
2102 2006-02-14 Martin Baulig <martin@ximian.com>
2104 * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
2106 2006-02-14 Martin Baulig <martin@ximian.com>
2109 (TypeManager.DropGenericMethodArguments): New public method; don't
2110 use GetGenericMethodDefinition() on something which is not a
2113 2006-02-14 Martin Baulig <martin@ximian.com>
2116 (ConstraintChecker.CheckConstraints): If a type parameter has the
2117 `struct' constraint, the type must be a non-nullable valuetype.
2119 2006-02-10 Martin Baulig <martin@ximian.com>
2122 (TypeManager.IsOverride): Make this work for instantiated methods
2123 in a generic class; fixes #77509.
2124 (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
2125 rather than calling it directly; fixes #77488.
2127 2006-02-08 Martin Baulig <martin@ximian.com>
2129 * generic.cs (ConstraintChecker.CheckConstraints): Move the error
2130 reporting into CheckConstraint() so we can use the correctly
2133 2006-02-08 Martin Baulig <martin@ximian.com>
2135 * expression.cs (BaseAccess): Add support for generic methods.
2137 * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
2138 the new MethodGroupExpr.
2140 2006-02-07 Martin Baulig <martin@ximian.com>
2142 * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
2143 also reference types; fixes #77483.
2145 2006-02-07 Martin Baulig <martin@ximian.com>
2148 (TypeManager.IsGenericMethod): We now return whether something is
2149 an instantiated generic method (and not a generic method def).
2150 (TypeManager.IsGenericMethodDefinition): New public method.
2153 (TypeManager.CSharpSignature): Only include type arguments for
2154 "real" generic methods, not for any instantiated method.
2155 (TypeManager.GetMethodName): Likewise, but also allow generic
2156 method definitions here.
2158 2006-02-06 Miguel de Icaza <miguel@novell.com>
2160 * codegen.cs (EmitScopeInitFromBlock): check here the
2161 capture_context, there is no need to make two calls to the
2164 * anonymous.cs: Add some debugging messages that might help me
2165 track other instances of this problem in the future (the
2166 regression of test 467).
2168 * cs-parser.jay: track the variable block, as we need to initalize
2169 any captured variables declared in this block for the "catch"
2170 portion of the "Try" statement.
2172 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
2173 scope initialization for captured variables.
2175 Also, move the emit for the variables after the block location has
2178 2006-02-06 Marek Safar <marek.safar@seznam.cz>
2180 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
2182 2006-02-06 Martin Baulig <martin@ximian.com>
2184 * class.cs (TypeContainer.DefineType): If we're a struct, pass
2185 `TypeManager.value_type' as parent type to
2186 ModuleBuilder.DefineType(). Fixes #77358.
2188 2006-02-02 Miguel de Icaza <miguel@novell.com>
2190 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
2191 commit yesterday, the initialization for the roots is necessary.
2192 What is not necessary is the scope activation.
2194 2006-02-02 Raja R Harinath <rharinath@novell.com>
2196 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
2197 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
2199 (Argument.Resolve): Remove CS0206 checks.
2201 2006-02-01 Miguel de Icaza <miguel@novell.com>
2203 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
2204 scopes for all the roots, the scopes will now be emitted when the
2205 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
2207 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
2208 code. This reduces a lot of existing cruft.
2210 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
2211 that the ScopeInfo is generated as we enter the scope, not at the
2212 time of use, which is what we used to do before.
2214 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
2215 every time a Block is about to be emitted if we have a
2218 2006-02-01 Raja R Harinath <rharinath@novell.com>
2220 * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
2221 attribute for mscorlib too.
2223 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
2225 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
2227 * typemanager.cs (cons_param_array_attribute): Make private.
2228 (Reset): Set it to null.
2229 (InitCoreHelpers): Don't initialize it.
2230 (ConsParamArrayAttribute): New. Initialize it as needed.
2231 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
2233 2006-01-31 Miguel de Icaza <miguel@novell.com>
2235 * expression.cs: There might be errors reported during the
2236 selection of applicable methods. If there are errors, do not
2237 continue execution as it will lead the compiler to crash.
2239 2006-01-30 Miguel de Icaza <miguel@novell.com>
2241 * expression.cs: Member access is not allowed on anonymous
2242 methods. Fixes #77402.
2244 2006-01-30 Raja R Harinath <rharinath@novell.com>
2247 * cs-parser.jay (VariableDeclaration): Don't set
2248 current_array_type to null.
2249 (field_declaration, event_declaration, declaration_statement):
2250 Set it to null here.
2252 2006-01-29 Raja R Harinath <harinath@gmail.com>
2255 * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
2257 2006-01-28 Raja R Harinath <harinath@gmail.com>
2259 * typemanager.cs (GenericParameterPosition): New.
2262 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
2264 * doc.cs : To process "include" elements, first we should create
2265 another list than XmlNodeList, because it could result in node
2266 removal, which could result in that the XmlNodeList gives up
2269 2006-01-25 Miguel de Icaza <miguel@novell.com>
2271 * expression.cs: Introduce an error report that we were not
2272 catching before. Gonzalo ran into it.
2274 2006-01-23 Miguel de Icaza <miguel@novell.com>
2276 A fix for bug: #76957
2278 * iterators.cs (MoveNextMethod.CreateMethodHost): call
2279 ComputeMethodHost before creating the method, this is a new
2282 * anonymous.cs (AnonymousContainer): Now we track all the scopes
2283 that this method references (RegisterScope). The actual scope
2284 where the method is hosted is computed with the ComputeMethodHost
2285 before we create the method.
2287 Moved the Deepest routine here.
2289 (AnonymousContainer.ComputeMethodHost): New routine used to
2290 compute the proper ScopeInfo that will host the anonymous method.
2292 (ScopeInfo): Deal with multiple roots. The problem was that we
2293 did not have a unique root where all ScopeInfos could be hanged
2294 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
2297 Remove AdjustMethodScope which is now computed at the end. Remove
2298 LinkScope which did a partial link, instead link all ScopeInfos
2299 before code generation from the new "LinkScopes" routine.
2301 Simplify all the Add* routines as they no longer need to maintain
2302 the tree, they just need to record that they are using variables
2305 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
2306 routines to produce the forest of ScopeInfo trees.
2308 * class.cs (TypeContainer.AppendMethod): This is just like
2309 AddMethod, but ensures that an interface implementation method
2310 (IEnumerable.XXX) is not inserted at the beginning of the queue of
2311 methods, but at the end.
2313 We use this functionality to ensure that the generated MoveNext
2314 method in the iterator class is resolved/emitted before the
2315 enumerator methods created.
2317 This is required because the MoveNext method computes the right
2318 ScopeInfo for the method. And the other methods will eventually
2319 need to resolve and fetch information computed from the anonymous
2323 2006-01-23 Raja R Harinath <rharinath@novell.com>
2325 Improve implementation of section 14.4.2.2 (Better function member).
2326 * expression.cs (Invocation.MoreSpecific): Compare all type
2327 arguments before deciding if one type is more specific than
2328 another. Handle array types too. Return the more specific type.
2329 (Invocation.BetterFunction): Add more tie-breaking rules from
2330 section 14.4.2.2. Perform "more specific" check after
2331 other tie-breaking rules. Compare all parameter types before
2332 choosing the "more specific" method.
2334 2006-01-21 Raja R Harinath <harinath@gmail.com>
2335 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2338 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
2340 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
2341 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
2343 2006-01-18 Martin Baulig <martin@ximian.com>
2345 * class.cs (TypeContainer.AddToMemberContainer): Use
2346 `symbol.MemberName.MethodName' instead of just `symbol.Name';
2349 2006-01-18 Martin Baulig <martin@ximian.com>
2351 Fix #76417: a generic class may now have methods which may unify
2352 for some type parameter substitutions.
2354 * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
2355 for methods which may unify anymore.
2357 * expression.cs (Invocation.MoreSpecific): New private static
2358 method; checks whether one method is more specific than another
2359 according to 14.4.2.2 of the spec.
2360 (Invocation.BetterFunction): Implement the tie-breaking rules from
2361 14.4.2.2 of the spec: if two methods unify for some type parameter
2362 substitution, we need to pick the more specific one.
2364 2006-01-18 Raja R Harinath <rharinath@novell.com>
2366 Fix #76656, cs0231-2.cs.
2367 * cs-parser.jay (formal_parameter_list): Make error case catch
2369 (parenthesized_expression_0): Add CS1026 check.
2370 (invocation_expression): Remove unused { $$ = lexer.Location }.
2372 2006-01-17 Raja R Harinath <rharinath@novell.com>
2375 * cs-parser.jay (statement_expression): Don't list out the
2376 individual statement-expressions. Convert syntax error into
2379 2006-01-16 Raja R Harinath <rharinath@novell.com>
2382 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
2383 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
2384 CheckIntermediateModification.
2385 (FieldExpr.DoResolve): Add new two-argument version that
2386 allows us to resolve the InstanceExpression as an lvalue.
2387 The one-argument variant is now just a wrapper.
2388 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
2389 Resolve the lhs as an lvalue if the it has a value type.
2390 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
2391 from Assign.DoResolve.
2392 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
2393 resolved as an lvalue.
2394 (PropertyExpr.DoResolve): Update.
2395 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
2396 has a value type. Move CS1612 check here from
2397 CheckIntermediateModification.
2398 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
2399 * expression.cs (EmptyExpression.OutAccess): New. Used as the
2400 'right_side' of a ResolveLValue on an 'out' argument.
2401 (EmptyExpression.LValueMemberAccess): New. Used as the
2402 'right_side' of a propagated ResolveLValue on a value type.
2403 (LocalVariableReference.DoResolveBase): Recognize
2404 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
2406 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
2407 EmptyExpression.Null.
2409 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
2411 * typemanager.cs : added IsGenericParameter(). In gmcs it returns
2412 Type.IsGenericParameter(). Fixed bug #77183.
2413 * doc.cs : it is now identical to doc.cs in mcs.
2415 2006-01-16 Martin Baulig <martin@ximian.com>
2417 * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
2419 2006-01-16 Martin Baulig <martin@ximian.com>
2421 * typemanager.cs (TypeManager.CSharpSignature): Make this work for
2422 ctors; fixes #77250.
2424 2006-01-12 Miguel de Icaza <miguel@novell.com>
2426 This fixes the problem where we used ldfld instead of ldflda to
2427 load the "THIS" pointer on captured parameters, when THIS is a
2428 value type. See bug #77205.
2430 * iterators.cs (CapturedThisReference.Emit): Pass false to
2431 EmitThis (we do not need the address).
2433 * codegen.cs (EmitThis): it needs to know whether we need the
2434 address of `this' or not. This is used by value types.
2436 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
2437 every other call passes false.
2439 2006-01-12 Raja R Harinath <rharinath@novell.com>
2442 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
2444 * expression.cs (Invocation.OverloadResolve): Update.
2445 (Invocation.DoResolve): Avoid double resolution of invocation.
2447 2006-01-11 Raja R Harinath <rharinath@novell.com>
2450 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
2451 unary negation of floating point types as 0-expr; negation cannot
2452 overflow in floating point types.
2455 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
2456 on operands of 'void' type.
2459 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
2460 and ExclusiveOr for boolean constants too.
2462 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
2464 * expression.cs: Fix Console.WriteLine ((this = x).foo);
2466 2006-01-12 Miguel de Icaza <miguel@novell.com>
2468 * cs-tokenizer.cs (Position): New class used to save and restore
2469 the position state in the tokenizer. Before this patch the save
2470 and restore was not complete enough so the line and columns would
2471 start to drift and the debugger and stack traces will get the
2474 2006-01-10 Martin Baulig <martin@ximian.com>
2477 (TypeParameter.InflateConstraints): New public method.
2479 * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
2480 constraints; fixes #77042.
2482 2006-01-10 Martin Baulig <martin@ximian.com>
2484 * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
2485 instead of the `TypeBuilder' for this "<>THIS" variable; fixes
2488 2006-01-09 Raja R Harinath <rharinath@novell.com>
2491 * expression.cs (Invocation.OverloadResolve): Replace reflected
2492 override methods with their base virtual methods, rather than
2494 * typemanager.cs (TypeManager.GetOverride): New.
2496 2005-12-21 Miguel de Icaza <miguel@novell.com>
2498 * driver.cs: Report the case of no source files and no -out:
2501 2005-12-20 Raja R Harinath <rharinath@novell.com>
2504 * expression.cs (ComposedCast.GetSignatureForError): Define.
2506 2006-01-05 Jb Evain <jbevain@gmail.com>
2508 * class.cs (Property.Define, Indexer.Define): do not tag the
2509 properties as SpecialName | RTSpecialName.
2511 2006-01-04 Miguel de Icaza <miguel@novell.com>
2513 * class.cs (MethodCore.IsDuplicateImplementation): This method was
2514 doing a low-level comparission of parameter types. It was lacking
2515 a check for __argslist.
2517 2005-12-30 Miguel de Icaza <miguel@novell.com>
2519 * expression.cs (ParameterReference.DoResolveBase): Allow
2520 reference parameters if they are local to this block.
2522 This allows the ref and out parameters of a delegate to be used in
2523 an anonymous method, for example:
2525 delegate void set (out int x);
2527 set s = delegate (out int x){
2531 This is used by functionality introduced late in the C# language.
2533 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
2534 method that take ref and out parameters.
2536 Fixes #77119 which was a late change in the spec.
2538 2005-12-23 Miguel de Icaza <miguel@novell.com>
2540 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
2541 parent if its the same scope. Fixes #77060.
2543 2005-12-22 Marek Safar <marek.safar@seznam.cz>
2545 * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
2547 2005-12-21 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2549 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
2550 errors 1726 for strong named assemblies with InternalsVisibleToAttribute
2551 that doesn't contain the full public key. This is a update of the
2552 friend assemblies in .Net 2.0 release.
2554 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2558 * namespace.cs (NamespaceEntry): Add extern_aliases as a
2559 ListDictionary, to contain the ExternAliasEntry entries (in
2560 addition to the NamespaceEntry.aliases hashtable). This field is
2561 shared between the original entry and its doppelganger (bodyless
2563 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
2564 extern_aliases field.
2565 (NamespaceEntry.Lookup): Move the IsImplicit check after the
2566 lookup in extern_aliases.
2568 2005-12-16 Raja R Harinath <rharinath@novell.com>
2571 * class.cs (TypeContainer.Mark_HasEquals): New.
2572 (TypeContainer.Mark_HasGetHashCode): New.
2573 (ClassPart): Override them.
2574 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
2576 * generic.cs (GenericMethod.DefineMembers): Update to changes.
2577 (TypeParameter.TypeParameter): Change type of 'parent' argument to
2581 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
2582 'parent' argument to the base constructor.
2584 Remove all mention of TypeContainer from decl.cs.
2585 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
2586 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
2587 (DeclSpace.DeclSpace): Likewise.
2588 (DeclSpace.DefineMembers): Remove unused argument.
2589 * cs-parser.jay (pop_current_class): Update to changes. Simplify
2590 debugging check -- we don't care if the debug code throws an
2591 InvalidCastException instead of an InternalErrorException.
2592 * class.cs (TypeContainer.DefineMembers): Update to changes.
2593 (TypeContainer.DoDefineMembers): Likewise.
2594 (TypeContainer.GetMethods): Likewise.
2595 (PropertyMember.Define): Likewise.
2596 (MemberBase.Parent): New property that forwards to
2597 MemberCore.Parent, but ensures that we get a TypeContainer.
2598 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
2599 (RootContext.PopulateTypes): Likewise. Remove special case code
2600 for !RootContext.StdLib: DefineMembers is idempotent.
2602 2005-12-13 Marek Safar <marek.safar@seznam.cz>
2604 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
2606 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
2608 * doc.cs : The search for referenced namespace was insufficient to
2609 get global one as it used to do. Fixed bug #76965.
2611 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
2613 * doc.cs : check name in cref in the last phase that whether it is
2616 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2618 * cs-tokenizer.cs : reverted the latest change: it somehow broke
2621 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2623 * doc.cs : so it turned out that we cannot skip override check for
2624 interface members. Fixed bug #76954.
2626 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2628 * cs-tokenizer.cs : fixed bug #75984:
2629 - #warning and #error should not be handled when the source line
2631 - #line is not checked strictly when the source line is disabled.
2632 - #define and #undef is on the other hand checked strictly at any
2635 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
2637 * cs-tokenizer.cs : missing Location (actually, filename) in one of
2640 2005-12-15 Raja R Harinath <rharinath@novell.com>
2642 * generic.cs (TypeManager.IsGeneric): Remove unused method.
2644 * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
2647 2005-12-14 Martin Baulig <martin@ximian.com>
2649 * typemanager.cs (TypeManager.GetFullName): Make this public;
2650 `Type.Fullname' now never returns null.
2652 * class.cs (Method.Define): Use TypeManager.GetFullName() for
2653 explicit interface implementations; we're now using the same
2654 naming convention than csc does.
2656 2005-12-14 Miguel de Icaza <miguel@novell.com>
2658 * convert.cs (ExplicitConversionCore): Check the return value from
2659 ExplicitConversionCore which can return null on failure. Fixes #76914
2661 2005-12-09 Raja R Harinath <rharinath@novell.com>
2663 * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
2664 instead of IsGenericInstance.
2665 * generic.cs (TypeManager.IsEqual): Likewise. Delete redundant
2666 code that's now covered by the more general test.
2667 * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
2669 * generic.cs (DropGenericTypeArguments): New. Captures the common
2670 pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
2671 * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
2672 * generic.cs, report.cs, typemanager.cs: Likewise.
2674 2005-12-08 Martin Baulig <martin@ximian.com>
2676 * generic.cs (TypeArguments.Resolve): Added CS1547 check.
2678 * typemanager.cs (TypeManager.CSharpSignature): Include type
2679 arguments in the signature of a generic method.
2681 2005-12-07 Martin Baulig <martin@ximian.com>
2683 Add support for custom attributes on type parameters.
2685 * cs-parser.jay (type_arguments): Added `opt_attributes'.
2687 * generic.cs (TypeParameterName): New public class; we use this
2688 instead of a `string' to store the name of a type parameter, so we
2689 can also have `Attributes'.
2690 (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
2691 array instead of a `string[]' array.
2692 (TypeParameter.ctor): We now also take an `Attributes' argument.
2693 (TypeParameter.EmitAttributes): New public method; emit our
2694 `OptAttributes' here.
2695 (GenericMethod.EmitAttributes): New public method; emit the custom
2696 attributes on all our type parameters.
2698 * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
2699 our type parameters.
2700 (MethodData.Define): If we're a generic method, call
2701 EmitAttributes() on it.
2703 2005-12-07 Martin Baulig <martin@ximian.com>
2706 (ConstraintChecker): New public abstract class; move the
2707 constraint checking here from `ConstructedType' and also do
2708 constraint checking for generic methods here.
2710 * expression.cs (Invocation.OverloadResolve): Use
2711 ConstraintChecker.CheckConstraints() if we resolved to a generic
2714 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2716 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2718 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2720 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
2721 (FieldBase.Initializer): Initializer is now optional.
2722 (EventField.Define): Only event field can have initializer.
2724 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
2726 * const.cs (Const): Reuse initializer.
2728 * cs-parser.jay: Updated after FieldBase changes.
2729 Added current_array_type to simplify array initializers.
2731 * ecore.cs (NullCast.IsDefaultValue): Implemented.
2733 * expression.cs, iterators.cs: Updated.
2735 * namespace.cs (NamespaceEntry): Made UsingFound private.
2737 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2739 * parameterCollection.cs: Obsolete, removed.
2740 * parser.cs: Obsolete, removed.
2742 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2745 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2747 * enum.cs (Enum.Define): Set obsolete context here.
2749 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
2752 - FindDocumentedMember() now expects 1) paramList as null
2753 when "we don't have to check the number of parameters" and
2754 2) Type.EmptyTypes when "there is no arguments".
2755 - Introduced FoundMember struct to hold the exact type which was
2756 used to find the documented member (the above change broke
2757 test-xml-044; it might be better just to use DeclaringType than
2758 what MS does, like this change does, but it depends on usage.)
2760 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
2762 * doc.cs : documented member might be from DeclaringType for nested
2763 types. Fixed bug #76782.
2765 2005-12-03 Ben Maurer <bmaurer@ximian.com>
2767 * anonymous.cs: Have the param code handle leaving copies on the
2768 stack etc. Allows anonymous params to take part in the assignment
2769 code (++, +=, etc). Fixes bug #76550
2771 * expression.cs: Handle the prepare_for_load/leave_copy by passing
2772 it down to the anon code.
2774 * iterators.cs: Use dummy var here
2776 * codegen.cs: Handle new vars
2778 2005-12-01 Marek Safar <marek.safar@seznam.cz>
2781 * class.cs (MethodData.Define): Set proper Obsolete context.
2783 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
2785 (FieldExpr.DoResolve): Ditto.
2787 2005-12-01 Marek Safar <marek.safar@seznam.cz>
2790 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
2791 parent is not obsolete.
2793 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
2795 * doc.cs : (FindDocumentedMember) find parameterless members first
2796 and get CS0419 in the early stage. Fixed first case of bug #76727.
2798 2005-11-30 Marek Safar <marek.safar@seznam.cz>
2801 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2802 no error was reported.
2804 *expression.cs (Binary.DoResolve): left can be null.
2806 2005-12-06 Raja R Harinath <rharinath@novell.com>
2808 * class.cs (MethodCore.CheckGenericOverride): Delete unused
2809 abstract method and all overrides.
2810 * support.cs (ParameterData.GenericConstraints): Delete.
2811 (ReflectionParameters.type_params): Delete.
2812 (ReflectionParameters.ReflectionParameters): Make private.
2813 (ReflectionParameters.GetConstaints): New factory method.
2814 * generic.cs (TypeParameterDefineType): Use it.
2815 (TypeManager.GetTypeParameterConstraints): Likewise.
2817 2005-11-22 Marek Safar <marek.safar@seznam.cz>
2820 * class.cs (MethodData.Emit): Parameters should be labeled first.
2822 2005-11-21 Marek Safar <marek.safar@seznam.cz>
2825 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2827 2005-11-18 Marek Safar <marek.safar@seznam.cz>
2829 * attribute.cs (AreParametersCompliant): Moved to Parameter.
2831 * class.cs (MethodCore): Parameter clean up.
2832 (IMethodData): Added ParameterInfo.
2833 (MethodData): Parameter clean up.
2834 (Indexer.Define): Parameter clean up.
2846 * typemanager.cs: Parameter clean up.
2848 * delegate.cs (Define): Get rid of duplicated code.
2850 * expression.cs (ParameterReference): Removed useless parameters
2852 (Invocation): Ditto.
2854 * parameter.cs (ParamsParameter): New class, params specialization.
2855 (ArglistParameter): Attemp to separate arglist.
2856 (Parameter): Refactored to be reusable and faster.
2857 (Parameter.Modifier): Made understandable.
2858 (Parameters): Changed to be used as a class for `this' assembly
2859 parameters. Refactored to use new specialized classes.
2861 * support.cs (ParameterData): Added Types property.
2862 (InternalParameters): Deleted.
2864 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2866 * doc.cs : the previous patch does not actually fix the bug.
2867 PropertyInfo override check is now implemented and really fixed it.
2868 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2870 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2872 * doc.cs : apply "override filter" also to properties.
2875 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2877 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2878 no need to check overrides. For classes, omit those results from
2879 interfaces since they must exist in the class. Fixed bug #76726.
2881 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2883 * typemanager.cs : (GetFullNameSignature) differentiate indexers
2884 with different parameters. Fixed the second problem in #76685.
2886 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2888 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2889 get expected 'protected' access in CheckValidFamilyAccess()).
2892 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2894 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2895 Fixed bug #76705. CS1569 was incorrectly commented out.
2897 2005-11-23 Martin Baulig <martin@ximian.com>
2899 * generic.cs (Constraints.Define): Removed.
2900 (TypeParameter.DefineConstraints): Removed.
2901 (TypeParameter.DefineType): Call SetGenericParameterAttributes()
2902 on the GenericTypeParameterBuilder here.
2904 2005-11-23 Martin Baulig <martin@ximian.com>
2906 * typemanager.cs (TypeManager.GetProperty): Make this public.
2908 * generic.cs (Nullable.NullableInfo.ctor): Use
2909 TypeManager.GetProperty() rather than using reflection directly.
2911 2005-11-17 Martin Baulig <martin@ximian.com>
2913 * expression.cs (Indexers.GetIndexersForType): Added support for
2914 generic parameters; fixes #76587.
2916 2005-11-17 Martin Baulig <martin@ximian.com>
2919 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2920 inherit the scope from our parent. Fixes #76653.
2922 2005-11-15 Martin Baulig <martin@ximian.com>
2924 * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
2925 instead of `ScopeTypeBuilder' to refer to the "current" type.
2926 (AnonymousMethod.CreateScopeType): Correctly create the helper
2927 class if we're inside a generic type definition.
2929 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
2931 * doc.cs : use Invocation.IsOverride() to do real override check.
2932 * expression.cs : made Invocation.IsOverride() internal.
2934 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
2936 * doc.cs : use TypeManager.FindMembers() instead of (possible)
2937 TypeBuilder.FindMembers() and filter overriden base members out.
2940 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2942 * doc.cs : ref/out parameters are represented as '@' (instead of
2943 '&' in type FullName). Fixed bug #76630 (additionally crefs).
2945 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2947 * doc.cs : when there was no '.' in cref to methods in doc comment,
2948 then parameters were missing in the output. Fixed bug #76691.
2950 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2952 * driver.cs : don't output docs when there is an error.
2955 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2958 Now it should detect indexers. Fixed primary concern in bug #76685.
2959 Fixed CS0419 message to not show the identical member signature in
2962 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2964 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2965 instead of Type.FindMembers() since it does not handle events.
2968 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
2970 * codegen.cs: Fixed typo (speficied -> specified).
2972 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2975 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
2977 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2979 * attribute.cs: Changed error message.
2981 * cs-tokenizer.cs: One more check.
2983 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2985 * statement.cs (Block.Resolve): Ignore empty statement.
2987 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2989 * report.cs: Made error/warning methods more strict to avoid
2992 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
2993 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
2994 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
2995 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
2997 2005-11-11 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2999 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute):
3000 Use the more explicit AssemblyName.FullName instead of
3001 AssemblyName.Name to report errors.
3003 2005-11-11 Marek Safar <marek.safar@seznam.cz>
3005 * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
3008 2005-11-10 Marek Safar <marek.safar@seznam.cz>
3018 * report.cs: Fixed error reporting and typos.
3020 * generic.cs (TypeParameter.GetSignatureForError): New method.
3021 (ConstructedType.GetSignatureForError): Instead of DeclarationName.
3023 * typemanager.cs (GetFullName): Refactored.
3025 2005-11-08 Marek Safar <marek.safar@seznam.cz>
3027 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
3028 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
3030 * class.cs (TypeContainer.IsComImport): New property.
3031 (Constructor.Define): Create proper ctor for ComImport types.
3033 * expression.cs (New.CheckComImport): Fixed.
3035 2005-11-07 Miguel de Icaza <miguel@novell.com>
3037 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
3038 that a parameter has been captured does not mean that we do not
3039 have to do the rest of the processing. This fixes the second part
3040 of #76592. If there was another anonymous method capturing
3041 values in the past, the Scope would never be set for the second
3042 method that captured the same parameter.
3044 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
3045 properly manipulate the stack. Second part of fix for #76592.
3047 * expression.cs (New): Add support for invoking "new" on
3048 interfaces that have been flagged with the ComImport attribute and
3049 the CoClass. Fixes #76637
3051 * statement.cs (Try.DoEmit): When a variable is captured, do not
3052 try to emit the vi.LocalBuilder variable as it has been captured.
3053 Create a temporary variable and store the results on the
3054 FieldBuilder. Fixes #76642
3056 2005-11-07 Marek Safar <marek.safar@seznam.cz>
3058 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
3060 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
3062 * expression.cs (Binary.DoResolve): Added && optimalization.
3064 * typemanager.cs (AddUserType): Removed useless argument.
3066 2005-11-04 Marek Safar <marek.safar@seznam.cz>
3068 * statement.cs (Block.variables): Uses ListDictionary.
3070 2005-11-03 Marek Safar <marek.safar@seznam.cz>
3073 * class.cs (PartialContainer.EmitType): Customized to emit
3074 security attributes.
3075 (ClassPart.ApplyAttributeBuilder): Transform security attribute
3076 for partial classes.
3078 2005-11-03 Marek Safar <marek.safar@seznam.cz>
3081 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
3082 access has to be fixed.
3084 * typemanager.cs (IsUnmanagedType): Wrong common field type.
3086 2005-11-01 Marek Safar <marek.safar@seznam.cz>
3089 * ecore.cs (NullCast.Reduce): Implemented.
3091 * expression.cs (ArrayCreation.CheckIndices): Correcly check
3094 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
3096 (Foreach.Resolve): Catch null properly.
3098 2005-10-29 Marek Safar <marek.safar@seznam.cz>
3100 * cs-tokenizer.cs: Warning text fix.
3102 * driver.cs: AllWarningNumbers exposed on public interface.
3104 * report.cs (): Reviewed warning numbers.
3105 (IsValidWarning): Use binary search.
3107 2005-10-29 Marek Safar <marek.safar@seznam.cz>
3109 * driver.cs: Implemeted resource visibility.
3110 (Resources): New class for code sharing between /res: and
3113 2005-11-07 Marek Safar <marek.safar@seznam.cz>
3115 decl.cs (CurrentTypeParameters): Fixed to be public.
3117 2005-11-07 Marek Safar <marek.safar@seznam.cz>
3119 generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
3121 2005-11-07 Marek Safar <marek.safar@seznam.cz>
3123 gmcs.exe.sources: Use CryptoConvert.cs from corlib.
3125 2005-11-05 Kornél Pál <kornelpal@hotmail.com>
3127 * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
3129 2005-11-04 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3131 Add friend assembly access support.
3132 * typemanager.cs: assembly_internals_vis_attrs
3133 cache for friend assembly access.
3134 (TypeManager.IsFriendAssembly): New method for
3135 checking friend assembly access.
3136 (TypeManager.Error_FriendAccessNameNotMatching): New
3138 (TypeManager.CompareKeyTokens): Likewise.
3139 (TypeManager.Filter): Handle friend accessible
3142 * namespace.cs (RootNamespace.GetTypeInAssembly): Return
3143 friend accessible types.
3145 * ecore.cs (Expression.IsAccessorAccessible): Handle
3146 friend accessible properties.
3148 * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
3151 2005-10-28 Marek Safar <marek.safar@seznam.cz>
3154 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
3157 * convert (Convert.ImplicitReferenceConversion): NullCast holds
3160 * ecore.cs (NullCast): Child is contant only.
3162 * literal.cs (NullLiteral.Reduce): null can be converted to any
3165 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
3167 * driver.cs: Use Encoding.Default as default code page instead
3170 2005-10-27 Raja R Harinath <rharinath@novell.com>
3173 * expression.cs (Invocation.Error_InvalidArguments): Handle
3174 __arglist parameters.
3175 (Invocation.VerifyArgumentsCompat): Likewise.
3176 * support.cs (ReflectionParameters.GetSignatureForError): Print
3177 __arglist parameters.
3178 (InternalParamters.GetSignatureForError): Likewise.
3179 * parameter.cs (Parameters.GetSignatureForError): Likewise.
3181 2005-10-26 Marek Safar <marek.safar@seznam.cz>
3183 * attribute.cs (GetPropertyValue): Made public.
3185 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
3187 Add new property WrapNonExceptionThrows to handle 2.0 assembly
3189 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
3192 * driver.cs: Reflect method name change.
3194 * statement.cs (Try.Resolve): Warn when try has both general
3197 * typemanager.cs: runtime_compatibility_attr_type new predefined
3200 2005-10-26 Raja R Harinath <harinath@gmail.com>
3203 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
3204 treat it as an empty parameter list.
3206 2005-10-26 Raja R Harinath <rharinath@novell.com>
3209 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
3210 ResolveAsTypeStep silent.
3211 * statement.cs (Block.AddConstant): Mark block as used.
3212 (Block.ResolveMeta): Avoid piling on error messages
3213 if a constant initializer resolution fails.
3215 2005-10-25 Raja R Harinath <rharinath@novell.com>
3217 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
3219 (NamespaceEntry.VerifyAllUsing): New.
3220 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
3221 behaviour. Delegates actual resolution of alias to ...
3222 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
3223 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
3225 * driver.cs (Driver.MainDriver): Update.
3227 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
3228 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
3230 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
3232 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
3233 RootNamespace.DefineNamespacesForAll.
3235 2005-10-24 Raja R Harinath <harinath@gmail.com>
3237 * typemanager.cs (assemblies, external_aliases, modules)
3238 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
3239 (ComputeNamespaces, GetRootNamespace): Remove extra staging
3240 overhead. Move resposibility ...
3241 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
3242 * driver.cs, attribute.cs, codegen.cs: Update to changes.
3244 2005-10-23 Raja R Harinath <harinath@gmail.com>
3246 * namespace.cs (RootNamespace.all_namespaces): Renamed from
3247 cached_namespaces. Improve usage.
3248 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
3249 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
3250 Move from GlobalRootNamespace and simplify.
3251 (RootNamespace.Global): Make instance variable.
3252 (RootNamespace.RootNamespace): Add "alias name" parameter.
3253 (GlobalRootNamespace): Simplify drastically.
3254 (Namespace.Lookup): Don't use GetNamespace.
3255 * typemanager.cs (GetRootNamespace): Rename from
3256 ComputeNamespaceForAlias.
3257 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
3259 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3261 * anonymous.cs (AnonymousContainer): Don't crash when container
3264 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3266 * expression.cs (Binary.DoResolve): Warn when comparing same
3269 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3272 * expression.cs (Binary.DoResolve): It looks like there are no
3273 convetsion rules in enum context.
3275 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3277 Add support for extern alias qualifiers.
3278 * typemanager.cs: Move some LookupTypeReflection code
3279 to namespace.cs, to have cleaner code. Added some methods
3280 to help us keep track of the extern aliased references.
3281 * driver.cs: Add suport for extern alias assemblies on command
3282 line and check for their warnings/errors. Also keep track of the
3283 extern aliased assemblies.
3284 * namespace.cs: Move the global functionality of Namespace
3285 to GlobalRootNamespace/RootNamespace. Now the global namespace
3286 is GlobalRootNamespace.Globa. Also the code moved from
3287 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
3288 Finally added LocalAliasEntry (AliasEntry before) and
3289 ExternAliasEntry, to handle alias statements.
3290 * cs-parser.jay: Add support in the grammar for extern alias
3292 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
3293 Update callings to Namespace (now in GlobalRootNamespace).
3295 2005-10-25 Martin Baulig <martin@ximian.com>
3297 * convert.cs (ImplicitTypeParameterConversion): Make base
3298 interfaces actually work; fixes #76557.
3300 2005-10-25 Martin Baulig <martin@ximian.com>
3303 (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
3304 all the type parameters; fixes #76551.
3306 2005-10-25 Martin Baulig <martin@ximian.com>
3311 (GenericMethod.ctor): Added `Expression return_type' and
3312 `Parameters parameters' arguments.
3313 (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
3314 parameter and return types to check their constraints if they're
3317 * codegen.cs (EmitContext.ResolvingGenericMethod): New public
3320 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3321 constraints of a generic type if `ec.ResolvingGenericMethod'.
3323 * class.cs (MethodCore.DoDefineParameters): Set
3324 `ec.ResolvingGenericMethod' if we're a generic method.
3325 (MemberBase.MemberType): Likewise.
3327 2005-10-25 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3329 * typemanager.cs (TypeManager): Added
3330 TypeManager.internals_visible_attr_type to cache
3331 S.R.CompilerServices.InternalsVisibleToAttribute.
3333 * codegen.cs (AssemblyClass): Added checks for
3334 InternalsVisibleToAttribute in new method
3335 CheckInternalsVisibleAttribute () and also cache the
3336 AssemblyName in AssemblyClass.Name.
3338 2005-10-24 Martin Baulig <martin@ximian.com>
3341 (TypeManager.ExpandInterfaces): Added overloaded version which
3342 just takes a `Type[]' array.
3345 (Constraints.Resolve): Don't expand the interfaces here; ie. we
3346 just use the interfaces which were explicitly specified and not
3347 the interfaces they inherit. Fixes #76482.
3348 (TypeParameter.FindMembers): Expand the interfaces here.
3350 2005-10-21 Martin Baulig <martin@ximian.com>
3353 (Constraints.Resolve): Also resolve the actual types here.
3354 (Constraints.ResolveTypes): Just check the constraints here.
3355 Fixes #76363; see gtest-218.cs.
3357 2005-10-21 Martin Baulig <martin@ximian.com>
3360 (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
3361 instead of a `BoxedCast'; fixes gtest-217.cs.
3363 2005-10-20 Atsushi Enomoto <atsushi@ximian.com>
3365 * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
3366 1) "new()" is specified as generic parameter constraint and 2) the
3367 type is TypeBuilder and 3) the type is abstract even if it has a
3368 default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
3370 2005-10-20 Martin Baulig <martin@ximian.com>
3373 (GenericConstraints.TypeParameter): New public property.
3374 (TypeParameter.ctor): Also take a `DeclSpace' argument.
3375 (TypeParameter.DeclSpace): New public property.
3376 (TypeParameter.DefineType): Inflate the constraints if our
3377 `DeclSpace' is an `Iterator'.
3379 2005-10-19 Atsushi Enomoto <atsushi@ximian.com>
3381 * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added
3382 GenericMethod argument to compare methods' generic type arguments.
3385 2005-10-19 Martin Baulig <martin@ximian.com>
3387 * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
3388 not ResolveType() when resolving the base type, so we're not
3389 checking the constraints here.
3390 (TypeContainer.ResolveType): Call ResolveType() on our base_type
3393 2005-10-19 Martin Baulig <martin@ximian.com>
3395 * generic.cs (ConstructedType.CheckConstraints): Committing
3396 untested fix for #76441.
3398 2005-10-18 Raja R Harinath <rharinath@novell.com>
3401 * class.cs (TypeContainer.DefineType): Move updating of
3402 topological sort earlier in the code.
3403 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
3405 2005-10-18 Marek Safar <marek.safar@seznam.cz>
3408 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
3410 * constant.cs (Constant.TryReduce): Moved from Cast class.
3411 (Reduce): Made little bit more OO and fixed missing conversions.
3413 * ecore.cs (Reduce): Implemented.
3414 (Binary.EnumLiftUp): New method to upgrade values to enum values.
3416 * literal.cs (Reduce): Implemented.
3418 * class.cs: Reverted Miguel's wrong commit.
3420 2005-10-14 Miguel de Icaza <miguel@novell.com>
3422 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
3424 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
3426 * cs-parser.jay, expression.cs : CS0214 was missing error location
3427 for constants. Fixed bug #76404.
3429 2005-10-10 Raja R Harinath <rharinath@novell.com>
3431 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
3433 (PropertyExpr.EmitCall): Likewise.
3434 * expression.cs (Invocation.EmitArguments): Handle case where
3436 (Invocation.EmitCall): Avoid allocating temporary variable if
3437 there are no arguments.
3439 2005-10-11 Marek Safar <marek.safar@seznam.cz>
3442 * convert.cs (ExplicitConversionCore): Fixed object->enum
3445 2005-10-07 Raja R Harinath <rharinath@novell.com>
3448 * convert.cs (ImplicitConversionStandard): Move conversion of
3449 void* to arbitrary pointer types ...
3450 (ExplicitConversionStandard): .. here.
3451 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
3452 error to always print typenames.
3454 2005-10-07 Raja R Harinath <rharinath@novell.com>
3456 * convert.cs (GetConversionOperator): Rename from
3457 GetConversionOperators. Move operator selection code from ...
3458 (UserDefinedConversion): ... here.
3460 2005-10-06 Marek Safar <marek.safar@seznam.cz>
3462 * convert.cs (ExplicitConversionCore): Removed duplicate enum
3465 2005-10-05 Marek Safar <marek.safar@seznam.cz>
3467 * assign.cs (Assign.DoResolve): Error method changed.
3469 * cfold.cs (DoConstantNumericPromotions): Error method changed.
3471 * const.cs (ResolveValue): Reset in_transit immediately.
3473 * constant.cs: Error method changed.
3475 * convert.cs: Removed useless location parameter.
3476 (ExplicitNumericConversion): Don't do double enum check.
3477 (ExplicitConversionCore): Renamed from ExplicitConversion.
3478 (ExplicitUnsafe): Extracted from ExplicitConversion.
3479 (ExplicitConversion): Uses for error reporting.
3481 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
3483 (ResolveBoolean): Uses common error method.
3484 (CastToDecimal): Get rid of ec.
3485 (CastFromDecimal): Optimized.
3486 (ConvCast): Get rid of ec.
3488 * enum.cs (ResolveValue): Reset in_transit immediately.
3489 (Emit): Return after first error.
3491 * expression.cs: Convert changes.
3493 * literal.cs: Error method changed.
3495 * statement.cs: Error method changed.
3497 2005-10-06 Raja R Harinath <rharinath@novell.com>
3499 Fix gtest-131.cs and gtest-211.cs.
3500 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
3501 Only emit code for a label if it is used. Unreachable code can
3502 violate ECMA evaluation stack invariants.
3504 2005-09-27 Marek Safar <marek.safar@seznam.cz>
3506 * anonymous.cs: Implemented ExprClassName.
3508 * assign.cs (Assign.DoResolve): Don't chrash when type is not
3511 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
3514 * class.cs (StaticClass.DefineContainerMembers): Report protected
3517 * codegen.cs: if(ed) PRODUCTION.
3519 * convert.cs (Error_CannotImplicitConversion): Better error
3522 * cs-parser.jay: More error checks.
3524 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
3526 * driver.cs (CSCParseOption): Enabled wrong option check.
3528 * ecore.cs (Expression.ExprClassName): Turned to property.
3529 (MemberExpr.CheckIntermediateModification): For checking boxed
3530 value types modification.
3532 * statement.cs (Fixed.Resolve): Expression type must be
3533 convertible to fixed type.
3534 (CollectionForeach.GetEnumeratorFilter,TryType):
3535 Small refactoring for easier error checking.
3537 2005-09-26 Marek Safar <marek.safar@seznam.cz>
3539 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
3542 * class.cs (GeneratedBaseInitializer): New class for customization
3543 compiler generated initializers.
3544 (MemberBase.DoDefine): Check Obsolete attribute here.
3545 (FieldMember.DoDefine): Ditto.
3547 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
3550 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
3551 (MemberCore.GetObsoleteAttribute): Removed argument.
3552 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
3553 (MemberCore.CheckObsoleteType): New helper.
3557 * statement.cs: Updates after MemberCore changes.
3559 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
3560 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
3562 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
3563 obsolete attribute for compiler construct.
3564 (As.DoResolve): Cache result.
3566 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
3568 2005-10-01 Miguel de Icaza <miguel@novell.com>
3570 * expression.cs (Probe): instead of having a "Type probe_type"
3571 keep the extra information as a TypeExpr probe_type_expr since the
3572 "As" operator needs to perform some type checks.
3574 * (As.DoResolve): If the type is a type parameter, ensure that it
3575 is constrained by a class.
3577 2005-09-22 Miguel de Icaza <miguel@novell.com>
3579 * statement.cs (Lock): Use the TemporaryVariable class instead of
3580 manually using local variables as those do not work when variables
3583 * ecore.cs: Moved the TemporaryVariable class from being a nested
3584 class inside Foreach to be a public class that can be employed in
3587 2005-09-19 Marek Safar <marek.safar@seznam.cz>
3589 * cs-parser.jay: interface_accessors replaced by
3590 accessor_declarations.
3592 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
3595 * statement.cs (GotoCase.Resolve): Convert null constant to
3597 (SwitchLabel.ResolveAndReduce): Ditto.
3598 (SwitchLabel.NullStringCase): Custom null stamp.
3599 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
3601 typemanager.cs (CSharpSignature): Don't skip first argument
3604 2005-09-16 Marek Safar <marek.safar@seznam.cz>
3606 * cfold.cs, constant.cs, convert.cs, ecore.cs,
3607 expression.cs, iterators.cs, literal.cs: Store constants and
3610 * class.cs (MemberBase.ShortName): Pass location.
3612 * cs-parser.jay: Some location fixes.
3614 * ecore.cs (Expression.Location): Made virtual.
3616 2005-09-27 Marek Safar <marek.safar@seznam.cz>
3619 * const.cs (Const.ResolveValue): Check for assigning non-null
3620 value to reference type.
3622 2005-09-26 Raja R Harinath <rharinath@novell.com>
3625 * expression.cs (This.VerifyFixed): In a value type T, the type of
3626 'this' is T&, iow, 'this' is either an out or ref parameter. In a
3627 value type R, 'this' is treated as a value parameter.
3629 2005-09-05 Miguel de Icaza <miguel@novell.com>
3631 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3632 if the underlying types are the same, otherwise we need to produce
3633 code that will do the proper cast.
3635 This was exposed by Marek's constant rewrite which produced
3636 invalid code for the call site:
3639 void Method (X v) {}
3643 This fixes test-49.cs
3645 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3647 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
3648 Type/Object should be allowed as well. Fixed bug #75968.
3650 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3652 * expression.cs : (Binary.DoResolve): when one is enum constant and
3653 another is constant 0, then return enum one *as enum type*.
3656 2005-10-04 Martin Baulig <martin@ximian.com>
3658 * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
3659 `SetMemberIsUsed()' work for generics, too.
3661 2005-10-04 Martin Baulig <martin@ximian.com>
3663 * expression.cs (DelegateInvocation.EmitStatement): Make this work
3664 for corlib. Fixes #75691.
3666 2005-09-28 Marek Safar <marek.safar@seznam.cz>
3669 * driver.cs: Fix compilation files with full root path.
3671 2005-09-25 Miguel de Icaza <miguel@novell.com>
3673 * report.cs (SymbolRelatedToPreviousError): Format the output so
3674 it does not use an open parenthesis that is never closed.
3676 * driver.cs: Follow coding guidelines
3678 2005-09-18 Miguel de Icaza <miguel@novell.com>
3680 * driver.cs: Set InEmacs based on the environment variable EMACS.
3682 * location.cs (InEmacs): in this mode, do not report column
3683 location as it confuses Emacs.
3685 2005-10-03 Raja R Harinath <rharinath@novell.com>
3687 * support.cs (SeekableStreamReader.Position): Don't error out when
3688 the requested position is just beyond the end of the current
3691 2005-09-28 Raja R Harinath <rharinath@novell.com>
3693 * support.cs (SeekableStreamReader): Simplify drastically. Don't
3694 try to keep in sync with the byte count of the underlying Stream.
3695 However, this limits us to a window size of 2048 characters: i.e.,
3696 the maximum lookahead of our lexer/parser can be 2048 characters.
3698 2005-09-22 Martin Baulig <martin@ximian.com>
3700 * driver.cs: Removed a debugging FIXME.
3702 2005-09-21 Raja R Harinath <rharinath@novell.com>
3704 * cs-parser.jay (type_arguments): Add CS1644 check.
3705 * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
3707 2005-09-15 Raja R Harinath <rharinath@novell.com>
3709 * Makefile (PROGRAM): Make profile specific.
3710 (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
3711 the current directory.
3714 * expression.cs (Invocation.EmitCall): Remove optimization on
3715 this_call since it doesn't handle 'this' being a value type.
3717 2005-09-05 Geoff Norton <gnorton@customerdna.com>
3719 * driver.cs: Ensure file handles are closed after parsing
3721 2005-09-05 Miguel de Icaza <miguel@novell.com>
3723 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3724 if the underlying types are the same, otherwise we need to produce
3725 code that will do the proper cast.
3727 This was exposed by Marek's constant rewrite which produced
3728 invalid code for the call site:
3731 void Method (X v) {}
3735 This fixes test-49.cs
3737 2005-09-05 Martin Baulig <martin@ximian.com>
3739 * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
3740 instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
3742 * cs-parser.jay (delegate_declaration): Small fix for #75852.
3744 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3746 * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
3747 to be a pointer type due to the spec 25.2, so check if declaring
3748 type is generic type definition. Fixed bug #75772.
3750 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3753 * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
3754 both types are not defined by methods.
3755 * expression.cs : (Invocation.IsApplicable): it should work when
3756 the argument type is equal to the parameter type, not only when
3757 ImplicitConversionExists() returns true.
3759 2005-09-02 Raja R Harinath <rharinath@novell.com>
3761 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
3765 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
3766 flow-branching for LocalVariableReferences in case we were invoked
3767 from a MemberAccess.
3768 * expression.cs (LocalVariableReference.VerifyAssigned): New.
3770 (LocalVariableReference.DoResolveBase): ... this.
3771 (MemberAccess.Resolve): Do the check that was disabled during
3774 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
3777 (PartialContainer.Create): check abstract/sealed/static strictly
3778 but abstract/sealed can exist only at one side. Fixed bug #75883.
3780 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
3783 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
3784 specified, don't default to UnmanagedType.I4.
3786 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
3788 * expression.cs : conditional operator should check possibly
3789 incorrect assign expression. Fixed bug #75946.
3791 2005-08-30 Raja R Harinath <rharinath@novell.com>
3794 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3795 (ScopeInfo.EmitScopeType): Use it to construct field names from
3796 names of captured locals.
3799 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3800 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3801 Pass 'target_type' to BoxedCast. Don't default to 'object'.
3802 (ExplicitConversion): Remove enum cases already handled by
3803 implicit conversion. Move implicit conversion check to the beginning.
3804 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3805 * expression.cs (ArrayCreation.EmitDynamicInitializers):
3806 Don't treat System.Enum as a struct.
3808 2005-08-30 Jb Evain <jbevain@gmail.com>
3810 * attribute.cs: handles as expression in parameters.
3812 2005-08-30 Raja R Harinath <rharinath@novell.com>
3815 * class.cs (TypeContainer.VerifyClsName): Don't use a
3816 PartialContainer when verifying CLS compliance.
3817 (AbstractPropertyEventMethod): Set Parent here, ...
3818 (PropertyMethod): ... not here.
3820 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
3822 * attribute.cs : escaped attribute name should not be allowed to be
3823 resolved (e.g. @class as classAttribute). Fixed bug #75930.
3825 2005-08-29 Raja R Harinath <rharinath@novell.com>
3828 * convert.cs (ImplicitStandardConversionExists): Allow zero also
3829 when converting a long constant to unsigned long.
3830 * expression.cs (Invocation.OverloadResolve): Add sanity check to
3831 detect where IsApplicable and VerifyArgumentsCompat disagree.
3833 2005-08-29 Raja R Harinath <rharinath@novell.com>
3834 and Carlos Alberto Cortez <carlos@unixmexico.org>
3837 * class.cs (TypeContainer.CanElideInitializer): New helper.
3838 (TypeContainer.EmitFieldInitializers): Use it to determine if we
3839 can safely emitting the initializer of a field.
3841 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3843 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
3844 allowed inside a switch (without loop). Fixed bug #75433.
3846 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
3848 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3849 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3851 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3853 * driver.cs : kinda reverting the default encoding changes (not exact
3854 revert since I noticed that "codepage:reset" might not work fine).
3856 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3858 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
3859 Location. Now getter and setter store location correctly.
3860 (errors/cs0111-12.cs now reports the expected location.)
3862 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3864 * driver.cs : Use default encoding on the environment.
3865 Removed (now that) extra parameter for SeekableStreamReader.
3866 * support.cs : (SeekableStreamReader) third .ctor() argument for
3867 StreamReader is not required (always true). preamble size could
3868 be acquired in simpler and safe way.
3870 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
3872 * cs-parser.jay: report CS0642 at warning level 3
3873 and report CS0642 for an if else statement also
3874 fixes bug #74745. Patch by John Luke (and a bit
3876 Removed extra CS0642 warning check for "while",
3878 * statement.cs: In Block.Resolve(), CS0642 check
3879 is reimplemented to check a sequence of an empty
3880 statement and a block.
3882 Both fix bug #66777.
3884 2005-08-24 Marek Safar <marek.safar@seznam.cz>
3886 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
3887 detection until I fix it.
3889 * cs-tokenizer.cs: Changed error message.
3891 * cs-parser.jay: Fixed 2 error locations.
3893 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
3894 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
3897 * enum.cs (GetSignatureForError): Fixed.
3899 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
3903 * typemanager.cs (RegisterProperty): Removed.
3905 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
3907 2005-08-24 Raja R Harinath <rharinath@novell.com>
3910 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
3911 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
3913 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3915 * expression.cs : tiny fix is required for not warning positive ulong.
3918 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3920 * expression.cs : add CS0652 check for constant and integral
3921 expression. Fixed bug #53974.
3923 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3925 * expression.cs : in DoNumericPromotions(), check if there is implicit
3926 conversion overload for string (to check CS0034). Fixed bug #52492.
3928 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3930 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
3932 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3934 * ecore.cs : report location when it is *not* Null.
3936 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3942 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
3943 correctly. Fixed bug #75721.
3945 2005-08-23 Raja R Harinath <rharinath@novell.com>
3947 * support.cs (SeekableStreamReader.Position): Avoid an expensive
3948 loop that performs 'min (pos, char_count)'.
3951 * expression.cs (Unary.ResolveOperator): Don't discard implicit
3952 converted value in Operator.OnesComplement.
3954 2005-08-22 Ben Maurer <bmaurer@ximian.com>
3956 * anonymous.cs: If the anon method is pulled into a helper class,
3957 it needs to be `internal' not `private'. Fixes runtime behavior on
3960 2005-08-17 Marek Safar <marek.safar@seznam.cz>
3963 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
3966 2005-08-16 Marek Safar <marek.safar@seznam.cz>
3968 The big constants rewrite
3969 Fix #75746, #75685 and more
3970 As a side effect saved 1MB for MWF ;-)
3972 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
3973 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
3974 enum based for corlib compilation.
3976 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
3979 * class.cs (FixedField.Define): Use ResolveAsConstant.
3981 * const.cs (IConstant): Interface constants and enums.
3982 (Const.ResolveValue): New method for constant resolvning.
3983 (ExternalConstant): Constants from imported assemblies.
3985 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
3986 conversion; like enums.
3987 (Constant.ToType): Converts this constant to different type.
3988 (Constant.Increment): Adds 1.
3990 * convert.cs (ImplicitConversionRequired): Simplified.
3992 * cs-parser.jay: Create EnumMember directly.
3994 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
3996 * doc.cs (GenerateEnumDocComment): Removed.
3998 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
3999 (ConvertIntLiteral): Removed.
4000 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
4002 * enum.cs (EnumMember): Implement IConstant.
4003 (Enum.IsValidEnumConstant): Removed.
4004 (Enum.GetNextDefaultValue): Removed.
4005 (Enum.FindMembers): Updated.
4006 (Enum.GenerateDocComment): Iterate enum members.
4008 * expression.cs (Cast.TryReduce): Handle enums correctly.
4009 (New.Constantify): Made public.
4010 (MemberAccess.DoResolve): Removed contant specific if(s).
4012 * literal.cs (NullLiteral): Implement new abstract methods.
4014 * statement.cs (GotoCase.Resolve): Use new constant methods.
4015 (SwitchLabel.ResolveAndReduce): Use new constant methods.
4017 * typemanager.cs (LookupEnum): Removed.
4018 (IsEnumType): Fixed to work with corlib.
4019 (RegisterConstant): Removed.
4020 (LookupConstant): Removed.
4021 (GetConstant): Changed to work with IConstant.
4023 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
4025 * location.cs : Fixed overflown (>255) column number.
4027 2005-08-03 Raja R Harinath <rharinath@novell.com>
4029 First cut of the qualified-alias-member feature.
4030 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
4032 * cs-parser.jay (DOUBLE_COLON): New token.
4033 (namespace_or_type_name): Add rule for recognizing
4034 qualified-alias-members.
4035 (primary_expression): Likewise.
4036 (element_access): Allow QualifiedAliasMember as a possible
4037 type-bearing expression.
4038 (local_variable_type, local_variable_pointer_type): Likewise.
4039 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
4040 aliases in the current and enclosing namespace declarations.
4041 (NamespaceEntry.UsingAlias): Add CS0440 warning.
4042 * decl.cs (MemberName.is_double_colon): New.
4043 (MemberName.MemberName): Add new constructor for alias-member.
4044 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
4045 * expression.cs (QualifiedAliasMember): New expression type.
4047 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4049 * location.cs : it borked when no argument was specified.
4051 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4053 * location.cs : tiny ToString() format fix.
4055 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4057 * statement.cs : oops, it was missing.
4059 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4061 A set of fixes for precise line/column location.
4064 "token" field now holds a file/line "delta", a line number offset
4065 from the segment, and a column number. See also:
4066 http://lists.ximian.com/pipermail/mono-devel-list/2004-
4067 December/009508.html
4068 Removed static IsNull. Use instance IsNull property instead.
4070 For some tokens it stores Location. For Identifier it stores
4071 LocatedToken which is a pair of string name and location.
4072 Column numbers are adjusted only at getChar().
4074 Use Location.ToString() for reporting (it now contains column).
4076 Largely modified to use LocatedToken instead of
4077 string (IDENTIFIER), and to acquire Location from some tokens.
4078 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
4079 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
4081 Now MemberName holds Location. DeclSpace.ctor() receives Location
4082 as a parameter. Removed extra parameters to all derived classes.
4083 Replaced Location.IsNull() with instance property.
4084 * assign.cs, expression.cs :
4085 Added .ctor() overload that omits Location.
4087 Added "nameEscaped" flag that indicates the identifier was escaped
4088 in the source file. This fixes bug #57047.
4090 2005-09-02 Martin Baulig <martin@ximian.com>
4092 * class.cs: Make CS3005 a warning, not an error.
4094 2005-08-02 Marek Safar <marek.safar@seznam.cz>
4096 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
4097 New method, looking for lo-case imported cls type.
4099 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
4102 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
4104 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
4106 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
4108 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
4110 Optimized to save 3.5 MB for SWF compilation.
4112 2005-08-01 Marek Safar <marek.safar@seznam.cz>
4114 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
4115 (PartialContainer.Create): Moved logic AddToContainer.
4116 (PartialContainer.MarkForDuplicationCheck): Shares name.
4118 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
4121 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
4123 (Namespace.GetSignatureForError): New method.
4125 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
4126 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
4128 2005-08-01 Raja R Harinath <rharinath@novell.com>
4131 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
4132 member lookup rather than qualifier_type, since qualifier_type can
4135 2005-08-01 Marek Safar <marek.safar@seznam.cz>
4137 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
4140 2005-07-31 Miguel de Icaza <miguel@novell.com>
4142 * statement.cs: Copy the local exception into the exception
4143 captured local. Fixes 75674
4145 2005-07-31 Raja R Harinath <harinath@gmail.com>
4148 * expression.cs (Invocation.OverloadResolve): Don't report error
4149 CS1501 if error CS1502 has been reported.
4150 (New.DoResolve): Delegate CS1501 reporting to
4151 Invocation.OverloadResolve.
4154 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
4155 invariant-meaning-in-block property in an enclosing block if
4158 2005-07-29 Marek Safar <marek.safar@seznam.cz>
4160 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
4161 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
4162 (Switch.CheckSwitch): Just save 50kb for SWF.
4164 2005-07-27 Martin Baulig <martin@ximian.com>
4166 * anonymous.cs (CaptureContext.AddField): Added
4167 `AnonymousContainer am' argument; compute its toplevel scope if
4168 it's not already computed. Fixes #75649.
4170 2005-07-26 Raja R Harinath <rharinath@novell.com>
4173 * class.cs (Constructor.Emit): Reset block to null if the block
4176 2005-07-25 Marek Safar <marek.safar@seznam.cz>
4178 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
4180 2005-07-25 Marek Safar <marek.safar@seznam.cz>
4182 * class.cs (MethodData.Define): Check whether accessor implementing
4183 interface is public.
4185 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
4187 2005-07-22 Marek Safar <marek.safar@seznam.cz>
4190 * namespace.cs (LookupType): Moved same type check to...
4192 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
4195 2005-07-21 Raja R Harinath <rharinath@novell.com>
4197 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
4198 already found a typebuilder.
4199 * class.cs (MethodCore.IsDuplicateImplementation): Compare
4200 MemberNames, not strings.
4202 * const.cs (Error_ExpressionMustBeConst):
4203 Rename from Error_EpressionMustBeConst.
4204 * const.cs, class.cs, statement.cd: Update.
4206 2005-07-21 Marek Safar <marek.safar@seznam.cz>
4210 * const.cs (Const.LookupConstantValue): Report missing contant expression
4212 (Error_EpressionMustBeConstant): Only one error method.
4214 * class.cs, statement.c: Updated.
4216 2005-07-20 Raja R Harinath <rharinath@novell.com>
4218 * statement.cs (Block.Flags): Add back HasVarargs.
4219 (Block.flags): Make protected.
4220 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
4222 * typemanager.cs (types, typecontainers, user_types): Remove.
4223 (UserTypes, TypeContainers): Likewise.
4224 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
4225 (CleanUp, Reset): Update.
4226 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
4227 (GetNestedType): Use Type.GetNestedType.
4228 (CoreLookupType): Take two arguments, the namespace and the
4229 basename of the type. Update to use the Namespace.Lookup
4231 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
4232 (RealMemberLookup): Use IsNestedChildOf instead of playing with
4233 string concatenation and substring matches.
4234 * class.cs, enum.cs, delegate.cs: Update to changes.
4236 2005-07-20 Marek Safar <marek.safar@seznam.cz>
4238 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
4239 Expression and made virtual.
4241 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
4242 (ImplicitStandardConversionExists): Fixed `byte' typo ?
4244 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
4246 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
4249 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
4252 2005-07-18 Marek Safar <marek.safar@seznam.cz>
4255 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
4256 AssemblyCultureAttribute is not used on executable.
4259 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
4261 2005-07-16 Raja R Harinath <rharinath@novell.com>
4264 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
4265 New. Reports CS0252/CS0253.
4266 Mostly taken from preliminary patch by Duncak Mak.
4267 (Binary.DoResolveOperator): Store results of operator lookup.
4268 Use them to detect if we need to warn about unintended reference
4271 2005-07-15 Raja R Harinath <rharinath@novell.com>
4274 * namespace.cs (Namespace.Lookup): Add back location parameter.
4275 (Namespace.LookupType): Add CS0436 report. Add location parameter.
4276 * delegate.cs, ecore.cs, expression.cs: Update to changes.
4278 * codegen.cs (EmitContext.DeclSpace): Make readonly.
4279 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
4280 (Namespace.LookupType): ... this.
4281 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
4283 * typemanager.cs (LookupTypeReflection): Remove buggy code that
4284 purported to handle pointers.
4285 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
4288 2005-07-15 Marek Safar <marek.safar@seznam.cz>
4290 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4293 2005-07-15 Raja R Harinath <rharinath@novell.com>
4295 * namespace.cs (Namespace.Lookup): Drop location parameter.
4296 (NamespaceEntry.LookupAlias): Remove. Merge into ...
4297 (NamespaceEntry.Lookup): ... this.
4298 (NamespaceEntry.Error_AmbiguousTypeReference):
4299 Move here from DeclSpace.
4300 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
4302 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
4303 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
4304 Move to NamespaceEntry.
4305 * delegate.cs, expression.cs: Update to changes.
4307 2005-08-31 Martin Baulig <martin@ximian.com>
4309 Committing a patch from Atsushi Enomoto for #75850.
4311 * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
4312 Prefer a generic enumerator over a non-generic one.
4314 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
4316 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
4317 * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
4319 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4321 * driver.cs : reverting default encoding change as well as mcs.
4323 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4325 * driver.cs, support.cs : merged r48826.
4327 > could you integrate your mcs changes to gmcs otherwise
4328 > gmcs cannot compile some files.
4330 2005-08-20 Martin Baulig <martin@ximian.com>
4332 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4333 scope if we don't already have it.
4335 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
4336 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
4339 2005-07-31 Miguel de Icaza <miguel@novell.com>
4341 * statement.cs: Copy the local exception into the exception
4342 captured local. Fixes 75674
4344 2005-07-15 Marek Safar <marek.safar@seznam.cz>
4346 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4349 2005-08-12 Martin Baulig <martin@ximian.com>
4351 * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
4352 for nested types here to avoid hitting the cache too early.
4354 2005-08-09 Miguel de Icaza <miguel@novell.com>
4356 * enum.cs: On the new compiler CLS error 3005 is now a warning not
4359 2005-08-03 Martin Baulig <martin@ximian.com>
4361 Make iterators in generic methods work; see gtest-191.cs.
4364 (Constraints.Resolve): Protect against being called twice.
4367 (TypeContainer.GetClassBases): Make this `protected virtual'.
4369 * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
4370 (Iterator.GetClassBases): Override this and compute the base
4372 (Iterator.DefineNestedTypes): If we're a generic method, all our
4373 method type parameters become class type parameters on the proxy
4377 (ToplevelBlock.Parameters): Make this a property, not a field.
4378 (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
4380 2005-08-03 Martin Baulig <martin@ximian.com>
4382 * typemanager.cs (TypeManager.IsSubclassOf): Use
4383 `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
4384 (TypeManager.GetFullName_recursed): Improved.
4386 2005-07-27 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4389 * ecore.cs (Expression.IsAccessorAccessible): Change the check for
4390 Private accessor case, using TypeManager.IsPrivateAccessible instead of
4391 invocation_type == mi.DeclaringType, since the first one also checks
4392 other condition used by generic instances.
4394 2005-07-27 Martin Baulig <martin@ximian.com>
4396 * anonymous.cs (CaptureContext.AddField): Added
4397 `AnonymousContainer am' argument; compute its toplevel scope if
4398 it's not already computed. Fixes #75649.
4400 2005-07-14 Marek Safar <marek.safar@seznam.cz>
4402 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
4403 CheckAttributeType and refactored.
4404 (Attribute.ResolvePossibleAttributeType): Changed to reuse
4405 ResolveAsTypeTerminal error handling.
4406 (ResolveAsTypeTerminal): Introduced because of global attributes extra
4408 (GetSignatureForError): Print errors in same way.
4411 * codegen.cs: Reflect attribute GetSignatureForError change.
4414 * expression.cs: Add silent parameter to ResolveAsTypeStep.
4416 * namespace.cs (UsingEntry): Refactored to make fields private.
4419 statement.cs: Error_UnexpectedKind has extra parameter.
4421 2005-07-14 Raja R Harinath <rharinath@novell.com>
4423 * ecore.cs (IAlias): Remove.
4424 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
4425 that implement the interface.
4426 * namespace.cs (Namespace): Likewise.
4427 (Namespace.declspaces): Renamed from 'defined_names'.
4428 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
4429 DeclSpace instead of an IAlias.
4430 * tree.cs (Tree.AddDecl): Update.
4432 2005-07-12 Raja R Harinath <rharinath@novell.com>
4434 * statement.cs (Block.Flags); Remove HasVarargs.
4435 (Block.HasVarargs): Move to ToplevelBlock.
4436 (Block.ThisVariable, Block.AddThisVariable): Likewise.
4437 (Block.Variables): Make protected. Initialize variable hashtable
4439 (Block.AddVariable): Update.
4440 (Block.Resolve): Update to changes.
4441 (ToplevelBlock.HasVarargs): New boolean.
4442 (ToplevelBlock.ThisVariable): Move here from Block.
4443 (ToplevelBlock.AddThisVariable): Likewise.
4444 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
4445 * expression.cs (This.ResolveBase): Update to changes.
4446 (ArglistAccess.DoResolve): Likewise.
4448 2005-07-11 Marek Safar <marek.safar@seznam.cz>
4451 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
4453 * class.cs (TypeContainer.VerifyMembers): Distinguish between
4454 not used and not used & assigned.
4455 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
4457 2005-07-11 Marek Safar <marek.safar@seznam.cz>
4460 * expression.cs (Is.DoResolve): null is never provided type.
4462 2005-07-08 Marek Safar <marek.safar@seznam.cz>
4465 * cs-parser.jay: Less strict event error rule to catch more errors.
4467 2005-07-11 Martin Baulig <martin@ximian.com>
4469 * generic.cs (ConstructedType.CheckConstraints): Improve the check
4470 for the constructor constraint: we do not only have to check
4471 whether the class has a public constructor, but also ensure that
4472 it's parameterless. Fixes #75492.
4474 2005-07-11 Martin Baulig <martin@ximian.com>
4476 * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
4477 between type parameters if they either have the reference type
4478 constraint or the class constraint.
4480 2005-07-10 Kamil Skalski <nazgul@nemerle.org>
4482 * generic.cs: Use MakeGenericType instead of BindGenericParameters.
4484 2005-07-07 Marek Safar <marek.safar@seznam.cz>
4487 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
4488 (ExtractSecurityPermissionSet): Cope with self referencing security
4489 attributes properly.
4491 * driver.cs (SetOutputFile): Made public property OutputFile.
4493 2005-07-07 Raja R Harinath <rharinath@novell.com>
4496 * class.cs (TypeContainer.first_nonstatic_field): Rename from
4497 has_nonstatic_fields. Make into a FieldBase pointer.
4498 (TypeContainer.AddField): Add CS0282 check.
4499 (TypeContainer.EmitType): Update.
4501 2005-07-06 Miguel de Icaza <miguel@novell.com>
4503 * cs-tokenizer.cs (consume_identifier): Do not create strings to
4504 compare if they start with __.
4506 2005-07-06 Raja R Harinath <rharinath@novell.com>
4508 * statement.cs (Switch.SwitchGoverningType): Only look at
4509 UserCasts that don't need implicit standard conversions to one of
4510 the allowed switch types (Fixes test-322.cs).
4511 (LocalInfo.Resolve): Re-enable sanity-test.
4513 2005-07-06 Marek Safar <marek.safar@seznam.cz>
4515 * cs-tokenizer.cs (consume_identifier): Detect double undescores
4517 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
4519 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
4521 2005-07-06 Raja R Harinath <rharinath@novell.com>
4524 * ecore.cs (SimpleName.GetSignatureForError): Add.
4525 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
4526 (MemberAccess.GetSignatureForError): Add.
4528 2005-07-05 Marek Safar <marek.safar@seznam.cz>
4530 The big error and warning messages review.
4560 * typemanager.cs: Updated.
4562 * class.cs: (MethodCore.SetYields): Moved here to share.
4563 (PropertyMethod.Define): Moved iterator setup here.
4565 * iterators.cs: Add orig_method to have full access to parent
4568 2005-07-05 Raja R Harinath <rharinath@novell.com>
4570 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
4571 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
4572 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
4573 variable of struct type.
4574 * expression.cs (Unary.ResolveOperator): Update to change.
4575 (Indirection.VerifyFixed): Likewise.
4576 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
4577 (ParameterReference.VerifyFixed): Value parameters are fixed.
4578 (This.VerifyFixed): Treat 'this' as a value parameter.
4579 * statement.cs (LocalInfo.IsFixed): Remove.
4581 2005-07-01 Martin Baulig <martin@ximian.com>
4583 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4584 `ec.EmitThis ()' to get the correct scope.
4586 2005-07-01 Martin Baulig <martin@ximian.com>
4588 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
4589 instance is a ParameterReference; fixes #75299.
4591 2005-06-30 Raja R Harinath <rharinath@novell.com>
4594 * expression.cs (Indexers.map): Remove.
4595 (Indexers.Append): Filter out inaccessible setters and getters.
4596 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
4599 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
4601 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
4602 (FieldExpr.Emit, PropertyExpr.Emit): Update.
4603 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
4604 * expression.cs (Invocation.EmitCall): Add CS0120 check.
4606 2005-06-30 Marek Safar <marek.safar@seznam.cz>
4609 * class.cs (FieldBase.GetInitializerExpression): One more field
4612 2005-06-28 Miguel de Icaza <miguel@novell.com>
4614 * pending.cs: Do not define a proxy if the base method is virtual,
4615 it will be picked up by the runtime (bug 75270).
4617 2005-07-08 Martin Baulig <martin@ximian.com>
4619 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
4620 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
4622 2005-07-07 Martin Baulig <martin@ximian.com>
4624 * generic.cs (ConstructedType.CheckConstraint): Use
4625 ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
4626 called recursively; fixes #75329.
4628 2005-07-06 Martin Baulig <martin@ximian.com>
4630 * generic.cs (TypeManager.InferTypeArguments): Added support for
4631 anonymous methods; fixes #75461.
4633 2005-07-01 Martin Baulig <martin@ximian.com>
4635 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4636 `ec.EmitThis ()' to get the correct scope.
4638 2005-07-01 Martin Baulig <martin@ximian.com>
4640 * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
4641 instance is `This'; fixes #75299.
4643 2005-06-30 Martin Baulig <martin@ximian.com>
4645 * class.cs (Indexer): Implement IIteratorContainer; added support
4646 for iterators in indexers.
4649 (EmitContext.CurrentIterator): Make this a property, not a field.
4651 * anonymous.cs (AnonymousContainer.Iterator): New public property.
4653 2005-06-28 Miguel de Icaza <miguel@novell.com>
4655 * pending.cs: Do not define a proxy if the base method is virtual,
4656 it will be picked up by the runtime (bug 75270).
4658 2005-06-28 Martin Baulig <martin@ximian.com>
4660 * cs-parser.jay (interface_method_declaration): Avoid a
4661 reduce/reduce conflict by moving some of the code into a separate
4662 `interface_method_declaration_body' rule; fixes #75368.
4664 2005-06-28 Martin Baulig <martin@ximian.com>
4666 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
4667 array check after the check for TypeBuilder's.
4669 2005-06-21 Raja R Harinath <rharinath@novell.com>
4671 * convert.cs (FindMostEncompassedType): Add two trivial special
4672 cases (number_of_types == 0 || number_of_types == 1).
4673 (FindMostEncompasingType): Likewise.
4675 2005-06-17 Raja R Harinath <rharinath@novell.com>
4677 Some cleanups preparing for the fix of #75283.
4678 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
4680 (EventExpr.InstanceResolve): Likewise.
4681 (EventExpr.DoResolve): Remove redundant checks.
4683 2005-06-08 Miguel de Icaza <miguel@novell.com>
4685 * class.cs: Small fix.
4687 2005-06-08 Raja R Harinath <rharinath@novell.com>
4690 * class.cs (GetPartialBases): Fix return value check of
4693 2005-06-07 Raja R Harinath <rharinath@novell.com>
4695 Ensure that partial classes are registered in their enclosing
4696 namespace. Initial part of fix of #75160.
4697 * tree.cs (Tree.RecordDecl): Add new namespace argument.
4698 Register declspace with namespace here, not in
4699 DeclSpace.RecordDecl.
4700 * cs-parser.jay: Pass namespace to RecordDecl.
4701 * class.cs (PartialContainer.Create): Likewise.
4702 (ClassPart.DefineType): New sanity-check. Throws an exception if
4704 * decl.cs (Declspace.RecordDecl): Remove.
4705 * namespace.cs (NamespaceEntry.DefineName): Remove.
4707 2005-06-06 Marek Safar <marek.safar@seznam.cz>
4709 * rootcontext.cs: Reset TargetExt as well.
4711 2005-06-03 Raja R Harinath <rharinath@novell.com>
4713 * ecore.cs (Expression.Resolve): Emit CS0654 error when
4716 2005-06-02 Raja R Harinath <rharinath@novell.com>
4718 Fix #75080, cs0119.cs.
4719 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
4721 (Expression.Resolve): ... this. Use it. Remove bogus code
4722 allowing ExprClass.Type and ExprClass.Namespace for
4723 ResolveFlags.VariableOrValue.
4724 (Expression.Resolve) [1-argument variant]: Change default resolve
4725 flags based on language version.
4726 (Expression.Error_UnexpectedKind): Use a simple string array
4727 rather than an ArrayList.
4728 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
4730 (TypeOfVoid.DoResolve): Likewise.
4731 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
4732 flags argument -- it always has the same value.
4734 2005-05-31 Raja R Harinath <rharinath@novell.com>
4737 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
4738 Use it in the error message.
4739 * assign.cs, expression.cs, statement.cs: Update.
4741 2005-05-30 Raja R Harinath <rharinath@novell.com>
4744 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
4745 the "almostMatchedMember" case too.
4746 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
4747 that failed the accessibility checks to 'almost_match'.
4749 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
4751 * attribute.cs: Use internal MethodBuilder methods to set
4752 ExactSpelling and SetLastError on PInvoke methods, instead
4753 of passing them via charset. Fixes #75060.
4755 2005-05-27 Raja R Harinath <rharinath@novell.com>
4757 * parameter.cs (Parameter): Remove TODO comment.
4758 (Parameter.DefineParameter): Remove Location parameter.
4759 (Parameters.LabelParameters): Likewise.
4760 * class.cs (Constructor.Emit): Update to change.
4761 (MethodData.Emit): Likewise.
4762 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
4763 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
4765 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
4768 Removed Parameters.Location and added Parameter.Location instead.
4769 Removed Location parameter from Emit() and GetSignature().
4776 Modified all related calls.
4778 2005-06-21 Martin Baulig <martin@ximian.com>
4780 * generic.cs (NullCoalescingOperator.Emit): Make this work if the
4781 left-hand side is not a nullable type; fixes #75328.
4783 2005-06-21 Martin Baulig <martin@ximian.com>
4786 (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
4787 (TypeManager.GetFullNameSignature): Likewise.
4789 * convert.cs (Convert.Error_CannotImplicitConversion): Compare
4790 `source.FullName' and `target.FullName' to check whether there are
4791 two conflicting definitions.
4793 2005-06-21 Martin Baulig <martin@ximian.com>
4795 * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
4796 a BoxedCast - also for reference types - to be compatible with csc.
4798 2005-06-21 Martin Baulig <martin@ximian.com>
4800 * expression.cs (MemberAccess.DoResolve): Add support for nested
4801 types in a generic instance; fixes #75320.
4803 2005-06-20 Martin Baulig <martin@ximian.com>
4805 * generic.cs (TypeManager.InferType): Also walk the class
4806 hierarchy for generic instances; fixes #75261.
4808 2005-06-17 Martin Baulig <martin@ximian.com>
4810 * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
4811 to make things work for corlib.
4813 2005-06-15 Martin Baulig <martin@ximian.com>
4815 * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
4816 obsolete `SecurityAction' values.
4818 2005-06-06 Marek Safar <marek.safar@seznam.cz>
4820 * rootcontext.cs: Reset TargetExt as well.
4822 2005-06-09 Martin Baulig <martin@ximian.com>
4824 * delegate.cs (Delegate.VerifyMethod): Added
4825 `MethodGroupExpr old_mg' argument; inherit its
4826 `HasTypeParameters'; fix #75085.
4828 2005-06-09 Martin Baulig <martin@ximian.com>
4830 * expression.cs (Invocation.OverloadResolve): Correctly handle
4831 generic methods for the SetMemberIsUsed(); fix #75064.
4833 2005-06-09 Martin Baulig <martin@ximian.com>
4835 * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
4838 2005-06-08 Martin Baulig <martin@ximian.com>
4840 * cs-parser.jay (nullable_type_or_conditional): If we put the
4841 nullable back and our `type' is a `ComposedCast', remove the
4842 nullable from it. Fixes #75156.
4844 * expression.cs (ComposedCast.RemoveNullable): New public method.
4846 2005-06-08 Martin Baulig <martin@ximian.com>
4848 The big Iterators rewrite :-)
4850 * iterators.cs: Rewrite this to use the anonymous methods framework.
4852 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
4853 before the TypeContainers; see 2test-21.cs.
4856 (TypeContainer.DefineType): Don't create a new EmitContext if we
4857 already have one (this only happens if we're an Iterator).
4858 (TypeContainer.Define): Also call Define() on all our iterators.
4859 (Method.CreateEmitContext): Added support for iterators.
4862 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
4863 (AnonymousContainer.CreateMethodHost): Moved here from
4864 AnonymousMethod and made abstract.
4865 (AnonymousContainer.CreateScopeType): New abstract method.
4866 (AnonymousContainer.IsIterator): New public property.
4867 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
4868 get the ScopeTypeBuilder rather than manually defining it here.
4869 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
4872 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
4873 before RootContext.DefineTypes().
4875 * codegen.cs (EmitContext.RemapToProxy): Removed.
4876 (EmitContext.CurrentAnonymousMethod): Changed type from
4877 AnonymousMethod -> AnonymousContainer.
4878 (EmitContext.ResolveTopBlock): Protect from being called twice.
4879 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
4880 (EmitContext.EmitThis): Removed the iterators hacks; use the
4881 anonymous methods framework for that.
4884 (ToplevelBlock.Container): Make this a property, not a field.
4885 (ToplevelBlock.ReParent): New public method; move the
4886 ToplevelBlock into a new container.
4887 (Foreach.TemporaryVariable): Simplify.
4889 2005-06-05 Martin Baulig <martin@ximian.com>
4891 * statement.cs (LocalInfo.CompilerGenerated): New flag.
4892 (Block.AddTemporaryVariable): New public method; creates a new
4893 `LocalInfo' for a temporary variable.
4894 (Block.EmitMeta): Create the LocalBuilders for all the temporary
4896 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
4897 non-iterator variables.
4899 2005-06-05 Martin Baulig <martin@ximian.com>
4901 * statement.cs (Foreach.TemporaryVariable): Create the
4902 LocalBuilder in the Emit phase and not in Resolve since in some
4903 situations, we don't have an ILGenerator during Resolve; see
4904 2test-19.cs for an example.
4906 2005-06-04 Martin Baulig <martin@ximian.com>
4908 The big Foreach rewrite - Part II.
4910 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
4911 with `PropertyInfo ienumerator_getcurrent'.
4913 * codegen.cs (VariableStorage): Removed.
4916 (Foreach): Derive from Statement, not ExceptionStatement.
4917 (Foreach.CollectionForeach): New nested class. Moved all the code
4918 dealing with collection foreach here.
4919 (Foreach.ForeachHelperMethods): Removed.
4920 (Foreach.TemporaryVariable): Implement IMemoryLocation.
4922 2005-05-23 Martin Baulig <martin@ximian.com>
4924 * statement.cs (Try.DoResolve): Don't create a `finally' if we
4925 don't need to. Fix #75014.
4927 2005-05-26 Raja R Harinath <rharinath@novell.com>
4929 Improve user-defined conversion handling.
4930 * convert.cs (GetConversionOperators): Rewrite. Return only the
4931 applicable operators.
4932 (AddConversionOperators): New. Helper for GetConversionOperators.
4933 (FindMostEncompassedType, FindMostEncompassingType): Verify that
4934 there is only one most encompassed/encompassing type.
4935 (FindMostSpecificSource, FindMostSpecificTarget): Remove
4936 "applicable operator" handling.
4937 (UserConversion): Move cache here from GetConversionOperators.
4938 Directly cache the chosen operator, rather than the whole
4940 (ExplicitNumericConversion): Fix buggy implementation of Decimal
4941 case. Allow conversion of decimal to sbyte and byte too.
4942 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4943 New static methods. Used to avoid allocating EmptyExpressions in
4946 2005-05-24 Duncan Mak <duncan@novell.com>
4948 * ecore.cs (CastFromDecimal): New class for casting a decimal to
4949 another class, used in Convert.ExplicitNumericConversion.
4950 (CastToDecimal): New class, similar to above, but casts to
4951 System.Decimal, used in Convert.ImplicitNumericConversion and also
4952 in explicit convesion from double/float to decimal.
4954 * convert.cs (ImplicitNumericConversion): Handle implicit
4955 conversions to System.Decimal.
4956 (ExplicitNumericConversion): handle explicit conversions to
4961 2005-05-20 Miguel de Icaza <miguel@novell.com>
4963 * typemanager.cs: Do not throw an exception in the TypeBuilder
4964 case, we take care of it on the TypeCode.
4966 2005-05-17 Marek Safar <marek.safar@seznam.cz>
4968 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
4971 * cs-parser.jay: Catch more lexical errors.
4973 * report.cs: Add one more Error method.
4976 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
4978 2005-05-20 Martin Baulig <martin@ximian.com>
4980 * class.cs (TypeContainer.CircularDepException): Removed.
4981 (TypeContainer.DefineType): Removed the `InTransit' stuff.
4982 (TypeContainer.CheckRecursiveDefinition): Check for circular class
4983 (CS0146) and interface (CS0529) dependencies here.
4985 2005-05-20 Martin Baulig <martin@ximian.com>
4987 * expression.cs (New.DoResolve): Move the CS0712 check above the
4988 CS0144 check; otherwise it can never be reached.
4990 2005-05-20 Martin Baulig <martin@ximian.com>
4992 * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
4994 2005-05-20 Martin Baulig <martin@ximian.com>
4996 * class.cs (TypeContainer.DefineType): Fix CS0698 check.
4998 * typemanager.cs (TypeManager.IsAttributeType): New public method.
5000 2005-05-19 Martin Baulig <martin@ximian.com>
5003 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
5004 to disable error reporting.
5006 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
5007 here since we don't want to report an error; see the new test-336.cs.
5009 2005-05-19 Raja R Harinath <rharinath@novell.com>
5011 * statement.cs (ToplevelBlock.GetParameterReference)
5012 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
5013 Move here from class Block.
5014 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
5015 * expression.cs (ParameterReference.DoResolveBase): Likewise.
5017 2005-05-18 Martin Baulig <martin@ximian.com>
5022 (FlowBranching.Reachability): Add non-static public And() and Or()
5024 (FlowBranchingSwitch): New class; do the `break_origins' thing
5025 like in FlowBranchingLoop.
5026 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
5027 reachability, not just locals and parameters.
5028 (FlowBranching.MergeChild): Remove some of the hacks for loop and
5029 switch; MergeBreakOrigins() now takes care of that.
5031 2005-05-18 Martin Baulig <martin@ximian.com>
5033 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5034 a loop and may leave it, reset the barrier; fixes #74974.
5036 2005-05-16 Raja R Harinath <rharinath@novell.com>
5038 Fix test-382.cs. Emit values of decimal constants.
5039 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
5041 (TypeContainer.AddField): ... this.
5042 (TypeContainer.EmitFieldInitializers): Allow the list of fields
5043 with initializers to include 'Const's.
5044 (ClassPart.RegisterFieldForInitialization): Forward to
5046 * const.cs (Const.Const): Pass initializer to base class.
5047 (Const.Define): In case of decimal constants, register them for
5048 initialization in a static constructor.
5050 2005-05-14 Martin Baulig <martin@ximian.com>
5052 * statement.cs (Block.Resolve): Correctly handle unreachable code;
5053 do not call ResolveUnreachable() on unreachable statements in
5054 here, see the comment in the source code.
5056 2005-05-13 Raja R Harinath <rharinath@novell.com>
5059 * expression.cs (BinaryResolveOperator): If one of the operands of
5060 an equality comparison is 'null' and the other is a pointer type,
5061 convert the null to a NullPointer.
5062 * convert.cs (ImplicitReferenceConversion): If the expression is a
5063 NullLiteral and the target type is a pointer type, return a
5064 NullPointer instead.
5065 (ImplicitConversionStandard): Likewise.
5067 2005-05-13 Marek Safar <marek.safar@seznam.cz>
5069 * cs-parser.jay: Set readonly context based on special constructs.
5071 * expression.cs (LocalVariableReference.DoResolveBase): Improved
5072 readonly variable error handling.
5074 * rootcontext.cs (EmitCode): Don't verify members when error
5077 * statement.cs (LocalInfo): Add reaodnly context information.
5078 (SetReadOnlyContext, GetReadOnlyContext): New methods.
5080 2005-05-17 Martin Baulig <martin@ximian.com>
5082 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
5085 2005-05-13 Martin Baulig <martin@ximian.com>
5087 * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
5088 handle unreachable blocks.
5090 2005-05-13 Martin Baulig <martin@ximian.com>
5093 (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
5094 (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
5097 2005-05-13 Martin Baulig <martin@ximian.com>
5099 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
5100 instance variable, not a local. Fix #74873.
5101 (Block.ResolveUnreachable): Set it to true here.
5103 2005-05-12 Martin Baulig <martin@ximian.com>
5105 * cs-parser.jay (property_declaration): Pass the `current_class',
5106 not the `current_container' to Property's .ctor. Fixes #74912.
5108 2005-05-11 Martin Baulig <martin@ximian.com>
5110 * typemanager.cs (Closure): Copy this from MCS and merge all the
5111 GMCS-specific changes into it.
5113 2005-05-12 Raja R Harinath <harinath@gmail.com>
5116 * typemanager.cs (unmanaged_enclosing_types): New.
5117 (IsUnmanagedType): Avoid infloops by using
5118 'unmanaged_enclosing_types' to talk with recursive invocations.
5120 2005-05-11 Duncan Mak <duncan@novell.com>
5122 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
5123 continuing to process for 'arg'.
5124 (handle_preprocessing_directive): Check the argument of the #endif
5125 directive and report error CS1025 if there are any trailing
5128 According to the C# spec, having even whitespace after the #endif
5129 directive is illegal; however, because we call arg.TrimEnd ()
5130 beforehand, we have the same behavior as csc, allowing whitespace
5131 after the directive.
5135 2005-05-11 Marek Safar <marek.safar@seznam.cz>
5139 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
5140 (Constructor.GetObsoleteAttribute): Implemented correctly.
5142 2005-05-10 Martin Baulig <martin@ximian.com>
5144 * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
5145 resolve the type; fixes #74864.
5146 (DefaultValueExpression): Create the LocalTemporary in Emit(), not
5147 in DoResolve(); fixes #74862.
5149 2005-05-10 Martin Baulig <martin@ximian.com>
5151 * support.cs (ReflectionParameters.ParameterModifier): Use
5152 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
5153 and `ParameterAttributes.In'. Fixes #74884.
5155 2005-05-10 Martin Baulig <martin@ximian.com>
5157 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
5158 the cache if we're just looking for `MemberTypes.NestedType' in a
5161 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
5162 constraints if we're still resolving the type tree.
5163 (Expression.MemberLookup): If we're resolving the type tree, only
5164 look for `MemberTypes.NestedType' since we're only interested in
5167 * class.cs (TypeContainer.DefineType): Don't resolve the type
5168 parameters here; do this later in ResolveType() after the type
5169 tree has been resolved.
5170 (TypeContainer.ResolveType): New public method; this is called
5171 after the type tree is resolved and before the types are being
5172 populated. We resolve the generic constraints here.
5173 (TypeContainer.DoDefineMember): Check the constraints on our base
5174 class and interfaces.
5176 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
5177 set the `ResolvingTypeTree' flag on the EmitContext.
5179 * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
5181 2005-05-10 Marek Safar <marek.safar@seznam.cz>
5183 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
5185 * expression.cs (Argument.GetParameterModifier): Turned to property.
5186 (Invocation.Error_InvalidArguments): Add more descriptive errors.
5188 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
5191 2005-05-09 Raja R Harinath <rharinath@novell.com>
5194 * decl.cs (MemberCache.AddMethods): Register override methods,
5195 rather than non-override methods.
5196 * typemanager.cs (RegisterOverride): New.
5197 (IsOverride): Update.
5199 2005-05-09 Marek Safar <marek.safar@seznam.cz>
5201 * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
5203 2005-05-06 Martin Baulig <martin@ximian.com>
5206 (Attributable.IsClsComplianceRequired): Fix typo in the method name.
5207 (AttributeTester.AnalyzeTypeCompliance): Add generics support.
5209 2005-05-09 Marek Safar <marek.safar@seznam.cz>
5213 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
5214 recursive declaration.
5216 * statement.cs (Block.ResolveMeta): Report any error in resolving.
5218 2005-05-06 Marek Safar <marek.safar@seznam.cz>
5220 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
5222 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
5224 2005-05-05 Raja R Harinath <rharinath@novell.com>
5227 * decl.cs (DeclSpace.FamilyAccessible):
5228 Use TypeManager.IsNestedFamilyAccessible.
5230 Fix reopened #64812.
5231 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
5234 2005-05-04 Raja R Harinath <rharinath@novell.com>
5235 Abin Thomas <projectmonokochi@rediffmail.com>
5236 Anoob V E <projectmonokochi@rediffmail.com>
5237 Harilal P R <projectmonokochi@rediffmail.com>
5240 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
5241 allow access to all static members.
5243 2005-05-04 Martin Baulig <martin@ximian.com>
5245 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
5247 2005-05-04 Martin Baulig <martin@ximian.com>
5251 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
5252 section at the end; make things work if `default' is not the last
5255 2005-05-04 Martin Baulig <martin@ximian.com>
5259 * statement.cs (Switch): Replaced the `got_default' field with a
5260 `default_section' one.
5261 (Switch.CheckSwitch): Set `default_section' here.
5262 (Switch.Resolve): If we're a constant switch and the constant is
5263 not found, use the default section.
5265 2005-05-03 Martin Baulig <martin@ximian.com>
5267 * expression.cs (ArrayAccess.EmitGetLength): New public method.
5269 * statement.cs (Foreach.ArrayForeach): New nested class.
5270 (Foreach.TemporaryVariable): New nested class.
5271 (Foreach.EmitArrayForeach): Removed; this is now in the new
5274 2005-05-03 Raja R Harinath <rharinath@novell.com>
5276 * pending.cs (BaseImplements): Move the #74773 fix here. This is
5278 (VerifyPendingMethods): Revert change below.
5280 * typemanager.cs (IsOverride, RegisterNonOverride): New.
5281 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
5282 that used to trigger warning -28. Remove warning -28.
5283 * expression.cs (Invocation.OverloadResolve): Use
5284 TypeManager.IsOverride to distinguish override methods.
5287 * pending.cs (VerifyPendingMethods): If a base type implements the
5288 requested interface, don't bother checking individual methods of
5289 the base type. As a side-effect, this prevents the creation of
5290 unnecessary proxies.
5292 2005-05-02 Martin Baulig <martin@ximian.com>
5296 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5297 Also `And' the locals if the old vector is null.
5298 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
5299 null; in this case we basically reset all the variables.
5301 2005-05-02 Martin Baulig <martin@ximian.com>
5305 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
5306 Added `FlowBranching branching' argument; always `and' the
5307 variables instead of `or'ing them unless we're an infinite loop.
5309 * statement.cs (While.Resolve): Create a new sibling unless we're
5312 2005-05-02 Martin Baulig <martin@ximian.com>
5316 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
5317 arguments; use it instead of creating a new TopLevelBlock.
5318 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
5319 our ConstructorInitializer.
5322 (TopLevelBlock.TopLevelBranching): New public property.
5323 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
5324 and create our `TopLevelBranching'.
5326 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
5327 anonymous method host, use `block.TopLevelBranching' rather than
5328 creating a new branching.
5330 2005-04-20 Miguel de Icaza <miguel@novell.com>
5332 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
5333 a ScopeInfo, if any of the current children is a child of the new
5334 entry, move those children there.
5336 2005-04-30 Martin Baulig <martin@ximian.com>
5338 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
5339 at the beginning of a SwitchSection. Fix #73335.
5341 2005-04-27 Marek Safar <marek.safar@seznam.cz>
5344 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
5346 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
5347 (FieldExpr.DoResolve): Obsolete members are ignored for field
5350 2005-04-26 Marek Safar <marek.safar@seznam.cz>
5352 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
5353 of arrays detection.
5355 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
5357 (Field.VerifyClsCompliance): Volatile fields are not compliant.
5359 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
5362 2005-04-25 Ben Maurer <bmaurer@ximian.com>
5364 * cs-parser.jay: Use the prefered version of -unsafe in error
5367 2005-04-22 Marek Safar <marek.safar@seznam.cz>
5369 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
5372 2005-04-20 John Luke <john.luke@gmail.com>
5374 * driver.cs: fix typo in error message, --outout to --output
5376 2005-04-30 Martin Baulig <martin@ximian.com>
5378 * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
5379 handle the .NET 2.x security attributes.
5381 2005-04-30 Martin Baulig <martin@ximian.com>
5384 (TypeManager.ExpandInterfaces): Don't add things twice.
5387 (TypeContainer.VerifyClsCompliance): Allow generic instances.
5389 2005-04-29 Martin Baulig <martin@ximian.com>
5391 * generic.cs (Constraints.ResolveTypes): Expand interfaces.
5393 * anonymous.cs: Added support for anonymous generic methods.
5395 2005-04-29 Martin Baulig <martin@ximian.com>
5397 * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
5400 2005-04-29 Martin Baulig <martin@ximian.com>
5402 * generic.cs (TypeManager.HasConstructorConstraint): Removed.
5404 * expression.cs (New.DoResolve): Fix the CS0304 check.
5406 2005-04-29 Martin Baulig <martin@ximian.com>
5408 * typemanager.cs (TypeManager.GetFullName): Updated to the new
5411 * class.cs (MethodCore.IsDuplicateImplementation): If we're an
5412 explicit interface implementation, compare the interface types.
5413 (MethodData.Define): Use the new naming scheme from the latest
5415 (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
5417 * decl.cs (MemberName.GetMemberName): Removed.
5418 (MemberName.MethodName, FullName): New properties.
5420 2005-04-25 Raja R Harinath <rharinath@novell.com>
5422 * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
5424 2005-04-22 Martin Baulig <martin@ximian.com>
5426 * generic.cs (GenericMethod): Create the EmitContext in the
5427 `Define()'; in `Define(MethodBuilder)', create the type parameters
5428 before calling `Define()'. Fixes #73933.
5430 2005-04-22 Martin Baulig <martin@ximian.com>
5433 (Constraints.Resolve): Make things work wrt. the new type lookup system.
5434 (ConstructedType.ResolveAsTypeTerminal): Don't override this.
5436 * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
5437 ConstructedType, check its constraints.
5439 2005-04-20 Marek Safar <marek.safar@seznam.cz>
5441 * codegen.cs (InRefOutArgumentResolving): New field.
5443 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
5444 fields outside contructor.
5446 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
5448 2005-04-19 Miguel de Icaza <miguel@novell.com>
5450 * anonymous.cs (CaptureContext.EmitParameterInstance): The
5451 parameter code was not completed ever, so it was not as up-to-date
5452 as local variables. Must finish it.
5454 The bug fix was to compare the Toplevel of the block, not the
5455 current block. Thanks for Ben for pointing this out.
5457 2005-04-19 Raja R Harinath <rharinath@novell.com>
5459 * decl.cs (AddMethods): Use the declaring type of the problem
5460 method to determine if we want to squash a warning.
5462 2005-04-19 Marek Safar <marek.safar@seznam.cz>
5464 * attribute.cs: Removed debug output.
5466 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
5468 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
5471 2005-04-18 Raja R Harinath <rharinath@novell.com>
5474 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
5475 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
5476 all null comparisons against reference types.
5478 2005-04-18 Marek Safar <marek.safar@seznam.cz>
5481 * class.cs (TypeContainer.CircularDepException) New nested
5483 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
5484 (TypeContainer.DefineType): Removed error, reset InTransit before
5486 (Class.DefineType): Throw exception when is in Transit.
5487 Catch exception and report error.
5488 (Struct.DefineType): Throw exception when is in Transit.
5489 Catch exception and report error.
5490 (Interface.DefineType): Throw exception when is in Transit.
5491 Catch exception and report error.
5493 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
5494 handle nested exception handlers.
5496 * flowanalysis.cs (InTryWithCatch): New method, search for try with
5499 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
5500 InFinally and InCatch storage.
5502 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
5503 (Catch.Resolve): Set and Restore ec.InCatch.
5504 (Try.Resolve): Set and Restore ec.InFinally.
5505 (Try.HasCatch): True when try has catch.
5507 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
5509 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
5510 for the same event member, so exclude such cases from warning 419.
5513 2005-04-16 Miguel de Icaza <miguel@novell.com>
5515 * expression.cs (Binary.ResolveOperator): Apply patch from John
5516 Luke to fix bug 59864: operators &, | and ^ on enumerations
5517 require that the same enum type on both sides.
5519 * driver.cs: Add warnings to old flag usage, this is to assist
5520 people who produce Makefiles and hope that the Makefiles will be
5523 * class.cs (TypeContainer.EmitType): Moved the definition of the
5524 special $PRIVATE$ field from the resolve phase to the Emit phase.
5525 During resolve we do not know if we are a struct with
5526 HasExplicitLayout, we know this only after the attributes for the
5529 Set the FieldOffset to zero on the dummy field that we create for
5530 the class. Fixes 74590.
5532 2005-04-16 Raja R Harinath <rharinath@novell.com>
5535 * ecore.cs (PropertyExpr.resolved): New.
5536 (DoResolve): Use it to handle a case of double resolution here.
5537 Handle a case of identical-name-and-type-name.
5538 * expression.cs (ArrayCreation.CheckIndices): Avoid double
5539 resolution by storing the results of expression resolution back
5540 into the "probes" array.
5542 2005-04-15 Raja R Harinath <rharinath@novell.com>
5544 Fix cs0208-7.cs and cs0208-8.cs.
5545 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
5546 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
5547 error reporting to point out the reason a struct is not unmanaged.
5549 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5551 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
5552 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
5554 2005-04-13 Raja R Harinath <rharinath@novell.com>
5557 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
5558 IdenticalNameAndTypeName here.
5559 (EventExpr.InstanceResolve): Likewise.
5561 2005-04-13 Marek Safar <marek.safar@seznam.cz>
5563 C# 2.0 DefaultCharSetAttribute implementation
5565 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
5566 which allows us to set GlobalNamespace for every resolve.
5567 (Attribute.ResolveArguments): Cut from Resolve.
5568 (Attribute.GetCharSetValue): Returns CharSet named argument.
5569 (Attribute.DefinePInvokeMethod): Gets default charset from
5571 (GlobalAttribute.ResolveAsTypeStep): Override.
5572 (GlobalAttribute.ResolveArguments): Override.
5574 * class.cs (TypeAttr): Is protected.
5576 * codegen.cs (ModuleClass.DefaultCharSet): New member.
5577 (ModuleClass.DefaultCharSetType): New memeber.
5578 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
5580 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
5581 charset from module.
5583 * delegate.cs (TypeAttr): Override.
5584 (Delegate.DefineType): Use this TypeAttr.
5586 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
5587 at very early stage (before types are defined) to resolve model
5588 module attributes. It will probably not work with corlib but it
5591 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
5592 charset from module.
5594 * typemanager.cs (default_charset_type): New type.
5596 2005-04-13 Raja R Harinath <rharinath@novell.com>
5598 * decl.cs (MemberCache.AddMethods): Don't warn if
5599 System.Object.Finalize has buggy MethodAttributes.
5601 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
5604 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5606 * doc.cs : detect ambiguous reference to overloaded members.
5607 Fixed bug #71603. MS 1.1 csc does not detect it.
5609 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5611 * doc.cs : delegates must not be referenced with parameters.
5614 2005-04-12 Miguel de Icaza <miguel@novell.com>
5616 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
5618 2005-04-10 Miguel de Icaza <miguel@novell.com>
5620 * driver.cs (MainDriver): Stop processing if the CLS stage found
5623 (CompilerCallableEntryPoint.InvokeCompiler): Always
5624 reset after execution; Take a TextWriter argument for the
5627 * report.cs: Use the error stream instead of hardcoding stderr.
5629 2005-04-09 Miguel de Icaza <miguel@novell.com>
5631 * class.cs: Reduce code paths to test, too small of an
5632 optimization to make it worth the extra testing. Always perform
5635 2005-04-08 Raja R Harinath <rharinath@novell.com>
5638 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
5639 operators that had errors reported on them.
5641 2005-04-08 Marek Safar <marek.safar@seznam.cz>
5643 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
5645 (Attribute.Resolve): Add named argument type checking.
5647 * class.cs (FixedField.Define): Use IsPrimitiveType
5649 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
5651 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
5652 unsafe parameter types.
5654 * statement.cs (Using.ResolveExpression): Add better error description.
5656 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
5658 2005-04-08 Raja R Harinath <rharinath@novell.com>
5661 * attribute.cs (Attribute.GetAttributeUsage): Resolve
5662 AttributeUsageAttribute in the emitcontext of the attribute class,
5663 not in the emitcontext of the attributable entity it was attached to.
5664 * cs-parser.jay: Use 'current_class', not 'current_container',
5665 when creating a GlobalAttribute.
5667 2005-04-08 Alp Toker <alp@atoker.com>
5669 * pending.cs: The fix to #58413 failed to compile methods implementing
5670 interfaces with/without params modifiers and vice versa, even though
5671 params modifiers aren't part of the signature. Make the modifier check
5672 less strict as in csc.
5674 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
5675 Anoob V E <projectmonokochi@rediffmail.com>
5676 Harilal P R <projectmonokochi@rediffmail.com>
5679 * pending.cs (TypeAndMethods.mods): New. Store the parameter
5680 modifiers of pending methods.
5681 (PendingImplementation.PendingImplementation): Initialize it.
5682 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
5683 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
5684 with ParameterData. Add check for modifiers.
5685 * class.cs (MethodData.Define): Update to changes.
5687 2005-04-07 Raja R Harinath <rharinath@novell.com>
5689 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
5691 2005-04-07 Marek Safar <marek.safar@seznam.cz>
5693 * class.cs (PropertyMethod.Define): Check private accessor in abstract
5696 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
5699 * typemanager.cs: Registered RequiredAttributeAttribute.
5701 2005-04-06 Marek Safar <marek.safar@seznam.cz>
5703 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
5704 Warning CS0169 is back at level 3.
5705 (IMethodData.SetMemberIsUsed): New method.
5707 * decl.cs (IsUsed): New value; moved from FieldBase.Status
5708 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
5710 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
5712 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
5714 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
5717 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
5720 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
5721 to avoid the problems with nested types.
5723 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
5724 Anoob V.E <projectmonokochi@rediffmail.com>
5725 Harilal P.R <projectmonokochi@rediffmail.com>
5726 Raja R Harinath <rharinath@novell.com>
5729 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
5731 * typemanager (GetConstructor): Make public.
5733 2005-04-05 John Luke <john.luke@gmail.com>
5734 Raja R Harinath <rharinath@novell.com>
5737 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
5738 struct too. Return false quicker in a few cases.
5739 (VerifyUnManaged): Use it.
5741 2005-04-05 Raja R Harinath <rharinath@novell.com>
5744 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
5745 not 'unreachable_seen'.
5747 2005-04-04 Marek Safar <marek.safar@seznam.cz>
5749 * attribute.cs (Attribute.GetValue): Removed unused.
5751 * codegen.cs (CodeGen.TrimExt): Removed unused.
5753 * cs-parser.jay (output): Removed unused.
5755 * cs-tokenizer.cs (hex_digits): Removed unused.
5757 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
5759 * expression.cs (Indirection.LoadExprValue): Removed unused.
5760 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
5762 * iterators.cs (Iterator.param_types): Removed unused.
5764 * statement.cs (Goto.block): Removed unused.
5765 (ToplevelBlock.did): Removed unused.
5766 (Switch.ResolveConstantSwitch): Removed unused.
5768 2005-04-01 Ben Maurer <bmaurer@ximian.com>
5770 * rootcontext.cs: Allow mcs to bootstrap with the compilation
5773 2005-04-19 Martin Baulig <martin@ximian.com>
5775 Merged r42462 from MCS and made it work for GMCS.
5777 * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
5779 * generic.cs (GenericMethod.Define): Removed `return_type' argument.
5781 2005-04-01 Raja R Harinath <rharinath@novell.com>
5783 Fix #74232 and cs0208-3.cs.
5784 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
5785 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
5786 unmanaged type. Don't use FieldBuilders when 't' is a
5787 TypeBuilder. Use ModFlags and MemberType fields.
5788 * class.cs (MemberBase.member_type): Rename from MemberType.
5789 (MemberBase.MemberType): New property. Determines member_type on
5791 (MemberBase.DoDefine): Don't initialize MemberType here.
5792 (FieldMember.Define): Likewise.
5794 2005-04-01 Marek Safar <marek.safar@seznam.cz>
5797 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
5798 Attributes are emitted there.
5800 2005-04-01 Raja R Harinath <rharinath@novell.com>
5802 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
5803 keyword in 'partial enum' too.
5804 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
5806 Report from Kamil Skalski <nazgul@omega.pl>.
5809 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
5810 have partial containers too.
5812 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
5813 in block' checks to Block.CheckInvariantMeaningInBlock.
5814 * statement.cs (Block.GetKnownVariableInfo): Make private.
5815 (Block.IsVariableUsedInChildBlock): Remove.
5816 (Block.IsVariableUsedInBlock): Likewise.
5817 (Block.CheckInvariantMeaningInBlock): New. Show location of
5818 conflicting declaration.
5819 (Block.AddVariable): Make error messages less long-winded and more
5820 specific. Show location of conflicting declaration.
5821 * parameter.cs (Parameters.Location): New readonly property.
5823 2005-03-31 Raja R Harinath <rharinath@novell.com>
5825 Clean up semantics of invoking ResolveMemberAccess.
5826 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
5827 can have an instance, ensure that we pass in a non-TypeExpression
5828 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
5829 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
5830 argument. Update to changes and simplify.
5831 (FieldExpr.Emitinstance): Remove CS0120 check.
5832 (PropertyExpr.EmitInstance): Likewise.
5833 * expression.cs (Argument.Resolve): Likewise.
5834 (Invocation.DoResolve): Update to changes in semantics of
5837 2005-03-31 Marek Safar <marek.safar@seznam.cz>
5840 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
5843 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
5845 2005-03-31 Raja R Harinath <rharinath@novell.com>
5847 Fix difference in behaviour with commandline invocation.
5848 * driver.cs (Driver.Reset): New.
5849 (CompilerCallableEntryPoint): Call it.
5851 * statement.cs (If.Resolve): Avoid spurious "uninitialized
5852 variable" warnings if the boolean expression failed to resolve.
5854 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
5856 * attribute.cs: Fix the union of several permissions when some of them
5857 are unrestricted (so the result isn't an unrestricted permission set).
5860 2005-03-30 Raja R Harinath <rharinath@novell.com>
5862 * ecore.cs (MemberExpr): New class. Convert from interface
5864 (MemberExpr.ResolveMemberAccess): Refactor and move here from
5865 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
5867 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
5868 (MethodGroupExpr.IsExplicitImpl): Remove.
5869 (Expression.GetFieldFromEvent): Remove.
5870 (SimpleName.MemberStaticCheck): Remove.
5871 (SimpleName.DoSimpleNameResolve): Update to changes.
5872 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
5873 (MemberAccess.IdenticalNameAndTypeName): Remove.
5874 (MemberAccess.error176): Move to MemberExpr.
5875 (MemberAccess.DoResolve): Update to changes.
5876 (BaseAccess.DoResolve): Likewise.
5878 2005-03-30 Marek Safar <marek.safar@seznam.cz>
5880 C# 2.0 Conditional attribute class implementation
5882 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
5883 Analyzes class whether it has attribute which has ConditionalAttribute
5884 and its condition is not defined.
5886 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
5887 (Class.IsExcluded): New method. Search for at least one defined
5888 condition in ConditionalAttribute of attribute class.
5890 2005-03-30 Raja R Harinath <rharinath@novell.com>
5892 * ecore.cs (PropertyExpr): Derive from Expression, not
5893 ExpressionStatement.
5894 (PropertyExpr.EmitStatement): Remove.
5896 2005-03-29 Raja R Harinath <rharinath@novell.com>
5899 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
5900 internal field "value__" of an enum be private. The examples for
5901 "value__" that I found on MSDN all used FieldAttributes.Private.
5903 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
5904 Don't mention IL method attribute names.
5906 Fix #47991. Remove a TODO.
5907 * statement.cs (Block.Toplevel): Make into a field.
5908 (Block.Parameters): Move into ToplevelBlock.
5909 (Block.known_variables): Rename from child_variable_names.
5910 (Block.Block): Remove variants that take Parameters. Initialize
5911 'Toplevel' with the immediately surrounding toplevel block.
5912 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
5913 LocalInfo parameter.
5914 (Block.GetKnownVariableInfo): New.
5915 (Block.IsVariableNameUsedInChildBlock): Update.
5916 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
5917 the block, even though it may not be in scope.
5918 (Block.AddVariable): Remove Parameters parameter. Use
5919 Toplevel.Parameters instead.
5920 (Block.AddConstant): Remove Parameters parameter.
5921 (Block.GetParameterReference): Update to use Toplevel.Parameters.
5922 (Block.IsParamaterReference): Likewise.
5923 (Block.IsLocalParameter): Likewise. Simplify a lot.
5924 (ToplevelBlock.Parameters): New. Moved from Block.
5925 (ToplevelBlock.ToplevelBlock): Update to changes. Always
5926 initialize Parameters to a non-null value.
5927 * cs-parser.jay: Update to changes.
5928 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
5929 simple names that mean different things in the same block. Use
5930 Block.IsVariableNameUsedInBlock.
5932 2005-03-28 Raja R Harinath <rharinath@novell.com>
5934 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
5936 2005-03-26 Raja R Harinath <harinath@acm.org>
5939 * assign.cs (Assign.DoResolve): When the RHS of an assignment
5940 fails to resolve, ensure that the LHS is still resolved as an
5943 2005-03-25 Raja R Harinath <harinath@acm.org>
5945 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
5947 (Enum.current_ec): Remove.
5948 (Enum.LookupEnumValue): Remove EmitContext argument.
5949 Just uses the one created during DefineType.
5950 (Enum.FindMembers): Update.
5951 * expression.cs (MemberAccess.DoResolve): Update.
5953 2005-03-22 Marek Safar <marek.safar@seznam.cz>
5955 * assign.cs (Assign.DoResolve): Check for CS1717 when
5956 source and target are same (uses Equals).
5958 * expression.cs (LocalVariableReference, ParameterReference,
5959 This): Implemented Equals, GetHashCode.
5961 * statement.cs (Block.GetParameterReference): Removed useless
5964 2005-03-22 Raja R Harinath <rharinath@novell.com>
5967 * statement.cs (Block.AddVariable): Ensure that we skip implicit
5968 blocks before deciding whether the error is cs0136 or cs0128.
5970 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
5971 (using_alias_directive, using_namespace_directive): Pass
5972 MemberName, not an expression to Namespace.UsingAlias and
5974 (MakeName): Use the MemberName of the namespace.
5975 * namespace.cs (Namespace.MemberName): New.
5976 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
5977 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
5979 * decl.cs (MemberName.Name): Make readonly.
5980 (MemberName.FromDotted): New "constructor".
5981 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
5982 (MemberCore.Name): Compute from MemberName on demand.
5983 (MemberCore.SetMemberName): Provide a way to change the
5985 (MemberCore.AddToContainer): Don't take a fullname parameter.
5986 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
5987 fully qualified name of the container to the member name.
5988 (TypeContainer.AddToTypeContainer): Use a fully qualified name
5989 only if the type is a member of the root container.
5990 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
5991 MemberName.Left rather than searching for an embedded ".".
5992 (PartialContainer.CreatePart): Update to changes in RootContext.
5993 (MemberBase.ShortName): Turn into a property. Use
5994 MemberCore.SetMemberName.
5995 (MemberBase.ExplicitInterfaceName): Remove.
5996 (MemberBase.UpdateMemberName): Remove.
5997 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
5998 (PropertyBase.SetMemberName): New override.
5999 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
6000 (Tree.GetDecl): New.
6001 (Tree.AllDecls): Rename from Decls.
6002 * attribute.cs, enum.cs, report.cs: Update to changes.
6003 * driver.cs (MainDriver): Use MemberName.FromDotted on
6004 RootContext.MainClass.
6006 2005-03-21 Marek Safar <marek.safar@seznam.cz>
6008 * class.cs (FixedField.Define): Check for CS1664 and more sanity
6011 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
6013 2005-03-18 Marek Safar <marek.safar@seznam.cz>
6015 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
6016 property accessor modifiers.
6018 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
6019 fixed buffer attribute (CS1716).
6020 (PropertyMethod.HasCustomAccessModifier): When property accessor
6021 has custom modifier.
6023 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
6025 (PropertyExpr.DoResolveLValue): Add CS0272.
6027 2005-03-17 Miguel de Icaza <miguel@novell.com>
6029 * convert.cs: When converting to a pointer, use the proper Conv.U
6030 or Conv.I depending on the source data type.
6032 * cs-tokenizer.cs: Make the size for large decimal constants,
6035 2005-03-17 Martin Baulig <martin@ximian.com>
6037 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6038 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
6040 2005-03-17 Martin Baulig <martin@ximian.com>
6042 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6043 to bool so we can return an error condition.
6044 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6047 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
6049 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
6052 2005-03-16 Raja R Harinath <rharinath@novell.com>
6054 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
6055 Refactor to avoid traversing the list of assemblies, and to avoid
6056 string concatenation.
6057 * typemanager.cs (guid_attr_type): Remove.
6058 (negative_hits, pointers, references): Remove hashes.
6060 (GetConstructedType): New. Uses type_hash to handle constructed
6061 types (arrays, references, pointers).
6062 (GetReferenceType, GetPointerType): Use it.
6063 (GetNestedType): New. Uses type_hash to handle nested types of
6065 (LookupType, LookupTypeDirect): Remove.
6066 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
6067 'types' hash and LookupTypeReflection directly.
6068 (params_string, params_object): Use GetConstructedType.
6069 * namespace.cs (Namespace.cached_types): New. Cache of reflected
6071 (Namespace.Lookup): Use cached_types.
6072 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
6073 provided by old TypeManager.LookupType.
6074 * rootcontext.cs (MakeFQN): Remove.
6075 * decl.cs (DeclSpace.MakeFQN): Likewise.
6076 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
6077 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
6078 TypeManager.GetConstructedType.
6079 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
6081 2005-04-16 Zoltan Varga <vargaz@freemail.hu>
6083 * cs-parser.jay: Fix build.
6085 2005-03-15 Marek Safar <marek.safar@seznam.cz>
6087 * class.cs (TypeContainer.CircularDepException) New nested
6088 (MethodCore.CheckBase): Report CS1715 for properties and indexers.
6090 * cs-parser.jay: Reports CS1527 for any namespace element.
6092 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
6095 * expression.cs (ParameterReference.IsAssigned): Changed error to
6097 (Error_WrongNumArguments): Moved CS0245 detection here.
6099 * statement.cs (Return.Resolve): Add CS1622 report.
6101 2005-03-11 Marek Safar <marek.safar@seznam.cz>
6103 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
6105 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
6107 * attribute.cs expression.cs: Get rid of some allocations.
6109 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
6111 * doc.cs : just eliminate the latest change.
6113 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
6115 * doc.cs : commented out the latest change. It breaks xml-030.cs
6117 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
6119 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
6120 fail. So invoke CreateType() in FindDocumentedType().
6122 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
6124 * cs-tokenizer.cs : added IsKeyword().
6125 * doc.cs : Detect keyword incorrectly used as identifier.
6126 Allow identifiers prefixed by @.
6128 2005-03-10 Marek Safar <marek.safar@seznam.cz>
6130 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
6131 It caused exception in namespace resolving (again!).
6133 * class.cs (Class.ctor): Removed exit.
6134 (PropertyMethod.ctor): ditto.
6136 * codegen.cs (Codegen.Reset): Reset static data.
6137 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
6139 * cs-tokenizer.cs (Cleanup): Removed.
6141 * driver.cs (GetSystemDir): Rewrote to one line command.
6142 It caused problem with unloaded dynamic modules.
6143 (UnixParseOption): Removed Exit.
6144 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
6145 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
6146 Now can be mcs used as library.
6148 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
6151 * location.cs (Reset): Reset static data.
6153 * namespace.cs (Reset): Reset static data.
6155 * report.cs (Report.Reset): Reset static data.
6157 * rootcontext.cs (RootContext.Reset): Reset static data.
6159 * tree.cs (RootTypes.ctor): Use Location.Null
6161 * typemanager.cs (TypeManager.Reset): Reset static data.
6162 (CoreLookupType): Removed Exit.
6163 (TypeHandle.Reset): Reset static data.
6165 2005-03-10 Raja R Harinath <rharinath@novell.com>
6168 * typemanager.cs (ComputeNamespaces): Import namespaces from
6169 referenced modules too.
6171 2005-03-09 Raja R Harinath <rharinath@novell.com>
6173 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
6176 2005-03-09 Raja R Harinath <rharinath@novell.com>
6178 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
6179 enclosing DeclSpace. This ensures that a name-lookup populates
6180 more caches and there are fewer 'TypeExpression's. Carve out
6181 nested type lookup into ...
6182 (LookupNestedTypeInHierarchy): ... this.
6184 2005-04-15 Martin Baulig <martin@ximian.com>
6186 Merged r41590 from MCS and make it work in the generics land.
6188 * generic.cs (TypeParameter.UpdateConstraints): Removed the
6191 * class.cs (PartialContainer.UpdateConstraints): Removed.
6192 (PartialContainer.CheckConstraints): Removed.
6193 (PartialContainer.SetParameterInfo): Store the constraints here.
6194 (PartialContainer.DefineTypeParameters): New public method;
6195 resolve the type parameter's constraints here. Note that the
6196 PartialContainer doesn't have an EmitContext anymore, so we must
6197 do this in the ClassPart.
6199 2005-03-09 Raja R Harinath <rharinath@novell.com>
6201 Clean up a few partial-class semantics.
6202 Fixes test-357.cs and cs1618-2.cs.
6203 * cs-parser.jay (struct_declaration): Use 'current_class' as
6204 parent of newly-created struct. Remove call to Register ().
6205 Use 'pop_current_class' to complete handing the current struct.
6206 (interface_declaration): Likewise.
6207 (class_declaration): Likewise.
6208 (enum_declaration): Use 'current_class' as parent of newly created
6210 (delegate_declaration): Likewise.
6211 (pop_current_class): New function. This is used to handle closing
6212 up the 'current_class' and 'current_container', and pointing them
6213 to the enclosing class/container.
6214 (CSharpParser): Initialize 'current_class' too.
6215 * decl.cs (MemberCore): Add check for invariant: a partial
6216 container is not a parsed entity, and thus does not enclose any
6218 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
6219 (DeclSpace.BaseTypeExpr): Use it.
6220 (DeclSpace.LookupType): Add check for invariant.
6221 * class.cs (TypeContainer): Add check for invariant: a nested
6222 class should have the same NamespaceEntry as its enclosing class.
6223 (TypeContainer.EmitFieldInitializers): Make virtual.
6224 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
6226 (TypeContainer.Register): Remove.
6227 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
6228 null. Use TypeResolveEmitContext for resolving base types and
6229 interfaces. Move initialization of Parts.TypeBuilder here from
6231 (TypeContainer.DefineNestedTypes): ... here.
6232 (PartialContainer): Take a Namespace not a NamespaceEntry.
6233 (PartialContainer.Create): Don't use Register. Call the
6234 appropriate Add... function directly.
6235 (ClassPart): Take both the PartialContainer and the enclosing
6236 class as constructor arguments.
6237 (ClassPart.EmitFieldInitializers): Override.
6238 (ClassPart.PartFindNestedTypes): Remove.
6239 (FieldBase.GetInitializerExpression): Resolve the initializer
6240 expression in the emit context of the enclosing class.
6241 * tree.cs (RootTypes): Remove Register ().
6243 2005-03-08 Marek Safar <marek.safar@seznam.cz>
6245 * cs-parser.jay: Removed CS0134.
6247 * driver.cs: Removed CS1901.
6249 * expression.cs (SizeOf.DoResolve): Don't report CS0233
6250 for predefined types.
6252 2005-03-07 Duncan Mak <duncan@novell.com>
6254 * codegen.cs (Save): Catch UnauthorizedAccessException as
6255 well. Fixes bug #73454.
6257 2005-03-07 Marek Safar <marek.safar@seznam.cz>
6259 * cs-tokenizer.cs (xtoken): Add CS1035.
6261 * class.cs (MethodData.Define): Add CS0683.
6262 (FieldMember.ctor): Add CS0681.
6264 2005-03-07 Raja R Harinath <rharinath@novell.com>
6266 * ecore.cs (SimpleName.DoResolve): Rename from
6267 SimpleName.DoResolveAllowStatic.
6268 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
6269 Pass 'intermediate' flag to MemberStaticCheck.
6270 (SimpleName.MemberStaticCheck): Skip "static check" only in case
6271 of "intermediate" lookups via MemberAccess.
6272 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
6273 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
6275 2005-03-07 Raja R Harinath <rharinath@novell.com>
6278 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
6279 slipped in because of variable names that are identical to a
6280 builtin type's BCL equivalent ('string String;', 'int Int32;').
6281 (PropertyExpr.EmitInstance): Likewise.
6283 2005-03-04 Marek Safar <marek.safar@seznam.cz>
6285 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
6287 * report.cs (warning_ignore_table): Made public.
6289 2005-03-04 Raja R Harinath <rharinath@novell.com>
6292 * class.cs (MethodData.Emit): Pass 'container' to
6293 container.GetObsoleteAttribute instead of 'container.Parent'.
6295 2005-03-03 Marek Safar <marek.safar@seznam.cz>
6297 * cs-parser.jay: Add 1534 error test.
6299 * iterators.cs (Yield.CheckContext): Add error 1629.
6300 (Iterator.ctor): Save unsafe modifier.
6301 (MoveNextMethod.DoEmit): Restore unsafe context.
6303 * namespace.cs (UsingAlias): Better error message.
6305 2005-03-03 Dan Winship <danw@novell.com>
6307 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
6308 the warning message [#73219]
6310 2005-03-03 Raja R Harinath <rharinath@novell.com>
6312 Fix compile with MCS 1.0.0.0.
6313 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
6314 w_restore to not depend on string constant folding.
6316 2005-03-03 Raja R Harinath <rharinath@novell.com>
6318 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
6319 CS0246 check to users who passed 'silent = false'.
6320 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
6322 (SimpleName.SimpleNameResolve): Update.
6323 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
6324 (MemberAccess.IdenticalNameAndTypeName): Update.
6325 * doc.cs (FindDocumentedTypeNonArray): Update.
6327 2005-03-03 Raja R Harinath <rharinath@novell.com>
6329 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
6330 * parameters.cs (ComputeAndDefineParameters): Remove.
6331 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
6332 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
6333 Use GetParameterInfo.
6335 2005-03-02 Marek Safar <marek.safar@seznam.cz>
6337 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
6339 2005-03-02 Raja R Harinath <rharinath@novell.com>
6341 Unify DeclSpace.LookupType and DeclSpace.FindType.
6342 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
6343 is in charge of defining nested types on demand.
6344 (DeclSpace.LookupType): Use it when the current_type is a
6345 TypeBuilder. Use LookupTypeDirect for reflected types.
6346 (DeclSpace.FindType): Remove.
6347 (DeclSpace.LookupInterfaceOrClass): Likewise.
6348 (DeclSpace.DefineTypeAndParents): Likewise.
6349 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
6350 DeclSpace.LookupType.
6351 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
6352 * typemanager.cs (LookupType): Simplify.
6353 (AddUserType): Remove type from negative_hits.
6354 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
6355 * class.cs (TypeContainer.FindMembers): Move handling of nested
6357 (TypeContainer.FindMembers_NestedTypes): ... here.
6358 (TypeContainer.FindNestedType): Implement override.
6359 (ClassPart.FindNestedType): Delegate to PartialContainer.
6360 (ClassPart.PartFindNestedType): Looks up the nested types of the
6363 2005-04-14 Martin Baulig <martin@ximian.com>
6365 * generic.cs (ConstructedType): Moved all the type lookup and
6366 nested class logic into SimpleName.
6367 (ConstructedType.ResolveConstructedType): Our underlying type is
6368 already fully resolved; all the type lookup stuff is in
6371 * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
6372 constructed types here instead of in ConstructedType.
6374 * decl.cs (MemberName.GetTypeExpression): Always create a
6375 SimpleName, not a ConstructedType.
6376 (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
6378 2005-03-02 Martin Baulig <martin@ximian.com>
6380 * class.cs (TypeContainer.DoDefineMembers): We also need a default
6381 static constructor in static classes.
6383 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
6385 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
6386 sizeParamIndex is not specified.
6388 2005-03-01 Marek Safar <marek.safar@seznam.cz>
6391 * report.cs (WarningMessage.IsEnabled): Missing null check.
6393 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6395 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
6396 in the fields and not in the properties.
6398 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
6400 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
6403 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6405 * attribute.cs: Small refactoring (improved robustness).
6406 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
6407 (ValidateGuid): Removed.
6408 (Resolve): Removed referenced to above mentioned.
6409 (GetAttributeUsage): Made private and changed to work without
6411 (GetIndexerAttributeValue): Don't crash.
6412 (GetConditionalAttributeValue): Ditto.
6413 (GetClsCompliantAttributeValue): Ditto.
6414 (ExtractSecurityPermissionSet): All attributes exceptions are
6416 (GetPropertyValue): New helper.
6417 (GetMethodImplOptions): New method.
6418 (DefinePInvokeMethod): Reuse common code. Implemented handling of
6419 some missing properties.
6421 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
6422 (Method.ApplyAttributeBuilder): Updated.
6424 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
6427 2005-02-28 Raja R Harinath <rharinath@novell.com>
6430 * report.cs (Report.SymbolRelatedToPreviousError): Handle
6431 non-simple types (array, pointer, reference).
6433 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6435 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
6437 * class.cs (MethodCore.IsDuplicateImplementation): Special error
6439 (Method.CheckBase): Catch wrong destructor here.
6440 (MethodData.Define): Add errors 550, 668.
6442 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
6444 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
6446 * pending.cs (VerifyPendingMethods): Add error 551.
6448 * typemanager.cs (CSharpName): Next error report helper.
6450 2005-02-25 Marek Safar <marek.safar@seznam.cz>
6452 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
6453 attributes. Removed useless attribute double check.
6454 It saves almost 2MBs for corlib.
6456 2005-02-25 Raja R Harinath <rharinath@novell.com>
6459 * statement.cs (ExpressionStatement.Resolve): Make robust to being
6460 called twice in case of error.
6462 2005-02-23 Chris Toshok <toshok@ximian.com>
6464 Fix compiler portions of #72827.
6465 * statement.cs (Block.Emit): call Begin/EndScope on the
6466 EmitContext instead of the ILGenerator.
6468 * codegen.cs (EmitContext.BeginScope): new method, call
6469 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
6471 (EmitContext.BeginScope): same, but EndScope and CloseScope
6473 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
6474 offset and call the superclass's OpenScope(int) with it.
6475 (SymbolWriter.CloseScope): get the current il
6476 offset and call superclass's CloseScope(int) with it.
6478 2005-02-23 Marek Safar <marek.safar@seznam.cz>
6480 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
6481 CS1677 for out and ref as well.
6483 * class.cs (Method.Define): Add error CS1599 detection.
6485 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
6487 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
6489 * delegate.cs (Delegate.Define): Add error CS1599 detection.
6491 * support.cs.cs (ModifierDesc): New helper method.
6493 2005-02-23 Raja R Harinath <rharinath@novell.com>
6494 Abin Thomas <projectmonokochi@rediffmail.com>
6495 Anoob V E <projectmonokochi@rediffmail.com>
6496 Harilal P R <projectmonokochi@rediffmail.com>
6499 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
6500 MemberLookup (used for error reporting) actually returns a result.
6501 Fix error report number (122, not 112).
6503 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
6504 Anoob V E <projectmonokochi@rediffmail.com>
6505 Harilal P R <projectmonokochi@rediffmail.com>
6508 * pending.cs (PendingImplementation.GetAbstractMethods):
6509 Find NonPublic members too.
6511 2005-02-22 Marek Safar <marek.safar@seznam.cz>
6513 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
6516 * class.cs (MethodCore.CheckMethodAgainstBase):
6517 Add error 239 report.
6519 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6521 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6523 * class.cs (Operator.Define): Add error 217 report.
6525 2005-02-21 Raja R Harinath <rharinath@novell.com>
6528 * expression.cs (Invocation.IsApplicable): Make public.
6529 (Invocation.IsParamsMethodApplicable): Likewise.
6530 * delegate.cs (Delegate.VerifyApplicability): Don't use
6531 Invocation.VerifyArgumentCompat for parameter applicability
6532 testing. Use Invocation.IsApplicable and
6533 Invocation.IsParamsMethodApplicable.
6535 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6537 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6539 * class.cs (Operator.Define): Add error 217 report.
6541 2005-02-21 Raja R Harinath <rharinath@novell.com>
6543 * namespace.cs (UsingEntry.Resolve): Undo change below.
6545 2005-02-21 Raja R Harinath <rharinath@novell.com>
6548 * ecore.cs (Expression.MemberLookupFailed): Add argument to
6549 disable the error message when the extended MemberLookup also
6551 (Expression.MemberLookupFinal): Update.
6552 (SimpleName.DoSimpleNameResolve): Update.
6553 * expression.cs (MemberAccess.ResolveNamespaceOrType):
6554 Don't use MemberLookupFinal.
6555 (New.DoResolve): Update.
6556 (BaseAccess.CommonResolve): Update.
6558 2005-02-21 Raja R Harinath <rharinath@novell.com>
6561 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
6562 occured previously, don't resolve again.
6564 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6567 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
6568 argument. Call ResolveAttributeUsage for unresolved.
6569 when types doesn't match ctor arguments.
6571 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
6572 for nested attribute classes.
6573 (Class.attribute_usage): Removed.
6574 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
6575 for attribute class.
6577 * ecore.cs (IsAttribute): Removed.
6579 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
6581 * rootcontext.cs (RegisterAttribute): Removed, attributes are
6583 (attribute_types): Removed.
6584 (EmitCode): Global attributes are emited as the latest.
6586 2005-02-18 Marek Safar <marek.safar@seznam.cz>
6588 * class.cs (EmitFieldInitializers): Don't emit field initializer
6589 for default values when optimilization is on.
6591 * constant.cs (Constant.IsDefaultValue): New property.
6593 * driver.cs: Add /optimize handling.
6597 * literal.cs: Implement new IsDefaultValue property.
6599 * rootcontext.cs (Optimize): New field, holds /optimize option.
6601 2005-02-18 Raja R Harinath <rharinath@novell.com>
6603 Fix crasher in re-opened #72347.
6604 * namespace.cs (Namespace.Lookup): Return null if
6605 DeclSpace.DefineType returns null.
6608 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
6610 2005-02-18 Raja R Harinath <rharinath@novell.com>
6612 Fix remainder of #63202. Change semantics of DoResolveLValue: it
6613 now returns null if it cannot resolve to an lvalue.
6614 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
6615 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
6616 returned null. Remove check for SimpleName.
6617 (EventExpr.DoResolveLValue): New.
6618 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
6619 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
6621 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
6623 (Unary.ResolveOperator): Move CS0211 check ...
6624 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
6626 (Unary.DoResolveLValue): Simplify.
6627 (AddressOf.DoResolveLValue): New.
6628 (ArrayAccess.DoResolveLValue): New.
6630 2005-02-16 Marek Safar <marek.safar@seznam.cz>
6632 * attribute.cs (Attribute.Resolve): Add arguments casting for
6633 when types doesn't match ctor arguments.
6635 2005-02-16 Raja R Harinath <rharinath@novell.com>
6637 Fix parts of #63202.
6638 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
6639 lookup of operator in base type. Ensure that all checks happen
6640 when the operator resolves to an "op_..." method.
6642 2005-02-15 Raja R Harinath <rharinath@novell.com>
6645 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
6646 'ignore_cs0104' parameter. Pass it to ...
6647 (NamespaceEntry.Lookup): ... this.
6648 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
6649 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
6650 (TypeLookupExpression.DoResolveAsTypeStep): Update.
6651 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
6652 Update. Request that cs0104 errors be ignored.
6653 (ComposedCast.ResolveAsTypeStep): Update.
6655 2005-02-14 Raja R Harinath <rharinath@novell.com>
6658 * expression.cs (Invocation.BetterFunction): Remove support for
6659 comparing virtual functions and their overrides.
6660 (Invocation.IsOverride): New.
6661 (Invocation.OverloadResolve): Don't consider 'override' functions
6662 during candidate selection. Store them in a lookaside list.
6663 If the selected method is a 'virtual' function, use the list to
6664 find any overrides that are closer to the LHS type.
6666 2005-02-14 Marek Safar <marek.safar@seznam.cz>
6668 * expression.cs (New.DoResolve): Add complex core type reduction.
6669 (New.Constantify): Converts complex core type syntax like 'new int ()'
6672 2005-02-14 Raja R Harinath <rharinath@novell.com>
6674 * decl.cs (EntryType.EntryType): New constructor to create an
6675 updated copy of a cache entry.
6676 (MemberCache.AddMethods): Use it.
6677 (MemberCache.ClearDeclaredOnly): Remove.
6678 (MemberCache.MemberCache): Update.
6680 2005-02-11 Miguel de Icaza <miguel@novell.com>
6682 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
6683 variable. This one is represents the actual low-level declaration
6684 of the method, as opposed to the semantic level `IsStatic'.
6686 An anonymous method which is hosted into a static method might be
6687 actually an instance method. IsStatic would reflect the
6688 container, while MethodIsStatic represents the actual code
6691 * expression.cs (ParameterReference): Use the new MethodIsStatic
6692 instead of IsStatic.
6694 * anonymous.cs (AnonymousMethod.Compatible): Pass the
6695 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
6696 set on the current EmitContext.
6698 * expression.cs (Cast): Overload DoResolveLValue so we can pass
6699 resolve our casted expression as an LValue. This triggers the
6700 proper LValue processing that is later required by Assign.
6704 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
6706 2005-02-11 Marek Safar <marek.safar@seznam.cz>
6708 C# 2.0 Fixed buffer implementation
6710 * anonymous.cs: Update after RegisterHelperClass renaming.
6712 * attribute.cs (AttributeTester.fixed_buffer_cache):
6713 Cache of external fixed buffers.
6714 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
6715 implementation if field is fixed buffer else null.
6718 (TypeContainer.AddField): Accept FieldMember instead of Field.
6719 (FieldBase.IsFieldClsCompliant): Extracted code from
6720 VerifyClsCompliance descendant customization.
6721 (FixedField): New class handles fixed buffer fields.
6722 (FixedFieldExternal): Keeps information about imported fixed
6724 (IFixedField): Make access to internal or external fixed buffer
6727 * cs-parser.jay: Add fixed buffer parsing.
6729 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
6732 * expression.cs (Indirection): Extended implementation to accept
6734 (PointerArithmetic.Emit): Get element from fixed buffer as well.
6735 (ElementAccess.MakePointerAccess): Get type as parameter.
6736 (DoResolve): Add fixed buffer field expression conversion.
6737 (DoResolveLValue): Ditto.
6738 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
6739 (ArrayPtr): Derives from FixedBufferPtr.
6740 (ArrayPtr.Emit): Add extra emit for array elements.
6742 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
6744 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
6745 for compiler generated types.
6746 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
6748 * statement.cs (Fixed): Refactored to be easier add fixed buffer
6749 and consume less memory.
6750 (Fixed.Resolve): Add fixed buffer case.
6752 * typemanager.cs (compiler_generated_attr_ctor,
6753 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
6754 (HasElementType): Add our own implementation to work on every
6757 2005-02-11 Miguel de Icaza <miguel@novell.com>
6759 * anonymous.cs (CaptureContext): Track whether `this' has been
6762 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
6763 only captured `this' if it was implicitly done (instance
6764 methods/variables were used).
6766 * codegen.cs (EmitContext.CaptureThis): New method to flag that
6767 `this' must be captured.
6769 2005-01-30 Miguel de Icaza <miguel@novell.com>
6771 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
6772 is null it means that there has been no need to capture anything,
6773 so we just create a sibling.
6775 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
6777 Just a partial fix. The other half is fairly elusive.
6779 2005-02-10 Raja R Harinath <rharinath@novell.com>
6781 Fix #52586, cs0121-4.cs.
6782 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
6783 and return a hashtable.
6784 (MemberCache.ClearDeclaredOnly): New.
6785 (MemberCache.MemberCache): Update to change. Make a deep copy of
6786 the method_hash of a base type too.
6787 (MemberCache.AddMethods): Adapt to having a deep copy of the base
6788 type methods. Overwrite entries with the same MethodHandle so
6789 that the ReflectedType is correct. The process leaves in base
6790 virtual functions and their overrides as distinct entries.
6791 (CacheEntry): Now a class instead of a struct. It shouldn't alter
6792 matters since it was boxed in a ArrayList before.
6793 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
6795 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
6796 case of a virtual function and its override (choose the overload
6798 (Invocation.OverloadResolve): Avoid 'override' members during
6799 'applicable_type' calculation.
6801 2005-03-28 Raja R Harinath <rharinath@novell.com>
6803 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
6804 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
6805 GetTypeHandle. It is possible for a reflected type to derive from
6806 a TypeBuilder (e.g., int[] derives from the TypeBuilder
6807 System.Array during mscorlib compilation).
6808 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
6809 contain a method_hash, don't create one either. Don't create a
6810 deep copy of the base cache's method_hash.
6811 (MemberCache.SetupCache): Rename back from DeepCopy.
6812 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
6813 already initialized. If we see an override function, add its
6814 underlying base virtual function to the member_hash too.
6816 2005-02-09 Raja R Harinath <rharinath@novell.com>
6818 Combine two near-redundant caches.
6819 * typemanager.cs (method_params): Rename from method_internal_params.
6820 (TypeManager.GetParameterData): New. Replace
6821 Invocation.GetParameterData.
6822 (TypeManager.LookupParametersByBuilder): Remove.
6823 * expression.cs (Invocation.method_parameter_cache): Remove.
6824 (Invocation.GetParameterData): Remove.
6826 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
6829 2005-02-08 Raja R Harinath <rharinath@novell.com>
6832 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
6833 TypeManager.multicast_delegate_type is null, resolve it by looking
6834 up "System.MulticastDelegate".
6835 * rootcontext.cs (RootContext.ResolveCore): Simplify.
6837 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
6838 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
6839 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
6842 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
6843 (LabeledStatement.AddReference): New. Set 'referenced'.
6844 (Goto.Resolve): Use it.
6846 2005-02-05 John Luke <john.luke@gmail.com>
6848 * driver.cs: remove duplicate -doc line in Usage ()
6850 2005-02-04 Raja R Harinath <rharinath@novell.com>
6852 * location.cs (Location.AddFile): Fix CS2002 error report.
6854 2005-02-02 Martin Baulig <martin@ximian.com>
6856 * delegate.cs (Delegate.DefineType): Report an internal error if
6857 TypeManager.multicast_delegate_type is null. See bug #72015 for
6860 2005-02-02 Raja R Harinath <rharinath@novell.com>
6862 Fix a crasher in a variant of #31984.
6863 * const.cs (Constant.CheckBase): New override that defers the
6864 new-or-override check in case the base type hasn't been populated
6866 (Constant.Define): Ensure the new-or-override check is performed.
6868 2005-02-01 Duncan Mak <duncan@ximian.com>
6870 * const.cs (LookupConstantValue): Check that `ce' is not null
6871 before calling GetValue ().
6873 2005-02-01 Raja R Harinath <rharinath@novell.com>
6875 Fix test-334.cs (#69519).
6876 * cs-parser.jay (using_alias_directive): Pass in an expression to
6877 NamespaceEntry.UsingAlias.
6878 (using_namespace_directive): Pass in an expression to
6879 NamespaceEntry.Using.
6880 (namespace_name): Don't flatten to a string.
6881 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
6882 (NamespaceEntry.AliasEntry.Resolve): Lookup using
6884 (NamespaceEntry.UsingEntry): Likewise.
6885 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
6887 (NamespaceEntry.LookupForUsing): Remove.
6888 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
6890 (NamespaceEntry.Lookup): Remove support for dotted names.
6892 2005-02-01 Raja R Harinath <rharinath@novell.com>
6894 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
6896 (NamespaceEntry.ImplicitParent): Compute on demand.
6897 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
6898 parallels the current.
6899 (NamespaceEntry.LookupForUsing): Use it.
6900 (NamespaceEntry.Lookup): If the current namespace-entry is
6901 implicit, don't search aliases and using tables.
6903 2005-02-01 Raja R Harinath <rharinath@novell.com>
6906 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
6908 (TypeContainer.BaseCache): Compute on demand.
6909 (TypeContainer.FindMembers): Define constants and types if they're
6910 not already created.
6911 (FieldMember.Define): Move resetting of ec.InUnsafe before error
6913 * const.cs (Constant.Define): Make idempotent.
6915 2005-01-29 Miguel de Icaza <miguel@novell.com>
6917 * pending.cs: Produce better code (no nops produced by using Ldarg
6920 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6921 i - 1' it should be arg + 1.
6925 2005-01-28 Raja R Harinath <rharinath@novell.com>
6927 * attribute.cs (Attribute.CheckAttributeType): Make private
6929 (Attribute.ResolveType): Make virtual.
6930 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
6931 handling of RootContext.Tree.Types.
6933 2005-01-27 Raja R Harinath <rharinath@novell.com>
6935 Update attribute-handling to use the SimpleName/MemberAccess
6937 * cs-parser.jay (attribute): Pass in an expression to the
6938 constructors of Attribute and GlobalAttribute.
6939 * attribute.cs (Attribute): Take an expression for the name.
6940 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
6941 passed in attribute name expression.
6942 (Attribute.CheckAttributeType): Use it.
6943 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
6944 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
6945 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
6946 argument to prevent error messages if the lookup fails.
6948 2005-01-27 Marek Safar <marek.safar@seznam.cz>
6950 * expression.cs (Indirection): Implemented IVariable interface
6951 to support indirection in AddressOf operator.
6952 (PointerArithmetic.Emit): Add optimalization for case where
6953 result can be precomputed.
6955 2005-01-26 Martin Baulig <martin@ximian.com>
6957 * class.cs (TypeContainer.AttributeTargets): Return the correct
6958 AttributeTargets depending on our `Kind' instead of throwing an
6959 exception; fixes #71632.
6961 2005-01-26 Marek Safar <marek.safar@seznam.cz>
6964 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
6967 2005-03-17 Martin Baulig <martin@ximian.com>
6969 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6970 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
6972 2005-03-17 Martin Baulig <martin@ximian.com>
6974 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6975 to bool so we can return an error condition.
6976 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6979 2005-03-17 Martin Baulig <martin@ximian.com>
6981 * generic.cs (TypeMananager.IsIEnumerable): New public method.
6983 * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
6984 converting from an array-type of T to `IEnumerable<T>'.
6986 2005-03-16 Martin Baulig <martin@ximian.com>
6988 * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
6989 (Nullable.LiftedUnaryMutator): New public class.
6991 * expression.cs (UnaryMutator.DoResolve): Added support for
6994 2005-03-14 Martin Baulig <martin@ximian.com>
6996 * generic.cs (Nullable.NullCoalescingOperator): Implemented.
6998 2005-03-14 Martin Baulig <martin@ximian.com>
7000 * generic.cs (Nullable.LiftedBinaryOperator): Added support for
7001 the comparision operators `<', `>', `<=' and `>='.
7003 2005-03-13 Martin Baulig <martin@ximian.com>
7006 (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
7007 avoid confusion with the `NullLiteral'.
7008 (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
7010 2005-03-13 Martin Baulig <martin@ximian.com>
7012 * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
7013 comparing arbitrary types with the null literal.
7015 2005-03-13 Martin Baulig <martin@ximian.com>
7017 * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
7018 boolean operators '&&', '||', '&' and '|'.
7019 (Nullable.OperatorTrueOrFalse): New public class.
7021 * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
7022 instead of a `StaticCallExpr'; added support for nullables.
7024 2005-03-10 Martin Baulig <martin@ximian.com>
7027 (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
7028 rather than `etype.IsSubclassOf (TypeManager.value_type)'.
7030 2005-03-07 Martin Baulig <martin@ximian.com>
7032 * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
7033 it work if `expr' is not an IMemoryLocation.
7034 (Nullable.Lifted): Implement IMemoryLocation.
7035 (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
7038 2005-03-05 Martin Baulig <martin@ximian.com>
7040 * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
7041 (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
7042 (Nullable): Added support for lifted unary and binary operators.
7044 * expression.cs (Unary.DoResolve): Added support for nullable types.
7045 (Binary.DoResolve): Likewise.
7046 (Conditional.DoResolve): Likewise.
7048 2005-03-02 Martin Baulig <martin@ximian.com>
7050 * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
7052 * class.cs (ClassPart.SetParameterInfo): Override this.
7053 (PartialContainer.SetParameterInfo): Override this.
7054 (TypeContainer.CheckConstraints): New protected method.
7055 (PartialContainer.CheckConstraints): Override this and check
7056 whether the same contraints were specified in all parts of a
7057 partial generic type definition.
7058 (PartialContainer.UpdateConstraints): New public method.
7060 * generic.cs (TypeParameter.UpdateConstraints): New public method.
7062 2005-03-02 Martin Baulig <martin@ximian.com>
7064 Committing a patch from Carlos Alberto Cortez to fix #72887.
7066 * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
7067 casts from `T []' to `int []'.
7069 2005-03-02 Martin Baulig <martin@ximian.com>
7071 * generic.cs (TypeManager.IsEqual): Make this symmetric.
7073 * expression.cs (Binary.ResolveOperator): When resolving a
7074 BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
7075 `=='. Fixes #71866. See gen-127.cs.
7077 2005-03-02 Martin Baulig <martin@ximian.com>
7079 * class.cs (TypeContainer.DoDefineMembers): We also need a default
7080 static constructor in static classes.
7082 2005-03-02 Martin Baulig <martin@ximian.com>
7085 (NullableType.Name, NullableType.FullName): Add a "?" to the name.
7086 (Nullable.LiftedConversion): Added support for user-defined
7089 * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
7091 * cs-parser.jay: Use ComposedCast everywhere instead of
7092 NullableType, so we don't need to check for NullableType
7094 (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
7095 case where we'll be resolved into a `parenthesized_expression_0'
7099 (Convert.UserDefinedConversion): Added nullable conversions.
7101 2005-02-28 Martin Baulig <martin@ximian.com>
7103 * generic.cs (TypeManager.IsNullableType): New static method.
7104 (Nullable): New abstract class.
7105 (Nullable.NullLiteral): New public class.
7106 (Nullable.LiftedConversion): New public class.
7108 * cs-parser.jay (non_expression_type): Changed `builtin_types' to
7109 `builtin_types opt_nullable'.
7112 (Convert.ImplicitConversionStandard): Added nullable conversions.
7113 (Convert.ExplicitConversionStandard): Likewise.
7114 (Convert.ExplicitConversion): Likewise.
7116 2005-02-26 Martin Baulig <martin@ximian.com>
7118 * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
7119 begin with a "?", for instance "?[]". Don't do a type lookup if
7122 2005-02-25 Martin Baulig <martin@ximian.com>
7124 The first part of Nullable Types :-)
7126 * generic.cs (NullableType): New public class.
7127 (NullCoalescingOperator): New public class.
7128 (TypeArguments.Resolve): Add a CS0306 check.
7130 * cs-parser.jay (opt_error_modifier): Removed, this was unused.
7131 (opt_nullable): New rule.
7132 (type): Added `opt_nullable' to `namespace_or_type_name',
7133 `builtin_types' and `pointer_type'.
7134 (array_type): Added `opt_nullable'.
7135 (opt_rank_specifier_or_nullable): New rule; this is the
7136 combination of `opt_rank_specifier' and `opt_nullable'.
7137 (opt_error): New rule; catch errors here.
7138 (nullable_type_or_conditional): New rule; we use this to check for
7139 nullable and still detect the conditional operator.
7140 (local_variable_type): Use `opt_rank_specifier_or_nullable'
7141 instead `opt_rank_specifier'.
7143 * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
7146 2005-02-24 Martin Baulig <martin@ximian.com>
7148 * README, README.Changes: Removed; they're old and obsolete.
7150 2005-02-22 Martin Baulig <martin@ximian.com>
7152 * generic.cs (TypeParameter.Resolve): If resolving the constraints
7153 returned an error, set `constraints' to null to avoid a crash
7155 (TypeParameter.ResolveType): Likewise.
7157 2005-02-22 Martin Baulig <martin@ximian.com>
7160 (Constraints.ResolveTypes): Protect against being called twice.
7161 (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
7162 (TypeParameter.ResolveType): New public method; calls
7163 constraints.ResolveTypes().
7164 (TypeParameter.DefineType): Moved constraints.ResolveType() out
7165 into the new ResolveType().
7166 (GenericMethod.Define): Call ResolveType() on all our
7169 2005-02-21 Martin Baulig <martin@ximian.com>
7172 (TypeManager.generic_nullable_type): New static public field.
7173 (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
7176 (RootContext.ResolveCore): Resolve "System.Nullable`1".
7178 2005-02-15 Martin Baulig <martin@ximian.com>
7180 * generic.cs (ConstructedType.Constraints): Correctly check
7181 constraints if the argument type is a type parameter; fixes
7184 2005-02-02 Martin Baulig <martin@ximian.com>
7186 * delegate.cs (Delegate.DefineType): Report an internal error if
7187 TypeManager.multicast_delegate_type is null. See bug #72015 for
7190 2005-01-29 Miguel de Icaza <miguel@novell.com>
7192 * pending.cs: Produce better code (no nops produced by using Ldarg
7195 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
7196 i - 1' it should be arg + 1.
7200 2005-01-26 Martin Baulig <martin@ximian.com>
7202 * cs-parser.jay (indexer_declarator): Don't report an error if we
7203 have type parameters since we can be an explicit interface
7204 implementation; fixes #71449.
7206 2005-01-26 Martin Baulig <martin@ximian.com>
7208 * class.cs (TypeContainer.AttributeTargets): Return the correct
7209 AttributeTargets depending on our `Kind' instead of throwing an
7210 exception; fixes #71632.
7212 2005-01-26 Martin Baulig <martin@ximian.com>
7214 * delegate.cs (Delegate.DefineType): Correctly define our type
7215 parameters. Fixes #71483.
7217 2005-01-25 Raja R Harinath <rharinath@novell.com>
7220 * expression.cs (MemberAccess.DoResolve): Don't complain with
7221 cs0572 when the LHS of a member access has identical name and type
7224 2005-01-25 Marek Safar <marek.safar@seznam.cz>
7227 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
7229 Create custom PermissionSet only for PermissionSetAttribute.
7231 2005-01-24 Marek Safar <marek.safar@seznam.cz>
7234 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
7235 delegates in static class.
7237 2005-01-24 Martin Baulig <martin@ximian.com>
7239 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7240 merging an implicit block, just use its reachability.
7242 * statement.cs (Block.Resolve): Make the unreachable code check
7243 work wrt. implicit blocks; see test-337 from #63842.
7245 2005-01-21 Alp Toker <alp@atoker.com>
7247 * cs-parser.jay: destructor_declaration's container is PartialContainer
7248 not Class when partial types are used, so use Kind prop instead of
7251 2005-01-22 Miguel de Icaza <miguel@ximian.com>
7253 * cs-parser.jay: Improve error reporting when an interface
7256 2005-01-20 Dick Porter <dick@ximian.com>
7258 * support.cs: SeekableStreamReader fix from Sandor Dobos
7259 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
7260 chars are read. Fixes bug 70369.
7262 2005-01-20 Raja R Harinath <rharinath@novell.com>
7264 * cs-parser.jay (catch_clause): Simplify current_block handling
7267 2005-01-17 Miguel de Icaza <miguel@ximian.com>
7269 * convert.cs (ImplicitStandardConversionExists): Synchronize the
7270 code with ImplicitStandardConversion to handle the implicit
7271 conversion of method groups into valid delegate invocations.
7273 The problem is that in parameter handling we were using this code
7274 path. Fixes bug #64698
7276 2005-01-19 Raja R Harinath <rharinath@novell.com>
7278 * cs-parser.jay: Fix several infelicities.
7279 - Avoid assigning to the parser value stack. Code like
7280 '$3 = null' is unclean. Synthesize a value for the code block
7282 - Avoid using oob_stack for storing location information. Use ...
7283 (_mark_): ... this. New (empty) rule. Saves the current location
7285 (foreach_statement): Avoid using oob_stack for current_block
7286 handling. Use technique used in for_statement and
7287 using_statement. Synthesize a value for the code block to store
7288 additional intermediate information.
7290 2005-01-13 Miguel de Icaza <miguel@ximian.com>
7292 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
7293 of a different type is only allowed to private fields of a
7294 containing type, not on fields of a base class.
7296 See test-174.cs and error cs0122-9.cs
7298 2005-01-13 Raja R Harinath <rharinath@novell.com>
7300 Fix test-335.cs (bug #58126).
7301 * cs-parser.jay (argument): Split out non-expression parts of the
7302 rule into 'non_simple_argument'.
7303 (invocation_expression): Support parenthesized invocations with
7304 multiple arguments, and with single non-simple arguments.
7306 2005-01-13 Raja R Harinath <rharinath@novell.com>
7308 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
7311 2005-01-12 Raja R Harinath <rharinath@novell.com>
7313 Fix cs0038-1.cs, cs1640-6.cs.
7314 * ecore.cs (Expression.Resolve): Remove special-case for
7315 SimpleName in error-handling.
7316 (Expression.almostMatchedMembers): Relax access permission to
7318 (Expression.MemberLookupFailed): Handle duplicates in
7319 almostMatchedMembers list.
7320 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
7321 * expression.cs (New.DoResolve): Report CS1540 for more cases.
7322 * typemanager.cs (GetFullNameSignature): Use the MethodBase
7323 overload if the passed in MemberInfo is a MethodBase.
7325 2005-01-25 Martin Baulig <martin@ximian.com>
7328 (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
7330 2005-01-12 Marek Safar <marek.safar@seznam.cz>
7333 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
7334 for non-CAS & merge permission sets properly.
7336 2005-01-11 Raja R Harinath <rharinath@novell.com>
7338 Improve standard-compliance of simple name and member access
7339 resolution. Fixes bugs #52697, #57200, #67520, #69519.
7340 * ecore.cs (FullNamedExpression): New abstract base class
7341 for Namespaces and TypeExpressions.
7342 (ResolveFlags.SimpleName): Remove.
7343 (SimpleName): Remove support for dotted names.
7344 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
7345 DeclSpace.FindType and DeclSpace.LookupType.
7346 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
7347 (Expression.ExprClassName): Make member function.
7348 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
7349 a namespace. Remove creation of dotted "SimpleName"s.
7350 (MemberAccess.DoResolve): Likewise.
7351 * decl.cs (DeclSpace.Cache): Make private.
7352 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
7353 (DeclSpace.FindType): Update.
7354 (DeclSpace.LookupType): Move here from RootContext. Return a
7355 FullNamedExpression.
7356 * namespace.cs (Namespace): Derive from FullNamedExpression
7357 so that it can be part of expression resolution.
7358 (Namespace.Lookup): Return an FullNamedExpression.
7359 (NamespaceEntry.LookupAlias): Lookup aliases only in current
7361 * rootcontext.cs (NamespaceLookup): Remove.
7362 (LookupType): Move to DeclSpace.
7363 * attribute.cs (CheckAttributeType): Update.
7364 * doc.cs (FindDocumentedType): Remove allowAlias argument.
7365 (FindDocumentedTypeNonArray): Likewise.
7367 2005-01-11 Raja R Harinath <rharinath@novell.com>
7369 Fix cs0509.cs, cs1632.cs.
7370 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
7371 is the same as IsInterface.
7372 (TypeContainer.GetClassBases): Likewise.
7373 * statement.cs (LabeledStatement.ig): New field.
7374 (LabeledStatement.LabelTarget): Save ILGenerator which created the
7376 (LabeledStatement.DoEmit): Check that the label was created with
7377 the same ILGenerator.
7379 2005-01-10 Marek Safar <marek.safar@seznam.cz>
7382 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
7383 accessors to its properties.
7385 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
7386 from accessors to property.
7388 2005-01-10 Marek Safar <marek.safar@seznam.cz>
7391 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
7394 2005-01-08 Miguel de Icaza <miguel@ximian.com>
7396 * attribute.cs: Check for null and empty strings.
7398 I have lost another battle to Paolo.
7400 2005-01-07 Marek Safar <marek.safar@seznam.cz>
7403 * class.cs (PropertyMethod): Set Parent field in ctors.
7404 (SetMethod.InternalParameters): Add unsafe switch hack.
7405 Override MarkForDuplicationCheck where it is appropriate.
7407 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
7408 It says whether container allows members with the same name.
7410 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
7411 Removed is_method parameter.
7413 2005-01-06 Duncan Mak <duncan@ximian.com>
7415 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
7416 because the previous change led to incorrect reporting of CS1032
7417 ("Cannot define/undefine preprocessor symbols after first token in
7418 file"). Instead of using `tokens_seen' as the only flag that
7419 triggers CS1040, introduce `comments_seen'. This new flag is used
7420 to signify having seen comments on the current line, so it is
7421 unset after a newline.
7423 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
7425 * doc.cs : When searching for a type, find nested type too.
7426 This fixes bug #71040.
7428 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
7431 - Warn missing member comment on those classes which also does not
7432 have doc comments. Fixed bug #71041.
7433 - Don't warn missing doc comment on default constructor.
7436 2005-01-06 Duncan Mak <duncan@ximian.com>
7438 * cs-tokenizer.cs (xtoken): After handling traditional C-style
7439 comments, set `tokens_seen' to true. This allows us to detect
7440 misplaced preprocessor directives (i.e. not at the beginning of
7441 the a line, nor after whitespaces). In that case, report error
7442 CS1040. This fixes bug #56460.
7444 * cs-parser.jay (interface_member_declaration): Add checks for
7445 IsExplicitImpl, and report CS0541 error if an interface member is
7446 defined as an explicit interface declaration.
7448 2005-01-06 Marek Safar <marek.safar@seznam.cz>
7451 * class.cs (PropertyMethod): Set Parent field in ctors.
7452 (SetMethod.InternalParameters): Add unsafe switch hack.
7454 * decl.cs (MemberCore.Parent): Cannot be readonly.
7456 2005-01-06 Raja R Harinath <rharinath@novell.com>
7458 * decl.cs (DeclSpace.ResolveType): Remove.
7459 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
7460 Merge in code from ...
7461 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
7462 * class.cs, enum.cs: Update to changes.
7464 2005-01-06 Miguel de Icaza <miguel@ximian.com>
7466 * anonymous.cs: Ensure that we init the scope of our parent if it
7467 has not been initialized yet.
7469 2004-12-30 Duncan Mak <duncan@ximian.com>
7471 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
7472 if field.FieldBuilder is null. Fixes #70758.
7474 * convert.cs: Fixed some typos and updated some of the comments.
7475 (ImplicitStandardConversionExists):
7476 (TryImplicitIntConversion): If `target_type' is an interface and
7477 the type of `ic' implements this interface, return true or a new
7478 BoxedCast instead of null. This fixes #70468.
7480 2004-12-29 Duncan Mak <duncan@ximian.com>
7482 * expression.cs (Argument.Emit): Check that Expr is
7483 IMemoryLocation before casting to it, and report CS1510 otherwise.
7487 2004-12-21 Ben Maurer <bmaurer@ximian.com>
7489 * statement.cs (Block.ThisVariable): remove the recursion here, to
7490 make the --profile more sane.
7492 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
7494 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
7495 assembly, by JB Evain.
7497 2004-12-17 Raja R Harinath <rharinath@novell.com>
7499 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
7500 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
7501 "parent" refers to enclosing type/class. "base" refers to superclass.
7503 2004-12-17 Raja R Harinath <rharinath@novell.com>
7505 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7506 Ensure that we only have GlobalAttributes.
7507 * attribute.cs (Attribute.Emit): Make non-virtual.
7508 (GlobalAttribute.Emit): Remove.
7509 (Attribute.Resolve): Make virtual.
7510 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
7511 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
7512 the argument. Don't create one.
7513 (Attribute.GetObsoleteAttribute): Likewise.
7514 (Attribute.GetClsCompliantAttributeValue): Likewise.
7515 * class.cs, decl.cs: Update to changes.
7517 2004-12-17 Marek Safar <marek.safar@seznam.cz>
7519 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
7521 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
7523 * statement.cs (Foreach.Resolve): Add error 186 report.
7525 2004-12-16 Marek Safar <marek.safar@seznam.cz>
7527 * expression.cs (Conditional.DoResolve): Add warning 429.
7529 * statement.cs (If.Resolve): Add warning 665.
7531 2004-12-16 Raja R Harinath <rharinath@novell.com>
7533 New invariant: RootContext.Tree.Types.NamespaceEntry == null
7534 except when in the parser, and in GlobalAttribute.
7535 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
7536 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
7537 RootContext.Tree.Types.NamespaceEntry once work is done.
7538 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
7539 and resets RootContext.Tree.Types.NamespaceEntry.
7541 2004-12-15 Marek Safar <marek.safar@seznam.cz>
7543 * cs-parser.jay: Don't create a block for every variable.
7545 2004-12-14 Miguel de Icaza <miguel@ximian.com>
7547 * location.cs: Provide extra information.
7549 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
7550 variables from the captured environment, it is the ldarg_0.
7552 2004-12-14 Marek Safar <marek.safar@seznam.cz>
7554 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
7557 * class.cs: Changed warning level for 169 to avoid developer
7558 displeasure from warning flooding. It will be changed back when they
7559 fix most of current BCL warnings.
7561 * RootContext.cs: Pushed default WarningLevel to 3.
7563 * statement.cs: Removed unused variable.
7565 2004-12-14 Marek Safar <marek.safar@seznam.cz>
7567 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
7568 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
7569 Add error 502 report.
7570 (StaticClass.DefineType): Add error 441 report.
7571 (Class.AllowedModifiersProp): New virtual property as temporary
7572 extension to AllowedModifiers.
7573 (Class.DefineType): Add error 418 report. Moved ModFlags check here
7574 to share implementation with StaticClass and don't call virtual
7577 * driver.cs (MainDriver): Add error 1558 test.
7579 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
7580 report. Moved error 36 test here.
7582 * statement.cs (Throw.Resolve): Add error 724 report.
7584 * typemanager.cs: Add out_attribute_type core type.
7586 2004-12-13 Marek Safar <marek.safar@seznam.cz>
7588 * class.cs (TypeContainer.VerifyClsCompliance): Add error
7590 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
7592 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
7595 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
7597 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
7598 Add error 3023 report.
7599 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
7601 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
7604 2004-12-12 John Luke <john.luke@gmail.com>
7606 * driver.cs (AddArgs): take -- into account when
7607 adding arguments, fixes bug 65710
7609 2004-12-12 Martin Baulig <martin@ximian.com>
7611 * expression.cs (Unary.TryReduceNegative): Added support for
7612 SByteConstant and ByteConstant.
7613 (Unary.Reduce): Check error values from TryReduceNegative().
7615 2004-12-10 Marek Safar <marek.safar@seznam.cz>
7617 * attributes.cs (Attribute.Resolve): Avoid multiple error report
7618 and report exception as error 182.
7620 2004-12-10 Raja R Harinath <rharinath@novell.com>
7622 * driver.cs (Main): Fix message when there are warnings.
7624 2004-12-09 Miguel de Icaza <miguel@ximian.com>
7626 * delegate.cs: Fixed my fix from yesterday, sorry about that.
7628 2004-12-09 Marek Safar <marek.safar@seznam.cz>
7630 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
7631 Reduced number of warnings.
7633 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
7635 2004-12-08 Miguel de Icaza <miguel@ximian.com>
7637 * driver.cs: Removed message.
7639 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
7641 2004-12-08 <vargaz@freemail.hu>
7643 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
7645 2004-12-08 Martin Baulig <martin@ximian.com>
7647 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7648 instead of a CS3002 for properties and indexer.
7650 2004-12-08 Martin Baulig <martin@ximian.com>
7652 * decl.cs (MemberName.ToString): Make this work again.
7654 2004-12-08 Marek Safar <marek.safar@seznam.cz>
7656 * attribute.cs (Resolve): Add error 591 detection.
7658 * class.cs (FieldMember.Define): Add error 1547 detection.
7659 (Indexer.Define): Add error 620 detection.
7660 (Operator.Define): Add error 590 detection.
7662 * ecore.cs: Missing argument for error 79.
7664 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
7667 2004-12-07 Marek Safar <marek.safar@seznam.cz>
7670 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
7673 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
7675 * cs-parser.jay : handle doc comments on implicit/explicit operators.
7676 Some operator comments were suppressed.
7677 * doc.cs : Implicit/explicit operator name in doc comments are like
7678 "op_Explicit(type)~returnType", so added suffix handling.
7680 2005-01-21 Alp Toker <alp@atoker.com>
7682 * cs-parser.jay: destructor_declaration's container is PartialContainer
7683 not Class when partial types are used, so use Kind prop instead of 'is'.
7685 2004-12-12 Martin Baulig <martin@ximian.com>
7687 * expression.cs (Unary.TryReduceNegative): Added support for
7688 SByteConstant and ByteConstant.
7689 (Unary.Reduce): Check error values from TryReduceNegative().
7691 2004-12-11 Martin Baulig <martin@ximian.com>
7693 * support.cs (ReflectionParameters.ParameterName): If we have a
7694 `gpd', call `ParameterName' on it.
7696 * parameter.cs (Parameter.GetParameterAttributes): New static method.
7698 * pending.cs (PendingImplementation.DefineProxy): Call
7699 DefineParameter() for all of the MethodBuilder's arguments.
7701 2004-12-09 Martin Baulig <martin@ximian.com>
7703 * doc.cs (DocUtil): Make this a static class.
7705 2004-12-09 Martin Baulig <martin@ximian.com>
7707 * expression.cs (Invocation.InferType): Moved the type inference
7708 implementation into TypeManager.
7710 * generics.cs (TypeManager): Moved the type inference
7711 implementation here.
7713 2004-12-09 Martin Baulig <martin@ximian.com>
7715 * typemanager.cs (TypeManager): Make this a partial class.
7718 (TypeManager): Move the generics part of `TypeManager' here.
7720 2004-12-08 Martin Baulig <martin@ximian.com>
7722 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7723 instead of a CS3002 for properties and indexer. Added CS3024
7724 check for generic interfaces.
7726 * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
7727 instances are not CLS-compliant.
7729 2004-12-08 Martin Baulig <martin@ximian.com>
7732 (void_pointer_expression): New rule for `void*', `void**' etc.
7733 (typeof_expression): Add `void_pointer_expression'; fixes #66846.
7735 2004-12-08 Martin Baulig <martin@ximian.com>
7737 * expression.cs (Invocation.InferType): Removed the hack for
7738 MethodCore.MayUnify().
7740 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
7743 * class.cs (MethodCore.MayUnify): Use
7744 TypeManager.MayBecomeEqualGenericTypes().
7746 2004-12-08 Martin Baulig <martin@ximian.com>
7748 * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
7749 parameter, box it. Fixes #69233.
7751 2004-12-08 Martin Baulig <martin@ximian.com>
7753 * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
7754 have the ctor constraint. Fixes #68326.
7756 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
7758 * cs-parser.jay : interface comment was not consumed because of
7759 extra opt_semicolon before doc handling.
7761 2004-12-03 Raja R Harinath <rharinath@novell.com>
7763 Fix test-327.cs, test-328.cs, and put in early infrastructure
7764 for eventually fixing #52697.
7765 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
7766 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
7768 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
7769 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
7770 (VerifyUsing, error246): Update.
7771 * rootcontext.cs (RootContext.NamespaceLookup): Just use
7772 'NamespaceEntry.LookupNamespaceOrType'.
7774 2004-12-07 Martin Baulig <martin@ximian.com>
7776 * driver.cs: Call it "BETA SOFTWARE" :-)
7778 2004-12-06 Raja R Harinath <rharinath@novell.com>
7780 Fix crash on cs0657-17.cs.
7781 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7782 Use RootContext.Tree.Types, not 'new RootTypes ()'.
7783 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
7784 the case where the NamespaceEntry gets overwritten.
7786 2004-12-06 Marek Safar <marek.safar@seznam.cz>
7788 Fixed #69195, #56821
7789 * ecore.cs (ResolveBoolean): Tiny refactoring.
7791 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
7792 of right expression resolving when left is false constant and
7793 operator is LogicalAnd OR true constant and operator is LogicalOr.
7795 * statement.cs (ResolveUnreachable): Always reports warning.
7797 2004-12-05 Miguel de Icaza <miguel@ximian.com>
7799 * class.cs: Distinguish between 1721 and 1722 (just a little help
7800 for the programmer).
7802 2004-12-03 Miguel de Icaza <miguel@ximian.com>
7804 * delegate.cs: Only allow this on new versions of the language.
7806 2004-12-02 Duncan Mak <duncan@ximian.com>
7808 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
7810 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
7811 here as a static method. Take an additional bool out parameter
7812 `must_do_cs1540_check' for signaling to InstanceResolve.
7813 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
7814 member field from PropertyExpr class and made it an argument of
7816 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
7817 check for MarshalByRefObject, and report CS0122 instead of CS1540.
7818 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
7819 and `remove_accessor' as well as InstanceResolve: report CS0122
7824 2004-12-07 Martin Baulig <martin@ximian.com>
7826 * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
7827 and CS0692 where appropriate.
7829 2004-12-06 Martin Baulig <martin@ximian.com>
7831 * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
7832 IsDuplicateImplementation() and improved it.
7834 * expression.cs (Invocation.InferTypeArguments): Added
7835 `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
7836 and removed the "ref" modifier from `infered_types'.
7838 * decl.cs (MemberName.ToString): Removed the exception.
7840 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
7842 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
7843 comments are allowed.
7845 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7847 * delegate.cs: Add checks for subtypes in paramaters and return values
7848 in VerifyMethod () to add support for Covariance/Contravariance
7851 2004-12-02 Miguel de Icaza <miguel@ximian.com>
7853 * report.cs: Remove extra closing parenthesis.
7855 * convert.cs (Error_CannotImplicitConversion): If the name of the
7856 types are the same, provide some extra information.
7858 2004-12-02 Marek Safar <marek.safar@seznam.cz>
7861 * attribute.cs (Resolve): Improved implementation of params
7862 attribute arguments.
7864 * support.cs (ParameterData): Add HasParams to be faster.
7866 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
7868 all things are for /doc support:
7870 * doc.cs: new file that supports XML documentation generation.
7871 * mcs.exe.sources: added doc.cs.
7873 Handle /doc command line option.
7874 Report error 2006 instead of 5 for missing file name for /doc.
7875 Generate XML documentation when required, after type resolution.
7877 Added support for picking up documentation (/// and /** ... */),
7878 including a new XmlCommentState enumeration.
7880 Added lines to fill Documentation element for field, constant,
7881 property, indexer, method, constructor, destructor, operator, event
7882 and class, struct, interface, delegate, enum.
7883 Added lines to warn incorrect comment.
7885 Added Documentation field (passed only when /doc was specified).
7887 Added DocComment, DocCommentHeader, GenerateDocComment() and
7888 OnGenerateDocComment() and some supporting private members for
7889 /doc feature to MemberCore.
7891 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
7893 Added overriden DocCommentHeader.
7895 Added overriden DocCommentHeader and GenerateDocComment().
7897 2004-12-01 Miguel de Icaza <miguel@ximian.com>
7899 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
7900 unwrapping the enumeration values, chain to
7901 DoConstantNumericPromotions again, so we can promote things to the
7902 fundamental types (takes care of enums that are bytes, sbytes).
7906 2004-12-01 Raja R Harinath <rharinath@novell.com>
7908 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
7909 Fix long-standing bug in type-lookup. Use FindType instead of
7910 LookupType when ec.ResolvingTypeTree.
7911 (Attribute.ResolveType, Attribute.Resolve)
7912 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
7914 (Attributes.Search): Remove internal version. Update.
7915 (Attributes.SearchMulti): Update.
7916 (Attributes.GetClsCompliantAttribute): Remove.
7917 (Attributes.GetIndexerNameAttribute): Remove.
7918 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
7919 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
7920 * class.cs (Indexer.Define): Likewise.
7922 2004-12-01 Marek Safar <marek.safar@seznam.cz>
7925 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
7926 MarshallByReference members access.
7928 * expression.cs: Use CheckMarshallByRefAccess;
7929 Better error CS0197 message.
7931 * report.cs: Print whole related error message.
7933 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7935 * class (GetClassBases): Better error 60 report.
7936 (EventProperty): Disabled warning 67 detection.
7938 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7941 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
7943 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
7946 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7949 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
7951 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
7953 2004-11-26 Miguel de Icaza <miguel@ximian.com>
7955 * attribute.cs (Attribute.Resolve): Refine error reporting and
7956 report a cs0117 if the identifier does not exist, to distinguish
7957 from 0617 which is a miss-use of the actual identifier.
7959 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
7960 between cs0070 and cs0079.
7962 * class.cs (MemberBase.DoDefine): When reporting a wrong
7963 accessibility level, we use MethodCore to compare instead of
7964 Method (this was a regression in some refactoring effort).
7966 So now we correctly report cs0056 again.
7968 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
7969 testing the target_type (which was known to be object_type) and
7970 not the source type (which is anonymous_method).
7972 Fixed reporting of error cs1660.
7974 * expression.cs (UserCast.Source): Expose the underlying cast.
7976 * statement.cs (Switch.SwitchGoverningType): Sort the list of
7977 allowed types to find a match to int32 first (most common).
7979 In addition, it ignores any ImplicitUserConversions that did an
7980 internal implicit conversion (as the switch statement allows only
7981 one integral conversion to exist).
7983 * class.cs (PartialContainer.Create): rename `name' to
7984 `member_name' for clarity. Then replace the string calls with a
7985 call to MemberName.GetPartialName, as now using
7986 MemberName.ToString is an error (this is due to the side effects
7987 it had, that were fixed in the past).
7989 This will restore the error reporting on a number of partial class
7990 errors that were missusing this (and getting an exception as a
7991 results, which is now just a plain textual warning, because
7992 yyparse debug output would crash otherwise).
7994 2004-11-26 Raja R Harinath <rharinath@novell.com>
7996 * Makefile (PROGRAM_INSTALL_DIR): Remove.
7998 2004-11-25 Ben Maurer <bmaurer@ximian.com>
8000 * rootcontext.cs (LookupType): Make sure to cache lookups that
8001 don't give us a negative result. This saves about 5% of corlib
8004 2004-11-25 Miguel de Icaza <miguel@ximian.com>
8006 * report.cs (AbstractMessage.Print): messages are sent to stderr
8008 * class.cs (TypeContainer.GetClassBases): It is an error to have a
8009 non-interface in the list of interfaces (at this point, either
8010 parent was properly set, or a base class is being listed in the
8011 interfaces section).
8013 This flags error 1722, and resolves the crash from bug 69259.
8015 2004-11-25 Ben Maurer <bmaurer@ximian.com>
8017 * statement.cs (Using.EmitExpressionFinally): make this work right
8018 for valuetypes. Fixes 69926.
8020 2004-11-25 Miguel de Icaza <miguel@ximian.com>
8022 * const.cs (Const.ChangeType): Cope with the "0 literal can be
8023 converted to an enum" here, before we try to change the underlying
8024 type. This code exists, but it is a different code path than the
8025 one used while encoding constants.
8027 (ImplicitReferenceConversionExists): In addition, resynchronized
8028 the code here, so it matches the same code in
8029 ImplicitReferenceConversionExists for the `from any class-type S
8030 to any interface-type T'.
8032 2004-11-25 Marek Safar <marek.safar@seznam.cz>
8034 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
8036 2004-11-24 Miguel de Icaza <miguel@ximian.com>
8038 * cs-parser.jay: Use verbosity accordingly.
8040 2004-11-24 Marek Safar <marek.safar@seznam.cz>
8042 * expression.cs (Unary.ResolveOperator): Do not report warning;
8043 AddressOf reads from variable.
8045 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
8047 2004-11-24 Marek Safar <marek.safar@seznam.cz>
8051 * attribute.cs (Attributable): Removed CheckTargets.
8052 (Attributes.Emit): Explicit attribute targets are tested here.
8054 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
8055 not enabled for interfaces.
8057 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
8058 (GetAssemblyName): Ouch next bug there.
8060 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
8062 * expression.cs: Error 275 added.
8064 2004-11-23 Marek Safar <marek.safar@seznam.cz>
8066 Fix bug #69177 (Implemented decimal constant support)
8068 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
8069 (BinaryFold): Add DecimalConstant.
8071 * const.cs (Define): Decimal constant
8073 (ChangeType): Add decimal type handling.
8074 (LookupConstantValue): Don't set value for decimal type but
8075 emit DecimalConstantAttribute. Needed for constant optimization.
8077 * constant.cs (ToDecimal): New method.
8078 (ConvertToDecimal): New method.
8079 (IntConstant): Implemented ConvertToDecimal.
8080 (DecimalConstant.Emit): Emit optimized version for decimals in
8083 * expression.cs (ResolveOperator): Changed order of constant
8084 reduction to work correctly with native types which have
8085 overloaded operators.
8086 (ResolveMemberAccess): Extract constant value from attribute
8089 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
8091 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
8092 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
8093 (ChangeType): Decimal is special.
8094 (TypeToCoreType): Add decimal type.
8096 2004-11-22 Marek Safar <marek.safar@seznam.cz>
8098 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
8101 2004-11-22 Marek Safar <marek.safar@seznam.cz>
8103 * class.cs (EventField.ApplyAttributeBuilder): Fix error
8106 2004-11-19 Marek Safar <marek.safar@seznam.cz>
8108 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
8110 * pending.cs (PendingImplementation): Grab only interfaces.
8112 2004-11-19 Marek Safar <marek.safar@seznam.cz>
8114 * statement.cs (ForeachHelperMethods): Add location member and
8115 error 202 detection.
8117 2004-11-18 Marek Safar <marek.safar@seznam.cz>
8119 * expression.cs (DoResolveBase): Fixed wrong warning for out
8122 2004-12-04 Martin Baulig <martin@ximian.com>
8124 * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
8125 to check whether the conversion is ok.
8127 * typemanager.cs (TypeManager.GetTypeArguments): Just return
8128 `Type.EmptyTypes' if we're not a generic TypeContainer.
8130 2004-11-25 Miguel de Icaza <miguel@ximian.com>
8132 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
8133 old bug: when converting from the null literal to a pointer,
8134 return an EmptyCast, not the NullLiteral.
8136 This fixes #69921, the recent null_type changes probably made this
8139 2004-12-03 Martin Baulig <martin@ximian.com>
8141 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8142 method as our child, call AnonymousMethod.Compatible() on it.
8144 2004-12-02 Miguel de Icaza <miguel@ximian.com>
8146 * class.cs (FieldBase): Use an unused bit field from the field to
8147 encode the `has_offset' property from the FieldMember. This saves
8148 a couple of Ks on bootstrap compilation.
8150 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8151 method as our child, return the AnonymousMethod resolved
8154 * expression.cs (New.DoResolve): Allow return values from
8155 NewDelegate to also include AnonymousMethods.
8159 2004-11-29 Raja R Harinath <rharinath@novell.com>
8161 * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
8163 * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
8164 System.Runtime.InteropServices._Exception, since it's a base
8165 interface of the core type System.Exception in the net_2_0 profile.
8167 2004-11-27 Martin Baulig <martin@ximian.com>
8169 * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
8171 2004-11-26 Raja R Harinath <rharinath@novell.com>
8173 * Makefile: Convert to use executable.make.
8174 * gmcs.exe.sources: New.
8176 2004-11-25 Martin Baulig <martin@ximian.com>
8178 * expression.cs (Invocation.InferType): Added support for byref types.
8180 2004-11-25 Martin Baulig <martin@ximian.com>
8182 * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
8183 in TypeManager.TypeToCoreType().
8185 2004-11-25 Martin Baulig <martin@ximian.com>
8187 * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
8188 "Dispose" method from the `current_type'.
8189 (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
8190 DoDefineMembers() instead of using the MethodBuilder; this is
8191 required for generic iterators.
8193 * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
8195 2004-11-24 Martin Baulig <martin@ximian.com>
8197 * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
8199 2004-11-20 Martin Baulig <martin@ximian.com>
8201 * expression.cs (Invocation.InferType): Correctly infer generic
8202 instances; see gen-103.cs.
8203 (Invocation.InferTypeArguments): If a generic method doesn't have
8204 any unbound type parameters, we don't need to infer anything.
8206 2004-11-19 Raja R Harinath <rharinath@novell.com>
8208 * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
8210 2004-11-17 Raja R Harinath <rharinath@novell.com>
8212 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
8213 (TypeHandle.GetMemberCache): New.
8214 (TypeHandle.TypeHandle): Update.
8215 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
8216 (TypeManager.LookupParentInterfacesCache):
8217 Rename from LookupInterfaceCache. Optimize slightly.
8218 (TypeManager.MemberLookup_FindMembers): Update.
8219 * decl.cs (MemberCache.MemberCache): Set Container to null in the
8221 (AddCacheContents): Rename from AddHashtable.
8222 * class.cs (TypeContainer.parent_container): Remove.
8223 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
8224 (TypeContainer.DoDefineMembers): Don't initialize it.
8225 Update to name changes.
8227 2004-11-17 Miguel de Icaza <miguel@ximian.com>
8229 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
8230 that factors the code to check access modifiers on override.
8232 (PropertyBase): Use the code here.
8234 Patch from Lluis S'anchez, fixes bug #69361.
8236 2004-11-15 Miguel de Icaza <miguel@ximian.com>
8238 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
8239 routine that is used to report the use of a captured variable
8240 whose address has been taken.
8242 There are two checks: one when variables are being captured and
8243 the other check is when the address of a variable is taken.
8245 (because an anonymous methods might be resolved before *or* after
8246 the address has been taken) and
8248 * expression.cs (Conditional.DoResolve): Remove the special
8249 casing that Martin added to trueExpr and falseExpr being both
8250 NullLiteral. We get the right behavior now just by introducing
8251 the null_type into the compiler.
8253 * convert.cs (ExplicitConversion): Change the code to use
8254 null_type instead of testing `expr is NullLiteral'.
8255 (ImplicitConversionStandard): use null_type too.
8256 (ImplicitReferenceConversionExists): use null_type too.
8257 (ImplicitReferenceConversion): use null_type too.
8259 * literal.cs: The type of `NullLiteral' is now null_type instead
8261 (Resolve): Set the type here.
8263 * typemanager.cs: Introduce null_type.
8265 2004-11-18 Martin Baulig <martin@ximian.com>
8268 (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
8270 2004-11-18 Martin Baulig <martin@ximian.com>
8272 * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
8274 2004-11-18 Martin Baulig <martin@ximian.com>
8276 * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
8277 of a `DeclSpace'. If one of our constraints is a `ConstructedType',
8278 call ResolveConstructedType() on it to resolve it without checking
8280 (Constraints.ResolveTypes): Check them here.
8281 (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
8282 but don't check constraints.
8283 (ConstructedType.ResolveAsTypeTerminal): Override this and also
8284 check constraints here.
8285 (ConstructedType.ResolveConstructedType): New public method. This
8286 is called from DoResolveAsTypeStep() and Constraints.Resolve() to
8287 resolve ourselves without checking constraints.
8289 * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
8291 2004-11-18 Martin Baulig <martin@ximian.com>
8294 (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
8296 * delegate.cs (Delegate.DefineType): Always create the EmitContext.
8298 2004-11-18 Martin Baulig <martin@ximian.com>
8300 * ecore.cs (TypeExpr.ResolveType): Removed.
8301 (Expression.ResolveAsTypeTerminal): We always return a fully
8302 resolved `TypeExpr', so we can just access its `Type'.
8304 * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
8306 2004-11-17 Martin Baulig <martin@ximian.com>
8308 * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
8309 sure we don't return any unresolved TypeExpr's.
8310 (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
8312 (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
8314 * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
8315 unresolved `ConstructedType's.
8317 2004-11-17 Martin Baulig <martin@ximian.com>
8319 * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
8321 2004-11-17 Martin Baulig <martin@ximian.com>
8324 (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
8326 * decl.cs (DeclSpace.ResolveType): Removed.
8327 (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
8329 2004-11-17 Martin Baulig <martin@ximian.com>
8331 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
8332 direction, like FindMembers() does. Fixes #69546, testcase is in
8335 2004-11-16 Martin Baulig <martin@ximian.com>
8337 This is based on a patch from Marek Safar, see bug #69082.
8338 Fixes bugs #63705 and #67130.
8340 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
8341 method; create a MemberCache for an interface type and cache the
8344 * decl.cs (IMemberContainer.ParentContainer): Removed.
8345 (IMemberContainer.ParentCache): New property.
8346 (MemberCache.SetupCacheForInterface): Removed.
8347 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
8348 to create a cache for an interface's "parent".
8350 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
8353 2004-11-14 Ben Maurer <bmaurer@ximian.com>
8355 * statement.cs: Avoid adding bools to a hashtable.
8357 2004-11-15 Martin Baulig <martin@ximian.com>
8359 * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
8361 2004-11-11 Martin Baulig <martin@ximian.com>
8363 * typemanager.cs (TypeManager.GetMethodName): New method.
8365 * class.cs (MethodData.Define): Include the generic arity in the
8366 name of an explicit interface; also add it to the method name.
8368 * pending.cs (PendingImplementation.InterfaceMethod): The method
8369 name now includes the generic arity.
8371 2004-11-07 Miguel de Icaza <miguel@ximian.com>
8373 * expression.cs (Invocation.OverloadResolve): Flag error if we are
8374 calling an unsafe method from a safe location.
8376 2004-11-06 Marek Safar <marek.safar@seznam.cz>
8379 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
8381 2004-11-06 Miguel de Icaza <miguel@ximian.com>
8383 * namespace.cs (VerifyUsing): use GetPartialName instead of
8386 2004-11-05 Miguel de Icaza <miguel@ximian.com>
8388 * statement.cs (Return.Resolve): Fix regression in typo: if
8389 `in_exc', we have to request a NeedReturnLabel, this was a typo
8390 introduced in the anonymous method check-in. Fixes #69131.
8392 * Indexers were using the ShortName when defining themselves,
8393 causing a regression in the compiler bootstrap when applying the
8394 patch from 2004-11-02 (first part), now they use their full name
8395 and the bug is gone.
8397 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
8399 * driver.cs: Strip the path from the names of embedded resources. Fixes
8402 2004-11-04 Raja R Harinath <rharinath@novell.com>
8404 Fix error message regression: cs0104-2.cs.
8405 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
8406 (AliasEntry.Resolve): Update.
8407 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
8409 (RootContext.LookupType): Update.
8411 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
8413 * cs-parser.jay: Add support for handling accessor modifiers
8414 * class: Add support port accessor modifiers and error checking,
8415 define PropertyMethod.Define as virtual (not abstract anymore)
8416 * ecore.cs: Add checking for proeprties access with access modifiers
8417 * iterators.cs: Modify Accessor constructor call based in the modified
8419 2004-11-02 Ben Maurer <bmaurer@ximian.com>
8421 * expression.cs (StringConcat): Handle being called twice,
8422 as when we have a concat in a field init with more than two
8425 2004-11-02 Miguel de Icaza <miguel@ximian.com>
8427 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
8428 special case explicit implementations, we should always produce
8429 the .property or .event declaration.
8431 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
8432 since it will not return correct data if people use this
8433 unresolved in the presence of using statements (see test-313).
8435 * class.cs (MethodData.Define): If we are an explicit interface
8436 implementation, set the method name to the full name of the
8437 interface plus the name of the method.
8439 Notice that using the method.MethodName.GetFullName() does not
8440 work, as it will only contain the name as declared on the source
8441 file (it can be a shorthand in the presence of using statements)
8442 and not the fully qualifed type name, for example:
8446 class D : ICloneable {
8447 object ICloneable.Clone () {
8451 Would produce a method called `ICloneable.Clone' instead of
8452 `System.ICloneable.Clone'.
8454 * namespace.cs (Alias.Resolve): Use GetPartialName.
8456 2004-11-01 Marek Safar <marek.safar@seznam.cz>
8458 * cs-parser.jay: Add error 1055 report.
8460 2004-11-01 Miguel de Icaza <miguel@ximian.com>
8462 * assign.cs (Assign.DoResolve): Only do the transform of
8463 assignment into a New if the types are compatible, if not, fall
8464 through and let the implicit code deal with the errors and with
8465 the necessary conversions.
8467 2004-11-01 Marek Safar <marek.safar@seznam.cz>
8469 * cs-parser.jay: Add error 1031 report.
8471 * cs-tokenizer.cs: Add location for error 1038.
8473 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8475 * cs-parser.jay: Add error 1016 report.
8477 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8479 * cs-parser.jay: Add errors 1575,1611 report.
8481 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8483 * cs-parser.jay: Add error 1001 report.
8485 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8488 * attribute.cs (GetMarshal): Add method argument for
8489 caller identification.
8491 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
8492 agument for GetMarshal and RuntimeMissingSupport.
8494 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8496 * attribute.cs (ExtractSecurityPermissionSet): Removed
8497 TypeManager.code_access_permission_type.
8499 * typemanager.cs: Removed TypeManager.code_access_permission_type.
8501 2004-10-27 Miguel de Icaza <miguel@ximian.com>
8503 * expression.cs (LocalVariableReference.DoResolveLValue): Check
8504 for obsolete use of a variable here. Fixes regression on errors
8505 cs0619-25 and cs0619-26.
8507 2004-10-27 Marek Safar <marek.safar@seznam.cz>
8509 Fix #62358, implemented security attribute encoding.
8511 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
8512 Tests permitted SecurityAction for assembly or other types.
8513 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
8514 data from SecurityPermissionAttribute to PermisionSet class.
8516 * class.cs (ApplyAttributeBuilder): Added special handling
8517 for System.Security.Permissions.SecurityAttribute based types.
8519 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
8520 special handling for System.Security.Permissions.SecurityAttribute
8523 * enum.cs (ApplyAttributeBuilder): Added special handling
8524 for System.Security.Permissions.SecurityAttribute based types.
8526 * parameter.cs (ApplyAttributeBuilder): Added special handling
8527 for System.Security.Permissions.SecurityAttribute based types.
8529 * rootcontext.cs: Next 2 core types.
8531 * typemanager.cs (TypeManager.security_permission_attr_type):
8532 Built in type for the SecurityPermission Attribute.
8533 (code_access_permission_type): Build in type.
8535 2004-10-17 Miguel de Icaza <miguel@ximian.com>
8537 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
8538 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
8539 all of this information into
8540 EmitContext.EmitCapturedVariableInstance.
8542 * codegen.cs (EmitCapturedVariableInstance): move here the
8543 funcionality of emitting an ldarg.0 in the presence of a
8544 remapping. This centralizes the instance emit code.
8546 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
8547 then emit a load of this: it means that we have reached the
8548 topmost ScopeInfo: the one that contains the pointer to the
8549 instance of the class hosting the anonymous method.
8551 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
8552 captures to the topmost CaptureContext.
8554 2004-10-12 Miguel de Icaza <miguel@ximian.com>
8556 * expression.cs (LocalVariableReference): Move the knowledge about
8557 the iterators into codegen's EmitCapturedVariableInstance.
8559 2004-10-11 Miguel de Icaza <miguel@ximian.com>
8561 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
8562 all code paths return a value from an anonymous method (it is the
8563 same as the 161 error, but for anonymous methods).
8565 2004-10-08 Miguel de Icaza <miguel@ximian.com>
8567 The introduction of anonymous methods in the compiler changed
8568 various ways of doing things in the compiler. The most
8569 significant one is the hard split between the resolution phase
8570 and the emission phases of the compiler.
8572 For instance, routines that referenced local variables no
8573 longer can safely create temporary variables during the
8574 resolution phase: they must do so from the emission phase,
8575 since the variable might have been "captured", hence access to
8576 it can not be done with the local-variable operations from the runtime.
8580 (Block.Flags): New flag `IsTopLevel' to indicate that this block
8581 is a toplevel block.
8583 (ToplevelBlock): A new kind of Block, these are the blocks that
8584 are created by the parser for all toplevel method bodies. These
8585 include methods, accessors and anonymous methods.
8587 These contain some extra information not found in regular blocks:
8588 A pointer to an optional CaptureContext (for tracking captured
8589 local variables and parameters). A pointer to the parent
8592 (Return.Resolve): Catch missmatches when returning a value from an
8593 anonymous method (error 1662).
8594 Invoke NeedReturnLabel from the Resolve phase instead of the emit
8597 (Break.Resolve): ditto.
8599 (SwitchLabel): instead of defining the labels during the
8600 resolution phase, we now turned the public ILLabel and ILLabelCode
8601 labels into methods called GetILLabelCode() and GetILLabel() that
8602 only define the label during the Emit phase.
8604 (GotoCase): Track the SwitchLabel instead of the computed label
8605 (its contained therein). Emit the code by using
8606 SwitchLabel.GetILLabelCode ().
8608 (LocalInfo.Flags.Captured): A new flag has been introduce to track
8609 whether the Local has been captured or not.
8611 (LocalInfo.IsCaptured): New property, used to tell whether the
8612 local has been captured.
8614 * anonymous.cs: Vastly updated to contain the anonymous method
8617 The main classes here are: CaptureContext which tracks any
8618 captured information for a toplevel block and ScopeInfo used to
8619 track the activation frames for various local variables.
8621 Each toplevel block has an optional capture context associated
8622 with it. When a method contains an anonymous method both the
8623 toplevel method and the anonymous method will create a capture
8624 context. When variables or parameters are captured, they are
8625 recorded on the CaptureContext that owns them, for example:
8629 MyDelegate d = delegate {
8634 Here `a' will be recorded as captured on the toplevel
8635 CapturedContext, the inner captured context will not have anything
8636 (it will only have data if local variables or parameters from it
8637 are captured in a nested anonymous method.
8639 The ScopeInfo is used to track the activation frames for local
8640 variables, for example:
8642 for (int i = 0; i < 10; i++)
8643 for (int j = 0; j < 10; j++){
8644 MyDelegate d = delegate {
8649 At runtime this captures a single captured variable `i', but it
8650 captures 10 different versions of the variable `j'. The variable
8651 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
8652 recorded on a child.
8654 The toplevel ScopeInfo will also track information like the `this'
8655 pointer if instance variables were referenced (this is necessary
8656 as the anonymous method lives inside a nested class in the host
8657 type of the method).
8659 (AnonymousMethod): Expanded to track the Toplevel, implement
8660 `AnonymousMethod.Compatible' to tell whether an anonymous method
8661 can be converted to a target delegate type.
8663 The routine now also produces the anonymous method content
8665 (AnonymousDelegate): A helper class that derives from
8666 DelegateCreation, this is used to generate the code necessary to
8667 produce the delegate for the anonymous method that was created.
8669 * assign.cs: API adjustments for new changes in
8670 Convert.ImplicitStandardConversionExists.
8672 * class.cs: Adjustments to cope with the fact that now toplevel
8673 blocks are of type `ToplevelBlock'.
8675 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
8676 insteda of standard blocks.
8678 Flag errors if params arguments are passed to anonymous methods.
8680 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
8681 `CurrentAnonymousMethod' which points to the current Anonymous
8682 Method. The variable points to the AnonymousMethod class that
8683 holds the code being compiled. It is set in the new EmitContext
8684 created for the anonymous method.
8686 (EmitContext.Phase): Introduce a variable and an enumeration to
8687 assist in enforcing some rules about when and where we are allowed
8688 to invoke certain methods (EmitContext.NeedsReturnLabel is the
8689 only one that enfonces this right now).
8691 (EmitContext.HaveCaptureInfo): new helper method that returns
8692 whether we have a CapturedContext initialized.
8694 (EmitContext.CaptureVariable): New method used to register that a
8695 LocalInfo must be flagged for capturing.
8697 (EmitContext.CapturedParameter): New method used to register that a
8698 parameters must be flagged for capturing.
8700 (EmitContext.CapturedField): New method used to register that a
8701 field must be flagged for capturing.
8703 (EmitContext.HaveCapturedVariables,
8704 EmitContext.HaveCapturedFields): Return whether there are captured
8705 variables or fields.
8707 (EmitContext.EmitMethodHostInstance): This is used to emit the
8708 instance for the anonymous method. The instance might be null
8709 (static methods), this (for anonymous methods that capture nothing
8710 and happen to live side-by-side with the current method body) or a
8711 more complicated expression if the method has a CaptureContext.
8713 (EmitContext.EmitTopBlock): Routine that drives the emission of
8714 code: it will first resolve the top block, then emit any metadata
8715 and then emit the code. The split is done so that we can extract
8716 any anonymous methods and flag any captured variables/parameters.
8718 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
8719 during this phase, the ILGenerator should not be used as labels
8720 and local variables declared here might not be accessible to any
8721 code that is part of an anonymous method.
8723 Exceptions to this include the temporary variables that are
8724 created by some statements internally for holding temporary
8727 (EmitContext.EmitMeta): New routine, in charge of emitting all the
8730 (EmitContext.TemporaryReturn): This method is typically called
8731 from the Emit phase, and its the only place where we allow the
8732 ReturnLabel to be defined other than the EmitMeta. The reason is
8733 that otherwise we would have to duplicate a lot of logic in the
8734 Resolve phases of various methods that today is on the Emit
8737 (EmitContext.NeedReturnLabel): This no longer creates the label,
8738 as the ILGenerator is not valid during the resolve phase.
8740 (EmitContext.EmitThis): Extended the knowledge in this class to
8741 work in anonymous methods in addition to iterators.
8743 (EmitContext.EmitCapturedVariableInstance): This emits whatever
8744 code is necessary on the stack to access the instance to a local
8745 variable (the variable will be accessed as a field).
8747 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
8748 EmitContext.EmitAddressOfParameter): Routines to support
8749 parameters (not completed at this point).
8751 Removals: Removed RemapLocal and RemapLocalLValue. We probably
8752 will also remove the parameters.
8754 * convert.cs (Convert): Define a `ConstantEC' which points to a
8755 null. This is just to prefity some code that uses
8756 ImplicitStandardConversion code and do not have an EmitContext
8759 The idea is to flag explicitly that at that point in time, it is
8760 known that the conversion will not trigger the delegate checking
8761 code in implicit conversions (which requires a valid
8764 Everywhere: pass new EmitContext parameter since
8765 ImplicitStandardConversionExists now requires it to check for
8766 anonymous method conversions.
8768 (Convert.ImplicitStandardConversionExists): If the type of an
8769 expression is the anonymous_method_type, and the type is a
8770 delegate, we invoke the AnonymousMethod.Compatible method to check
8771 whether an implicit conversion is possible.
8773 (Convert.ImplicitConversionStandard): Only do implicit method
8774 group conversions if the language level is not ISO_1.
8776 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
8777 MethodInfo for the Invoke method. used by Delegate and
8780 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
8781 method conversions if the target type is a delegate.
8783 Removed extra debugging nops.
8785 (LocalVariableReference): Turn the `local_info' into a public
8788 Add `prepared' field, the same hack used for FieldExprs to cope
8789 with composed assignments, as Local variables do not necessarily
8790 operate purely on the stack as they used to: they can be captured
8793 Add `temp' for a temporary result, like fields.
8795 Refactor DoResolve and DoResolveLValue into DoResolveBase.
8797 It now copes with Local variables that are captured and emits the
8798 proper instance variable to load it from a field in the captured
8801 (ParameterReference.DoResolveBase): During the resolve phase,
8802 capture parameters if we are in an anonymous method.
8804 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
8805 anonymous method, use the EmitContext helper routines to emit the
8806 parameter reference.
8808 * iterators.cs: Set RemapToProxy to true/false during the
8811 * parameters.cs (GetParameterByName): New helper method.
8813 * typemanager.cs (anonymous_method_type) a new type that
8814 represents an anonyous method. This is always an internal type,
8815 used as a fencepost to test against the anonymous-methodness of an
8818 2004-10-20 Marek Safar <marek.safar@seznam.cz>
8820 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
8822 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
8824 2004-11-10 Martin Baulig <martin@ximian.com>
8826 * expression.cs (Invocation.BetterFunction): If two methods have
8827 equal parameter types, but only one of them is generic, the
8828 non-generic one wins.
8829 (New.DoResolve): Don't set `is_struct' to false if we're a generic
8830 instance; just use `Type.IsValueType' to determine whether
8831 something is a struct or not.
8832 (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
8833 so we can be called multiple times.
8835 2004-11-10 Martin Baulig <martin@ximian.com>
8837 * generic.cs (TypeParameter.DefineConstraints): New public method.
8838 (TypeParameter.CheckAccessLevel): Override this and return true.
8839 (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
8840 override ResolveType() anymore.
8841 (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
8843 2004-11-10 Martin Baulig <martin@ximian.com>
8845 * rootcontext.cs (RootContext.LookupType): If we're a nested type,
8846 call DeclSpace.ResolveNestedType() on it.
8848 2004-11-10 Martin Baulig <martin@ximian.com>
8850 * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
8851 non-null, call ParameterModifier() on it.
8853 2004-11-10 Martin Baulig <martin@ximian.com>
8856 (Iterators): Added `current_type' and `this_type' fields.
8857 (Iterators.DefineIterator): Create a new EmitContext and store it
8858 in `ec'; compute `this_type'.
8860 2004-11-10 Martin Baulig <martin@ximian.com>
8863 (TypeManager.IsPrivateAccessible): New public method.
8864 (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
8866 2004-11-10 Martin Baulig <martin@ximian.com>
8868 * class.cs (TypeContainer.DefineType): Call
8869 TypeBuilder.DefineGenericParameters() before resolving the type
8871 (MethodData.parent_method): New protected field.
8872 (MethodData..ctor): Added `MethodInfo parent_method' argument.
8873 (MethodData.Define): Compute `parent_method'.
8876 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
8877 (MemberCore.GetClsCompliantAttributeValue): Likewise.
8878 (DeclSpace.ec): New protected field; store the EmitContext here.
8879 (DeclSpace.EmitContext): New public property.
8880 (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
8881 (DeclSpace.ResolveNestedType): New public method.
8882 (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
8883 (DeclSpace.NestedAccessible): Added `Type tb' argument.
8884 (DeclSpace.FamilyAccessible): Likewise.
8885 (DeclSpace.FindType): Call ResolveNestedType() for nested types.
8886 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
8889 * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
8892 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
8893 (Enum.Emit): Don't create a new EmitContext.
8895 2004-10-18 Martin Baulig <martin@ximian.com>
8897 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
8898 `Type' directly, but call ResolveType() on it.
8899 (Catch.Resolve): Likewise.
8900 (Foreach.Resolve): Likewise.
8902 2004-10-18 Martin Baulig <martin@ximian.com>
8904 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
8905 `Type' directly, but call ResolveType() on it.
8906 (Probe.DoResolve): Likewise.
8907 (ArrayCreation.LookupType): Likewise.
8908 (TypeOf.DoResolve): Likewise.
8909 (SizeOf.DoResolve): Likewise.
8911 2004-10-18 Raja R Harinath <rharinath@novell.com>
8913 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
8916 2004-10-17 John Luke <john.luke@gmail.com>
8918 * class.cs (Operator.GetSignatureForError): use CSharpName
8920 * parameter.cs (Parameter.GetSignatureForError): Returns
8921 correct name even if was not defined.
8923 2004-10-13 Raja R Harinath <rharinath@novell.com>
8926 * class.cs (TypeContainer.EmitContext): New property.
8927 (DefineNestedTypes): Create an emitcontext for each part.
8928 (MethodCore.DoDefineParameters): Use container's emitcontext.
8929 Pass type array to InternalParameters.
8930 (MemberBase.DoDefine): Use container's emitcontext.
8931 (FieldMember.Define): Likewise.
8932 (Event.Define): Likewise.
8933 (SetMethod.GetParameterInfo): Change argument to EmitContext.
8934 Pass type array to InternalParameters.
8935 (SetIndexerMethod.GetParameterInfo): Likewise.
8936 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8937 * delegate.cs (Define): Pass emitcontext to
8938 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
8939 array to InternalParameters.
8940 * expression.cs (ParameterReference.DoResolveBase): Pass
8941 emitcontext to GetParameterInfo.
8942 (ComposedCast.DoResolveAsTypeStep): Remove check on
8943 ec.ResolvingTypeTree.
8944 * parameter.cs (Parameter.Resolve): Change argument to
8945 EmitContext. Use ResolveAsTypeTerminal.
8946 (Parameter.GetSignature): Change argument to EmitContext.
8947 (Parameters.ComputeSignature): Likewise.
8948 (Parameters.ComputeParameterTypes): Likewise.
8949 (Parameters.GetParameterInfo): Likewise.
8950 (Parameters.ComputeAndDefineParameterTypes): Likewise.
8951 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
8952 * support.cs (InternalParameters..ctor): Remove variant that takes
8954 * typemanager.cs (system_intptr_expr): New.
8955 (InitExpressionTypes): Initialize it.
8957 2004-10-12 Chris Toshok <toshok@ximian.com>
8959 * cs-parser.jay: fix location for try_statement and catch_clause.
8961 2004-10-18 Martin Baulig <martin@ximian.com>
8963 * class.cs (FieldMember.Define): Don't access the TypeExpr's
8964 `Type' directly, but call ResolveType() on it.
8965 (MemberBase.DoDefine): Likewise.
8967 * expression.cs (New.DoResolve): Don't access the TypeExpr's
8968 `Type' directly, but call ResolveType() on it.
8969 (ComposedCast.DoResolveAsTypeStep): Likewise.
8971 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
8972 `Type' directly, but call ResolveType() on it.
8974 2004-10-17 John Luke <john.luke@gmail.com>
8976 * class.cs (Operator.GetSignatureForError): use CSharpName
8978 * parameter.cs (Parameter.GetSignatureForError): Returns
8979 correct name even if was not defined.
8981 2004-10-13 Raja R Harinath <rharinath@novell.com>
8984 * class.cs (TypeContainer.EmitContext): New property.
8985 (DefineNestedTypes): Create an emitcontext for each part.
8986 (MethodCore.DoDefineParameters): Use container's emitcontext.
8987 Pass type array to InternalParameters.
8988 (MemberBase.DoDefine): Use container's emitcontext.
8989 (FieldMember.Define): Likewise.
8990 (Event.Define): Likewise.
8991 (SetMethod.GetParameterInfo): Change argument to EmitContext.
8992 Pass type array to InternalParameters.
8993 (SetIndexerMethod.GetParameterInfo): Likewise.
8994 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8995 * delegate.cs (Define): Pass emitcontext to
8996 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
8997 array to InternalParameters.
8998 * expression.cs (ParameterReference.DoResolveBase): Pass
8999 emitcontext to GetParameterInfo.
9000 (ComposedCast.DoResolveAsTypeStep): Remove check on
9001 ec.ResolvingTypeTree.
9002 * parameter.cs (Parameter.Resolve): Change argument to
9003 EmitContext. Use ResolveAsTypeTerminal.
9004 (Parameter.GetSignature): Change argument to EmitContext.
9005 (Parameters.ComputeSignature): Likewise.
9006 (Parameters.ComputeParameterTypes): Likewise.
9007 (Parameters.GetParameterInfo): Likewise.
9008 (Parameters.ComputeAndDefineParameterTypes): Likewise.
9009 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
9010 * support.cs (InternalParameters..ctor): Remove variant that takes
9012 * typemanager.cs (system_intptr_expr): New.
9013 (InitExpressionTypes): Initialize it.
9015 2004-10-12 Chris Toshok <toshok@ximian.com>
9017 * cs-parser.jay: fix location for try_statement and catch_clause.
9019 2004-10-07 Raja R Harinath <rharinath@novell.com>
9021 More DeclSpace.ResolveType avoidance.
9022 * decl.cs (MemberCore.InUnsafe): New property.
9023 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
9024 with newly created EmitContext.
9025 (FieldMember.Define): Likewise.
9026 * delegate.cs (Delegate.Define): Likewise.
9027 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
9028 only if normal name-lookup fails.
9029 (TypeExpr.DoResolve): Enable error-checking.
9030 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
9031 (SizeOf.DoResolve): Likewise.
9032 (ComposedCast.DoResolveAsTypeStep): Likewise.
9033 (StackAlloc.DoResolve): Likewise.
9034 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
9035 (Block.Unsafe): New property.
9036 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
9037 (Unsafe): Set 'unsafe' flag of contained block.
9038 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
9039 (Fixed.Resolve): Likewise.
9040 (Catch.Resolve): Likewise.
9041 (Using.ResolveLocalVariableDecls): Likewise.
9042 (Foreach.Resolve): Likewise.
9044 2004-10-05 John Luke <john.luke@gmail.com>
9046 * cs-parser.jay: add location to error CS0175
9048 2004-10-04 Miguel de Icaza <miguel@ximian.com>
9050 * ecore.cs (Expression.Constantity): Add support for turning null
9053 * const.cs (Const.Define): Allow constants to be reference types
9054 as long as the value is Null.
9056 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
9058 * namespace.cs (NamespaceEntry.Using): No matter which warning
9059 level is set, check if this namespace name has already been added.
9061 2004-10-03 Ben Maurer <bmaurer@ximian.com>
9063 * expression.cs: reftype [!=]= null should always use br[true,false].
9066 2004-10-03 Marek Safar <marek.safar@seznam.cz>
9069 * attribute.cs: Enum conversion moved to
9070 GetAttributeArgumentExpression to be applied to the all
9073 2004-10-01 Raja R Harinath <rharinath@novell.com>
9075 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
9076 * class.c (TypeContainer.DefineType): Flag error if
9077 base types aren't accessible due to access permissions.
9078 * decl.cs (DeclSpace.ResolveType): Move logic to
9079 Expression.ResolveAsTypeTerminal.
9080 (DeclSpace.ResolveTypeExpr): Thin layer over
9081 Expression.ResolveAsTypeTerminal.
9082 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
9083 Refactor code into NestedAccess. Use it.
9084 (DeclSpace.NestedAccess): New.
9085 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
9086 argument to silence errors. Check access permissions.
9087 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
9088 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
9089 (Cast.DoResolve): Likewise.
9090 (New.DoResolve): Likewise.
9091 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
9092 (TypeOf.DoResolve): Likewise.
9094 * expression.cs (Invocation.BetterConversion): Return the Type of
9095 the better conversion. Implement section 14.4.2.3 more faithfully.
9096 (Invocation.BetterFunction): Make boolean. Make correspondence to
9097 section 14.4.2.2 explicit.
9098 (Invocation.OverloadResolve): Update.
9099 (Invocation): Remove is_base field.
9100 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
9101 (Invocation.Emit): Likewise.
9103 2004-09-24 Marek Safar <marek.safar@seznam.cz>
9105 * cs-parser.jay: Reverted 642 warning fix.
9107 2004-09-23 Marek Safar <marek.safar@seznam.cz>
9110 * decl.cs (FindMemberWithSameName): Indexer can have more than
9113 2004-09-23 Marek Safar <marek.safar@seznam.cz>
9115 * expression.cs (LocalVariableReference.DoResolveLValue):
9116 Do not report warning 219 for out values.
9117 (EmptyExpression.Null): New member to avoid extra allocations.
9119 2004-09-23 Marek Safar <marek.safar@seznam.cz>
9121 * cs-parser.jay: Fix wrong warning 642 report.
9123 * cs-tokenizer.cs (CheckNextToken): New helper;
9124 Inspect next character if is same as expected.
9126 2004-09-23 Martin Baulig <martin@ximian.com>
9128 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9129 (Convert.ImplicitReferenceConversionExists): Likewise.
9131 2004-11-09 Raja R Harinath <rharinath@novell.com>
9133 * Makefile (DISTFILES): Comment out a few missing files.
9135 2004-10-29 Raja R Harinath <rharinath@novell.com>
9137 * Makefile (bootstrap_libs,bootstrap_libfiles): New.
9138 (bootstrap-libs): New target. Invokes the net_2_0_bootstrap profile.
9139 (gmcs.exe): Invoke bootstrap-libs.
9140 (clean-local): Clean the net_2_0_bootstrap profile too.
9141 (PROGRAM_INSTALL_DIR): New.
9142 (install-local): Use it.
9144 2004-10-13 Martin Baulig <martin@ximian.com>
9146 * generic.cs (TypeManager.InflatedConstraints): New nested class.
9147 (TypeParameter.DefineType): If we're a method type parameter and
9148 that method is overriding something, "inflate" its constraints.
9150 2004-10-12 Martin Baulig <martin@ximian.com>
9152 * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
9153 and have type arguments, create and resolve a ConstructedType.
9155 2004-10-12 Martin Baulig <martin@ximian.com>
9157 * decl.cs (MemberCache.FindMemberToOverride): Use
9158 TypeManager.IsEqual() to compare the parameters and Type.Equals()
9159 to compare the invocationType.
9161 * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
9162 When comparing two type parameters, only do the signature-only
9163 comparision for method type parameters.
9165 2004-10-11 Martin Baulig <martin@ximian.com>
9167 * report.cs: Don't make --fatal abort on warnings, we have
9168 -warnaserror for that.
9170 2004-10-11 Martin Baulig <martin@ximian.com>
9173 (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
9174 (TypeManager.IsEqual): Call ourself recursively instead of using
9177 2004-10-11 Martin Baulig <martin@ximian.com>
9179 * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
9180 on our own type parameters, not on the ones we inherit from a containing
9183 * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
9186 * generic.cs (TypeParameter.Define): We may only be called once.
9188 * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
9189 instead of TypeManager.IsEqual().
9191 2004-09-28 Martin Baulig <martin@ximian.com>
9194 (GenericConstraints.EffectiveBaseClass): New public property.
9195 (TypeParameter.GenericConstraints): New public property.
9196 (ConstructedType.CheckConstraints): Improved.
9198 * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
9199 (Convert.TypeParameterConversion): New private method; use this in
9200 ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
9201 for all conversions related to type parameters.
9203 2004-09-24 Martin Baulig <martin@ximian.com>
9205 * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
9206 type parameter conversions for type parameters which are known to
9209 2004-09-24 Martin Baulig <martin@ximian.com>
9211 * generic.cs (GenericConstraints): Added `IsReferenceType' and
9212 `IsValueType' properties.
9214 * support.cs (ReflectionConstraints): Use
9215 Type.GetGenericParameterConstraints() instead of the old hack.
9217 2004-09-24 Martin Baulig <martin@ximian.com>
9219 * generic.cs (GenericConstraints): Moved here and made it an
9222 * support.cs (GenericConstraints): Moved to generic.cs.
9224 2004-09-24 Martin Baulig <martin@ximian.com>
9227 (ReflectionConstraints): Un-nested this class and made it public.
9230 (TypeManager.GetTypeParameterConstraints): New public method.
9231 (TypeManager.HasConstructorConstraint): Use the attributes.
9233 2004-09-24 Martin Baulig <martin@ximian.com>
9235 * support.cs (GenericConstraints): Replaced `HasConstructor',
9236 `IsReferenceType' and `IsValueType' with `Attributes'.
9237 (ReflectionParameters.ReflectionConstraints): Removed the Create()
9238 method and made the .ctor public.
9240 * generic.cs (Constraints.Attributes): New public property.
9241 (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
9242 `IsReferenceType' -> `HasReferenceTypeConstraint' and
9243 `IsValueType' -> `HasValueTypeConstraint'.
9245 2004-09-23 Martin Baulig <martin@ximian.com>
9247 * generic.cs (Constraints): Reflect latest runtime changes.
9249 2004-09-23 Martin Baulig <martin@ximian.com>
9251 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9252 (Convert.ImplicitReferenceConversionExists): Likewise.
9254 2004-09-23 Marek Safar <marek.safar@seznam.cz>
9256 * class.cs (Operator.Define): Add error 448 and 559 report.
9258 2004-09-22 Marek Safar <marek.safar@seznam.cz>
9260 * class.cs (MemberBase.IsTypePermitted): New protected
9261 method for checking error CS0610.
9263 2004-09-22 Marek Safar <marek.safar@seznam.cz>
9265 * class.cs (TypeContainer.HasExplicitLayout): New property
9266 Returns whether container has StructLayout attribute set Explicit.
9267 (FieldMember): New abstract class for consts and fields.
9268 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
9269 (Field): Reuse FieldMember.
9271 * const.cs (Const): Reuse FieldMember.
9273 * rootcontext.cs: EmitConstants call moved to class.
9275 2004-09-22 Martin Baulig <martin@ximian.com>
9277 Marek and me just fixed one of our oldest bugs: #28562 :-)
9279 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
9281 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
9282 we're an EnumConstant, just return that.
9283 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
9284 an EnumConstant. In this case, we need to use GetValueAsEnumType()
9285 to get the value which'll actually be written into the attribute.
9286 However, we have to use GetValue() to access the attribute's value
9289 2004-09-22 Marek Safar <marek.safar@seznam.cz>
9291 * constant.cs (Constant.IsNegative): New abstract property
9294 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
9295 (StackAlloc.DoResolve): Reused IsNegative.
9297 2004-09-22 Martin Baulig <martin@ximian.com>
9299 * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
9300 public method; like LookupTypeContainer, but also works for
9303 * report.cs (Report.SymbolRelatedToPreviousError): Use
9304 TypeManager.LookupGenericTypeContainer().
9306 2004-09-22 Martin Baulig <martin@ximian.com>
9308 Thanks to Peter Sestoft for this bug report.
9310 * expression.cs (Conditional): If both the `trueExpr' and the
9311 `falseExpr' is a NullLiteral, return a NullLiteral.
9313 2004-09-22 Martin Baulig <martin@ximian.com>
9315 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
9316 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
9317 for the "get_Current" call.
9319 2004-09-21 Martin Baulig <martin@ximian.com>
9321 * convert.cs (Convert.ImplicitReferenceConversion): When
9322 converting to an interface type, first check whether we're
9323 converting from a reference type.
9325 2004-09-14 Martin Baulig <martin@ximian.com>
9327 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
9329 2004-09-14 Marek Safar <marek.safar@seznam.cz>
9332 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
9333 called and is obsolete then this member suppress message
9334 when call is inside next [Obsolete] method or type.
9336 * expression.cs: Use TestObsoleteMethodUsage member.
9338 2004-09-14 Martin Baulig <martin@ximian.com>
9340 * genericparser.cs: Removed.
9342 2004-09-13 Marek Safar <marek.safar@seznam.cz>
9344 * class.cs (MethodCore.CheckBase): Fix bug #65757.
9346 2004-09-12 Marek Safar <marek.safar@seznam.cz>
9348 * attribute.cs (Attribute.Resolve): Add error 653 report.
9350 * class.cs (Class.ApplyAttributeBuilder): Add error 641
9352 (Method.ApplyAttributeBuilder): Add error 685 report.
9353 (Operator.Define): Add error 564 report.
9355 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
9357 * expression.cs (Invocation.DoResolve): Add error
9360 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
9363 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9365 * class.cs (ConstructorInitializer.Resolve):
9366 Wrong error number (515->516).
9368 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9370 * class.cs (Indexer.Define): Add error 631 report.
9372 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9374 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
9376 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9378 * expression.cs (Probe.DoResolve): Add error CS0241 report.
9380 2004-09-10 Marek Safar <marek.safar@seznam.cz>
9382 * cs-parser.jay: Added error CS0241 report.
9384 2004-09-10 Raja R Harinath <rharinath@novell.com>
9386 * cs-parser.jay (fixed_statement): Introduce a scope for the
9387 declaration in the 'fixed' statement.
9389 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9391 * cs-parser.jay: Added CS0230 error report.
9393 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9395 * cs-parser.jay: Added errors CS0231 and CS0257 report.
9397 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9399 * expression.cs (Argument.Resolve): Added error CS0192 and
9402 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9404 C# 2.0 #pragma warning feature
9406 * cs-tokenizer.cs (PreProcessPragma): New method;
9407 Handles #pragma directive.
9409 * report.cs (WarningRegions): New class; Support
9410 class for #pragma warning directive. It tests whether
9411 warning is enabled for a given line.
9413 2004-09-08 Miguel de Icaza <miguel@ximian.com>
9415 * const.cs: Add more descriptive error report, tahnks to
9418 2004-09-08 Marek Safar <marek.safar@seznam.cz>
9420 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
9422 2004-09-07 Miguel de Icaza <miguel@ximian.com>
9424 * expression.cs: Apply patch from Ben: Remove dead code from
9425 ArrayCreation, and remove the TurnintoConstant call in const.cs,
9426 as that code just threw an exception anwyays.
9428 * const.cs: Remove the call to the turnintoconstant, for details
9431 * literal.cs: The type of the null-literal is the null type; So
9432 we use a placeholder type (literal.cs:System.Null, defined here)
9435 * expression.cs (Conditional.DoResolve): Remove some old code that
9436 is no longer needed, conversions have been fixed.
9438 (ArrayCreationExpression.DoResolve): Return false if we fail to
9439 resolve the inner expression.
9441 2004-09-07 Raja R Harinath <rharinath@novell.com>
9444 * cs-parser.jay (delegate_declaration): Record a delegate
9445 declaration as a type declaration.
9446 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
9448 2004-09-06 Miguel de Icaza <miguel@ximian.com>
9450 * parameter.cs: Do not crash if the type can not be resolved.
9452 * expression.cs: Report errors with unsafe pointers, fixes #64896
9454 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
9456 * expression.cs: Pointer arith always needs to do a conv.i
9457 if the operand is a long. fix 65320
9459 2004-09-04 Marek Safar <marek.safar@seznam.cz>
9461 Fixed cs0619-37.cs, cs0619-38.cs
9463 * enum.cs (GetObsoleteAttribute): Removed.
9465 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
9466 on Enum member is double staged. The first is tested member
9469 2004-09-04 Marek Safar <marek.safar@seznam.cz>
9471 Fixed #56986, #63631, #65231
9473 * class.cs: (TypeContainer.AddToMemberContainer): New method,
9474 adds member to name container.
9475 (TypeContainer.AddToTypeContainer): New method, adds type to
9477 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
9478 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
9479 AddOperator): Simplified by reusing AddToMemberContainer.
9480 (TypeContainer.UserDefinedStaticConstructor): Changed to property
9482 (Method.CheckForDuplications): Fixed implementation to test all
9484 (MemberBase): Detection whether member is explicit interface
9485 implementation is now in constructor.
9486 (MemberBase.UpdateMemberName): Handles IndexerName.
9487 (Accessor): Changed to keep also location information.
9488 (AbstractPropertyEventMethod): Is derived from MemberCore.
9489 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
9490 will be emited or not.
9491 (PropertyBase.AreAccessorsDuplicateImplementation):
9492 Tests whether accessors are not in collision with some method.
9493 (Operator): Is derived from MethodCore to simplify common
9496 * decl.cs (Flags.TestMethodDuplication): Test for duplication
9498 (DeclSpace.AddToContainer): Adds the member to defined_names
9499 table. It tests for duplications and enclosing name conflicts.
9501 * enum.cs (EnumMember): Clean up to reuse the base structures
9503 2004-09-03 Martin Baulig <martin@ximian.com>
9505 Merged latest changes into gmcs. Please keep this comment in
9506 here, it makes it easier for me to see what changed in MCS since
9507 the last time I merged.
9509 2004-09-03 Martin Baulig <martin@ximian.com>
9511 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9512 into TypeContainer, to make partial classes work again.
9514 2004-09-03 Martin Baulig <martin@ximian.com>
9516 * rootcontext.cs (RootContext.V2): Removed.
9518 2004-03-23 Martin Baulig <martin@ximian.com>
9520 * expression.cs (Invocation.OverloadResolve): Added `bool
9521 may_fail' argument and use it instead of the Location.IsNull() hack.
9523 2004-09-09 Martin Baulig <martin@ximian.com>
9525 * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
9527 2004-09-09 Martin Baulig <martin@ximian.com>
9529 * generic.cs (TypeParameter.DefineType): Added support for
9530 explicit interface methods.
9532 2004-09-09 Martin Baulig <martin@ximian.com>
9534 * README.Changes: New document. Started to list important changes
9535 between MCS and GMCS here.
9537 2004-09-08 Martin Baulig <martin@ximian.com>
9540 (TypeContainer.CheckRecursiveDefinition): New protected method.
9541 (TypeContainer.DefineType): Move the CS0146 check into
9542 CheckRecursiveDefinition().
9544 2004-09-06 Martin Baulig <martin@ximian.com>
9546 * generic.cs (ConstructedType.CheckConstraints): Allow builtin
9547 types for the constructor constraint.
9549 2004-09-03 Martin Baulig <martin@ximian.com>
9551 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9552 into TypeContainer, to make partial classes work again.
9554 2004-09-03 Martin Baulig <martin@ximian.com>
9556 * rootcontext.cs (RootContext.V2): Removed.
9558 2004-03-23 Martin Baulig <martin@ximian.com>
9560 * expression.cs (Invocation.OverloadResolve): Added `bool
9561 may_fail' argument and use it instead of the Location.IsNull() hack.
9563 2004-09-03 Martin Baulig <martin@ximian.com>
9565 Merged latest changes into gmcs. Please keep this comment in
9566 here, it makes it easier for me to see what changed in MCS since
9567 the last time I merged.
9569 2004-09-03 Raja R Harinath <rharinath@novell.com>
9572 * expression.cs (BetterConversion): Don't allow either conversion
9573 to be null. Remove redundant implicit conversion test when 'q ==
9574 null' -- when this function is invoked, we already know that the
9575 implicit conversion exists.
9576 (BetterFunction): Assume that 'best' is non-null. Remove
9577 redundant reimplementation of IsApplicable when 'best' is null.
9578 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
9579 number of arguments.
9580 (IsAncestralType): Extract from OverloadResolve.
9581 (OverloadResolve): Make robust to the MethodGroupExpr being
9582 unsorted. Implement all the logic of Section 14.5.5.1, and
9583 support overloading of methods from multiple applicable types.
9584 Clean up logic somewhat. Don't pass null methods to BetterFunction.
9586 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
9587 (RealError, Warning): Append type of report to related symbol.
9589 2004-09-03 Marek Safar <marek.safar@seznam.cz>
9591 * enum.cs: Fixed CLS-Compliance checks for enum members.
9592 Error tests cs3008-8.cs, cs3014-8.cs
9594 2004-09-02 Marek Safar <marek.safar@seznam.cz>
9596 Fixed bug #62342, #63102
9597 * class.cs: ImplementIndexer uses member.IsExplicitImpl
9598 like ImplementMethod.
9600 2004-09-02 Marek Safar <marek.safar@seznam.cz>
9602 * attribute.cs (Attribute.GetAttributeArgumentExpression):
9605 2004-09-02 Martin Baulig <martin@ximian.com>
9607 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9608 TypeManager.GetArgumentTypes() rather than calling GetParameters()
9611 2004-09-01 Marek Safar <marek.safar@seznam.cz>
9613 C# 2.0 Static classes implemented
9615 * class.cs (TypeContainer): instance_constructors,
9616 initialized_fields, initialized_static_fields,
9617 default_constructor, base_inteface_types are protected to be
9618 accessible from StaticClass.
9619 (TypeContainer.DefineDefaultConstructor): New virtual method
9620 for custom default constructor generating
9621 (StaticClass): New class to handle "Static classes" feature.
9623 * cs-parser.jay: Handle static keyword on class like instance
9626 * driver.cs: Added "/langversion" command line switch with two
9627 options (iso-1, default).
9629 2004-08-31 Marek Safar <marek.safar@seznam.cz>
9631 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
9633 2004-08-31 Miguel de Icaza <miguel@ximian.com>
9635 * delegate.cs: Style.
9637 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
9639 * delegate.cs: Add seperate instance expr field for miguel.
9641 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
9643 * PointerArithmetic (Resolve): make sure we are not doing
9644 pointer arith on void*. Also, make sure we are resolved
9645 by not setting eclass until resolve.
9647 All callers: Make sure that PointerArithmetic gets resolved.
9649 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
9651 * ArrayCreation (LookupType): If the type does not resolve
9652 to an array, give an error.
9654 2004-08-27 Marek Safar <marek.safar@seznam.cz>
9656 * statement.cs (Try.Resolve): Fixed bug #64222
9658 2004-08-27 Martin Baulig <martin@ximian.com>
9661 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9664 2004-08-26 Marek Safar <marek.safar@seznam.cz>
9666 * ecore.cs (Constantify): Get underlying type via
9667 System.Enum.GetUnderlyingType to avoid StackOverflow on the
9668 Windows in special cases.
9670 2004-08-26 Marek Safar <marek.safar@seznam.cz>
9672 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
9673 for obtaining also private methods.
9674 (GetRemoveMethod): Used GetRemoveMethod (true)
9675 for obtaining also private methods.
9677 2004-09-02 Martin Baulig <martin@ximian.com>
9679 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9680 TypeManager.GetArgumentTypes() rather than calling GetParameters()
9683 2004-08-27 Martin Baulig <martin@ximian.com>
9686 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9689 2004-08-25 Martin Baulig <martin@ximian.com>
9691 * support.cs (ReflectionParameters..ctor): If this is a generic
9692 method, retrieve and store its type parameters.
9693 (InternalParameters..ctor): Added `TypeParameter[]' argument.
9694 (ReflectionParameters.GenericConstraints): The argument specifies
9695 the type parameter, not the method parameter.
9696 (InternalParameters.GenericConstraints): Likewise.
9698 * generic.cs (TypeParameter.DefineType): Correctly handle
9699 constraints wrt. generic methods in interfaces and their
9702 2004-08-24 Martin Baulig <martin@ximian.com>
9704 * generic.cs (TypeParameter.IsSubclassOf): New public method.
9705 (Constraints.IsSubclassOf): New internal method.
9707 * typemanager.cs (TypeManager.FindMembers): Added special support
9708 for GenericTypeParameterBuilder's.
9709 (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
9712 2004-08-24 Martin Baulig <martin@ximian.com>
9715 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
9716 this for accessibility checks.
9717 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
9718 IsNestedFamilyAccessible.
9719 (TypeManager.IsSubclassOf): New method, do what the name actually
9722 2004-08-24 Martin Baulig <martin@ximian.com>
9724 * expression.cs (MemberAccess.DoResolve): When resolving ourselves
9725 as a SimpleName, include the generic arity.
9727 2004-08-24 Martin Baulig <martin@ximian.com>
9729 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
9730 MethodAttributes.HideBySig for operators.
9732 2004-08-23 Martin Baulig <martin@ximian.com>
9734 Back to the old error reporting system :-)
9736 * report.cs (Message): Removed.
9737 (Report.MessageData, ErrorData, WarningData): Removed.
9738 (Report.Error, Warning): Back to the old system.
9740 2004-08-23 Martin Baulig <martin@ximian.com>
9742 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
9744 * class.cs (TypeContainer.ParentContainer): New public virtual
9745 method; replaces the explicit interface implementation.
9746 (ClassPart.ParentContainer): Override.
9748 2004-08-23 Martin Baulig <martin@ximian.com>
9750 * statement.cs (Switch): Added support for constant switches; see
9751 #59428 or test-285.cs.
9753 2004-08-22 Marek Safar <marek.safar@seznam.cz>
9756 * statement.cs (GetEnumeratorFilter): Removed useless
9757 logic because C# specs is strict. GetEnumerator must be
9760 2004-08-22 Martin Baulig <martin@ximian.com>
9762 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9763 a switch and may break, reset the barrier. Fixes #59867.
9765 2004-08-22 Marek Safar <marek.safar@seznam.cz>
9767 CLS-Compliance speed up (~5% for corlib)
9769 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
9770 New method. Tests container for CLS-Compliant names
9772 * class.cs (TypeContainer.VerifyClsName): New method.
9773 Checks whether container name is CLS Compliant.
9774 (Constructor): Implements IMethodData.
9776 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
9777 low-case table for CLS Compliance test.
9778 (MemberCache.VerifyClsParameterConflict): New method.
9779 Checks method parameters for CS3006 error.
9781 * enum.cs (EnumMember): Is derived from MemberCore.
9782 (Enum.VerifyClsName): Optimized for better performance.
9784 2004-08-06 Marek Safar <marek.safar@seznam.cz>
9786 * report.cs: Renamed Error_T to Error and changed all
9789 2004-08-06 Marek Safar <marek.safar@seznam.cz>
9791 * class.cs (TypeContainer.IndexerArrayList): New inner class
9792 container for indexers.
9793 (TypeContainer.DefaultIndexerName): New constant for default
9794 indexer name. Replaced all "Item" with this constant.
9795 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
9797 * typemanager.cs (TypeManager.default_member_ctor): Cache here
9798 DefaultMemberAttribute constructor.
9800 2004-08-05 Martin Baulig <martin@ximian.com>
9802 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9805 2004-08-05 Marek Safar <marek.safar@seznam.cz>
9807 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
9808 multi platforms problem.
9810 * compiler.csproj: Included shared files.
9812 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9814 Fix bug 60333, 55971 in the more general way
9815 * attribute.cs (Attribute.GetAttributeArgumentExpression):
9816 Added arg_type argument for constant conversion.
9817 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
9819 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9822 * class.cs (TypeContainer ): New inner classes MethodArrayList,
9823 OperatorArrayList, MethodCoreArrayList for typecontainer
9824 containers. Changed class member types to these new types.
9825 (MethodArrayList.DefineMembers): Added test for CS0659.
9827 2004-08-04 Miguel de Icaza <miguel@ximian.com>
9829 * cfold.cs: Synchronize the folding with the code in expression.cs
9830 Binary.DoNumericPromotions for uint operands.
9832 * attribute.cs: Revert patch from Raja, it introduced a regression
9833 while building Blam-1.2.1 (hard to isolate a test case).
9835 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9839 (TypeContainer.Define): Renamed to DefineContainerMembers because of
9841 (MethodCore.parent_method): New member. The method we're overriding
9842 if this is an override method.
9843 (MethodCore.CheckBase): Moved from Method class and made common.
9844 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
9846 (MethodCore.CheckForDuplications): New abstract method. For custom
9847 member duplication search in a container
9848 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
9849 method and its return type.
9850 (Event.conflict_symbol): New member. Symbol with same name in the
9854 (MemberCache.FindMemberWithSameName): New method. The method
9855 is looking for conflict with inherited symbols.
9857 2004-08-04 Martin Baulig <martin@ximian.com>
9859 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9861 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9863 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9865 * report.cs (Message): New enum for better error, warning reference in
9867 (MessageData): New inner abstract class. It generally handles printing of
9868 error and warning messages.
9869 Removed unused Error, Warning, Message methods.
9871 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9873 Fix for cs0592-8.cs test
9875 (Attributable.ValidAttributeTargets): Made public.
9876 (Attribute.ExplicitTarget): New member for explicit target value.
9877 (Attribute.CheckTargets): Now we translate explicit attribute
9878 target to Target here.
9880 2004-08-03 Ben Maurer <bmaurer@ximian.com>
9882 * ecore.cs (MethodGroupExpr): new IsBase property.
9884 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
9886 * delegate.cs (DelegateCreation): store a MethodGroupExpr
9887 rather than an instance expr.
9889 (DelegateCreation.Emit): Use the method group rather than
9890 the instance expression. Also, if you have base.Foo as the
9891 method for a delegate, make sure to emit ldftn, not ldftnvirt.
9893 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
9895 (NewDelegate.DoResolve): Only check for the existance of Invoke
9896 if the method is going to be needed. Use MethodGroupExpr.
9898 (NewDelegate.Emit): Remove, DelegateCreation implements this.
9900 * expression.cs: For pointer arith., make sure to use
9901 the size of the type, not the size of the pointer to
9904 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9907 * class.cs (Class): Added error CS0502 test.
9909 2004-08-03 John Luke <jluke@cfl.rr.com>
9910 Raja R Harinath <rharinath@novell.com>
9913 * attribute.cs (Attribute.complained_before): New flag.
9914 (Attribute.ResolveType, Attribute.Resolve),
9915 (Attribute.DefinePInvokeMethod): Set it.
9916 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
9918 2004-08-03 Martin Baulig <martin@ximian.com>
9920 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9921 use a user-defined operator; we still need to do numeric
9922 promotions in case one argument is a builtin type and the other
9923 one has an implicit conversion to that type. Fixes #62322.
9925 2004-08-18 Martin Baulig <martin@ximian.com>
9927 * class.cs (Method.Define): Use the correct method name when
9928 creating the MethodBuilder for a generic method.
9930 2004-08-17 Martin Baulig <martin@ximian.com>
9932 * generic.cs (Constraints): Support type parameter constraints.
9934 2004-08-16 Martin Baulig <martin@ximian.com>
9936 * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
9937 (Token.GENERIC_DIMENSION): New token; this is returned if we
9938 encounter an unbound generic type in a typeof() expression.
9940 * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
9941 this token is only generated while parsing a typeof() expression.
9942 (typeof_expression): Removed the old unbound_type hack.
9944 * generic.cs (TypeArguments.IsUnbound): New public property.
9946 * decl.cs (MemberName): Added support for unbound types.
9948 2004-08-14 Martin Baulig <martin@ximian.com>
9951 (TypeManager.IsEqualGenericInstance): New static method.
9952 (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
9953 just used to check accessibility, so follow the rules of 26.1.6.
9955 * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
9956 ConstructedType instead of a TypeExpression if we have type arguments.
9958 * cs-parser.jay (typeof_expression): Support unbound generic types.
9960 * ecore.cs (UnboundTypeExpression): New public class.
9962 2004-08-12 Martin Baulig <martin@ximian.com>
9964 * typemanager.cs (TypeManager.IsNestedChildOf): Use
9965 TypeManager.IsEqual() rather than `=='.
9967 * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
9968 generic instances as well.
9970 2004-08-12 Martin Baulig <martin@ximian.com>
9972 * expression.cs (Invocation.InferType): We can only infer method
9973 type parameters. Fixes #62647.
9975 2004-08-11 Martin Baulig <martin@ximian.com>
9977 * class.cs (TypeContainer.DefineType): Create the TypeBuilder
9978 before resolving the base classes.
9980 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9982 * Makefile: install .mdb file too.
9984 2004-08-05 Martin Baulig <martin@ximian.com>
9986 * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
9987 initializer, the current type is just the TypeBuilder, not the
9988 instantiated generic type.
9989 (FieldExpr.IsFieldInitializer): New public property.
9991 2004-08-04 Martin Baulig <martin@ximian.com>
9993 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9995 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9997 2004-08-03 Martin Baulig <martin@ximian.com>
9999 * class.cs (MethodData.Define): If we're an explicit
10000 implementation, remove the generic arity from the type name.
10002 2004-08-03 Martin Baulig <martin@ximian.com>
10004 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
10005 use a user-defined operator; we still need to do numeric
10006 promotions in case one argument is a builtin type and the other
10007 one has an implicit conversion to that type. Fixes #62322.
10009 2004-08-02 Martin Baulig <martin@ximian.com>
10011 * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
10012 `TypeExpr[]' array.
10013 (TypeContainer.GetClassBases): Return the unexpanded list of
10014 interfaces; we expand them later.
10015 (TypeContainer.DefineType): After creating the TypeBuilder, call
10016 TypeManager.ExpandInterfaces() to get an expanded and resolved
10017 list of interfaces.
10019 * ecore.cs (TypeExpr.GetInterfaces): Removed
10021 * generics.cs (Constraints.InterfaceConstraints): Remove.
10022 (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
10023 register the interface constraints.
10026 (TypeManager.AddUserType): Removed the `ifaces' argument.
10027 (TypeManager.AddTypeParameter): Likewise.
10028 (TypeManager.AddUserInterface): Removed, was unused.
10029 (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
10030 `TypeExpr[]' array for the interfaces.
10031 (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
10032 has been defined, returns a list of the resolved interfaces types.
10033 (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
10034 (TypeManager.GetExplicitInterfaces): Likewise.
10036 2004-08-02 Martin Baulig <martin@ximian.com>
10038 * expression.cs (Invocation.EmitCall): If we're invoking a method
10039 on a type parameter, use the new `Constrained' prefix opcode.
10041 2004-08-02 Martin Baulig <martin@ximian.com>
10043 * statement.cs (LocalInfo.Flags): Added `IsThis'.
10044 (LocalInfo.IsThis): New public property.
10045 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
10047 2004-08-01 Martin Baulig <martin@ximian.com>
10049 * class.cs (TypeContainer.GetClassBases): Don't set the default
10050 here since we may get called from GetPartialBases().
10051 (TypeContainer.DefineType): If GetClassBases() didn't return a
10052 parent, use the default one.
10054 2004-07-30 Martin Baulig <martin@ximian.com>
10056 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
10058 * class.cs (SourceMethod): New public class, derive from the
10059 symbol writer's ISourceMethod.
10060 (Method): Use the new symbol writer API.
10062 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
10063 as argument and use the new symbol writer.
10066 (SourceFile): Implement the symbol writer's ISourceFile.
10067 (Location.SymbolDocument): Removed.
10068 (Location.SourceFile): New public property.
10070 * symbolwriter.cs: Use the new symbol writer API.
10072 2004-07-30 Raja R Harinath <rharinath@novell.com>
10074 * Makefile (install-local): Remove. Functionality moved to
10077 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
10079 * Makefile: Install mcs.exe.config file together with mcs.exe.
10080 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
10081 correct runtime version.
10083 2004-07-25 Martin Baulig <martin@ximian.com>
10086 (TypeContainer.RegisterOrder): Removed, this was unused.
10087 (TypeContainer, interface_order): Removed.
10088 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
10089 TypeContainer as argument since we can also be called with a
10090 `PartialContainer' for a partial class/struct/interface.
10091 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
10092 of checking whether we're an `Interface' - we could be a
10093 `PartialContainer'.
10094 (PartialContainer.Register): Override; call
10095 AddClass()/AddStruct()/AddInterface() on our parent.
10097 * cs-parser.jay (interface_member_declaration): Add things to the
10098 `current_container', not the `current_class'.
10100 * rootcontext.cs (RegisterOrder): The overloaded version which
10101 takes an `Interface' was unused, removed.
10103 * typemanager.cs (TypeManager.LookupInterface): Return a
10104 `TypeContainer', not an `Interface'.
10105 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
10106 contain a `PartialContainer' for an interface, so check it's
10107 `Kind' to figure out what it is.
10109 2004-07-25 Martin Baulig <martin@ximian.com>
10111 * class.cs (Class.DefaultTypeAttributes): New public constant.
10112 (Struct.DefaultTypeAttributes): Likewise.
10113 (Interface.DefaultTypeAttributes): Likewise.
10114 (PartialContainer.TypeAttr): Override this and add the
10115 DefaultTypeAttributes.
10117 2004-07-25 Martin Baulig <martin@ximian.com>
10119 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
10120 we can just use the `Parent' field instead.
10122 2004-07-25 Martin Baulig <martin@ximian.com>
10124 * class.cs (TypeContainer.Emit): Renamed to EmitType().
10126 2004-07-25 Martin Baulig <martin@ximian.com>
10128 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
10129 our parts before defining any methods.
10130 (TypeContainer.VerifyImplements): Make this virtual.
10131 (ClassPart.VerifyImplements): Override and call VerifyImplements()
10132 on our PartialContainer.
10134 2004-07-25 Martin Baulig <martin@ximian.com>
10136 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
10138 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
10139 argument, we can just use the `Parent' field instead.
10142 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
10143 (MemberBase.DoDefine): Likewise.
10145 2004-07-24 Martin Baulig <martin@ximian.com>
10147 * decl.cs (MemberCore.Parent): New public field.
10148 (DeclSpace.Parent): Moved to MemberCore.
10150 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
10151 (MemberBase.ctor): Added TypeContainer argument, pass it to our
10153 (FieldBase, Field, Operator): Likewise.
10154 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
10155 (EventField, Event): Likewise.
10157 2004-07-23 Martin Baulig <martin@ximian.com>
10159 * class.cs (PartialContainer): New public class.
10160 (ClassPart): New public class.
10161 (TypeContainer): Added support for partial classes.
10162 (TypeContainer.GetClassBases): Splitted some of the functionality
10163 out into GetNormalBases() and GetPartialBases().
10165 * cs-tokenizer.cs (Token.PARTIAL): New token.
10166 (Tokenizer.consume_identifier): Added some hacks to recognize
10167 `partial', but only if it's immediately followed by `class',
10168 `struct' or `interface'.
10170 * cs-parser.jay: Added support for partial clases.
10172 2004-07-23 Martin Baulig <martin@ximian.com>
10174 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
10175 a `DeclSpace' and also made it readonly.
10176 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
10177 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
10178 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
10180 * cs-parser.jay: Pass the `current_class', not the
10181 `current_container' (at the moment, this is still the same thing)
10182 to a new Method, Property, Event, Indexer or Constructor.
10184 2004-07-23 Martin Baulig <martin@ximian.com>
10186 * cs-parser.jay (CSharpParser): Added a new `current_class' field
10187 and removed the `current_interface' one.
10188 (struct_declaration, class_declaration, interface_declaration):
10189 Set `current_class' to the newly created class/struct/interface;
10190 set their `Bases' and call Register() before parsing their body.
10192 2004-07-23 Martin Baulig <martin@ximian.com>
10194 * class.cs (Kind): New public enum.
10195 (TypeContainer): Made this class abstract.
10196 (TypeContainer.Kind): New public readonly field.
10197 (TypeContainer.CheckDef): New public method; moved here from
10199 (TypeContainer.Register): New public abstract method.
10200 (TypeContainer.GetPendingImplementations): New public abstract
10202 (TypeContainer.GetClassBases): Removed the `is_class' and
10203 `is_iface' parameters.
10204 (TypeContainer.DefineNestedTypes): Formerly known as
10206 (ClassOrStruct): Made this class abstract.
10208 * tree.cs (RootTypes): New public type.
10210 2004-07-20 Martin Baulig <martin@ximian.com>
10212 * tree.cs (Tree.RecordNamespace): Removed.
10213 (Tree.Namespaces): Removed.
10215 * rootcontext.cs (RootContext.IsNamespace): Removed.
10217 * cs-parser.jay (namespace_declaration): Just create a new
10218 NamespaceEntry here.
10220 2004-07-21 Lluis Sanchez Gual <lluis@novell.com>
10222 * Makefile: Install gmcs.exe.config file together with gmcs.exe.
10223 * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
10224 entry to make sure it runs in the correct runtime version.
10226 2004-07-18 Martin Baulig <martin@ximian.com>
10228 * generic.cs (ConstructedType.CheckConstraints): Improved
10229 constraints checking.
10231 2004-07-18 Martin Baulig <martin@ximian.com>
10233 * expression.cs (Invocation.BetterMethod): Call
10234 TypeManager.TypeToCoreType() on all types and removed my previous
10235 hack; we're already doig the right thing here.
10237 2004-07-17 Martin Baulig <martin@ximian.com>
10239 * decl.cs (MemberName.MakeName): Create the "class`1" names here.
10241 2004-07-16 Martin Baulig <martin@ximian.com>
10243 * iterators.cs: Added generics support.
10245 2004-07-16 Martin Baulig <martin@ximian.com>
10247 * iterators.cs: Rewrote this. We're now using one single Proxy
10248 class for both the IEnumerable and the IEnumerator interface and
10249 `Iterator' derives from Class so we can use the high-level API.
10251 * class.cs (TypeContainer.AddIterator): New method.
10252 (TypeContainer.DoDefineType): New protected virtual method, which
10253 is called from DefineType().
10254 (TypeContainer.DoDefineMembers): Call DefineType() and
10255 DefineMembers() on all our iterators.
10256 (TypeContainer.Emit): Call Emit() on all our iterators.
10257 (TypeContainer.CloseType): Call CloseType() on all our iterators.
10259 * codegen.cs (EmitContext.CurrentIterator): New public field.
10261 2004-07-15 Martin Baulig <martin@ximian.com>
10264 (TypeManager.not_supported_exception_type): New type.
10266 2004-07-14 Martin Baulig <martin@ximian.com>
10269 (TypeManager.generic_ienumerable_type): New type.
10270 (TypeManager.generic_ienumerator_type): New type.
10273 (RootContext.interfaces_first_stage): Added
10274 "System.Collections.Generic.IEnumerator`1" and
10275 "System.Collections.Generic.IEnumerable`1".
10277 2004-07-14 Martin Baulig <martin@ximian.com>
10279 * iterators.cs: Use real error numbers.
10281 2004-07-14 Martin Baulig <martin@ximian.com>
10283 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
10284 requires this to be a System.Collection.IEnumerable and not a
10285 class implementing that interface.
10286 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
10288 2004-07-13 Marek Safar <marek.safar@seznam.cz>
10290 * class.cs: Fixed previous fix, it broke some error tests.
10292 2004-07-12 Martin Baulig <martin@ximian.com>
10294 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
10297 2004-07-14 Martin Baulig <martin@ximian.com>
10299 * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
10300 an exclamation mark (!) for the generic arity to reflect the
10301 latest spec changes; ie. use "System.Collections.Generic.IList`1".
10303 2004-07-13 Martin Baulig <martin@ximian.com>
10305 * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
10306 specifiers being part of a type argument.
10308 2004-07-13 Martin Baulig <martin@ximian.com>
10310 * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
10311 name for generic types.
10313 2004-07-13 Martin Baulig <martin@ximian.com>
10315 * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
10318 2004-07-09 Miguel de Icaza <miguel@ximian.com>
10320 * assign.cs (LocalTemporary): Add new argument: is_address,If
10321 `is_address' is true, then the value that we store is the address
10322 to the real value, and not the value itself.
10324 * ecore.cs (PropertyExpr): use the new local temporary
10325 stuff to allow us to handle X.Y += z (where X is a struct)
10327 2004-07-08 Martin Baulig <martin@ximian.com>
10329 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
10330 not always return, just like we're doing in Using.Resolve().
10332 2004-07-07 Miguel de Icaza <miguel@ximian.com>
10334 * cs-parser.jay (fixed_statement): flag this as Pinned.
10336 2004-07-06 Miguel de Icaza <miguel@ximian.com>
10338 * typemanager.cs (TypeManager): Removed MakePinned method, this
10339 mechanism is replaced with the .NET 2.x compatible mechanism of
10340 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
10342 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
10343 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
10344 `IsFixed' property which has a different meaning.
10346 2004-07-02 Raja R Harinath <rharinath@novell.com>
10348 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
10349 visible from inside a nested class, not just the names of the
10350 immediately enclosing class.
10351 Fix for bug #60730.
10353 2004-06-24 Raja R Harinath <rharinath@novell.com>
10355 * expression.cs (BetterConversion): Remove buggy special-case
10356 handling of "implicit constant expression conversions". At this
10357 point, we already know that the conversion is possible -- we're
10358 only checking to see which is better.
10360 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10362 * cs-parser.jay: Added error CS0210 test.
10364 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10366 * cs-parser.jay: Added error CS0134 test.
10368 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10371 * cs-parser.jay: Added error CS0145 test.
10373 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10375 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
10377 2004-06-23 Ben Maurer <bmaurer@ximian.com>
10379 * expression.cs (StackAlloc.Resolve): The argument may not
10380 be a constant; deal with this case.
10382 2004-06-23 Marek Safar <marek.safar@seznam.cz>
10384 * attribute.cs (IndexerName_GetIndexerName): Renamed to
10385 GetIndexerAttributeValue.
10386 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
10388 * class.cs (Indexer.Define): Added error tests for CS0415,
10391 2004-06-23 Miguel de Icaza <miguel@ximian.com>
10393 * attribute.cs (Attribute.Resolve): Keep field code in sync with
10396 2004-06-23 Martin Baulig <martin@ximian.com>
10398 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
10399 neither return nor throw, reset the barrier as well. Fixes #60457.
10401 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
10403 * class.cs : EventAttributes is now set to None by default.
10404 This fixes bug #60459.
10406 2004-06-18 Marek Safar <marek.safar@seznam.cz>
10409 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10410 Don't throw exception but return null (it's sufficient now).
10412 2004-06-18 Marek Safar <marek.safar@seznam.cz>
10414 * typemanager.cs (GetArgumentTypes): Faster implementation.
10416 2004-06-18 Martin Baulig <martin@ximian.com>
10418 * attribute.cs (Attribute.Resolve): Check whether we're an
10419 EmptyCast which a Constant child. Fixes #60333.
10421 2004-06-17 Ben Maurer <bmaurer@ximian.com>
10423 * statement.cs (EmitCollectionForeach): Account for the fact that
10424 not all valuetypes are in areas which we can take the address of.
10425 For these variables, we store to a temporary variable. Also, make
10426 sure that we dont emit a `callvirt' on a valuetype method.
10428 2004-06-15 Marek Safar <marek.safar@seznam.cz>
10430 * expression.cs (StackAlloc.DoReSolve): Added test for
10431 negative parameter (CS0247).
10433 2004-06-15 Marek Safar <marek.safar@seznam.cz>
10436 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
10438 2004-06-15 Marek Safar <marek.safar@seznam.cz>
10441 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
10444 2004-06-14 Marek Safar <marek.safar@seznam.cz>
10446 Fix bug #58254 & cs1555.cs, cs1556.cs
10447 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
10449 2004-06-14 Marek Safar <marek.safar@seznam.cz>
10451 * cs-parser.jay: Added error CS1669 test for indexers.
10453 2004-06-18 Martin Baulig <martin@ximian.com>
10455 * generics.cs (GenericMethod.ctor): Don't take an Attributes
10456 argument. Fixes #60441.
10458 2004-06-16 Ben Maurer <bmaurer@ximian.com>
10459 * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
10460 The name needs to have the actual name of the method in order
10461 for other tests (such as the one in OverloadResolve for Invoke
10462 on a delegate) to work. As well, it does not really help
10463 error reporting because the method group had multiple methods.
10464 * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
10465 Make profiling work.
10467 2004-06-13 Martin Baulig <martin@ximian.com>
10469 * cs-parser.jay: Don't allow generic attributes.
10471 2004-06-13 Martin Baulig <martin@ximian.com>
10473 * class.cs (MemberBase.DoDefineBase): New protected method.
10474 (MemberBase.DoDefine): Compute the `flags' in the new
10475 DoDefineBase() which must be called first.
10476 (Method.Define): Call DoDefineBase() first so we have the flags
10477 when defining the generic method.
10479 * cs-parser.jay (interface_method_declaration): Support generic methods.
10481 2004-06-13 Martin Baulig <martin@ximian.com>
10483 * decl.cs (TypeName): Removed.
10484 (MemberName): Removed TypeName and MemberNow; now we just have
10487 * cs-parser.jay: Don't distinguish between type arguments and type
10488 parameters in the grammar and simplified the rules a bit. The
10489 reduce/reduce conflicts are now gone (except the one we inherited
10492 2004-06-11 Martin Baulig <martin@ximian.com>
10494 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
10495 call this twice: for params and varargs methods.
10497 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10500 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
10502 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10504 * attribute.cs (Attribute.GetValidTargets): Made public.
10507 (AbstractPropertyEventMethod): New class for better code sharing.
10508 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
10510 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
10512 2004-06-09 Martin Baulig <martin@ximian.com>
10514 * cs-parser.jay: Removed a reduce/reduce conflict.
10516 2004-06-03 Martin Baulig <martin@ximian.com>
10518 * generic.cs (ConstructedType.GetMemberAccess): Renamed to
10519 GetSimpleName() and return a SimpleName.
10521 * ecore.cs (SimpleName.Arguments): New public field.
10522 (SimpleName): Added overloaded ctor which takes an additional
10523 TypeArguments argument.
10524 (SimpleName.SimpleNameResolve): Added support for generic methods.
10525 (MethodGroupExpr.ResolveGeneric): New public method. The code was
10526 formerly in MemberAccess.DoResolve(), but we also need it in
10527 SimpleNameResolve().
10529 * expression.cs (MemberAccess.DoResolve): Use the new
10530 MethodGroupExpr.ResolveGeneric().
10532 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10534 * decl.cs: If possible, use lookuptypedirect here. We can only do
10535 this if there is no `.' after the namespace. Avoids using
10536 LookupType, which does lots of slow processing.
10537 (FindNestedType) New method, does what it says :-).
10538 * namespace.cs: use LookupTypeDirect.
10539 * rootcontext.cs: use membercache, if possible.
10540 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10542 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10545 According to the spec,
10547 In a member access of the form E.I, if E is a single identifier,
10548 and if the meaning of E as a simple-name (§7.5.2) is a constant,
10549 field, property, localvariable, or parameter with the same type as
10550 the meaning of E as a type-name (§3.8), then both possible
10551 meanings of E are permitted.
10553 We did not check that E as a simple-name had the same type as E as
10556 This trivial check gives us 5-7% on bootstrap time.
10558 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10560 * expression.cs (Invocation.OverloadResolve): Avoid the
10561 use of hashtables and boxing here by allocating on demand.
10563 2004-05-30 Martin Baulig <martin@ximian.com>
10565 * rootcontext.cs (RootContext.LookupType): Don't cache things if
10566 we're doing a silent lookup. Don't try to lookup nested types in
10567 TypeManager.object_type (thanks to Ben Maurer).
10569 2004-05-30 Martin Baulig <martin@ximian.com>
10571 Committing a patch from Ben Maurer.
10573 * rootcontext.cs (RootContext.LookupType): Cache negative results.
10575 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10577 * convert.cs: add a trivial cache for overload operator resolution.
10579 2004-05-31 Marek Safar <marek.safar@seznam.cz>
10582 (AttributeTester.GetObsoleteAttribute): Returns instance of
10583 ObsoleteAttribute when type is obsolete.
10586 (TypeContainer.VerifyObsoleteAttribute): Override.
10587 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
10588 (MethodCode.VerifyObsoleteAttribute): Override.
10589 (MemberBase.VerifyObsoleteAttribute): Override.
10592 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
10593 and report proper error.
10596 (Delegate.VerifyObsoleteAttribute): Override.
10599 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
10600 and report proper error.
10601 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
10604 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
10608 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
10609 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
10610 Added test for ObsoleteAttribute.
10613 (Catch): Derived from Statement.
10615 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10617 * decl.cs: If possible, use lookuptypedirect here. We can only do
10618 this if there is no `.' after the namespace. Avoids using
10619 LookupType, which does lots of slow processing.
10620 (FindNestedType) New method, does what it says :-).
10621 * namespace.cs: use LookupTypeDirect.
10622 * rootcontext.cs: use membercache, if possible.
10623 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10625 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10628 According to the spec,
10630 In a member access of the form E.I, if E is a single identifier,
10631 and if the meaning of E as a simple-name (§7.5.2) is a constant,
10632 field, property, localvariable, or parameter with the same type as
10633 the meaning of E as a type-name (§3.8), then both possible
10634 meanings of E are permitted.
10636 We did not check that E as a simple-name had the same type as E as
10639 This trivial check gives us 5-7% on bootstrap time.
10641 2004-05-30 Marek Safar <marek.safar@seznam.cz>
10643 Fixed bug #59071 & cs0160.cs
10644 * statement.cs (Try.Resolve): Check here whether order of catch
10645 clauses matches their dependencies.
10647 2004-05-30 Marek Safar <marek.safar@seznam.cz>
10650 * ecore.cs (SimpleName.SimpleNameResolve): Added test for
10653 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10655 * expression.cs (Invocation.OverloadResolve): Avoid the
10656 use of hashtables and boxing here by allocating on demand.
10658 2004-05-30 Martin Baulig <martin@ximian.com>
10660 * rootcontext.cs (RootContext.LookupType): Don't cache things if
10661 we're doing a silent lookup. Don't try to lookup nested types in
10662 TypeManager.object_type (thanks to Ben Maurer).
10664 2004-05-30 Martin Baulig <martin@ximian.com>
10666 Committing a patch from Ben Maurer.
10668 * rootcontext.cs (RootContext.LookupType): Cache negative results.
10670 2004-05-29 Martin Baulig <martin@ximian.com>
10672 * class.cs (IMethodData.ShouldIgnore): New method.
10674 * typemanager.cs (TypeManager.MethodFlags): Don't take a
10675 `Location' argument, we don't need it anywhere. Use
10676 `IMethodData.ShouldIgnore ()' instead of
10677 `MethodData.GetMethodFlags ()'.
10678 (TypeManager.AddMethod): Removed.
10679 (TypeManager.AddMethod2): Renamed to AddMethod.
10681 2004-05-29 Martin Baulig <martin@ximian.com>
10683 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
10685 * convert.cs (Convert.ImplicitReferenceConversion): If we're
10686 converting from a class type S to an interface type and we already
10687 have an object on the stack, don't box it again. Fixes #52578.
10689 2004-05-29 Martin Baulig <martin@ximian.com>
10691 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10692 Added support for `params' parameters. Fixes #59267.
10694 2004-05-29 Martin Baulig <martin@ximian.com>
10696 * literal.cs (NullPointer): Provide a private .ctor which sets
10697 `type' to TypeManager.object_type. Fixes #59048.
10699 2004-05-29 Martin Baulig <martin@ximian.com>
10701 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
10702 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
10704 * ecore.cs (EventExpr.instance_expr): Make the field private.
10706 2004-05-26 Marek Safar <marek.safar@seznam.cz>
10708 Fixed bug #50080 & cs0214-2.cs
10709 * expression.cs (Cast.DoResolve): Check unsafe context here.
10711 * statement.cs (Resolve.DoResolve): Likewise.
10713 2004-05-26 Martin Baulig <martin@ximian.com>
10715 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
10717 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
10718 (RootContext.LookupType): Pass down the `silent' flag.
10720 2004-05-25 Martin Baulig <martin@ximian.com>
10723 (MethodGroupExpr.IdenticalTypeName): New public property.
10724 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
10725 expression actually refers to a type.
10727 2004-05-25 Martin Baulig <martin@ximian.com>
10729 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
10730 for #56176 and made it actually work.
10732 2004-05-25 Martin Baulig <martin@ximian.com>
10734 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
10735 (FieldExpr, PropertyExpr): Override and implement
10736 CacheTemporaries. Fixes #52279.
10738 2004-05-25 Miguel de Icaza <miguel@ximian.com>
10740 * location.cs: In the new compiler listing a file twice is a
10741 warning, not an error.
10743 2004-05-24 Martin Baulig <martin@ximian.com>
10745 * enum.cs (Enum.DefineType): For the `BaseType' to be a
10746 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
10748 2004-05-24 Martin Baulig <martin@ximian.com>
10750 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
10751 walking the `using' list. Fixes #53921.
10753 2004-05-24 Martin Baulig <martin@ximian.com>
10755 * const.cs (Const.LookupConstantValue): Added support for
10756 EmptyCast's; fixes #55251.
10758 2004-05-24 Martin Baulig <martin@ximian.com>
10760 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
10761 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
10762 which does the CS0135 check. The reason is that we first need to
10763 check whether the variable actually exists.
10765 2004-05-24 Martin Baulig <martin@ximian.com>
10767 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
10768 than RootContext.LookupType() to find the explicit interface
10769 type. Fixes #58584.
10771 2004-05-24 Raja R Harinath <rharinath@novell.com>
10773 * Makefile: Simplify. Use executable.make.
10774 * mcs.exe.sources: New file. List of sources of mcs.exe.
10776 2004-05-24 Anders Carlsson <andersca@gnome.org>
10780 Use the invariant culture when doing String.Compare for CLS case
10783 2004-05-23 Martin Baulig <martin@ximian.com>
10785 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
10786 don't have any dots. Fixes #52622, added cs0246-8.cs.
10788 * namespace.cs (NamespaceEntry.Lookup): Likewise.
10790 2004-05-23 Marek Safar <marek.safar@seznam.cz>
10792 * class.cs (MemberBase.Define): Reuse MemberType member for
10793 resolved type. Other methods can use it too.
10795 2004-05-23 Martin Baulig <martin@ximian.com>
10797 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
10798 the variable also exists in the current block (otherwise, we need
10799 to report a CS0103). Fixes #58670.
10801 2004-05-23 Martin Baulig <martin@ximian.com>
10803 * flowanalysis.cs (Reachability.Reachable): Compute this
10804 on-the-fly rather than storing it as a field.
10806 2004-05-23 Martin Baulig <martin@ximian.com>
10808 * flowanalysis.cs (Reachability.And): Manually compute the
10809 resulting `barrier' from the reachability.
10811 2004-05-23 Marek Safar <marek.safar@seznam.cz>
10814 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
10815 instance of ObsoleteAttribute when symbol is obsolete.
10818 (IMethodData): Extended interface for ObsoleteAttribute support.
10820 2004-05-22 Marek Safar <marek.safar@seznam.cz>
10822 * attribute.cs: Fix bug #55970
10824 2004-05-22 Marek Safar <marek.safar@seznam.cz>
10828 (GetObsoleteAttribute): New method. Creates the instance of
10830 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
10831 ObsoleteAttribute when member is obsolete.
10832 (AttributeTester.Report_ObsoleteMessage): Common method for
10833 Obsolete error/warning reporting.
10836 (TypeContainer.base_classs_type): New member for storing parent type.
10839 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
10840 for this MemberCore.
10842 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10844 * attribute.cs, const.cs: Fix bug #58590
10846 2004-05-21 Martin Baulig <martin@ximian.com>
10848 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
10849 out parameters if the end of the method is unreachable. Fixes
10852 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10854 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
10855 Hari was right, why extra method.
10857 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10859 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
10861 2004-05-20 Martin Baulig <martin@ximian.com>
10863 * delegate.cs: Convert this file to Unix mode - like the original
10866 2004-05-20 Martin Baulig <martin@ximian.com>
10868 * attribute.cs: Convert this file to Unix mode - like the original
10871 2004-05-19 Marek Safar <marek.safar@seznam.cz>
10873 Fix bug #58688 (MCS does not report error when the same attribute
10876 * attribute.cs (Attribute.Emit): Distinction between null and default.
10878 2004-05-19 Raja R Harinath <rharinath@novell.com>
10880 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
10881 of a top-level attribute without an attribute target.
10882 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
10884 (Attribute.Conditional_GetConditionName),
10885 (Attribute.Obsolete_GetObsoleteMessage): Update.
10886 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
10887 part of ScanForIndexerName.
10888 (Attribute.CanIgnoreInvalidAttribute): New function.
10889 (Attribute.ScanForIndexerName): Move to ...
10890 (Attributes.ScanForIndexerName): ... here.
10891 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
10892 (Attributes.Search): New internal variant that can choose not to
10893 complain if types aren't resolved. The original signature now
10895 (Attributes.GetClsCompliantAttribute): Use internal variant, with
10896 complaints suppressed.
10897 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
10898 only if it not useful.
10899 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
10900 top-level for attributes that are shared between the assembly
10901 and a top-level class.
10902 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
10903 * class.cs: Update to reflect changes.
10904 (DefineIndexers): Fuse loops.
10905 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
10906 a couple more variants of attribute names.
10908 2004-05-18 Marek Safar <marek.safar@seznam.cz>
10910 Fix bug #52585 (Implemented explicit attribute declaration)
10913 (Attributable.ValidAttributeTargets): New abstract method. It gets
10914 list of valid attribute targets for explicit target declaration.
10915 (Attribute.Target): It holds target itself.
10916 (AttributeSection): Removed.
10917 (Attribute.CheckTargets): New method. It checks whether attribute
10918 target is valid for the current element.
10921 (EventProperty): New class. For events that are declared like
10922 property (with add and remove accessors).
10923 (EventField): New class. For events that are declared like field.
10926 * cs-parser.jay: Implemented explicit attribute target declaration.
10928 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
10929 Override ValidAttributeTargets.
10932 (ReturnParameter): Class for applying custom attributes on
10934 (ParameterAtribute): New class. Class for applying custom
10935 attributes on the parameter type.
10937 2004-05-17 Miguel de Icaza <miguel@ximian.com>
10939 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
10942 (Method): Allow UNSAFE here.
10944 * modifiers.cs: Support unsafe reporting.
10946 2004-05-17 Marek Safar <marek.safar@seznam.cz>
10948 * decl.cs: Fix bug #58478.
10950 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10952 * statement.cs: When checking for unreachable code on an EmptyStatement,
10953 set the location. Fixes bug #58488.
10955 2004-05-13 Miguel de Icaza <miguel@ximian.com>
10957 * driver.cs: Add -pkg handling.
10959 From Gonzalo: UseShelLExecute=false
10961 2004-05-12 Marek Safar <marek.safar@seznam.cz>
10964 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
10966 (Attribute.IsClsCompliaceRequired): Moved to base for better
10968 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
10969 when attribute is AttributeUsageAttribute.
10970 (Attribute.GetValidTargets): Simplified.
10971 (Attribute.GetAttributeUsage): New method returns AttributeUsage
10972 attribute for this type.
10973 (Attribute.ApplyAttributes): Method renamed to Emit and make
10975 (GlobalAttributeSection): New class for special handling of global
10976 attributes (assembly, module).
10977 (AttributeSection.Emit): New method.
10979 * class.cs: Implemented Attributable abstract methods.
10980 (MethodCore.LabelParameters): Moved to Parameter class.
10981 (Accessor): Is back simple class.
10982 (PropertyMethod): Implemented Attributable abstract class.
10983 (DelegateMethod): Implemented Attributable abstract class.
10984 (Event): New constructor for disctintion between normal Event
10985 and Event with accessors.
10987 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
10989 * codegen.cs, const.cs, decl.cs, delegate.cs:
10990 (CommonAssemblyModulClass): Implemented Attributable abstract class
10993 * enum.cs: Implement IAttributeSupport interface.
10994 (EnumMember): New class for emum members. Implemented Attributable
10998 (ParameterBase): Is abstract.
10999 (ReturnParameter): New class for easier [return:] attribute handling.
11001 * typemanager.cs: Removed builder_to_attr.
11003 2004-05-11 Raja R Harinath <rharinath@novell.com>
11006 * attribute.cs (Attribute.GetPositionalValue): New function.
11007 * class.cs (TypeContainer.VerifyMembers): New function.
11008 (TypeContainer.Emit): Use it.
11009 (ClassOrStruct): New base class for Class and Struct.
11010 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
11011 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
11013 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
11014 then each non-static field should have a FieldOffset attribute.
11015 Otherwise, none of the fields should have a FieldOffset attribute.
11016 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
11017 and FieldOffset attributes.
11018 * typemanager.cs (TypeManager.struct_layout_attribute_type)
11019 (TypeManager.field_offset_attribute_type): New core types.
11020 (TypeManager.InitCoreTypes): Initialize them.
11022 2004-05-11 Michal Moskal <malekith@pld-linux.org>
11024 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
11025 Return correct type.
11028 2004-05-09 Miguel de Icaza <miguel@ximian.com>
11030 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
11031 be implicitly converted to ulong.
11033 * expression.cs: The logic for allowing operator &, | and ^ worked
11034 was wrong, it worked before because we did not report an error in
11035 an else branch. Fixes 57895.
11037 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
11038 allow volatile fields to be reference types.
11040 2004-05-07 Miguel de Icaza <miguel@ximian.com>
11042 * driver.cs: Add support for /debug-
11044 2004-05-07 Raja R Harinath <rharinath@novell.com>
11046 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
11047 Add a 'complain' parameter to silence errors.
11048 (Attribute.Resolve): Update to changes. Put in sanity check to catch
11049 silently overlooked type-resolutions.
11050 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
11051 to reflect changes.
11052 (Attributes.Search): New function.
11053 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
11054 (Attributes.GetAttributeFullName): Remove hack.
11055 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
11056 Update to reflect changes.
11057 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11058 Use Attributes.Search instead of nested loops.
11060 2004-05-07 Marek Safar <marek.safar@seznam.cz>
11063 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
11064 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
11065 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
11067 * report.cs: (Report.Warning): Renamed to Warning_T because of
11068 parameter collision.
11070 2004-05-05 Raja R Harinath <rharinath@novell.com>
11072 * expression.cs (MemberAccess.ResolveMemberAccess):
11073 Exit with non-zero status after Report.Error.
11074 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
11076 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
11078 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
11080 * support.cs: Don't hang when the file is empty.
11082 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
11084 * support.cs: In SeekableStreamReader, compute the preamble size of the
11085 underlying stream. Position changes should take into account that initial
11088 2004-05-03 Todd Berman <tberman@sevenl.net>
11090 * driver.cs: remove unused GetSysVersion function.
11092 2004-05-03 Todd Berman <tberman@sevenl.net>
11094 * driver.cs: Remove the hack from saturday, as well as the hack
11095 from jackson (LoadAssemblyFromGac), also adds the CWD to the
11096 link_paths to get that bit proper.
11098 2004-05-01 Todd Berman <tberman@sevenl.net>
11100 * driver.cs: Try a LoadFrom before a Load, this checks the current
11101 path. This is currently a bug in mono that is be fixed, however, this
11102 provides a workaround for now. This will be removed when the bug
11105 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
11107 * CryptoConvert.cs: Updated to latest version. Fix issue with
11108 incomplete key pairs (#57941).
11110 2004-05-01 Todd Berman <tberman@sevenl.net>
11112 * driver.cs: Remove '.' from path_chars, now System.* loads properly
11115 2004-04-30 Jackson Harper <jackson@ximian.com>
11117 * codegen.cs: Open keys readonly.
11119 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11121 * typemanager.cs: don't report cyclic struct layout when a struct
11122 contains 2 or more fields of the same type. Failed for Pango.AttrShape
11123 which has 2 Pango.Rectangle fields.
11125 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
11127 * expression.cs: Handle IntPtr comparisons with IL code
11128 rather than a method call.
11130 2004-04-29 Martin Baulig <martin@ximian.com>
11132 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
11133 the list of PropertyInfo's in class hierarchy and find the
11134 accessor. Fixes #56013.
11136 2004-04-29 Martin Baulig <martin@ximian.com>
11138 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
11140 2004-04-29 Martin Baulig <martin@ximian.com>
11142 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11144 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
11146 2004-04-29 Martin Baulig <martin@ximian.com>
11148 * class.cs (ConstructorInitializer.Resolve): Check whether the
11149 parent .ctor is accessible. Fixes #52146.
11151 2004-04-29 Martin Baulig <martin@ximian.com>
11153 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11155 * statement.cs (Using.EmitLocalVariableDecls): Use
11156 TypeManager.idisposable_type, not typeof (IDisposable).
11157 (Foreach.EmitCollectionForeach): Added support for valuetypes.
11159 2004-04-29 Martin Baulig <martin@ximian.com>
11161 * class.cs (Event.Define): Don't emit the field and don't set
11162 RTSpecialName and SpecialName for events on interfaces. Fixes
11165 2004-04-29 Raja R Harinath <rharinath@novell.com>
11167 Refactor Attribute.ApplyAttributes.
11168 * attribute.cs (Attributable): New base class for objects that can
11169 have Attributes applied on them.
11170 (Attribute): Make AttributeUsage fields public.
11171 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
11172 (Attribute.IsInternalCall): New property.
11173 (Attribute.UsageAttr): Convert to a public read-only property.
11174 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
11175 (Attribute.ResolveType, Attribute.Resolve)
11176 (Attribute.ScanForIndexerName): Update to reflect changes.
11177 (Attribute.CheckAttributeTarget): Re-format.
11178 (Attribute.ApplyAttributes): Refactor, to various
11179 Attributable.ApplyAttributeBuilder methods.
11180 * decl.cs (MemberCore): Make Attributable.
11181 * class.cs (Accessor): Make Attributable.
11182 (MethodData.ApplyAttributes): Use proper attribute types, not
11184 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
11185 (TypeContainer.ApplyAttributeBuilder)
11186 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
11187 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
11188 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
11189 (Operator.ApplyAttributeBuilder): New factored-out methods.
11190 * const.cs (Const.ApplyAttributeBuilder): Likewise.
11191 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
11192 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
11193 * parameter.cs (ParameterBase): New Attributable base class
11194 that can also represent Return types.
11195 (Parameter): Update to the changes.
11197 2004-04-29 Jackson Harper <jackson@ximian.com>
11199 * driver.cs: Prefer the corlib system version when looking for
11200 assemblies in the GAC. This is still a hack, but its a better hack
11203 2004-04-29 Marek Safar <marek.safar@seznam.cz>
11205 * decl.cs, enum.cs: Improved error 3005 reporting.
11207 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
11208 (related_symbols): New private member for list of symbols
11209 related to reported error/warning.
11211 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
11213 2004-04-29 Martin Baulig <martin@ximian.com>
11215 * ecore.cs (Expression.Constantify): If we're an enum and
11216 TypeManager.TypeToCoreType() doesn't give us another type, use
11217 t.UnderlyingSystemType. Fixes #56178.
11219 2004-04-29 Martin Baulig <martin@ximian.com>
11221 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
11222 interfaces and for each interface, only add members directly
11223 declared in that interface. Fixes #53255.
11225 2004-04-28 Martin Baulig <martin@ximian.com>
11227 * expression.cs (ConditionalLogicalOperator): Use a temporary
11228 variable for `left' to avoid that we evaluate it more than once;
11231 2004-04-28 Martin Baulig <martin@ximian.com>
11233 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
11236 2004-04-28 Martin Baulig <martin@ximian.com>
11238 * statement.cs (LocalInfo.Resolve): Check whether the type is not
11241 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
11242 whether the type is not void (CS1547).
11244 2004-04-28 Martin Baulig <martin@ximian.com>
11246 * expression.cs (Unary.DoResolveLValue): Override this and report
11247 CS0131 for anything but Operator.Indirection.
11249 2004-04-28 Martin Baulig <martin@ximian.com>
11251 Committing a patch from Ben Maurer; see bug #50820.
11253 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11256 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11259 2004-04-28 Martin Baulig <martin@ximian.com>
11261 Committing a patch from Ben Maurer; see bug #50820.
11263 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11266 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11269 2004-04-28 Martin Baulig <martin@ximian.com>
11271 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
11272 (Block.AddLabel): Call DoLookupLabel() to only search in the
11275 2004-04-28 Martin Baulig <martin@ximian.com>
11277 * cfold.cs (ConstantFold.BinaryFold): Added special support for
11278 comparing StringConstants and NullLiterals in Equality and Inequality.
11280 2004-04-28 Jackson Harper <jackson@ximian.com>
11282 * driver.cs: Attempt to load referenced assemblies from the
11283 GAC. This is the quick and dirty version of this method that
11284 doesnt take into account versions and just takes the first
11285 canidate found. Will be good enough for now as we will not have more
11286 then one version installed into the GAC until I update this method.
11288 2004-04-28 Martin Baulig <martin@ximian.com>
11290 * typemanager.cs (TypeManager.CheckStructCycles): New public
11291 static method to check for cycles in the struct layout.
11293 * rootcontext.cs (RootContext.PopulateTypes): Call
11294 TypeManager.CheckStructCycles() for each TypeContainer.
11295 [Note: We only need to visit each type once.]
11297 2004-04-28 Martin Baulig <martin@ximian.com>
11299 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
11301 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
11302 success and added `out object value'. Use a `bool resolved' field
11303 to check whether we've already been called rather than
11304 `ConstantValue != null' since this breaks for NullLiterals.
11306 2004-04-28 Raja R Harinath <rharinath@novell.com>
11308 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
11309 setting of this flag, since the 'set' method may be non-public.
11311 2004-04-28 Raja R Harinath <rharinath@novell.com>
11313 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
11314 check on current_vector.Block.
11316 2004-04-27 Martin Baulig <martin@ximian.com>
11318 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
11319 a field initializer. Fixes #56459.
11321 2004-04-27 Martin Baulig <martin@ximian.com>
11323 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
11324 we're not attempting to use an indexer. Fixes #52154.
11326 2004-04-27 Martin Baulig <martin@ximian.com>
11328 * statement.cs (Return): Don't create a return label if we don't
11329 need it; reverts my change from January 20th. Thanks to Ben
11332 2004-04-27 Martin Baulig <martin@ximian.com>
11334 According to the spec, `goto' can only leave a nested scope, but
11337 * statement.cs (Block.LookupLabel): Only lookup in the current
11338 block, don't recurse into parent or child blocks.
11339 (Block.AddLabel): Check in parent and child blocks, report
11340 CS0140/CS0158 if we find a duplicate.
11341 (Block): Removed this indexer for label lookups.
11342 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
11343 this already does the error reporting for us.
11346 (FlowBranching.UsageVector.Block): New public variable; may be null.
11347 (FlowBranching.CreateSibling): Added `Block' argument.
11348 (FlowBranching.LookupLabel): New public virtual method. Lookup a
11349 label for the target of a `goto' and check whether we're not
11350 leaving a `finally'.
11352 2004-04-27 Martin Baulig <martin@ximian.com>
11354 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11355 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
11358 2004-04-27 Martin Baulig <martin@ximian.com>
11360 * statement.cs (Block.AddLabel): Also check for implicit blocks
11361 and added a CS0158 check.
11363 2004-04-27 Martin Baulig <martin@ximian.com>
11365 * flowanalysis.cs (FlowBranchingLoop): New class.
11366 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
11367 UsageVector's instead of an ArrayList.
11368 (FlowBranching.Label): Likewise.
11369 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
11370 (FlowBranching.AddBreakVector): New method.
11372 2004-04-27 Miguel de Icaza <miguel@ximian.com>
11374 * attribute.cs: Small regression fix: only convert the type if we
11375 the type is different, fixes System.Drawing build.
11377 2004-04-27 Martin Baulig <martin@ximian.com>
11379 * attribute.cs (Attribute.Resolve): If we have a constant value
11380 for a named field or property, implicity convert it to the correct
11383 2004-04-27 Raja R Harinath <rharinath@novell.com>
11385 * statement.cs (Block.Block): Implicit blocks share
11386 'child_variable_names' fields with parent blocks.
11387 (Block.AddChildVariableNames): Remove.
11388 (Block.AddVariable): Mark variable as "used by a child block" in
11389 every surrounding block.
11390 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
11391 been used in a child block, complain about violation of "Invariant
11392 meaning in blocks" rule.
11393 * cs-parser.jay (declare_local_variables): Don't use
11394 AddChildVariableNames.
11395 (foreach_statement): Don't create an implicit block: 'foreach'
11396 introduces a scope.
11398 2004-04-23 Miguel de Icaza <miguel@ximian.com>
11400 * convert.cs (ImplicitNumericConversion): 0 is also positive when
11401 converting from 0L to ulong. Fixes 57522.
11403 2004-04-22 Marek Safar <marek.safar@seznam.cz>
11405 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
11406 derived class hides via 'new' keyword field from base class (test-242.cs).
11407 TODO: Handle this in the more general way.
11409 * class.cs (CheckBase): Ditto.
11411 2004-04-22 Marek Safar <marek.safar@seznam.cz>
11413 * decl.cs (caching_flags): New member for storing cached values
11415 (MemberCore.Flags): New enum where bit flags for caching_flags
11417 (MemberCore.cls_compliance): Moved to caching_flags.
11418 (DeclSpace.Created): Moved to caching_flags.
11420 * class.cs: Use caching_flags instead of DeclSpace.Created
11422 2004-04-21 Miguel de Icaza <miguel@ximian.com>
11424 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
11425 if we are only a derived class, not a nested class.
11427 * typemanager.cs: Same as above, but do this at the MemberLookup
11428 level (used by field and methods, properties are handled in
11429 PropertyExpr). Allow for the qualified access if we are a nested
11432 2004-04-21 Marek Safar <marek.safar@seznam.cz>
11434 * class.cs: Refactoring.
11435 (IMethodData): New inteface; Holds links to parent members
11436 to avoid member duplication (reduced memory allocation).
11437 (Method): Implemented IMethodData interface.
11438 (PropertyBase): New inner classes for get/set methods.
11439 (PropertyBase.PropertyMethod): Implemented IMethodData interface
11440 (Event): New inner classes for add/remove methods.
11441 (Event.DelegateMethod): Implemented IMethodData interface.
11443 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
11444 EmitContext (related to class.cs refactoring).
11446 2004-04-21 Raja R Harinath <rharinath@novell.com>
11448 * delegate.cs (Delegate.VerifyApplicability): If the number of
11449 arguments are the same as the number of parameters, first try to
11450 verify applicability ignoring any 'params' modifier on the last
11454 2004-04-08 Martin Baulig <martin@ximian.com>
11456 Merged latest changes into gmcs. Please keep this comment in
11457 here, it makes it easier for me to see what changed in MCS since
11458 the last time I merged.
11460 2004-04-16 Raja R Harinath <rharinath@novell.com>
11462 * class.cs (TypeContainer.AddIndexer): Use
11463 'ExplicitInterfaceName' to determine if interface name was
11464 explicitly specified. 'InterfaceType' is not initialized at this time.
11465 (TypeContainer.DefineIndexers): Remove use of temporary list. The
11466 Indexers array is already in the required order. Initialize
11467 'IndexerName' only if there are normal indexers.
11468 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
11469 (TypeContainer.Emit): Emit DefaultMember attribute only if
11470 IndexerName is initialized.
11473 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
11475 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
11478 2004-04-15 Raja R Harinath <rharinath@novell.com>
11480 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
11484 * attribute.cs (Attribute.Resolve): Check for duplicate named
11488 2004-04-15 Miguel de Icaza <miguel@ximian.com>
11490 * iterators.cs (MarkYield): track whether we are in an exception,
11491 and generate code accordingly. Use a temporary value to store the
11492 result for our state.
11494 I had ignored a bit the interaction of try/catch with iterators
11495 since their behavior was not entirely obvious, but now it is
11496 possible to verify that our behavior is the same as MS .NET 2.0
11500 2004-04-14 Miguel de Icaza <miguel@ximian.com>
11502 * iterators.cs: Avoid creating temporaries if there is no work to
11505 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
11506 Enumerations, use TypeManager.EnumToUnderlying and call
11509 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
11512 (This.Emit): Use EmitContext.EmitThis to emit our
11515 (This.EmitAssign): Ditto.
11517 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
11518 codepaths, we will move all the functionality into
11521 (FieldExpr.EmitAssign): Ditto.
11523 This fixes several hidden bugs that I uncovered while doing a code
11524 review of this today.
11526 * codegen.cs (EmitThis): reworked so the semantics are more clear
11527 and also support value types "this" instances.
11529 * iterators.cs: Changed so that for iterators in value types, we
11530 do not pass the value type as a parameter.
11532 Initialization of the enumerator helpers is now done in the caller
11533 instead of passing the parameters to the constructors and having
11534 the constructor set the fields.
11536 The fields have now `assembly' visibility instead of private.
11538 2004-04-11 Miguel de Icaza <miguel@ximian.com>
11540 * expression.cs (Argument.Resolve): Check if fields passed as ref
11541 or out are contained in a MarshalByRefObject.
11543 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
11544 another compiler type.
11546 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
11548 * class.cs (Indexer.Define): use the new name checking method.
11549 Also, return false on an error.
11550 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
11551 (is_identifier_[start/part]_character): make static.
11553 2004-04-10 Miguel de Icaza <miguel@ximian.com>
11555 * expression.cs (Binary.ResolveOperator): Do no append strings
11556 twice: since we can be invoked more than once (array evaluation)
11557 on the same concatenation, take care of this here. Based on a fix
11558 from Ben (bug #56454)
11560 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
11562 * codegen.cs: Fix another case where CS1548 must be reported (when
11563 delay-sign isn't specified and no private is available #56564). Fix
11564 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
11565 error when MCS is used on the MS runtime and we need to delay-sign
11566 (which seems unsupported by AssemblyBuilder - see #56621).
11568 2004-04-08 Marek Safar <marek.safar@seznam.cz>
11570 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
11571 (TypeManager.ComputeNamespaces): Faster implementation for
11574 * compiler.csproj: Updated AssemblyName to mcs.
11576 2004-05-11 Jackson Harper <jackson@ximian.com>
11578 * Makefile: Preserve MONO_PATH
11580 2004-05-11 Jackson Harper <jackson@ximian.com>
11582 * Makefile: Use mono and mcs to build gmcs
11584 2004-05-03 Miguel de Icaza <miguel@ximian.com>
11586 * codegen.cs: Add patch from Robert Shade
11587 <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
11590 2004-05-02 Sebastien Pouliot <sebastien@ximian.com>
11592 * CryptoConvert.cs: Updated to latest version. Fix issue with
11593 incomplete key pairs (#57941).
11595 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
11597 * codegen.cs: Fix another case where CS1548 must be reported (when
11598 delay-sign isn't specified and no private is available #56564). Fix
11599 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
11600 error when MCS is used on the MS runtime and we need to delay-sign
11601 (which seems unsupported by AssemblyBuilder - see #56621).
11603 2004-04-29 Jackson Harper <jackson@ximian.com>
11605 * Makefile: Set MONO_PATH to use the bootstrap corlib
11606 * driver.cs: Check the GAC for referenced assemblies.
11608 2004-04-29 Martin Baulig <martin@ximian.com>
11610 * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
11612 2004-04-07 Martin Baulig <martin@ximian.com>
11614 * expression.cs (Binary.ResolveOperator): Added special case for
11615 Equality/Inequality between a type parameter and a null literal.
11617 2004-04-07 Martin Baulig <martin@ximian.com>
11619 * convert.cs: Check null literal -> type parameter conversions.
11621 2004-04-07 Martin Baulig <martin@ximian.com>
11623 * generic.cs (ConstructedType.CheckConstraints): Enforce the
11624 `class' and `struct' constraints.
11626 2004-04-07 Martin Baulig <martin@ximian.com>
11628 * generic.cs (SpecialConstraint): New public enum.
11629 (Constraints.Resolve): Added support for the `class' and `struct'
11632 * cs-parser.jay (type_parameter_constraint): Added support for the
11633 `class' and `struct' constraints.
11635 2004-04-07 Martin Baulig <martin@ximian.com>
11637 * support.cs (GenericConstraints): Replaced `Types' by
11638 `ClassConstraint' and `InterfaceConstraints'; added
11639 `HasClassConstraint'.
11641 2004-04-07 Martin Baulig <martin@ximian.com>
11644 (Constraints.InterfaceConstraints): New public property.
11645 (Constraints.Types): Make this property public
11646 (TypeParameter): Implement IMemberContainer.
11647 (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
11648 instead of a TypeBuilder/MethodBuilder; pass the interface
11649 constraints to TypeManager.AddTypeParameter().
11650 (TypeParameter.DefineType): Just take an EmitContext and no
11651 TypeBuilder/MethodBuilder. Use the new public API.
11653 * typemanager.cs (TypeManager.AddTypeParameter): Added
11654 `TypeExpr[]' argument; add the interfaces to the
11655 `builder_to_ifaces' hash.
11656 (TypeManager.LookupMemberContainer): For
11657 GenericTypeParameterBuilders, get the TypeParameter from the
11658 `builder_to_type_param'.
11659 (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
11660 the TypeParameter and call FindMembers on it.
11662 2004-04-07 Martin Baulig <martin@ximian.com>
11665 (MethodCore.GenericMethod): Moved this field here from Method.
11666 (MethodCore.IsDuplicateImplementation): Take the number of type
11667 parameters into account if we're a generic method.
11669 * expression.cs (Invocation.InferTypeArguments): Don't return true
11670 if `arguments' is null; we still need to check whether we actually
11671 don't need to infer anything in this case.
11672 (MemberAccess): Merged the functionality from GenericMemberAccess
11675 * generic.cs (GenericMemberAccess): Removed.
11677 2004-04-05 Martin Baulig <martin@ximian.com>
11679 * decl.cs (MemberCore): For generic classes, interfaces and
11680 structs, `Name' now includes the number of type parameters
11681 ("Stack!1.Node!1").
11682 (DeclSpace.FindType): Removed the `num_type_args' argument; we now
11683 encode the number of type arguments in the type name.
11685 * expression.cs (Expression.MemberLookup): Removed the
11686 `num_type_args' argument; we now encode the number of type
11687 arguments in the type name.
11689 * ecore.cs (SimpleName): Encode the number of type arguments in
11690 the type name itself.
11692 * generic.cs (ConstructedType): Likewise.
11694 * tree.cs (Tree.RecordDecl): Take a `string' instead of a
11695 `MemberName'; we now include the number of type parameters in the
11698 * typemanager.cs (TypeManager.CheckGeneric): Removed.
11699 (TypeManager.MemberLookup): Removed the
11700 `num_type_args' argument; we now encode the number of type
11701 arguments in the type name.
11703 2004-04-03 Martin Baulig <martin@ximian.com>
11705 * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
11706 (MemberCore.MemberName): Moved here from MemberBase.
11707 (DeclSpace.SetParameterInfo): Just take the constraints as an
11708 ArrayList; we already have the type parameters in our
11709 `MemberName'; also do the CS0080 reporting here.
11711 * cs-parser.jay (struct_declaration): Use `member_name' instead of
11712 `IDENTIFIER opt_type_parameter_list'; when constructing our
11713 `MemberName', it'll already include our type parameters.
11714 (class_declaration, interface_declaration): Likewise.
11715 (delegate_declaration): Likewise.
11716 (MakeName): Take a MemberName and return a MemberName.
11717 The following two changes are required to avoid shift/reduce conflicts:
11718 (member_name): Don't include a TypeName anymore; ie. this is now
11719 just 'IDENTIFIER opt_type_parameter_list'.
11720 (property_declaration, event_declaration): Use a
11721 `namespace_or_type_name' instead of a `member_name'.
11723 2004-04-03 Martin Baulig <martin@ximian.com>
11725 * decl.cs (MemberName): Renamed to `TypeName' and created a new
11726 `MemberName' class.
11727 (TypeName): Formerly known as MemberName.
11729 * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
11730 instead of a `MemberName'.
11732 * cs-parser.jay (namespace_or_type_name): Create a TypeName.
11733 (member_name): New rule; create a MemberName.
11735 2004-04-02 Martin Baulig <martin@ximian.com>
11737 * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
11738 (CS0305 and CS0308).
11740 2004-04-02 Martin Baulig <martin@ximian.com>
11742 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
11743 support for nested types.
11745 2004-04-02 Martin Baulig <martin@ximian.com>
11747 * ecore.cs (IAlias): New public interface.
11748 (TypeExpr, TypeExpression): Implement IAlias.
11749 (TypeAliasExpression): New public class.
11751 * namespace.cs (Namespace): Implement IAlias.
11752 (Namespace.Lookup): Return an IAlias instead on an object.
11753 (Namespace.DefineName): Take an IAlias instead of an object.
11754 (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
11756 (NamespaceEntry.UsingAlias): Take a Membername instead of an
11758 (NamespaceEntry.LookupAlias): Return an IAlias instead on an
11760 (NamespaceEntry.Lookup): Likewise.
11762 * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
11765 * decl.cs (DeclSpace): Implement IAlias.
11766 (DeclSpace.LookupAlias): Return an IAlias instead of a string.
11768 * generic.cs (ConstructedType): Improved error checking.
11770 2004-04-02 Martin Baulig <martin@ximian.com>
11772 * convert.cs: Added type parameter conversions.
11775 (UnboxCast.Emit): Emit an `unbox.any' for type params.
11776 (ClassCast.Emit): If the source type is a type parameter, box it.
11777 If the target type is a type parameter, emit an `unbox.any'
11778 instead of a `classcast'.1
11780 2004-04-01 Martin Baulig <martin@ximian.com>
11782 * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
11784 2004-04-01 Martin Baulig <martin@ximian.com>
11786 * generic.cs (ConstructedType.CheckConstraints): Use
11787 Convert.ImplicitStandardConversionExists(); user-defined implicit
11788 conversions are not allowed according to the spec.
11790 2004-03-30 Martin Baulig <martin@ximian.com>
11792 * expression.cs (New): Added support for type parameters.
11795 (TypeManager.activator_type): New public static field.
11796 (TypeManager.activator_create_instance): Likewise.
11798 2004-03-30 Martin Baulig <martin@ximian.com>
11800 * typemanager.cs (TypeManager.HasConstructorConstraint): New
11803 2004-03-30 Martin Baulig <martin@ximian.com>
11805 * generic.cs (ConstructedType.CheckConstraints): Actually follow
11806 the spec here: the argument type must be convertible to the
11809 2004-03-30 Martin Baulig <martin@ximian.com>
11812 (TypeParameter.Define, TypeParameter.DefineMethod): Call
11813 TypeManager.AddTypeParameter().
11814 (ConstructedType.CheckConstraints): Re-enable this and actually
11815 check whether we have a constructor constraint.
11818 (TypeManager.builder_to_type_param): New static field.
11819 (TypeManager.AddTypeParameter): New static method.
11820 (TypeManager.LookupTypeParameter): New public method.
11822 2004-03-30 Martin Baulig <martin@ximian.com>
11824 * generic.cs (TypeParameter.DefineType): Return a boolean and use
11825 the new API to actually define the constructor constraint.
11828 (TypeManager.new_constraint_attr_type): New static field.
11829 (TypeManager.InitCoreTypes): Initialize it.
11831 2004-03-30 Martin Baulig <martin@ximian.com>
11833 * generic.cs (Constraints): Completed error checking, use correct
11836 2004-03-29 Martin Baulig <martin@ximian.com>
11838 * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
11840 * expression.cs (Invocation.InferTypeArguments): Added overloaded
11841 public version which takes a `ParameterData pd' instead of an
11844 2004-03-29 Martin Baulig <martin@ximian.com>
11846 * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
11849 2004-03-29 Martin Baulig <martin@ximian.com>
11851 * expression.cs (Argument.ResolveMethodGroup): If we're a
11852 ConstructedType, call GetMemberAccess() on it.
11854 2004-03-29 Martin Baulig <martin@ximian.com>
11856 * class.cs (MethodBase.CheckGenericOverride): New abstract method.
11857 (MethodCore.CheckGenericOverride): When overriding a generic
11858 method, check whether the constraints match.
11860 * support.cs (GenericConstraints): New public interface.
11861 (ParameterData.GenericConstraints): New public method.
11863 * parameter.cs (Parameter.Resolve): Check whether we're a generic
11864 method parameter and compute our constraints if appropriate.
11865 (Parameter.GenericConstraints): New public property.
11867 * generic.cs (Constraints): Implement GenericConstraints.
11869 2004-03-29 Martin Baulig <martin@ximian.com>
11871 * decl.cs (MemberCache.FindMemberToOverride): Use
11872 `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
11874 2004-03-29 Martin Baulig <martin@ximian.com>
11876 * generic.cs (GenericMethod.Define): Resolve our type parameters.
11878 2004-03-29 Martin Baulig <martin@ximian.com>
11880 * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
11881 not allowed on non-generic declarations").
11883 2004-03-29 Martin Baulig <martin@ximian.com>
11885 * expression.cs (Invocation.InferTypeArguments): Added overloaded
11886 public version of this method.
11888 * class.cs (MethodCore.IsDuplicateImplementation): Use
11889 Invocation.InferTypeArguments() to check this.
11891 2004-03-29 Martin Baulig <martin@ximian.com>
11893 * convert.cs: Use TypeManager.IsDelegateType() instead of
11894 comparing types correctly.
11896 2004-03-29 Martin Baulig <martin@ximian.com>
11898 * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
11899 types directly to make it work for generic instances.
11901 * typemanager.cs (TypeManager.IsSubclassOf): New static method.
11903 2004-03-29 Martin Baulig <martin@ximian.com>
11905 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
11906 support for arrays.
11908 2004-03-24 Martin Baulig <martin@ximian.com>
11910 * decl.cs (DeclSpace.FindType): Also use
11911 TypeManager.CheckGeneric() for types from the using clauses.
11913 2004-03-23 Martin Baulig <martin@ximian.com>
11915 * expression.cs (Invocation.OverloadResolve): Added `bool
11916 may_fail' argument and use it instead of the Location.IsNull() hack.
11918 2004-03-23 Martin Baulig <martin@ximian.com>
11920 * expression.cs (Invocation.InferType): Use correct type inference
11923 2004-03-23 Martin Baulig <martin@ximian.com>
11925 * ecore.cs (MethodGroupExpr.Name): Use
11926 TypeManager.CSharpSignature() instead of just the name.
11928 * expression.cs (Invocation.OverloadResolve): Provide better error
11930 (Invocation.DoResolve): OverloadResolve() never returns null
11931 without reporting an error, so removed the error -6 reporting here.
11933 2004-03-23 Martin Baulig <martin@ximian.com>
11935 * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
11938 * cs-parser.jay (delegate_declaration): Support generic delegates.
11940 * delegate.cs: Support generic delegates.
11942 2004-03-22 Martin Baulig <martin@ximian.com>
11944 * expression.cs (Invocation.InferParamsTypeArguments): New static
11945 method; does type inference for params arguments.
11947 2004-03-21 Martin Baulig <martin@ximian.com>
11949 * typemanager.cs (TypeManager.IsGenericMethod): New public static
11950 method; checks whether a method is a generic method.
11952 * expression.cs (Invocation.InferTypeArguments): New static method;
11953 infer type arguments for generic method invocation.
11955 * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
11956 property; we set this to true if we're resolving a generic method
11957 invocation and the user specified type arguments, ie. we're not
11958 doing type inference.
11960 2004-03-20 Martin Baulig <martin@ximian.com>
11962 * class.cs (MethodData.DeclaringType): New public property.
11963 (MethodData.Define): Set DeclaringType here.
11964 (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
11965 instead of OperatorMethodBuilder.DeclaringType.
11967 2004-03-20 Martin Baulig <martin@ximian.com>
11969 * cs-tokenizer.cs (xtoken): Return a special
11970 Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
11972 * cs-parser.jay (default_value_expression): Switch to the new
11975 2004-03-19 Martin Baulig <martin@ximian.com>
11977 * decl.cs (MemberName): New class. We use this to "construct"
11978 namespace_or_type_name's.
11980 * generics.cs (TypeArguments.GetDeclarations): New public method;
11981 returns the type arguments as a string[] and reports a CS0081 if
11982 one of them is not an identifier.
11984 * class.cs (MemberBase): The .ctor now takes the name as a
11985 MemberName instead of a string.
11986 (MemberBase.ExplicitInterfaceName): Changed type from string to
11988 (MemberBase.DoDefine): If we're an explicit implementation, the
11989 InterfaceType may be a generic instance.
11991 * cs-parser.jay (namespace_or_type_name): Return a MemberName.
11992 (namespace_name): Call MemberName.GetName () to transform the
11993 MemberName into a string and ensure we don't have any type
11995 (type_name): Call MemberName.GetTypeExpression() to transfrom the
11996 MemberName into an expression.
11997 (method_header): Use namespace_or_type_name instead of member_name.
11999 2004-04-07 Miguel de Icaza <miguel@ximian.com>
12001 * rootcontext.cs: Add new types to the boot resolution.
12003 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
12004 MulticastDelegate is not allowed.
12006 * typemanager.cs: Add new types to lookup: System.TypedReference
12009 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
12010 check for TypedReference or ArgIterator, they are not allowed.
12012 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
12013 makes us properly catch 1510 in some conditions (see bug 56016 for
12016 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
12018 * CryptoConvert.cs: update from corlib version
12021 2004-04-05 Miguel de Icaza <miguel@ximian.com>
12023 * class.cs (Indexer.Define): Check indexername declaration
12025 2004-04-05 Marek Safar <marek.safar@seznam.cz>
12027 * attribute.cs (IsClsCompliant): Fixed problem with handling
12028 all three states (compliant, not-compliant, undetected).
12030 2004-03-30 Marek Safar <marek.safar@seznam.cz>
12032 * attribute.cs (Attribute): Location is now public.
12033 (Resolve): Store resolved arguments (pos_values) in attribute class.
12034 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
12035 (GetClsCompliantAttributeValue): New method that gets
12036 CLSCompliantAttribute value.
12037 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
12038 if exists else null.
12039 (AttributeTester): New class for CLS-Compliant verification routines.
12041 * class.cs (Emit): Add CLS-Compliant verification.
12042 (Method.GetSignatureForError): Implemented.
12043 (Constructor.GetSignatureForError): Implemented
12044 (Constructor.HasCompliantArgs): Returns if constructor has
12045 CLS-Compliant arguments.
12046 (Constructor.Emit): Override.
12047 (Construcor.IsIdentifierClsCompliant): New method; For constructors
12048 is needed to test only parameters.
12049 (FieldBase.GetSignatureForError): Implemented.
12050 (TypeContainer): New member for storing base interfaces.
12051 (TypeContainer.FindMembers): Search in base interfaces too.
12053 * codegen.cs (GetClsComplianceAttribute): New method that gets
12054 assembly or module CLSCompliantAttribute value.
12055 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
12057 (ModuleClass.Emit): Add error 3012 test.
12059 * const.cs (Emit): Override and call base for CLS-Compliant tests.
12061 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
12062 state for all decl types.
12063 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
12064 if CLS-Compliant tests are required.
12065 (IsClsCompliaceRequired): New method. Analyze whether code
12066 must be CLS-Compliant.
12067 (IsExposedFromAssembly): New method. Returns true when MemberCore
12068 is exposed from assembly.
12069 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
12070 value or gets cached value.
12071 (HasClsCompliantAttribute): New method. Returns true if MemberCore
12072 is explicitly marked with CLSCompliantAttribute.
12073 (IsIdentifierClsCompliant): New abstract method. This method is
12074 used to testing error 3005.
12075 (IsIdentifierAndParamClsCompliant): New method. Common helper method
12076 for identifier and parameters CLS-Compliant testing.
12077 (VerifyClsCompliance): New method. The main virtual method for
12078 CLS-Compliant verifications.
12079 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
12080 null. I don't know why is null (too many public members !).
12081 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
12082 and get value of first CLSCompliantAttribute that found.
12084 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
12085 (VerifyClsCompliance): Override and add extra tests.
12087 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
12088 clscheck- disable CLS-Compliant verification event if assembly is has
12089 CLSCompliantAttribute(true).
12091 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
12092 ApllyAttribute is now called in emit section as in the other cases.
12093 Possible future Emit integration.
12094 (IsIdentifierClsCompliant): New override.
12095 (VerifyClsCompliance): New override.
12096 (GetEnumeratorName): Returns full enum name.
12098 * parameter.cs (GetSignatureForError): Implemented.
12100 * report.cs (WarningData): New struct for Warning message information.
12101 (LocationOfPreviousError): New method.
12102 (Warning): New method. Reports warning based on the warning table.
12103 (Error_T): New method. Reports error based on the error table.
12105 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
12106 verifications are done here.
12108 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
12110 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
12111 CLSCompliantAttribute.
12112 (all_imported_types): New member holds all imported types from other
12114 (LoadAllImportedTypes): New method fills static table with exported types
12115 from all referenced assemblies.
12116 (Modules): New property returns all assembly modules.
12118 2004-03-30 Miguel de Icaza <miguel@ximian.com>
12120 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
12121 throwing a parser error.
12123 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
12124 which removes the hardcoded get_/set_ prefixes for properties, as
12125 IL allows for the properties to be named something else.
12129 * expression.cs: Do not override operand before we know if it is
12130 non-null. Fix 56207
12132 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
12134 * typemanager.cs: support for pinned variables.
12136 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
12138 * decl.cs, typemanager.cs: Avoid using an arraylist
12139 as a buffer if there is only one result set.
12141 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
12143 * expression.cs: Make sure you cant call a static method
12144 with an instance expression, bug #56174.
12146 2004-03-29 Miguel de Icaza <miguel@ximian.com>
12148 * class.cs (IsDuplicateImplementation): Improve error reporting to
12149 flag 663 (method only differs in parameter modifier).
12151 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
12152 in preprocessor directives.
12154 * location.cs (LookupFile): Allow for the empty path.
12156 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
12157 better approach for some of that patch, but its failing with the
12158 CharSet enumeration. For now try/catch will do.
12160 * typemanager.cs: Do not crash if a struct does not have fields.
12163 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
12165 * expression.cs: cs0213, cant fix a fixed expression.
12168 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
12170 * cs-parser.jay: detect invalid embeded statements gracefully.
12173 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
12175 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
12178 the invocation type may not be a subclass of the tye of the item/
12179 The type of the item must be a subclass of the invocation item.
12184 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
12186 * attribute.cs: Added methods to get a string and a bool from an
12187 attribute. Required to information from AssemblyKeyFileAttribute,
12188 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
12189 * codegen.cs: Modified AssemblyName creation to include support for
12190 strongnames. Catch additional exceptions to report them as CS1548.
12191 * compiler.csproj: Updated include CryptoConvert.cs.
12192 * compiler.csproj.user: Removed file - user specific configuration.
12193 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
12194 Mono.Security assembly. The original class is maintained and tested in
12195 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
12196 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
12197 like CSC 8.0 (C# v2) supports.
12198 * Makefile: Added CryptoConvert.cs to mcs sources.
12199 * rootcontext.cs: Added new options for strongnames.
12201 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
12203 * driver.cs: For --expect-error, report error code `2'
12204 if the program compiled with no errors, error code `1' if
12205 it compiled with an error other than the one expected.
12207 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
12209 * compiler.csproj: Updated for Visual Studio .NET 2003.
12210 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
12211 * compiler.sln: Updated for Visual Studio .NET 2003.
12213 2004-03-24 Ravi Pratap M <ravi@ximian.com>
12215 * expression.cs: Fix bug #47234. We basically need to apply the
12216 rule that we prefer the conversion of null to a reference type
12217 when faced with a conversion to 'object' (csc behaviour).
12219 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12221 * statement.cs: Shorter form for foreach, eliminates
12222 a local variable. r=Martin.
12224 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12226 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
12227 checks if we can use brtrue/brfalse to test for 0.
12228 * expression.cs: use the above in the test for using brtrue/brfalse.
12229 cleanup code a bit.
12231 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12233 * expression.cs: Rewrite string concat stuff. Benefits:
12235 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
12236 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
12237 rather than a concat chain.
12239 * typemanager.cs: Add lookups for more concat overloads.
12241 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12243 * expression.cs: Emit shorter il code for array init.
12260 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
12262 * statement.cs: Before, two switch blocks would be merged if the
12263 total size of the blocks (end_item - begin_item + 1) was less than
12264 two times the combined sizes of the blocks.
12266 Now, it will only merge if after the merge at least half of the
12271 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
12273 * class.cs : csc build fix for GetMethods(). See bug #52503.
12275 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
12277 * expression.cs: Make sure fp comparisons work with NaN.
12278 This fixes bug #54303. Mig approved this patch a long
12279 time ago, but we were not able to test b/c the runtime
12282 2004-03-19 Miguel de Icaza <miguel@ximian.com>
12284 * ecore.cs (TypExpr.GetHashCode): implement this overload.
12286 2004-03-19 Martin Baulig <martin@ximian.com>
12288 * class.cs (MemberCore.IsDuplicateImplementation): Check whether
12289 two overloads may unify for some type parameter substitutions and
12290 report a CS0408 if appropriate.
12292 2004-03-19 Martin Baulig <martin@ximian.com>
12294 * class.cs (MemberCore.IsDuplicateImplementation): Report the
12295 error here and not in our caller.
12297 2004-03-19 Martin Baulig <martin@ximian.com>
12299 * interface.cs: Completely killed this file.
12300 (Interface): We're now a TypeContainer and live in class.cs.
12302 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
12303 argument; we're now also called for interfaces.
12304 (TypeContainer.DefineMembers): Allow this method being called
12306 (TypeContainer.GetMethods): New public method; formerly known as
12307 Interface.GetMethod(). This is used by PendingImplementation.
12308 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
12309 it's now private and non-static.
12310 (Interface): Moved this here; it's now implemented similar to
12312 (Method, Property, Event, Indexer): Added `bool is_interface'
12313 argument to their .ctor's.
12314 (MemberBase.IsInterface): New public field.
12316 * cs-parser.jay: Create normal Method, Property, Event, Indexer
12317 instances instead of InterfaceMethod, InterfaceProperty, etc.
12318 (opt_interface_base): Removed; we now use `opt_class_base' instead.
12319 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
12321 2004-03-19 Martin Baulig <martin@ximian.com>
12323 * class.cs (MethodCore.IsDuplicateImplementation): New private
12324 method which does the CS0111 checking.
12325 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
12326 Use IsDuplicateImplementation().
12328 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
12330 * decl.cs (FindMemberToOverride): New method to find the correct
12331 method or property to override in the base class.
12333 - Make Method/Property use the above method to find the
12334 version in the base class.
12335 - Remove the InheritableMemberSignatureCompare as it is now
12338 This patch makes large code bases much faster to compile, as it is
12339 O(n) rather than O(n^2) to do this validation.
12341 Also, it fixes bug 52458 which is that nested classes are not
12342 taken into account when finding the base class member.
12344 Reviewed/Approved by Martin.
12346 2004-03-17 Martin Baulig <martin@ximian.com>
12348 * expression.cs (MemberAccess.DoResolve): Take the parent's number
12349 of type arguments into account; use the `real_num_type_args'
12350 approach like in DoResolveAsTypeStep().
12352 * generic.cs (GenericMemberAccess.DoResolve): Make this work for
12355 2004-03-17 Marek Safar <marek.safar@seznam.cz>
12357 * interface.cs: In all interface classes removed redundant
12358 member initialization.
12360 2004-03-16 Martin Baulig <martin@ximian.com>
12362 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12364 2004-03-15 Miguel de Icaza <miguel@ximian.com>
12366 * decl.cs (DefineTypeAndParents): New helper method to define a
12367 type's containers before the type itself is defined; This is a
12368 bug exposed by the recent changes to Windows.Forms when an
12369 implemented interface was defined inside a class that had not been
12372 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
12374 (Check): Loop correctly to report errors modifiers
12375 (UNSAFE was not in the loop, since it was the same as TOP).
12377 * interface.cs: Every interface member now takes a ModFlags,
12378 instead of a "is_new" bool, which we set on the base MemberCore.
12380 Every place where we called "UnsafeOk" in the interface, now we
12381 call the proper member (InterfaceMethod.UnsafeOK) instead to get
12382 the unsafe settings from the member declaration instead of the
12383 container interface.
12385 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
12387 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12388 `set_indexer_name' to the pending bits (one per type).
12390 We fixed a bug today that was picking the wrong method to
12391 override, since for properties the existing InterfaceMethod code
12392 basically ignored the method name. Now we make sure that the
12393 method name is one of the valid indexer names.
12395 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
12397 * support.cs (SeekableStreamReader): Keep track of stream byte
12398 positions and don't mix them with character offsets to the buffer.
12400 Patch from Gustavo Giráldez
12402 2004-03-15 Marek Safar <marek.safar@seznam.cz>
12404 * interface.cs (InterfaceSetGetBase): Removed double member
12405 initialization, base class does it as well.
12407 2004-03-13 Martin Baulig <martin@ximian.com>
12409 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
12410 when compiling corlib.
12412 2004-03-13 Miguel de Icaza <miguel@ximian.com>
12414 * convert.cs (ExplicitConversion): We were reporting an error on
12415 certain conversions (object_type source to a value type, when the
12416 expression was `null') before we had a chance to pass it through
12417 the user defined conversions.
12419 * driver.cs: Replace / and \ in resource specifications to dots.
12422 * class.cs: Add check for duplicate operators. Fixes 52477
12424 2004-03-11 Miguel de Icaza <miguel@ximian.com>
12426 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
12427 that are in the middle of the statements, not only at the end.
12430 * class.cs (TypeContainer.AddField): No longer set the
12431 `HaveStaticConstructor' flag, now we call it
12432 `UserDefineStaticConstructor' to diferentiate the slightly
12433 semantic difference.
12435 The situation is that we were not adding BeforeFieldInit (from
12436 Modifiers.TypeAttr) to classes that could have it.
12437 BeforeFieldInit should be set to classes that have no static
12442 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
12444 And most importantly Zoltan's comment:
12446 http://bugzilla.ximian.com/show_bug.cgi?id=44229
12448 "I think beforefieldinit means 'it's ok to initialize the type sometime
12449 before its static fields are used', i.e. initialization does not need
12450 to be triggered by the first access to the type. Setting this flag
12451 helps the JIT to compile better code, since it can run the static
12452 constructor at JIT time, and does not need to generate code to call it
12453 (possibly lots of times) at runtime. Unfortunately, mcs does not set
12454 this flag for lots of classes like String.
12456 csc sets this flag if the type does not have an explicit static
12457 constructor. The reasoning seems to be that if there are only static
12458 initalizers for a type, and no static constructor, then the programmer
12459 does not care when this initialization happens, so beforefieldinit
12462 This bug prevents the AOT compiler from being usable, since it
12463 generates so many calls to mono_runtime_class_init that the AOT code
12464 is much slower than the JITted code. The JITted code is faster,
12465 because it does not generate these calls if the vtable is type is
12466 already initialized, which is true in the majority of cases. But the
12467 AOT compiler can't do this."
12469 2004-03-10 Miguel de Icaza <miguel@ximian.com>
12471 * class.cs (MethodData.Emit): Refactor the code so symbolic
12472 information is generated for destructors; For some reasons we
12473 were taking a code path that did not generate symbolic information
12476 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
12478 * class.cs: Create a Constructor.CheckBase method that
12479 takes care of all validation type code. The method
12480 contains some code that was moved from Define.
12482 It also includes new code that checks for duplicate ctors.
12483 This fixes bug #55148.
12485 2004-03-09 Joshua Tauberer <tauberer@for.net>
12487 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
12488 a { ... }-style array creation invokes EmitStaticInitializers
12489 which is not good for reference-type arrays. String, decimal
12490 and now null constants (NullCast) are not counted toward
12491 static initializers.
12493 2004-03-05 Martin Baulig <martin@ximian.com>
12495 * location.cs (SourceFile.HasLineDirective): New public field;
12496 specifies whether the file contains or is referenced by a "#line"
12498 (Location.DefineSymbolDocuments): Ignore source files which
12499 either contain or are referenced by a "#line" directive.
12501 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
12503 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
12504 direct access to our parent, so check the method inline there.
12506 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
12508 * expression.cs (Invocation.EmitCall): Miguel's last commit
12509 caused a regression. If you had:
12514 In Foo the implict this would be null.
12516 2004-02-27 Miguel de Icaza <miguel@ximian.com>
12518 * expression.cs (Invocation.EmitCall): If the method is not
12519 virtual, do not emit a CallVirt to it, use Call.
12521 * typemanager.cs (GetFullNameSignature): Improve the method to
12522 cope with ".ctor" and replace it with the type name.
12524 * class.cs (ConstructorInitializer.Resolve): Now the method takes
12525 as an argument the ConstructorBuilder where it is being defined,
12526 to catch the recursive constructor invocations.
12528 2004-03-16 Martin Baulig <martin@ximian.com>
12530 * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
12531 ConstructedType, call ResolveType() on it to get the type rather
12532 than just using `expr.Type'.
12534 2004-03-16 Martin Baulig <martin@ximian.com>
12536 * generics.cs (ConstructedType.GetMemberAccess): Take the
12537 EmitContext instead on the TypeExpr and use
12538 ec.TypeContainer.CurrentType/ec.ContainerType.
12540 2004-03-16 Martin Baulig <martin@ximian.com>
12542 * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
12543 parameters before aliases.
12545 2004-03-16 Martin Baulig <martin@ximian.com>
12547 * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
12548 New oublic function; checks whether two generic instances may become
12549 equal under some instantiations (26.3.1).
12551 * class.cs (TypeContainer.Define): Call
12552 TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
12555 2004-03-16 Martin Baulig <martin@ximian.com>
12557 * class.cs (TypeContainer.GetClassBases): Moved
12558 Error_TypeParameterAsBase() here and also check whether the base
12559 class is not an attribute.
12561 2004-03-16 Martin Baulig <martin@ximian.com>
12563 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12565 2004-03-16 Martin Baulig <martin@ximian.com>
12567 * class.cs (Error_TypeParameterAsBase): Use correct error number
12570 2004-03-16 Martin Baulig <martin@ximian.com>
12572 * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
12575 * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
12578 2004-03-15 Martin Baulig <martin@ximian.com>
12580 * typemanager.cs (TypeManager.GetFullName): New public method.
12581 (TypeManager.MemberLookup): Added `int_num_type_arguments'
12582 argument; only return members with the correct number of type
12584 (TypeManager.CheckGeneric): Allow -1 to bypass the check.
12585 (TypeManager.FilterWithClosure): Call CheckGeneric() to check
12586 whether the number of type arguments matches.
12588 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
12589 not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
12591 * expression.cs (MemberAccess): Added public `NumTypeArguments'
12592 field; it's set by the protected .ctor when we're actually a
12593 GenericMemberAccess.
12594 (MemberAccess.ResolveAsTypeStep): Compute the total number of type
12595 arguments and pass it to MemberLookupFinal ().
12597 * ecore.cs (Expression.MemberLookup): Added `int
12598 num_type_arguments' argument; only return members with the correct
12599 number of type arguments.
12600 (Expression.MemberLookupFailed): Check whether the MemberLookup
12601 failed because we did not have the correct number of type
12602 arguments; report CS0305 in this case.
12604 * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
12605 `e.ResolveAsTypeTerminal()' already did so.
12607 2004-03-15 Martin Baulig <martin@ximian.com>
12609 * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
12610 we're a ConstructedType; in this case, the caller must report an
12611 error (for instance CS0131).
12613 * generic.cs (TypeArguments): Added Location argument to the .ctor.
12614 (TypeArguments.Resolve): Actually report errors here.
12616 2004-03-15 Miguel de Icaza <miguel@ximian.com>
12618 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12619 `set_indexer_name' to the pending bits (one per type).
12621 We fixed a bug today that was picking the wrong method to
12622 override, since for properties the existing InterfaceMethod code
12623 basically ignored the method name. Now we make sure that the
12624 method name is one of the valid indexer names.
12626 2004-03-15 Martin Baulig <martin@ximian.com>
12628 * typemanager.cs (TypeManager.IndexerPropertyName): Added support
12629 for generic instances.
12631 2004-03-13 Martin Baulig <martin@ximian.com>
12633 * class.cs (TypeContainer.DefineType): Call
12634 TypeManager.AddUserType() immediately after creating the
12635 TypeBuilder; pass all type parameters when creating the
12638 * decl.cs (DeclSpace.FindNestedType): New public method.
12639 (DeclSpace.FindType): Added `int num_type_args' argument; only
12640 return types with the correct number of type parameters.
12641 (DeclSpace.CountTypeParams): New public property.
12643 * ecore.cs (SimpleName.ctor): Added overloaded version which takes
12644 the number of type parameters; defaults to zero.
12646 * generic.cs (TypeArguments.Count): New public property.
12647 (ConstructedType.DoResolveAsTypeStep): First call
12648 ds.FindNestedType() to find out whether we're nested in the
12649 current generic type; in this case, we inherit all type parameters
12650 from the current class.
12652 * rootcontext.cs (RootContext.NamespaceLookup): Added `int
12653 num_type_args' argument.
12654 (RootContext.LookupType): Added overloaded version which takes the
12655 number of type arguments; only return types with the correct
12656 number of type arguments.
12658 * typemanager.cs (TypeManager.CheckGeneric): New public function;
12659 checks whether `Type t' has `int num_type_args'.
12661 2004-03-13 Martin Baulig <martin@ximian.com>
12663 * generic.cs (GenericMethod.DefineType): New method; calls
12664 DefineType() on all the type parameters.
12666 * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
12667 (MethodData.Define): If we're a generic method, call
12668 GenericMethod.DefineType() to define the type parameters.
12670 2004-03-10 Martin Baulig <martin@ximian.com>
12672 * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
12673 instead of IsAssignableFrom.
12675 2004-03-10 Martin Baulig <martin@ximian.com>
12677 * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
12679 * support.cs (ParameterData.HasArrayParameter): New property.
12680 (ReflectionParameters.ctor): Take a MethodBase instead of a
12681 ParameterInfo[]. If we have any type parameters, get the generic
12682 method definition and ask it whether we have variable arguments.
12684 2004-02-26 Miguel de Icaza <miguel@ximian.com>
12686 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
12687 routines to check if a type is an enumerable/enumerator allow
12688 classes that implement the IEnumerable or IEnumerator interfaces.
12690 * class.cs (Property, Operator): Implement IIteratorContainer, and
12691 implement SetYields.
12693 (Property.Define): Do the block swapping for get_methods in the
12694 context of iterators. We need to check if Properties also
12695 include indexers or not.
12697 (Operator): Assign the Block before invoking the
12698 OperatorMethod.Define, so we can trigger the Iterator code
12701 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
12702 Property and Operator classes are not created when we parse the
12703 declarator but until we have the block completed, so we use a
12704 singleton SimpleIteratorContainer.Simple to flag whether the
12705 SetYields has been invoked.
12707 We propagate this setting then to the Property or the Operator to
12708 allow the `yield' to function.
12710 2004-02-25 Marek Safar <marek.safar@seznam.cz>
12712 * codegen.cs: Implemented attribute support for modules.
12713 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
12714 Assembly/Module functionality.
12716 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
12717 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
12718 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
12720 2004-02-16 Marek Safar <marek.safar@seznam.cz>
12722 * interface.cs (FindMembers): The operation is performed on all base
12723 interfaces and not only on the first. It is required for future CLS Compliance patch.
12725 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
12727 * statement.cs, codegen.cs:
12728 This patch deals with patterns such as:
12730 public class List : IEnumerable {
12732 public MyEnumerator GetEnumerator () {
12733 return new MyEnumerator(this);
12736 IEnumerator IEnumerable.GetEnumerator () {
12740 public struct MyEnumerator : IEnumerator {
12745 Before, there were a few things we did wrong:
12746 1) we would emit callvirt on a struct, which is illegal
12747 2) we emited ldarg when we needed to emit ldarga
12748 3) we would mistakenly call the interface methods on an enumerator
12749 type that derived from IEnumerator and was in another assembly. For example:
12751 public class MyEnumerator : IEnumerator
12753 Would have the interface methods called, even if there were public impls of the
12754 method. In a struct, this lead to invalid IL code.
12756 2004-02-11 Marek Safar <marek.safar@seznam.cz>
12758 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
12761 * delegate.cs (Define): Fixed crash when delegate type is undefined.
12763 2004-02-11 Miguel de Icaza <miguel@ximian.com>
12765 * cs-parser.jay: Fix small regression: we were not testing V2
12766 compiler features correctly.
12768 * interface.cs: If the emit context is null, then create one
12770 2004-02-09 Marek Safar <marek.safar@seznam.cz>
12772 * decl.cs (GetSignatureForError): New virtual method to get full name
12773 for error messages.
12775 * attribute.cs (IAttributeSupport): New interface for attribute setting.
12776 Now it is possible to rewrite ApplyAttributes method to be less if/else.
12778 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
12779 Duplicated members and code in these classes has been removed.
12780 Better encapsulation in these classes.
12782 2004-02-07 Miguel de Icaza <miguel@ximian.com>
12784 * assign.cs (Assign.DoResolve): When dealing with compound
12785 assignments, there is a new rule in ECMA C# 2.4 (might have been
12786 there before, but it is documented here) that states that in:
12790 If b is of type int, and the `op' is a shift-operator, then the
12791 above is evaluated as:
12795 * expression.cs (Binary.ResolveOperator): Instead of testing for
12796 int/uint/long/ulong, try to implicitly convert to any of those
12797 types and use that in pointer arithmetic.
12799 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
12800 method to print information for from the type, not from the
12801 null-method we were given.
12803 2004-02-01 Duncan Mak <duncan@ximian.com>
12805 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
12806 parsing for cmd, fixes bug #53694.
12808 2004-02-04 Marek Safar <marek.safar@seznam.cz>
12810 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
12811 in the member name duplication tests. Property and operator name duplication
12812 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
12814 2004-02-03 Marek Safar <marek.safar@seznam.cz>
12816 * interface.cs (PopulateMethod): Fixed crash when interface method
12817 returns not existing type (error test cs0246-3.cs).
12819 2004-02-02 Ravi Pratap M <ravi@ximian.com>
12821 * cs-parser.jay (interface_accessors): Re-write actions to also
12822 store attributes attached to get and set methods. Fix spelling
12825 (inteface_property_declaration): Modify accordingly.
12827 (InterfaceAccessorInfo): New helper class to store information to pass
12828 around between rules that use interface_accessors.
12830 * interface.cs (Emit): Apply attributes on the get and set
12831 accessors of properties and indexers too.
12833 * attribute.cs (ApplyAttributes): Modify accordingly to use the
12834 right MethodBuilder when applying attributes to the get and set accessors.
12836 2004-01-31 Miguel de Icaza <miguel@ximian.com>
12838 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
12840 2004-01-26 Miguel de Icaza <miguel@ximian.com>
12842 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
12844 2004-01-25 Miguel de Icaza <miguel@ximian.com>
12846 * cs-parser.jay: Remove YIELD token, instead use the new grammar
12847 changes that treat `yield' specially when present before `break'
12848 or `return' tokens.
12850 * cs-tokenizer.cs: yield is no longer a keyword.
12852 2004-01-23 Marek Safar <marek.safar@seznam.cz>
12854 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
12855 setting for default constructors.
12856 For default constructors are almost every time set wrong Modifier. The
12857 generated IL code has been alright. But inside mcs this values was
12858 wrong and this was reason why several of my CLS Compliance tests
12861 2004-02-27 Martin Baulig <martin@ximian.com>
12863 * generics.cs (ConstructedType.ResolveType): Make the nested type
12864 stuff actually work.
12866 2004-02-25 Martin Baulig <martin@ximian.com>
12868 * decl.cs (DeclSpace.CurrentTypeParameters): New protected
12869 property; returns the type parameters just from the current type,
12870 ie. with the ones from outer classes.
12871 (DeclSpace.LookupGeneric): First search in the current class, then
12873 (DeclSpace.initialize_type_params): When hiding a type parameter
12874 from an outer class, put it into the `type_param_list' anyways.
12876 * expression.cs (MemberAccess.expr): Made this field protected.
12878 * class.cs (TypeContainer.Define): The `CurrentType' just contains
12879 the type parameters from the current class.
12881 * generic.cs (ConstructedType.ResolveType): Support nested generic
12882 types by taking the type parameters which we inherit from outer
12883 classes into account.
12884 (GenericMemberAccess.ResolveAsTypeStep): Override this and added
12885 support for nested generic types.
12887 2004-02-23 Martin Baulig <martin@ximian.com>
12889 * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
12890 field and check whether we're nested inside a generic type.
12891 (DeclSpace.ResolveType): If we're resolving to a generic type
12892 definition, create a ConstructedType and return its resolved type.
12893 (DeclSpace.initialize_type_params): New private method;
12894 initializes the `type_param_list' field from the type parameters
12895 from this and all enclosing classes.
12896 (DeclSpace.TypeParameters): Call initialize_type_params() unless
12897 we're already initialized.
12899 2004-02-23 Martin Baulig <martin@ximian.com>
12901 * class.cs (Method.Define): Create the generic method before
12902 calling DoDefine().
12903 (Memberbase.DoDefine): Added DeclSpace argument (in addition to
12904 the TypeContainer one); we use this for generic methods.
12906 * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
12907 parent's TypeBuilder.
12909 2004-02-18 Martin Baulig <martin@ximian.com>
12911 * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
12912 to check for equality.
12914 2004-02-05 Martin Baulig <martin@ximian.com>
12916 * ecore.cs (FieldExpr.DoResolveLValue): If we have an
12917 `ec.TypeContainer.CurrentType', use it instead of
12918 `ec.ContainerType' to check whether we're in the type's ctor.
12920 2004-01-29 Martin Baulig <martin@ximian.com>
12922 * expression.cs (Invocation.DoResolve): If we're a
12923 `ConstructedType', then we're actually a generic method, so
12924 rewrite the expr as a GenericMemberAccess.
12926 * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
12927 here; manually parse it into a string.
12929 2004-01-28 Martin Baulig <martin@ximian.com>
12931 * typemanager.cs (TypeManager.IsEqual): New static method.
12932 (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
12933 check for equality instead of using `=='.
12935 2004-01-26 Martin Baulig <martin@ximian.com>
12937 * decl.cs (DeclSpace.CurrentType): New public field.
12939 * expression.cs (This.ResolveBase): If we have an
12940 `ec.TypeContainer.CurrentType', use it instead of
12941 `ec.ContainerType'.
12943 * class.cs (TypeContainer.DefineType): If we're a generic type,
12944 create the `CurrentType' (unresolved).
12945 (TypeContainer.GenericType): New private field.
12946 (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
12947 it and store it in `GenericType' before creating the MemberCache.
12948 (TypeContainer.GetMembers): If we have a `GenericType', call
12949 TypeManager.FindMembers() on it.
12951 * interface.cs (Interface.GenericType): New private field.
12952 (Interface.DefineType): If we're a generic type, create the
12953 `CurrentType' (unresolved).
12954 (Interface.DefineMembers): If we have a `CurrentType', resolve it
12955 and store it in `GenericType' before creating the MemberCache.
12956 (Interface.GetMembers): If we have a `GenericType', call
12957 TypeManager.FindMembers() on it.
12959 2004-01-22 Martin Baulig <martin@ximian.com>
12961 * cs-parser.jay (namespace_or_type_name): Return an Expression,
12962 not a QualifiedIdentifier. This is what `type_name_expression'
12963 was previously doing.
12964 (type_name_expression): Removed; the code is now in
12965 `namespace_or_type_name'.
12966 (qualified_identifier): Removed, use `namespace_or_type_name'
12968 (QualifiedIdentifier): Removed this class.
12970 2004-01-22 Martin Baulig <martin@ximian.com>
12972 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
12973 not a string as alias name.
12975 2004-01-21 Miguel de Icaza <miguel@ximian.com>
12977 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
12978 #52730 bug, and instead compute correctly the need to use a
12979 temporary variable when requesting an address based on the
12980 static/instace modified of the field and the constructor.
12982 2004-01-21 Martin Baulig <martin@ximian.com>
12984 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
12985 class and namespace before looking up aliases. Fixes #52517.
12987 2004-01-21 Martin Baulig <martin@ximian.com>
12989 * flowanalysis.cs (UsageVector.Merge): Allow variables being
12990 assinged in a 'try'; fixes exception4.cs.
12992 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12993 * class.cs : Implemented parameter-less constructor for TypeContainer
12995 * decl.cs: Attributes are now stored here. New property OptAttributes
12997 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
12999 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
13001 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13003 * typemanager.cs (CSharpSignature): Now reports also inner class name.
13004 (CSharpSignature): New method for indexer and property signature.
13006 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13008 * pending.cs (IsVirtualFilter): Faster implementation.
13010 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13012 * typemanager.cs: Avoid inclusion of same assembly more than once.
13014 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13016 * cs-parser.jay: Fixed problem where the last assembly attribute
13017 has been applied also to following declaration (class, struct, etc.)
13019 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13021 * class.cs: Added error CS0538, CS0539 reporting.
13022 Fixed crash on Microsoft runtime when field type is void.
13024 * cs-parser.jay: Added error CS0537 reporting.
13026 * pending.cs: Added error CS0535 reporting.
13027 Improved error report for errors CS0536, CS0534.
13029 2004-01-20 Miguel de Icaza <miguel@ximian.com>
13031 Merge a few bits from the Anonymous Method MCS tree.
13033 * statement.cs (ToplevelBlock): New class for toplevel methods,
13034 will hold anonymous methods, lifted variables.
13036 * cs-parser.jay: Create toplevel blocks for delegates and for
13037 regular blocks of code.
13039 2004-01-20 Martin Baulig <martin@ximian.com>
13041 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
13042 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
13043 and `NeedExplicitReturn'; added `IsLastStatement'.
13044 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
13045 have a `ReturnLabel' or we're not unreachable.
13047 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
13048 child's reachability; don't just override ours with it. Fixes
13049 #58058 (lluis's example).
13050 (FlowBranching): Added public InTryOrCatch(), InCatch(),
13051 InFinally(), InLoop(), InSwitch() and
13052 BreakCrossesTryCatchBoundary() methods.
13054 * statement.cs (Return): Do all error checking in Resolve().
13055 Unless we are the last statement in a top-level block, always
13056 create a return label and jump to it.
13057 (Break, Continue): Do all error checking in Resolve(); also make
13058 sure we aren't leaving a `finally'.
13059 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
13060 statement in a top-level block.
13061 (Block.Flags): Added `IsDestructor'.
13062 (Block.IsDestructor): New public property.
13064 2004-01-20 Martin Baulig <martin@ximian.com>
13066 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
13068 2004-01-20 Martin Baulig <martin@ximian.com>
13070 * statement.cs (Statement.ResolveUnreachable): New public method.
13071 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
13072 (Block.Resolve): Resolve unreachable statements.
13074 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
13076 * expression.cs: We need to fix the case where we do
13077 not have a temp variable here.
13079 * assign.cs: Only expression compound assignments need
13080 temporary variables.
13082 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
13084 * flowanalysis.cs: Reduce memory allocation in a few ways:
13085 - A block with no variables should not allocate a bit
13087 - A method with no out parameters does not need any tracking
13088 for assignment of the parameters, so we need not allocate
13091 public readonly Type[] VariableTypes;
13092 public readonly string[] VariableNames;
13093 Are redundant. The data is already stored in the variable
13094 map, so we need not allocate another array for it.
13095 - We need to add alot of checks for if (params | locals) == null
13096 due to the first two changes.
13098 2004-01-18 Miguel de Icaza <miguel@ximian.com>
13100 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
13101 implement IMemoryLocation, we store a copy on a local variable and
13102 take the address of it. Patch from Benjamin Jemlich
13104 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
13105 to use a special "type_name_expression" rule which reduces the
13106 number of "QualifiedIdentifier" classes created, and instead
13107 directly creates MemberAccess expressions.
13109 2004-01-17 Miguel de Icaza <miguel@ximian.com>
13111 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
13112 that fixes #52853. Null literal assignment to ValueType
13114 * class.cs (MethodData.Emit): Instead of checking the name of the
13115 method to determine if its a destructor, create a new derived
13116 class from Method called Destructor, and test for that.
13118 * cs-parser.jay: Create a Destructor object instead of a Method.
13120 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
13124 2004-01-16 Miguel de Icaza <miguel@ximian.com>
13126 * expression.cs (Binary.ResolveOperator): Perform an implicit
13127 conversion from MethodGroups to their delegate types on the
13128 Addition operation.
13130 * delegate.cs: Introduce a new class DelegateCreation that is the
13131 base class for `NewDelegate' and `ImplicitDelegateCreation',
13132 factor some code in here.
13134 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
13135 conversion from MethodGroups to compatible delegate types.
13137 * ecore.cs (Expression.Resolve): Do not flag error 654
13138 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
13139 we allow conversions from MethodGroups to delegate types now.
13141 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
13142 assignments in v2 either.
13144 2004-01-10 Miguel de Icaza <miguel@ximian.com>
13146 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
13147 static read-only fields in ctors.
13149 Applied patch from Benjamin Jemlich
13151 * expression.cs (UnaryMutator): Avoid leaking local variables.
13153 2004-01-09 Miguel de Icaza <miguel@ximian.com>
13155 * cs-tokenizer.cs (IsCastToken): Allow the various native types
13156 here to return true, as they can be used like this:
13158 (XXX) int.MEMBER ()
13160 Fixed 49836 and all the other dups
13162 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
13164 * driver.cs: Implement /win32res and /win32icon.
13166 2004-01-08 Miguel de Icaza <miguel@ximian.com>
13168 * cs-parser.jay: Add a rule to improve error handling for the
13169 common mistake of placing modifiers after the type.
13171 2004-01-07 Miguel de Icaza <miguel@ximian.com>
13173 * cs-parser.jay (interface_event_declaration): Catch
13174 initialization of events on interfaces, and report cs0068
13176 * cs-parser.jay (interface_event_declaration): Catch
13177 initialization of events.
13179 * ecore.cs: Better report missing constructors.
13181 * expression.cs (Binary.ResolveOperator): My previous bug fix had
13182 the error reporting done in the wrong place. Fix.
13184 * expression.cs (Binary.ResolveOperator): Catch the
13185 operator + (E x, E y) error earlier, and later allow for implicit
13186 conversions in operator +/- (E e, U x) from U to the underlying
13189 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
13190 52596, if the container class is abstract, the default constructor
13191 is protected otherwise its public (before, we were always public).
13193 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
13196 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
13197 Jemlich that fixes bug #52597, MCS was generating invalid code for
13198 idisposable structs. Thanks to Ben for following up with this
13201 2004-01-06 Miguel de Icaza <miguel@ximian.com>
13203 * driver.cs: Allow assemblies without code to be generated, fixes
13206 2004-01-07 Nick Drochak <ndrochak@gol.com>
13208 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
13210 2004-01-05 Miguel de Icaza <miguel@ximian.com>
13212 * cs-parser.jay: Add rules to improve error reporting if fields or
13213 methods are declared at the namespace level (error 116)
13215 * Add rules to catch event add/remove
13217 2004-01-04 David Sheldon <dave-mono@earth.li>
13219 * expression.cs: Added matching ")" to error message for
13222 2004-01-03 Todd Berman <tberman@gentoo.org>
13224 * ecore.cs, attribute.cs:
13225 Applying fix from #52429.
13227 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13229 * ecore.cs, expression.cs, statement.cs:
13230 Total rewrite of how we handle branching. We
13231 now handle complex boolean expressions with fewer
13232 jumps. As well if (x == 0) no longer emits a ceq.
13234 if (x is Foo) is much faster now, because we generate
13237 Overall, we get a pretty big improvement on our benchmark
13238 tests. The code we generate is smaller and more readable.
13240 I did a full two-stage bootstrap. The patch was reviewed
13241 by Martin and Miguel.
13243 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13245 * cs-parser.jay: Make primary_expression not take a QI.
13246 we dont need this because the member_access rule covers
13247 us here. So we replace the rule with just IDENTIFIER.
13249 This has two good effects. First, we remove a s/r conflict.
13250 Second, we allocate many fewer QualifiedIdentifier objects.
13252 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13254 * attribute.cs: Handle MarshalAs attributes as pseudo, and
13255 set the correct information via SRE. This prevents
13256 hanging on the MS runtime. Fixes #29374.
13258 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13260 * convert.cs: correctly handle conversions to value types
13261 from Enum and ValueType as unboxing conversions.
13263 Fixes bug #52569. Patch by Benjamin Jemlich.
13265 2004-01-02 Ravi Pratap <ravi@ximian.com>
13267 * expression.cs (BetterConversion): Prefer int -> uint
13268 over int -> ulong (csc's behaviour). This fixed bug #52046.
13270 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
13272 * decl.cs (MemberCache.FindMembers): now returns a
13275 * typemanager.cs: In general, go with with ^^.
13276 (CopyNewMethods): take an IList.
13277 (RealMemberLookup): Only allocate an arraylist
13278 if we copy from two sets of methods.
13280 This change basically does two things:
13281 1) Fewer array lists allocated due to CopyNewMethods.
13282 2) the explicit cast in MemberList costed ALOT.
13284 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
13286 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
13287 a hashtable to avoid needless string allocations when an identifier is
13288 used more than once (the common case).
13290 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
13292 * pending.cs: MS's TypeBuilder.GetInterfaces ()
13293 is broken, it will not return anything. So, we
13294 have to use the information we have in mcs to
13297 * typemanager.cs: Add a cache for GetInterfaces,
13298 since this will now be used more often (due to ^^)
13300 (GetExplicitInterfaces) New method that gets the
13301 declared, not effective, interfaces on a type
13302 builder (eg, if you have interface IFoo, interface
13303 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
13306 This patch makes MCS able to bootstrap itself on
13309 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
13311 * expression.cs: Remove the Nop's that Miguel put
13314 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
13316 * report.cs, codegen.cs: Give the real stack trace to
13317 the error when an exception is thrown.
13319 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
13321 * decl.cs: only allocate hashtables for ifaces if
13324 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
13326 * expression.cs: fix the error from cs0121-2.cs
13327 (a parent interface has two child interfaces that
13328 have a function with the same name and 0 params
13329 and the function is called through the parent).
13331 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
13333 * class.cs, rootcontext.cs, typmanager.cs: do not
13336 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
13338 * codegen.cs: remove stack for the ec flow branching.
13339 It is already a linked list, so no need.
13341 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
13343 * Makefile: Allow custom profiler here.
13345 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
13347 * typemanager.cs (LookupType):
13348 - Use a static char [], because split takes
13349 a param array for args, so it was allocating
13351 - Do not store true in a hashtable, it boxes.
13353 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
13355 * flowanalysis.cs: bytify common enums.
13357 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
13359 * modifiers.cs: Add a new set of flags for the
13360 flags allowed on explicit interface impls.
13361 * cs-parser.jay: catch the use of modifiers in
13362 interfaces correctly.
13363 * class.cs: catch private void IFoo.Blah ().
13365 All related to bug #50572.
13367 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
13369 * decl.cs: Rewrite the consistant accessability checking.
13370 Accessability is not linear, it must be implemented in
13371 a tableish way. Fixes #49704.
13373 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
13375 * expression.cs: Handle negation in a checked context.
13376 We must use subtraction from zero. Fixes #38674.
13378 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
13380 * class.cs: Ignore static void main in DLLs.
13381 * rootcontext.cs: Handle the target type here,
13382 since we are have to access it from class.cs
13383 * driver.cs: account for the above.
13385 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
13387 * report.cs: Give line numbers and files if available.
13389 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
13391 * driver.cs: Implement /addmodule.
13393 * typemanager.cs: Change 'modules' field so it now contains Modules not
13396 2003-12-20 Martin Baulig <martin@ximian.com>
13398 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
13399 (FieldBase.IsAssigned): Removed this field.
13400 (FieldBase.SetAssigned): New public method.
13401 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
13403 2003-12-20 Martin Baulig <martin@ximian.com>
13405 * expression.cs (LocalVariableReference.DoResolve): Don't set
13406 `vi.Used' if we're called from DoResolveLValue().
13408 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
13409 returns the usage vector it just merged into the current one -
13410 pass this one to UsageWarning().
13411 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
13412 of the `EmitContext', don't call this recursively on our children.
13414 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
13416 * driver.cs: Implement /target:module.
13418 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
13420 * support.cs (CharArrayHashtable): New helper class.
13422 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
13423 char arrays, not strings, so we can avoid creating a string in
13424 consume_identifier if the identifier is a keyword.
13426 2003-12-16 Martin Baulig <martin@ximian.com>
13428 * statement.cs (LocalInfo.Assigned): Removed this property.
13429 (LocalInfo.Flags): Removed `Assigned'.
13430 (LocalInfo.IsAssigned): New public method; takes the EmitContext
13431 and uses flow analysis.
13432 (Block.UsageWarning): Made this method private.
13433 (Block.Resolve): Call UsageWarning() if appropriate.
13435 * expression.cs (LocalVariableReference.DoResolve): Always set
13436 LocalInfo.Used here.
13438 2003-12-13 Martin Baulig <martin@ximian.com>
13440 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
13441 any value here; we're now using flow analysis to figure out
13442 whether a statement/block returns a value.
13444 2003-12-13 Martin Baulig <martin@ximian.com>
13446 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
13448 (FlowBranching.MergeFinally): Don't call
13449 `branching.CheckOutParameters()' here, this is called in
13451 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
13452 when adding the `finally' vector.
13454 2003-12-13 Martin Baulig <martin@ximian.com>
13457 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
13458 actually work and also fix #48962.
13460 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
13462 * decl.cs: Do not check System.Object for nested types,
13463 since we know it does not have any. Big bang for buck:
13466 Run 1: 8.35 seconds
13467 Run 2: 8.32 seconds
13468 corlib: 17.99 seconds
13470 Run 1: 8.17 seconds
13471 Run 2: 8.17 seconds
13472 corlib: 17.39 seconds
13474 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
13476 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
13477 time we are returning 0 members, so we save alot here.
13479 2003-12-11 Martin Baulig <martin@ximian.com>
13481 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
13482 `MergeChild()', also just take the `FlowBranching' as argument;
13483 call Merge() on it and return the result.
13484 (FlowBranching.Merge): We don't need to do anything if we just
13487 2003-12-11 Martin Baulig <martin@ximian.com>
13489 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
13490 them in an `ArrayList' to reduce memory usage. Thanks to Ben
13491 Maurer for this idea.
13493 2003-12-11 Martin Baulig <martin@ximian.com>
13495 * flowanalysis.cs (MergeResult): This class is now gone; we now
13496 use the `UsageVector' for this. The reason for this is that if a
13497 branching just has one sibling, we don't need to "merge" them at
13498 all - that's the next step to do.
13499 (FlowBranching.Merge): We now return a `UsageVector' instead of a
13502 2003-12-11 Martin Baulig <martin@ximian.com>
13504 Reworked flow analyis and made it more precise and bug-free. The
13505 most important change is that we're now using a special `Reachability'
13506 class instead of having "magic" meanings of `FlowReturns'. I'll
13507 do some more cleanups and optimizations and also add some more
13508 documentation this week.
13510 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
13511 largely reworked this class.
13512 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
13513 the new `Reachability' class instead of having "magic" values here.
13514 (FlowBranching): We're now using an instance of `Reachability'
13515 instead of having separate `Returns', `Breaks' etc. fields.
13517 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
13518 based on flow analysis; ignore the return value of block.Emit ().
13520 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
13522 * driver.cs typemanager.cs: Find the mono extensions to corlib even
13523 if they are private.
13525 2003-12-09 Martin Baulig <martin@ximian.com>
13527 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
13528 call them directly on the UsageVector.
13530 2003-12-09 Martin Baulig <martin@ximian.com>
13532 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
13533 Changed return type from `FlowReturns' to `Reachability'.
13535 2003-12-09 Martin Baulig <martin@ximian.com>
13537 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
13538 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
13539 `Reachable' fields with a single `Reachability' one.
13541 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13543 * class.cs (FindMembers): Remove foreach's.
13548 Run 1: 8.74 seconds
13549 Run 2: 8.71 seconds
13552 Run 1: 8.64 seconds
13553 Run 2: 8.58 seconds
13556 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13561 This patch does a few things:
13562 1. EmptyStatement is now a singleton, so it is never reallocated.
13563 2. All blah is EmptyStatement constructs have been changed to
13564 blah == EmptyStatement.Value, which is much faster and valid
13565 now that EmptyStatement is a singleton.
13566 3. When resolving a block, rather than allocating a new array for
13567 the non-empty statements, empty statements are replaced with
13568 EmptyStatement.Value
13569 4. Some recursive functions have been made non-recursive.
13570 Mainly the performance impact is from (3), however (1) and (2) are needed for
13571 this to work. (4) does not make a big difference in normal situations, however
13572 it makes the profile look saner.
13577 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13578 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13579 Total memory allocated: 56397 KB
13582 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
13583 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
13584 Total memory allocated: 55666 KB
13586 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13588 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
13589 than the hashtable in a hashtable version
13591 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
13592 we always end up concating a string. This results in a huge perf
13593 loss, because many strings have to be tracked by the GC. In this
13594 patch, we first use a hashtable that works with two keys, so that
13595 the strings do not need to be concat'ed.
13599 Run 1: 8.74 seconds
13600 Run 2: 8.71 seconds
13603 Run 1: 8.65 seconds
13604 Run 2: 8.56 seconds
13606 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13608 * Makefile: Add a new target `do-time' that does a quick and simple
13609 profile, leaving easy to parse output.
13611 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
13613 * codegen.cs (Init): Create the dynamic assembly with
13614 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
13616 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
13618 * support.cs: Make the PtrHashtable use only one
13619 instance of its comparer.
13621 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
13623 * typemanager.cs: Fix lookup of GetNamespaces.
13625 2003-11-29 Miguel de Icaza <miguel@ximian.com>
13627 * expression.cs: Removed redundant line.
13629 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
13630 ArrayLists, use for loops with bounds.
13632 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
13635 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
13636 arraylists, use for loop with bounds.
13638 The above three changes give us a 0.071 second performance
13639 improvement out of 3.294 seconds down to 3.223. On my machine
13640 the above changes reduced the memory usage by 1,387 KB during
13641 compiler bootstrap.
13643 * cs-parser.jay (QualifiedIdentifier): New class used to represent
13644 QualifiedIdentifiers. Before we created a new string through
13645 concatenation, and mostly later on, the result would be
13646 manipulated by DecomposeQI through string manipulation.
13648 This reduced the compiler memory usage for bootstrapping from
13649 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
13650 compile times in 0.05 seconds.
13652 2003-11-28 Dick Porter <dick@ximian.com>
13654 * support.cs: Do string compares with the Invariant culture.
13662 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
13663 the comparison is done with the Invariant culture.
13665 2003-11-27 Miguel de Icaza <miguel@ximian.com>
13667 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
13668 GetEnumerator method.
13670 (ProbeCollectionType): Iterate starting at the most specific type
13671 upwards looking for a GetEnumerator
13673 * expression.cs: Shift count can be up to 31 for int/uint and 63
13676 2003-11-26 Miguel de Icaza <miguel@ximian.com>
13678 * statement.cs (Block.LookupLabel): Also look for the label on the
13679 children blocks. Use a hash table to keep track of visited
13682 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
13683 we actually did transform the other operand, otherwise fall back
13684 to the common codepath that casts to long.
13686 * cs-tokenizer.cs: Use the same code pattern as the int case.
13687 Maybe I should do the parsing myself, and avoid depending on the
13688 Parse routines to get this done.
13690 2003-11-25 Miguel de Icaza <miguel@ximian.com>
13692 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
13693 which fixes bug 51347. This time test it.
13695 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
13696 attributes for example can not tell the difference between these.
13697 The difference was only a syntax feature of the language.
13699 * attribute.cs: Apply attributes to delegates.
13701 * delegate.cs: Call the apply attributes method.
13703 2003-11-24 Miguel de Icaza <miguel@ximian.com>
13705 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
13706 comparing 0 vs Byte.MinValue, not the value
13708 (ImplicitConversionRequired): When reporting a conversion error,
13709 use error 31 to print out the constant error instead of the
13712 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
13713 which fixes bug 51347.
13715 2003-11-22 Miguel de Icaza <miguel@ximian.com>
13717 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
13718 which fixes the -warnaserror command line option.
13720 2003-11-21 Miguel de Icaza <miguel@ximian.com>
13722 * cfold.cs (DoNumericPromotions): During constant folding of
13723 additions on UIntConstant, special case intconstants with
13724 IntConstants like we do on the expression binary operator.
13726 2003-11-12 Miguel de Icaza <miguel@ximian.com>
13728 * convert.cs (ImplicitReferenceConversion): We were missing a case
13729 (System.Enum are not value types or class types, so we need to
13730 classify them separatedly).
13732 * driver.cs: We do not support error 2007.
13734 2003-11-12 Jackson Harper <jackson@ximian.com>
13736 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
13737 system directory. Also use the full file name so users can
13738 libraries names mscorlib-o-tron.dll in a non system dir.
13740 2004-01-04 David Sheldon <dave-mono@earth.li>
13742 * expression.cs: Added matching ")" to error message for CS0077.
13744 2003-12-19 Martin Baulig <martin@ximian.com>
13746 * typemanager.cs (TypeManager.IsEqualGenericType): New public
13747 static method; see documentation in the method.
13748 (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
13750 * convert.cs (Convert.ImplicitReferenceConversion,
13751 Convert.ImplicitReferenceConversionExists): Add support for
13752 generic type declarations; see gen-36.cs.
13754 2003-12-19 Martin Baulig <martin@ximian.com>
13756 * pending.cs (Pending.InterfaceMethod): Use
13757 `Type.IsAssignableFrom()' instead of `=='.
13759 2003-12-18 Martin Baulig <martin@ximian.com>
13761 * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
13764 * convert.cs (Convert.ImplicitStandardConversionExists): Use
13765 `expr_type.Equals (target_type)' instead of `=='.
13767 2003-12-08 Martin Baulig <martin@ximian.com>
13769 * generics.cs (Constraints.Types): Removed.
13770 (Constraints.Resolve): Just resolve everything to TypeExpr's, not
13772 (Constraints.ResolveTypes): New public method; resolves the
13773 TypeExpr's to Type's.
13774 (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
13775 longer takes the constraints.
13776 (TypeParameter.DefineMethod): Likewise.
13777 (TypeParameter.DefineType): New public method. Calls
13778 `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
13781 2003-12-08 Martin Baulig <martin@ximian.com>
13783 * convert.cs (Convert.ImplicitConversionStandard): Use
13784 `expr_type.Equals (target_type)' instead of `=='.
13786 2003-12-08 Martin Baulig <martin@ximian.com>
13788 * typemanager.cs (TypeManager.GetReferenceType): Call
13789 `Type.MakeByRefType ()'.
13791 2003-12-08 Martin Baulig <martin@ximian.com>
13793 * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
13794 just has some special meaning in some situations. For instance,
13795 it is allowed to use `where' as the name of a variable etc.
13797 2003-12-04 Martin Baulig <martin@ximian.com>
13799 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
13800 `Type.MakeArrayType()' for array types.
13802 2003-11-18 Miguel de Icaza <miguel@ximian.com>
13804 * expression.cs (Invocation.VerifyArgumentsCompat): Remove
13807 (SizeOf.DoResolve): assign the `type_queried' field. This gets
13810 2003-11-16 Martin Baulig <martin@ximian.com>
13812 * codegen.cs (EmitContext.IsGeneric): Removed.
13814 * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
13815 ResolveGeneric() on the DeclSpace.
13817 2003-11-16 Martin Baulig <martin@ximian.com>
13819 * generic.cs (TypeArguments.Resolve):
13820 `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
13821 `ResolveType()' on it to get the Type.
13823 2003-11-15 Martin Baulig <martin@ximian.com>
13825 * generic.cs (ConstructedType.GetInterfaces): Override this.
13827 2003-11-14 Martin Baulig <martin@ximian.com>
13829 * interface.cs (Interface.DefineType): Define all type parameters
13830 before adding the interfaces we inherit.
13832 2003-11-11 Martin Baulig <martin@ximian.com>
13834 * generic.cs (ConstructedType.ResolveType): Always call
13835 `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
13837 2003-11-10 Martin Baulig <martin@ximian.com>
13839 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
13840 (TypeManager.InitCoreTypes): Initialize them here, but instead of
13841 calling `ResolveType()' on them, directly assign their `Type'.
13843 2003-11-08 Martin Baulig <martin@ximian.com>
13845 * generic.cs (ConstructedType): Override `IsClass' etc.
13847 2003-11-08 Martin Baulig <martin@ximian.com>
13849 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
13850 return value and the `out parent' parameter.
13851 (TypeContainer.DefineType): Moved the CS0644 check into
13852 GetClassBases(). Don't pass the interface types to the
13853 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
13854 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
13856 * ecore.cs (TypeExpr.IsAttribute): New property.
13857 (TypeExpr.GetInterfaces): New method.
13859 * interface.cs (Interface.GetInterfaceTypeByName): Return a
13860 TypeExpr instead of a Type.
13861 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
13862 (Interface.DefineType): Don't pass the interface types to the
13863 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
13864 them later and then call `TypeBulider.AddInterfaceImplementation()'.
13866 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
13867 instead of a `Type[]'.
13868 (TypeManager.RegisterBuilder): Likewise.
13869 (TypeManager.AddUserInterface): Likewise.
13870 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
13871 `Type[]' and also return a `TypeExpr[]'.
13872 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
13874 2003-11-08 Martin Baulig <martin@ximian.com>
13876 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
13879 2003-11-08 Martin Baulig <martin@ximian.com>
13881 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
13882 TypeManager.ResolveExpressionTypes().
13884 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
13885 instead of an Expression.
13886 (TypeExpr): This is now an abstract base class for `TypeExpression'.
13887 (TypeExpression): New public class; formerly known as `TypeExpr'.
13889 * expression.cs (ComposedCast): Derive from TypeExpr.
13891 * typemanager.cs (TypeManager.system_*_expr): These are now
13892 TypExpr's instead of Expression's.
13893 (TypeManager.ResolveExpressionTypes): New public static function;
13894 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
13897 2003-11-06 Miguel de Icaza <miguel@ximian.com>
13899 * expression.cs (New.DoResolve): Do not dereference value that
13900 might be a null return.
13902 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
13903 sure that the constant value has the right type. Fixes an
13904 unreported bug, similar to 50425.
13906 * const.cs (Const.LookupConstantValue): Call
13907 ImplicitStandardConversionExists before doing a conversion to
13908 avoid havng the TypeManager.ChangeType do conversions.
13910 Reduced the number of casts used
13912 (Const.ChangeType): New routine to enable reuse of the constant
13913 type changing code from statement.
13915 * typemanager.cs (ChangeType): Move common initialization to
13916 static global variables.
13920 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
13921 every value type to go through, even if it was void. Fix that.
13923 * cs-tokenizer.cs: Use is_identifier_start_character on the start
13924 character of the define, and the is_identifier_part_character for
13925 the rest of the string.
13927 2003-11-05 Miguel de Icaza <miguel@ximian.com>
13929 * expression.cs (UnaryMutator.EmitCode): When I updated
13930 LocalVariableReference.DoResolve, I overdid it, and dropped an
13931 optimization done on local variable references.
13933 2003-11-04 Miguel de Icaza <miguel@ximian.com>
13935 * ecore.cs: Convert the return from Ldlen into an int.
13937 2003-10-20 Miguel de Icaza <miguel@ximian.com>
13939 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
13940 the accessibility, this is a special case for toplevel non-public
13941 classes (internal for instance).
13943 2003-10-20 Nick Drochak <ndrochak@gol.com>
13945 * ecore.cs: Fix typo and build. Needed another right paren.
13947 2003-10-19 Miguel de Icaza <miguel@ximian.com>
13949 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
13950 `internal' case regular and protected, but not allowing protected
13951 to be evaluated later. Bug 49840
13953 2003-10-15 Miguel de Icaza <miguel@ximian.com>
13955 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
13956 to kb.Nlast, and not the kb.nFirst to isolate the switch
13959 Extract the underlying type, so enumerations of long/ulong are
13960 treated like long/ulong.
13962 2003-10-14 Miguel de Icaza <miguel@ximian.com>
13964 * expression.cs (New): Overload the meaning of RequestedType to
13965 track the possible creation of the NewDelegate type, since
13966 DoResolve is invoked more than once for new constructors on field
13969 See bugs: #48800 and #37014
13971 * cs-parser.jay (declare_local_constants): Take an arraylist
13972 instead of a single constant.
13974 (local_constant_declaration): It should take a
13975 constant_declarators, not a constant_declarator. Fixes 49487
13977 * convert.cs: Fix error report.
13979 2003-10-13 Jackson Harper <jackson@ximian.com>
13981 * typemanager.cs (TypeToCoreType): Add float and double this fixes
13984 2003-11-03 Martin Baulig <martin@ximian.com>
13986 * expression.cs (ArrayAccess.GetStoreOpcode): Added
13987 `out bool has_type_arg'; if set, we need to pass the type to
13989 (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
13990 Stelem_Any/Ldelem_Any for generic parameters.
13992 2003-11-02 Martin Baulig <martin@ximian.com>
13994 * expression.cs (Invocation.EmitCall): Use
13995 `TypeManager.IsValueType()' to check whether it's a value type.
13996 Don't set `struct_call' when calling a method on a type parameter.
13998 2003-11-02 Martin Baulig <martin@ximian.com>
14000 * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
14001 and removed the TypeBuilder argument.
14003 * typemanager.cs (TypeManager.IsValueType): Return
14004 `t.IsGenericParameter || t.IsValueType'.
14006 2003-10-25 Martin Baulig <martin@ximian.com>
14008 * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
14009 call ConstructedType.Resolve() on it.
14011 * generic.cs (ConstructedType.Resolve): Set `type' on success.
14013 2003-10-25 Martin Baulig <martin@ximian.com>
14015 * class.cs (TypeContainer.GetClassBases): Changed
14016 `out Type parent' into `out TypeExpr parent'. Moved CS0644 and
14017 CS8214 reporting here.
14018 (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
14019 instead of a `Type' for our parent. In case of a recursive
14020 declaration (see tests/gen-23.cs for an example), our parent is a
14021 ConstructedType and it doesn't have its type set. So, first
14022 create our own TypeBuilder, then call constructed.Resolve() to get
14023 the parent's type and finally TypeBuilder.SetParent() it.
14025 * ecore.cs (TypeExpr.Name): New public virtual property.
14028 (ConstructedType): We're now a TypeExpr and not just an Expression.
14029 (ConstructedType.ResolveAsTypeStep): Don't resolve our type
14030 arguments here; this is done later.
14031 (ConstructedType.Resolve): New public method to resolve the type
14032 arguments and bind them.
14034 2003-10-21 Martin Baulig <martin@ximian.com>
14036 * convert.cs: Use `TypeManager.IsValueType' instead of
14037 'type.IsValueType' everywhere.
14039 * typemanager.cs (TypeManager.IsValueType): Return true for type
14040 parameters. The reason for this is that we need to box a type
14041 parameter when converting it to a reference type.
14043 * cs-parser.jay: Added support for default value expressions.
14045 * generics.cs (DefaultValueExpression): New public class.
14047 2003-10-17 Martin Baulig <martin@ximian.com>
14049 * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
14050 TypeContainer so we can also use this for Interfaces.
14051 (TypeParameter.Resolve): Likewise.
14053 * interface.cs (Interface.DefineType): Added support for generic
14056 * cs-parser.jay: Added support for generic structs and interfaces.
14058 2003-10-17 Martin Baulig <martin@ximian.com>
14060 * generic.cs (GenericMemberAccess.DoResolve): We can now actually
14061 call generic methods :-)
14063 2003-10-16 Martin Baulig <martin@ximian.com>
14065 * cs-parser.jay (namespace_or_type_name): Only create a
14066 GenericMemberAccess if we actually have type arguments.
14068 2003-10-13 Martin Baulig <martin@ximian.com>
14070 * class.cs (Method.Define): If we're a generic method, call
14071 TypeBuilder.DefineGenericMethod () before resolving
14073 (MethodData): Added .ctor which takes an additional MethodBuilder
14074 argument; this is used for generic methods.
14075 (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
14076 we already have a MethodBuilder.
14078 2003-10-10 Martin Baulig <martin@ximian.com>
14080 * class.cs (Method): Added .ctor which takes a `GenericMethod'
14081 instead of a `DeclSpace'. This is used for generic methods.
14083 * cs-parser.jay (method_header): Added support for generic
14084 methods; create a `GenericMethod' instance and pass it to the
14085 `Method's .ctor; it'll be used as the `DeclSpace' to lookup
14086 parameters and locals.
14088 * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
14089 since we already have the location. Check whether we're a generic
14090 type declaration or a generic method and create the correct type
14093 * generic.cs (TypeParameter.DefineMethod): New public method.
14094 (GenericMethod): New public class; derives from DeclSpace and is
14095 used for generic methods.
14097 2003-10-09 Martin Baulig <martin@ximian.com>
14099 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
14101 (MethodCore.DoDefineParameters): Removed the TypeContainer
14102 argument; use the DeclSpace which was passed to the .ctor instead.
14103 (MethodCore.CheckParameter): Take a DeclSpace instead of a
14104 TypeContainer; we only need a DeclSpace here.
14106 2003-10-09 Martin Baulig <martin@ximian.com>
14108 * class.cs (MethodData): Added additional `DeclSpace ds' argument
14110 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
14111 EmitContext's .ctor.
14113 2003-10-09 Martin Baulig <martin@ximian.com>
14115 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
14116 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
14117 AsAccessible(), moved them as well.
14119 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
14121 2003-10-07 Miguel de Icaza <miguel@ximian.com>
14123 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
14124 generation for >=, as spotted by Paolo, bug 48679.
14125 Patch from David Waite.
14127 * cs-tokenizer.cs: Add handling for #pragma.
14129 * cs-parser.jay: Allow for both yield and yield return in the
14130 syntax. The anti-cobolization of C# fight will go on!
14132 * class.cs (TypeBuilder.DefineType): Catch error condition here
14133 (Parent.DefineType erroring out and returning null).
14135 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14136 coping with enumerations variables, we were mistakenly processing
14137 them as a regular value type instead of built-in types. Fixes the
14140 * typemanager.cs (IsBuiltinOrEnum): New method.
14142 2003-09-30 Miguel de Icaza <miguel@ximian.com>
14144 * cs-parser.jay: Upgrade: yield now needs the return clause.
14146 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
14148 * cs-parser.jay : Renamed yyName to yyNames related to jay.
14150 2003-09-29 Martin Baulig <martin@ximian.com>
14152 * typemanager.cs (TypeManager.GetMethodFlags): Added support for
14153 inflated generic methods.
14155 * generics.cs (ConstructedType): Distinguish between open and
14156 closed constructed types; correctly resolve the arguments.
14158 2003-09-22 Martin Baulig <martin@ximian.com>
14160 * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
14161 all type arguments meet their constraints.
14163 2003-09-19 Martin Baulig <martin@ximian.com>
14165 * decl.cs (MemberCache.SetupCacheForInterface): Take a
14166 `MemberCache parent' argument. Normally, an interface doesn't
14167 have a parent type except System.Object, but we use this in gmcs
14168 for generic type parameters.
14170 2003-09-18 Martin Baulig <martin@ximian.com>
14172 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
14173 on `type.IsInterface'; don't check whether the type has a parent
14174 to determine whether it's an interface.
14176 2003-09-17 Martin Baulig <martin@ximian.com>
14178 * generic.cs (ConstructedType.ToString): Always use `name' as the
14181 2003-09-15 Martin Baulig <martin@ximian.com>
14183 * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
14185 * generic.cs (Constraints.Resolve): New public method; this is
14186 called to resolve the constraint types and to check whether all
14187 the constraints are correct.
14188 (Constraints.Types): New public property.
14189 (TypeParameter.Resolve): New public method; resolves all the
14190 type's constraints.
14192 * class.cs (TypeContainer.DefineType): Call
14193 TypeParameter.Resolve() before actually defining the type.
14195 2003-09-15 Martin Baulig <martin@ximian.com>
14197 * class.cs (TypeContainer.DefineType): Added an error flag to
14198 avoid reporting duplicate CS0146's ("class definition is
14201 * driver.cs (Driver.MainDriver): Abort if
14202 RootContext.ResolveTree() reported any errors.
14204 2003-09-07 Martin Baulig <martin@ximian.com>
14206 * report.cs (Error, Warning): Added overloaded versions which take
14207 a `params object[] args' and call String.Format().
14209 2003-09-07 Martin Baulig <martin@ximian.com>
14211 * decl.cs (DeclSpace..ctor): Don't call
14212 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
14213 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
14214 (DeclSpace.RecordDecl): New method.
14216 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
14218 2003-09-02 Ravi Pratap <ravi@ximian.com>
14220 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
14221 value attributes to be applied to ParameterBuilders.
14223 * class.cs (MethodCore.LabelParameters): Make static and more
14224 generic so that it can be used from other places - like interface
14225 methods, for instance.
14227 * interface.cs (Interface.Emit): Call LabelParameters before
14228 emitting attributes on the InterfaceMethod.
14230 2003-09-07 Martin Baulig <martin@ximian.com>
14232 * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
14233 if the number of type parameters doesn't match.
14235 2003-09-04 Martin Baulig <martin@ximian.com>
14237 * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
14238 for arrays of generic type params (ie. `!0[]').
14240 2003-09-04 Martin Baulig <martin@ximian.com>
14242 * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
14245 2003-09-04 Martin Baulig <martin@ximian.com>
14247 * decl.cs (DeclSpace.LookupGeneric): New method.
14248 (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
14251 * generic.cs (TypeParameterExpr): Take a TypeParameter as
14252 argument, not just a string.
14253 (TypeParameter.Define): New public method; this is called to
14254 actually define the generic parameter; after this, you can use the
14255 new `Type' property to get the type.
14257 2003-09-04 Martin Baulig <martin@ximian.com>
14259 * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
14260 is now an ArrayList; initialize the result of the `TypeParameters'
14262 (DeclSpace.GetGenericData): Removed.
14263 (DeclSpace.LookupGeneric): Temporarily removed; we need to
14264 implement this in a different way.
14265 (DeclSpace.GetTypeParameters): Removed; there's now a
14266 `TypeParameters' property.
14267 (DeclSpace.TypeParameters): New public property.
14269 * generic.cs (Constraints): Make this class public.
14270 (TypeParameter): New public class.
14272 2003-09-04 Martin Baulig <martin@ximian.com>
14274 * decl.cs (DeclSpace.GetTypeParameters): New method to return the
14275 generic parameters.
14277 * class.cs (TypeContainer.DefineType): Call
14278 TypeBuilder.DefineGenericParameter () on all generic parameters if
14279 this is a generic type.
14281 2003-08-28 Martin Baulig <martin@ximian.com>
14283 * sample-stack.il: Compile this with ilasm: "ilasm /dll
14286 * sample-hello.cs: Compile this with gmcs: "gmcs
14287 /r:sample-stack.dll sample-hello.cs".
14289 2003-08-28 Martin Baulig <martin@ximian.com>
14291 * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
14292 the parameters to the generic type.
14294 2003-08-28 Martin Baulig <martin@ximian.com>
14296 * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
14298 2003-08-28 Martin Baulig <martin@ximian.com>
14300 * cs-parser.jay (opt_type_argument_list): Use
14301 `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
14302 (primary_expression): Replace `qualified_identifier' with `type_name'.
14303 (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
14305 * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
14306 parser to check whether it is syntactically a type parameter list;
14307 return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
14310 2003-08-26 Martin Baulig <martin@ximian.com>
14312 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
14313 resolving aliases; fixes #47927.
14315 2003-08-26 Martin Baulig <martin@ximian.com>
14317 * statement.cs (Using.DoResolve): This is internally emitting a
14318 try/finally clause, so we need to set ec.NeedExplicitReturn if we
14319 do not always return. Fixes #47681.
14321 2003-08-26 Martin Baulig <martin@ximian.com>
14323 * decl.cs (MemberCore): Moved WarningNotHiding(),
14324 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
14326 (AdditionResult): Make this nested in DeclSpace.
14327 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
14328 argument; call NamespaceEntry.Define() unless we're nested in a
14331 * namespace.cs (Namespace.DefineName): New public function. This
14332 is called from DeclSpace's .ctor to add
14333 (Namespace.Lookup): Include DeclSpaces in the lookup.
14335 * class.cs (Operator): Derive from MemberBase, not MemberCore.
14337 * const.cs (Const): Derive from MemberBase, not MemberCore.
14339 2003-08-25 Martin Baulig <martin@ximian.com>
14341 * convert.cs (Convert.ExplicitReferenceConversion): When
14342 converting from an interface type to a class, unbox if the target
14343 type is a struct type. Fixes #47822.
14345 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14347 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
14350 2003-08-22 Martin Baulig <martin@ximian.com>
14352 * class.cs (TypeManager.DefineType): When defining a nested type,
14353 call DefineType() on our parent; fixes #47801.
14355 2003-08-22 Martin Baulig <martin@ximian.com>
14357 * class.cs (MethodData.Define): While checking if a method is an
14358 interface implementation, improve the test a bit more to fix #47654.
14360 2003-08-22 Martin Baulig <martin@ximian.com>
14362 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
14363 correctly; fixes #47722.
14365 2003-08-22 Martin Baulig <martin@ximian.com>
14367 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
14368 LocalVariableReference, ensure it's not read-only. Fixes #47536.
14370 * statement.cs (Fixed.DoResolve): Make all variables read-only.
14372 2003-08-22 Martin Baulig <martin@ximian.com>
14374 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
14375 can only be assigned in static constructors. Fixes #47161.
14377 2003-08-22 Martin Baulig <martin@ximian.com>
14379 Rewrote and improved the flow analysis code.
14381 * flowbranching.cs (FlowBranching): Make this class abstract.
14382 (FlowBranching.CreateBranching): New static function to create a
14383 new flow branching.
14384 (FlowBranchingBlock, FlowBranchingException): New classes.
14385 (FlowBranching.UsageVector.Type): New public readonly field.
14386 (FlowBranching.UsageVector.Breaks): Removed the setter.
14387 (FlowBranching.UsageVector.Returns): Removed the setter.
14388 (FlowBranching.UsageVector): Added Break(), Return(),
14389 NeverReachable() and Throw() methods to modify the reachability.
14390 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
14391 done by FlowBranching.Merge().
14392 (FlowBranching.UsageVector.MergeChild): New method; merges the
14393 merge result into the current vector.
14394 (FlowBranching.Merge): New abstract method to merge a branching.
14396 2003-08-12 Martin Baulig <martin@ximian.com>
14398 * expression.cs (Indirection.CacheTemporaries): Create the
14399 LocalTemporary with the pointer type, not its element type.
14401 2003-08-10 Miguel de Icaza <miguel@ximian.com>
14403 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
14404 token was a keyword or not.
14406 Add `error' options where an IDENTIFIER was expected; Provide
14407 CheckToken and CheckIdentifierToken convenience error reporting
14410 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
14412 * decl.cs: Rename `NamespaceEntry Namespace' public field into
14413 NameSpaceEntry NameSpaceEntry.
14415 (LookupInterfaceOrClass): Avoid creating a full qualified name
14416 from namespace and name: avoid doing lookups when we know the
14417 namespace is non-existant. Use new Tree.LookupByNamespace which
14418 looks up DeclSpaces based on their namespace, name pair.
14420 * driver.cs: Provide a new `parser verbose' to display the
14421 exception thrown during parsing. This is turned off by default
14422 now, so the output of a failure from mcs is more graceful.
14424 * namespace.cs: Track all the namespaces defined in a hashtable
14427 (IsNamespace): New method
14429 2003-08-09 Miguel de Icaza <miguel@ximian.com>
14431 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
14432 we know that we need to concatenate (full typename can never be
14437 * statement.cs: Use a bitfield; Do not initialize to null things
14438 which are done by the constructor by default.
14440 * cs-parser.jay: bug fix, parameter was 4, not 3.
14442 * expression.cs: Just use the property;
14444 * statement.cs: No need for GetVariableInfo method.
14446 2003-08-08 Martin Baulig <martin@ximian.com>
14448 * flowanalysis.cs (FlowReturns): This is now nested in the
14449 `FlowBranching' class.
14450 (MyBitVector): Moved this here from statement.cs.
14451 (FlowBranching.SiblingType): New enum type.
14452 (FlowBranching.CreateSibling): Added `SiblingType' argument.
14454 2003-08-07 Martin Baulig <martin@ximian.com>
14456 * flowanalysis.cs (FlowBranchingType): This is now nested in the
14457 `FlowBranching' class and called `BranchingType'.
14459 2003-08-07 Martin Baulig <martin@ximian.com>
14461 * flowanalysis.cs: Moved all the control flow analysis code into
14464 2003-08-07 Martin Baulig <martin@ximian.com>
14466 * assign.cs (Assign.DoResolve): `target' must either be an
14467 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
14470 2003-08-07 Miguel de Icaza <miguel@ximian.com>
14472 * expression.cs (BinaryMethod): This kind of expression is created by the
14473 Binary class if it determines that the operator has to be handled
14476 (BinaryDelegate): This kind of expression is created if we are
14477 dealing with a + or - operator on delegates.
14479 (Binary): remove method, argumetns, and DelegateOperator: when
14480 dealing with methods,
14482 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
14484 * statement.cs (Block): use bitfields for the three extra booleans
14485 we had in use. Remove unused topblock parameter.
14487 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
14489 * assign.cs: Drop extra unneeded tests.
14491 2003-08-06 Miguel de Icaza <miguel@ximian.com>
14493 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
14495 * statement.cs (Foreach): Use VariableStorage instead of
14498 * codegen.cs (VariableStorage): New class used by clients that
14499 require a variable stored: locals or fields for variables that
14500 need to live across yield.
14502 Maybe provide a convenience api for EmitThis+EmitLoad?
14504 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
14507 2003-08-05 Miguel de Icaza <miguel@ximian.com>
14509 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
14510 RemapParameterLValue): New methods that are used to turn a
14511 precomputed FieldInfo into an expression like this:
14515 The idea is to use this instead of making LocalVariableReference
14516 have more than one meaning.
14518 * cs-parser.jay: Add error production to BASE.
14520 * ecore.cs: Deal with TypeManager.GetField returning null, which
14521 is now a valid return value.
14523 (FieldExprNoAddress): New expression for Fields whose address can
14526 * expression.cs (LocalVariableReference): During the resolve
14527 phases, create new expressions if we are in a remapping context.
14528 Remove code that dealt with remapping here.
14530 (ParameterReference): same.
14532 (ProxyInstance): New expression, like the `This' expression, but
14533 it is born fully resolved. We know what we are doing, so remove
14534 the errors that are targeted to user-provided uses of `this'.
14536 * statement.cs (Foreach): our variable is now stored as an
14537 Expression; During resolution, follow the protocol, dont just
14538 assume it will return this.
14540 2003-08-06 Martin Baulig <martin@ximian.com>
14542 * support.cs (SeekableStreamReader.cs): New public class.
14544 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
14545 SeekableStreamReader instead of the normal StreamReader.
14547 2003-08-04 Martin Baulig <martin@ximian.com>
14549 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
14550 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
14551 deambiguate casts and delegate invocations.
14552 (parenthesized_expression): Use the new tokens to ensure this is
14553 not a cast of method invocation.
14555 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
14556 when reading a `)' and Deambiguate_CloseParens () was previously
14559 * expression.cs (ParenthesizedExpression): New class. This is
14560 just used for the CS0075 test.
14561 (Binary.DoResolve): Check for CS0075.
14563 2003-07-29 Ravi Pratap <ravi@ximian.com>
14565 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
14566 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
14567 reference comparison.
14569 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
14570 examine the ReturnType for equality - this is necessary in the
14571 cases of implicit and explicit operators whose signature also
14572 includes the return type.
14574 2003-07-26 Miguel de Icaza <miguel@ximian.com>
14576 * namespace.cs: Cache the result of the namespace computation,
14577 instead of computing it every time.
14579 2003-07-24 Miguel de Icaza <miguel@ximian.com>
14581 * decl.cs: Use a global arraylist that we reuse over invocations
14582 to avoid excesive memory consumption. Reduces memory usage on an
14583 mcs compile by one meg (45 average).
14585 * typemanager.cs (LookupTypeReflection): In .NET pointers are
14586 private, work around that.
14588 2003-07-23 Miguel de Icaza <miguel@ximian.com>
14590 * literal.cs (IntLiteral): Define Zero and One static literals.
14592 * cs-parser.jay (integer_literal): use static literals to reduce
14593 memory usage for the most used literals (0, 1 and -1). 211kb
14594 reduced in memory usage.
14596 Replace all calls to `new ArrayList' with `new
14597 ArrayList(4)' which is a good average number for most allocations,
14598 and also requires only 16 bytes of memory for its buffer by
14601 This reduced MCS memory usage in seven megabytes for the RSS after
14604 2003-07-28 Ravi Pratap <ravi@ximian.com>
14606 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
14607 handle params methods the correct way by forming only one
14608 applicable set with params and normal methods in them. Earlier we
14609 were looking at params methods only if we found no normal methods
14610 which was not the correct thing to do.
14612 (Invocation.BetterFunction): Take separate arguments indicating
14613 when candidate and the best method are params methods in their
14616 This fixes bugs #43367 and #46199.
14618 * attribute.cs: Documentation updates.
14620 (CheckAttribute): Rename to CheckAttributeTarget.
14621 (GetValidPlaces): Rename to GetValidTargets.
14623 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
14624 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
14628 2003-07-28 Miguel de Icaza <miguel@ximian.com>
14630 * codegen.cs: Compute IsGeneric correctly.
14632 * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
14635 Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
14636 OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN. There were too many
14637 regressions, and I was chasing more bugs than I required.
14639 * interface.cs: Use expressions for base type names (like classes
14640 and structs have been doing for a while now), and resolve that.
14641 This patch should probably go into head as well.
14643 This makes it one less user of FindType.
14645 2003-07-24 Miguel de Icaza <miguel@ximian.com>
14647 This compiler can not self host currently. Need to fix that.
14649 * Makefile: compile to `gmcs.exe'
14651 * driver.cs: Turn on v2 by default on gmcs.
14653 * generic.cs (ConstructedType): Does no longer take a container
14654 type argument; That will be taken care of later.
14656 (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
14657 Use SimpleName to resolve for now, so we can continue the work on
14658 the parser, until we get Type.GetType that understands generics.
14660 (ConstructedType.ToString): Implement
14662 (TypeArguments.Resolve): Resolve the child expressions as types.
14664 * cs-parser.jay: Rename interface_constraints to
14665 type_parameter_constraints
14667 (namespace_or_type_name): Only use constructed types for the basic
14668 construction, we will deal with identifier<...> later.
14670 (type/type_name): No longer call DecomposeQI, as
14671 namespace_or_type_name is always decoded now.
14673 2003-07-22 Ravi Pratap <ravi@ximian.com>
14675 * expression.cs (Invocation.OverloadResolve): Follow the spec more
14676 closely: we eliminate methods in base types when we have an
14677 applicable method in a top-level type.
14679 Please see section 14.5.5.1 for an exact description of what goes
14682 This fixes bug #45127 and a host of other related to corlib compilation.
14684 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
14685 array is the method corresponding to the top-level type (this is
14686 because of the changes made to icall.c) so we change this
14689 (MethodGroupExpr.Name): This too.
14691 * typemanager.cs (GetElementType): New method which does the right
14692 thing when compiling corlib.
14694 * everywhere: Make use of the above in the relevant places.
14696 2003-07-22 Martin Baulig <martin@ximian.com>
14698 * cs-parser.jay (invocation_expression): Moved
14699 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
14700 `cast_expression', but create a InvocationOrCast which later
14701 resolves to either an Invocation or a Cast.
14703 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
14704 method; call this before EmitStatement() to make sure that this
14705 expression can be used as a statement.
14707 * expression.cs (InvocationOrCast): New class; resolves to either
14708 an Invocation or a Cast.
14710 * statement.cs (StatementExpression): Call ResolveStatement() on
14711 the ExpressionStatement before emitting it.
14713 2003-07-21 Martin Baulig <martin@ximian.com>
14715 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
14716 `ref' and `out' attributes match; fixes #46220.
14717 (MemberAccess.ResolveMemberAccess): You can't reference a type
14718 through an expression; fixes #33180.
14719 (Indexers.GetIndexersForType): Don't return the indexers from
14720 interfaces the class implements; fixes #46502.
14722 2003-07-21 Martin Baulig <martin@ximian.com>
14724 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
14725 CS0661 checks; fixes bug #30442.
14727 2003-07-21 Martin Baulig <martin@ximian.com>
14729 * decl.cs (AdditionResult): Added `Error'.
14731 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
14733 * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
14734 cs0031.cs actually work.
14736 2003-07-20 Miguel de Icaza <miguel@ximian.com>
14738 * cs-parser.jay (namespace_name): do not use
14739 namespace_or_type_name, use qualified_identifier, because
14740 namespace_or_type_name will soon return a composed expression
14741 instead of a string.
14743 (namespace_or_type_name): Instead of returning a string, now this
14744 production returns an expression.
14746 * codegen.cs (EmitContext): Setup IsGeneric property based on
14747 whether our DeclSpace is generic, our the method is generic.
14749 * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
14750 the method is generic.
14752 * cs-parser.jay (type_arguments, opt_type_argument_list,
14753 type_parameters, type_parameter_list, opt_type_parameter_list,
14754 type_parameter,, opt_type_parameter_constraints_clauses,
14755 type_parameter_constraints_clauses,
14756 type_parameter_constraint_clause, type_parameter_constraint,
14757 interface_constraints): Add new production
14759 * decl.cs (DeclSpace): IsGeneric, flag to track whether this
14760 DeclSpace is generic or not.
14762 (DeclSpace.SetParameterInfo): New routine, used to set the
14763 parameter info for a type.
14765 (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
14766 returns a GenericTypeExpr
14768 * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
14769 generic, lookup the generic argument.
14771 * attribute.cs: Do not allow TypeParameterExpressions in
14774 * class.cs: Do not allow the Main method to be defined in a
14777 * expression.cs (SizeOf): Do not allow generic types to be used as
14778 arguments to sizeof.
14780 * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
14781 it: whether a type is generic or not. Only works for types we are
14782 currently building for now.
14784 2003-07-20 Martin Baulig <martin@ximian.com>
14786 * namespace.cs: Fixed that bug which caused a crash when compiling
14787 the debugger's GUI.
14789 2003-07-20 Miguel de Icaza <miguel@ximian.com>
14791 * typemanager.cs (LookupTypeReflection): Never expose types which
14792 are NotPublic, NestedPrivate, NestedAssembly, or
14793 NestedFamANDAssem. We used to return these, and later do a check
14794 that would report a meaningful error, but the problem is that we
14795 would not get the real match, if there was a name override.
14797 2003-07-18 Miguel de Icaza <miguel@ximian.com>
14799 * namespace.cs (Namespace, Name): Do not compute the namespace
14800 name dynamically, compute it in the constructor. This reduced
14801 memory usage by 1697 KB.
14803 * driver.cs: Use --pause to pause at the end.
14805 2003-07-17 Peter Williams <peter@newton.cx>
14807 * Makefile: Change the name of the test target so that it doesn't
14808 conflict with the recursive test target.
14810 2003-07-17 Miguel de Icaza <miguel@ximian.com>
14812 * expression.cs (LocalVariableReference.Emit, EmitAssign,
14813 AddressOf): Do not use EmitThis, that was wrong, use the actual
14816 2003-07-15 Miguel de Icaza <miguel@ximian.com>
14818 * class.cs (MethodData.Define): While checking if a method is an
14819 interface implementation, improve the test: If we are not public
14820 (use new test here: use the computed MethodAttributes directly,
14821 instead of the parsed modifier flags) check if the `implementing'
14822 method comes from an interface or not.
14824 * pending.cs (VerifyPendingMethods): Slightly better error
14827 * makefile: add test target that does the mcs bootstrap.
14829 2003-07-16 Ravi Pratap <ravi@ximian.com>
14831 * interface.cs (Define): Do nothing here since there are no
14832 members to populate etc. Move the attribute emission out of here
14833 since this was just totally the wrong place to put it. Attribute
14834 application happens during the 'Emit' phase, not in the 'Define'
14837 (Emit): Add this method and move the attribute emission here
14839 * rootcontext.cs (EmitCode): Call the Emit method on interface
14842 2003-07-14 Ravi Pratap M <ravi@ximian.com>
14844 * expression.cs (OverloadResolve): Report error only if Location
14845 is not 'Null' which means that there was a probe going on.
14847 2003-07-14 Martin Baulig <martin@ximian.com>
14849 * expression.cs (ConditionalLogicalOperator): New public class to
14850 implement user defined conditional logical operators.
14851 This is section 14.11.2 in the spec and bug #40505.
14853 2003-07-14 Martin Baulig <martin@ximian.com>
14855 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
14857 2003-07-14 Martin Baulig <martin@ximian.com>
14859 * codegen.cs (EmitContext.InFixedInitializer): New public field.
14861 * ecore.cs (IVariable.VerifyFixed): New interface method.
14863 * expression.cs (Unary.ResolveOperator): When resolving the `&'
14864 operator, check whether the variable is actually fixed. Fixes bug
14865 #36055. Set a variable definitely assigned when taking its
14866 address as required by the spec.
14868 * statement.cs (LocalInfo.IsFixed): New field.
14869 (LocalInfo.MakePinned): Set `IsFixed' to true.
14871 2003-07-14 Ravi Pratap M <ravi@ximian.com>
14873 * attribute.cs (Attribute.Resolve): While doing a Member lookup
14874 for .ctors, ensure that we only ask for members declared in the
14875 attribute type (BindingFlags.DeclaredOnly).
14879 * expression.cs (Error_WrongNumArguments): Report error 1501
14880 correctly the way CSC does.
14882 2003-07-13 Martin Baulig <martin@ximian.com>
14884 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
14885 lookup on the fully qualified name, to make things like "X.X" work
14886 where "X.X" is a fully qualified type name, but we also have a
14887 namespace "X" in the using list. Fixes #41975.
14889 2003-07-13 Martin Baulig <martin@ximian.com>
14891 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
14892 function. If we're a CompoundAssign, we need to create an embedded
14893 CompoundAssign, not an embedded Assign.
14894 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
14897 2003-07-13 Martin Baulig <martin@ximian.com>
14899 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
14900 work to fix bug #46088.
14902 2003-07-13 Ravi Pratap <ravi@ximian.com>
14904 * class.cs (Operator.Emit): Do not emit attributes here - it is
14905 taken care of by the Method class that we delegate too. This takes
14906 care of bug #45876.
14908 2003-07-10 Martin Baulig <martin@ximian.com>
14910 * expression.cs (TypeOfVoid): New class.
14911 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
14913 2003-07-10 Martin Baulig <martin@ximian.com>
14915 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
14918 2003-07-10 Martin Baulig <martin@ximian.com>
14920 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
14921 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
14923 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
14925 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
14927 2003-07-10 Martin Baulig <martin@ximian.com>
14929 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
14930 of decimal. Fixes #42850.
14932 NOTE: I also fixed the created byte blob, but this doesn't work on
14933 the MS runtime and csc never produces any byte blobs for decimal
14936 2003-07-10 Martin Baulig <martin@ximian.com>
14938 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
14939 structs; fixes #32068.
14940 (Block.AddChildVariableNames): Fixed #44302.
14942 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14944 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
14946 2003-07-07 Miguel de Icaza <miguel@ximian.com>
14948 * attribute.cs: And this test is onger needed.
14950 2003-07-08 Martin Baulig <martin@ximian.com>
14952 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
14953 inaccessible types. Fixes #36313.
14955 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
14957 * namespace.cs (NamespaceEntry): Create implicit entries for all
14958 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
14959 implicit entries for N1.N2 and N1.
14961 2003-07-08 Martin Baulig <martin@ximian.com>
14963 Rewrote the handling of namespaces to fix a lot of the issues
14964 wrt. `using' aliases etc.
14966 * namespace.cs (Namespace): Splitted this class into a
14967 per-assembly `Namespace' and a per-file `NamespaceEntry'.
14969 * typemanager.cs (TypeManager.IsNamespace): Removed.
14970 (TypeManager.ComputeNamespaces): Only compute namespaces from
14971 loaded assemblies here, not the namespaces from the assembly we're
14972 currently compiling.
14974 2003-07-08 Martin Baulig <martin@ximian.com>
14976 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
14978 2003-07-07 Miguel de Icaza <miguel@ximian.com>
14980 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
14983 I thought about the memory savings here, but LookupTypeReflection
14984 is used under already very constrained scenarios. Compiling
14985 corlib or mcs only exposes one hit, so it would not really reduce
14986 any memory consumption.
14988 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14990 * typemanager.cs: fixes bug #45889 by only adding public types from
14991 other assemblies to the list of known types.
14993 2003-07-07 Miguel de Icaza <miguel@ximian.com>
14995 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
14996 on the type we resolved.
14998 2003-07-05 Martin Baulig <martin@ximian.com>
15000 * pending.cs (PendingImplementation.ParentImplements): Don't
15001 create the proxy if the parent is abstract.
15003 * class.cs (TypeContainer.DefineIndexers): Process explicit
15004 interface implementations first. Fixes #37714.
15006 2003-07-04 Miguel de Icaza <miguel@ximian.com>
15008 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
15009 defined recursively; but since we modify the input parameters
15010 (left is set to `this' temporarily), we reset this value if the
15011 left_is_explicit is false, which gives the original semantics to
15014 * literal.cs (NullPointer): new class used to represent a null
15015 literal in a pointer context.
15017 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
15018 type is a pointer, use a NullPointer object instead of a
15019 NullLiteral. Closes 43687
15021 (ExplicitConversion): Convert pointer values using
15022 the conv opcode to the proper type.
15024 * ecore.cs (New): change ValueTypeVariable property into a method,
15025 that returns whether the valuetype is suitable for being used.
15027 * expression.cs (Binary.DoNumericPromotions): Only return if we
15028 the int constant was a valid uint, and we can return both left and
15029 right as uints. If not, we continue processing, to trigger the
15030 type conversion. This fixes 39018.
15032 * statement.cs (Block.EmitMeta): During constant resolution, set
15033 the CurrentBlock property on the emitcontext, so that we resolve
15034 constants propertly.
15036 2003-07-02 Martin Baulig <martin@ximian.com>
15038 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
15039 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
15041 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
15042 than emitting it here.
15044 * statement.cs: Fixed some more flow analysis bugs.
15046 2003-07-02 Martin Baulig <martin@ximian.com>
15048 * class.cs (MethodData.Define): When implementing interface
15049 methods, set Final unless we're Virtual.
15051 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
15052 check work for interface methods.
15054 2003-07-01 Martin Baulig <martin@ximian.com>
15056 * ecore.cs (EmitContext.This): Replaced this property with a
15057 GetThis() method which takes a Location argument. This ensures
15058 that we get the correct error location for a CS0188.
15060 2003-07-01 Miguel de Icaza <miguel@ximian.com>
15062 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
15063 ImplicitStandardConversion.
15065 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
15067 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
15069 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
15072 2003-06-30 Miguel de Icaza <miguel@ximian.com>
15074 * class.cs (Constructor.Define): Turn off initlocals for unsafe
15077 (MethodData.Define): Turn off initlocals for unsafe methods.
15079 2003-06-29 Miguel de Icaza <miguel@ximian.com>
15081 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
15082 complete; Fixes #37521.
15084 * delegate.cs: Use Modifiers.TypeAttr to compute the
15085 TypeAttributes, instead of rolling our own. This makes the flags
15086 correct for the delegates.
15088 2003-06-28 Miguel de Icaza <miguel@ximian.com>
15090 * class.cs (Constructor.Define): Set the private flag for static
15091 constructors as well.
15093 * cs-parser.jay (statement_expression): Set the return value to
15094 null, to avoid a crash when we catch an error.
15096 2003-06-24 Miguel de Icaza <miguel@ximian.com>
15098 * cs-parser.jay: Applied patch from Jackson that adds support for
15099 extern and unsafe modifiers to destructor declarations.
15101 * expression.cs: Report error 21 if the user is trying to index a
15104 * driver.cs: Add an error message, suggested by the bug report.
15106 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
15107 if we do not have a ": this ()" constructor initializer. Fixes 45149
15109 2003-06-14 Miguel de Icaza <miguel@ximian.com>
15111 * namespace.cs: Add some information to reduce FAQs.
15113 2003-06-13 Miguel de Icaza <miguel@ximian.com>
15115 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
15116 underlying enumeration types. Fixes #43915.
15118 * expression.cs: Treat ushort/short as legal values to be used in
15119 bitwise operations.
15121 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
15123 * delegate.cs: transfer custom attributes for paramenters from
15124 the delegate declaration to Invoke and BeginInvoke.
15126 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
15128 * attribute.cs: handle custom marshalers and emit marshal info
15131 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
15133 * makefile.gnu: Added anonymous.cs to the compiler sources.
15135 2003-05-28 Miguel de Icaza <miguel@ximian.com>
15137 * iterators.cs: Change the name of the proxy class to include two
15140 * cs-parser.jay: Update grammar to include anonymous methods.
15142 * anonymous.cs: new file.
15144 2003-05-27 Miguel de Icaza <miguel@ximian.com>
15146 * class.cs (Field.Define): Add missing test for pointers and
15149 2003-05-27 Ravi Pratap <ravi@ximian.com>
15151 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
15152 we use the stobj opcode.
15154 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
15155 since it wasn't the correct fix.
15157 It still is puzzling that we are required to use stobj for IntPtr
15158 which seems to be a ValueType.
15160 2003-05-26 Miguel de Icaza <miguel@ximian.com>
15162 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
15163 during regular simple name resolution. Now, the trick is that
15164 instead of returning for processing the simplename, we do a
15165 TypeManager.LookupType (ie, a rooted lookup as opposed to a
15166 contextual lookup type). If a match is found, return that, if
15167 not, return for further composition.
15169 This fixes long-standing 30485.
15171 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15172 using the address to initialize an object, do an Stobj instead of
15173 using the regular Stelem.
15175 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
15176 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
15177 Because if we are a BaseIndexerAccess that value will be true.
15180 * statement.cs (GotoCase.Resolve): Return after reporting an
15181 error, do not attempt to continue.
15183 * expression.cs (PointerArithmetic.Emit): If our operand is a
15184 long, convert our constants to match the operand before
15185 multiplying. Convert to I type before adding. Fixes 43670.
15187 2003-05-14 Ravi Pratap <ravi@ximian.com>
15189 * enum.cs (ImplicitConversionExists) : Rename to
15190 ImplicitEnumConversionExists to remove ambiguity.
15192 * ecore.cs (NullCast): New type of cast expression class which
15193 basically is very similar to EmptyCast with the difference being
15194 it still is a constant since it is used only to cast a null to
15196 (eg. (string) null)
15198 * convert.cs (ImplicitReferenceConversion): When casting a null
15199 literal, we return a NullCast.
15201 * literal.cs (NullLiteralTyped): Remove - I don't see why this
15202 should be around anymore.
15204 The renaming (reported was slightly wrong). Corrections:
15206 ConvertImplicitStandard -> ImplicitConversionStandard
15207 ConvertExplicitStandard -> ExplicitConversionStandard
15209 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
15210 before passing them in !
15212 * convert.cs (ImplicitConversionStandard): When comparing for
15213 equal expr and target types, ensure that expr is not a
15216 In general, we must not be checking (expr_type ==
15217 target_type) in the top level conversion methods
15218 (ImplicitConversion, ExplicitConversion etc). This checking is
15219 done in the methods that they delegate to.
15221 2003-05-20 Miguel de Icaza <miguel@ximian.com>
15223 * convert.cs: Move Error_CannotConvertType,
15224 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
15225 ImplicitNumericConversion, ImplicitConversionExists,
15226 ImplicitUserConversionExists, StandardConversionExists,
15227 FindMostEncompassedType, FindMostSpecificSource,
15228 FindMostSpecificTarget, ImplicitUserConversion,
15229 ExplicitUserConversion, GetConversionOperators,
15230 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
15231 TryImplicitIntConversion, Error_CannotConvertImplicit,
15232 ConvertImplicitRequired, ConvertNumericExplicit,
15233 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
15234 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
15237 Perform the following renames:
15239 StandardConversionExists -> ImplicitStandardConversionExists
15240 ConvertImplicit -> ImplicitConversion
15241 ConvertImplicitStandard -> ImplicitStandardConversion
15242 TryImplicitIntConversion -> ImplicitIntConversion
15243 ConvertImplicitRequired -> ImplicitConversionRequired
15244 ConvertNumericExplicit -> ExplicitNumericConversion
15245 ConvertReferenceExplicit -> ExplicitReferenceConversion
15246 ConvertExplicit -> ExplicitConversion
15247 ConvertExplicitStandard -> ExplicitStandardConversion
15249 2003-05-19 Martin Baulig <martin@ximian.com>
15251 * statement.cs (TypeInfo.StructInfo): Made this type protected.
15252 (TypeInfo): Added support for structs having structs as fields.
15254 * ecore.cs (FieldExpr): Implement IVariable.
15255 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
15256 VariableInfo for the field.
15258 2003-05-18 Martin Baulig <martin@ximian.com>
15260 * expression.cs (This.DoResolve): Report a CS0027 if we're
15261 emitting a field initializer.
15263 2003-05-18 Martin Baulig <martin@ximian.com>
15265 * expression.cs (This.ResolveBase): New public function.
15266 (This.DoResolve): Check for CS0188.
15268 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
15271 * ecore.cs (MethodGroupExpr.DoResolve): Set the
15272 `instance_expression' to null if we don't have any non-static
15275 2003-05-18 Martin Baulig <martin@ximian.com>
15277 Reworked the way how local variables and parameters are handled by
15278 the flow analysis code.
15280 * statement.cs (TypeInfo, VariableMap): New public classes.
15281 (VariableInfo): New public class. This is now responsible for
15282 checking whether a variable has been assigned. It is used for
15283 parameters and local variables.
15284 (Block.EmitMeta): Take the InternalParameters as argument; compute
15285 the layout of the flow vectors here.
15286 (Block.LocalMap, Block.ParameterMap): New public properties.
15287 (FlowBranching): The .ctor doesn't get the InternalParameters
15288 anymore since Block.EmitMeta() now computes the layout of the flow
15290 (MyStructInfo): This class is now known as `StructInfo' and nested
15291 in `TypeInfo'; we don't access this directly anymore.
15293 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
15294 property and removed IsAssigned(), IsFieldAssigned(),
15295 SetAssigned() and SetFieldAssigned(); we now call them on the
15296 VariableInfo so we don't need to duplicate this code everywhere.
15298 * expression.cs (ParameterReference): Added `Block block' argument
15300 (LocalVariableReference, ParameterReference, This): The new
15301 VariableInfo class is now responsible for all the definite
15304 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
15305 IsParameterAssigned, SetParameterAssigned): Removed.
15307 2003-05-18 Martin Baulig <martin@ximian.com>
15309 * typemanager.cs (InitCoreTypes): Try calling
15310 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
15311 the 3-args-version. Corlib now also needs our `void_type'.
15312 (GetMethod): Added overloaded version which takes an optional
15313 `bool report_errors' to allow lookups of optional methods.
15315 2003-05-12 Martin Baulig <martin@ximian.com>
15317 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
15318 only used for locals and not for parameters.
15320 2003-05-12 Miguel de Icaza <miguel@ximian.com>
15322 * support.cs (InternalParameters.ParameterType): Return the
15323 ExternalType of the parameter.
15325 * parameter.cs (Parameter.ExternalType): drop the two arguments,
15328 2003-05-11 Miguel de Icaza <miguel@ximian.com>
15330 * class.cs (MethodData.Define): Do not set the `newslot' on
15331 interface members, if they are also flagged as "override".
15333 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
15334 better code for ++i and i++. This only works for static fields
15335 and local variables.
15337 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
15338 want to pull the DeclSpace out of the builder_to_declspace instead
15339 of the TypeBuilder (like in TypeContainer.FindMembers).
15341 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
15342 instead of LookupTypeContainer. Fixes the crash on .NET for
15343 looking up interface members.
15345 * const.cs: Create our own emit context during the Definition
15346 stage, so that constants are evaluated in the proper context, when
15347 a recursive definition happens.
15349 2003-05-11 Martin Baulig <martin@ximian.com>
15351 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
15352 new block for a switch section.
15353 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
15354 the adding/lookup in the switch block. Fixes #39828.
15356 2003-05-09 Miguel de Icaza <miguel@ximian.com>
15358 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
15359 functionality: I needed to convert the data after I had performed
15360 the add/sub operation into the operands type size.
15362 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
15363 pass the type for the box operation, otherwise the resulting
15364 object would have been of type object.
15366 (BoxedCast): Add constructor to specify the type to box as.
15368 2003-05-07 Miguel de Icaza <miguel@ximian.com>
15370 * iterators.cs: I was reusing the `count' variable inadvertently,
15371 take steps to not allow this to happen.
15373 2003-05-06 Miguel de Icaza <miguel@ximian.com>
15375 * attribute.cs (Attribute.Resolve): Params attributes are encoded
15376 by creating an array at the point where the params starts and
15377 putting all those arguments there, then adjusting the size of the
15380 2003-05-05 Miguel de Icaza <miguel@ximian.com>
15382 * expression.cs (New.AddressOf): Implement interface
15383 IMemoryLocation. This is used when the `new' operator is used in
15384 the context of an invocation to a method on a value type.
15386 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
15389 * namespace.cs: Also check the using aliases here.
15391 * driver.cs: Move the test for using validity after the types have
15392 been entered, so we do a single pass that also includes the using
15395 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
15396 in the regular case. CreateSiblingForFinally is doing extra
15399 * attribute.cs (GetAttributeArgumentExpression): Store the result
15400 on an out value, and use the return value to indicate failure
15401 instead of using null (which is a valid return for Constant.GetValue).
15403 * statement.cs: Perform the analysis flow for the increment
15404 portion after the statement, because this will be the real flow of
15405 execution. Fixes #42385
15407 * codegen.cs (EmitContext.EmitArgument,
15408 EmitContext.EmitStoreArgument): New helper functions when the
15409 RemapToProxy flag is set.
15411 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
15414 Add support for remapping parameters.
15416 * iterators.cs: Propagate parameter values; Store parameter
15417 values in the proxy classes.
15419 2003-05-04 Miguel de Icaza <miguel@ximian.com>
15421 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
15422 need a proxy reference; I do not know what I was thinking
15424 * cs-parser.jay (constructor_initializer): catch another error,
15425 and display nice message.
15427 (field_declaration): catch void field declaration
15428 to flag a better error.
15430 * class.cs (MemberBase.CheckBase): Report an error instead of a
15431 warning if a new protected member is declared in a struct.
15432 (Field.Define): catch the error of readonly/volatile.
15434 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
15436 (FieldExpr.AddressOf): ditto. Catch error where the address of a
15437 volatile variable is taken
15439 2003-05-02 Miguel de Icaza <miguel@ximian.com>
15441 * statement.cs (Fixed.Resolve): Report an error if we are not in
15444 2003-05-01 Miguel de Icaza <miguel@ximian.com>
15446 * typemanager.cs: reuse the code that handles type clashes for
15447 delegates and enumerations.
15449 * class.cs (Report28): Always report.
15451 * expression.cs (EncodeAsAttribute): Allow nulls here.
15453 2003-04-28 Miguel de Icaza <miguel@ximian.com>
15455 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
15456 the functionality for testing whether an expression is valid for
15457 an attribute here. Also handle the case of arrays of elements
15460 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
15461 encoding a linear array into an array of objects that are suitable
15462 to be passed to an CustomAttributeBuilder.
15464 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
15466 * ecore.cs: (FieldExpr): Handle field remapping here.
15468 * iteratators.cs: Pass the instance variable (if the method is an
15469 instance method) to the constructors, so we can access the field
15470 variables on the class.
15472 TODO: Test this with structs. I think the THIS variable on
15473 structs might have to be a pointer, and not a refenrece
15475 2003-04-27 Miguel de Icaza <miguel@ximian.com>
15477 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
15478 local variables to fields in a proxy class.
15480 * iterators.cs (PopulateProxy): Rename our internal fields to
15482 Create a <THIS> field if we are an instance method, so we can
15483 reference our parent container variables.
15484 (MapVariable): Called back from the EmitContext code to enter a
15485 new variable to field mapping into the proxy class (we just create
15489 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
15490 for using the remapped locals to fields.
15492 I placed the code here, because that gives the same semantics to
15493 local variables, and only changes the Emit code.
15495 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
15496 statements inside iterators.
15497 (VariableInfo): Add a FieldBuilder for the cases when we are
15498 remapping local variables to fields in a proxy class
15500 * ecore.cs (SimpleNameResolve): Avoid testing two times for
15501 current_block != null.
15503 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
15504 not cope with strings, as it has been moved to the
15505 TableSwitchEmit. Fixed bug in switch generation.
15507 * expression.cs (New.DoResolve): Provide more context for the user
15508 when reporting an error.
15510 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
15513 * expression.cs (MemberAccess.DoResolve): When we get a type back,
15514 check the permissions for it. Note than in a type-resolution
15515 context the check was already present in DeclSpace.ResolveType,
15516 but was missing from the MemberAccess.
15518 (ArrayCreation.CheckIndices): warn if the user has
15519 more nested levels of expressions, but there are no more
15520 dimensions specified. Avoids crash on bug 41906.
15522 2003-04-26 Miguel de Icaza <miguel@ximian.com>
15524 * statement.cs (Block): replace Implicit bool, for a generic
15526 New flag: `Unchecked'. This is used during the EmitMeta phase
15527 (which is out-of-line with the regular Resolve/Emit process for a
15528 statement, as this is done ahead of time, but still gets a chance
15529 to call constant resolve).
15531 (Block.Flags): new enum for adding a new flag.
15533 (Block.EmitMeta): track the state of unchecked.
15535 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
15536 to enable constant resolution to work there as well.
15538 2003-04-22 Miguel de Icaza <miguel@ximian.com>
15540 * typemanager.cs (ienumerable_type): Also look up
15541 System.Collections.IEnumerable.
15543 2003-04-21 Miguel de Icaza <miguel@ximian.com>
15545 TODO: Test more than one conditional per method.
15547 * class.cs (Indexer.Define): Report the location where the user is
15548 referencing the unsupported feature.
15550 (MethodData): Overload the use of `conditionals' to
15551 minimize the creation of needless ArrayLists. This saves roughly
15552 212kb on my machine.
15554 (Method): Implement the new IIteratorContainer interface.
15555 (Method.SetYields): Implement the method by setting the ModFlags
15556 to contain METHOD_YIELDS.
15558 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
15559 which just got set to null.
15561 * iterators.cs: New file.
15563 (Yield, YieldBreak): New statements.
15565 * statement.cs (Return.Resolve): Flag an error if we are used in
15566 an iterator method.
15568 * codegen.cs (InIterator): New flag set if the code is being
15569 compiled in an iterator method.
15571 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
15572 internal modifier, and we just use it to avoid adding extra
15573 fields, as this is seldom used.
15575 * cs-parser.jay: Add yield_statement (yield and yield break).
15577 * driver.cs: New flag -v2 to turn on version 2 features.
15579 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
15580 hashtable when v2 is enabled.
15582 2003-04-20 Miguel de Icaza <miguel@ximian.com>
15584 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
15585 there is already a namespace defined with this name.
15587 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
15588 people upgraded their corlibs.
15590 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
15591 always use fully qualified types, no need to use the compiler
15594 (TypeManager.IsNamespace): Use binarysearch.
15596 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
15597 AddDelegate): I did not quite use the new IsValid API properly: I
15598 have to pass the short-name and the fullname. I was passing only
15599 the basename instead of the fullname sometimes.
15601 (TypeContainer.DefineType): call NamespaceClash.
15603 * interface.cs (Interface.DefineType): use NamespaceClash before
15606 * delegate.cs (Delegate.DefineType): use NamespaceClash before
15609 * enum.cs: (Enum.DefineType): use NamespaceClash before
15612 * typemanager.cs (: 3-line patch that gives us some tasty 11%
15613 speed increase. First, use the negative_hits cache when we get a
15614 negative. Second, add the type with its full original name
15615 instead of the new . and + encoded name (reflection uses + to
15616 separate type from a nested type). Use LookupTypeReflection
15617 directly which bypasses the type->name hashtable (that we already
15618 know does not contain the type.
15620 * decl.cs (DeclSpace.ResolveTypeExpr): track the
15621 location/container type.
15623 * driver.cs: When passing utf8, use directly the UTF8Encoding.
15625 2003-04-19 Miguel de Icaza <miguel@ximian.com>
15627 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
15629 * delegate.cs (NewDelegate.Resolve): Test whether an instance
15630 method is being referenced in the method group from a static
15631 context, and report error 120 if so.
15633 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
15636 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
15637 is created, we create the A namespace).
15639 * cs-parser.jay: A namespace also introduces a DeclarationFound.
15642 2003-04-18 Miguel de Icaza <miguel@ximian.com>
15644 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
15645 invocation to ModuleBuilder.GetType with the same values will
15646 return a new type instance, so we need to cache its return
15649 * expression.cs (Binary.ResolveOperator): Only allow the compare
15650 operators on enums if they are of the same type.
15652 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
15653 types of ValueType on their own case. Before we were giving them
15654 the same treatment as objects.
15656 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
15657 fullname. Short name is used to compare against container name.
15658 Fullname is used to check against defined namespace names.
15660 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
15661 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
15663 (Method.CheckBase): Call parent.
15664 (MemberBase.CheckBase): Check for protected members on sealed
15666 (PropertyBase.CheckBase): Call parent.
15667 (Field.Define): Call parent.
15669 * report.cs: Negative error codes are now mapped to 8000 - code,
15670 so that the display is render more nicely.
15672 * typemanager.cs: Do not use try/catch, instead report a regular
15675 (GetPointerType, GetReferenceType): These methods provide
15676 mechanisms to obtain the T* and T& from a T. We had the code
15677 previously scattered around the code base, and it also used
15678 TypeManager.LookupType that would go through plenty of caches.
15679 This one goes directly to the type source.
15681 In some places we did the Type.GetType followed by
15682 ModuleBuilder.GetType, but not in others, so this unifies the
15683 processing as well.
15685 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
15686 statements now that we have namespace information.
15688 * typemanager.cs (IsNamespace): New method, returns whether the
15689 string presented is a namespace or not.
15691 (ComputeNamespaces): New public entry point, computes the list of
15692 available namespaces, using the GetNamespaces API call in Mono, or
15693 the slower version in MS.NET.
15695 Now before we start the semantic analysis phase, we have a
15696 complete list of namespaces including everything that the user has
15699 Deleted old code to cache namespaces in .nsc files.
15701 2003-04-17 Miguel de Icaza <miguel@ximian.com>
15703 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
15704 class/struct location definition Location for the implicit
15705 constructor location.
15707 (Operator.Define): Use the location of the operator for the
15708 implicit Method definition.
15710 (Constructor.Emit): use the constructor location for the implicit
15711 base initializer constructor.
15713 * ecore.cs: Remove ITypeExpression. This interface is now gone,
15714 and the Expression class now contains two new methods:
15716 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
15717 isolate type lookup from the rest of the resolution process.
15719 Since we use Expressions to hold type definitions due to the way
15720 we parse the input we have historically overloaded Resolve to
15721 perform the Type lookups if a special flag is passed. Now this is
15722 eliminated and two methods take their place.
15724 The differences in the two methods between xStep and xTerminal is
15725 that xStep is involved in our current lookup system that uses
15726 SimpleNames to compose a name, while xTerminal is used just to
15727 catch the case where the simplename lookup failed.
15729 2003-04-16 Miguel de Icaza <miguel@ximian.com>
15731 * expression.cs (ResolveMemberAccess): Remove redundant code.
15732 TypeExpr expressions are always born fully resolved.
15734 * interface.cs (PopulateMethod): Do not lookup the types twice.
15735 We were doing it once during SemanticAnalysis and once during
15738 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
15739 in local variable type definitions, were being returned as a
15740 SimpleName (we decomposed everything into a string), that is
15741 because primary_expression was being used instead of a type in the
15742 grammar (reduce/reduce conflicts).
15744 The part that was wrong is that we converted the expression into a
15745 string (an oversimplification in one hand, compounded with primary
15746 expressions doing string concatenation).
15752 Would return "A.B.C[]" as a SimpleName. This stopped things like
15753 using clauses from working on this particular context. And a type
15754 was being matched directly against "A.B.C[]".
15756 We now use the correct approach, and allow for ComposedCast to be
15757 part of the unary expression. So the "A.B.C []" become a composed
15758 cast of "A.B.C" (as a nested group of MemberAccess with a
15759 SimpleName at the end) plus the rank composition "[]".
15763 2003-04-10 Miguel de Icaza <miguel@ximian.com>
15765 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
15766 for the access level checking.
15768 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
15769 `TypeContainer container', because I kept getting confused when I
15770 was debugging this code.
15772 * expression.cs (Indexers): Instead of tracking getters/setters,
15773 we now track them in parallel. We create one arraylist less, but
15774 most importantly it is possible now for the LValue code to find a
15775 matching get for a set.
15777 (IndexerAccess.DoResolveLValue): Update the code.
15778 GetIndexersForType has been modified already to extract all the
15779 indexers from a type. The code assumed it did not.
15781 Also make the code set the correct return type for the indexer.
15782 This was fixed a long time ago for properties, but was missing for
15783 indexers. It used to be void_type.
15785 (Binary.Emit): Test first for doubles instead of
15786 floats, as they are more common.
15788 (Binary.EmitBranchable): Use the .un version of the branch opcodes
15789 when dealing with floats and the <=, >= operators. This fixes bug
15792 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
15793 to load the array value by emitting a load on the foreach variable
15794 type. This was incorrect.
15796 We now emit the code to load an element using the the array
15797 variable type, and then we emit the conversion operator.
15801 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
15803 * attribute.cs: Avoid allocation of ArrayLists in the common case.
15805 2003-04-09 Miguel de Icaza <miguel@ximian.com>
15807 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
15808 test for protection before we test for signatures.
15810 (MethodSignature.ToString): implement.
15812 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
15813 to the case where we reduced into a LongConstant.
15815 * decl.cs (CheckAccessLevel): If the type is an array, we can not
15816 depend on whether the information is acurrate, because the
15817 Microsoft runtime will always claim that the array type is public,
15818 regardless of the real state.
15820 If the type is a pointer, another problem happens: the type is
15821 reported as non-public in Microsoft.
15823 In both cases we have to call CheckAccessLevel recursively with
15824 the underlying type as the argument to be tested.
15826 2003-04-08 Miguel de Icaza <miguel@ximian.com>
15828 * assign.cs (Assign.Emit): If we are dealing with a compound
15829 assignment expression, we should use the code path that stores the
15830 intermediate result in a temporary value. This fixes #40903.
15832 *expression.cs (Indirection.ToString): Provide ToString method for
15835 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
15837 * class.cs: Null out fields holding references to Block objects so
15838 they can be garbage collected.
15840 * expression.cs (OverloadResolve): Remove unused local.
15842 2003-04-07 Martin Baulig <martin@ximian.com>
15844 * codegen.cs (EmitContext.CurrentFile): New public field.
15845 (EmitContext.Mark): Use the CurrentFile to check whether the
15846 location is in the correct file.
15847 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
15849 2003-04-07 Martin Baulig <martin@ximian.com>
15851 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
15853 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
15854 location. [FIXME: The location argument which gets passed to this
15855 method is sometimes wrong!]
15857 2003-04-07 Nick Drochak <ndrochak@gol.com>
15859 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
15861 2003-04-07 Miguel de Icaza <miguel@ximian.com>
15863 * expression.cs (Indirection.EmitAssign): We were using the
15864 temporary, but returning immediately instead of continuing the
15867 2003-04-06 Martin Baulig <martin@ximian.com>
15869 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
15870 if it's a nested child, but also deriving from the outer class.
15873 * typemanager.cs (IsNestedChildOf): Make this work if it's a
15874 nested child, but also deriving from the outer class. See
15876 (FilterWithClosure): We may access private members of the outer
15877 class if we're a nested child and deriving from the outer class.
15878 (RealMemberLookup): Only set `closure_private_ok' if the
15879 `original_bf' contained BindingFlags.NonPublic.
15881 2003-04-05 Martin Baulig <martin@ximian.com>
15883 * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
15884 probe if its a type parameter, and if so, flag an error.
15886 * decl.cs: Move here the SetParameterInfo code from class.cs.
15887 Handle IsGeneric here.
15889 Handle a variety of errors in the parameter info definition.
15891 * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
15892 type parameters here.
15894 * cs-parser.jay (class_declaration): report errors for parameters
15897 2003-01-21 Miguel de Icaza <miguel@ximian.com>
15899 * generic.cs: New file, contains support code for generics.
15901 * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
15902 OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
15904 Update parser for the above removals.
15906 * cs-tokenizer.cs: Do not handle <<= or >>= specially. This is
15907 now taken care of in the parser.
15909 2003-04-02 Miguel de Icaza <miguel@ximian.com>
15911 * class.cs (Event.Define): Do not allow abstract events to have
15914 2003-04-01 Miguel de Icaza <miguel@ximian.com>
15916 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
15917 block in event declarations.
15919 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
15920 value type, get its address.
15922 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
15923 leaving a class on the stack instead of a boolean value (int
15924 0/1). Change the code so we compare against null, and then the
15925 result against zero.
15927 * class.cs (TypeContainer.GetClassBases): We were checking for the
15928 parent class being sealed too late.
15930 * expression.cs (Binary.Emit): For <= and >= when dealing with
15931 floating point values, use cgt.un and clt.un instead of cgt and
15934 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
15936 * statement.cs: Apply the same optimization as MS: skip the
15937 GetEnumerator returning an IEnumerator, and use the one returning a
15938 CharEnumerator instead. This allows us to avoid the try-finally block
15941 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
15943 * cs-parser.jay: Attributes cannot be applied to
15944 namespaces. Fixes #40473
15946 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15949 (Add*): check if the name is valid using the full name for constants,
15950 fields, properties and events.
15952 2003-03-28 Miguel de Icaza <miguel@ximian.com>
15954 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
15955 char constants to be part of the enumeration.
15957 * expression.cs (Conditional.DoResolve): Add support for operator
15958 true. Implements the missing functionality from 14.12
15960 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
15961 operator true/false as required by the spec.
15963 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
15964 implicit conversion to boolean.
15966 * statement.cs (Statement.ResolveBoolean): A boolean expression is
15967 also one where the type implements `operator true'.
15969 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
15970 get an expression that will invoke operator true based on an
15973 (GetConversionOperators): Removed the hack that called op_True
15976 (Expression.ResolveBoolean): Move this from Statement.
15978 2003-03-17 Miguel de Icaza <miguel@ximian.com>
15980 * ecore.cs (FieldExpr): do not allow initialization of initonly
15981 fields on derived classes
15983 2003-03-13 Martin Baulig <martin@ximian.com>
15985 * statement.cs (Block.Emit): Call ig.BeginScope() and
15986 ig.EndScope() when compiling with debugging info; call
15987 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
15989 2003-03-08 Miguel de Icaza <miguel@ximian.com>
15991 * expression.cs (Indexers): Do not construct immediately, allow
15992 for new members to be appended as we go. Fixes 38143
15994 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15996 * expression.cs: save/restore context when resolving an unchecked
15999 2003-03-05 Miguel de Icaza <miguel@ximian.com>
16001 * cfold.cs: Catch division by zero in modulus operator during
16004 2003-03-03 Miguel de Icaza <miguel@ximian.com>
16006 * interface.cs (Interface.DefineMembers): Avoid defining members
16009 2003-02-27 Miguel de Icaza <miguel@ximian.com>
16011 * driver.cs: handle the +/- options for -noconfig
16013 * statement.cs (Unckeched.Resolve): Also track the state of
16014 unchecked in the Resolve phase.
16016 2003-02-27 Martin Baulig <martin@ximian.com>
16018 * ecore.cs (Expression.MemberLookup): Don't create a
16019 MethodGroupExpr for something which is not a method. Fixes #38291.
16021 2003-02-25 Miguel de Icaza <miguel@ximian.com>
16023 * class.cs (MemberBase.CheckParameters): Also check that the type
16024 is unmanaged if it is a pointer.
16026 * expression.cs (SizeOf.Resolve): Add location information.
16028 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
16029 a managed type is declared.
16031 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
16032 parameter modifiers as well. Fixes bug 38606
16034 * class.cs: Very sad. Am backing out the speed up changes
16035 introduced by the ArrayList -> Array in the TypeContainer, as they
16036 were not actually that much faster, and introduced a bug (no error
16037 reports on duplicated methods).
16039 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
16040 source first, this will guarantee that we have a valid expression
16041 before calling in lower levels functions that will require a
16042 resolved object. Then use this original_source in the
16043 target.ResolveLValue instead of the original source that was
16046 Another change. Use target.Resolve instead of LValueResolve.
16047 Although we are resolving for LValues, we will let the Assign code
16048 take care of that (it will be called again from Resolve). This
16049 basically allows code like this:
16051 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
16052 class Y { void A (X x) { x [0] += o; }
16054 The problem was that the indexer was trying to resolve for
16055 set_Item (idx, object o) and never finding one. The real set_Item
16056 was set_Item (idx, X). By delaying the process we get the right
16061 2003-02-23 Martin Baulig <martin@ximian.com>
16063 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
16064 while calling DoEmit ().
16066 * codegen.cs (EmitContext.Mark): Don't mark locations in other
16067 source files; if you use the #line directive inside a method, the
16068 compiler stops emitting line numbers for the debugger until it
16069 reaches the end of the method or another #line directive which
16070 restores the original file.
16072 2003-02-23 Martin Baulig <martin@ximian.com>
16074 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
16076 2003-02-23 Martin Baulig <martin@ximian.com>
16078 * statement.cs (Block.AddChildVariableNames): We need to call this
16079 recursively, not just for our immediate children.
16081 2003-02-23 Martin Baulig <martin@ximian.com>
16083 * class.cs (Event.Define): Always make the field private, like csc does.
16085 * typemanager.cs (TypeManager.RealMemberLookup): Make events
16086 actually work, fixes bug #37521.
16088 2003-02-23 Miguel de Icaza <miguel@ximian.com>
16090 * delegate.cs: When creating the various temporary "Parameters"
16091 classes, make sure that we call the ComputeAndDefineParameterTypes
16092 on those new parameters (just like we do with the formal ones), to
16093 allow them to be resolved in the context of the DeclSpace.
16095 This fixes the bug that Dick observed in Bugzilla #38530.
16097 2003-02-22 Miguel de Icaza <miguel@ximian.com>
16099 * expression.cs (ResolveMemberAccess): When resolving a constant,
16100 do not attempt to pull a constant if the value was not able to
16101 generate a valid constant.
16103 * const.cs (LookupConstantValue): Do not report more errors than required.
16105 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16107 * expression.cs: fixes bug #38328.
16109 2003-02-18 Miguel de Icaza <miguel@ximian.com>
16111 * class.cs: Changed all the various members that can be part of a
16112 class from being an ArrayList to be an Array of the right type.
16113 During the DefineType type_list, interface_list, delegate_list and
16114 enum_list are turned into types, interfaces, delegates and enums
16117 And during the member population, indexer_list, event_list,
16118 constant_list, field_list, instance_constructor_list, method_list,
16119 operator_list and property_list are turned into their real arrays.
16121 Although we could probably perform this operation earlier, for
16122 good error reporting we need to keep the lists and remove the
16123 lists for longer than required.
16125 This optimization was triggered by Paolo profiling the compiler
16126 speed on the output of `gen-sample-program.pl' perl script.
16128 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
16129 not crash in methods like MemberLookupFailed that use this field.
16131 This problem arises when the compiler fails to resolve a type
16132 during interface type definition for example.
16134 2003-02-18 Miguel de Icaza <miguel@ximian.com>
16136 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
16137 inherit from System.Object, so we have to stop at null, not only
16138 when reaching System.Object.
16140 2003-02-17 Miguel de Icaza <miguel@ximian.com>
16142 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
16143 DeclaredOnly because the parent indexer might have had a different
16144 name, but did not loop until the top of the hierarchy was reached.
16146 The problem this one fixes is 35492: when a class implemented an
16147 indexer from an interface, we were getting the interface method
16148 (which was abstract) and we were flagging an error (can not invoke
16151 This also keeps bug 33089 functioning, and test-148 functioning.
16153 * typemanager.cs (IsSpecialMethod): The correct way of figuring
16154 out if a method is special is to see if it is declared in a
16155 property or event, or whether it is one of the predefined operator
16156 names. This should fix correctly #36804.
16158 2003-02-15 Miguel de Icaza <miguel@ximian.com>
16160 The goal here is to remove the dependency on EmptyCast.Peel ().
16161 Killing it completely.
16163 The problem is that currently in a number of places where
16164 constants are expected, we have to "probe" for an EmptyCast, and
16165 Peel, which is not the correct thing to do, as this will be
16166 repetitive and will likely lead to errors.
16168 The idea is to remove any EmptyCasts that are used in casts that
16169 can be reduced to constants, so we only have to cope with
16172 This bug hunt was triggered by Bug 37363 and the desire to remove
16173 the duplicate pattern where we were "peeling" emptycasts to check
16174 whether they were constants. Now constants will always be
16177 * ecore.cs: Use an enumconstant here instead of wrapping with
16180 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
16181 throwing me off. By handling this we can get rid of a few hacks.
16183 * statement.cs (Switch): Removed Peel() code.
16185 2003-02-14 Miguel de Icaza <miguel@ximian.com>
16187 * class.cs: Location information for error 508
16189 * expression.cs (New.DoResolve): Add a guard against double
16190 resolution of an expression.
16192 The New DoResolve might be called twice when initializing field
16193 expressions (see EmitFieldInitializers, the call to
16194 GetInitializerExpression will perform a resolve on the expression,
16195 and later the assign will trigger another resolution
16197 This leads to bugs (#37014)
16199 * delegate.cs: The signature for EndInvoke should contain any ref
16200 or out parameters as well. We were not doing this in the past.
16202 * class.cs (Field.Define): Do not overwrite the type definition
16203 inside the `volatile' group. Turns out that volatile enumerations
16204 were changing the type here to perform a validity test, which
16207 2003-02-12 Miguel de Icaza <miguel@ximian.com>
16209 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
16210 and structs, we do not want to load the instance variable
16212 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
16213 enum_type has to be handled like an object reference (implicit
16214 conversions exists from this to object), but the regular IsClass
16215 and IsValueType tests will never return true for this one.
16217 Also we use TypeManager.IsValueType instead of type.IsValueType,
16218 just for consistency with the rest of the code (this is only
16219 needed if we ever use the construct exposed by test-180.cs inside
16220 corlib, which we dont today).
16222 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
16224 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
16227 2003-02-09 Martin Baulig <martin@ximian.com>
16229 * namespace.cs (Namespace..ctor): Added SourceFile argument.
16230 (Namespace.DefineNamespaces): New static public method; this is
16231 called when we're compiling with debugging to add all namespaces
16232 to the symbol file.
16234 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
16235 pass it to the Namespace's .ctor.
16237 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
16238 and MethodBase arguments; pass the namespace ID to the symwriter;
16239 pass the MethodBase instead of the token to the symwriter.
16240 (SymbolWriter.DefineNamespace): New method to add a namespace to
16243 2003-02-09 Martin Baulig <martin@ximian.com>
16245 * symbolwriter.cs: New file. This is a wrapper around
16246 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
16247 methods here in near future.
16249 2003-02-09 Martin Baulig <martin@ximian.com>
16251 * codegen.cs (EmitContext.Mark): Just pass the arguments to
16252 ILGenerator.MarkSequencePoint() which are actually used by the
16255 2003-02-09 Martin Baulig <martin@ximian.com>
16257 * location.cs (SourceFile): New public sealed class. This
16258 contains the name and an index which is used in the location's token.
16259 (Location): Reserve an appropriate number of bits in the token for
16260 the source file instead of walking over that list, this gives us a
16261 really huge performance improvement when compiling with debugging.
16263 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
16264 `SourceFile' argument instead of a string.
16265 (Driver.ProcessFile): Add all the files via Location.AddFile(),
16266 but don't parse/tokenize here, we need to generate the list of all
16267 source files before we do that.
16268 (Driver.ProcessFiles): New static function. Parses/tokenizes all
16271 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
16272 instead of a string.
16274 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
16277 2003-02-09 Martin Baulig <martin@ximian.com>
16279 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
16280 filename on `#line default'.
16282 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
16284 * statement.cs: don't clear the pinned var when the fixed statement
16285 returns from the method (fixes bug#37752).
16287 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
16289 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
16292 2003-02-07 Martin Baulig <martin@ximian.com>
16294 * driver.cs: Removed the `--debug-args' command line argument.
16296 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
16297 automatically by the AsssemblyBuilder.
16298 (CodeGen.InitializeSymbolWriter): We don't need to call any
16299 initialization function on the symbol writer anymore. This method
16300 doesn't take any arguments.
16302 2003-02-03 Miguel de Icaza <miguel@ximian.com>
16304 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
16305 from referenced assemblies as well.
16307 2003-02-02 Martin Baulig <martin@ximian.com>
16309 * class.cs (MethodData.Emit): Generate debugging info for external methods.
16311 2003-02-02 Martin Baulig <martin@ximian.com>
16313 * class.cs (Constructor.Emit): Open the symbol writer before
16314 emitting the constructor initializer.
16315 (ConstructorInitializer.Emit): Call ec.Mark() to allow
16316 single-stepping through constructor initializers.
16318 2003-01-30 Miguel de Icaza <miguel@ximian.com>
16320 * class.cs: Handle error 549: do not allow virtual methods in
16323 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
16325 * decl.cs: Check access levels when resolving types
16327 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
16329 * statement.cs: Add parameters and locals set in catch blocks that might
16330 return to set vector
16332 2003-01-29 Miguel de Icaza <miguel@ximian.com>
16334 * class.cs (Operator): Set the SpecialName flags for operators.
16336 * expression.cs (Invocation.DoResolve): Only block calls to
16337 accessors and operators on SpecialName methods.
16339 (Cast.TryReduce): Handle conversions from char constants.
16342 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
16344 * statement.cs: small memory and time optimization in FlowBranching.
16346 2003-01-28 Pedro Mart <yoros@wanadoo.es>
16348 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
16349 problem that the last fix but in the other sid (Set).
16351 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
16352 access when there is no indexer in the hierarchy.
16354 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
16356 * class.cs: Combine some if statements.
16358 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16360 * driver.cs: fixed bug #37187.
16362 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
16364 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
16365 any indexer, it's needed to build a list with all the indexers in the
16366 hierarchy (AllGetters), else we have problems. Fixes #35653.
16368 2003-01-23 Miguel de Icaza <miguel@ximian.com>
16370 * class.cs (MethodData.Define): It is wrong for an interface
16371 implementation to be static in both cases: explicit and implicit.
16372 We were only handling this in one case.
16374 Improve the if situation there to not have negations.
16376 * class.cs (Field.Define): Turns out that we do not need to check
16377 the unsafe bit on field definition, only on usage. Remove the test.
16379 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16381 * driver.cs: use assembly.Location instead of Codebase (the latest
16382 patch made mcs fail when using MS assemblies).
16384 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
16386 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
16387 get the path to *corlib.dll.
16389 2003-01-21 Nick Drochak <ndrochak@gol.com>
16393 * typemanager.cs: Remove compiler warnings
16395 2003-01-20 Duncan Mak <duncan@ximian.com>
16397 * AssemblyInfo.cs: Bump the version number to 0.19.
16399 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16401 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
16403 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
16405 * class.cs (Constructor::Emit): Emit debugging info for constructors.
16407 2003-01-17 Miguel de Icaza <miguel@ximian.com>
16409 * cs-parser.jay: Small fix: we were not comparing the constructor
16410 name correctly. Thanks to Zoltan for the initial pointer.
16412 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
16414 * cs-tokenizer.cs: Set file name when specified with #line
16416 2003-01-15 Miguel de Icaza <miguel@ximian.com>
16418 * cs-parser.jay: Only perform the constructor checks here if we
16419 are named like the class; This will help provider a better
16420 error. The constructor path is taken when a type definition is
16421 not found, but most likely the user forgot to add the type, so
16422 report that rather than the constructor error.
16424 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
16426 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
16429 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16431 * cs-parser.jay: Add cleanup call.
16433 2003-01-13 Duncan Mak <duncan@ximian.com>
16435 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
16436 consistent with other methods.
16438 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16440 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
16442 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
16444 * attribute.cs: only set GuidAttr to true when we have a
16447 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16451 * typemanager.cs: fixes to allow mcs compile corlib with the new
16452 Type.IsSubclassOf fix.
16454 2003-01-08 Miguel de Icaza <miguel@ximian.com>
16456 * expression.cs (LocalVariableReference.DoResolve): Classify a
16457 constant as a value, not as a variable. Also, set the type for
16460 * cs-parser.jay (fixed_statement): take a type instead of a
16461 pointer_type, so we can produce a better error message later.
16463 * statement.cs (Fixed.Resolve): Flag types that are not pointers
16466 (For.DoEmit): Make inifinite loops have a
16467 non-conditional branch back.
16469 (Fixed.DoEmit): First populate the pinned variables, then emit the
16470 statement, then clear the variables. Before I was emitting the
16471 code once for each fixed piece.
16474 2003-01-08 Martin Baulig <martin@ximian.com>
16476 * statement.cs (FlowBranching.MergeChild): A break in a
16477 SWITCH_SECTION does not leave a loop. Fixes #36155.
16479 2003-01-08 Martin Baulig <martin@ximian.com>
16481 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
16482 lives in the same number space than `param_map'. Fixes #36154.
16484 2003-01-07 Miguel de Icaza <miguel@ximian.com>
16486 * cs-parser.jay (constructor_declaration): Set the
16487 Constructor.ModFlags before probing for it. This makes the
16488 compiler report 514, 515 and 132 (the code was there, but got
16491 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
16492 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
16493 (GotoCase.Resolve): Set `Returns' to ALWAYS.
16495 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
16497 * enum.cs: create the enum static fields using the enum type.
16499 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
16501 * class.cs: don't try to create the ParamBuilder for the return
16502 type if it's not needed (and handle it breaking for the ms runtime
16505 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
16507 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
16509 2002-12-29 Miguel de Icaza <miguel@ximian.com>
16511 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
16512 the command. This showed up while compiling the JANET source
16513 code, which used \r as its only newline separator.
16515 2002-12-28 Miguel de Icaza <miguel@ximian.com>
16517 * class.cs (Method.Define): If we are an operator (because it
16518 reuses our code), then set the SpecialName and HideBySig. #36128
16520 2002-12-22 Miguel de Icaza <miguel@ximian.com>
16522 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
16523 exception, report error 120 `object reference required'.
16525 * driver.cs: Add --pause option, used during to measure the size
16526 of the process as it goes with --timestamp.
16528 * expression.cs (Invocation.DoResolve): Do not allow methods with
16529 SpecialName to be invoked.
16531 2002-12-21 Miguel de Icaza <miguel@ximian.com>
16533 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
16534 number before adding it.
16536 2002-12-21 Ravi Pratap <ravi@ximian.com>
16538 * ecore.cs (StandardImplicitConversion): When in an unsafe
16539 context, we allow conversion between void * to any other pointer
16540 type. This fixes bug #35973.
16542 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
16544 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
16545 is not thrown when extensionless outputs are used
16547 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16549 * rootcontext.cs: fixed compilation of corlib.
16551 2002-12-19 Miguel de Icaza <miguel@ximian.com>
16553 * attribute.cs (Attributes.Contains): Add new method.
16555 * class.cs (MethodCore.LabelParameters): if the parameter is an
16556 `out' parameter, check that no attribute `[In]' has been passed.
16558 * enum.cs: Handle the `value__' name in an enumeration.
16560 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
16562 * decl.cs: Added special case to allow overrides on "protected
16565 2002-12-18 Ravi Pratap <ravi@ximian.com>
16567 * attribute.cs (Attributes.AddAttributeSection): Rename to this
16568 since it makes much more sense.
16570 (Attributes.ctor): Don't require a Location parameter.
16572 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
16574 * attribute.cs (ApplyAttributes): Remove extra Location parameters
16575 since we already have that information per attribute.
16577 * everywhere : make appropriate changes.
16579 * class.cs (LabelParameters): Write the code which actually
16580 applies attributes to the return type. We can't do this on the MS
16581 .NET runtime so we flag a warning in the case an exception is
16584 2002-12-18 Miguel de Icaza <miguel@ximian.com>
16586 * const.cs: Handle implicit null conversions here too.
16588 2002-12-17 Ravi Pratap <ravi@ximian.com>
16590 * class.cs (MethodCore.LabelParameters): Remove the extra
16591 Type [] parameter since it is completely unnecessary. Instead
16592 pass in the method's attributes so that we can extract
16593 the "return" attribute.
16595 2002-12-17 Miguel de Icaza <miguel@ximian.com>
16597 * cs-parser.jay (parse): Use Report.Error to flag errors instead
16598 of ignoring it and letting the compile continue.
16600 * typemanager.cs (ChangeType): use an extra argument to return an
16601 error condition instead of throwing an exception.
16603 2002-12-15 Miguel de Icaza <miguel@ximian.com>
16605 * expression.cs (Unary.TryReduce): mimic the code for the regular
16606 code path. Perform an implicit cast in the cases where we can
16607 implicitly convert to one of the integral types, and then reduce
16608 based on that constant. This fixes bug #35483.
16610 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16612 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
16614 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16616 * namespace.cs: fixed bug #35489.
16618 2002-12-12 Miguel de Icaza <miguel@ximian.com>
16620 * class.cs: Remove some dead code.
16622 * cs-parser.jay: Estimate the number of methods needed
16623 (RootContext.MethodCount);
16625 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
16626 numbers instead of StringBuilders.
16628 * support.cs (PtrHashtable): Add constructor with initial size;
16629 We can now reduce reallocations of the method table.
16631 2002-12-10 Ravi Pratap <ravi@ximian.com>
16633 * attribute.cs (ApplyAttributes): Keep track of the emitted
16634 attributes on a per-target basis. This fixes bug #35413.
16636 2002-12-10 Miguel de Icaza <miguel@ximian.com>
16638 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
16639 default to the Windows 1252 encoding.
16641 (UnixParseOption): Support version, thanks to Alp for the missing
16644 * AssemblyInfo.cs: Add nice assembly information.
16646 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
16649 * cs-parser.jay: Allow a trailing comma before the close bracked
16650 in the attribute_section production.
16652 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
16653 address of the instance was being taken, I will take this out,
16654 because we take the address of the object immediately here.
16656 2002-12-09 Ravi Pratap <ravi@ximian.com>
16658 * typemanager.cs (AreMultipleAllowed): Take care of the most
16659 obvious case where attribute type is not in the current assembly -
16662 2002-12-08 Miguel de Icaza <miguel@ximian.com>
16664 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
16665 definitions, instead of doing that afterwards.
16667 Also we use a nice little hack, depending on the constructor, we
16668 know if we are a "composed" name or a simple name. Hence, we
16669 avoid the IndexOf test, and we avoid
16671 * codegen.cs: Add code to assist in a bug reporter to track down
16672 the source of a compiler crash.
16674 2002-12-07 Ravi Pratap <ravi@ximian.com>
16676 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
16677 types have been emitted for a given element and flag an error
16678 if something which does not have AllowMultiple set is used more
16681 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
16682 attribute types and their corresponding AllowMultiple properties
16684 (AreMultipleAllowed): Check the property for a given type.
16686 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
16687 property in the case we have a TypeContainer.
16689 (Attributes.AddAttribute): Detect duplicates and just skip on
16690 adding them. This trivial fix catches a pretty gross error in our
16691 attribute emission - global attributes were being emitted twice!
16693 Bugzilla bug #33187 is now fixed.
16695 2002-12-06 Miguel de Icaza <miguel@ximian.com>
16697 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
16698 instead of pp_and).
16700 * expression.cs (Binary.ResolveOperator): I can only use the
16701 Concat (string, string, string) and Concat (string, string,
16702 string, string) if the child is actually a concatenation of
16705 2002-12-04 Miguel de Icaza <miguel@ximian.com>
16707 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
16708 context where we need a 2-character lookahead.
16710 * pending.cs (PendingImplementation): Rework so we can keep track
16711 of interface types all the time, and flag those which were
16712 implemented by parents as optional.
16714 2002-12-03 Miguel de Icaza <miguel@ximian.com>
16716 * expression.cs (Binary.ResolveOperator): Use
16717 String.Concat(string,string,string) or
16718 String.Concat(string,string,string,string) when possible.
16720 * typemanager: More helper methods.
16723 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
16725 * pending.cs: remove the bogus return from GetMissingInterfaces()
16726 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
16728 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16730 * namespace.cs: avoid duplicated 'using xxx' being added to
16731 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
16732 when we get more than one 'using' statement for the same namespace.
16733 Report a CS0105 warning for it.
16735 2002-11-30 Miguel de Icaza <miguel@ximian.com>
16737 * cs-tokenizer.cs (consume_identifier): use read directly, instead
16738 of calling getChar/putback, uses internal knowledge of it.
16740 (xtoken): Reorder tokenizer so most common patterns are checked
16741 first. This reduces the compilation time in another 5% (from 8.11s
16742 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
16744 The parsing time is 22% of the compilation in mcs, and from that
16745 64% is spent on the tokenization process.
16747 I tried using a binary search for keywords, but this is slower
16748 than the hashtable. Another option would be to do a couple of
16751 * Not use a StringBuilder, instead use an array of chars,
16752 with a set value. Notice that this way we could catch
16753 the 645 error without having to do it *afterwards*.
16755 * We could write a hand-parser to avoid the hashtable
16756 compares altogether.
16758 The identifier consumption process takes 37% of the tokenization
16759 time. Another 15% is spent on is_number. 56% of the time spent
16760 on is_number is spent on Int64.Parse:
16762 * We could probably choose based on the string length to
16763 use Int32.Parse or Int64.Parse and avoid all the 64-bit
16766 Another 3% is spend on wrapping `xtoken' in the `token' function.
16768 Handle 0xa0 as whitespace (#34752)
16770 2002-11-26 Miguel de Icaza <miguel@ximian.com>
16772 * typemanager.cs (IsCLRType): New routine to tell whether a type
16773 is one of the builtin types.
16775 Maybe it needs to use TypeCodes to be faster. Maybe we could use
16776 typecode in more places instead of doing pointer comparissions.
16777 We could leverage some knowledge about the way the typecodes are
16780 New code to cache namespaces in assemblies, it is currently not
16781 invoked, to be used soon.
16783 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
16785 * expression.cs (Binary.ResolveOperator): specially handle
16786 strings, and do not perform user-defined operator overloading for
16789 2002-11-24 Miguel de Icaza <miguel@ximian.com>
16791 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
16792 internalcall as it is a pretty simple operation; Avoid whenever
16793 possible to call Char.IsLetter.
16795 (consume_identifier): Cut by half the number of
16796 hashtable calls by merging the is_keyword and GetKeyword behavior.
16798 Do not short-circuit, because if we do, we
16799 report errors (ie, #if false && true would produce an invalid
16803 2002-11-24 Martin Baulig <martin@ximian.com>
16805 * expression.cs (Cast.TryReduce): If we're in checked syntax,
16806 check constant ranges and report a CS0221. Fixes #33186.
16808 2002-11-24 Martin Baulig <martin@ximian.com>
16810 * cs-parser.jay: Make this work for uninitialized variable
16811 declarations in the `for' initializer. Fixes #32416.
16813 2002-11-24 Martin Baulig <martin@ximian.com>
16815 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
16816 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
16818 2002-11-24 Martin Baulig <martin@ximian.com>
16820 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
16821 argument; if true, we also check for user-defined conversions.
16822 This is only needed if both arguments are of a user-defined type.
16823 Fixes #30443, added test-175.cs.
16824 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
16826 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
16828 2002-11-24 Martin Baulig <martin@ximian.com>
16830 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
16831 function to get the store opcode.
16832 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
16833 only emit the Ldelema if the store opcode is Stobj. You must run
16834 both test-34 and test-167 to test this. Fixes #34529.
16836 2002-11-23 Martin Baulig <martin@ximian.com>
16838 * ecore.cs (Expression.MemberLookup): Added additional
16839 `qualifier_type' argument which is used when we're being called
16840 from MemberAccess.DoResolve() and null if we're called from a
16842 (Expression.MemberLookupFailed): New method to report errors; this
16843 does the CS1540 check and reports the correct error message.
16845 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
16846 argument for the CS1540 check and redone the way how we're dealing
16847 with private members. See the comment in the source code for details.
16848 (FilterWithClosure): Reverted this back to revision 1.197; renamed
16849 `closure_start_type' to `closure_qualifier_type' and check whether
16850 it's not null. It was not this filter being broken, it was just
16851 being called with the wrong arguments.
16853 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
16854 and pass it the correct `qualifier_type'; this also does the error
16857 2002-11-22 Miguel de Icaza <miguel@ximian.com>
16859 * expression.cs (Invocation.EmitParams): If the we are dealing
16860 with a non-built-in value type, load its address as well.
16862 (ArrayCreation): Use a a pretty constant instead
16863 of the hardcoded value 2. Use 6 instead of 2 for the number of
16864 static initializers.
16866 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
16867 because they are not really value types, just glorified integers.
16869 * driver.cs: Do not append .exe, the CSC compiler does not do it.
16871 * ecore.cs: Remove redundant code for enumerations, make them use
16872 the same code path as everything else, fixes the casting issue
16873 with enumerations in Windows.Forms.
16875 * attribute.cs: Do only cast to string if it is a string, the
16876 validation happens later.
16878 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
16879 people upgrade their corlibs.
16881 * ecore.cs: Oops, enumerations were not following the entire code path
16883 2002-11-21 Miguel de Icaza <miguel@ximian.com>
16885 * typemanager.cs (FilterWithClosure): Commented out the test for
16886 1540 in typemanager.cs, as it has problems when accessing
16887 protected methods from a parent class (see test-174.cs).
16889 * attribute.cs (Attribute.ValidateGuid): new method.
16890 (Attribute.Resolve): Use above.
16892 2002-11-19 Miguel de Icaza <miguel@ximian.com>
16894 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
16896 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
16897 handling for enumerations, as we only needed the TypeContainer
16898 functionality to begin with (this is required for the fix below to
16899 work for enums that reference constants in a container class for
16902 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
16904 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
16905 a valid TypeBuilder to perform lookups on.o
16907 * class.cs (InheritableMemberSignatureCompare): Use true in the
16908 call to GetGetMethod and GetSetMethod, because we are comparing
16909 the signature, and we need to get the methods *even* if they are
16912 (PropertyBase.CheckBase): ditto.
16914 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
16915 GotoCase.Resolve): Use Peel on EmpytCasts.
16917 * ecore.cs (EmptyCast): drop child, add Peel method.
16919 2002-11-17 Martin Baulig <martin@ximian.com>
16921 * ecore.cs (EmptyCast.Child): New public property.
16923 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
16924 label resolved to an EmptyCast. Fixes #34162.
16925 (GotoCase.Resolve): Likewise.
16926 (Block.EmitMeta): Likewise.
16928 2002-11-17 Martin Baulig <martin@ximian.com>
16930 * expression.cs (Invocation.BetterConversion): Prefer int over
16931 uint; short over ushort; long over ulong for integer literals.
16932 Use ImplicitConversionExists instead of StandardConversionExists
16933 since we also need to check for user-defined implicit conversions.
16934 Fixes #34165. Added test-173.cs.
16936 2002-11-16 Martin Baulig <martin@ximian.com>
16938 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
16939 with the `true' and `false' literals. Fixes #33151.
16941 2002-11-16 Martin Baulig <martin@ximian.com>
16943 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
16944 October 22nd; don't do the cs1540 check for static members.
16946 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
16947 now using our own filter here and doing the cs1540 check again.
16949 2002-11-16 Martin Baulig <martin@ximian.com>
16951 * support.cs (InternalParameters): Don't crash if we don't have
16952 any fixed parameters. Fixes #33532.
16954 2002-11-16 Martin Baulig <martin@ximian.com>
16956 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
16957 when looking up static methods to make this work on Windows.
16960 2002-11-16 Martin Baulig <martin@ximian.com>
16962 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
16963 a setter rather than using PropertyInfo.CanWrite.
16965 2002-11-15 Nick Drochak <ndrochak@gol.com>
16967 * class.cs: Allow acces to block member by subclasses. Fixes build
16970 2002-11-14 Martin Baulig <martin@ximian.com>
16972 * class.cs (Constructor.Emit): Added the extern/block check.
16975 2002-11-14 Martin Baulig <martin@ximian.com>
16977 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
16978 iteration while looking for indexers, this is needed because the
16979 indexer may have a different name in our base classes. Fixed the
16980 error reporting (no indexers at all, not get accessor, no
16981 overloaded match). Fixes bug #33089.
16982 (IndexerAccess.DoResolveLValue): Likewise.
16984 2002-11-14 Martin Baulig <martin@ximian.com>
16986 * class.cs (PropertyBase.CheckBase): Make this work for multiple
16987 indexers. Fixes the first part of bug #33089.
16988 (MethodSignature.InheritableMemberSignatureCompare): Added support
16991 2002-11-13 Ravi Pratap <ravi@ximian.com>
16993 * attribute.cs (Attribute.Resolve): Catch the
16994 NullReferenceException and report it since it isn't supposed to
16997 2002-11-12 Miguel de Icaza <miguel@ximian.com>
16999 * expression.cs (Binary.EmitBranchable): Also handle the cases for
17000 LogicalOr and LogicalAnd that can benefit from recursively
17001 handling EmitBranchable. The code now should be nice for Paolo.
17003 2002-11-08 Miguel de Icaza <miguel@ximian.com>
17005 * typemanager.cs (LookupType): Added a negative-hit hashtable for
17006 the Type lookups, as we perform quite a number of lookups on
17007 non-Types. This can be removed once we can deterministically tell
17008 whether we have a type or a namespace in advance.
17010 But this might require special hacks from our corlib.
17014 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
17015 and double which avoids a conversion from an integer to a double.
17017 * expression.cs: tiny optimization, avoid calling IsConstant,
17018 because it effectively performs the lookup twice.
17020 2002-11-06 Miguel de Icaza <miguel@ximian.com>
17022 But a bogus return here to keep the semantics of the old code
17023 until the Mono runtime is fixed.
17025 * pending.cs (GetMissingInterfaces): New method used to remove all
17026 the interfaces that are already implemented by our parent
17027 classes from the list of pending methods.
17029 * interface.cs: Add checks for calls after ResolveTypeExpr.
17031 2002-11-05 Miguel de Icaza <miguel@ximian.com>
17033 * class.cs (Class.Emit): Report warning 67: event not used if the
17034 warning level is beyond 3.
17036 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
17037 being a NullLiteral.
17039 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
17042 * class.cs (TypeContainer.GetClassBases): Cover a missing code
17043 path that might fail if a type can not be resolved.
17045 * expression.cs (Binary.Emit): Emit unsigned versions of the
17048 * driver.cs: use error 5.
17050 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
17052 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
17054 2002-11-01 Miguel de Icaza <miguel@ximian.com>
17056 * cs-parser.jay (switch_section): A beautiful patch from Martin
17057 Baulig that fixed 33094.
17059 2002-10-31 Miguel de Icaza <miguel@ximian.com>
17061 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
17062 Check whether the base is abstract and report an error if so.
17064 * expression.cs (IndexerAccess.DoResolveLValue,
17065 IndexerAccess.DoResolve): ditto.
17067 (Invocation.DoResolve): ditto.
17069 (Invocation.FullMethodDesc): Improve the report string.
17071 * statement.cs (Block): Eliminate IsVariableDefined as it is
17072 basically just a wrapper for GetVariableInfo.
17074 * ecore.cs (SimpleName): Use new
17076 * support.cs (ReflectionParamter.ParameterType): We unwrap the
17077 type, as we return the actual parameter ref/unref state on a
17080 2002-10-30 Miguel de Icaza <miguel@ximian.com>
17082 * support.cs: Return proper flags REF/OUT fixing the previous
17085 * expression.cs: Reverted last patch, that was wrong. Is_ref is
17086 not used to mean `ref' but `ref or out' in ParameterReference
17088 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
17089 full type signature instead of calling TypeManger.CSharpName
17092 * support.cs (InternalParameters.ParameterDesc): Do not compare
17093 directly to the modflags, because REF/OUT will actually be bitsets
17096 * delegate.cs (VerifyMethod): Check also the modifiers.
17098 * cs-tokenizer.cs: Fix bug where floating point values with an
17099 exponent where a sign was missing was ignored.
17101 * driver.cs: Allow multiple assemblies to be specified in a single
17104 2002-10-28 Miguel de Icaza <miguel@ximian.com>
17106 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
17107 because identifiers after a parenthesis would end up in this kind
17108 of production, and we needed to desamiguate it for having casts
17111 (UserDefinedType *) xxx
17113 2002-10-24 Miguel de Icaza <miguel@ximian.com>
17115 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
17116 we should set on the Bindingflags.NonPublic, but not turn on
17117 private_ok. private_ok controls whether a Private member is
17118 returned (this is chekced on the filter routine), while the
17119 BindingFlags.NonPublic just controls whether private/protected
17120 will be allowed. This fixes the problem part of the problem of
17121 private properties being allowed to be used in derived classes.
17123 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
17124 so we can call the children DoResolveLValue method (this will
17125 properly signal errors on lvalue assignments to base properties)
17127 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
17128 getter are null, and we have a property info, we know that this
17129 happened because the lookup failed, so we report an error 122 for
17130 protection level violation.
17132 We also silently return if setter and getter are null in the
17133 resolve functions, this condition only happens if we have flagged
17134 the error before. This is the other half of the problem.
17136 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
17137 not have accessibility information, that is why we were returning
17138 true in the filter function in typemanager.cs.
17140 To properly report 122 (property is inaccessible because of its
17141 protection level) correctly, we report this error in ResolveAccess
17142 by failing if both the setter and the getter are lacking (ie, the
17145 DoResolve and DoLResolve have been modified to check for both
17146 setter/getter being null and returning silently, the reason being
17147 that I did not want to put the knowledge about this error in upper
17150 int old = Report.Errors;
17151 x = new PropertyExpr (...);
17152 if (old != Report.Errors)
17157 So the property expr is returned, but it is invalid, so the error
17158 will be flagged during the resolve process.
17160 * class.cs: Remove InheritablePropertySignatureCompare from the
17161 class, as we no longer depend on the property signature to compute
17162 whether it is possible to implement a method or not.
17164 The reason is that calling PropertyInfo.GetGetMethod will return
17165 null (in .NET, in Mono it works, and we should change this), in
17166 cases where the Get Method does not exist in that particular
17171 class X { public virtual int A { get { return 1; } } }
17173 class Z : Y { public override int A { get { return 2; } } }
17175 Would fail in Z because the parent (Y) would not have the property
17176 defined. So we avoid this completely now (because the alternative
17177 fix was ugly and slow), and we now depend exclusively on the
17180 (PropertyBase.CheckBase): Use a method-base mechanism to find our
17181 reference method, instead of using the property.
17183 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
17184 routines are gone now.
17186 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
17187 names, they were incorrectly named.
17189 * cs-tokenizer.cs: Return are more gentle token on failure.
17191 * pending.cs (PendingImplementation.InterfaceMethod): This routine
17192 had an out-of-sync index variable, which caused it to remove from
17193 the list of pending methods the wrong method sometimes.
17195 2002-10-22 Miguel de Icaza <miguel@ximian.com>
17197 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
17198 CanWrite, because those refer to this particular instance of the
17199 property, and do not take into account the fact that we can
17200 override single members of a property.
17202 Constructor requires an EmitContext. The resolution process does
17203 not happen here, but we need to compute the accessors before,
17204 because the resolution does not always happen for properties.
17206 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
17207 subclass, before we did not update this flag, but we did update
17210 (GetAccessors): Drop this routine, as it did not work in the
17211 presence of partially overwritten set/get methods.
17213 Notice that this broke the cs1540 detection, but that will require
17216 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17220 * driver.cs: issue a warning instead of an error if we don't support
17221 debugging for the platform. Also ignore a couple of errors that may
17222 arise when trying to write the symbols. Undo my previous patch.
17224 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17226 * driver.cs: ignore /debug switch except for Unix platforms.
17228 2002-10-23 Nick Drochak <ndrochak@gol.com>
17230 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
17232 2002-10-21 Miguel de Icaza <miguel@ximian.com>
17234 * driver.cs: Do not make mcs-debug conditional, so we do not break
17235 builds that use it.
17237 * statement.cs (UsageVector.MergeChildren): I would like Martin to
17238 review this patch. But basically after all the children variables
17239 have been merged, the value of "Breaks" was not being set to
17240 new_breaks for Switch blocks. I think that it should be set after
17241 it has executed. Currently I set this to the value of new_breaks,
17242 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
17243 conservative, but I do not understand this code very well.
17245 I did not break anything in the build, so that is good ;-)
17247 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
17249 2002-10-20 Mark Crichton <crichton@gimp.org>
17251 * cfold.cs: Fixed compile blocker. Really fixed it this time.
17253 2002-10-20 Nick Drochak <ndrochak@gol.com>
17255 * cfold.cs: Fixed compile blocker.
17257 2002-10-20 Miguel de Icaza <miguel@ximian.com>
17259 * driver.cs: I was chekcing the key, not the file.
17261 2002-10-19 Ravi Pratap <ravi@ximian.com>
17263 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
17264 message that we were generating - we just need to silently return
17267 2002-10-19 Miguel de Icaza <miguel@ximian.com>
17269 * class.cs (Event.Define): Change my previous commit, as this
17270 breaks the debugger. This is a temporary hack, as it seems like
17271 the compiler is generating events incorrectly to begin with.
17273 * expression.cs (Binary.ResolveOperator): Added support for
17274 "U operator - (E x, E y)"
17276 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
17279 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
17280 init-only variables, but this path did not take into account that
17281 there might be also instance readonly variables. Correct this
17284 This fixes bug 32253
17286 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
17289 * driver.cs: Change the extension for modules to `netmodule'
17291 * cs-parser.jay: Improved slightly the location tracking for
17292 the debugger symbols.
17294 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
17295 modifiers that were specified instead of the hardcoded value
17296 (FamAndAssem). This was basically ignoring the static modifier,
17297 and others. Fixes 32429.
17299 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
17300 fixed a bug in the process (32476)
17302 * expression.cs (ArrayAccess.EmitAssign): Patch from
17303 hwang_rob@yahoo.ca that fixes bug 31834.3
17305 2002-10-18 Miguel de Icaza <miguel@ximian.com>
17307 * driver.cs: Make the module extension .netmodule.
17309 2002-10-16 Miguel de Icaza <miguel@ximian.com>
17311 * driver.cs: Report an error if the resource file is not found
17312 instead of crashing.
17314 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
17315 false, like Emit does.
17317 2002-10-16 Nick Drochak <ndrochak@gol.com>
17319 * typemanager.cs: Remove unused private member. Also reported mcs
17320 bug to report this as a warning like csc.
17322 2002-10-15 Martin Baulig <martin@gnome.org>
17324 * statement.cs (Statement.Emit): Made this a virtual method; emits
17325 the line number info and calls DoEmit().
17326 (Statement.DoEmit): New protected abstract method, formerly knows
17327 as Statement.Emit().
17329 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
17331 2002-10-11 Miguel de Icaza <miguel@ximian.com>
17333 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
17334 have fixed a remaining problem: not every AddXXXX was adding a
17335 fully qualified name.
17337 Now everyone registers a fully qualified name in the DeclSpace as
17338 being defined instead of the partial name.
17340 Downsides: we are slower than we need to be due to the excess
17341 copies and the names being registered this way.
17343 The reason for this is that we currently depend (on the corlib
17344 bootstrap for instance) that types are fully qualified, because
17345 we dump all the types in the namespace, and we should really have
17346 types inserted into the proper namespace, so we can only store the
17347 basenames in the defined_names array.
17349 2002-10-10 Martin Baulig <martin@gnome.org>
17351 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
17352 from bug #31834, see the bug report for a testcase which is
17355 2002-10-10 Martin Baulig <martin@gnome.org>
17357 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
17358 flow analysis code for this.
17360 * statement.cs (Do, While, For): Tell the flow analysis code about
17362 (FlowBranching.UsageVector): Added support for infinite loops.
17363 (Block.Resolve): Moved the dead code elimination here and use flow
17366 2002-10-09 Miguel de Icaza <miguel@ximian.com>
17368 * class.cs (Field.Define): Catch cycles on struct type
17371 * typemanager.cs (IsUnmanagedtype): Do not recursively check
17372 fields if the fields are static. We only need to check instance
17375 * expression.cs (As.DoResolve): Test for reference type.
17377 * statement.cs (Using.ResolveExpression): Use
17378 ConvertImplicitRequired, not ConvertImplicit which reports an
17380 (Using.ResolveLocalVariableDecls): ditto.
17382 * expression.cs (Binary.ResolveOperator): Report errors in a few
17383 places where we had to.
17385 * typemanager.cs (IsUnmanagedtype): Finish implementation.
17387 2002-10-08 Miguel de Icaza <miguel@ximian.com>
17389 * expression.cs: Use StoreFromPtr instead of extracting the type
17390 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
17392 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
17393 an enumeration value to a System.Enum, but System.Enum is not a
17394 value type, but an class type, so we need to box.
17396 (Expression.ConvertExplicit): One codepath could return
17397 errors but not flag them. Fix this. Fixes #31853
17399 * parameter.cs (Resolve): Do not allow void as a parameter type.
17401 2002-10-06 Martin Baulig <martin@gnome.org>
17403 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
17404 if it's a class type and not a struct. Fixes #31815.
17406 2002-10-06 Martin Baulig <martin@gnome.org>
17408 * statement.cs: Reworked the flow analysis code a bit to make it
17409 usable for dead code elimination.
17411 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17413 * cs-parser.jay: allow empty source files. Fixes bug #31781.
17415 2002-10-04 Miguel de Icaza <miguel@ximian.com>
17417 * expression.cs (ComposedCast.DoResolveType): A quick workaround
17418 to fix the test 165, will investigate deeper.
17420 2002-10-04 Martin Baulig <martin@gnome.org>
17422 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
17423 finally blocks actually work.
17424 (Try.Resolve): We don't need to create a sibling for `finally' if
17425 there is no finally block.
17427 2002-10-04 Martin Baulig <martin@gnome.org>
17429 * class.cs (Constructor.Define): The default accessibility for a
17430 non-default constructor is private, not public.
17432 2002-10-04 Miguel de Icaza <miguel@ximian.com>
17434 * class.cs (Constructor): Make AllowedModifiers public, add
17437 * cs-parser.jay: Perform the modifiers test here, as the
17438 constructor for the Constructor class usually receives a zero
17439 because of the way we create it (first we create, later we
17440 customize, and we were never checking the modifiers).
17442 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
17443 is a version of LookupTypeReflection that includes the type-name
17444 cache. This can be used as a fast path for functions that know
17445 the fully qualified name and are only calling into *.GetType() to
17446 obtain a composed type.
17448 This is also used by TypeManager.LookupType during its type
17451 (LookupType): We now also track the real type name, as sometimes
17452 we can get a quey for the real type name from things like
17453 ComposedCast. This fixes bug 31422.
17455 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
17456 complete type fullname, it does not have to go through the type
17457 resolution system to obtain the composed version of the type (for
17458 obtaining arrays or pointers).
17460 (Conditional.Emit): Use the EmitBoolExpression to
17461 generate nicer code, as requested by Paolo.
17463 (ArrayCreation.CheckIndices): Use the patch from
17464 hwang_rob@yahoo.ca to validate the array initializers.
17466 2002-10-03 Miguel de Icaza <miguel@ximian.com>
17468 * class.cs (ConstructorInitializer.Emit): simplify code by using
17469 Invocation.EmitCall, and at the same time, fix the bugs in calling
17470 parent constructors that took variable arguments.
17472 * ecore.cs (Expression.ConvertNumericExplicit,
17473 Expression.ImplicitNumericConversion): Remove the code that
17474 manually wrapped decimal (InternalTypeConstructor call is now gone
17477 * expression.cs (Cast.TryReduce): Also handle decimal types when
17478 trying to perform a constant fold on the type.
17480 * typemanager.cs (IsUnmanagedtype): Partially implemented.
17482 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
17483 that only turned off an error report, and did nothing else.
17485 2002-10-02 Miguel de Icaza <miguel@ximian.com>
17487 * driver.cs: Handle and ignore /fullpaths
17489 2002-10-01 Miguel de Icaza <miguel@ximian.com>
17491 * expression.cs (Binary.ResolveOperator): Catch the case where
17492 DoNumericPromotions returns true,
17494 (Binary.DoNumericPromotions): Simplify the code, and the tests.
17496 2002-09-27 Miguel de Icaza <miguel@ximian.com>
17498 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
17501 2002-09-26 Miguel de Icaza <miguel@ximian.com>
17503 * ecore.cs (ConvertNumericExplicit): It is not enough that the
17504 conversion exists, but it is also required that the conversion be
17505 performed. This manifested in "(Type64Enum) 2".
17507 * class.cs (TypeManager.AddMethod): The fix is not to change
17508 AddEnum, because that one was using a fully qualified name (every
17509 DeclSpace derivative does), but to change the AddMethod routine
17510 that was using an un-namespaced name. This now correctly reports
17511 the duplicated name.
17513 Revert patch until I can properly fix it. The issue
17514 is that we have a shared Type space across all namespaces
17515 currently, which is wrong.
17517 Options include making the Namespace a DeclSpace, and merge
17518 current_namespace/current_container in the parser.
17520 2002-09-25 Miguel de Icaza <miguel@ximian.com>
17522 * cs-parser.jay: Improve error reporting when we get a different
17523 kind of expression in local_variable_type and
17524 local_variable_pointer_type.
17526 Propagate this to avoid missleading errors being reported.
17528 * ecore.cs (ImplicitReferenceConversion): treat
17529 TypeManager.value_type as a target just like object_type. As
17534 Is valid, and needs to result in the int 1 being boxed before it
17535 is assigned to the value type v.
17537 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
17538 to validate the enumeration name.
17540 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
17541 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
17542 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
17544 * ecore.cs (TryImplicitIntConversion): When doing an
17545 implicit-enumeration-conversion, check if the type is 64-bits and
17546 perform a conversion before passing to EnumConstant.
17548 2002-09-23 Miguel de Icaza <miguel@ximian.com>
17550 * decl.cs (Error_AmbiguousTypeReference); New routine used to
17551 report ambiguous type references. Unlike the MS version, we
17552 report what the ambiguity is. Innovation at work ;-)
17554 (DeclSpace.FindType): Require a location argument to
17555 display when we display an ambiguous error.
17557 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
17559 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
17561 * expression.cs (EmitDynamicInitializers): Apply patch from
17562 hwang_rob@yahoo.ca that fixes the order in which we emit our
17565 2002-09-21 Martin Baulig <martin@gnome.org>
17567 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
17568 delegate takes no arguments.
17570 2002-09-20 Miguel de Icaza <miguel@ximian.com>
17572 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
17575 * expression.cs: Extract the underlying type.
17577 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
17579 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
17581 2002-09-19 Miguel de Icaza <miguel@ximian.com>
17583 * class.cs (TypeContainer.DefineType): We can not use the nice
17584 PackingSize with the size set to 1 DefineType method, because it
17585 will not allow us to define the interfaces that the struct
17588 This completes the fixing of bug 27287
17590 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
17591 means also structs. This fixes part of the problem.
17592 (Expresion.ImplicitReferenceConversionExists): ditto.
17594 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
17595 error if there were no errors reported during the type lookup
17596 process, to avoid duplicates or redundant errors. Without this
17597 you would get an ambiguous errors plus a type not found. We have
17598 beaten the user enough with the first error.
17600 (DeclSparce.FindType): Emit a warning if we have an ambiguous
17603 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
17604 during the resolution process, stop the lookup, this avoids
17605 repeated error reports (same error twice).
17607 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
17609 * typemanager.cs (LookupType): Redo the type lookup code to match
17610 the needs of System.Reflection.
17612 The issue is that System.Reflection requires references to nested
17613 types to begin with a "+" sign instead of a dot. So toplevel
17614 types look like: "NameSpace.TopLevelClass", and nested ones look
17615 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
17618 2002-09-19 Martin Baulig <martin@gnome.org>
17620 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
17621 says that a method always returns or always throws an exception,
17622 don't report the CS0161.
17624 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
17625 set `Returns = new_returns'.
17627 2002-09-19 Martin Baulig <martin@gnome.org>
17629 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
17630 to an enum constant, check for a CS0176.
17632 2002-09-18 Miguel de Icaza <miguel@ximian.com>
17634 * class.cs (TypeContainer.CheckPairedOperators): Now we check
17635 for operators that must be in pairs and report errors.
17637 * ecore.cs (SimpleName.DoResolveType): During the initial type
17638 resolution process, when we define types recursively, we must
17639 check first for types in our current scope before we perform
17640 lookups in the enclosing scopes.
17642 * expression.cs (MakeByteBlob): Handle Decimal blobs.
17644 (Invocation.VerifyArgumentsCompat): Call
17645 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
17646 I thought we were supposed to always call this, but there are a
17647 few places in the code where we dont do it.
17649 2002-09-17 Miguel de Icaza <miguel@ximian.com>
17651 * driver.cs: Add support in -linkres and -resource to specify the
17652 name of the identifier.
17654 2002-09-16 Miguel de Icaza <miguel@ximian.com>
17656 * ecore.cs (StandardConversionExists): Sync with the conversion
17657 code: allow anything-* to void* conversions.
17659 (FindMostSpecificSource): Use an Expression argument
17660 instead of a Type, because we might be handed over a Literal which
17661 gets a few more implicit conversions that plain types do not. So
17662 this information was being lost.
17664 Also, we drop the temporary type-holder expression when not
17667 2002-09-17 Martin Baulig <martin@gnome.org>
17669 * class.cs (PropertyBase.CheckBase): Don't check the base class if
17670 this is an explicit interface implementation.
17672 2002-09-17 Martin Baulig <martin@gnome.org>
17674 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
17675 different `IndexerName' attributes.
17677 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
17678 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
17679 virtual CommonResolve().
17681 2002-09-16 Miguel de Icaza <miguel@ximian.com>
17683 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
17684 and convert that to the UnderlyingType.
17686 * statement.cs (Foreach.Resolve): Indexers are just like variables
17687 or PropertyAccesses.
17689 * cs-tokenizer.cs (consume_string): Track line numbers and columns
17690 inside quoted strings, we were not doing this before.
17692 2002-09-16 Martin Baulig <martin@gnome.org>
17694 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
17695 resolve it. This is needed for the definite assignment check of the
17696 instance expression, fixes bug #29846.
17697 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
17699 2002-09-16 Nick Drochak <ndrochak@gol.com>
17701 * parameter.cs: Fix compile error. Cannot reference static member
17702 from an instance object. Is this an mcs bug?
17704 2002-09-14 Martin Baulig <martin@gnome.org>
17706 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
17707 multiple times. Fixes bug #30295, added test-166.cs.
17709 2002-09-14 Martin Baulig <martin@gnome.org>
17711 * statement.cs (Block.Emit): Don't emit unreachable code.
17712 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
17713 `break' statements.
17714 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
17716 2002-09-14 Martin Baulig <martin@gnome.org>
17718 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
17721 2002-09-14 Martin Baulig <martin@gnome.org>
17723 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
17724 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
17725 be false on the ms runtime.
17727 2002-09-13 Martin Baulig <martin@gnome.org>
17729 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
17730 the CS0038 error message.
17732 2002-09-12 Miguel de Icaza <miguel@ximian.com>
17734 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
17735 constant inside, return it.
17737 2002-09-12 Martin Baulig <martin@gnome.org>
17739 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
17740 implicit conversion can be done between enum types.
17742 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
17743 check whether an implicit conversion to the current enum's UnderlyingType
17744 exists and report an error if not.
17746 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
17747 without debugging support.
17749 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
17750 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
17752 2002-09-12 Martin Baulig <martin@gnome.org>
17754 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
17756 * ecore.cs (IMemberExpr.DeclaringType): New property.
17757 (SimpleName.SimpleNameResolve): Check whether we're accessing a
17758 nonstatic member of an outer type (CS0038).
17760 2002-09-11 Miguel de Icaza <miguel@ximian.com>
17762 * driver.cs: Activate the using-error detector at warning level
17763 4 (at least for MS-compatible APIs).
17765 * namespace.cs (VerifyUsing): Small buglett fix.
17767 * pending.cs (PendingImplementation): pass the container pointer.
17769 * interface.cs (GetMethods): Allow for recursive definition. Long
17770 term, I would like to move every type to support recursive
17771 definitions, not the current ordering mechanism that we have right
17774 The situation is this: Attributes are handled before interfaces,
17775 so we can apply attributes to interfaces. But some attributes
17776 implement interfaces, we will now handle the simple cases
17777 (recursive definitions will just get an error).
17779 * parameter.cs: Only invalidate types at the end if we fail to
17782 2002-09-09 Martin Baulig <martin@gnome.org>
17784 * ecore.cs (PropertyExpr.Emit): Also check for
17785 TypeManager.system_int_array_get_length so this'll also work when
17786 compiling corlib. Fixes #30003.
17788 2002-09-09 Martin Baulig <martin@gnome.org>
17790 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
17791 and throw an exception if we can't get the type's size. Fixed #30040,
17794 2002-09-09 Martin Baulig <martin@gnome.org>
17796 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
17798 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
17799 context. Fixes bug #30027.
17801 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
17802 virtual functions. Fixes bug #30043, added test-164.cs.
17804 2002-09-08 Ravi Pratap <ravi@ximian.com>
17806 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
17808 2002-09-08 Nick Drochak <ndrochak@gol.com>
17810 * driver.cs: Use an object to get the windows codepage since it's not a
17813 2002-09-08 Miguel de Icaza <miguel@ximian.com>
17815 * statement.cs (For.Emit): for infinite loops (test == null)
17816 return whether there is a break inside, not always "true".
17818 * namespace.cs (UsingEntry): New struct to hold the name of the
17819 using definition, the location where it is defined, and whether it
17820 has been used in a successful type lookup.
17822 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
17827 2002-09-06 Ravi Pratap <ravi@ximian.com>
17829 * attribute.cs : Fix incorrect code which relied on catching
17830 a NullReferenceException to detect a null being passed in
17831 where an object was expected.
17833 2002-09-06 Miguel de Icaza <miguel@ximian.com>
17835 * statement.cs (Try): flag the catch variable as assigned
17837 * expression.cs (Cast): Simplified by using ResolveType instead of
17838 manually resolving.
17840 * statement.cs (Catch): Fix bug by using ResolveType.
17842 2002-09-06 Ravi Pratap <ravi@ximian.com>
17844 * expression.cs (BetterConversion): Special case for when we have
17845 a NullLiteral as the argument and we have to choose between string
17846 and object types - we choose string the way csc does.
17848 * attribute.cs (Attribute.Resolve): Catch the
17849 NullReferenceException and report error #182 since the Mono
17850 runtime no more has the bug and having this exception raised means
17851 we tried to select a constructor which takes an object and is
17854 2002-09-05 Ravi Pratap <ravi@ximian.com>
17856 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
17857 message (1502, 1503) when we can't locate a method after overload
17858 resolution. This is much more informative and closes the bug
17861 * interface.cs (PopulateMethod): Return if there are no argument
17862 types. Fixes a NullReferenceException bug.
17864 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
17865 expressions too. Previously we were checking only in one place for
17866 positional arguments leaving out named arguments.
17868 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
17869 type to the enum type is not allowed. Remove code corresponding to
17872 (ConvertNumericExplicit): Allow explicit conversions from
17873 the underlying type to enum type. This precisely follows the spec
17874 and closes a bug filed by Gonzalo.
17876 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17879 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
17881 2002-09-03 Miguel de Icaza <miguel@ximian.com>
17883 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
17884 it was important that we stored the right value after the
17885 reduction in `converted'.
17887 2002-09-04 Martin Baulig <martin@gnome.org>
17889 * location.cs (Location.SymbolDocument): Use full pathnames for the
17892 2002-08-30 Miguel de Icaza <miguel@ximian.com>
17894 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
17895 of the expression resolve mechanism, because that will catch the
17896 SimpleName error failures.
17898 (Conditional): If we can not resolve the
17899 expression, return, do not crash.
17901 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17904 (location): display token name instead of its number.
17906 2002-08-28 Martin Baulig <martin@gnome.org>
17908 * expression.cs (Binary.ResolveOperator): Don't silently return
17909 but return an error if an operator cannot be applied between two
17912 2002-08-28 Martin Baulig <martin@gnome.org>
17914 * class.cs (Constructor.Define): Set the permission attributes
17915 correctly instead of making all constructors public.
17917 2002-08-28 Martin Baulig <martin@gnome.org>
17919 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
17920 for private members before reporting a CS0103; if we find anything,
17923 2002-08-28 Martin Baulig <martin@gnome.org>
17925 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
17926 to check whether `closure_start_type == closure_invocation_type',
17927 we also need to check whether `m.DeclaringType == closure_invocation_type'
17928 before bypassing the permission checks. We might be accessing
17929 protected/private members from the base class.
17930 (TypeManager.RealMemberLookup): Only set private_ok if private
17931 members were requested via BindingFlags.NonPublic.
17933 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
17935 * expression.cs (MemberAccess.ResolveMemberAccess): Set
17936 MethodGroupExpr.IsExplicitImpl if appropriate.
17937 (Invocation.DoResolve): Don't report the CS0120 for explicit
17938 interface implementations.
17940 2002-08-27 Martin Baulig <martin@gnome.org>
17942 * expression.cs (Invocation.DoResolve): If this is a static
17943 method and we don't have an InstanceExpression, we must report
17946 2002-08-25 Martin Baulig <martin@gnome.org>
17948 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
17949 `==' between a valuetype and an object.
17951 2002-08-25 Miguel de Icaza <miguel@ximian.com>
17953 * ecore.cs (TypeExpr): Provide a ToString method.
17955 2002-08-24 Martin Baulig <martin@gnome.org>
17957 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
17958 now called proggie.dbg and it's a binary file.
17960 2002-08-23 Martin Baulig <martin@gnome.org>
17962 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
17964 2002-08-23 Martin Baulig <martin@gnome.org>
17966 * struct.cs (MyStructInfo.ctor): Make this work with empty
17967 structs; it's not allowed to use foreach() on null.
17969 2002-08-23 Martin Baulig <martin@gnome.org>
17971 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
17972 writer the full pathname of the generated assembly.
17974 2002-08-23 Martin Baulig <martin@gnome.org>
17976 * statements.cs (FlowBranching.UsageVector.MergeChildren):
17977 A `finally' block never returns or breaks; improved handling of
17980 2002-08-23 Martin Baulig <martin@gnome.org>
17982 * statement.cs (Throw.Resolve): Allow `throw null'.
17984 2002-08-23 Martin Baulig <martin@gnome.org>
17986 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
17987 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
17988 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
17989 MemberLookup would return a wrong event if this is an explicit
17990 interface implementation and the class has an event with the same
17993 2002-08-23 Martin Baulig <martin@gnome.org>
17995 * statement.cs (Block.AddChildVariableNames): New public method.
17996 (Block.AddChildVariableName): Likewise.
17997 (Block.IsVariableNameUsedInChildBlock): Likewise.
17998 (Block.AddVariable): Check whether a variable name has already
17999 been used in a child block.
18001 * cs-parser.jay (declare_local_variables): Mark all variable names
18002 from the current block as being used in a child block in the
18005 2002-08-23 Martin Baulig <martin@gnome.org>
18007 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
18008 find the symbol writer.
18010 * driver.cs: csc also allows the arguments to /define being
18011 separated by commas, not only by semicolons.
18013 2002-08-23 Martin Baulig <martin@gnome.org>
18015 * interface.cs (Interface.GetMembers): Added static check for events.
18017 2002-08-15 Martin Baulig <martin@gnome.org>
18019 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
18020 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
18022 * ecore.cs (Expression.MemberLookup): Added documentation and explained
18023 why the MethodData.EmitDestructor() change was necessary.
18025 2002-08-20 Martin Baulig <martin@gnome.org>
18027 * class.cs (TypeContainer.FindMembers): Added static check for events.
18029 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
18031 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
18032 use Type.GetEvents(), not Type.FindMembers().
18034 2002-08-20 Martin Baulig <martin@gnome.org>
18036 * decl.cs (MemberCache): Added a special method cache which will
18037 be used for method-only searched. This ensures that a method
18038 search will return a MethodInfo with the correct ReflectedType for
18041 2002-08-20 Martin Baulig <martin@gnome.org>
18043 * decl.cs (DeclSpace.FindMembers): Made this public.
18045 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18047 * delegate.cs: fixed build on windows.
18048 [FIXME: Filed as bug #29150: MCS must report these errors.]
18050 2002-08-19 Ravi Pratap <ravi@ximian.com>
18052 * ecore.cs (StandardConversionExists): Return a false
18053 if we are trying to convert the void type to anything else
18054 since that is not allowed.
18056 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
18057 we flag error 70 in the event an event is trying to be accessed
18058 directly from outside the declaring type.
18060 2002-08-20 Martin Baulig <martin@gnome.org>
18062 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
18063 MemberCache from typemanager.cs to decl.cs.
18065 2002-08-19 Martin Baulig <martin@gnome.org>
18067 * class.cs (TypeContainer): Implement IMemberContainer.
18068 (TypeContainer.DefineMembers): Create the MemberCache.
18069 (TypeContainer.FindMembers): Do better BindingFlags checking; only
18070 return public members if BindingFlags.Public was given, check
18071 whether members are static.
18073 2002-08-16 Martin Baulig <martin@gnome.org>
18075 * decl.cs (DeclSpace.Define): Splitted this in Define and
18076 DefineMembers. DefineMembers is called first and initializes the
18079 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
18080 DefineMembers() on all our DeclSpaces.
18082 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
18083 but call DefineMembers() on all nested interfaces. We call their
18084 Define() in our new Define() function.
18086 * interface.cs (Interface): Implement IMemberContainer.
18087 (Interface.Define): Moved all code except the attribute stuf to
18089 (Interface.DefineMembers): Initialize the member cache.
18091 * typemanager.cs (IMemberFinder): Removed this interface, we don't
18092 need this anymore since we can use MemberCache.FindMembers directly.
18094 2002-08-19 Martin Baulig <martin@gnome.org>
18096 * typemanager.cs (MemberCache): When creating the cache for an
18097 interface type, add all inherited members.
18098 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
18099 to `out bool used_cache' and documented it.
18100 (TypeManager.MemberLookup): If we already used the cache in the first
18101 iteration, we don't need to do the interfaces check.
18103 2002-08-19 Martin Baulig <martin@gnome.org>
18105 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
18106 here from IMemberFinder and don't implement this interface anymore.
18107 (DeclSpace.MemberCache): Moved here from IMemberFinder.
18109 * typemanager.cs (IMemberFinder): This interface is now only used by
18110 classes which actually support the member cache.
18111 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
18112 since we only put DeclSpaces into this Hashtable.
18113 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
18114 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
18116 2002-08-16 Martin Baulig <martin@gnome.org>
18118 * typemanager.cs (ICachingMemberFinder): Removed.
18119 (IMemberFinder.MemberCache): New property.
18120 (TypeManager.FindMembers): Merged this with RealFindMembers().
18121 This function will never be called from TypeManager.MemberLookup()
18122 so we can't use the cache here, just the IMemberFinder.
18123 (TypeManager.MemberLookup_FindMembers): Check whether the
18124 IMemberFinder has a MemberCache and call the cache's FindMembers
18126 (MemberCache): Rewrote larger parts of this yet another time and
18127 cleaned it up a bit.
18129 2002-08-15 Miguel de Icaza <miguel@ximian.com>
18131 * driver.cs (LoadArgs): Support quoting.
18133 (Usage): Show the CSC-like command line arguments.
18135 Improved a few error messages.
18137 2002-08-15 Martin Baulig <martin@gnome.org>
18139 * typemanager.cs (IMemberContainer.Type): New property.
18140 (IMemberContainer.IsInterface): New property.
18142 The following changes are conditional to BROKEN_RUNTIME, which is
18143 defined at the top of the file.
18145 * typemanager.cs (MemberCache.MemberCache): Don't add the base
18146 class'es members, but add all members from TypeHandle.ObjectType
18147 if we're an interface.
18148 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
18149 is the current type.
18150 (MemberCache.CacheEntry.Container): Removed this field.
18151 (TypeHandle.GetMembers): Include inherited members.
18153 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18155 * typemanager.cs: fixed compilation and added a comment on a field that
18158 2002-08-15 Martin Baulig <martin@gnome.org>
18160 * class.cs (ConstructorInitializer.Resolve): In the
18161 Expression.MemberLookup call, use the queried_type as
18164 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
18165 declared' attribute, it's always true.
18166 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
18167 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
18168 temporary wrapper for FindMembers which tells MemberLookup whether
18169 members from the base classes are included in the return value.
18170 This will go away soon.
18171 (TypeManager.MemberLookup): Use this temporary hack here; once the
18172 new MemberCache is completed, we don't need to do the DeclaredOnly
18173 looping here anymore since the MemberCache will take care of this.
18174 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
18175 (MemberCache): When creating the MemberCache for a class, get
18176 members from the current class and all its base classes.
18177 (MemberCache.CacheEntry.Container): New field. This is a
18178 temporary hack until the Mono runtime is fixed to distinguish
18179 between ReflectedType and DeclaringType. It allows us to use MCS
18180 with both the MS runtime and the unfixed Mono runtime without
18181 problems and without accecting performance.
18182 (MemberCache.SearchMembers): The DeclaredOnly looping from
18183 TypeManager.MemberLookup is now done here.
18185 2002-08-14 Martin Baulig <martin@gnome.org>
18187 * statement.cs (MyStructInfo.MyStructInfo): Don't call
18188 Type.GetFields on dynamic types but get the fields from the
18189 corresponding TypeContainer.
18190 (MyStructInfo.GetStructInfo): Added check for enum types.
18192 * typemanager.cs (MemberList.IsSynchronized): Implemented.
18193 (MemberList.SyncRoot): Implemented.
18194 (TypeManager.FilterWithClosure): No need to check permissions if
18195 closure_start_type == closure_invocation_type, don't crash if
18196 closure_invocation_type is null.
18198 2002-08-13 Martin Baulig <martin@gnome.org>
18200 Rewrote TypeContainer.FindMembers to use a member cache. This
18201 gives us a speed increase of about 35% for the self-hosting MCS
18202 build and of about 15-20% for the class libs (both on GNU/Linux).
18204 * report.cs (Timer): New class to get enhanced profiling. This
18205 whole class is "TIMER" conditional since it remarkably slows down
18208 * class.cs (MemberList): New class. This is an IList wrapper
18209 which we're now using instead of passing MemberInfo[]'s around to
18210 avoid copying this array unnecessarily.
18211 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
18212 (ICachingMemberFinder, IMemberContainer): New interface.
18213 (TypeManager.FilterWithClosure): If `criteria' is null, the name
18214 has already been checked, otherwise use it for the name comparision.
18215 (TypeManager.FindMembers): Renamed to RealMemberFinder and
18216 provided wrapper which tries to use ICachingMemberFinder.FindMembers
18217 if possible. Returns a MemberList, not a MemberInfo [].
18218 (TypeHandle): New class, implements IMemberContainer. We create
18219 one instance of this class per type, it contains a MemberCache
18220 which is used to do the member lookups.
18221 (MemberCache): New class. Each instance of this class contains
18222 all members of a type and a name-based hash table.
18223 (MemberCache.FindMembers): This is our new member lookup
18224 function. First, it looks up all members of the requested name in
18225 the hash table. Then, it walks this list and sorts out all
18226 applicable members and returns them.
18228 2002-08-13 Martin Baulig <martin@gnome.org>
18230 In addition to a nice code cleanup, this gives us a performance
18231 increase of about 1.4% on GNU/Linux - not much, but it's already
18232 half a second for the self-hosting MCS compilation.
18234 * typemanager.cs (IMemberFinder): New interface. It is used by
18235 TypeManager.FindMembers to call FindMembers on a TypeContainer,
18236 Enum, Delegate or Interface.
18237 (TypeManager.finder_to_member_finder): New PtrHashtable.
18238 (TypeManager.finder_to_container): Removed.
18239 (TypeManager.finder_to_delegate): Removed.
18240 (TypeManager.finder_to_interface): Removed.
18241 (TypeManager.finder_to_enum): Removed.
18243 * interface.cs (Interface): Implement IMemberFinder.
18245 * delegate.cs (Delegate): Implement IMemberFinder.
18247 * enum.cs (Enum): Implement IMemberFinder.
18249 * class.cs (TypeContainer): Implement IMemberFinder.
18251 2002-08-12 Martin Baulig <martin@gnome.org>
18253 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
18255 2002-08-12 Martin Baulig <martin@gnome.org>
18257 * ecore.cs (ITypeExpression): New interface for expressions which
18259 (TypeExpression): Renamed to TypeLookupExpression.
18260 (Expression.DoResolve): If we're doing a types-only lookup, the
18261 expression must implement the ITypeExpression interface and we
18262 call DoResolveType() on it.
18263 (SimpleName): Implement the new ITypeExpression interface.
18264 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
18265 hack, the situation that we're only looking up types can't happen
18266 anymore when this method is called. Moved the type lookup code to
18267 DoResolveType() and call it.
18268 (SimpleName.DoResolveType): This ITypeExpression interface method
18269 is now doing the types-only lookup.
18270 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
18271 (ResolveFlags): Added MaskExprClass.
18273 * expression.cs (MemberAccess): Implement the ITypeExpression
18275 (MemberAccess.DoResolve): Added support for a types-only lookup
18276 when we're called via ITypeExpression.DoResolveType().
18277 (ComposedCast): Implement the ITypeExpression interface.
18279 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
18280 Expression.Resolve() with ResolveFlags.Type instead.
18282 2002-08-12 Martin Baulig <martin@gnome.org>
18284 * interface.cs (Interface.Define): Apply attributes.
18286 * attribute.cs (Attribute.ApplyAttributes): Added support for
18287 interface attributes.
18289 2002-08-11 Martin Baulig <martin@gnome.org>
18291 * statement.cs (Block.Emit): Only check the "this" variable if we
18292 do not always throw an exception.
18294 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
18295 whether the property has a set accessor.
18297 2002-08-11 Martin Baulig <martin@gnome.org>
18299 Added control flow analysis support for structs.
18301 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
18302 with control flow analysis turned off.
18303 (IVariable): New interface.
18304 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
18305 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
18306 (FieldExpr.DoResolve): Resolve the instance expression with flow
18307 analysis turned off and do the definite assignment check after the
18308 resolving when we know what the expression will resolve to.
18310 * expression.cs (LocalVariableReference, ParameterReference):
18311 Implement the new IVariable interface, only call the flow analysis
18312 code if ec.DoFlowAnalysis is true.
18313 (This): Added constructor which takes a Block argument. Implement
18314 the new IVariable interface.
18315 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
18316 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
18317 This does the definite assignment checks for struct members.
18319 * class.cs (Constructor.Emit): If this is a non-static `struct'
18320 constructor which doesn't have any initializer, call
18321 Block.AddThisVariable() to tell the flow analysis code that all
18322 struct elements must be initialized before control returns from
18325 * statement.cs (MyStructInfo): New public class.
18326 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
18327 argument to this indexer. If non-zero, check an individual struct
18328 member, not the whole struct.
18329 (FlowBranching.CheckOutParameters): Check struct members.
18330 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
18331 overloaded versions of these methods which take an additional
18332 `int field_idx' argument to check struct members.
18333 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
18334 overloaded versions of these methods which take an additional
18335 `string field_name' argument to check struct member.s
18336 (VariableInfo): Implement the IVariable interface.
18337 (VariableInfo.StructInfo): New public property. Returns the
18338 MyStructInfo instance of the variable if it's a struct or null.
18339 (Block.AddThisVariable): New public method. This is called from
18340 Constructor.Emit() for non-static `struct' constructor which do
18341 not have any initializer. It creates a special variable for the
18342 "this" instance variable which will be checked by the flow
18343 analysis code to ensure that all of the struct's fields are
18344 initialized before control returns from the constructor.
18345 (UsageVector): Added support for struct members. If a
18346 variable/parameter is a struct with N members, we reserve a slot
18347 in the usage vector for each member. A struct is considered fully
18348 initialized if either the struct itself (slot 0) or all its
18349 members are initialized.
18351 2002-08-08 Martin Baulig <martin@gnome.org>
18353 * driver.cs (Driver.MainDriver): Only report an error CS5001
18354 if there were no compilation errors.
18356 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
18357 `UnsafeContext' property to determine whether the parent is in
18358 unsafe context rather than checking the parent's ModFlags:
18359 classes nested in an unsafe class are unsafe as well.
18361 2002-08-08 Martin Baulig <martin@gnome.org>
18363 * statement.cs (UsageVector.MergeChildren): Distinguish between
18364 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
18365 we return. Added test17() and test18() to test-154.cs.
18367 2002-08-08 Martin Baulig <martin@gnome.org>
18369 * typemanager.cs (TypeManager.FilterWithClosure): If we have
18370 Family access, make sure the invoking type isn't a subclass of the
18371 queried type (that'd be a CS1540).
18373 * ecore.cs (Expression.MemberLookup): Added overloaded version of
18374 this method which takes an additional `Type invocation_type'.
18376 * expression.cs (BaseAccess.DoResolve): Use the base type as
18377 invocation and query type.
18378 (MemberAccess.DoResolve): If the lookup failed and we're about to
18379 report a CS0122, try a lookup with the ec.ContainerType - if this
18380 succeeds, we must report a CS1540.
18382 2002-08-08 Martin Baulig <martin@gnome.org>
18384 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
18385 (MethodGroupExpr): Implement the IMemberExpr interface.
18387 * expression (MemberAccess.ResolveMemberAccess): No need to have
18388 any special code for MethodGroupExprs anymore, they're now
18391 2002-08-08 Martin Baulig <martin@gnome.org>
18393 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
18394 Family, FamANDAssem and FamORAssem permissions.
18395 (TypeManager.IsSubclassOrNestedChildOf): New public method.
18397 2002-08-08 Martin Baulig <martin@gnome.org>
18399 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
18400 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
18403 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
18405 * driver.cs: implemented /resource option to embed managed resources.
18407 2002-08-07 Martin Baulig <martin@gnome.org>
18409 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
18410 (FieldBase.HasFieldInitializer): New public property.
18411 (FieldBase.GetInitializerExpression): New public method. Resolves and
18412 returns the field initializer and makes sure it is only resolved once.
18413 (TypeContainer.EmitFieldInitializers): Call
18414 FieldBase.GetInitializerExpression to get the initializer, this ensures
18415 that it isn't resolved multiple times.
18417 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
18418 the resolving process (SimpleName/MemberLookup) that we're currently
18419 emitting a field initializer (which must not access any instance members,
18420 this is an error CS0236).
18422 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
18423 argument, if the `IsFieldInitializer' flag is set, we must report and
18424 error CS0236 and not an error CS0120.
18426 2002-08-07 Martin Baulig <martin@gnome.org>
18428 * ecore.cs (IMemberExpr): New public interface.
18429 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
18430 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
18431 if the expression is an IMemberExpr.
18433 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
18434 to be null, implicitly default to `this' if we're non-static in
18435 this case. Simplified the code a lot by using the new IMemberExpr
18436 interface. Also fixed bug #28176 here.
18438 2002-08-06 Martin Baulig <martin@gnome.org>
18440 * cs-parser.jay (SimpleLookup): Removed. We need to create
18441 ParameterReferences during semantic analysis so that we can do a
18442 type-only search when resolving Cast, TypeOf and SizeOf.
18443 (block): Pass the `current_local_parameters' to the Block's
18446 * class.cs (ConstructorInitializer): Added `Parameters parameters'
18447 argument to the constructor.
18448 (ConstructorInitializer.Resolve): Create a temporary implicit
18449 block with the parameters.
18451 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
18452 references here if we aren't doing a type-only search.
18454 * statement.cs (Block): Added constructor which takes a
18455 `Parameters parameters' argument.
18456 (Block.Parameters): New public property.
18458 * support.cs (InternalParameters.Parameters): Renamed `parameters'
18459 to `Parameters' and made it public readonly.
18461 2002-08-06 Martin Baulig <martin@gnome.org>
18463 * ecore.cs (Expression.Warning): Made this public as well.
18465 * report.cs (Report.Debug): Print the contents of collections.
18467 2002-08-06 Martin Baulig <martin@gnome.org>
18469 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
18470 used to tell Resolve() which kinds of expressions it may return.
18471 (Expression.Resolve): Added overloaded version of this method which
18472 takes a `ResolveFlags flags' argument. This can be used to tell
18473 Resolve() which kinds of expressions it may return. Reports a
18475 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
18476 ResolveFlags.SimpleName.
18477 (Expression.Error118): Added overloaded version of this method which
18478 takes a `ResolveFlags flags' argument. It uses the flags to determine
18479 which kinds of expressions are allowed.
18481 * expression.cs (Argument.ResolveMethodGroup): New public method.
18482 Resolves an argument, but allows a MethodGroup to be returned.
18483 This is used when invoking a delegate.
18485 * TODO: Updated a bit.
18487 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18489 Fixed compilation with csc.
18491 * ecore.cs: Expression.Error made public. Is this correct? Should
18492 Warning be made public too?
18494 * expression.cs: use ea.Location instead of ea.loc.
18495 [FIXME: Filed as bug #28607: MCS must report these errors.]
18497 2002-08-06 Martin Baulig <martin@gnome.org>
18499 * ecore.cs (Expression.loc): Moved the location here instead of
18500 duplicating it in all derived classes.
18501 (Expression.Location): New public property.
18502 (Expression.Error, Expression.Warning): Made them non-static and
18503 removed the location argument.
18504 (Expression.Warning): Added overloaded version which takes an
18505 `int level' argument.
18506 (Expression.Error118): Make this non-static and removed the
18507 expression and location arguments.
18508 (TypeExpr): Added location argument to the constructor.
18510 * expression.cs (StaticCallExpr): Added location argument to
18512 (Indirection, PointerArithmetic): Likewise.
18513 (CheckedExpr, UnCheckedExpr): Likewise.
18514 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
18515 (StringPtr): Likewise.
18518 2002-08-05 Martin Baulig <martin@gnome.org>
18520 * expression.cs (BaseAccess.DoResolve): Actually report errors.
18522 * assign.cs (Assign.DoResolve): Check whether the source
18523 expression is a value or variable.
18525 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
18526 while resolving the corresponding blocks.
18528 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
18529 an error, don't silently return null.
18531 * statement.cs (Block.AddVariable): Do the error reporting here
18532 and distinguish between CS0128 and CS0136.
18533 (Block.DoResolve): Report all unused labels (warning CS0164).
18534 (LabeledStatement): Pass the location to the constructor.
18535 (LabeledStatement.HasBeenReferenced): New property.
18536 (LabeledStatement.Resolve): Set it to true here.
18538 * statement.cs (Return.Emit): Return success even after reporting
18539 a type mismatch error (CS0126 or CS0127), this is what csc does and
18540 it avoids confusing the users with any consecutive errors.
18542 2002-08-05 Martin Baulig <martin@gnome.org>
18544 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
18546 * const.cs (Const.LookupConstantValue): Catch circular definitions.
18548 * expression.cs (MemberAccess.DoResolve): Silently return if an
18549 error has already been reported.
18551 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
18552 error has already been reported.
18554 2002-08-05 Martin Baulig <martin@gnome.org>
18556 * statement.cs (UsageVector): Only initialize the `parameters'
18557 vector if we actually have any "out" parameters.
18559 2002-08-05 Martin Baulig <martin@gnome.org>
18561 * expression.cs (Binary.ResolveOperator): When combining delegates,
18562 they must have the same type.
18564 2002-08-05 Martin Baulig <martin@gnome.org>
18566 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
18567 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
18568 work with the ms runtime and we also don't need it: if we're a
18569 PropertyBuilder and not in the `indexer_arguments' hash, then we
18570 are a property and not an indexer.
18572 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
18573 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
18574 since the latter one doesn't work with the ms runtime.
18576 2002-08-03 Martin Baulig <martin@gnome.org>
18578 Fixed bugs #27998 and #22735.
18580 * class.cs (Method.IsOperator): New public field.
18581 (Method.CheckBase): Report CS0111 if there's already a method
18582 with the same parameters in the current class. Report CS0508 when
18583 attempting to change the return type of an inherited method.
18584 (MethodData.Emit): Report CS0179 if a method doesn't have a body
18585 and it's not marked abstract or extern.
18586 (PropertyBase): New abstract base class for Property and Indexer.
18587 (PropertyBase.CheckBase): Moved here from Property and made it work
18589 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
18590 the same so we can reuse it there.
18591 (Property, Indexer): Derive from PropertyBase.
18592 (MethodSignature.inheritable_property_signature_filter): New delegate
18593 to find properties and indexers.
18595 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
18596 argument and improved error reporting.
18598 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
18599 EmptyReadOnlyParameters and made it a property.
18601 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
18602 version of this method which takes a `PropertyInfo indexer'.
18603 (TypeManager.RegisterIndexer): New method.
18605 * class.cs: Added myself as author of this file :-)
18607 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18609 * class.cs: fixed compilation on windoze.
18611 2002-08-03 Martin Baulig <martin@gnome.org>
18613 * interface.cs (Interface.GetInterfaceBases): Check whether all
18614 base interfaces are at least as accessible than the current one.
18616 * class.cs (TypeContainer.GetClassBases): Check whether base types
18617 are at least as accessible than the current type.
18618 (TypeContainer.AsAccessible): Implemented and made non-static.
18619 (MemberBase.CheckParameters): Report errors if the accessibility
18622 * delegate.cs (Delegate.Delegate): The default visibility is
18623 internal for top-level types and private for nested types.
18624 (Delegate.Define): Report errors if the accessibility checks fail.
18626 * enum.cs (Enum.Enum): The default visibility is internal for
18627 top-level types and private for nested types.
18628 (Enum.DefineType): Compute the correct visibility.
18630 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
18631 function which takes a `bool is_toplevel' instead of a TypeContainer.
18633 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
18636 2002-08-02 Martin Baulig <martin@gnome.org>
18638 * expression.cs (LocalVariableReferenc): Added constructor which
18639 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
18640 (LocalVariableReference.IsReadOnly): New property.
18641 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
18642 variable is readonly, use our own readonly flag to do this; you can
18643 use the new constructor to get a writable reference to a read-only
18646 * cs-parser.jay (foreach_statement, using_statement): Get a writable
18647 reference to the local variable.
18649 2002-08-01 Miguel de Icaza <miguel@ximian.com>
18651 * rootcontext.cs (ResolveCore): Also include System.Exception
18653 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
18654 we reach an EmptyStatement.
18656 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
18659 * expression.cs (Binary.ResolveOperator): Check error result in
18662 use brtrue/brfalse directly and avoid compares to null.
18664 2002-08-02 Martin Baulig <martin@gnome.org>
18666 * class.cs (TypeContainer.Define): Define all nested interfaces here.
18667 Fixes bug #28407, added test-155.cs.
18669 2002-08-01 Martin Baulig <martin@gnome.org>
18671 * class.cs (Event.EmitDefaultMethod): Make this work with static
18672 events. Fixes #28311, added verify-3.cs.
18674 2002-08-01 Martin Baulig <martin@gnome.org>
18676 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
18677 `is_disposable' fields.
18678 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
18679 `hm.is_disposable' if we're using the collection pattern.
18680 (Foreach.EmitCollectionForeach): Use the correct type for the
18681 enumerator's local variable, only emit the try/finally block if
18682 necessary (fixes #27713).
18684 2002-08-01 Martin Baulig <martin@gnome.org>
18686 * ecore.cs (Expression.report118): Renamed to Error118 and made
18689 * statement.cs (Throw.Resolve): Check whether the expression is of
18690 the correct type (CS0118) and whether the type derives from
18691 System.Exception (CS0155).
18692 (Catch.Resolve): New method. Do the type lookup here and check
18693 whether it derives from System.Exception (CS0155).
18694 (Catch.CatchType, Catch.IsGeneral): New public properties.
18696 * typemanager.cs (TypeManager.exception_type): Added.
18698 2002-07-31 Miguel de Icaza <miguel@ximian.com>
18700 * driver.cs: Updated About function.
18702 2002-07-31 Martin Baulig <martin@gnome.org>
18704 Implemented Control Flow Analysis.
18706 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
18707 (EmitContext.CurrentBranching): Added.
18708 (EmitContext.StartFlowBranching): Added.
18709 (EmitContext.EndFlowBranching): Added.
18710 (EmitContext.KillFlowBranching): Added.
18711 (EmitContext.IsVariableAssigned): Added.
18712 (EmitContext.SetVariableAssigned): Added.
18713 (EmitContext.IsParameterAssigned): Added.
18714 (EmitContext.SetParameterAssigned): Added.
18715 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
18716 Added control flow analysis stuff here.
18718 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
18719 resolve the expression as lvalue.
18720 (LocalVariableReference.DoResolve): Check whether the variable has
18721 already been assigned.
18722 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
18723 the parameter as assigned here.
18724 (ParameterReference.DoResolve): Check whether the parameter has already
18726 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
18727 expression as lvalue.
18729 * statement.cs (FlowBranching): New class for the flow analysis code.
18730 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
18731 (LabeledStatement.IsDefined): New public property.
18732 (LabeledStatement.AddUsageVector): New public method to tell flow
18733 analyis that the label may be reached via a forward jump.
18734 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
18736 (VariableInfo.Number): New public field. This is used by flow analysis
18737 to number all locals of a block.
18738 (Block.CountVariables): New public property. This is the number of
18739 local variables in this block (including the locals from all parent
18741 (Block.EmitMeta): Number all the variables.
18743 * statement.cs: Added flow analysis support to all classes.
18745 2002-07-31 Martin Baulig <martin@gnome.org>
18747 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
18748 To get debugging messages, compile mcs with /define:MCS_DEBUG and
18749 then use this argument.
18751 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
18753 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
18754 use this to specify /define options.
18756 2002-07-29 Martin Baulig <martin@gnome.org>
18758 * statement.cs (Fixed): Moved all code that does variable lookups
18759 and resolvings from Emit to Resolve.
18761 * statement.cs (For): Moved all code that does variable lookups
18762 and resolvings from Emit to Resolve.
18764 * statement.cs (Using): Moved all code that does variable lookups
18765 and resolvings from Emit to Resolve.
18767 2002-07-29 Martin Baulig <martin@gnome.org>
18769 * attribute.cs (Attribute.Resolve): Explicitly catch a
18770 System.NullReferenceException when creating the
18771 CustromAttributeBuilder and report a different warning message.
18773 2002-07-29 Martin Baulig <martin@gnome.org>
18775 * support.cs (ParameterData.ParameterName): Added method to
18776 get the name of a parameter.
18778 * typemanager.cs (TypeManager.IsValueType): New public method.
18780 2002-07-29 Martin Baulig <martin@gnome.org>
18782 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
18783 is a flag which specifies that it's either ref or out.
18784 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
18785 the out parameter to `out Parameter.Modifier mod', also set the
18786 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
18788 * support.cs (InternalParameters.ParameterModifier): Distinguish
18789 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18790 Parameter.Modifier.ISBYREF flag if it's either ref or out.
18792 * expression.cs (Argument.GetParameterModifier): Distinguish
18793 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18794 Parameter.Modifier.ISBYREF flag if it's either ref or out.
18796 2002-07-29 Martin Baulig <martin@gnome.org>
18798 * expression.cs (ParameterReference.ParameterReference): Added
18799 `Location loc' argument to the constructor.
18801 * cs-parser.jay: Pass location to ParameterReference.
18803 2002-07-28 Miguel de Icaza <miguel@ximian.com>
18805 * statement.cs (Try): Initialize the location.
18807 * cs-parser.jay: pass location to Try.
18809 * expression.cs (Unary.Reduce): Change the prototype to return
18810 whether a constant fold could be performed or not. The result is
18811 returned in an out parameters. In the case of Indirection and
18812 AddressOf, we want to perform the full tests.
18814 2002-07-26 Miguel de Icaza <miguel@ximian.com>
18816 * statement.cs (Statement.Emit): Flag dead code.
18818 2002-07-27 Andrew Birkett <andy@nobugs.org>
18820 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
18822 2002-07-27 Martin Baulig <martin@gnome.org>
18824 * class.cs (MethodData.Define): Put back call to
18825 TypeManager.AddMethod(), accidentally commented this out.
18827 * report.cs (Debug): New public method to print debugging information,
18828 this is `[Conditional ("DEBUG")]'.
18830 2002-07-26 Martin Baulig <martin@gnome.org>
18832 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
18833 (switch_statement): Push the current_block to the switch_stack and
18834 pop it again when we're done with the switch.
18835 (switch_section): The new block is a child of the current_block.
18836 Fixes bug #24007, added test-152.cs.
18838 2002-07-27 Martin Baulig <martin@gnome.org>
18840 * expression.cs (Invocation.EmitArguments): When calling a varargs
18841 function with only its fixed arguments, we need to pass an empty
18844 2002-07-27 Martin Baulig <martin@gnome.org>
18846 Mono 0.13 has been released.
18848 2002-07-25 Miguel de Icaza <miguel@ximian.com>
18850 * driver.cs: Rename --resource to --linkres, because that is what
18851 we do currently, we dont support --resource yet.
18853 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
18855 2002-07-25 Martin Baulig <martin@gnome.org>
18857 * class.cs (MethodData): New public class. This is a `method builder'
18858 class for a method or one accessor of a Property/Indexer/Event.
18859 (MethodData.GetMethodFlags): Moved here from MemberBase.
18860 (MethodData.ApplyAttributes): Likewise.
18861 (MethodData.ApplyObsoleteAttribute): Likewise.
18862 (MethodData.ApplyConditionalAttribute): Likewise.
18863 (MethodData.ApplyDllImportAttribute): Likewise.
18864 (MethodData.CheckAbstractAndExternal): Likewise.
18865 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
18866 (MethodData.Emit): Formerly known as Method.Emit().
18867 (MemberBase): Moved everything which was specific to a single
18868 accessor/method to MethodData.
18869 (Method): Create a new MethodData and call Define() and Emit() on it.
18870 (Property, Indexer, Event): Create a new MethodData objects for each
18871 accessor and call Define() and Emit() on them.
18873 2002-07-25 Martin Baulig <martin@gnome.org>
18875 Made MethodCore derive from MemberBase to reuse the code from there.
18876 MemberBase now also checks for attributes.
18878 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
18879 (MemberBase.GetMethodFlags): Moved here from class Method and marked
18881 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
18882 `CallingConventions cc' and `Attributes opt_attrs' arguments.
18883 (MemberBase.ApplyAttributes): New virtual method; applies the
18884 attributes to a method or accessor.
18885 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
18886 (MemberBase.ApplyConditionalAttribute): Likewise.
18887 (MemberBase.ApplyDllImportAttribute): Likewise.
18888 (MemberBase.CheckAbstractAndExternal): Likewise.
18889 (MethodCore.ParameterTypes): This is now a property instead of a
18890 method, it's initialized from DoDefineParameters().
18891 (MethodCore.ParameterInfo): Removed the set accessor.
18892 (MethodCore.DoDefineParameters): New protected virtual method to
18893 initialize ParameterTypes and ParameterInfo.
18894 (Method.GetReturnType): We can now simply return the MemberType.
18895 (Method.GetMethodFlags): Override the MemberBase version and add
18896 the conditional flags.
18897 (Method.CheckBase): Moved some code from Define() here, call
18898 DoDefineParameters() here.
18899 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
18900 here to avoid some larger code duplication.
18901 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
18902 ensure that abstract and external accessors don't declare a body.
18904 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
18905 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
18906 lookup in the attribute's parent classes, so we need to abort as soon
18907 as we found the first match.
18908 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
18909 the attribute has no arguments.
18911 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
18914 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18916 * cs-parser.jay: reverted previous patch.
18918 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18920 * cs-parser.jay: fixed bug #22119.
18922 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18924 * attribute.cs: fixed compilation. The error was:
18925 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
18926 be assigned to before control leaves the current method."
18927 [FIXME: Filed as bug #28186: MCS must report this error.]
18929 2002-07-25 Martin Baulig <martin@gnome.org>
18931 * attribute.cs (Attribute.Conditional_GetConditionName): New static
18932 method to pull the condition name ouf of a Conditional attribute.
18933 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
18934 the obsolete message and error flag out of an Obsolete attribute.
18936 * class.cs (Method.GetMethodFlags): New public method to get the
18937 TypeManager.MethodFlags for this method.
18938 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
18940 (Method.Define): Get and apply the Obsolete and Conditional attributes;
18941 if we're overriding a virtual function, set the new private variable
18942 `parent_method'; call the new TypeManager.AddMethod().
18944 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
18945 the MethodBuilder and the Method in a PtrHashtable.
18946 (TypeManager.builder_to_method): Added for this purpose.
18947 (TypeManager.MethodFlags): Added IsObsoleteError.
18948 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
18949 Obsolete and Conditional arguments in MethodBuilders. If we discover
18950 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
18951 the message from the attribute.
18953 2002-07-24 Martin Baulig <martin@gnome.org>
18955 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
18956 preprocessor directives, ensure that the argument to #define/#undef is
18957 exactly one identifier and that it's actually an identifier.
18959 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
18962 2002-07-24 Martin Baulig <martin@gnome.org>
18964 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
18965 initialize it to TypeManager.object_type in the constructor.
18966 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
18967 of the `hm.get_current' method if we're using the collection pattern.
18968 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
18969 for the explicit conversion to make it work when we're using the collection
18970 pattern and the `Current' property has a different return type than `object'.
18973 2002-07-24 Martin Baulig <martin@gnome.org>
18975 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
18976 does not match, but don't report any errors. This method is called in
18977 order for all methods in a MethodGroupExpr until a matching method is
18978 found, so we don't want to bail out if the first method doesn't match.
18979 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
18980 matches, report the 123. Fixes #28070.
18982 2002-07-24 Martin Baulig <martin@gnome.org>
18984 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
18985 TypeManager.TypeToCoreType() to the top of the method so the
18986 following equality checks will work. Fixes #28107.
18988 2002-07-24 Martin Baulig <martin@gnome.org>
18990 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
18991 operand is of type uint, and the other operand is of type sbyte,
18992 short or int, the operands are converted to type long." -
18993 Actually do what this comment already told us. Fixes bug #28106,
18996 2002-07-24 Martin Baulig <martin@gnome.org>
18998 * class.cs (MethodBase): New abstract class. This is now a base
18999 class for Property, Indexer and Event to avoid some code duplication
19000 in their Define() and DefineMethods() methods.
19001 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
19002 generic methods for Define() and DefineMethods().
19003 (FieldBase): Derive from MemberBase, not MemberCore.
19004 (Property): Derive from MemberBase, not MemberCore.
19005 (Property.DefineMethod): Moved all the code from this method to the
19006 new MethodBase.DefineAccessor(), just call it with appropriate
19008 (Property.Define): Call the new Property.DoDefine(), this does some
19009 sanity checks and we don't need to duplicate the code everywhere.
19010 (Event): Derive from MemberBase, not MemberCore.
19011 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
19012 accessors, this will also make them work with interface events.
19013 (Indexer): Derive from MemberBase, not MemberCore.
19014 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
19015 (Indexer.Define): Use the new MethodBase functions.
19017 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
19018 argument to the constructor.
19019 (Interface.FindMembers): Added support for interface events.
19020 (Interface.PopluateEvent): Implemented.
19022 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
19024 2002-07-22 Miguel de Icaza <miguel@ximian.com>
19026 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
19027 but this is required to check for a method name being the same as
19028 the containing class.
19032 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19034 * interface.cs: initialize variable.
19036 2002-07-23 Martin Baulig <martin@gnome.org>
19038 Implemented the IndexerName attribute in interfaces.
19040 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
19041 name if this is an explicit interface implementation.
19042 (Indexer.InterfaceIndexerName): New public variable. If we're
19043 implementing an interface indexer, this is the IndexerName in that
19044 interface. Otherwise, it's the IndexerName.
19045 (Indexer.DefineMethod): If we're implementing interface indexer,
19046 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
19047 and Pending.ImplementIndexer methods.
19048 (Indexer.Define): Also define the PropertyBuilder if we're
19049 implementing an interface indexer and this is neither an explicit
19050 interface implementation nor do the IndexerName match the one in
19053 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
19054 If a method is defined here, then we always need to create a proxy
19055 for it. This is used when implementing interface indexers.
19056 (Pending.IsInterfaceIndexer): New public method.
19057 (Pending.ImplementIndexer): New public method.
19058 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
19059 This is used when implementing interface indexers to define a proxy
19061 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
19062 define a proxy if necessary.
19064 * interface.cs (Interface.IndexerName): New public variable.
19065 (Interface.PopulateIndexer): Set the IndexerName.
19066 (Interface.DefineIndexers): New private method. Populate all the
19067 indexers and make sure their IndexerNames match.
19069 * typemanager.cs (IndexerPropertyName): Added support for interface
19072 2002-07-22 Martin Baulig <martin@gnome.org>
19074 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
19075 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
19076 ret if HasReturnLabel.
19077 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
19080 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
19081 and set the ec.LoopBeginTryCatchLevel.
19082 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
19083 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
19084 the current ec.TryCatchLevel, the branch goes out of an exception
19085 block. In this case, we need to use Leave and not Br.
19087 2002-07-22 Martin Baulig <martin@gnome.org>
19089 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
19090 block unless the block does not always return or it is contained in
19091 another try { ... } catch { ... } block. Fixes bug #26506.
19092 Added verify-1.cs to the test suite.
19094 2002-07-22 Martin Baulig <martin@gnome.org>
19096 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
19097 then we do not always return. Fixes bug #24985.
19099 2002-07-22 Martin Baulig <martin@gnome.org>
19101 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
19102 lookup on a per-class level; ie. walk up the class hierarchy until we
19103 found at least one applicable method, then choose the best among them.
19104 Fixes bug #24463 and test-29.cs.
19106 2002-07-22 Martin Baulig <martin@gnome.org>
19108 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
19109 return types of the methods. The return type is not part of the
19110 signature and we must not check it to make the `new' modifier work.
19111 Fixes bug #27999, also added test-147.cs.
19112 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
19114 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
19115 on the method's return type.
19117 2002-07-21 Martin Baulig <martin@gnome.org>
19119 * assign.cs: Make this work if the rightmost source is a constant and
19120 we need to do an implicit type conversion. Also adding a few more tests
19121 to test-38.cs which should have caught this.
19123 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
19124 target in the makefile for this. The makefile.gnu is primarily intended
19125 for end-users who don't want to debug the compiler.
19127 2002-07-21 Martin Baulig <martin@gnome.org>
19129 * assign.cs: Improved the Assign class so it can now handle embedded
19130 assignments (X = Y = Z = something). As a side-effect this'll now also
19131 consume less local variables. test-38.cs now passes with MCS, added
19132 a few new test cases to that test.
19134 2002-07-20 Martin Baulig <martin@gnome.org>
19136 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
19137 instructions. Fixes bug #27977, also added test-146.cs.
19139 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19141 * cs-tokenizer.cs: fixed getHex ().
19143 2002-07-19 Martin Baulig <martin@gnome.org>
19145 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
19146 not Type.GetType() to lookup the array type. This is needed when
19147 we're constructing an array of a user-defined type.
19148 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
19149 single-dimensional arrays, but also for single-dimensial arrays of
19152 2002-07-19 Martin Baulig <martin@gnome.org>
19154 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
19155 this function is called, it's not allowed to share LocalBuilders
19156 among ILGenerators.
19158 2002-07-19 Martin Baulig <martin@gnome.org>
19160 * expression.cs (Argument.Resolve): Report an error 118 when trying
19161 to pass a type as argument.
19163 2002-07-18 Martin Baulig <martin@gnome.org>
19165 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
19166 Conv_R_Un for the signed `long' type.
19168 2002-07-15 Miguel de Icaza <miguel@ximian.com>
19170 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
19171 `expr' for the temporary result, as that will fail if we do
19172 multiple resolves on the same expression.
19174 2002-07-05 Miguel de Icaza <miguel@ximian.com>
19176 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
19177 ec.TypeContainer for looking up aliases.
19179 * class.cs (TypeContainer): Remove LookupAlias from here.
19181 * decl.cs (DeclSpace); Move here.
19183 2002-07-01 Miguel de Icaza <miguel@ximian.com>
19185 * class.cs (FindMembers): Only call filter if the constructor
19186 bulider is not null.
19188 Also handle delegates in `NestedTypes' now. Now we will perform
19189 type lookups using the standard resolution process. This also
19192 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
19193 This uses Expressions (the limited kind that can be parsed by the
19194 tree) instead of strings.
19196 * expression.cs (ComposedCast.ToString): Implement, used to flag
19197 errors since now we have to render expressions.
19199 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
19202 * ecore.cs (SimpleName.ToString): ditto.
19204 * cs-parser.jay: Instead of using strings to assemble types, use
19205 Expressions to assemble the type (using SimpleName, ComposedCast,
19206 MemberAccess). This should fix the type lookups in declarations,
19207 because we were using a different code path for this.
19209 * statement.cs (Block.Resolve): Continue processing statements
19210 even when there is an error.
19212 2002-07-17 Miguel de Icaza <miguel@ximian.com>
19214 * class.cs (Event.Define): Also remove the `remove' method from
19215 the list of pending items.
19217 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
19218 generate more compact code.
19220 2002-07-17 Martin Baulig <martin@gnome.org>
19222 * const.cs (Const.LookupConstantValue): Add support for constant
19223 `unchecked' and `checked' expressions.
19224 Also adding test case test-140.cs for this.
19226 2002-07-17 Martin Baulig <martin@gnome.org>
19228 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
19229 check whether mi.ReturnType implements the IEnumerator interface; the
19230 `==' and the IsAssignableFrom() will fail in this situation.
19232 2002-07-16 Ravi Pratap <ravi@ximian.com>
19234 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
19237 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19239 * expression.cs: fixed bug #27811.
19241 2002-07-14 Miguel de Icaza <miguel@ximian.com>
19243 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
19244 Molaro: when we are a ref, the value already contains a pointer
19245 value, do not take the address of it.
19247 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
19248 * removed mb-parser.jay and mb-tokenizer.cs
19250 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19252 * expression.cs: check against the building corlib void type.
19254 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
19256 * ecore.cs: fix for valuetype static readonly fields: when
19257 initializing them, we need their address, not the address of a copy.
19259 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
19261 * typemanager.cs: register also enum_type in corlib.
19263 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19265 * class.cs: allow calling this (but not base) initializers in structs.
19267 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
19269 * ecore.cs: make sure we compare against the building base types
19272 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
19274 * typemanager.cs: fix TypeToCoreType() to handle void and object
19275 (corlib gets no more typerefs after this change).
19277 2002-07-12 Miguel de Icaza <miguel@ximian.com>
19279 * expression.cs (ArrayCreation.EmitArrayArguments): use
19280 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
19282 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
19283 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
19284 array indexes, the runtime actually forbids them.
19286 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
19287 for array arguments here.
19289 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
19290 instead of the default for ValueTypes.
19292 (New.DoEmit): Use IsValueType instead of
19293 IsSubclassOf (value_type)
19294 (New.DoResolve): ditto.
19295 (Invocation.EmitCall): ditto.
19297 * assign.cs (Assign): ditto.
19299 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
19300 Statements *are* currently doing part of their resolution during
19303 Expressions do always resolve during resolve, but statements are
19304 only required to propagate resolution to their children.
19306 2002-07-11 Miguel de Icaza <miguel@ximian.com>
19308 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
19310 (LoadAssembly): Do not add the dll if it is already specified
19312 (MainDriver): Add the System directory to the link path at the end,
19313 after all the other -L arguments.
19315 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
19316 wrong opcode for loading bytes and bools (ldelem.i1 instead of
19317 ldelem.u1) and using the opposite for sbytes.
19319 This fixes Digger, and we can finally run it.
19321 * driver.cs (UnixParseOption): Move the option parsing here.
19322 (CSCParseOption): Implement CSC-like parsing of options.
19324 We now support both modes of operation, the old Unix way, and the
19325 new CSC-like way. This should help those who wanted to make cross
19326 platform makefiles.
19328 The only thing broken is that /r:, /reference: and /lib: are not
19329 implemented, because I want to make those have the same semantics
19330 as the CSC compiler has, and kill once and for all the confussion
19331 around this. Will be doing this tomorrow.
19333 * statement.cs (Unsafe.Resolve): The state is checked during
19334 resolve, not emit, so we have to set the flags for IsUnsfe here.
19336 2002-07-10 Miguel de Icaza <miguel@ximian.com>
19338 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
19339 not catch the Error_ObjectRefRequired in SimpleName (as it is
19340 possible to have a class/instance variable name that later gets
19341 deambiguated), we have to check this here.
19343 2002-07-10 Ravi Pratap <ravi@ximian.com>
19345 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
19346 make static and put into Expression.
19348 (Event.Define): Register the private field of the event with the
19349 TypeManager so that GetFieldFromEvent can get at it.
19351 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
19352 keep track of the private field associated with an event which
19355 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
19358 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
19360 2002-07-10 Miguel de Icaza <miguel@ximian.com>
19362 * expression.cs (Binary.EmitBranchable): this routine emits the
19363 Binary expression in a branchable context. This basically means:
19364 we need to branch somewhere, not just get the value on the stack.
19366 This works together with Statement.EmitBoolExpression.
19368 * statement.cs (Statement.EmitBoolExpression): Use
19371 2002-07-09 Miguel de Icaza <miguel@ximian.com>
19373 * statement.cs (For): Reduce the number of jumps in loops.
19375 (For): Implement loop inversion for the For statement.
19377 (Break): We can be breaking out of a Try/Catch controlled section
19378 (foreach might have an implicit try/catch clause), so we need to
19379 use Leave instead of Br.
19381 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
19382 now). If the instace expression supports IMemoryLocation, we use
19383 the AddressOf method from the IMemoryLocation to extract the
19384 address instead of emitting the instance.
19386 This showed up with `This', as we were emitting the instance
19387 always (Emit) instead of the Address of This. Particularly
19388 interesting when This is a value type, as we dont want the Emit
19389 effect (which was to load the object).
19391 2002-07-08 Miguel de Icaza <miguel@ximian.com>
19393 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
19395 * statement.cs (Checked): Set the CheckedState during the resolve
19396 process too, as the ConvCast operations track the checked state on
19397 the resolve process, and not emit.
19399 * cs-parser.jay (namespace_member_declaration): Flag that we have
19400 found a declaration when we do. This is used to flag error 1529
19402 * driver.cs: Report ok when we display the help only.
19404 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
19406 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
19408 2002-07-04 Miguel de Icaza <miguel@ximian.com>
19410 * cs-tokenizer.cs (define): We also have to track locally the
19411 defines. AllDefines is just used for the Conditional Attribute,
19412 but we also need the local defines for the current source code.
19414 2002-07-03 Miguel de Icaza <miguel@ximian.com>
19416 * statement.cs (While, For, Do): These loops can exit through a
19417 Break statement, use this information to tell whether the
19418 statement is the last piece of code.
19420 (Break): Flag that we break.
19422 * codegen.cs (EmitContexts): New `Breaks' state variable.
19424 2002-07-03 Martin Baulig <martin@gnome.org>
19426 * class.cs (TypeContainer.MethodModifiersValid): Allow override
19427 modifiers in method declarations in structs. Otherwise, you won't
19428 be able to override things like Object.Equals().
19430 2002-07-02 Miguel de Icaza <miguel@ximian.com>
19432 * class.cs (Method, Property, Indexer): Do not allow the public
19433 modifier to be used in explicit interface implementations.
19435 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
19436 override modifiers in method declarations in structs
19438 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
19440 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
19441 integer or real overflow, report an error
19443 2002-07-02 Martin Baulig <martin@gnome.org>
19445 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
19446 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
19447 to tell the runtime about our newly created System.Object and
19448 System.ValueType types.
19450 2002-07-02 Miguel de Icaza <miguel@ximian.com>
19452 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
19453 struct instead of Ldarg/Starg.
19455 2002-07-02 Martin Baulig <martin@gnome.org>
19457 * expression.cs (Indirection.Indirection): Call
19458 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
19460 2002-07-02 Martin Baulig <martin@gnome.org>
19462 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
19463 ValueType, call TypeManager.TypeToCoreType() on it.
19464 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
19465 the OpCodes.Newarr argument.
19467 2002-07-02 Martin Baulig <martin@gnome.org>
19469 * expression.cs (Invocation.EmitCall): When compiling corlib,
19470 replace all calls to the system's System.Array type to calls to
19471 the newly created one.
19473 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
19474 System.Array methods.
19475 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
19476 from the system's System.Array type which must be replaced.
19478 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
19480 * typemanager.cs: load unverifiable_code_ctor so we can build
19481 corlib using the correct type. Avoid using GetTypeCode() with
19483 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
19484 TypeManager.object_type to allow building corlib.
19486 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
19488 * ecore.cs: handle System.Enum separately in LoadFromPtr().
19490 2002-07-01 Martin Baulig <martin@gnome.org>
19492 * class.cs: Make the last change actually work, we need to check
19493 whether `ifaces != null' to avoid a crash.
19495 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19497 * class.cs: when we build structs without fields that implement
19498 interfaces, we need to add the interfaces separately, since there is
19499 no API to both set the size and add the interfaces at type creation
19502 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19504 * expression.cs: the dimension arguments to the array constructors
19505 need to be converted if they are a long.
19507 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
19509 * class.cs: don't emit ldarg.0 if there is no parent constructor
19510 (fixes showstopper for corlib).
19512 2002-06-29 Martin Baulig <martin@gnome.org>
19514 MCS now compiles corlib on GNU/Linux :-)
19516 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
19517 ie. check for MethodImplOptions.InternalCall.
19519 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
19520 and TypeManager.attribute_type are null, so we must explicitly check
19521 whether parent is not null to find out whether it's an attribute type.
19522 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
19523 and SetBuilder, not only if the property is neither abstract nor external.
19524 This is necessary to set the MethodImplOptions on the accessor methods.
19525 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
19526 SetBuilder, see Property.Emit().
19528 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
19529 populate "System.Object", "System.ValueType" and "System.Attribute" since
19530 they've already been populated from BootCorlib_PopulateCoreTypes().
19532 2002-06-29 Martin Baulig <martin@gnome.org>
19534 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
19535 is the NullLiteral, we also need to make sure that target_type is not
19538 2002-06-29 Martin Baulig <martin@gnome.org>
19540 * rootcontext.cs (RootContext.ResolveCore): We must initialize
19541 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
19542 before calling BootstrapCorlib_ResolveDelegate ().
19544 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19546 * statement.cs: fixed build-breaker. All tests passed ok.
19548 2002-06-27 Martin Baulig <martin@gnome.org>
19550 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
19551 for System.Decimal when compiling corlib.
19553 2002-06-27 Martin Baulig <martin@gnome.org>
19555 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
19556 switch blocks which contain nothing but a default clause.
19558 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
19560 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
19562 2002-06-27 Martin Baulig <martin@gnome.org>
19564 * ecore.cs (PropertyExpr.PropertyExpr): Call
19565 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
19567 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
19568 is already a TypeBuilder.
19570 2002-06-27 Martin Baulig <martin@gnome.org>
19572 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
19573 `target_type == TypeManager.array_type', not IsAssignableFrom() in
19574 the "from an array-type to System.Array" case. This makes it work
19575 when compiling corlib.
19577 2002-06-27 Martin Baulig <martin@gnome.org>
19579 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
19580 non-static PropertyExpr, set its InstanceExpression. This makes
19581 the `ICollection.Count' property work in System/Array.cs.
19583 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
19585 * driver.cs: Made error handling more consistent. Errors now
19586 tracked by Report class, so many methods which used to return int
19587 now return void. Main() now prints success/failure and
19588 errors/warnings message.
19590 Renamed '--probe' compiler argument to '--expect-error'. Removed
19591 the magic number return values (123 and 124). Now, if the
19592 expected error occurs, the compiler exits with success (exit value
19593 0). If the compilation completes without seeing that particular
19594 error, the compiler exits with failure (exit value 1). The
19595 makefile in mcs/errors has been changed to handle the new behaviour.
19597 * report.cs: Made 'expected error' number a property and renamed
19598 it from 'Probe' to 'ExpectedError'.
19600 * genericparser.cs: Removed error handling support, since it is
19601 now all done by Report class.
19603 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
19604 class, so parse() no longer returns an int.
19606 * namespace.cs: Use Report.Error instead of GenericParser.error
19608 2002-06-22 Miguel de Icaza <miguel@ximian.com>
19610 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
19611 TypeContainer.AddOperator): At the front of the list put the
19612 explicit implementations, so they get resolved/defined first.
19614 2002-06-21 Miguel de Icaza <miguel@ximian.com>
19616 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
19617 interface type is implemented by this TypeContainer. Used during
19618 explicit interface implementation.
19620 (Property.Define, Indexer.Define, Method.Define): Validate that
19621 the given interface in the explicit implementation is one of the
19622 base classes for the containing type.
19624 Also if we are explicitly implementing an interface, but there is
19625 no match in the pending implementation table, report an error.
19627 (Property.Define): Only define the property if we are
19628 not explicitly implementing a property from an interface. Use the
19629 correct name also for those properties (the same CSC uses,
19630 although that is really not needed).
19632 (Property.Emit): Do not emit attributes for explicitly implemented
19633 properties, as there is no TypeBuilder.
19635 (Indexer.Emit): ditto.
19637 Hiding then means that we do not really *implement* a pending
19638 implementation, which makes code fail.
19640 2002-06-22 Martin Baulig <martin@gnome.org>
19642 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
19643 the return value of Object.GetType(). [FIXME: we need to do this whenever
19644 we get a type back from the reflection library].
19646 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
19648 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
19650 2002-06-20 Miguel de Icaza <miguel@ximian.com>
19652 * attribute.cs: Return null if we can not look up the type.
19654 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
19655 the interface types found.
19657 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
19658 interface types found.
19660 * typemanager.cs (GetInterfaces): Make this routine returns alll
19661 the interfaces and work around the lame differences between
19662 System.Type and System.Reflection.Emit.TypeBuilder in the results
19663 result for GetInterfaces.
19665 (ExpandInterfaces): Given an array of interface types, expand and
19666 eliminate repeated ocurrences of an interface. This expands in
19667 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
19670 2002-06-21 Martin Baulig <martin@gnome.org>
19672 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
19675 2002-06-21 Martin Baulig <martin@gnome.org>
19677 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
19678 and called with one of the core types, return the corresponding typebuilder for
19681 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
19684 2002-06-21 Martin Baulig <martin@gnome.org>
19686 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
19687 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
19688 (Expression.ConvertReferenceExplicit): Likewise.
19690 * expression.cs (ElementAccess.DoResolve): Likewise.
19691 (ElementAccess.DoResolveLValue): Likewise.
19693 2002-06-10 Martin Baulig <martin@gnome.org>
19695 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
19696 add the "value" parameter to the parameter list.
19698 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
19701 2002-06-19 Miguel de Icaza <miguel@ximian.com>
19703 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
19704 the argument to an int, uint, long or ulong, per the spec. Also
19705 catch negative constants in array creation.
19707 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
19709 * class.cs: do not allow the same interface to appear twice in
19710 the definition list.
19712 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
19714 * ecore.cs: don't use ldlen with System.Array.
19716 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
19718 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
19720 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
19722 * modifiers.cs: produce correct field attributes for protected
19723 internal. Easy fix so miguel can work on ther harder stuff:-)
19725 2002-06-18 Miguel de Icaza <miguel@ximian.com>
19727 * pending.cs: New file. Move the code from class.cs here.
19728 Support clearning the pending flag for all methods (when not doing
19729 explicit interface implementation).
19731 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
19733 * rootcontext.cs: added a couple more types needed to bootstrap.
19735 2002-06-17 Miguel de Icaza <miguel@ximian.com>
19737 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
19738 constructor in the type, instead of any constructor in the type
19739 hierarchy. Thanks to Paolo for finding this bug (it showed up as
19740 a bug in the Mono runtime when applying the params attribute).
19742 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
19743 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
19745 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
19747 * expression.cs (Unary.ResolveOperator): Use TypeManager
19748 to resolve the type.
19750 2002-06-13 Ravi Pratap <ravi@ximian.com>
19752 * cs-parser.jay (enum_member_declaration): Pass in the attributes
19755 * enum.cs (AddEnumMember): Add support to store the attributes associated
19756 with each member too.
19758 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
19759 field builders too - this takes care of the enum member case.
19761 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
19763 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
19764 address-of operator on both value types and pointers.
19766 2002-06-10 Martin Baulig <martin@gnome.org>
19768 * interface.cs (Interface.PopulateIndexer): Add the indexer's
19769 PropertyBuilder to the `property_builders' list.
19771 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
19772 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
19773 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
19774 find any indexers which are inherited from an interface.
19776 2002-06-09 Martin Baulig <martin@gnome.org>
19778 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
19779 the same type as the constant if necessary. There's also a test-130.cs
19782 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
19784 * typemanager.cs (TypeManager.ChangeType): Previously known as
19785 Enum.ChangeEnumType().
19787 2002-06-09 Martin Baulig <martin@gnome.org>
19789 * expression.cs (Cast.TryReduce): Added support for consts.
19791 2002-06-08 Ravi Pratap <ravi@ximian.com>
19793 * class.cs (Accessor): Hold attributes information so we can pass
19796 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
19797 Modify to pass in attributes attached to the methods.
19799 (add_accessor_declaration, remove_accessor_declaration): Ditto.
19801 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
19802 to handle the Accessor kind :-)
19804 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
19806 2002-06-08 Martin Baulig <martin@gnome.org>
19808 * expression.cs (Unary.TryReduceNegative): Added support for
19811 2002-06-08 Martin Baulig <martin@gnome.org>
19813 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
19814 name can't be found in the `defined_names' - the caller will do a
19815 MemberLookup in this case and thus find methods in System.Enum
19816 such as Enum.IsDefined().
19818 2002-06-08 Martin Baulig <martin@gnome.org>
19820 * enum.cs (Enum.ChangeEnumType): This is a custom version of
19821 Convert.ChangeType() which works with TypeBuilder created types.
19822 (Enum.LookupEnumValue, Enum.Define): Use it here.
19824 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
19825 `TypeBuilder.BaseType != null' check.
19826 (TypeContainer.FindMembers): Only lookup parent members if we
19827 actually have a parent.
19828 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
19829 (ConstructorInitializer.Resolve): Likewise.
19831 * interface.cs (Interface.FindMembers): Added
19832 `TypeBuilder.BaseType != null' check.
19834 * rootcontext.cs (RootContext.ResolveCore): Added
19835 "System.Runtime.CompilerServices.IndexerNameAttribute" to
19836 classes_second_stage.
19838 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
19839 debug_type and trace_type when compiling with --nostdlib.
19841 2002-06-07 Martin Baulig <martin@gnome.org>
19843 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
19844 (AddField): Set it to true when adding a non-static field.
19845 (DefineType): Use `have_nonstatic_fields' to find out whether we
19846 have non-static fields, not `Fields != null'.
19848 2002-06-02 Miguel de Icaza <miguel@ximian.com>
19850 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
19851 dereferencing a null on the static-field code path)
19853 2002-05-30 Martin Baulig <martin@gnome.org>
19855 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
19856 to take command line arguments. Use reflection to call the new
19857 custom `Initialize' function on the symbol writer and pass it the
19858 command line arguments.
19860 * driver.cs (--debug-args): New command line argument to pass command
19861 line arguments to the symbol writer.
19863 2002-05-28 Miguel de Icaza <miguel@ximian.com>
19865 * assign.cs (DoResolve): Forgot to do the implicit conversion to
19866 the target type for indexers and properties. Thanks to Joe for
19869 2002-05-27 Miguel de Icaza <miguel@ximian.com>
19871 * typemanager.cs (MethodFlags): returns the method flags
19872 (Obsolete/ShouldIgnore) that control warning emission and whether
19873 the invocation should be made, or ignored.
19875 * expression.cs (Invocation.Emit): Remove previous hack, we should
19876 not do this on matching a base type, we should do this based on an attribute
19878 Only emit calls to System.Diagnostics.Debug and
19879 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
19880 on the command line.
19882 * rootcontext.cs: Global settings for tracing and debugging.
19884 * cs-tokenizer.cs (define): New utility function to track
19885 defines. Set the global settings for TRACE and DEBUG if found.
19887 2002-05-25 Ravi Pratap <ravi@ximian.com>
19889 * interface.cs (Populate*): Pass in the TypeContainer as well as
19890 the DeclSpace as parameters so that we can create EmitContexts and
19891 then use that to apply attributes etc.
19893 (PopulateMethod, PopulateEvent, PopulateProperty)
19894 (PopulateIndexer): Apply attributes everywhere.
19896 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
19899 (ApplyAttributes): Update accordingly.
19901 We now apply interface attributes for all members too.
19903 2002-05-26 Miguel de Icaza <miguel@ximian.com>
19905 * class.cs (Indexer.Define); Correctly check if we are explicit
19906 implementation (instead of checking the Name for a ".", we
19907 directly look up if the InterfaceType was specified).
19909 Delay the creation of the PropertyBuilder.
19911 Only create the PropertyBuilder if we are not an explicit
19912 interface implementation. This means that explicit interface
19913 implementation members do not participate in regular function
19914 lookups, and hence fixes another major ambiguity problem in
19915 overload resolution (that was the visible effect).
19917 (DefineMethod): Return whether we are doing an interface
19920 * typemanager.cs: Temporary hack until we get attributes in
19921 interfaces (Ravi is working on that) and we get IndexerName
19922 support in interfaces.
19924 * interface.cs: Register the indexers as properties.
19926 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
19927 warning, I have verified that this is a bug in the .NET runtime
19928 (JavaScript suffers of the same problem).
19930 * typemanager.cs (MemberLookup): When looking up members for
19931 interfaces, the parent of an interface is the implicit
19932 System.Object (so we succeed in searches of Object methods in an
19933 interface method invocation. Example: IEnumerable x; x.ToString
19936 2002-05-25 Miguel de Icaza <miguel@ximian.com>
19938 * class.cs (Event): Events should also register if they do
19939 implement the methods that an interface requires.
19941 * typemanager.cs (MemberLookup); use the new GetInterfaces
19944 (GetInterfaces): The code used to lookup interfaces for a type is
19945 used in more than one place, factor it here.
19947 * driver.cs: Track the errors at the bottom of the file, we kept
19950 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
19951 instance if the method we are calling is static!
19953 2002-05-24 Miguel de Icaza <miguel@ximian.com>
19955 * attribute.cs (ApplyAttributes): Make this function filter out
19956 the IndexerName attribute (as that attribute in reality is never
19957 applied) and return the string constant for the IndexerName
19960 * class.cs (TypeContainer.Emit): Validate that all the indexers
19961 have the same IndexerName attribute, and if so, set the
19962 DefaultName attribute on the class.
19964 * typemanager.cs: The return value might contain other stuff (not
19965 only methods). For instance, consider a method with an "Item"
19966 property and an Item method.
19968 * class.cs: If there is a problem with the parameter types,
19971 2002-05-24 Ravi Pratap <ravi@ximian.com>
19973 * ecore.cs (ImplicitConversionExists): Wrapper function which also
19974 looks at user defined conversion after making a call to
19975 StandardConversionExists - we need this for overload resolution.
19977 * expression.cs : Update accordingly the various method calls.
19979 This fixes 2 bugs filed against implicit user defined conversions
19981 2002-05-22 Miguel de Icaza <miguel@ximian.com>
19983 * statement.cs: Track the result of the assignment.
19985 2002-05-21 Miguel de Icaza <miguel@ximian.com>
19987 * expression.cs (MemberAccess): Improved error reporting for
19988 inaccessible members.
19990 2002-05-22 Martin Baulig <martin@gnome.org>
19992 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
19993 itself with debugging support.
19995 2002-05-22 Martin Baulig <martin@gnome.org>
19997 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
19998 Removed, this isn't needed anymore.
20000 2002-05-20 Martin Baulig <martin@gnome.org>
20002 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
20003 be underlying type for an enum.
20005 2002-05-20 Miguel de Icaza <miguel@ximian.com>
20007 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
20008 that splits out the loading of just the core types.
20010 * rootcontext.cs (ResolveCore): Split the struct resolution in
20011 two, so we can load the enumeration underlying types before any
20014 * expression.cs (Is): Bandaid until we fix properly Switch (see
20015 bug #24985 for details).
20017 * typemanager.cs (ImplementsInterface): The hashtable will contain
20018 a null if there are no interfaces implemented.
20020 2002-05-18 Miguel de Icaza <miguel@ximian.com>
20022 * cs-parser.jay (indexer_declarator): It is fine to have array
20025 2002-05-17 Miguel de Icaza <miguel@ximian.com>
20027 * typemanager.cs: (RegisterBuilder): New function used to register
20028 TypeBuilders that implement interfaces. Since
20029 TypeBuilder.GetInterfaces (as usual) does not work with lame
20031 (AddUserType): register interfaces.
20033 (ImplementsInterface): Use the builder_to_ifaces hash if we are
20034 dealing with TypeBuilder. Also, arrays are showing up as
20035 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
20036 methods can not be invoked on them!
20038 * ecore.cs (ExplicitReferenceConversionExists): Made public.
20039 (ImplicitReferenceConversionExists): Split out from
20040 StandardConversionExists.
20042 * expression.cs (As): We were only implementing one of the three
20043 cases for the as operator. We now implement them all.
20044 (Is): Implement the various other cases for Is as well.
20046 * typemanager.cs (CACHE): New define used to control if we want or
20047 not the FindMembers cache. Seems to have a negative impact on
20048 performance currently
20050 (MemberLookup): Nested types have full acess to
20051 enclosing type members
20053 Remove code that coped with instance/static returns for events, we
20054 now catch this in RealFindMembers.
20056 (RealFindMembers): only perform static lookup if the instance
20057 lookup did not return a type or an event.
20059 2002-05-17 Miguel de Icaza <miguel@ximian.com>
20061 * assign.cs (CompoundAssign): We pass more semantic information
20062 now to Compound Assignments than we did before: now we have all
20063 the information at hand, and now we resolve the target *before* we
20064 do the expression expansion, which allows the "CacheValue" method
20065 to have the effect we intended (before, a [x] += 1 would generate
20066 two differen ArrayAccess expressions from the ElementAccess,
20067 during the resolution process).
20069 (CompoundAssign.DoResolve): Resolve target and original_source here.
20071 2002-05-16 Miguel de Icaza <miguel@ximian.com>
20073 * expression.cs (ArrayAccess): dropped debugging information.
20075 * typemanager.cs: Small bug fix: I was always returning i_members,
20076 instead of one of i_members or s_members (depending on which had
20079 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
20080 method is invoked before any code generation takes place, and it
20081 is a mechanism to inform that the expression will be invoked more
20082 than once, and that the method should use temporary values to
20083 avoid having side effects
20085 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
20087 * ecore.cs (Expression.CacheTemporaries): Provide empty default
20090 * expression.cs (Indirection, ArrayAccess): Add support for
20091 CacheTemporaries in these two bad boys.
20093 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
20094 ldobj or ldind_ref.
20095 (StoreFromPtr): Handle stobj as well.
20097 * expression.cs (UnaryMutator): Share more code.
20099 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
20100 down: I was not tracking the Filter function as well, which
20101 was affecting the results of the cache.
20103 2002-05-15 Miguel de Icaza <miguel@ximian.com>
20105 * attribute.cs: Remove the hack to handle the CharSet property on
20108 2002-05-14 Miguel de Icaza <miguel@ximian.com>
20110 * attribute.cs (DoResolve): More uglyness, we now only try to
20111 resolve the attribute partially, to extract the CharSet
20112 information (only if we are a StructLayout attribute). Otherwise
20114 (GetExtraTypeInfo): Add some code to conditionally kill in the
20115 future this. I am more and more convinced that the .NET
20116 framework has special code to handle the attribute setting on
20119 * expression.cs (IsParamsMethodApplicable): Revert my previous
20120 foreach change here, it was wrong.
20122 2002-05-13 Miguel de Icaza <miguel@ximian.com>
20124 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
20125 (pp_expr): do not abort on unknown input, just return.
20126 (eval): abort if there are pending chars.
20128 * attribute.cs (Attribute.Resolve): Positional parameters are
20129 optional. Deal with that case.
20131 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
20132 the Ansi/Unicode/Auto information for the type.
20134 (TypeContainer.DefineType): instantiate the EmitContext here, as
20135 we will be using it during the type definition (to resolve
20136 attributes) and during the emit phase.
20138 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
20139 to pull type information out of the attributes
20141 (Attribute.Resolve): track the constructor builder, and allow for
20142 multiple invocations (structs and classes will use this).
20144 * ecore.cs (MemberLookupFinal): new version with all the
20145 parameters customizable.
20147 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
20148 constructors. Return if the result value is null (as the error
20149 would have been flagged already by MemberLookupFinal)
20151 Do not allow instances of abstract classes or interfaces to be
20154 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
20155 We have to compare the assembly property here when dealing with
20156 FamANDAssem and Assembly access modifiers, because we might be
20157 creating an assembly from *modules* (that means that we are not
20158 getting TypeBuilders for types defined in other modules that are
20159 part of this assembly).
20161 (Method.Emit): If the method is marked abstract and has a body,
20164 (TypeContainer.DefineMembers): If both the defined member and the
20165 parent name match are methods, then do not emit any warnings: let
20166 the Method.Define routine take care of flagging warnings. But if
20167 there is a mismatch (method overrides something else, or method is
20168 overriwritten by something, then emit warning).
20170 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
20171 set to null, this means `do not check for the return type on the
20174 (Method.Define): set the return type for the method signature to
20175 null, so that we get methods with the same name and parameters and
20176 different return types. This is used to flag warning 114 (you are
20177 hiding a method, and you probably want to use the new/override
20180 * typemanager.cs (MemberLookup): Implemented proper access
20181 control, closing a long standing set of bug reports. The problem
20182 was that the Framework only has two bits: Public and NonPublic,
20183 and NonPublic includes private and protected methods, but we need
20184 to enforce the FamANDAssem, FamOrAssem and Family.
20186 2002-05-11 Miguel de Icaza <miguel@ximian.com>
20188 * statement.cs (GotoCase): Return true: Ammounts to giving up
20189 knowledge on whether we return or not, and letting the other case
20190 be responsible for it.
20192 2002-05-10 Miguel de Icaza <miguel@ximian.com>
20194 * driver.cs: Do not load directories for each file processed, only
20195 do it if there is a pattern.
20197 * ecore.cs: Report readonly assigns here as well, as we might have
20198 been resolved only by MemberAccess.
20200 (SimpleName.SimpleNameResolve): Also be useful for LValue
20201 resolution. We need this to propagate assign to local readonly variables
20203 * typemanager.cs: Use a ptrhashtable for the criteria, because we
20204 do not want to reuse potential criteria memory.
20206 * class.cs (MyEventBuilder): Set reflected_type;
20208 * ecore.cs (Constantify): Added support for constifying bools.
20210 (RootContext.LookupType): Added a cache for values looked up in
20211 the declaration space.
20213 * typemanager.cs (FindMembers): Now is a front-end to
20214 RealFindMembers, and provides a two-level hashtable-based cache to
20217 15% performance improvement: from 22.5 to 19.2 seconds.
20219 * expression.cs (IsParamsMethodApplicable): use foreach.
20220 (Invocation.DoResolve): ditto.
20221 (New.DoResolve): ditto.
20222 (ArrayCreation.DoResolve): ditto.
20224 * ecore.cs (FindMostEncompassingType): use foreach.
20226 * delegate.cs (NewDelegate.DoResolve): Use foreach
20228 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
20229 (RemoveMethods): use foreach.
20231 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
20232 nested foreach statements instead of for, and also break out of
20233 the inner loop once a match is found.
20235 (Invocation.OverloadResolve): Use foreach, simplify the code.
20237 2002-05-08 Miguel de Icaza <miguel@ximian.com>
20239 * cfold.cs (BinaryFold): During an enumeration evaluation context,
20240 we actually unwrap the expression to allow for extra information
20243 * expression.cs: Use Shr_Un on unsigned operations.
20245 2002-05-08 Ravi Pratap <ravi@ximian.com>
20247 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
20248 applicable operators was not being considered correctly. This closes
20249 the bug Miguel reported.
20251 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
20253 * attribute.cs: check that the type derives from System.Attribute
20254 and report the correct error in that case (moved the duplicate code to
20255 its own method, too).
20257 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
20259 * attribute.cs: lookup attribute type name as the spec says: first the
20260 bare attribute name and then name + "Attribute" (nant compiles with
20261 mcs after this fix).
20263 2002-05-07 Miguel de Icaza <miguel@ximian.com>
20265 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
20266 Because of the way we parse things, we should try to see if a
20267 UIntConstant can fit in an integer.
20269 2002-05-07 Ravi Pratap <ravi@ximian.com>
20271 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
20272 when we are in an explicit context.
20274 (ConvertReferenceExplicit): When converting from Iface type S to Class
20275 T make sure the rules are implemented as an OR.
20277 * parameter.cs (ParameterType): Make it a property for now although the
20278 purpose really isn't anything immediate.
20280 * expression.cs (Is*Applicable): Do better checking on the parameter type
20281 of a ref/out parameter. The ones from the system assemblies are already
20282 marked with the correct type so we don't need to do any correction.
20284 * ecore.cs (StandardConversionExists): Conversion from Interface types to
20285 the object type is standard too so include that.
20287 2002-05-06 Miguel de Icaza <miguel@ximian.com>
20289 * ecore.cs (StandardConversionExists): Augment with missing code:
20290 deal with IntConstant, LongConstants and Enumerations.
20292 * assign.cs: Report the error, instead of failing silently
20294 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
20295 typecontainer that they are declared, because the
20296 typecontainer/namespace will have the list of using clauses that
20297 need to be applied.
20299 Assembly Attributes were escaping the normal registration
20302 (EmitCode): Apply attributes within an EmitContext that represents
20303 the container they were declared on.
20305 * cs-parser.jay: Track bases for structs. How did I get this wrong?
20307 2002-05-06 Ravi Pratap <ravi@ximian.com>
20309 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
20310 Revamp completely - make much cleaner as we now operate only
20313 (FindMostSpecificSource, FindMostSpecificTarget): New methods
20314 to implement the logic detailed in the spec more correctly.
20316 (UserDefinedConversion): Update accordingly.
20318 2002-05-06 Miguel de Icaza <miguel@ximian.com>
20320 * statement.cs: Return flow analysis information up.
20322 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
20325 (token): Do not consume an extra character before calling
20328 2002-05-06 Piers Haken <piersh@friskit.com>
20330 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
20332 2002-05-06 Miguel de Icaza <miguel@ximian.com>
20334 * class.cs (Constructor.Emit): Set the IsStatic flag in the
20335 EmitContext during the instance constructor initializer
20336 resolution, to stop access to instance variables.
20338 This is mandated by the spec, last paragraph of the `constructor
20339 initializers' section.
20341 2002-05-05 Miguel de Icaza <miguel@ximian.com>
20343 * cs-parser.jay, class.cs (Accessor): new class used to represent
20344 an accessor (get or set). In the past we used `null' to represent
20345 a missing accessor. But this is ambiguous because there was no
20346 way to tell in abstract indexers/properties if one of them was
20349 Now there is a way of addressing that.
20351 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
20352 instead of FindMembers.
20354 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
20355 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
20357 * attribute.cs: Treat indexers and properties as the same in terms
20358 of applying attributes
20360 * ecore.cs (FindMostEncompassedType): Use statically initialized
20361 EmptyExpressions()s like we do elsewhere to avoid creating useless
20362 objects (and we take this out of the tight loop).
20364 (GetConversionOperators): Move the code to extract the actual
20365 operators to a separate routine to clean things up.
20367 2002-05-04 Miguel de Icaza <miguel@ximian.com>
20369 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
20370 events are always registered FieldBuilders.
20372 * class.cs (FieldBase): New class shared by Fields
20374 * delegate.cs: If we are a toplevel delegate, use our full name.
20375 If we are a nested delegate, then only use our tail name.
20377 2002-05-02 Ravi Pratap <ravi@ximian.com>
20379 * expression.cs (IsApplicable): Ensure that we add the "&" to
20380 ref/out types before comparing it with the type of the argument.
20382 (IsParamsMethodApplicable): Ditto.
20384 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
20387 * delegate.cs : Handle the case when we have more than one applicable
20388 method. Flag an error only when we finish checking all.
20390 2002-05-02 Miguel de Icaza <miguel@ximian.com>
20392 * expression.cs: Add support for boolean static initializers.
20394 2002-05-01 Miguel de Icaza <miguel@ximian.com>
20396 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
20398 * parameter.cs (ComputeParameterTypes,
20399 ComputeAndDefineParameterTypes): Better error handling: now we
20400 clear the `types' cache if we fail during any of the type lookups.
20401 We also return the status code correctly to our caller
20403 * delegate.cs: If we fail to define a delegate, abort the extra
20406 * expression.cs (Binary.ResolveOperator): for
20407 operator==(object,object) and operator !=(object, object) we also
20408 have to verify that there is an implicit conversion from one to
20411 (ArrayAccess.DoResolve): Array Access can operate on
20414 2002-04-30 Miguel de Icaza <miguel@ximian.com>
20416 * assign.cs (CompoundAssign): A new class used as a "flag" that
20417 the assignment actually is happening as part of a compound
20418 assignment operator.
20420 During compound assignment, a few new rules exist to enable things
20427 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
20428 to the type of x) if y is implicitly convertible to the type of x,
20429 and the operator is a builtin operator and the return type of the
20430 operator is explicitly convertible to the type of x.
20432 * rootcontext.cs: Reset warning level to 2. 4 catches various
20433 "interesting" features in mcs, we must clean this up at some
20434 point, but currently am trying to kill other bugs ;-)
20436 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
20437 in container classes as well.
20439 * expression.cs (Binary.ResolveOperator): Handle string case
20440 before anything else (as operator overloading does emit an error
20441 before doing anything else).
20443 This code could go away when we move to a table driven model, but
20444 i could not come up with a good plan last night.
20446 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
20448 * typemanager.cs (CSharpName): reimplementation using regex.
20449 * class.cs: added null check for fields in Emit
20450 * rootcontext.cs: set warninglevel to 4
20452 2002-04-29 Miguel de Icaza <miguel@ximian.com>
20454 * typemanager.cs (CSharpName): reimplemented with Lupus
20457 2002-04-28 Miguel de Icaza <miguel@ximian.com>
20459 * statement.cs (If): correclty implement Resolve, because we were
20460 not catching sem errors in there. The same process is needed
20462 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
20465 (Statement.Warning_DeadCodeFound): Factorize code.
20466 (While): Report dead code here too.
20468 (Statement): Added Resolve virtual method to allow
20469 for resolution split from the emit code.
20471 2002-04-26 Miguel de Icaza <miguel@ximian.com>
20473 * statement.cs (EmitBoolExpression): No longer try to resolve the
20475 (MakeBoolean): New utility function that resolve, implicitly
20476 converts to boolean and tags the expression.
20479 (If, Do): Implement dead code elimination.
20480 (While): Implement loop inversion
20482 (Do, While, For, If): Resolve the expression prior to calling our
20485 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
20488 - added method Report28 (warning: program has more than one entry point)
20489 - added method IsEntryPoint, implements paragraph 10.1 of the spec
20490 - modified method Method.Define, the part at the end of the method
20492 * rootcontext.cs: added static public Location EntryPointLocation;
20494 * ../errors/cs0028.cs : Add test case for the above warning.
20497 - modified method CSharpName to allow arrays of primitive type to
20498 be printed nicely (e.g. instead of System.Int32[][] it now prints
20500 - added method CSharpSignature: returns the signature of a method
20501 in string format to be used in reporting errors, warnings, etc.
20503 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
20506 2002-04-26 Ravi Pratap <ravi@ximian.com>
20508 * delegate.cs (Define): Fix extremely silly bug where I was
20509 setting the type of the 'object' parameter of the BeginInvoke
20510 method to System.IAsyncResult instead of System.Object ;-)
20512 2002-04-26 Miguel de Icaza <miguel@ximian.com>
20514 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
20517 (Constructor.Emit): return if we fail to initialize the
20518 constructor. Another door closed!
20520 * expression.cs (New.DoResolve): Improve error message (from -6 to
20521 1501). Use DeclaredOnly lookup to find the exact constructor.
20523 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
20524 loop. This is useful.
20526 * cs-parser.jay: Adjust the default parameters so that destructors
20527 have the proper signature.
20529 2002-04-26 Martin Baulig <martin@gnome.org>
20531 * driver.cs (LoadAssembly): If `assembly' contains any characters
20532 which are only valid in path names and not in assembly names
20533 (currently slash, backslash and point), use Assembly.LoadFrom ()
20534 instead of Assembly.Load () on the `assembly' (before iteration
20535 over the link_paths).
20537 2002-04-26 Martin Baulig <martin@gnome.org>
20539 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
20541 2002-04-25 Miguel de Icaza <miguel@ximian.com>
20543 * class.cs (Property): use the new typemanager.MemberLookup
20545 (TypeContainer.MemberLookup): Implement using the
20546 TypeManager.MemberLookup now.
20548 * typemanager.cs: Make MemberLookup a function of the TypeManager,
20549 and return MemberInfos, so that these can be used without an
20550 EmitContext (what we had before).
20552 2002-04-24 Miguel de Icaza <miguel@ximian.com>
20554 * expression.cs: Fix the case where the argument to params if the
20555 type of the params. I omitted handling this before. Fixed
20557 2002-04-22 Miguel de Icaza <miguel@ximian.com>
20559 * driver.cs: Call BootCorlib_PopulateCoreType
20561 * class.cs (Property.CheckBase): Check for properties only, not
20564 * interface.cs: Temporary hack: try/catch around the
20565 CustomAttributeBuilder, because I am getting an exception that I
20568 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
20569 types whose definitions are required to be there (attributes are
20570 defined before standard types).
20572 Compute definitions as we boot the various types, as they are used
20573 immediately (value_type class will need object_type, but if we do
20574 not initialize object_type, we will pass a null, which will let
20575 the runtime pick the System.Object from the existing corlib, which
20576 is not what we want).
20578 2002-04-22 Patrik Torstensson <totte@labs2.com>
20580 * cs-tokenizer.cs: fixed a number of trim() issues.
20582 2002-04-22 Ravi Pratap <ravi@ximian.com>
20584 * expression.cs (Argument.Type): Ensure that we return the correct
20585 type when we have out or ref parameters [in which case we
20588 2002-04-22 Miguel de Icaza <miguel@ximian.com>
20590 * class.cs (Property, Indexer): Allow extern modifier in there.
20592 * typemanager.cs (InitBaseTypes): Initializes object_type and
20593 value_type, since those will be used early on during the bootstrap
20594 process to compile corlib.
20596 (InitCoreTypes): Move code from here to InitBaseTypes.
20598 2002-04-21 Miguel de Icaza <miguel@ximian.com>
20600 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
20601 single-dimension arrays as using the ldlen opcode.
20603 Daniel Lewis discovered this optimization.
20605 * typemanager.cs: Add signature for System.Array::get_Length
20607 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20609 * statement.cs: report the error when the foreach does not apply to an
20610 array nor a collection.
20612 2002-04-19 Miguel de Icaza <miguel@ximian.com>
20614 * expression.cs: Add implicit conversions to the operator ~.
20616 * constant.cs (DecimalConstant.Emit): Emit decimal value.
20618 * typemanager.cs: Locate the decimal constructor.
20620 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20622 * attribute.cs: use the new property of TypeOf.
20623 * expression.cs: added 'get' property around typearg.
20625 These changes fix a build breaker reported by NickD. Is this the
20626 correct way to fix? If not, please, revert my changes and make it
20629 2002-04-17 Miguel de Icaza <miguel@ximian.com>
20631 * attribute.cs: Add support for typeof in attribute invocations.
20632 I am not sure that this is right though.
20634 2002-04-14 Duncan Mak <duncan@ximian.com>
20636 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
20637 Binary.Operator.Division case.
20639 2002-04-13 Ravi Pratap <ravi@ximian.com>
20641 * class.cs (DefineType): Ensure that we do a proper check on
20642 attribute types and also register it with the TypeManager.
20644 (TypeContainer.Targets): The default for attribute types is
20645 AttributeTargets.All.
20647 * attribute.cs (ApplyAttributes): Registering the attribute type
20648 is done elsewhere, not when we discover we have a Usage attribute.
20650 2002-04-12 Ravi Pratap <ravi@ximian.com>
20652 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
20653 and get rid of is_delegate parameter.
20655 * everywhere : update.
20657 2002-04-12 Ravi Pratap <ravi@ximian.com>
20659 * cs-parser.jay (compilation_unit): Revamp completely to use
20660 some new ideas that I got from Rhys' grammar to solve the problems
20661 with assembly level attributes.
20663 (outer_declaration): New grammar production.
20665 (attribute_sections): Add.
20667 (opt_attributes): Base on attribute_sections
20669 (namespace_declaration): Allow opt_attributes to tackle the case
20670 when we have assembly level attributes - we are clever in this
20673 * attribute.cs (ApplyAttributes): Do not worry about assembly
20674 attributes in the non-global context.
20676 * rootcontext.cs (AddGlobalAttributes): Go back to using this
20677 instead of SetGlobalAttributes.
20679 * class.cs, rootcontext.cs : Ensure we define and generate
20680 attribute types before anything else.
20682 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
20683 and flag the new error -20 for the case when the attribute type
20684 does not have valid targets specified. csc does not catch this.
20686 * ../errors/errors.txt : update for error # -20
20688 2002-04-11 Ravi Pratap <ravi@ximian.com>
20690 * support.cs (InternalParameters.ParameterModifier): Do some null
20691 checking and return sane values.
20693 * class.cs (Method.Define): If we are a PInvoke method, ensure
20694 that we are static and extern. Report error # 601
20696 * ../errors/cs0601.cs : Add test case for the above error.
20698 2002-04-07 Ravi Pratap <ravi@ximian.com>
20700 * rootcontext.cs (attribute_types): We need to keep type of
20701 all attribute types separately and emit code for them first.
20703 (RegisterAttribute) : Implement.
20705 * class.cs (DefineType): Check if the current Type is a custom
20706 attribute type and register it accordingly.
20708 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
20709 adding the first attribute twice and rename to
20711 (SetGlobalAttributes): this.
20713 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
20716 * attribute.cs (ApplyAttributes): Take an additional argument telling us
20717 if we are processing global arguments. Hmm, I am unsure of this.
20719 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20721 * expression.cs: added static array of strings to avoid calling
20722 Enum.ToString () for Operator in Binary. Significant recover of
20725 2002-04-10 Miguel de Icaza <miguel@ximian.com>
20727 * class.cs (FindMembers): Allow the Builders of the various
20728 members to be null. If they are skip them. This only happens
20729 during the PInvoke declaration.
20731 2002-04-09 Miguel de Icaza <miguel@ximian.com>
20733 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
20734 failure, so we do not keep going afterwards.
20736 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
20737 wanted to pass `false' as the `is_delegate' argument. If this is
20738 the case, why not use delegate_type == null to mean `is_delegate =
20739 false' and anything else as is_delegate = true.
20741 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
20743 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
20744 code for the section, not the beginning of the tests.
20746 2002-04-08 Miguel de Icaza <miguel@ximian.com>
20748 * cfold.cs: Handle operator + (Enum x, Underlying x)
20750 * expression.cs (Binary): same. Warn about errors where we have
20751 Enum/Enum in operator + as well.
20753 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
20756 - added support for switch(bool)
20757 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
20758 - add TableSwitchEmit() to handle table-based switch statements
20760 2002-04-05 Ravi Pratap <ravi@ximian.com>
20762 * expression.cs (Invocation.OverloadResolve): Factor out code which
20763 does parameter compatibility checking with arguments so that we can
20764 re-use the code even from Delegate.VerifyApplicability
20766 (VerifyArgumentsCompat): Move above code here.
20768 * delegate.cs (VerifyApplicability): Get rid of duplicate code
20769 and instead make a call to the above method.
20771 2002-03-31 Ravi Pratap <ravi@ximian.com>
20773 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
20774 We use it to keep track of classes which are attribute types.
20776 2002-04-02 Miguel de Icaza <miguel@ximian.com>
20778 * delegate.cs (Delegate.Define): Correctly define the types in the
20779 presence of fixed and array parameters.
20781 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
20784 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
20785 include NonPublic after the first iteration.
20787 * class.cs (Indexer.CheckBase): Only check if both parents are
20790 * cs-parser.jay (accessor_body): If empty, set to null.
20792 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
20793 same code path here to resolve constants names that we did have in
20794 MemberAccess.DoResolve. There is too much code duplicated here.
20796 2002-04-01 Miguel de Icaza <miguel@ximian.com>
20798 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
20800 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
20803 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
20804 tokens, numbers and strings.
20806 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
20809 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
20810 asyncronous parameters and the regular parameters.
20812 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
20813 specify the target directory.
20815 * expression.cs: (This.DoResolve): Simplify
20816 (As.Emit): Optimize, do not generate IsInst if the expression is
20817 always of the given type.
20819 (Is.DoResolve): Bug fix, we were reporting both always/never for
20822 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
20823 creating too many unnecessary arrays.
20825 2002-03-31 Miguel de Icaza <miguel@ximian.com>
20827 * class.cs (EmitFieldInitializer): Use Assign expression to assign
20828 fields instead of rolling our own initializer. Takes care of all
20829 implicit conversions, and drops unnecessary static checks/argument.
20831 2002-03-31 Dick Porter <dick@ximian.com>
20833 * driver.cs: use the GetDirectories() return values properly, and
20834 use "/" as path separator.
20836 2002-03-30 Miguel de Icaza <miguel@ximian.com>
20838 * expression.cs (Unary): Optimize - - expr into expr.
20839 (Binary): Optimize a + (-b) into a -b.
20841 * codegen.cs (CodeGen): Made all methods static.
20843 2002-03-29 Miguel de Icaza <miguel@ximian.com>
20847 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
20848 TypeBuilder property.
20850 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
20853 * tree.cs: Removed the various RecordXXXX, and replaced with a
20854 single RecordDecl. Removed all the accessor methods, and just
20855 left a single access point Type
20857 * enum.cs: Rename DefineEnum to DefineType.
20859 * decl.cs: New abstract method `DefineType' used to unify the
20860 Defines for Enumerations, Interfaces, TypeContainers and
20863 (FindType): Moved LookupInterfaceOrClass here. Moved the
20864 LookupBaseClasses method that used to live in class.cs and
20865 interface.cs here, and renamed to FindType.
20867 * delegate.cs: Implement DefineType. Take advantage of the
20868 refactored pattern for locating the parent builder without taking
20869 the parent_builder argument (which we know does not work if we are
20870 nested, and triggering a toplevel definition).
20872 2002-03-28 Miguel de Icaza <miguel@ximian.com>
20874 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
20875 accessibility of a member has changed during override and report
20878 * class.cs (Method.Define, Property.Define): Only complain on
20879 overrides if the method is private, any other accessibility is
20880 fine (and since we just checked the permission is the same, we are
20883 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
20884 and elif are processed always. The other pre-processing
20885 directives are only processed if we are "taking" the path
20887 2002-03-29 Martin Baulig <martin@gnome.org>
20889 * class.cs (Method.Emit): Only emit symbolic debugging info if the
20890 current location is not Null.
20892 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
20893 a separate method so we can profile it.
20895 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
20896 `span.Seconds' are just seconds, but no minutes or hours.
20897 (MainDriver): Profile the CodeGen.SaveSymbols calls.
20899 2002-03-28 Miguel de Icaza <miguel@ximian.com>
20901 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
20902 Remove the gratuitous set of Final:
20904 // If an interface implementation, then we can set Final.
20905 if (((flags & MethodAttributes.Abstract) == 0) &&
20906 implementing.DeclaringType.IsInterface)
20907 flags |= MethodAttributes.Final;
20909 I do not know what I was smoking when I used that.
20912 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
20913 step into fixing the name resolution issues for delegates and
20914 unifying the toplevel name resolution.
20916 2002-03-28 Martin Baulig <martin@gnome.org>
20918 * class.cs (Method.Emit): If we have a symbol writer, call its
20919 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
20920 tell it about the current method.
20922 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
20923 writer that we're going to emit the first byte of IL code for a new
20924 statement (a new source line).
20925 (EmitContext.EmitTopBlock): If we have a symbol writer, call
20926 EmitContext.Mark() before emitting any code.
20928 * location.cs (SymbolDocument): Return null when we're Null.
20930 * statement.cs (Statement): Moved the `Location loc' variable here.
20931 (Statement.EmitBoolExpression): If we have a symbol writer, call
20932 ec.Mark() before emitting any code to tell it that we're at the
20933 beginning of a new statement.
20934 (StatementExpression): Added `Location' argument to the constructor.
20935 (Block): Added public readonly variable `StartLocation' and public
20936 variable `EndLocation'. The latter is to be set using SetEndLocation().
20937 (Block): Added constructor which takes a start and end location.
20938 (Block.SetEndLocation): New method. This sets the end location.
20939 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
20940 local variables we create.
20941 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
20942 each statement and do also mark the begin and end of the block.
20944 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
20945 tell it the current lexer.Location, use Location.Null for the end of the
20947 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
20948 current block, set its end location using SetEndLocation().
20949 (statement_expression): StatementExpression constructor now takes the
20950 lexer.Location as additional argument.
20951 (for_statement, declare_local_variables): Likewise.
20952 (declare_local_variables): When creating a new implicit block, use the
20953 new Block constructor and pass it the lexer.Location.
20955 2002-03-28 Miguel de Icaza <miguel@ximian.com>
20957 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
20958 members also on the parent interfaces recursively.
20960 2002-03-27 Miguel de Icaza <miguel@ximian.com>
20962 * report.cs: Use new formats, since Gonzalo finished the missing
20965 * expression.cs (Binary.ResolveOperator): added missing operator|
20966 operator& and operator^ for bool/bool.
20968 * cs-parser.jay: CheckDef now takes a Location argument that is
20969 used to report errors more precisly (instead of reporting the end
20970 of a definition, we try to track something which is a lot closer
20971 to the source of the problem).
20973 * cs-tokenizer.cs: Track global token use, so we can properly flag
20974 the use of #define/#undef after the first token has been seen.
20976 Also, rename the reportXXXX to Error_DescriptiveName
20978 * decl.cs (DeclSpace.IsTopLevel): Move property here from
20979 TypeContainer, so that Enum and Interface can use this too.
20981 * class.cs (TypeContainer.LookupInterfaceOrClass,
20982 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
20983 `builder' argument. Typically this was used to pass the parent
20984 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
20987 The problem is that a nested class could trigger the definition of
20988 a toplevel class, and the builder would be obviously wrong in that
20991 So we drop this argument, and we compute dynamically the
20992 TypeBuilder/ModuleBuilder (the correct information was available
20993 to us anyways from DeclSpace.Parent)
20995 * interface.cs (Interface.DefineInterface): Drop builder
20996 parameter cleanup like class.cs
20998 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
21001 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
21004 (Try.Emit): Propagate the returns value from the statement.
21006 (Return.Emit): Even if we are leavning
21008 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
21010 * modifiers.cs: Fix the computation of MethodAttributes flags.
21012 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
21014 * driver.cs: allow compilation of files that start with '/'.
21015 Add a default case when checking the argument of --target.
21017 2002-03-25 Miguel de Icaza <miguel@ximian.com>
21019 * interface.cs: Implement the same search algorithm for types in
21020 the interface code.
21022 * delegate.cs: Do not allow multiple definition.
21024 * Recovered ChangeLog that got accidentally amputated
21026 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
21028 * rootcontext.cs: Load manually enum to allow core classes to
21029 contain enumerations.
21031 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
21032 Update to new static methods in TypeManager.
21034 * typemanager.cs (GetMethod, GetConstructor): Use our
21035 implementation of FindMembers to find the members, since during
21036 corlib compilation, the types are TypeBuilders and GetMethod and
21037 GetConstructor do not work.
21039 Make all methods in TypeManager static.
21041 (InitCodeHelpers): Split the functionality from
21042 the InitCodeTypes function.
21044 * driver.cs: Call InitCodeHelpers after we have populated the
21047 * cs-parser.jay (delegate_declaration): we did not used to compute
21048 the delegate name correctly for void delegates.
21050 2002-03-24 Miguel de Icaza <miguel@ximian.com>
21052 * rootcontext.cs (RootContext): Init the interface_resolve_order
21053 and type_container_resolve_order always.
21055 (ResolveCore, BootstrapCorlib_ResolveClass,
21056 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
21057 compiler when compiling with --nostdlib
21059 * class.cs (TypeContainer.DefineType): Check that our parent is
21060 not null. This test is most important when we are bootstraping
21063 * codegen.cs: Split out the symbol writing code.
21065 2002-03-25 Martin Baulig <martin@gnome.org>
21067 * driver.cs (-g): Made -g an alias for --debug.
21069 2002-03-24 Martin Baulig <martin@gnome.org>
21071 * codegen.cs (SymbolWriter): New public variable. Returns the
21072 current symbol writer.
21073 (CodeGen): Added `bool want_debugging_support' argument to the
21074 constructor. If true, tell the ModuleBuild that we want debugging
21075 support and ask it for the ISymbolWriter.
21076 (Save): If we have a symbol writer, call it's Close() method after
21077 saving the assembly.
21079 * driver.c (--debug): New command line argument to create a
21080 debugger information file.
21082 * location.cs (SymbolDocument): New public property. Returns an
21083 ISymbolDocumentWriter object for the current source file or null
21084 if we don't have a symbol writer.
21086 2002-03-21 Miguel de Icaza <miguel@ximian.com>
21088 * driver.cs (LoadAssembly): Correctly return when all the paths
21089 have been tried and not before.
21091 * statement.cs (Switch.Emit): return the actual coverage for this
21092 statement (returns/not-returns)
21094 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
21095 switch of the statement if we are the last switch section. That
21096 kills two problems: try/catch problems (we used to emit an empty
21097 nop at the end) and switch statements where all branches would
21100 2002-03-19 Miguel de Icaza <miguel@ximian.com>
21102 * driver.cs: Add default assemblies (the equivalent to the
21103 Microsoft CSC.RSP file)
21105 * cs-tokenizer.cs: When updating `cols and setting it to zero,
21106 also update tokens_seen and set it to false.
21108 * driver.cs: Implement --recurse for Mike.
21110 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
21111 correctly splitting out the paths.
21113 2002-03-18 Miguel de Icaza <miguel@ximian.com>
21115 * interface.cs (Interface.PopulateProperty): Instead of using
21116 `parent' as the declaration space for the set parameters, use
21119 * support.cs (InternalParameters): InternalParameters constructor
21120 takes a DeclSpace instead of a TypeContainer.
21122 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
21123 types are being initialized, load the address of it before calling
21126 (New): Provide a mechanism to disable the generation of local
21127 value type temporaries when the caller will be providing us with
21128 an address to store it.
21130 (ArrayCreation.EmitDynamicInitializers): Use it.
21132 2002-03-17 Miguel de Icaza <miguel@ximian.com>
21134 * expression.cs (Invocation.EmitArguments): Only probe for array
21135 property if there is more than one argument. Sorry about that.
21137 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
21138 empty param arrays.
21140 * class.cs (Method.LabelParameters): Fix incorrect code path that
21141 prevented the `ParamArrayAttribute' from being applied to the
21144 2002-03-16 Miguel de Icaza <miguel@ximian.com>
21146 * support.cs (ReflectionParameters): Correctly compute whether the
21147 last argument is a params array. Fixes the problem with
21150 * typemanager.cs: Make the assemblies array always be non-null
21151 (empty, but non-null)
21153 * tree.cs (RecordDecl): New function that abstracts the recording
21154 of names. This reports error 101, and provides a pointer to the
21155 previous declaration. Fixes a crash in the compiler.
21157 * cs-parser.jay (constructor_declaration): Update to new grammar,
21158 and provide a constructor_body that can be empty.
21160 2002-03-15 Miguel de Icaza <miguel@ximian.com>
21162 * driver.cs: Add support for --resources.
21164 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
21165 Make all types for the various array helper methods be integer.
21167 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
21168 CheckState to ConvCast.
21170 (ConvCast): Now it takes a `checked' state argument, to avoid
21171 depending on the emit context for the conversion, and just using
21172 the resolve time setting.
21174 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
21175 instead of Invocation.EmitArguments. We do not emit the original
21176 arguments, instead we emit those which have been converted to
21177 unsigned int expressions.
21179 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
21181 * codegen.cs: ditto.
21183 * expression.cs (LocalVariableReference): Drop the use of the
21184 Store function that depended on the variable index.
21186 * statement.cs (VariableInfo): Drop the `Idx' property from this
21187 class, as this is not taking into account the indexes for
21188 temporaries tat we generate during the execution, getting the
21191 * class.cs: First emit class initializers, then call the parent
21194 * expression.cs (Binary): Fix opcode emision.
21195 (UnaryMutator.EmitCode): Support checked code generation
21197 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
21198 matches for events for both the Static and Instance scans,
21199 pointing to the same element. Fix that.
21201 2002-03-14 Miguel de Icaza <miguel@ximian.com>
21203 * rootcontext.cs (ResolveTree): Always set the
21204 interface_resolve_order, because nested interfaces will be calling
21207 * class.cs (GetInterfaceOrClass): Track the same resolution
21208 process used by TypeManager.LookupType. This fixes the nested
21209 type lookups in class declarations (separate path from
21212 (TypeContainer.DefineType): Also define nested interfaces.
21213 (TypeContainer.RegisterOrder): New public function used to
21214 register the order in which child interfaces need to be closed.
21216 Nested interfaces need to be closed after their parents have been
21219 * interface.cs (InterfaceAttr): Put all the logic for computing
21220 the interface attribute here.
21222 (DefineInterface): Register our interface order with the
21223 RootContext or with the TypeContainer depending on the case.
21225 2002-03-12 Miguel de Icaza <miguel@ximian.com>
21227 * cs-parser.jay: rework foreach statement to work with the new
21228 changes to the policy on SimpleNames.
21230 * report.cs: support Stacktrace on warnings as well.
21232 * makefile: drop --unsafe and /unsafe from the compile.
21234 2002-03-13 Ravi Pratap <ravi@ximian.com>
21236 * ecore.cs (StandardConversionExists): Modify to take an Expression
21237 as the first parameter. Ensure we do null -> reference type conversion
21240 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
21241 temporary Expression objects.
21243 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
21245 * interface.cs: workaround bug in method overloading resolution
21246 (there is already a bugzilla bug for it).
21248 2002-03-12 Miguel de Icaza <miguel@ximian.com>
21250 We could also solve this problem by having a separate path for
21251 performing type lookups, instead of DoResolve, we could have a
21252 ResolveType entry point, and only participating pieces of the
21253 production (simplename, deref, array) would implement this.
21255 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
21256 signal SimpleName to only resolve type names and not attempt to
21257 resolve anything else.
21259 * expression.cs (Cast): Set the flag.
21261 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
21263 * class.cs: Only report 108 if there is no `new' modifier.
21265 * cs-parser.jay: rework foreach statement to work with the new
21266 changes to the policy on SimpleNames.
21268 * report.cs: support Stacktrace on warnings as well.
21270 * makefile: drop --unsafe and /unsafe from the compile.
21272 2002-03-11 Miguel de Icaza <miguel@ximian.com>
21274 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21275 lookups here, instead of doing that at parse time. This means
21276 that our grammar will not introduce `LocalVariableReferences' as
21277 expressions at this point. That solves the problem of code like
21281 static void Main ()
21285 This is only half the fix. The full fix requires parameters to
21286 also be handled in this way.
21288 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
21289 makes the use more obvious of the DeclSpace. The
21290 ec.TypeContainer.TypeBuilder is now only used to pull the
21291 TypeBuilder for it.
21293 My theory is that I can get rid of the TypeBuilder completely from
21294 the EmitContext, and have typecasts where it is used (from
21295 DeclSpace to where it matters).
21297 The only pending problem is that the code that implements Aliases
21298 is on TypeContainer, and probably should go in DeclSpace.
21300 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21301 lookups here, instead of doing that at parse time. This means
21302 that our grammar will not introduce `LocalVariableReferences' as
21303 expressions at this point. That solves the problem of code like
21307 static void Main ()
21311 This is only half the fix. The full fix requires parameters to
21312 also be handled in this way.
21314 * class.cs (Property.DefineMethod): When implementing an interface
21315 method, set newslot, when implementing an abstract method, do not
21316 set the flag (before we tried never setting it, or always setting
21317 it, which is the difference).
21318 (Indexer.DefineMethod): same.
21319 (Method.DefineMethod): same.
21321 * ecore.cs: Only set the status used flag if we get back a Field.
21323 * attribute.cs: Temporary hack, so Paolo can keep working.
21325 2002-03-08 Ravi Pratap <ravi@ximian.com>
21327 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
21328 the unmanaged type in the case we have a MarshalAs attribute.
21330 (Resolve): Handle the case when we are parsing the special MarshalAs
21331 attribute [we need to store the unmanaged type to use later]
21333 * typemanager.cs (marshal_as_attr_type): Built in type for the
21334 MarshalAs Attribute.
21336 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
21337 on parameters and accordingly set the marshalling info.
21339 2002-03-09 Miguel de Icaza <miguel@ximian.com>
21341 * class.cs: Optimizing slightly by removing redundant code after
21342 we switched to the `NoTypes' return value.
21343 (Property.DefineMethod): use NoTypes here too.
21345 This fixes the bug I introduced in my last batch of changes.
21347 2002-03-05 Ravi Pratap <ravi@ximian.com>
21349 * tree.cs (RecordEnum): Add. We now keep track of enums too.
21351 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
21352 Enums since those are types too.
21354 * cs-parser.jay (enum_declaration): Record enums as we parse them.
21356 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
21357 thanks to a call during the lookup process.
21359 2002-03-07 Miguel de Icaza <miguel@ximian.com>
21361 * statement.cs (Foreach): Lots of work to accomodate a particular
21362 kind of foreach statement that I had not kept in mind. It is
21363 possible to have foreachs on classes that provide a GetEnumerator
21364 method that return objects that implement the "pattern" for using
21365 a foreach, there is no need to support GetEnumerator
21368 This is needed to compile nant.
21370 * decl.cs: Only report 114 if the member is not `Finalize' and if
21371 the warning level is at least 2.
21373 * class.cs: Moved the compare function from Method to
21376 (MethodSignature.InheritableMemberSignatureCompare): Add new
21377 filter function that is used to extract inheritable methods from a
21380 (Method.Define): Use the new `inheritable_method_signature_filter'
21383 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
21386 2002-03-06 Miguel de Icaza <miguel@ximian.com>
21388 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
21390 * cs-parser.jay: Add opt_semicolon to the interface declaration.
21392 * expression.cs: Pass location information to
21393 ConvertImplicitStandard.
21395 * class.cs: Added debugging code to track return values from
21398 2002-03-05 Miguel de Icaza <miguel@ximian.com>
21400 * expression.cs (Is.DoResolve): If either side of the `is' is an
21401 interface, do not flag the warning.
21403 * ecore.cs (ImplicitReferenceConversion): We need a separate test
21406 * report.cs: Allow for --fatal to be used with --probe.
21408 * typemanager.cs (NoTypes): Move the definition for the empty Type
21411 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
21413 (TypeContainer.DefineProxy): New function used to proxy to parent
21414 implementations when implementing interfaces.
21415 (TypeContainer.ParentImplements): used to lookup if our parent
21416 implements a public function that is required by an interface.
21417 (TypeContainer.VerifyPendingMethods): Hook this up.
21419 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
21420 `modules' and `assemblies' arraylists into arrays. We only grow
21421 these are the very early start up of the program, so this improves
21422 the speedof LookupType (nicely measured).
21424 * expression.cs (MakeByteBlob): Replaced unsafe code with
21425 BitConverter, as suggested by Paolo.
21427 * cfold.cs (ConstantFold.Binary): Special case: perform constant
21428 folding of string concatenation, but if either side is a string,
21429 and the other is not, then return null, and let the runtime use
21430 the concatenation on the string plus the object (using
21431 `Object.ToString').
21433 2002-03-04 Miguel de Icaza <miguel@ximian.com>
21435 Constant Folding has been implemented now.
21437 * expression.cs (Unary.Reduce): Do not throw an exception, catch
21438 the error instead on types that are not supported in one's
21441 * constant.cs (Constant and all children): New set of functions to
21442 perform implict and explicit conversions.
21444 * ecore.cs (EnumConstant): Implement the new functions to perform
21445 conversion by proxying to the child expression.
21447 * codegen.cs: (ConstantCheckState): Constant evaluation has its
21448 own separate setting that can not be turned off from the command
21449 line using --unchecked or --checked and is only controlled using
21450 the checked/unchecked statements and expressions. This setting is
21451 used by the constant folder to flag errors.
21453 * expression.cs (CheckedExpr, UncheckedExpr): Set the
21454 ConstantCheckState as well.
21456 During Resolve, they also have to flag the state, because the
21457 constant folder runs completely in the Resolve phase.
21459 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
21462 2002-03-01 Miguel de Icaza <miguel@ximian.com>
21464 * cfold.cs: New file, this file contains the constant folder.
21466 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
21467 argument to track whether we are using the resulting address to
21468 load or store a value and provide better error messages.
21470 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
21471 new AddressOf arguments.
21473 * statement.cs (Foreach.EmitCollectionForeach): Update
21475 * expression.cs (Argument.Emit): Call AddressOf with proper
21476 arguments to track usage.
21478 (New.DoEmit): Call AddressOf with new arguments.
21480 (Unary.Emit): Adjust AddressOf call.
21482 2002-03-01 Ravi Pratap <ravi@ximian.com>
21484 * cs-parser.jay (member_access): Change the case for pre-defined types
21485 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
21488 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
21491 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
21492 essentially like methods and apply attributes like MethodImplOptions to them too.
21494 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
21497 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
21498 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
21501 * Update code everywhere accordingly.
21503 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
21505 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
21507 2002-02-28 Ravi Pratap <ravi@ximian.com>
21509 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
21510 try performing lookups against those instead of jumping straight into using
21511 the 'using' clauses.
21513 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
21515 (LookupType): Perform lookups in implicit parents too.
21517 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
21518 sequence as RootContext.LookupType.
21520 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
21521 the various cases of namespace lookups into this method.
21523 2002-03-01 Miguel de Icaza <miguel@ximian.com>
21525 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
21526 in positional arguments)
21528 * class.cs (Operator): Update the AllowedModifiers to contain
21531 * cs-parser.jay: Update operator declaration to allow for the
21532 operator body to be empty.
21534 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
21537 2002-02-27 Miguel de Icaza <miguel@ximian.com>
21539 * class.cs (Method.Emit): Label parameters.
21541 * driver.cs: Return 1 or 0 as the program exit code.
21543 2002-02-26 Miguel de Icaza <miguel@ximian.com>
21545 * expression.cs: Special case the `null' object when trying to
21546 auto-compute the type, as anything can be explicitly converted to
21549 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
21550 spotting this Paolo.
21552 (Expression.ImplicitNumericConversion): Perform comparissions of
21553 the type using the underlying type in the case of an enumeration
21554 rather than using the enumeration type for the compare.
21556 Cope with the underlying == type case, which is not possible to
21559 (Expression.ConvertNumericExplicit): Perform comparissions of
21560 the type using the underlying type in the case of an enumeration
21561 rather than using the enumeration type for the compare.
21563 * driver.cs: If the user does not supply an extension, assume .exe
21565 * cs-parser.jay (if_statement): Rewrote so that we can track the
21566 location for the if statement.
21568 * expression.cs (Binary.ConstantFold): Only concat strings when
21569 the operation is "+", not everything ;-)
21571 * statement.cs (Statement.EmitBoolExpression): Take a location
21573 (If, While, Do): Track location.
21575 * expression.cs (Binary.ResolveOperator): In the object + string
21576 case, I was missing a call to ConvertImplicit
21578 2002-02-25 Ravi Pratap <ravi@ximian.com>
21580 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
21581 Location arguments. Ensure we use RootContext.LookupType to do our work
21582 and not try to do a direct Type.GetType and ModuleBuilder.GetType
21584 * interface.cs (PopulateMethod): Handle the type of the parameter being
21587 * expression.cs (Invocation.BetterFunction): Handle the case when we
21588 have a params method with no fixed arguments and a call is made with no
21591 2002-02-25 Miguel de Icaza <miguel@ximian.com>
21593 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
21594 the verbatim-string-literal
21596 * support.cs (InternalParameters.ParameterModifier): handle null
21598 (InternalParameters.ParameterType): ditto.
21600 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
21601 duplicating the name of the variable parameter.
21602 (GetParameterByName): Fix bug where we were not looking up array
21603 paramters if they were the only present (thanks Paolo!).
21604 (GetParameterInfo): We only have an empty set of types if both
21605 fixed and array are set to null.
21606 (GetParameterInfo-idx): Handle FixedParameter == null
21608 * cs-parser.jay: Handle the case where there is no catch
21609 statements (missing null test).
21611 2002-02-22 Miguel de Icaza <miguel@ximian.com>
21613 * driver.cs (MainDriver): Be conservative on our command line
21616 Catch DirectoryNotFoundException when calling GetFiles.
21618 (SplitPathAndPattern): Used to split the input specification into
21619 a path and a pattern that we can feed to Directory.GetFiles.
21621 2002-02-21 Miguel de Icaza <miguel@ximian.com>
21623 * statement.cs (Fixed): Implement the last case of the Fixed
21624 statement (string handling).
21626 * expression.cs (StringPtr): New class used to return a char * to
21627 a string; Used by the Fixed statement.
21629 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
21631 * expression.cs (Binary.ResolveOperator): Remove redundant
21632 MemberLookup pn parent type.
21633 Optimize union call, we do not need a union if the types are the same.
21634 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
21637 Specialize the use of MemberLookup everywhere, instead of using
21638 the default settings.
21640 (StackAlloc): Implement stackalloc keyword.
21642 * cs-parser.jay: Add rule to parse stackalloc.
21644 * driver.cs: Handle /h, /help, /?
21646 * expression.cs (MakeByteBlob): Removed the hacks we had in place
21647 before we supported unsafe code.
21649 * makefile: add --unsafe to the self compilation of mcs.
21651 2002-02-20 Miguel de Icaza <miguel@ximian.com>
21653 * expression.cs (PointerArithmetic): New class that is used to
21654 perform pointer arithmetic.
21655 (Binary.Resolve): Handle pointer arithmetic
21656 Handle pointer comparission.
21657 (ArrayPtr): Utility expression class that is used to take the
21658 address of an array.
21660 (ElementAccess): Implement array access for pointers
21662 * statement.cs (Fixed): Implement fixed statement for arrays, we
21663 are missing one more case before we are done.
21665 * expression.cs (Indirection): Implement EmitAssign and set the
21666 ExprClass to Variable. This allows pointer dereferences to be
21667 treated as variables, and to have values assigned to them.
21669 * ecore.cs (Expression.StoreFromPtr): New utility function to
21670 store values dereferencing.
21672 2002-02-20 Ravi Pratap <ravi@ximian.com>
21674 * expression.cs (Binary.ResolveOperator): Ensure that we are
21675 not trying to operate on a void type - this fixes the reported
21678 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
21679 the parent implementation is sealed.
21681 * ../errors/cs0239.cs : Add.
21683 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
21685 * typemanager.cs (unverifiable_code_type): Corresponds to
21686 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
21687 which have unsafe code in them.
21689 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
21692 2002-02-19 Miguel de Icaza <miguel@ximian.com>
21694 * cs-tokenizer.cs: Add support for @"litreal strings"
21696 Make tokenizer accept pre-processor directives
21697 on any column (remove the old C-like limitation).
21699 * rootcontext.cs (EmitCode): Emit any global attributes.
21700 (AddGlobalAttributes): Used to keep track of assembly attributes.
21702 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
21704 * cs-parser.jay: Add support for global attributes.
21706 2002-02-17 Miguel de Icaza <miguel@ximian.com>
21708 * expression.cs (Indirection): New helper class. Unary will
21709 create Indirection classes to be able to implement the
21710 IMemoryLocation interface on it.
21712 2002-02-16 Miguel de Icaza <miguel@ximian.com>
21714 * cs-parser.jay (fixed_statement): reference the right statement.
21716 * statement.cs (Fixed.Emit): Finish implementing the fixed
21717 statement for the &x case.
21719 2002-02-14 Miguel de Icaza <miguel@ximian.com>
21721 * class.cs (Property.Define, Method.Define): Remove newslot when
21724 * modifiers.cs: My use of NewSlot when `Abstract' was set was
21725 wrong. NewSlot should only be used if the `new' keyword is present.
21727 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
21728 locating our system dir. Sorry about this.
21730 2002-02-13 Miguel de Icaza <miguel@ximian.com>
21732 * driver.cs (GetSystemDir): Compute correctly the location of our
21733 system assemblies. I was using the compiler directory instead of
21734 the library directory.
21736 2002-02-13 Ravi Pratap <ravi@ximian.com>
21738 * expression.cs (BetterFunction): Put back in what Miguel commented out
21739 since it is the correct fix. The problem is elsewhere ;-)
21741 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
21742 parameters of the parms method are themselves compatible or not !
21744 (StandardConversionExists): Fix very dangerous bug where we were forgetting
21745 to check that a class implements an interface before saying that an implicit
21746 conversion was allowed. Use ImplementsInterface to do the checking.
21748 2002-02-13 Miguel de Icaza <miguel@ximian.com>
21750 * class.cs (Method.Define): Track whether we are an explicit
21751 implementation or not. And only call DefineMethodOverride if we
21752 are an explicit implementation.
21754 (Property.DefineMethod): Ditto.
21756 2002-02-11 Ravi Pratap <ravi@ximian.com>
21758 * expression.cs (BetterFunction): Catch hideous bug which was
21759 preventing us from detecting ambiguous calls due to implicit casts i.e
21762 2002-01-29 Miguel de Icaza <miguel@ximian.com>
21764 * support.cs (Pair): Remove un-needed method. I figured why I was
21765 getting the error in cs-parser.jay, the variable in a foreach loop
21766 is readonly, and the compiler does not really treat this as a variable.
21768 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
21769 instead of EQUALS in grammar.
21771 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
21773 * expression.cs (Unary.DoResolve): Check whether the argument is
21776 2002-01-28 Miguel de Icaza <miguel@ximian.com>
21778 * support.cs: Api for Pair to set a value. Despite the fact that
21779 the variables are public the MS C# compiler refuses to compile
21780 code that accesses the field if the variable is part of a foreach
21783 * statement.cs (Fixed): Begin implementation of the fixed
21786 (Block.AddVariable): Return the VariableInfo on success and null
21787 on failure instead of true/false.
21789 * cs-parser.jay (foreach): Catch errors on variables already
21790 defined (we were ignoring this value before) and properly unwind
21791 the block hierarchy
21793 (fixed_statement): grammar for the fixed statement.
21795 2002-01-25 Miguel de Icaza <miguel@ximian.com>
21797 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
21798 pointer types to be incretemented.
21800 (SizeOf): Implement.
21802 * cs-parser.jay (pointer_member_access): Implement
21803 expr->IDENTIFIER production.
21805 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
21806 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
21809 (Unary): Implement indirection.
21811 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
21812 use in non-unsafe context).
21814 (SimpleName.DoResolve): Check for pointers in field access on safe
21817 (Expression.LoadFromPtr): Factor the load-indirect code in this
21818 function. This was duplicated in UnboxCast and ParameterReference
21820 2002-01-24 Miguel de Icaza <miguel@ximian.com>
21822 * expression.cs (ComposedCast): report an error if a pointer cast
21823 is used in a safe region.
21825 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
21826 pointer type casts in unsafe context.
21828 * codegen.cs (EmitContext): Set up IsUnsafe.
21830 * cs-parser.jay (non_expression_type): Add productions for pointer
21833 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
21834 code. We should not use force into static mode if the method is
21835 not virtual. Fixes bug in MIS
21837 * statement.cs (Do.Emit, While.Emit, For.Emit,
21838 Statement.EmitBoolExpression): Add support to Do and While to
21839 propagate infinite loop as `I do return' semantics.
21841 Improve the For case to also test for boolean constants.
21843 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
21844 to the list of attributes we can add.
21846 Remove `EmitContext' argument.
21848 * class.cs (Method.Define): Apply parameter attributes.
21849 (Constructor.Define): Apply parameter attributes.
21850 (MethodCore.LabelParameters): Move here the core of labeling
21853 * support.cs (ReflectionParameters.ParameterModifier,
21854 InternalParameters.ParameterModifier): Use IsByRef on the type and
21855 only return the OUT bit for these parameters instead of in/out/ref
21858 This is because I miss-understood things. The ParameterInfo.IsIn
21859 and IsOut represent whether the parameter has the [In] and [Out]
21862 2002-01-22 Miguel de Icaza <miguel@ximian.com>
21864 * ecore.cs (FieldExpr.Emit): Release temporaries.
21866 * assign.cs (LocalTemporary.Release): new function.
21868 * codegen.cs (EmitContext.GetTemporaryStorage,
21869 EmitContext.FreeTemporaryStorage): Rework the way we deal with
21870 temporary storage. Now we can "put back" localbuilders when we
21873 2002-01-21 Miguel de Icaza <miguel@ximian.com>
21875 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
21876 need to make a copy of the variable to generate verifiable code.
21878 2002-01-19 Miguel de Icaza <miguel@ximian.com>
21880 * driver.cs: Compute dynamically the system directory.
21882 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
21883 Slower, but more generally useful. Used by the abstract
21884 registering implementation.
21886 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
21887 the rules for the special rule on Type/instances. First check if
21888 we have the same name, and if so, try that special static path
21889 rather than the instance path.
21891 2002-01-18 Miguel de Icaza <miguel@ximian.com>
21893 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
21896 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
21897 Enum, ValueType, Delegate or Array for non-corlib compiles.
21899 * cs-tokenizer.cs: Catch long identifiers (645)
21901 * typemanager.cs (IndexerPropetyName): Ravi never tested this
21904 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
21905 fix, we were returning too early, so we were not registering
21906 pending methods from abstract classes.
21908 Do not register pending methods if the class is abstract.
21910 * expression.cs (Conditional.DoResolve): Report circular implicit
21911 conversions when we neecd to compute it for conditional
21914 (Is.DoResolve): If the expression is always of the provided type,
21915 flag warning 183. If the expression can not ever be of the
21916 provided type flag warning 184.
21918 * class.cs: Catch 169 as well.
21920 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
21923 2002-01-18 Nick Drochak <ndrochak@gol.com>
21925 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
21927 2002-01-17 Miguel de Icaza <miguel@ximian.com>
21929 * interface.cs: (PopulateMethod): Check for pointers being defined
21930 only if the unsafe context is active.
21931 (PopulateProperty): ditto.
21932 (PopulateIndexer): ditto.
21934 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
21935 specified. If pointers are present, make sure that they are
21936 present in an unsafe context.
21937 (Constructor, Constructor.Define): ditto.
21938 (Field, Field.Define): ditto.
21939 (Property, Property.Define): ditto.
21940 (Event, Event.Define): ditto.
21942 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
21943 hashtable if there are classes or structs defined.
21945 * expression.cs (LocalVariableReference.DoResolve): Simplify this
21946 code, as the constant resolution moved.
21948 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
21949 the metadata, so we can flag error 133.
21951 * decl.cs (MemberCore.UnsafeOK): New function to test that a
21952 pointer is being declared in an unsafe context.
21954 2002-01-16 Miguel de Icaza <miguel@ximian.com>
21956 * modifiers.cs (Modifiers.Check): Require a Location argument.
21957 Report error 227 for Unsafe use.
21959 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
21961 * statement.cs (For.Emit): If the test is null, then report that
21962 we do `return', as we wont reach anything afterwards.
21964 (Switch.SwitchGoverningType): Track the expression that matched
21967 * driver.cs: Allow negative numbers as an error code to flag.
21969 * cs-parser.jay: Handle 1551.
21971 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
21973 2002-01-15 Miguel de Icaza <miguel@ximian.com>
21975 * cs-parser.jay: Report 1518 (type declaration can only contain
21976 class, struct, interface, enum or delegate)
21978 (switch_label): Report 1523 (keywords `case' or `default' must
21981 (opt_switch_sections): Report 1522 (empty switch)
21983 * driver.cs: Report 1515 (response file specified multiple times)
21984 Report 1516 (Source file specified multiple times).
21986 * expression.cs (Argument.Resolve): Signal 1510
21988 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
21989 access not allowed in static code)
21991 2002-01-11 Ravi Pratap <ravi@ximian.com>
21993 * typemanager.cs (IsPointerType): Utility method which we are going
21996 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
21997 the object type, so we take care of that.
21999 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
22001 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
22002 added to non-params parameters :-)
22004 * typemanager.cs (CSharpName): Include 'void' type too.
22006 (void_ptr_type): Include in the set of core types.
22008 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
22011 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
22014 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
22015 completely forgotten about it.
22017 2002-01-10 Ravi Pratap <ravi@ximian.com>
22019 * cs-parser.jay (pointer_type): Add. This begins our implementation
22020 of parsing rules for unsafe code.
22022 (unsafe_statement): Implement.
22024 (embedded_statement): Modify to include the above.
22026 * statement.cs (Unsafe): Implement new class for unsafe blocks.
22028 * codegen.cs (EmitContext.InUnsafe): Add. This determines
22029 if the current context is an unsafe one.
22031 * cs-parser.jay (local_variable_pointer_type): Since local variable types
22032 are handled differently, we need separate rules for them.
22034 (local_variable_declaration): Update to use local_variable_pointer_type
22035 to allow variable declarations of unmanaged pointer types.
22037 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
22038 in unsafe contexts.
22040 * ../errors/cs0214.cs : Add.
22042 2002-01-16 Nick Drochak <ndrochak@gol.com>
22044 * makefile: remove 'response' file when cleaning.
22046 2002-01-15 Miguel de Icaza <miguel@ximian.com>
22048 * cs-parser.jay: Report 1524.
22050 2002-01-14 Miguel de Icaza <miguel@ximian.com>
22052 * typemanager.cs (RegisterMethod): drop checking if we have
22053 registered this from here
22055 2002-01-12 Miguel de Icaza <miguel@ximian.com>
22057 * class.cs (Method.EmitDestructor): Implement calling our base
22060 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
22061 value of InFinally.
22063 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
22064 this routine and will wrap the call in a try/catch block. Deal
22067 2002-01-11 Miguel de Icaza <miguel@ximian.com>
22069 * ecore.cs (Expression.MemberLookup): instead of taking a
22070 parameter `same_type' that was used to tell whether we could
22071 access private members we compute our containing type from the
22074 (FieldExpr): Added partial support for volatile fields. This does
22075 not work for volatile fields exposed from assemblies, as I can not
22076 figure out how to extract the modreq from it.
22078 Updated all the source files to use this.
22080 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
22081 because it is referenced by MemberLookup very often.
22083 2002-01-09 Ravi Pratap <ravi@ximian.com>
22085 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
22086 TypeBuilder.GetCustomAttributes to retrieve what we need.
22088 Get rid of redundant default_member_attr_type as this is the same as
22089 default_member_type which already exists.
22091 * interface.cs, attribute.cs : Update accordingly.
22093 2002-01-08 Miguel de Icaza <miguel@ximian.com>
22095 * typemanager.cs: Enable IndexerPropertyName again. It does not
22096 work for TYpeBuilders though. Ravi, can you please fix this?
22098 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
22100 * expression.cs (Argument.Emit): Handle the case of ref objects
22101 being passed to ref functions;
22103 (ParameterReference.EmitLoad): Loads the content of the pointer
22104 without dereferencing.
22106 2002-01-07 Miguel de Icaza <miguel@ximian.com>
22108 * cs-tokenizer.cs: Implemented the pre-processing expressions.
22110 2002-01-08 Ravi Pratap <ravi@ximian.com>
22112 * class.cs (Indexer.DefineMethod): Incorporate the interface
22113 type in the name of the method if we are doing explicit interface
22116 * expression.cs (ConversionExists): Remove as it is completely obsolete.
22118 (BetterConversion): Fix extremely trivial bug where we were referring to
22119 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
22122 * ../errors/bug16.cs : Add although we have fixed it.
22124 2002-01-07 Miguel de Icaza <miguel@ximian.com>
22126 * expression.cs (BaseIndexer): Begin implementation.
22128 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
22130 * cs-parser.jay (indexer_declarator): Use qualified_identifier
22131 production directly to remove a shift/reduce, and implement
22132 explicit interface implementation.
22134 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
22135 after a floating point suffix.
22137 * expression.cs (DoNumericPromotions): Improved the conversion for
22138 uint/uint. If we have a constant, we avoid doing a typecast to a
22141 * class.cs (Indexer): Implement explicit interface implementation
22144 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
22146 * class.cs: make the default instance constructor public and hidebysig.
22148 2001-01-03 Ravi Pratap <ravi@ximian.com>
22150 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
22151 so we can call it from elsewhere.
22153 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
22154 we emit it internally if the class has a defined indexer; otherwise the user
22155 emits it by decorating the class definition with the DefaultMemberAttribute.
22157 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
22158 attribute is not used on a type which defines an indexer.
22160 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
22161 character when we skip whitespace.
22163 * ../errors/cs0646.cs : Add.
22165 2002-01-03 Miguel de Icaza <miguel@ximian.com>
22167 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
22170 * makefile: Add practical target `mcs3.exe' which builds the third
22171 generation compiler.
22173 * expression.cs (New): Fix structures constructor calling.
22175 * class.cs (Property, Method, Indexer): Emit Final flag on the
22176 method if we are an interface implementation and we are not
22179 * ecore.cs (PropertyExpr): New public field `IsBase', tells
22180 whether this property is referencing a `base' method.
22182 * expression.cs (Invocation.EmitCall): take an extra argument:
22183 is_base, this is used to determine whether the `call' or
22184 `callvirt' opcode should be used.
22187 * delegate.cs: update EmitCall.
22189 * class.cs (Method.Define): Set NewSlot for the cases where we are
22190 not implementing an interface method.
22192 (Property.Define): ditto.
22194 2002-01-02 Miguel de Icaza <miguel@ximian.com>
22196 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
22197 'r'. Allows mcs to parse itself fully.
22199 2002-01-02 Ravi Pratap <ravi@ximian.com>
22201 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
22202 of the number of initializers that require the InitializeArray method.
22204 (CheckIndices): Store the Expression in all cases - not the plain value. Also
22205 update the above field where necessary.
22207 (MakeByteBlob): Update accordingly.
22209 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
22212 (EmitDynamicInitializers): Update in accordance with the new optimization.
22214 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
22215 same OpCode applies.
22217 * cs-parser.jay : Fix some glaring errors I introduced.
22219 2002-01-01 Ravi Pratap <ravi@ximian.com>
22221 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
22222 so that we can check for name clashes there too.
22224 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
22225 for interface indexers.
22227 * interfaces.cs (Define): Emit the default member attribute.
22229 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
22230 variable was being referred to while setting the value ;-)
22232 2002-01-01 Miguel de Icaza <miguel@ximian.com>
22234 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
22235 byte-by-byte information when we know the data is zero.
22237 Make the block always a multiple of 4, because
22238 DefineInitializedData has a bug.
22240 * assign.cs: Fix, we should assign from the temporary, not from
22243 * expression.cs (MakeByteBlob): Fix my incorrect code.
22245 2001-12-31 Miguel de Icaza <miguel@ximian.com>
22247 * typemanager.cs (EnumToUnderlying): This function is used to get
22248 the underlying type from an enumeration, because it does not
22251 * constant.cs: Use the I4_S form for values between -128 and 127.
22253 * statement.cs (Block.LookupLabel): Looks up a label.
22254 (Block): Drop support for labeled blocks.
22256 (LabeledStatement): New kind of statement that represents a label
22259 (Goto): Finally implement this bad boy.
22261 * cs-parser.jay: Update to reflect new mechanism to implement
22264 2001-12-30 Miguel de Icaza <miguel@ximian.com>
22266 * codegen.cs (EmitContext.This): a codegen property that keeps the
22267 a single instance of this instead of creating many different this
22270 * delegate.cs (Delegate.DoResolve): Update to use the property;
22272 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
22274 * expression.cs (BaseAccess.DoResolve): Ditto.
22276 2001-12-29 Ravi Pratap <ravi@ximian.com>
22278 * typemanager.cs (methodimpl_attr_type): Add to hold the type
22279 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
22281 (InitCoreTypes): Update accordingly.
22283 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
22284 so we can quickly store the state.
22286 (ApplyAttributes): Set the correct implementation flags
22287 for InternalCall methods.
22289 2001-12-29 Miguel de Icaza <miguel@ximian.com>
22291 * expression.cs (EmitCall): if a method is not virtual, then do
22292 not use callvirt on it.
22294 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
22295 user defined stuff) requires the use of stobj, which takes an
22296 address on the stack instead of an array and an index. So emit
22297 the Ldelema operation for it.
22299 (EmitStoreOpcode): Use stobj for valuetypes.
22301 (UnaryMutator.EmitCode): Use the right 1 value depending on
22302 whether we are dealing with int64/uint64, float or doubles.
22304 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
22305 constructors that I implemented last night.
22307 (Constructor.IsDefault): Fix to work properly for static
22310 * cs-parser.jay (CheckDef): report method signature errors.
22311 Update error number 103 to be 132.
22313 * decl.cs: New AdditionResult enumeration value: MethodExists.
22314 Although we do this check for methods later on in the semantic
22315 analysis, catching repeated default constructors is so easy that
22316 we catch these here.
22318 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
22321 (ParameterReference.EmitAssign, Emit): handle
22324 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
22325 (ArrayAccess.EmitStoreOpcode): ditto.
22327 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
22329 * expression.cs (MakeByteBlob): Complete all the missing types
22330 (uint, short, ushort, byte, sbyte)
22332 * class.cs: Only init instance field initializers on instance
22335 Rename `constructors' to instance_constructors.
22337 (TypeContainer.AddConstructor): Only add constructors to the list
22338 if it is not static.
22340 Make sure that we handle default_static_constructor independently
22341 everywhere where we handle instance_constructors
22343 2001-12-28 Miguel de Icaza <miguel@ximian.com>
22345 * class.cs: Do not lookup or create a base initializer for a
22346 static constructor.
22348 (ConstructorInitializer.Resolve): use the proper type to lookup
22351 * cs-parser.jay: Report error 1585 (modifiers between type and name).
22353 * enum.cs, interface.cs: Remove CloseType, this is taken care by
22356 * decl.cs: CloseType is now an virtual method, the default
22357 implementation just closes this type.
22359 2001-12-28 Ravi Pratap <ravi@ximian.com>
22361 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
22362 to PreserveSig by default. Also emit HideBySig on such methods.
22364 Basically, set the defaults to standard values.
22366 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
22367 argument, if candidate is better, it can't be worse than the best !
22369 (Invocation): Re-write bits to differentiate between methods being
22370 applicable in their expanded form and their normal form - for params
22373 Get rid of use_standard everywhere as only standard conversions are allowed
22374 in overload resolution.
22376 More spec conformance.
22378 2001-12-27 Miguel de Icaza <miguel@ximian.com>
22380 * driver.cs: Add --timestamp, to see where the compiler spends
22383 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
22384 `this' in static code.
22386 (SimpleName.DoResolve): Implement in terms of a helper function
22387 that allows static-references to be passed upstream to
22390 (Expression.ResolveWithSimpleName): Resolve specially simple
22391 names when called by MemberAccess to implement the special
22394 (Expression.ImplicitReferenceConversion): Handle conversions from
22395 Null to reference types before others, as Null's type is
22398 * expression.cs (Invocation.EmitCall): Handle the special case of
22399 calling methods declared on a reference type from a ValueType
22400 (Base classes System.Object and System.Enum)
22402 (MemberAccess.Resolve): Only perform lookups on Enumerations if
22403 the left hand side is a TypeExpr, not on every enumeration.
22405 (Binary.Resolve): If types are reference types, then do a cast to
22406 object on operators != and == of both arguments.
22408 * typemanager.cs (FindMembers): Extract instance and static
22409 members if requested.
22411 * interface.cs (PopulateProperty): Use void_type instead of null
22412 as the return type for the setter method.
22414 (PopulateIndexer): ditto.
22416 2001-12-27 Ravi Pratap <ravi@ximian.com>
22418 * support.cs (ReflectionParameters): Fix minor bug where we
22419 were examining the wrong parameter for the ParamArray attribute.
22421 Cope with requests for the type of the parameter at position
22422 greater than the params parameter's. We now return the element
22423 type of the params array as that makes more sense.
22425 * expression.cs (Invocation.IsParamsMethodApplicable): Update
22426 accordingly as we no longer have to extract the element type
22429 (Invocation.OverloadResolve): Update.
22431 2001-12-27 Miguel de Icaza <miguel@ximian.com>
22433 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
22434 against IEnumerator, test whether the return value is a descendant
22435 of the IEnumerator interface.
22437 * class.cs (Indexer.Define): Use an auxiliary method to implement
22438 the other bits of the method definition. Begin support for
22439 explicit interface implementation.
22441 (Property.DefineMethod): Use TypeManager.void_type instead of null
22442 for an empty return value.
22444 2001-12-26 Miguel de Icaza <miguel@ximian.com>
22446 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
22447 dealing with a FieldExpr which is composed of a FieldBuilder, in
22448 the code path we did extract the constant, but we should have
22449 obtained the underlying value to be able to cast it (otherwise we
22450 end up in an infinite loop, this is what Ravi was running into).
22452 (ArrayCreation.UpdateIndices): Arrays might be empty.
22454 (MemberAccess.ResolveMemberAccess): Add support for section
22455 14.5.4.1 that deals with the special case of E.I when E is a type
22456 and something else, that I can be a reference to a static member.
22458 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
22459 handle a particular array type to create byte blobs, it is just
22460 something we dont generate byteblobs for.
22462 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
22465 * location.cs (Push): remove the key from the hashtable that we
22466 are about to add. This happens for empty files.
22468 * driver.cs: Dispose files after we have parsed them.
22470 (tokenize): new function that only runs the tokenizer on its
22471 input, for speed testing.
22473 2001-12-26 Ravi Pratap <ravi@ximian.com>
22475 * class.cs (Event.Define): Define the private field only if there
22476 are no accessors defined.
22478 * expression.cs (ResolveMemberAccess): If there is no associated
22479 field with the event, that means we have an event defined with its
22480 own accessors and we should flag error cs0070 since transforming
22481 ourselves into a field is not valid in that case.
22483 * ecore.cs (SimpleName.DoResolve): Same as above.
22485 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
22486 and charset to sane values.
22488 2001-12-25 Ravi Pratap <ravi@ximian.com>
22490 * assign.cs (DoResolve): Perform check on events only if they
22491 are being accessed outside the declaring type.
22493 * cs-parser.jay (event_declarations): Update rules to correctly
22494 set the type of the implicit parameter etc.
22496 (add_accessor, remove_accessor): Set current local parameters.
22498 * expression.cs (Binary): For delegate addition and subtraction,
22499 cast the return value from the method into the appropriate delegate
22502 2001-12-24 Ravi Pratap <ravi@ximian.com>
22504 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
22505 of these as the workaround is unnecessary.
22507 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
22508 delegate data - none of that is needed at all.
22510 Re-write bits to extract the instance expression and the delegate method
22513 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
22516 * attribute.cs (ApplyAttributes): New method to take care of common tasks
22517 of attaching attributes instead of duplicating code everywhere.
22519 * everywhere : Update code to do attribute emission using the above method.
22521 2001-12-23 Miguel de Icaza <miguel@ximian.com>
22523 * expression.cs (IsParamsMethodApplicable): if there are not
22524 parameters, return immediately.
22526 * ecore.cs: The 0 literal can be implicity converted to an enum
22529 (SimpleName.DoResolve): First lookup the type, then lookup the
22532 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
22533 want to get its address. If the InstanceExpression is not
22534 addressable, store the result in a temporary variable, then get
22537 * codegen.cs: Only display 219 errors on warning level or above.
22539 * expression.cs (ArrayAccess): Make it implement the
22540 IMemoryLocation interface.
22542 (Binary.DoResolve): handle the operator == (object a, object b)
22543 and operator != (object a, object b) without incurring into a
22544 BoxedCast (because 5 != o should never be performed).
22546 Handle binary enumerator operators.
22548 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
22549 value type, otherwise use Ldelem_ref.
22551 Use precomputed names;
22553 (AddressOf): Implement address of
22555 * cs-parser.jay (labeled_statement): Fix recursive block
22556 addition by reworking the production.
22558 * expression.cs (New.DoEmit): New has a special case:
22560 If we are dealing with a ValueType, we have a few
22561 situations to deal with:
22563 * The target of New is a ValueType variable, that is
22564 easy, we just pass this as the variable reference
22566 * The target of New is being passed as an argument,
22567 to a boxing operation or a function that takes a
22570 In this case, we need to create a temporary variable
22571 that is the argument of New.
22574 2001-12-23 Ravi Pratap <ravi@ximian.com>
22576 * rootcontext.cs (LookupType): Check that current_type is not null before
22577 going about looking at nested types.
22579 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
22580 not implement the IAssignMethod interface any more.
22582 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
22583 where we tranform them into FieldExprs if they are being resolved from within
22584 the declaring type.
22586 * ecore.cs (SimpleName.DoResolve): Do the same here.
22588 * assign.cs (DoResolve, Emit): Clean up code considerably.
22590 * ../errors/bug10.cs : Add.
22592 * ../errors/cs0070.cs : Add.
22594 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
22596 * assign.cs : Get rid of EventIsLocal everywhere.
22598 2001-12-23 Miguel de Icaza <miguel@ximian.com>
22600 * ecore.cs (ConvertIntLiteral): finished the implementation.
22602 * statement.cs (SwitchLabel): Convert the value we are using as a
22603 key before looking up the table.
22605 2001-12-22 Miguel de Icaza <miguel@ximian.com>
22607 * codegen.cs (EmitTopBlock): Require a Location argument now.
22609 * cs-parser.jay (constructor_declarator): We need to setup
22610 current_local_parameters before we parse the
22611 opt_constructor_initializer, to allow the variables to be bound
22612 to the constructor arguments.
22614 * rootcontext.cs (LookupType): First lookup nested classes in our
22615 class and our parents before we go looking outside our class.
22617 * expression.cs (ConstantFold): Extract/debox the values at the
22620 * rootcontext.cs (EmitCode): Resolve the constants first before we
22621 resolve the types. This is not really needed, but it helps debugging.
22623 * statement.cs: report location.
22625 * cs-parser.jay: pass location to throw statement.
22627 * driver.cs: Small bug fix.
22629 * report.cs: Updated format to be 4-zero filled digits.
22631 2001-12-22 Ravi Pratap <ravi@ximian.com>
22633 * expression.cs (CheckIndices): Fix minor bug where the wrong
22634 variable was being referred to ;-)
22636 (DoEmit): Do not call EmitStaticInitializers when the
22637 underlying type is System.Object.
22639 2001-12-21 Ravi Pratap <ravi@ximian.com>
22641 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
22642 and do the usual workaround for SRE.
22644 * class.cs (MyEventBuilder.EventType): New member to get at the type
22645 of the event, quickly.
22647 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
22649 * assign.cs (Assign.DoResolve): Handle the case when the target
22650 is an EventExpr and perform the necessary checks.
22652 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
22655 (SimpleName.MemberStaticCheck): Include check for EventExpr.
22657 (EventExpr): Set the type in the constructor itself since we
22658 are meant to be born fully resolved.
22660 (EventExpr.Define): Revert code I wrote earlier.
22662 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
22663 instance expression is null. The instance expression is a This in that case
22664 or a null, depending on whether it is a static method or not.
22666 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
22667 refers to more than one method.
22669 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
22670 and accordingly flag errors.
22672 2001-12-21 Miguel de Icaza <miguel@ximian.com>
22674 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
22676 2001-12-22 Miguel de Icaza <miguel@ximian.com>
22678 * location.cs (ToString): Provide useful rutine.
22680 2001-12-21 Miguel de Icaza <miguel@ximian.com>
22682 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
22683 objects, return the actual integral boxed.
22685 * statement.cs (SwitchLabel): define an ILLabel for each
22688 (Switch.CheckSwitch): If the value is a Literal, extract
22689 the underlying literal.
22691 Also in the unused hashtable we had, add the SwitchLabel so we can
22692 quickly look this value up.
22694 * constant.cs: Implement a bunch of new constants. Rewrite
22695 Literal based on this. Made changes everywhere to adapt to this.
22697 * expression.cs (Expression.MakeByteBlob): Optimize routine by
22698 dereferencing array only once, and also copes with enumrations.
22700 bytes are two bytes wide, not one.
22702 (Cast): Perform constant conversions.
22704 * ecore.cs (TryImplicitIntConversion): Return literals instead of
22705 wrappers to the literals here.
22707 * expression.cs (DoNumericPromotions): long literals can converted
22708 to ulong implicity (this is taken care of elsewhere, but I was
22709 missing this spot).
22711 * ecore.cs (Expression.Literalize): Make the return type Literal,
22712 to improve type checking.
22714 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
22716 2001-12-20 Miguel de Icaza <miguel@ximian.com>
22718 * literal.cs: Revert code from ravi that checked the bounds. The
22719 bounds are sane by the definition of the type itself.
22721 * typemanager.cs: Fix implementation of ImplementsInterface. We
22722 need to actually look up in our parent hierarchy for interfaces
22725 * const.cs: Use the underlying type for enumerations
22727 * delegate.cs: Compute the basename for the delegate creation,
22728 that should fix the delegate test case, and restore the correct
22729 Type Lookup semantics in rootcontext
22731 * rootcontext.cs: Revert Ravi's last patch. The correct way of
22732 referencing a nested type with the Reflection API is using the "+"
22735 * cs-parser.jay: Do not require EOF token at the end.
22737 2001-12-20 Ravi Pratap <ravi@ximian.com>
22739 * rootcontext.cs (LookupType): Concatenate type names with
22740 a '.' instead of a '+' The test suite passes again.
22742 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
22743 field of the enumeration.
22745 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
22746 the case when the member is an EventExpr.
22748 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
22749 static has an associated instance expression.
22751 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
22753 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
22755 * class.cs (Event.Define): Register event and perform appropriate checks
22758 We define the Add and Remove methods even if the use provides none because
22759 in that case, we provide default implementations ourselves.
22761 Define a private field of the type of the event. This is done by the CSC compiler
22762 and we should be doing it too ;-)
22764 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
22765 More methods we use in code we generate.
22767 (multicast_delegate_type, delegate_type): Two separate types since the distinction
22770 (InitCoreTypes): Update accordingly for the above.
22772 * class.cs (Event.Emit): Generate code for default accessors that we provide
22774 (EmitDefaultMethod): Do the job in the above.
22776 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
22779 2001-12-20 Miguel de Icaza <miguel@ximian.com>
22781 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
22782 builders even if we were missing one.
22784 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
22785 pass the Basename as our class name instead of the Name. The
22786 basename will be correctly composed for us.
22788 * parameter.cs (Paramters): Now takes a Location argument.
22790 * decl.cs (DeclSpace.LookupType): Removed convenience function and
22791 make all the code call directly LookupType in RootContext and take
22792 this chance to pass the Location information everywhere.
22794 * Everywhere: pass Location information.
22796 2001-12-19 Miguel de Icaza <miguel@ximian.com>
22798 * class.cs (Constructor.Define): Updated way of detecting the
22799 length of the parameters.
22801 (TypeContainer.DefineType): Use basename as the type name for
22804 (TypeContainer.Define): Do not recursively define types here, as
22805 definition is taken care in order by the RootContext.
22807 * tree.cs: Keep track of namespaces in a per-file basis.
22809 * parameter.cs (Parameter.ComputeSignature): Update to use
22812 (Parameters.GetSignature): ditto.
22814 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
22815 instead of a TypeContainer.
22817 (Interface.SemanticAnalysis): Use `this' instead of our parent to
22818 resolve names. Because we need to be resolve in our context, not
22821 * driver.cs: Implement response files.
22823 * class.cs (TypeContainer.DefineType): If we are defined, do not
22824 redefine ourselves.
22826 (Event.Emit): Emit the code for add/remove handlers.
22827 (Event.Define): Save the MethodBuilders for add/remove.
22829 * typemanager.cs: Use pair here too.
22831 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
22832 DictionaryEntry requires the first argument to be non-null.
22834 (enum_declaration): Compute full name for registering the
22837 (delegate_declaration): Instead of using
22838 formal_parameter_list, use opt_formal_parameter_list as the list
22841 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
22842 (EventParsing): New property that controls whether `add' and
22843 `remove' are returned as tokens or identifiers (for events);
22845 2001-12-19 Ravi Pratap <ravi@ximian.com>
22847 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
22848 use MyEventBuilder only and let it wrap the real builder for us.
22850 (MyEventBuilder): Revamp constructor etc.
22852 Implement all operations that we perform on EventBuilder in precisely the same
22855 (FindMembers): Update to use the EventBuilder member.
22857 (Event.Emit): Update accordingly.
22859 2001-12-18 Ravi Pratap <ravi@ximian.com>
22861 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
22862 by calling the appropriate methods.
22864 (GetCustomAttributes): Make stubs as they cannot possibly do anything
22867 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
22869 2001-12-17 Ravi Pratap <ravi@ximian.com>
22871 * delegate.cs (Delegate.Populate): Check that the return type
22872 and various parameters types are indeed accessible.
22874 * class.cs (Constructor.Define): Same here.
22876 (Field.Define): Ditto.
22878 (Event.Define): Ditto.
22880 (Operator.Define): Check that the underlying Method defined itself
22881 correctly - so it's MethodBuilder should not be null.
22883 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
22884 expression happens to be null.
22886 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
22887 members but as of now we don't seem to be able to do anything really useful with it.
22889 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
22890 not the EventBuilder.
22892 2001-12-18 Miguel de Icaza <miguel@ximian.com>
22894 * cs-tokenizer.cs: Add support for defines.
22895 Add support for #if, #elif, #else, #endif
22897 (eval_var): evaluates a variable.
22898 (eval): stubbed for evaluating functions.
22900 * cs-parser.jay: Pass the defines information
22902 * driver.cs: Add --define command line option.
22904 * decl.cs: Move MemberCore here.
22906 Make it the base class for DeclSpace. This allows us to catch and
22907 report 108 and 109 for everything now.
22909 * class.cs (TypeContainer.Define): Extract all the members
22910 before populating and emit the warning 108 (new keyword required
22911 to override) instead of having each member implement this.
22913 (MemberCore.Define): New abstract method, we will be using this in
22914 the warning reporting engine in Populate.
22916 (Operator.Define): Adjust to new MemberCore protocol.
22918 * const.cs (Const): This does not derive from Expression, it is a
22919 temporary object we use to create fields, it is a MemberCore.
22921 * class.cs (Method.Define): Allow the entry point to be in a
22924 * driver.cs: Rewrite the argument handler to clean it up a bit.
22926 * rootcontext.cs: Made it just an auxiliary namespace feature by
22927 making everything static.
22929 * driver.cs: Adapt code to use RootContext type name instead of
22932 * delegate.cs: Remove RootContext argument.
22934 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
22937 * class.cs (Event.Define): The lookup can fail.
22939 * cs-tokenizer.cs: Begin implementation of pre-procesor.
22941 * expression.cs: Resolve the this instance before invoking the code.
22943 2001-12-17 Miguel de Icaza <miguel@ximian.com>
22945 * cs-parser.jay: Add a production in element_access that allows
22946 the thing to become a "type" reference. This way we can parse
22947 things like "(string [])" as a type.
22949 Note that this still does not handle the more complex rules of
22953 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
22955 * ecore.cs: (CopyNewMethods): new utility function used to
22956 assemble the list of methods from running FindMembers.
22958 (MemberLookup): Rework FindMembers so that
22960 2001-12-16 Miguel de Icaza <miguel@ximian.com>
22962 * class.cs (TypeContainer): Remove Delegates who fail to be
22965 * delegate.cs (Populate): Verify that we dont get null return
22966 values. TODO: Check for AsAccessible.
22968 * cs-parser.jay: Use basename to emit error 574 (destructor should
22969 have the same name as container class), not the full name.
22971 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
22972 possible representation.
22974 Also implements integer type suffixes U and L.
22976 2001-12-15 Miguel de Icaza <miguel@ximian.com>
22978 * expression.cs (ArrayCreation.DoResolve): We need to do the
22979 argument resolution *always*.
22981 * decl.cs: Make this hold the namespace. Hold the root context as
22983 (LookupType): Move here.
22985 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
22987 * location.cs (Row, Name): Fixed the code, it was always returning
22988 references to the first file.
22990 * interface.cs: Register properties defined through interfaces.
22992 * driver.cs: Add support for globbing on the command line
22994 * class.cs (Field): Make it derive from MemberCore as well.
22997 2001-12-15 Ravi Pratap <ravi@ximian.com>
22999 * class.cs (Event::Define): Check that the type of the event is a delegate
23000 type else flag error #66.
23002 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
23005 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
23006 values of EntryPoint, CharSet etc etc.
23008 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
23010 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
23011 be null and we should ignore this. I am not sure if this is really clean. Apparently,
23012 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
23013 which needs this to do its work.
23015 * ../errors/cs0066.cs : Add.
23017 2001-12-14 Miguel de Icaza <miguel@ximian.com>
23019 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
23022 * class.cs: (MethodSignature.MethodSignature): Removed hack that
23023 clears out the parameters field.
23024 (MemberSignatureCompare): Cleanup
23026 (MemberCore): New base class used to share code between MethodCore
23029 (RegisterRequiredImplementations) BindingFlags.Public requires
23030 either BindingFlags.Instace or Static. Use instance here.
23032 (Property): Refactored code to cope better with the full spec.
23034 * parameter.cs (GetParameterInfo): Return an empty array instead
23037 * class.cs (Property): Abstract or extern properties have no bodies.
23039 * parameter.cs (GetParameterInfo): return a zero-sized array.
23041 * class.cs (TypeContainer.MethodModifiersValid): Move all the
23042 method modifier validation to the typecontainer so we can reuse
23043 this on properties.
23045 (MethodCore.ParameterTypes): return an empty sized array of types.
23047 (Property.Define): Test property modifier validity.
23049 Add tests for sealed/override too.
23051 (Method.Emit): abstract or extern methods have no bodies.
23053 2001-12-14 Ravi Pratap <ravi@ximian.com>
23055 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
23058 (Method::Define, ::Emit): Modify accordingly.
23060 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
23062 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
23064 * makefile: Pass in /unsafe.
23066 2001-12-13 Miguel de Icaza <miguel@ximian.com>
23068 * class.cs (MakeKey): Kill routine.
23070 * class.cs (TypeContainer.Define): Correctly define explicit
23071 method implementations (they require the full interface name plus
23074 * typemanager.cs: Deply the PtrHashtable here and stop using the
23075 lame keys. Things work so much better.
23077 This of course broke everyone who depended on `RegisterMethod' to
23078 do the `test for existance' test. This has to be done elsewhere.
23080 * support.cs (PtrHashtable): A hashtable that avoid comparing with
23081 the object stupid Equals method (because, that like fails all over
23082 the place). We still do not use it.
23084 * class.cs (TypeContainer.SetRequiredInterface,
23085 TypeContainer.RequireMethods): Killed these two routines and moved
23086 all the functionality to RegisterRequiredImplementations.
23088 (TypeContainer.RegisterRequiredImplementations): This routine now
23089 registers all the implementations required in an array for the
23090 interfaces and abstract methods. We use an array of structures
23091 which can be computed ahead of time to reduce memory usage and we
23092 also assume that lookups are cheap as most classes will not
23093 implement too many interfaces.
23095 We also avoid creating too many MethodSignatures.
23097 (TypeContainer.IsInterfaceMethod): Update and optionally does not
23098 clear the "pending" bit if we find that there are problems with
23101 (TypeContainer.VerifyPendingMethods): Update to report errors of
23102 methods that look like implementations but are not.
23104 (TypeContainer.Define): Add support for explicit interface method
23107 2001-12-12 Miguel de Icaza <miguel@ximian.com>
23109 * typemanager.cs: Keep track of the parameters here instead of
23110 being a feature of the TypeContainer.
23112 * class.cs: Drop the registration of parameters here, as
23113 InterfaceMethods are also interface declarations.
23115 * delegate.cs: Register methods with the TypeManager not only with
23116 the TypeContainer. This code was buggy.
23118 * interface.cs: Full registation here.
23120 2001-12-11 Miguel de Icaza <miguel@ximian.com>
23122 * expression.cs: Remove reducer for binary expressions, it can not
23125 * const.cs: Put here the code that used to go into constant.cs
23127 * constant.cs: Put here the code for constants, this is a new base
23128 class for Literals.
23130 * literal.cs: Make Literal derive from Constant.
23132 2001-12-09 Miguel de Icaza <miguel@ximian.com>
23134 * statement.cs (Return.Emit): Report error 157 if the user
23135 attempts to return from a finally block.
23137 (Return.Emit): Instead of emitting a return, jump to the end of
23140 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
23141 LocalBuilder to store the result of the function. ReturnLabel is
23142 the target where we jump.
23145 2001-12-09 Radek Doulik <rodo@ximian.com>
23147 * cs-parser.jay: remember alias in current namespace
23149 * ecore.cs (SimpleName::DoResolve): use aliases for types or
23152 * class.cs (LookupAlias): lookup alias in my_namespace
23154 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
23156 (LookupAlias): lookup alias in this and if needed in parent
23159 2001-12-08 Miguel de Icaza <miguel@ximian.com>
23163 * rootcontext.cs: (ModuleBuilder) Made static, first step into
23164 making things static. I need this to avoid passing the
23165 TypeContainer when calling ParameterType.
23167 * support.cs (InternalParameters.ParameterType): Remove ugly hack
23168 that did string manipulation to compute the type and then call
23169 GetType. Use Parameter.ParameterType instead.
23171 * cs-tokenizer.cs: Consume the suffix for floating values.
23173 * expression.cs (ParameterReference): figure out whether this is a
23174 reference parameter or not. Kill an extra variable by computing
23175 the arg_idx during emission.
23177 * parameter.cs (Parameters.GetParameterInfo): New overloaded
23178 function that returns whether a parameter is an out/ref value or not.
23180 (Parameter.ParameterType): The type of the parameter (base,
23181 without ref/out applied).
23183 (Parameter.Resolve): Perform resolution here.
23184 (Parameter.ExternalType): The full type (with ref/out applied).
23186 * statement.cs (Using.Emit, Using.EmitExpression): Implement
23187 support for expressions on the using statement.
23189 2001-12-07 Miguel de Icaza <miguel@ximian.com>
23191 * statement.cs (Using.EmitLocalVariableDecls): Split the
23192 localvariable handling of the using statement.
23194 (Block.EmitMeta): Keep track of variable count across blocks. We
23195 were reusing slots on separate branches of blocks.
23197 (Try.Emit): Emit the general code block, we were not emitting it.
23199 Check the type of the declaration to be an IDisposable or
23200 something that can be implicity converted to it.
23202 Emit conversions if required.
23204 * ecore.cs (EmptyExpression): New utility class.
23205 (Expression.ImplicitConversionExists): New utility function.
23207 2001-12-06 Miguel de Icaza <miguel@ximian.com>
23209 * statement.cs (Using): Implement.
23211 * expression.cs (LocalVariableReference): Support read only variables.
23213 * statement.cs: Remove the explicit emit for the Leave opcode.
23214 (VariableInfo): Add a readonly field.
23216 2001-12-05 Miguel de Icaza <miguel@ximian.com>
23218 * ecore.cs (ConvCast): new class used to encapsulate the various
23219 explicit integer conversions that works in both checked and
23220 unchecked contexts.
23222 (Expression.ConvertNumericExplicit): Use new ConvCast class to
23223 properly generate the overflow opcodes.
23225 2001-12-04 Miguel de Icaza <miguel@ximian.com>
23227 * statement.cs: The correct type for the EmptyExpression is the
23228 element_type, not the variable type. Ravi pointed this out.
23230 2001-12-04 Ravi Pratap <ravi@ximian.com>
23232 * class.cs (Method::Define): Handle PInvoke methods specially
23233 by using DefinePInvokeMethod instead of the usual one.
23235 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
23236 above to do the task of extracting information and defining the method.
23238 2001-12-04 Ravi Pratap <ravi@ximian.com>
23240 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
23241 of the condition for string type.
23243 (Emit): Move that here.
23245 (ArrayCreation::CheckIndices): Keep string literals in their expression
23248 (EmitDynamicInitializers): Handle strings appropriately.
23250 2001-12-04 Miguel de Icaza <miguel@ximian.com>
23252 * codegen.cs (EmitContext): Replace multiple variables with a
23253 single pointer to the current Switch statement.
23255 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
23258 2001-12-03 Miguel de Icaza <miguel@ximian.com>
23262 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
23265 (Foreach.Emit): Foreach on arrays was not setting
23266 up the loop variables (for break/continue).
23268 (GotoCase): Semi-implented.
23270 2001-12-03 Ravi Pratap <ravi@ximian.com>
23272 * attribute.cs (CheckAttribute): Handle system attributes by using
23273 Attribute.GetAttributes to examine information we need.
23275 (GetValidPlaces): Same here.
23277 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
23279 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
23281 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
23283 (Method::Define): Set appropriate flags if we have a DllImport attribute.
23285 (Method::Emit): Handle the case when we are a PInvoke method.
23287 2001-12-03 Miguel de Icaza <miguel@ximian.com>
23289 * expression.cs: Use ResolveWithSimpleName on compound names.
23291 2001-12-02 Ravi Pratap <ravi@ximian.com>
23293 * constant.cs (EmitConstant): Make sure we resolve the associated expression
23294 before trying to reduce it.
23296 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
23298 * constant.cs (LookupConstantValue): Implement.
23300 (EmitConstant): Use the above in emitting the constant.
23302 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
23303 that are user-defined by doing a LookupConstantValue on them.
23305 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
23308 2001-11-29 Miguel de Icaza <miguel@ximian.com>
23310 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
23312 (BaseAccess.DoResolve): Implement.
23314 (MemberAccess.DoResolve): Split this routine into a
23315 ResolveMemberAccess routine that can be used independently
23317 2001-11-28 Miguel de Icaza <miguel@ximian.com>
23319 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
23320 As that share bits of the implementation. Is returns a boolean,
23321 while As returns the Type that is being probed.
23323 2001-12-01 Ravi Pratap <ravi@ximian.com>
23325 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
23326 instead of a Literal - much easier.
23328 (EnumInTransit): Remove - utterly useless :-)
23330 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
23332 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
23334 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
23335 chain when we have no associated expression.
23337 2001-11-30 Ravi Pratap <ravi@ximian.com>
23339 * constant.cs (Define): Use Location while reporting the errror.
23341 Also emit a warning when 'new' is used and there is no inherited
23344 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
23347 (LookupEnumValue): Implement to lookup an enum member's value and define it
23350 (Populate): Re-write accordingly to use the above routine.
23352 2001-11-27 Miguel de Icaza <miguel@ximian.com>
23354 * expression.cs (This): Fix prototype for DoResolveLValue to
23355 override the base class DoResolveLValue.
23357 * cs-parser.cs: Report errors cs574 and cs575 (destructor
23360 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
23361 (we need to load the address of the field here). This fixes
23364 (FieldExpr.DoResolveLValue): Call the DoResolve
23365 function to initialize the Instance expression.
23367 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
23368 correctly the GetEnumerator operation on a value type.
23370 * cs-parser.jay: Add more simple parsing error catches.
23372 * statement.cs (Switch): Add support for string switches.
23373 Handle null specially.
23375 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
23377 2001-11-28 Ravi Pratap <ravi@ximian.com>
23379 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
23381 (declare_local_constant): New helper function.
23383 * statement.cs (AddConstant): Keep a separate record of constants
23385 (IsConstant): Implement to determine if a variable is a constant.
23387 (GetConstantExpression): Implement.
23389 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
23391 * statement.cs (IsVariableDefined): Re-write.
23393 2001-11-27 Ravi Pratap <ravi@ximian.com>
23395 * class.cs (TypeContainer::FindMembers): Look for constants
23396 in the case when we are looking for MemberTypes.Field
23398 * expression.cs (MemberAccess::DoResolve): Check that in the
23399 case we are a FieldExpr and a Literal, we are not being accessed
23400 by an instance reference.
23402 * cs-parser.jay (local_constant_declaration): Implement.
23404 (declaration_statement): Implement for constant declarations.
23406 2001-11-26 Miguel de Icaza <miguel@ximian.com>
23408 * statement.cs (Switch): Catch double defaults.
23410 (Switch): More work on the switch() statement
23411 implementation. It works for integral values now, need to finish
23415 2001-11-24 Miguel de Icaza <miguel@ximian.com>
23417 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
23418 integer literals into other integer literals. To be used by
23421 2001-11-24 Ravi Pratap <ravi@ximian.com>
23423 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
23426 (EmitDynamicInitializers): Cope with the above since we extract data
23427 directly from ArrayData now.
23429 (ExpectInitializers): Keep track of whether initializers are mandatory
23432 (Bounds): Make it a hashtable to prevent the same dimension being
23433 recorded for every element in that dimension.
23435 (EmitDynamicInitializers): Fix bug which prevented the Set array method
23438 Also fix bug which was causing the indices to be emitted in the reverse
23441 2001-11-24 Miguel de Icaza <miguel@ximian.com>
23443 * expression.cs (ArrayCreation): Implement the bits that Ravi left
23444 unfinished. They do not work, because the underlying code is
23447 2001-11-22 Miguel de Icaza <miguel@ximian.com>
23449 * cs-parser.jay: Remove bogus fixme.
23451 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
23452 on Switch statement.
23454 2001-11-23 Ravi Pratap <ravi@ximian.com>
23456 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
23459 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
23460 parameter. Apparently, any expression is allowed.
23462 (ValidateInitializers): Update accordingly.
23464 (CheckIndices): Fix some tricky bugs thanks to recursion.
23466 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
23467 I was being completely brain-dead.
23469 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
23470 and re-write acordingly.
23472 (DelegateInvocation): Re-write accordingly.
23474 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
23476 (MakeByteBlob): Handle types more correctly.
23478 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
23479 initialization from expressions but it is incomplete because I am a complete
23482 2001-11-22 Miguel de Icaza <miguel@ximian.com>
23484 * statement.cs (If.Emit): Fix a bug that generated incorrect code
23485 on If. Basically, we have to return `true' (ie, we do return to
23486 our caller) only if both branches of the if return.
23488 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
23489 short-circuit operators, handle them as short circuit operators.
23491 (Cast.DoResolve): Resolve type.
23492 (Cast.Cast): Take an expression as the target type.
23494 * cs-parser.jay (cast_expression): Remove old hack that only
23495 allowed a limited set of types to be handled. Now we take a
23496 unary_expression and we resolve to a type during semantic
23499 Use the grammar productions from Rhys to handle casts (this is
23500 not complete like Rhys syntax yet, we fail to handle that corner
23501 case that C# has regarding (-x), but we will get there.
23503 2001-11-22 Ravi Pratap <ravi@ximian.com>
23505 * class.cs (EmitFieldInitializer): Take care of the case when we have a
23506 field which is an array type.
23508 * cs-parser.jay (declare_local_variables): Support array initialization too.
23510 * typemanager.cs (MakeKey): Implement.
23512 (everywhere): Use the above appropriately.
23514 * cs-parser.jay (for_statement): Update for array initialization while
23515 declaring variables.
23517 * ecore.cs : The error message was correct, it's the variable's names that
23518 were misleading ;-) Make the code more readable.
23520 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
23521 the correct type etc.
23523 (ConvertExplicit): Handle Enum types by examining the underlying type.
23525 2001-11-21 Ravi Pratap <ravi@ximian.com>
23527 * parameter.cs (GetCallingConvention): Always return
23528 CallingConventions.Standard for now.
23530 2001-11-22 Miguel de Icaza <miguel@ximian.com>
23532 * expression.cs (Binary.ResolveOperator): Update the values of `l'
23533 and `r' after calling DoNumericPromotions.
23535 * ecore.cs: Fix error message (the types were in the wrong order).
23537 * statement.cs (Foreach.ProbeCollectionType): Need to pass
23538 BindingFlags.Instance as well
23540 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
23541 implicit int literal conversion in an empty cast so that we
23542 propagate the right type upstream.
23544 (UnboxCast): new class used to unbox value types.
23545 (Expression.ConvertExplicit): Add explicit type conversions done
23548 (Expression.ImplicitNumericConversion): Oops, forgot to test for
23549 the target type before applying the implicit LongLiterals to ULong
23552 2001-11-21 Miguel de Icaza <miguel@ximian.com>
23554 * cs-parser.jay (for_statement): Reworked the way For works: now
23555 we declare manually any variables that are introduced in
23556 for_initializer to solve the problem of having out-of-band code
23557 emition (that is what got for broken).
23559 (declaration_statement): Perform the actual variable declaration
23560 that used to be done in local_variable_declaration here.
23562 (local_variable_declaration): Do not declare anything, just pass
23563 the information on a DictionaryEntry
23565 2001-11-20 Ravi Pratap <ravi@ximian.com>
23567 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
23568 re-write of the logic to now make it recursive.
23570 (UpdateIndices): Re-write accordingly.
23572 Store element data in a separate ArrayData list in the above methods.
23574 (MakeByteBlob): Implement to dump the array data into a byte array.
23576 2001-11-19 Ravi Pratap <ravi@ximian.com>
23578 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
23581 * constant.cs (Define): Implement.
23583 (EmitConstant): Re-write fully.
23585 Pass in location info.
23587 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
23590 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
23591 DictionaryEntry since we need location info too.
23593 (constant_declaration): Update accordingly.
23595 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
23596 code into another method : UpdateIndices.
23598 2001-11-18 Ravi Pratap <ravi@ximian.com>
23600 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
23601 some type checking etc.
23603 2001-11-17 Ravi Pratap <ravi@ximian.com>
23605 * expression.cs (ArrayCreation::ValidateInitializers): Implement
23606 bits to provide dimension info if the user skips doing that.
23608 Update second constructor to store the rank correctly.
23610 2001-11-16 Ravi Pratap <ravi@ximian.com>
23612 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
23613 and try to implement.
23615 * ../errors/cs0150.cs : Add.
23617 * ../errors/cs0178.cs : Add.
23619 2001-11-16 Miguel de Icaza <miguel@ximian.com>
23621 * statement.cs: Implement foreach on multi-dimensional arrays.
23623 * parameter.cs (Parameters.GetParameterByName): Also lookup the
23624 name of the params argument.
23626 * expression.cs: Use EmitStoreOpcode to get the right opcode while
23627 initializing the array.
23629 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
23630 we can use this elsewhere.
23632 * statement.cs: Finish implementation of foreach for single
23635 * cs-parser.jay: Use an out-of-band stack to pass information
23636 around, I wonder why I need this.
23638 foreach_block: Make the new foreach_block the current_block.
23640 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
23641 function used to return a static Parameters structure. Used for
23642 empty parameters, as those are created very frequently.
23644 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
23646 2001-11-15 Ravi Pratap <ravi@ximian.com>
23648 * interface.cs : Default modifier is private, not public. The
23649 make verify test passes again.
23651 2001-11-15 Ravi Pratap <ravi@ximian.com>
23653 * support.cs (ReflectionParameters): Fix logic to determine
23654 whether the last parameter is a params one. Test 9 passes again.
23656 * delegate.cs (Populate): Register the builders we define with
23657 RegisterParameterForBuilder. Test 19 passes again.
23659 * cs-parser.jay (property_declaration): Reference $6 instead
23660 of $$ to get at the location.
23662 (indexer_declaration): Similar stuff.
23664 (attribute): Ditto.
23666 * class.cs (Property): Register parameters for the Get and Set methods
23667 if they exist. Test 23 passes again.
23669 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
23670 call to EmitArguments as we are sure there aren't any params arguments.
23671 Test 32 passes again.
23673 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
23674 IndexOutOfRangeException.
23676 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
23677 Test 33 now passes again.
23679 2001-11-15 Miguel de Icaza <miguel@ximian.com>
23681 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
23682 broke a bunch of things. Will have to come up with a better way
23683 of tracking locations.
23685 * statement.cs: Implemented foreach for single dimension arrays.
23687 2001-11-09 Miguel de Icaza <miguel@ximian.com>
23689 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
23690 an error. This removes the lookup from the critical path.
23692 * cs-parser.jay: Removed use of temporary_loc, which is completely
23695 2001-11-14 Miguel de Icaza <miguel@ximian.com>
23697 * support.cs (ReflectionParameters.ParameterModifier): Report
23698 whether the argument is a PARAMS argument or not.
23700 * class.cs: Set the attribute `ParamArrayAttribute' on the
23701 parameter argument.
23703 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
23704 and cons_param_array_attribute (ConstructorInfo for
23705 ParamArrayAttribute).,
23707 * codegen.cs: Emit the return using the `Return' statement, that
23708 way we can report the error correctly for missing return values.
23710 * class.cs (Method.Emit): Clean up.
23712 * expression.cs (Argument.Resolve): Take another argument: the
23713 location where this argument is used. Notice that this is not
23714 part of the "Argument" class as to reduce the size of the
23715 structure (we know the approximate location anyways).
23717 Test if the argument is a variable-reference, if not, then
23718 complain with a 206.
23720 (Argument.Emit): Emit addresses of variables.
23722 (Argument.FullDesc): Simplify.
23724 (Invocation.DoResolve): Update for Argument.Resolve.
23726 (ElementAccess.DoResolve): ditto.
23728 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
23729 method should be virtual, as this method is always virtual.
23731 (NewDelegate.DoResolve): Update for Argument.Resolve.
23733 * class.cs (ConstructorInitializer.DoResolve): ditto.
23735 * attribute.cs (Attribute.Resolve): ditto.
23737 2001-11-13 Miguel de Icaza <miguel@ximian.com>
23739 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
23741 * expression.cs (ParameterReference): Drop IStackStorage and implement
23742 IAssignMethod instead.
23744 (LocalVariableReference): ditto.
23746 * ecore.cs (FieldExpr): Drop IStackStorage and implement
23747 IAssignMethod instead.
23749 2001-11-13 Miguel de Icaza <miguel@ximian.com>
23751 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
23752 enumerations that are used in heavily used structures derive from
23753 byte in a laughable and pathetic attempt to reduce memory usage.
23754 This is the kind of pre-optimzations that you should not do at
23755 home without adult supervision.
23757 * expression.cs (UnaryMutator): New class, used to handle ++ and
23758 -- separatedly from the other unary operators. Cleans up the
23759 code, and kills the ExpressionStatement dependency in Unary.
23761 (Unary): Removed `method' and `Arguments' from this class, making
23762 it smaller, and moving it all to SimpleCall, so I can reuse this
23763 code in other locations and avoid creating a lot of transient data
23764 strucutres when not required.
23766 * cs-parser.jay: Adjust for new changes.
23768 2001-11-11 Miguel de Icaza <miguel@ximian.com>
23770 * enum.cs (Enum.Populate): If there is a failure during
23773 * cs-parser.jay (opt_enum_base): we used to catch type errors
23774 here, but this is really incorrect. The type error should be
23775 catched during semantic analysis.
23777 2001-12-11 Ravi Pratap <ravi@ximian.com>
23779 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
23780 current_local_parameters as expected since I, in my stupidity, had forgotten
23783 * attribute.cs (GetValidPlaces): Fix stupid bug.
23785 * class.cs (Method::Emit): Perform check on applicability of attributes.
23787 (Constructor::Emit): Ditto.
23789 (Field::Emit): Ditto.
23791 (Field.Location): Store location information.
23793 (Property, Event, Indexer, Operator): Ditto.
23795 * cs-parser.jay (field_declaration): Pass in location for each field.
23797 * ../errors/cs0592.cs : Add.
23799 2001-11-12 Ravi Pratap <ravi@ximian.com>
23801 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
23803 (InitCoreTypes): Update accordingly.
23805 (RegisterAttrType, LookupAttr): Implement.
23807 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
23808 info about the same.
23810 (Resolve): Update to populate the above as necessary.
23812 (Error592): Helper.
23814 (GetValidPlaces): Helper to the above.
23816 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
23818 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
23820 2001-11-12 Ravi Pratap <ravi@ximian.com>
23822 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
23824 * ../errors/cs0617.cs : Add.
23826 2001-11-11 Ravi Pratap <ravi@ximian.com>
23828 * enum.cs (Emit): Rename to Populate to be more consistent with what
23829 we expect it to do and when exactly it is called.
23831 * class.cs, rootcontext.cs : Update accordingly.
23833 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
23834 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
23836 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
23838 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
23839 of a fieldinfo using the above, when dealing with a FieldBuilder.
23841 2001-11-10 Ravi Pratap <ravi@ximian.com>
23843 * ../errors/cs0031.cs : Add.
23845 * ../errors/cs1008.cs : Add.
23847 * ../errrors/cs0543.cs : Add.
23849 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
23852 (FindMembers): Implement.
23854 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
23855 enums and delegates too.
23857 (enum_types): Rename to builder_to_enum.
23859 (delegate_types): Rename to builder_to_delegate.
23861 * delegate.cs (FindMembers): Implement.
23863 2001-11-09 Ravi Pratap <ravi@ximian.com>
23865 * typemanager.cs (IsEnumType): Implement.
23867 * enum.cs (Emit): Re-write parts to account for the underlying type
23868 better and perform checking etc.
23870 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
23871 of the underlying type.
23873 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
23876 * enum.cs (error31): Helper to report error #31.
23878 * cs-parser.jay (enum_declaration): Store location of each member too.
23880 * enum.cs (member_to_location): New hashtable.
23882 (AddEnumMember): Update location hashtable.
23884 (Emit): Use the location of each member while reporting errors.
23886 2001-11-09 Miguel de Icaza <miguel@ximian.com>
23888 * cs-parser.jay: A for_initializer if is a
23889 local_variable_declaration really ammount to have an implicit
23890 block with the variable declaration and no initializer for for.
23892 * statement.cs (For.Emit): Cope with null initializers.
23894 This fixes the infinite loop on for initializers.
23896 2001-11-08 Miguel de Icaza <miguel@ximian.com>
23898 * enum.cs: More cleanup.
23900 * ecore.cs: Remove dead code.
23902 * class.cs (Property.Emit): More simplification.
23903 (Event.Emit): ditto.
23905 Reworked to have less levels of indentation.
23907 2001-11-08 Ravi Pratap <ravi@ximian.com>
23909 * class.cs (Property): Emit attributes.
23919 * enum.cs (Emit): Ditto.
23921 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
23924 * class.cs (Field, Event, etc.): Move attribute generation into the
23925 Emit method everywhere.
23927 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
23928 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
23929 as we had no way of defining nested enums !
23931 * rootcontext.cs : Adjust code accordingly.
23933 * typemanager.cs (AddEnumType): To keep track of enum types separately.
23935 2001-11-07 Ravi Pratap <ravi@ximian.com>
23937 * expression.cs (EvalConstantExpression): Move into ecore.cs
23939 * enum.cs (Enum): Rename some members and make them public and readonly
23940 according to our convention.
23942 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
23945 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
23947 (Enum::Emit): Write a simple version for now which doesn't try to compute
23948 expressions. I shall modify this to be more robust in just a while.
23950 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
23952 (TypeContainer::CloseType): Create the Enum types too.
23954 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
23956 * expression.cs (EvalConstantExpression): Get rid of completely.
23958 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
23959 user-defined values and other cases.
23961 (IsValidEnumLiteral): Helper function.
23963 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
23964 out there in the case we had a literal FieldExpr.
23966 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
23968 (Literalize): Revamp a bit to take two arguments.
23970 (EnumLiteral): New class which derives from Literal to wrap enum literals.
23972 2001-11-06 Ravi Pratap <ravi@ximian.com>
23974 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
23976 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
23978 (Resolve): Use the above to ensure we have proper initializers.
23980 2001-11-05 Ravi Pratap <ravi@ximian.com>
23982 * expression.cs (Expression::EvalConstantExpression): New method to
23983 evaluate constant expressions.
23985 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
23987 2001-11-07 Miguel de Icaza <miguel@ximian.com>
23989 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
23992 (Binary.ResolveOperator): Handle operator != (object a, object b)
23993 and operator == (object a, object b);
23995 (Binary.DoNumericPromotions): Indicate whether the numeric
23996 promotion was possible.
23998 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
24001 Made the ArrayAccess implement interface IAssignMethod instead of
24002 IStackStore as the order in which arguments are passed reflects
24005 * assign.cs: Instead of using expr.ExprClass to select the way of
24006 assinging, probe for the IStackStore/IAssignMethod interfaces.
24008 * typemanager.cs: Load InitializeArray definition.
24010 * rootcontext.cs (RootContext.MakeStaticData): Used to define
24011 static data that can be used to initialize arrays.
24013 2001-11-05 Miguel de Icaza <miguel@ximian.com>
24015 * expression.cs: Handle operator== and operator!= for booleans.
24017 (Conditioal.Reduce): Implement reducer for the ?: operator.
24019 (Conditional.Resolve): Implement dead code elimination.
24021 (Binary.Resolve): Catch string literals and return a new
24022 concatenated string.
24024 (Unary.Reduce): Implement reduction of unary expressions.
24026 * ecore.cs: Split out the expression core handling here.
24028 (Expression.Reduce): New method used to perform constant folding
24029 and CSE. This is needed to support constant-expressions.
24031 * statement.cs (Statement.EmitBoolExpression): Pass true and false
24032 targets, and optimize for !x.
24034 2001-11-04 Ravi Pratap <ravi@ximian.com>
24036 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
24037 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
24038 set custom atttributes.
24040 * literal.cs (Literal::GetValue): New abstract method to return the actual
24041 value of the literal, cast as an object.
24043 (*Literal): Implement GetValue method.
24045 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
24046 expressions to the arraylist but objects of type Argument.
24048 * class.cs (TypeContainer::Emit): Emit our attributes too.
24050 (Method::Emit, Constructor::Emit): Ditto.
24052 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
24053 to be ignoring earlier.
24055 2001-11-03 Ravi Pratap <ravi@ximian.com>
24057 * attribute.cs (AttributeSection::Define): Implement to do the business
24058 of constructing a CustomAttributeBuilder.
24060 (Attribute): New trivial class. Increases readability of code.
24062 * cs-parser.jay : Update accordingly.
24064 (positional_argument_list, named_argument_list, named_argument): New rules
24066 (attribute_arguments): Use the above so that we are more correct.
24068 2001-11-02 Ravi Pratap <ravi@ximian.com>
24070 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
24071 to perform all checks for a method with a params parameter.
24073 (Invocation::OverloadResolve): Update to use the above method and therefore
24074 cope correctly with params method invocations.
24076 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
24079 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
24080 constructors in our parent too because we can't afford to miss out on
24083 * attribute.cs (AttributeSection): New name for the class Attribute
24085 Other trivial changes to improve readability.
24087 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
24088 use the new class names.
24090 2001-11-01 Ravi Pratap <ravi@ximian.com>
24092 * class.cs (Method::Define): Complete definition for params types too
24094 (Indexer::Define): Ditto.
24096 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
24097 Cope everywhere with a request for info about the array parameter.
24099 2001-11-01 Ravi Pratap <ravi@ximian.com>
24101 * tree.cs (RecordNamespace): Fix up to check for the correct key.
24103 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
24104 local_variable_type to extract the string corresponding to the type.
24106 (local_variable_type): Fixup the action to use the new helper method.
24108 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
24111 * expression.cs : Clean out code which uses the above.
24113 2001-10-31 Ravi Pratap <ravi@ximian.com>
24115 * typemanager.cs (RegisterMethod): Check if we already have an existing key
24116 and bale out if necessary by returning a false.
24118 (RegisterProperty): Ditto.
24120 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
24121 and print out appropriate error messages.
24123 * interface.cs (everywhere): Ditto.
24125 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
24126 location to constructor.
24128 * class.cs (Property, Event, Indexer): Update accordingly.
24130 * ../errors/cs111.cs : Added.
24132 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
24133 of a method, as laid down by the spec.
24135 (Invocation::OverloadResolve): Use the above method.
24137 2001-10-31 Ravi Pratap <ravi@ximian.com>
24139 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
24140 now take a TypeContainer and a Parameters object.
24142 (ParameterData): Modify return type of ParameterModifier method to be
24143 Parameter.Modifier and not a string.
24145 (ReflectionParameters, InternalParameters): Update accordingly.
24147 * expression.cs (Argument::GetParameterModifier): Same here.
24149 * support.cs (InternalParameters::ParameterType): Find a better way of determining
24150 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
24151 symbol in it at all so maybe this is only for now.
24153 2001-10-30 Ravi Pratap <ravi@ximian.com>
24155 * support.cs (InternalParameters): Constructor now takes an extra argument
24156 which is the actual Parameters class.
24158 (ParameterDesc): Update to provide info on ref/out modifiers.
24160 * class.cs (everywhere): Update call to InternalParameters to pass in
24161 the second argument too.
24163 * support.cs (ParameterData): Add ParameterModifier, which is a method
24164 to return the modifier info [ref/out etc]
24166 (InternalParameters, ReflectionParameters): Implement the above.
24168 * expression.cs (Argument::ParameterModifier): Similar function to return
24169 info about the argument's modifiers.
24171 (Invocation::OverloadResolve): Update to take into account matching modifiers
24174 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
24175 a new SetFormalParameters object which we pass to InternalParameters.
24177 2001-10-30 Ravi Pratap <ravi@ximian.com>
24179 * expression.cs (NewArray): Merge into the ArrayCreation class.
24181 2001-10-29 Ravi Pratap <ravi@ximian.com>
24183 * expression.cs (NewArray): Merge classes NewBuiltinArray and
24184 NewUserdefinedArray into one as there wasn't much of a use in having
24187 * expression.cs (Argument): Change field's name to ArgType from Type.
24189 (Type): New readonly property which returns the proper type, taking into
24190 account ref/out modifiers.
24192 (everywhere): Adjust code accordingly for the above.
24194 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
24195 whether we are emitting for a ref or out parameter.
24197 * expression.cs (Argument::Emit): Use the above field to set the state.
24199 (LocalVariableReference::Emit): Update to honour the flag and emit the
24202 * parameter.cs (Attributes): Set the correct flags for ref parameters.
24204 * expression.cs (Argument::FullDesc): New function to provide a full desc.
24206 * support.cs (ParameterData): Add method ParameterDesc to the interface.
24208 (ReflectionParameters, InternalParameters): Implement the above method.
24210 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
24213 (Invocation::FullMethodDesc): Ditto.
24215 2001-10-29 Miguel de Icaza <miguel@ximian.com>
24217 * cs-parser.jay: Add extra production for the second form of array
24220 * expression.cs (ArrayCreation): Update to reflect the above
24223 * Small changes to prepare for Array initialization.
24225 2001-10-28 Miguel de Icaza <miguel@ximian.com>
24227 * typemanager.cs (ImplementsInterface): interface might be null;
24228 Deal with this problem;
24230 Also, we do store negative hits on the cache (null values), so use
24231 this instead of calling t.GetInterfaces on the type everytime.
24233 2001-10-28 Ravi Pratap <ravi@ximian.com>
24235 * typemanager.cs (IsBuiltinType): New method to help determine the same.
24237 * expression.cs (New::DoResolve): Get rid of array creation code and instead
24238 split functionality out into different classes.
24240 (New::FormArrayType): Move into NewBuiltinArray.
24242 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
24245 (NewBuiltinArray): New class to handle creation of built-in arrays.
24247 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
24248 account creation of one-dimensional arrays.
24250 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
24252 (NewUserdefinedArray::DoResolve): Implement.
24254 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
24256 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
24257 we maintain inside the TypeManager. This is necessary to perform lookups on the
24260 (LookupType): Update to perform GetType on the module builders too.
24262 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
24264 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
24266 2001-10-23 Ravi Pratap <ravi@ximian.com>
24268 * expression.cs (New::DoResolve): Implement guts of array creation.
24270 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
24272 2001-10-27 Miguel de Icaza <miguel@ximian.com>
24274 * expression.cs: Fix bug I introduced lsat night that broke
24277 (Expression.Resolve): Report a 246 error (can not resolve name)
24278 if we find a SimpleName in the stream.
24280 (Expression.ResolveLValue): Ditto.
24282 (Expression.ResolveWithSimpleName): This function is a variant of
24283 ResolveName, this one allows SimpleNames to be returned without a
24284 warning. The only consumer of SimpleNames is MemberAccess
24286 2001-10-26 Miguel de Icaza <miguel@ximian.com>
24288 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
24289 might arrive here. I have my doubts that this is correct.
24291 * statement.cs (Lock): Implement lock statement.
24293 * cs-parser.jay: Small fixes to support `lock' and `using'
24295 * cs-tokenizer.cs: Remove extra space
24297 * driver.cs: New flag --checked, allows to turn on integer math
24300 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
24301 Threading.Monitor.Exit
24303 2001-10-23 Miguel de Icaza <miguel@ximian.com>
24305 * expression.cs (IndexerAccess::DoResolveLValue): Set the
24306 Expression Class to be IndexerAccess.
24308 Notice that Indexer::DoResolve sets the eclass to Value.
24310 2001-10-22 Miguel de Icaza <miguel@ximian.com>
24312 * class.cs (TypeContainer::Emit): Emit code for indexers.
24314 * assign.cs (IAssignMethod): New interface implemented by Indexers
24315 and Properties for handling assignment.
24317 (Assign::Emit): Simplify and reuse code.
24319 * expression.cs (IndexerAccess, PropertyExpr): Implement
24320 IAssignMethod, clean up old code.
24322 2001-10-22 Ravi Pratap <ravi@ximian.com>
24324 * typemanager.cs (ImplementsInterface): New method to determine if a type
24325 implements a given interface. Provides a nice cache too.
24327 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
24330 (ConvertReferenceExplicit): Ditto.
24332 * delegate.cs (Delegate::Populate): Update to define the parameters on the
24333 various methods, with correct names etc.
24335 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
24336 Operator.UnaryNegation.
24338 * cs-parser.jay (operator_declarator): Be a little clever in the case where
24339 we have a unary plus or minus operator.
24341 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
24344 * everywhere : update accordingly.
24346 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
24349 * class.cs (Method::Define): For the case where we are implementing a method
24350 inherited from an interface, we need to set the MethodAttributes.Final flag too.
24351 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
24353 2001-10-21 Ravi Pratap <ravi@ximian.com>
24355 * interface.cs (FindMembers): Implement to work around S.R.E
24358 * typemanager.cs (IsInterfaceType): Implement.
24360 (FindMembers): Update to handle interface types too.
24362 * expression.cs (ImplicitReferenceConversion): Re-write bits which
24363 use IsAssignableFrom as that is not correct - it doesn't work.
24365 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
24366 and accordingly override EmitStatement.
24368 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
24369 using the correct logic :-)
24371 2001-10-19 Ravi Pratap <ravi@ximian.com>
24373 * ../errors/cs-11.cs : Add to demonstrate error -11
24375 2001-10-17 Miguel de Icaza <miguel@ximian.com>
24377 * assign.cs (Assign::Resolve): Resolve right hand side first, and
24378 then pass this as a hint to ResolveLValue.
24380 * expression.cs (FieldExpr): Add Location information
24382 (FieldExpr::LValueResolve): Report assignment to readonly
24385 (Expression::ExprClassFromMemberInfo): Pass location information.
24387 (Expression::ResolveLValue): Add new method that resolves an
24390 (Expression::DoResolveLValue): Default invocation calls
24393 (Indexers): New class used to keep track of indexers in a given
24396 (IStackStore): Renamed from LValue, as it did not really describe
24397 what this did. Also ResolveLValue is gone from this interface and
24398 now is part of Expression.
24400 (ElementAccess): Depending on the element access type
24402 * typemanager.cs: Add `indexer_name_type' as a Core type
24403 (System.Runtime.CompilerServices.IndexerNameAttribute)
24405 * statement.cs (Goto): Take a location.
24407 2001-10-18 Ravi Pratap <ravi@ximian.com>
24409 * delegate.cs (Delegate::VerifyDelegate): New method to verify
24410 if two delegates are compatible.
24412 (NewDelegate::DoResolve): Update to take care of the case when
24413 we instantiate a delegate from another delegate.
24415 * typemanager.cs (FindMembers): Don't even try to look up members
24416 of Delegate types for now.
24418 2001-10-18 Ravi Pratap <ravi@ximian.com>
24420 * delegate.cs (NewDelegate): New class to take care of delegate
24423 * expression.cs (New): Split the delegate related code out into
24424 the NewDelegate class.
24426 * delegate.cs (DelegateInvocation): New class to handle delegate
24429 * expression.cs (Invocation): Split out delegate related code into
24430 the DelegateInvocation class.
24432 2001-10-17 Ravi Pratap <ravi@ximian.com>
24434 * expression.cs (New::DoResolve): Implement delegate creation fully
24435 and according to the spec.
24437 (New::DoEmit): Update to handle delegates differently.
24439 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
24440 because of which we were printing out arguments in reverse order !
24442 * delegate.cs (VerifyMethod): Implement to check if the given method
24443 matches the delegate.
24445 (FullDelegateDesc): Implement.
24447 (VerifyApplicability): Implement.
24449 * expression.cs (Invocation::DoResolve): Update to accordingly handle
24450 delegate invocations too.
24452 (Invocation::Emit): Ditto.
24454 * ../errors/cs1593.cs : Added.
24456 * ../errors/cs1594.cs : Added.
24458 * delegate.cs (InstanceExpression, TargetMethod): New properties.
24460 2001-10-16 Ravi Pratap <ravi@ximian.com>
24462 * typemanager.cs (intptr_type): Core type for System.IntPtr
24464 (InitCoreTypes): Update for the same.
24466 (iasyncresult_type, asynccallback_type): Ditto.
24468 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
24471 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
24474 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
24475 the builders for the 4 members of a delegate type :-)
24477 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
24480 * expression.cs (New::DoResolve): Implement guts for delegate creation.
24482 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
24484 2001-10-15 Miguel de Icaza <miguel@ximian.com>
24486 * statement.cs (Break::Emit): Implement.
24487 (Continue::Emit): Implement.
24489 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
24490 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
24491 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
24492 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
24495 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
24496 properties that track the label for the current loop (begin of the
24497 loop and end of the loop).
24499 2001-10-15 Ravi Pratap <ravi@ximian.com>
24501 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
24502 use of emitting anything at all.
24504 * class.cs, rootcontext.cs : Get rid of calls to the same.
24506 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
24508 (Populate): Define the constructor correctly and set the implementation
24511 * typemanager.cs (delegate_types): New hashtable to hold delegates that
24514 (AddDelegateType): Implement.
24516 (IsDelegateType): Implement helper method.
24518 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
24520 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
24521 and accordingly handle it.
24523 * delegate.cs (Populate): Take TypeContainer argument.
24524 Implement bits to define the Invoke method. However, I still haven't figured out
24525 how to take care of the native int bit :-(
24527 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
24528 Qualify the name of the delegate, not its return type !
24530 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
24533 (StandardConversionExists): Checking for array types turns out to be recursive.
24535 (ConvertReferenceExplicit): Implement array conversion.
24537 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
24539 2001-10-12 Ravi Pratap <ravi@ximian.com>
24541 * cs-parser.jay (delegate_declaration): Store the fully qualified
24542 name as it is a type declaration.
24544 * delegate.cs (ReturnType, Name): Rename members to these. Make them
24547 (DefineDelegate): Renamed from Define. Does the same thing essentially,
24548 as TypeContainer::DefineType.
24550 (Populate): Method in which all the definition of the various methods (Invoke)
24553 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
24556 (CloseDelegate): Finally creates the delegate.
24558 * class.cs (TypeContainer::DefineType): Update to define delegates.
24559 (Populate, Emit and CloseType): Do the same thing here too.
24561 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
24562 delegates in all these operations.
24564 2001-10-14 Miguel de Icaza <miguel@ximian.com>
24566 * expression.cs: LocalTemporary: a new expression used to
24567 reference a temporary that has been created.
24569 * assign.cs: Handle PropertyAccess back here, so that we can
24570 provide the proper semantic access to properties.
24572 * expression.cs (Expression::ConvertReferenceExplicit): Implement
24573 a few more explicit conversions.
24575 * modifiers.cs: `NEW' modifier maps to HideBySig.
24577 * expression.cs (PropertyExpr): Make this into an
24578 ExpressionStatement, and support the EmitStatement code path.
24580 Perform get/set error checking, clean up the interface.
24582 * assign.cs: recognize PropertyExprs as targets, and if so, turn
24583 them into toplevel access objects.
24585 2001-10-12 Miguel de Icaza <miguel@ximian.com>
24587 * expression.cs: PropertyExpr::PropertyExpr: use work around the
24590 * typemanager.cs: Keep track here of our PropertyBuilders again to
24591 work around lameness in SRE.
24593 2001-10-11 Miguel de Icaza <miguel@ximian.com>
24595 * expression.cs (LValue::LValueResolve): New method in the
24596 interface, used to perform a second resolution pass for LValues.
24598 (This::DoResolve): Catch the use of this in static methods.
24600 (This::LValueResolve): Implement.
24602 (This::Store): Remove warning, assigning to `this' in structures
24605 (Invocation::Emit): Deal with invocation of
24606 methods on value types. We need to pass the address to structure
24607 methods rather than the object itself. (The equivalent code to
24608 emit "this" for structures leaves the entire structure on the
24609 stack instead of a pointer to it).
24611 (ParameterReference::DoResolve): Compute the real index for the
24612 argument based on whether the method takes or not a `this' pointer
24613 (ie, the method is static).
24615 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
24616 value types returned from functions when we need to invoke a
24617 method on the sturcture.
24620 2001-10-11 Ravi Pratap <ravi@ximian.com>
24622 * class.cs (TypeContainer::DefineType): Method to actually do the business of
24623 defining the type in the Modulebuilder or Typebuilder. This is to take
24624 care of nested types which need to be defined on the TypeBuilder using
24625 DefineNestedMethod.
24627 (TypeContainer::GetClassBases): Implement. Essentially the code from the
24628 methods in RootContext, only ported to be part of TypeContainer.
24630 (TypeContainer::GetInterfaceOrClass): Ditto.
24632 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
24634 * interface.cs (Interface::DefineInterface): New method. Does exactly
24635 what RootContext.CreateInterface did earlier, only it takes care of nested types
24638 (Interface::GetInterfaces): Move from RootContext here and port.
24640 (Interface::GetInterfaceByName): Same here.
24642 * rootcontext.cs (ResolveTree): Re-write.
24644 (PopulateTypes): Re-write.
24646 * class.cs (TypeContainer::Populate): Populate nested types too.
24647 (TypeContainer::Emit): Emit nested members too.
24649 * typemanager.cs (AddUserType): Do not make use of the FullName property,
24650 instead just use the name argument passed in as it is already fully
24653 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
24654 to TypeContainer mapping to see if a type is user-defined.
24656 * class.cs (TypeContainer::CloseType): Implement.
24658 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
24659 the default constructor.
24661 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
24664 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
24666 * interface.cs (CloseType): Create the type here.
24668 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
24671 Remove all the methods which are now in TypeContainer.
24673 2001-10-10 Ravi Pratap <ravi@ximian.com>
24675 * delegate.cs (Define): Re-write bits to define the delegate
24678 2001-10-10 Miguel de Icaza <miguel@ximian.com>
24680 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
24682 * expression.cs (ImplicitReferenceConversion): handle null as well
24683 as a source to convert to any reference type.
24685 * statement.cs (Return): Perform any implicit conversions to
24686 expected return type.
24688 Validate use of return statement.
24690 * codegen.cs (EmitContext): Pass the expected return type here.
24692 * class.cs (Method, Constructor, Property): Pass expected return
24693 type to EmitContext.
24695 2001-10-09 Miguel de Icaza <miguel@ximian.com>
24697 * expression.cs: Make DoResolve take an EmitContext instead of a
24700 Replaced `l' and `location' for `loc', for consistency.
24702 (Error, Warning): Remove unneeded Tc argument.
24704 * assign.cs, literal.cs, constant.cs: Update to new calling
24707 * codegen.cs: EmitContext now contains a flag indicating whether
24708 code is being generated in a static method or not.
24710 * cs-parser.jay: DecomposeQI, new function that replaces the old
24711 QualifiedIdentifier. Now we always decompose the assembled
24712 strings from qualified_identifier productions into a group of
24715 2001-10-08 Miguel de Icaza <miguel@ximian.com>
24717 * rootcontext.cs: Deal with field-less struct types correctly now
24718 by passing the size option to Define Type.
24720 * class.cs: Removed hack that created one static field.
24722 2001-10-07 Miguel de Icaza <miguel@ximian.com>
24724 * statement.cs: Moved most of the code generation here.
24726 2001-10-09 Ravi Pratap <ravi@ximian.com>
24728 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
24731 (ElementAccess): Remove useless bits for now - keep checks as the spec
24734 2001-10-08 Ravi Pratap <ravi@ximian.com>
24736 * expression.cs (ElementAccess::DoResolve): Remove my crap code
24737 and start performing checks according to the spec.
24739 2001-10-07 Ravi Pratap <ravi@ximian.com>
24741 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
24742 rank_specifiers instead.
24744 (rank_specifiers): Change the order in which the rank specifiers are stored
24746 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
24748 * expression.cs (ElementAccess): Implement the LValue interface too.
24750 2001-10-06 Ravi Pratap <ravi@ximian.com>
24752 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
24753 except that user defined conversions are not included.
24755 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
24756 perform the conversion of the return type, if necessary.
24758 (New::DoResolve): Check whether we are creating an array or an object
24759 and accordingly do the needful.
24761 (New::Emit): Same here.
24763 (New::DoResolve): Implement guts of array creation.
24765 (New::FormLookupType): Helper function.
24767 2001-10-07 Miguel de Icaza <miguel@ximian.com>
24769 * codegen.cs: Removed most of the code generation here, and move the
24770 corresponding code generation bits to the statement classes.
24772 Added support for try/catch/finalize and throw.
24774 * cs-parser.jay: Added support for try/catch/finalize.
24776 * class.cs: Catch static methods having the flags override,
24777 virtual or abstract.
24779 * expression.cs (UserCast): This user cast was not really doing
24780 what it was supposed to do. Which is to be born in fully resolved
24781 state. Parts of the resolution were being performed at Emit time!
24785 2001-10-05 Miguel de Icaza <miguel@ximian.com>
24787 * expression.cs: Implicity convert the result from UserCast.
24789 2001-10-05 Ravi Pratap <ravi@ximian.com>
24791 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
24792 prevented it from working correctly.
24794 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
24795 merely ConvertImplicit.
24797 2001-10-05 Miguel de Icaza <miguel@ximian.com>
24799 * typemanager.cs: Make the LookupTypeContainer function static,
24800 and not per-instance.
24802 * class.cs: Make static FindMembers (the one that takes a Type
24805 * codegen.cs: Add EmitForeach here.
24807 * cs-parser.jay: Make foreach a toplevel object instead of the
24808 inline expansion, as we need to perform semantic analysis on it.
24810 2001-10-05 Ravi Pratap <ravi@ximian.com>
24812 * expression.cs (Expression::ImplicitUserConversion): Rename to
24813 UserDefinedConversion.
24815 (Expression::UserDefinedConversion): Take an extra argument specifying
24816 whether we look for explicit user conversions too.
24818 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
24820 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
24822 (ExplicitUserConversion): Make it a call to UserDefinedConversion
24823 with the appropriate arguments.
24825 * cs-parser.jay (cast_expression): Record location too.
24827 * expression.cs (Cast): Record location info.
24829 (Expression::ConvertExplicit): Take location argument.
24831 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
24832 to determine if we are doing explicit conversions.
24834 (UserCast::Emit): Update accordingly.
24836 (Expression::ConvertExplicit): Report an error if everything fails.
24838 * ../errors/cs0030.cs : Add.
24840 2001-10-04 Miguel de Icaza <miguel@ximian.com>
24842 * modifiers.cs: If the ABSTRACT keyword is present, also set the
24843 virtual and newslot bits.
24845 * class.cs (TypeContainer::RegisterRequiredImplementations):
24846 Record methods we need.
24848 (TypeContainer::MakeKey): Helper function to make keys for
24849 MethodBases, since the Methodbase key is useless.
24851 (TypeContainer::Populate): Call RegisterRequiredImplementations
24852 before defining the methods.
24854 Create a mapping for method_builders_to_methods ahead of time
24855 instead of inside a tight loop.
24857 (::RequireMethods): Accept an object as the data to set into the
24858 hashtable so we can report interface vs abstract method mismatch.
24860 2001-10-03 Miguel de Icaza <miguel@ximian.com>
24862 * report.cs: Make all of it static.
24864 * rootcontext.cs: Drop object_type and value_type computations, as
24865 we have those in the TypeManager anyways.
24867 Drop report instance variable too, now it is a global.
24869 * driver.cs: Use try/catch on command line handling.
24871 Add --probe option to debug the error reporting system with a test
24874 * report.cs: Add support for exiting program when a probe
24875 condition is reached.
24877 2001-10-03 Ravi Pratap <ravi@ximian.com>
24879 * expression.cs (Binary::DoNumericPromotions): Fix the case when
24880 we do a forcible conversion regardless of type, to check if
24881 ForceConversion returns a null.
24883 (Binary::error19): Use location to report error.
24885 (Unary::error23): Use location here too.
24887 * ../errors/cs0019.cs : Check in.
24889 * ../errors/cs0023.cs : Check in.
24891 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
24892 case of a non-null MethodInfo object with a length of 0 !
24894 (Binary::ResolveOperator): Flag error if overload resolution fails to find
24895 an applicable member - according to the spec :-)
24896 Also fix logic to find members in base types.
24898 (Unary::ResolveOperator): Same here.
24900 (Unary::report23): Change name to error23 and make first argument a TypeContainer
24901 as I was getting thoroughly confused between this and error19 :-)
24903 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
24904 (::FindMostEncompassedType): Implement.
24905 (::FindMostEncompassingType): Implement.
24906 (::StandardConversionExists): Implement.
24908 (UserImplicitCast): Re-vamp. We now need info about most specific
24909 source and target types so that we can do the necessary conversions.
24911 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
24912 mathematical union with no duplicates.
24914 2001-10-03 Miguel de Icaza <miguel@ximian.com>
24916 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
24917 in order from base classes to child classes, so that we can in
24918 child classes look up in our parent for method names and
24919 attributes (required for handling abstract, virtual, new, override
24920 constructs: we need to instrospect our base class, and if we dont
24921 populate the classes in order, the introspection might be
24922 incorrect. For example, a method could query its parent before
24923 the parent has any methods and would determine that the parent has
24924 no abstract methods (while it could have had them)).
24926 (RootContext::CreateType): Record the order in which we define the
24929 2001-10-02 Miguel de Icaza <miguel@ximian.com>
24931 * class.cs (TypeContainer::Populate): Also method definitions can
24932 fail now, keep track of this.
24934 (TypeContainer::FindMembers): Implement support for
24935 DeclaredOnly/noDeclaredOnly flag.
24937 (Constructor::Emit) Return the ConstructorBuilder.
24939 (Method::Emit) Return the MethodBuilder.
24940 Check for abstract or virtual methods to be public.
24942 * rootcontext.cs (RootContext::CreateType): Register all the
24943 abstract methods required for the class to be complete and the
24944 interface methods that must be implemented.
24946 * cs-parser.jay: Report error 501 (method requires body if it is
24947 not marked abstract or extern).
24949 * expression.cs (TypeOf::Emit): Implement.
24951 * typemanager.cs: runtime_handle_type, new global type.
24953 * class.cs (Property::Emit): Generate code for properties.
24955 2001-10-02 Ravi Pratap <ravi@ximian.com>
24957 * expression.cs (Unary::ResolveOperator): Find operators on base type
24958 too - we now conform exactly to the spec.
24960 (Binary::ResolveOperator): Same here.
24962 * class.cs (Operator::Define): Fix minor quirk in the tests.
24964 * ../errors/cs0215.cs : Added.
24966 * ../errors/cs0556.cs : Added.
24968 * ../errors/cs0555.cs : Added.
24970 2001-10-01 Miguel de Icaza <miguel@ximian.com>
24972 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
24973 single integer which is really efficient
24975 2001-10-01 Ravi Pratap <ravi@ximian.com>
24977 * expression.cs (Expression::ImplicitUserConversion): Use location
24978 even in the case when we are examining True operators.
24980 * class.cs (Operator::Define): Perform extensive checks to conform
24981 with the rules for operator overloading in the spec.
24983 * expression.cs (Expression::ImplicitReferenceConversion): Implement
24984 some of the other conversions mentioned in the spec.
24986 * typemanager.cs (array_type): New static member for the System.Array built-in
24989 (cloneable_interface): For System.ICloneable interface.
24991 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
24992 we start resolving the tree and populating types.
24994 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
24996 2001-10-01 Miguel de Icaza <miguel@ximian.com>
24998 * expression.cs (Expression::ExprClassFromMemberInfo,
24999 Expression::Literalize): Create literal expressions from
25000 FieldInfos which are literals.
25002 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
25003 type casts, because they were wrong. The test suite in tests
25006 (ImplicitNumericConversion): ushort to ulong requires a widening
25009 Int32 constant to long requires widening cast as well.
25011 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
25012 for integers because the type on the stack is not i4.
25014 2001-09-30 Miguel de Icaza <miguel@ximian.com>
25016 * expression.cs (report118): require location argument.
25018 * parameter.cs: Do not dereference potential null value.
25020 * class.cs: Catch methods that lack the `new' keyword when
25021 overriding a name. Report warnings when `new' is used without
25022 anything being there to override.
25024 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
25026 * class.cs: Only add constructor to hashtable if it is non-null
25027 (as now constructors can fail on define).
25029 (TypeManager, Class, Struct): Take location arguments.
25031 Catch field instance initialization in structs as errors.
25033 accepting_filter: a new filter for FindMembers that is static so
25034 that we dont create an instance per invocation.
25036 (Constructor::Define): Catch errors where a struct constructor is
25039 * cs-parser.jay: Pass location information for various new
25042 * delegate.cs (Delegate): take a location argument.
25044 * driver.cs: Do not call EmitCode if there were problesm in the
25045 Definition of the types, as many Builders wont be there.
25047 * decl.cs (Decl::Decl): Require a location argument.
25049 * cs-tokenizer.cs: Handle properly hex constants that can not fit
25050 into integers, and find the most appropiate integer for it.
25052 * literal.cs: Implement ULongLiteral.
25054 * rootcontext.cs: Provide better information about the location of
25055 failure when CreateType fails.
25057 2001-09-29 Miguel de Icaza <miguel@ximian.com>
25059 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
25062 * expression.cs (Binary::CheckShiftArguments): Add missing type
25064 (Binary::ResolveOperator): Add type to the logical and and logical
25065 or, Bitwise And/Or and Exclusive Or code paths, it was missing
25068 (Binary::DoNumericPromotions): In the case where either argument
25069 is ulong (and most signed types combined with ulong cause an
25070 error) perform implicit integer constant conversions as well.
25072 2001-09-28 Miguel de Icaza <miguel@ximian.com>
25074 * expression.cs (UserImplicitCast): Method should always be
25076 (Invocation::BetterConversion): Simplified test for IntLiteral.
25078 (Expression::ImplicitNumericConversion): Split this routine out.
25079 Put the code that performs implicit constant integer conversions
25082 (Expression::Resolve): Become a wrapper around DoResolve so we can
25083 check eclass and type being set after resolve.
25085 (Invocation::Badness): Remove this dead function
25087 (Binary::ResolveOperator): Do not compute the expensive argumnets
25088 unless we have a union for it.
25090 (Probe::Emit): Is needs to do an isinst and then
25091 compare against null.
25093 (::CanConvert): Added Location argument. If the Location argument
25094 is null (Location.Null), then we do not report errors. This is
25095 used by the `probe' mechanism of the Explicit conversion. We do
25096 not want to generate an error for something that the user
25097 explicitly requested to be casted. But the pipeline for an
25098 explicit cast first tests for potential implicit casts.
25100 So for now, if the Location is null, it means `Probe only' to
25101 avoid adding another argument. Might have to revise this
25104 (ClassCast): New class used to type cast objects into arbitrary
25105 classes (used in Explicit Reference Conversions).
25107 Implement `as' as well.
25109 Reverted all the patches from Ravi below: they were broken:
25111 * The use of `level' as a mechanism to stop recursive
25112 invocations is wrong. That was there just to catch the
25113 bug with a strack trace but not as a way of addressing
25116 To fix the problem we have to *understand* what is going
25117 on and the interactions and come up with a plan, not
25118 just get things going.
25120 * The use of the type conversion cache that I proposed
25121 last night had an open topic: How does this work across
25122 protection domains. A user defined conversion might not
25123 be public in the location where we are applying the
25124 conversion, a different conversion might be selected
25125 (ie, private A->B (better) but public B->A (worse),
25126 inside A, A->B applies, but outside it, B->A will
25129 * On top of that (ie, even if the above is solved),
25130 conversions in a cache need to be abstract. Ie, `To
25131 convert from an Int to a Short use an OpcodeCast', not
25132 `To convert from an Int to a Short use the OpcodeCast on
25133 the variable 5' (which is what this patch was doing).
25135 2001-09-28 Ravi Pratap <ravi@ximian.com>
25137 * expression.cs (Invocation::ConversionExists): Re-write to use
25138 the conversion cache
25140 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
25141 cache all conversions done, not just user-defined ones.
25143 (Invocation::BetterConversion): The real culprit. Use ConversionExists
25144 to determine if a conversion exists instead of acutually trying to
25145 perform the conversion. It's faster too.
25147 (Expression::ConvertExplicit): Modify to use ConversionExists to check
25148 and only then attempt the implicit conversion.
25150 2001-09-28 Ravi Pratap <ravi@ximian.com>
25152 * expression.cs (ConvertImplicit): Use a cache for conversions
25153 already found. Check level of recursion and bail out if necessary.
25155 2001-09-28 Miguel de Icaza <miguel@ximian.com>
25157 * typemanager.cs (string_concat_string_string, string_concat_object_object):
25158 Export standard methods that we expect for string operations.
25160 * statement.cs (Block::UsageWarning): Track usage of variables and
25161 report the errors for not used variables.
25163 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
25166 2001-09-27 Miguel de Icaza <miguel@ximian.com>
25168 * codegen.cs: remove unnneded code
25170 * expression.cs: Removed BuiltinTypeAccess class
25172 Fix the order in which implicit conversions are
25175 The previous fixed dropped support for boxed conversions (adding a
25176 test to the test suite now)
25178 (UserImplicitCast::CanConvert): Remove test for source being null,
25179 that code is broken. We should not feed a null to begin with, if
25180 we do, then we should track the bug where the problem originates
25181 and not try to cover it up here.
25183 Return a resolved expression of type UserImplicitCast on success
25184 rather than true/false. Ravi: this is what I was talking about,
25185 the pattern is to use a static method as a "constructor" for
25188 Also, do not create arguments until the very last minute,
25189 otherwise we always create the arguments even for lookups that
25190 will never be performed.
25192 (UserImplicitCast::Resolve): Eliminate, objects of type
25193 UserImplicitCast are born in a fully resolved state.
25195 * typemanager.cs (InitCoreTypes): Init also value_type
25196 (System.ValueType).
25198 * expression.cs (Cast::Resolve): First resolve the child expression.
25200 (LValue): Add new method AddressOf to be used by
25203 Change the argument of Store to take an EmitContext instead of an
25204 ILGenerator, because things like FieldExpr need to be able to call
25205 their children expression to generate the instance code.
25207 (Expression::Error, Expression::Warning): Sugar functions for
25210 (Expression::MemberLookup): Accept a TypeContainer instead of a
25211 Report as the first argument.
25213 (Expression::ResolvePrimary): Killed. I still want to improve
25214 this as currently the code is just not right.
25216 (Expression::ResolveMemberAccess): Simplify, but it is still
25219 (Unary::Resolve): Catch errors in AddressOf operators.
25221 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
25222 index to a byte for the short-version, or the compiler will choose
25223 the wrong Emit call, which generates the wrong data.
25225 (ParameterReference::Emit, ::Store): same.
25227 (FieldExpr::AddressOf): Implement.
25229 * typemanager.cs: TypeManager: made public variable instead of
25232 * driver.cs: document --fatal.
25234 * report.cs (ErrorMessage, WarningMessage): new names for the old
25235 Error and Warning classes.
25237 * cs-parser.jay (member_access): Turn built-in access to types
25238 into a normal simplename
25240 2001-09-27 Ravi Pratap <ravi@ximian.com>
25242 * expression.cs (Invocation::BetterConversion): Fix to cope
25243 with q being null, since this was introducing a bug.
25245 * expression.cs (ConvertImplicit): Do built-in conversions first.
25247 2001-09-27 Ravi Pratap <ravi@ximian.com>
25249 * expression.cs (UserImplicitCast::Resolve): Fix bug.
25251 2001-09-27 Ravi Pratap <ravi@ximian.com>
25253 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
25254 I had introduced long ago (what's new ?).
25256 * expression.cs (UserImplicitCast::CanConvert): Static method to do
25257 the work of all the checking.
25258 (ConvertImplicit): Call CanConvert and only then create object if necessary.
25259 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
25261 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
25262 that is the right way.
25264 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
25265 overloading resolution. Use everywhere instead of cutting and pasting code.
25267 (Binary::ResolveOperator): Use MakeUnionSet.
25269 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
25270 we have to convert to bool types. Not complete yet.
25272 2001-09-27 Miguel de Icaza <miguel@ximian.com>
25274 * typemanager.cs (TypeManager::CSharpName): support ushort.
25276 * expression.cs (Expression::TryImplicitIntConversion): Attempts
25277 to provide an expression that performsn an implicit constant int
25278 conversion (section 6.1.6).
25279 (Expression::ConvertImplicitRequired): Reworked to include
25280 implicit constant expression conversions.
25282 (Expression::ConvertNumericExplicit): Finished.
25284 (Invocation::Emit): If InstanceExpression is null, then it means
25285 that we perform a call on this.
25287 2001-09-26 Miguel de Icaza <miguel@ximian.com>
25289 * expression.cs (Unary::Emit): Remove some dead code.
25290 (Probe): Implement Resolve and Emit for `is'.
25291 (Expression::ConvertImplicitRequired): Attempt to do constant
25292 expression conversions here. Maybe should be moved to
25293 ConvertImplicit, but I am not sure.
25294 (Expression::ImplicitLongConstantConversionPossible,
25295 Expression::ImplicitIntConstantConversionPossible): New functions
25296 that tell whether is it possible to apply an implicit constant
25297 expression conversion.
25299 (ConvertNumericExplicit): Started work on explicit numeric
25302 * cs-parser.jay: Update operator constants.
25304 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
25305 (Parameters::GetSignature): Hook up VerifyArgs here.
25306 (Parameters::VerifyArgs): Verifies that no two arguments have the
25309 * class.cs (Operator): Update the operator names to reflect the
25310 ones that the spec expects (as we are just stringizing the
25313 * expression.cs (Unary::ResolveOperator): Fix bug: Use
25314 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
25315 previous usage did only work for our methods.
25316 (Expression::ConvertImplicit): Handle decimal implicit numeric
25317 conversions as well.
25318 (Expression::InternalTypeConstructor): Used to invoke constructors
25319 on internal types for default promotions.
25321 (Unary::Emit): Implement special handling for the pre/post
25322 increment/decrement for overloaded operators, as they need to have
25323 the same semantics as the other operators.
25325 (Binary::ResolveOperator): ditto.
25326 (Invocation::ConversionExists): ditto.
25327 (UserImplicitCast::Resolve): ditto.
25329 2001-09-26 Ravi Pratap <ravi@ximian.com>
25331 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
25332 operator, return after emitting body. Regression tests pass again !
25334 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
25335 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
25336 (Invocation::OverloadResolve): Ditto.
25337 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
25339 * everywhere : update calls to the above methods accordingly.
25341 2001-09-26 Miguel de Icaza <miguel@ximian.com>
25343 * assign.cs (Assign): Make it inherit from ExpressionStatement.
25345 * expression.cs (ExpressionStatement): New base class used for
25346 expressions that can appear in statements, so that we can provide
25347 an alternate path to generate expression that do not leave a value
25350 (Expression::Emit, and all the derivatives): We no longer return
25351 whether a value is left on the stack or not. Every expression
25352 after being emitted leaves a single value on the stack.
25354 * codegen.cs (EmitContext::EmitStatementExpression): Use the
25355 facilties of ExpressionStatement if possible.
25357 * cs-parser.jay: Update statement_expression.
25359 2001-09-25 Miguel de Icaza <miguel@ximian.com>
25361 * driver.cs: Change the wording of message
25363 2001-09-25 Ravi Pratap <ravi@ximian.com>
25365 * expression.cs (Binary::ResolveOperator): Had forgottten to set
25366 the type of the expression to the return type of the method if
25367 we have an overloaded operator match ! The regression tests pass again !
25368 (Unary::ResolveOperator): Ditto.
25370 * expression.cs (Invocation::ConversionExists): Correct the member lookup
25371 to find "op_Implicit", not "implicit" ;-)
25372 (UserImplicitCast): New class to take care of user-defined implicit conversions.
25373 (ConvertImplicit, ForceConversion): Take TypeContainer argument
25375 * everywhere : Correct calls to the above accordingly.
25377 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
25378 (ConvertImplicit): Do user-defined conversion if it exists.
25380 2001-09-24 Miguel de Icaza <miguel@ximian.com>
25382 * assign.cs: track location.
25383 (Resolve): Use implicit conversions on assignment.
25385 * literal.cs: Oops. Not good, Emit of short access values should
25386 pass (Bytes) or the wrong argument will be selected.
25388 * expression.cs (Unary::Emit): Emit code for -expr.
25390 (Unary::ResolveOperator): Handle `Substract' for non-constants
25391 (substract from zero from the non-constants).
25392 Deal with Doubles as well.
25394 (Expression::ConvertImplicitRequired): New routine that reports an
25395 error if no implicit conversion exists.
25397 (Invocation::OverloadResolve): Store the converted implicit
25398 expressions if we make them
25400 2001-09-24 Ravi Pratap <ravi@ximian.com>
25402 * class.cs (ConstructorInitializer): Take a Location argument.
25403 (ConstructorBaseInitializer): Same here.
25404 (ConstructorThisInitializer): Same here.
25406 * cs-parser.jay : Update all calls accordingly.
25408 * expression.cs (Unary, Binary, New): Take location argument.
25409 Update accordingly everywhere.
25411 * cs-parser.jay : Update all calls to the above to take a location
25414 * class.cs : Ditto.
25416 2001-09-24 Ravi Pratap <ravi@ximian.com>
25418 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
25419 (Invocation::BetterConversion): Same here
25420 (Invocation::ConversionExists): Ditto.
25422 (Invocation::ConversionExists): Implement.
25424 2001-09-22 Ravi Pratap <ravi@ximian.com>
25426 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
25427 Also take an additional TypeContainer argument.
25429 * All over : Pass in TypeContainer as argument to OverloadResolve.
25431 * typemanager.cs (CSharpName): Update to check for the string type and return
25434 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
25437 2001-09-21 Ravi Pratap <ravi@ximian.com>
25439 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
25440 (Invocation::BetterFunction): Implement.
25441 (Invocation::BetterConversion): Implement.
25442 (Invocation::ConversionExists): Skeleton, no implementation yet.
25444 Okay, things work fine !
25446 2001-09-21 Miguel de Icaza <miguel@ximian.com>
25448 * typemanager.cs: declare and load enum_type, delegate_type and
25451 * expression.cs (Expression::Emit): Now emit returns a value that
25452 tells whether a value is left on the stack or not. This strategy
25453 might be reveted tomorrow with a mechanism that would address
25454 multiple assignments.
25455 (Expression::report118): Utility routine to report mismatches on
25458 (Unary::Report23): Report impossible type/operator combination
25461 (Unary::IsIncrementableNumber): Whether the type can be
25462 incremented or decremented with add.
25463 (Unary::ResolveOperator): Also allow enumerations to be bitwise
25465 (Unary::ResolveOperator): Implement ++, !, ~,
25467 (Invocation::Emit): Deal with new Emit convetion.
25469 * All Expression derivatives: Updated their Emit method to return
25470 whether they leave values on the stack or not.
25472 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
25473 stack for expressions that are statements.
25475 2001-09-20 Miguel de Icaza <miguel@ximian.com>
25477 * expression.cs (LValue): New interface. Must be implemented by
25479 (LocalVariableReference, ParameterReference, FieldExpr): Implement
25482 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
25483 interface for generating code, simplifies the code.
25485 2001-09-20 Ravi Pratap <ravi@ximian.com>
25487 * expression.cs (everywhere): Comment out return statements in ::Resolve
25488 methods to avoid the warnings.
25490 2001-09-20 Miguel de Icaza <miguel@ximian.com>
25492 * driver.cs (parse): Report error 2001 if we can not open the
25495 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
25498 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
25501 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
25502 otherwise nested blocks end up with the same index.
25504 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
25506 * expression.cs: Instead of having FIXMEs in the Resolve
25507 functions, throw exceptions so it is obvious that we are facing a
25510 * cs-parser.jay (invocation_expression): Pass Location information.
25512 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
25513 Use a basename for those routines because .NET does not like paths
25516 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
25519 2001-09-19 Miguel de Icaza <miguel@ximian.com>
25521 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
25522 are loading the correct data types (throws an exception if not).
25523 (TypeManager::InitCoreTypes): Use CoreLookupType
25525 * expression.cs (Unary::ResolveOperator): return the child
25526 expression for expressions which are just +expr.
25527 (Unary::ResolveOperator): Return negative literals for -LITERAL
25528 expressions (otherwise they are Unary {Literal}).
25529 (Invocation::Badness): Take into account `Implicit constant
25530 expression conversions'.
25532 * literal.cs (LongLiteral): Implement long literal class.
25533 (IntLiteral): export the `Value' of the intliteral.
25535 2001-09-19 Ravi Pratap <ravi@ximian.com>
25537 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
25539 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
25540 instead of 'Operator'
25542 * expression.cs (Binary::ResolveOperator): Update accordingly.
25543 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
25546 * cs-parser.jay (unary_expression): Update to use the new names.
25548 * gen-treedump.cs (GetUnary): Same here.
25550 * expression.cs (Unary::Resolve): Implement.
25551 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
25552 operators are found instead of making noise ;-)
25553 (Unary::ResolveOperator): New method to do precisely the same thing which
25554 Binary::ResolveOperator does for Binary expressions.
25555 (Unary.method, .Arguments): Add.
25556 (Unary::OperName): Implement.
25557 (Unary::ForceConversion): Copy and Paste !
25559 * class.cs (Operator::Define): Fix a small bug for the case when we have
25562 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
25563 for the inbuilt operators. Only overloading works for now ;-)
25565 2001-09-18 Miguel de Icaza <miguel@ximian.com>
25567 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
25568 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
25570 * expression.cs (This::Emit): Implement.
25571 (This::Resolve): Implement.
25572 (TypeOf:Resolve): Implement.
25573 (Expression::ResolveSimpleName): Add an implicit this to instance
25575 (MemberAccess::Resolve): Deal with Parameters and Fields.
25576 Bind instance variable to Field expressions.
25577 (FieldExpr::Instance): New field used to track the expression that
25578 represents the object instance.
25579 (FieldExpr::Resolve): Track potential errors from MemberLookup not
25581 (FieldExpr::Emit): Implement.
25583 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
25584 the last instruction contains a return opcode to avoid generating
25585 the last `ret' instruction (this generates correct code, and it is
25586 nice to pass the peverify output).
25588 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
25589 initializer for static and instance variables.
25590 (Constructor::Emit): Allow initializer to be null in the case of
25591 static constructors. Only emit initializer for instance
25594 (TypeContainer::FindMembers): Return a null array if there are no
25597 Also fix the code for the MemberTypes.Method branch, as it was not
25598 scanning that for operators (or tried to access null variables before).
25600 * assign.cs (Assign::Emit): Handle instance and static fields.
25604 * driver.cs: Stop compilation if there are parse errors.
25606 * cs-parser.jay (constructor_declaration): Provide default base
25607 initializer for non-static constructors.
25608 (constructor_declarator): Do not provide a default base
25609 initializers if none was specified.
25610 Catch the fact that constructors should not have parameters.
25612 * class.cs: Do not emit parent class initializers for static
25613 constructors, that should be flagged as an error.
25615 2001-09-18 Ravi Pratap <ravi@ximian.com>
25617 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
25618 Move back code into TypeContainer::Populate.
25620 2001-09-18 Ravi Pratap <ravi@ximian.com>
25622 * class.cs (TypeContainer::AddConstructor): Fix the check to
25623 compare against Name, not Basename.
25624 (Operator::OpType): Change Plus and Minus to Add and Subtract.
25626 * cs-parser.jay : Update accordingly.
25628 * class.cs (TypeContainer::FindMembers): For the case where we are searching
25629 for methods, don't forget to look into the operators too.
25630 (RegisterMethodBuilder): Helper method to take care of this for
25631 methods, constructors and operators.
25632 (Operator::Define): Completely revamp.
25633 (Operator.OperatorMethod, MethodName): New fields.
25634 (TypeContainer::Populate): Move the registering of builders into
25635 RegisterMethodBuilder.
25636 (Operator::Emit): Re-write.
25638 * expression.cs (Binary::Emit): Comment out code path to emit method
25639 invocation stuff for the case when we have a user defined operator. I am
25640 just not able to get it right !
25642 2001-09-17 Miguel de Icaza <miguel@ximian.com>
25644 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
25647 (Expression::MemberLookup): Provide a version that allows to
25648 specify the MemberTypes and BindingFlags.
25650 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
25651 so it was not fetching variable information from outer blocks.
25653 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
25654 Beforefieldinit as it was buggy.
25656 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
25657 that Ravi put here.
25659 * class.cs (Constructor::Emit): Only emit if block is not null.
25660 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
25661 deal with this by semantically definining it as if the user had
25664 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
25665 constructors as we now "emit" them at a higher level.
25667 (TypeContainer::DefineDefaultConstructor): Used to define the
25668 default constructors if none was provided.
25670 (ConstructorInitializer): Add methods Resolve and Emit.
25672 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
25674 2001-09-17 Ravi Pratap <ravi@ximian.com>
25676 * class.cs (TypeContainer::EmitDefaultConstructor): Register
25677 the default constructor builder with our hashtable for methodbuilders
25680 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
25681 and argument_count is 0 in which case we have a match.
25682 (Binary::ResolveOperator): More null checking and miscellaneous coding
25685 2001-09-17 Ravi Pratap <ravi@ximian.com>
25687 * rootcontext.cs (IsNameSpace): Compare against null.
25689 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
25691 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
25692 and Unary::Operator.
25694 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
25697 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
25698 we have overloaded operators.
25699 (Binary::ResolveOperator): Implement the part which does the operator overload
25702 * class.cs (Operator::Emit): Implement.
25703 (TypeContainer::Emit): Emit the operators we have too.
25705 * expression.cs (Binary::Emit): Update to emit the appropriate code for
25706 the case when we have a user-defined operator.
25708 2001-09-17 Miguel de Icaza <miguel@ximian.com>
25710 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
25712 2001-09-16 Ravi Pratap <ravi@ximian.com>
25714 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
25715 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
25716 (Constructor::Emit): Implement.
25717 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
25718 if we have no work to do.
25719 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
25722 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
25723 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
25725 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
25728 2001-09-15 Ravi Pratap <ravi@ximian.com>
25730 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
25732 (Tree::RecordNamespace): Method to do what the name says ;-)
25733 (Tree::Namespaces): Property to get at the namespaces hashtable.
25735 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
25738 * rootcontext.cs (IsNamespace): Fixed it :-)
25740 2001-09-14 Miguel de Icaza <miguel@ximian.com>
25742 * class.cs (TypeContainer::FindMembers): Add support for
25744 (MethodCore): New class that encapsulates both the shared aspects
25745 of a Constructor and a Method.
25746 (Method, Constructor): Factored pieces into MethodCore.
25748 * driver.cs: Added --fatal which makes errors throw exceptions.
25749 Load System assembly as well as part of the standard library.
25751 * report.cs: Allow throwing exceptions on errors for debugging.
25753 * modifiers.cs: Do not use `parent', instead use the real type
25754 container to evaluate permission settings.
25756 * class.cs: Put Ravi's patch back in. He is right, and we will
25757 have to cope with the
25759 2001-09-14 Ravi Pratap <ravi@ximian.com>
25761 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
25762 FamORAssem, not FamANDAssem.
25764 2001-09-14 Miguel de Icaza <miguel@ximian.com>
25766 * driver.cs: Added --parse option that only parses its input files
25769 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
25770 incorrect. IsTopLevel is not used to tell whether an object is
25771 root_types or not (that can be achieved by testing this ==
25772 root_types). But to see if this is a top-level *class* (not
25773 necessarly our "toplevel" container).
25775 2001-09-14 Ravi Pratap <ravi@ximian.com>
25777 * enum.cs (Enum::Define): Modify to call the Lookup method on the
25778 parent instead of a direct call to GetType.
25780 2001-09-14 Ravi Pratap <ravi@ximian.com>
25782 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
25783 Modifiers.TypeAttr. This should just be a call to that method.
25785 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
25786 object so that we can determine if we are top-level or not.
25788 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
25791 * enum.cs (Enum::Define): Ditto.
25793 * modifiers.cs (FieldAttr): Re-write.
25795 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
25796 (TypeContainer::HaveStaticConstructor): New property to provide access
25797 to precisely that info.
25799 * modifiers.cs (MethodAttr): Re-write.
25800 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
25802 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
25803 of top-level types as claimed.
25805 2001-09-13 Miguel de Icaza <miguel@ximian.com>
25807 * expression.cs (MemberLookup): Fruitless attempt to lookup
25808 constructors. Maybe I need to emit default constructors? That
25809 might be it (currently .NET emits this for me automatically).
25810 (Invocation::OverloadResolve): Cope with Arguments == null.
25811 (Invocation::EmitArguments): new function, shared by the new
25812 constructor and us.
25813 (Invocation::Emit): Handle static and instance methods. Emit
25814 proper call instruction for virtual or non-virtual invocations.
25815 (New::Emit): Implement.
25816 (New::Resolve): Implement.
25817 (MemberAccess:Resolve): Implement.
25818 (MethodGroupExpr::InstanceExpression): used conforming to the spec
25819 to track instances.
25820 (FieldExpr::Resolve): Set type.
25822 * support.cs: Handle empty arguments.
25824 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
25825 SimpleLookup): Auxiliary routines to help parse a qualifier
25828 Update qualifier_identifier rule.
25830 * codegen.cs: Removed debugging messages.
25832 * class.cs: Make this a global thing, this acts just as a "key" to
25833 objects that we might have around.
25835 (Populate): Only initialize method_builders_to_methods once.
25837 * expression.cs (PropertyExpr): Initialize type from the
25840 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
25841 Resolve pattern. Attempt to implicitly convert value to boolean.
25844 * expression.cs: Set the type for the int32/int32 argument case.
25845 (Binary::ResolveOperator): Set the return type to boolean for
25846 comparission operators
25848 * typemanager.cs: Remove debugging print code.
25850 (Invocation::Resolve): resolve type.
25852 * class.cs: Allocate a MemberInfo of the correct size, as the code
25853 elsewhere depends on the test to reflect the correct contents.
25855 (Method::) Keep track of parameters, due to System.Reflection holes
25857 (TypeContainer::Populate): Keep track of MethodBuilders to Method
25860 (TypeContainer::FindMembers): Use ArrayList and then copy an array
25861 of the exact size and return that.
25863 (Class::LookupMethodByBuilder): New function that maps
25864 MethodBuilders to its methods. Required to locate the information
25865 on methods because System.Reflection bit us again.
25867 * support.cs: New file, contains an interface ParameterData and
25868 two implementations: ReflectionParameters and InternalParameters
25869 used to access Parameter information. We will need to grow this
25872 * expression.cs (Invocation::GetParameterData): implement a cache
25873 and a wrapper around the ParameterData creation for methods.
25874 (Invocation::OverloadResolve): Use new code.
25876 2001-09-13 Ravi Pratap <ravi@ximian.com>
25878 * class.cs (TypeContainer::EmitField): Remove and move into
25879 (Field::Define): here and modify accordingly.
25880 (Field.FieldBuilder): New member.
25881 (TypeContainer::Populate): Update accordingly.
25882 (TypeContainer::FindMembers): Implement.
25884 2001-09-13 Miguel de Icaza <miguel@ximian.com>
25886 * statement.cs: (VariableInfo::VariableType): New field to be
25887 initialized with the full type once it is resolved.
25889 2001-09-12 Miguel de Icaza <miguel@ximian.com>
25891 * parameter.cs (GetParameterInfo): Use a type cache to compute
25892 things only once, and to reuse this information
25894 * expression.cs (LocalVariableReference::Emit): Implement.
25895 (OpcodeCast::Emit): fix.
25897 (ParameterReference::Resolve): Implement.
25898 (ParameterReference::Emit): Implement.
25900 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
25901 that are expressions need to stay as Expressions.
25903 * typemanager.cs (CSharpName): Returns the C# name of a type if
25906 * expression.cs (Expression::ConvertImplicit): New function that
25907 implements implicit type conversions.
25909 (Expression::ImplicitReferenceConversion): Implements implicit
25910 reference conversions.
25912 (EmptyCast): New type for transparent casts.
25914 (OpcodeCast): New type for casts of types that are performed with
25915 a sequence of bytecodes.
25917 (BoxedCast): New type used for casting value types into reference
25918 types. Emits a box opcode.
25920 (Binary::DoNumericPromotions): Implements numeric promotions of
25921 and computation of the Binary::Type.
25923 (Binary::EmitBranchable): Optimization.
25925 (Binary::Emit): Implement code emission for expressions.
25927 * typemanager.cs (TypeManager): Added two new core types: sbyte
25930 2001-09-12 Ravi Pratap <ravi@ximian.com>
25932 * class.cs (TypeContainer::FindMembers): Method which does exactly
25933 what Type.FindMembers does, only we don't have to use reflection. No
25934 implementation yet.
25936 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
25937 typecontainer objects as we need to get at them.
25938 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
25940 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
25941 typecontainer object.
25943 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
25944 of just a Report object.
25946 2001-09-11 Ravi Pratap <ravi@ximian.com>
25948 * class.cs (Event::Define): Go back to using the prefixes "add_" and
25950 (TypeContainer::Populate): Now define the delegates of the type too.
25951 (TypeContainer.Delegates): Property to access the list of delegates defined
25954 * delegates.cs (Delegate::Define): Implement partially.
25956 * modifiers.cs (TypeAttr): Handle more flags.
25958 2001-09-11 Ravi Pratap <ravi@ximian.com>
25960 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
25962 (Operator::Define): Re-write logic to get types by using the LookupType method
25963 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
25964 (Indexer::Define): Ditto.
25965 (Event::Define): Ditto.
25966 (Property::Define): Ditto.
25968 2001-09-10 Ravi Pratap <ravi@ximian.com>
25970 * class.cs (TypeContainer::Populate): Now define operators too.
25971 (TypeContainer.Operators): New property to access the list of operators
25973 (Operator.OperatorMethodBuilder): New member to hold the method builder
25974 for the operator we are defining.
25975 (Operator::Define): Implement.
25977 2001-09-10 Ravi Pratap <ravi@ximian.com>
25979 * class.cs (Event::Define): Make the prefixes of the accessor methods
25980 addOn_ and removeOn_
25982 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
25983 of the location being passed in too. Ideally, this should go later since all
25984 error reporting should be done through the Report object.
25986 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
25987 (Populate): Iterate thru the indexers we have and define them too.
25988 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
25989 for the get and set accessors.
25990 (Indexer::Define): Implement.
25992 2001-09-09 Miguel de Icaza <miguel@ximian.com>
25994 * expression.cs (Binary::Resolve): Beginning of it. I scratched
25995 my previous implementation, did not work.
25997 * typemanager.cs: Add a couple of missing types (the longs).
25999 * literal.cs: Use TypeManager.bool_type instead of getting it.
26001 * expression.cs (EventExpr): New kind of expressions.
26002 (Expressio::ExprClassFromMemberInfo): finish
26004 2001-09-08 Miguel de Icaza <miguel@ximian.com>
26006 * assign.cs: Emit stores to static fields differently.
26008 2001-09-08 Ravi Pratap <ravi@ximian.com>
26010 * Merge in changes and adjust code to tackle conflicts. Backed out my
26011 code in Assign::Resolve ;-)
26013 2001-09-08 Ravi Pratap <ravi@ximian.com>
26015 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
26016 instead Report.Error and also pass in the location.
26017 (CSharpParser::Lexer): New readonly property to return the reference
26018 to the Tokenizer object.
26019 (declare_local_variables): Use Report.Error with location instead of plain
26023 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
26024 (Operator.CheckBinaryOperator): Ditto.
26026 * cs-parser.jay (operator_declarator): Update accordingly.
26028 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
26029 (CheckBinaryOperator): Same here.
26031 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
26032 on the name without any prefixes of namespace names etc. This is because we
26033 already might have something already fully qualified like
26034 'System.Console.WriteLine'
26036 * assign.cs (Resolve): Begin implementation. Stuck ;-)
26038 2001-09-07 Ravi Pratap <ravi@ximian.com>
26040 * cs-tokenizer.cs (location): Return a string which also contains
26043 * expression.cs (ElementAccess): New class for expressions of the
26044 type 'element access.'
26045 (BaseAccess): New class for expressions of the type 'base access.'
26046 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
26049 * cs-parser.jay (element_access): Implement action.
26050 (base_access): Implement actions.
26051 (checked_expression, unchecked_expression): Implement.
26053 * cs-parser.jay (local_variable_type): Correct and implement.
26054 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
26056 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
26058 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
26059 name and the specifiers.
26061 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
26063 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
26064 making them all public ;-)
26066 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
26069 2001-09-07 Miguel de Icaza <miguel@ximian.com>
26071 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
26073 (FieldExpr, PropertyExprs): New resolved expressions.
26074 (SimpleName::MemberStaticCheck): Perform static checks for access
26075 to non-static fields on static methods. Maybe this should be
26076 generalized for MemberAccesses.
26077 (SimpleName::ResolveSimpleName): More work on simple name
26080 * cs-parser.jay (primary_expression/qualified_identifier): track
26081 the parameter index.
26083 * codegen.cs (CodeGen::Save): Catch save exception, report error.
26084 (EmitContext::EmitBoolExpression): Chain to expression generation
26085 instead of temporary hack.
26086 (::EmitStatementExpression): Put generic expression code generation.
26088 * assign.cs (Assign::Emit): Implement variable assignments to
26089 local variables, parameters and fields.
26091 2001-09-06 Miguel de Icaza <miguel@ximian.com>
26093 * statement.cs (Block::GetVariableInfo): New method, returns the
26094 VariableInfo for a variable name in a block.
26095 (Block::GetVariableType): Implement in terms of GetVariableInfo
26097 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
26098 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
26100 2001-09-06 Ravi Pratap <ravi@ximian.com>
26102 * cs-parser.jay (operator_declaration): Continue on my quest : update
26103 to take attributes argument.
26104 (event_declaration): Ditto.
26105 (enum_declaration): Ditto.
26106 (indexer_declaration): Ditto.
26108 * class.cs (Operator::Operator): Update constructor accordingly.
26109 (Event::Event): Ditto.
26111 * delegate.cs (Delegate::Delegate): Same here.
26113 * enum.cs (Enum::Enum): Same here.
26115 2001-09-05 Ravi Pratap <ravi@ximian.com>
26117 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
26119 * ../tests/cs0658.cs : New file to demonstrate error 0658.
26121 * attribute.cs (Attributes): New class to encapsulate all attributes which were
26122 being passed around as an arraylist.
26123 (Attributes::AddAttribute): Method to add attribute sections.
26125 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
26126 (struct_declaration): Update accordingly.
26127 (constant_declaration): Update.
26128 (field_declaration): Update.
26129 (method_header): Update.
26130 (fixed_parameter): Update.
26131 (parameter_array): Ditto.
26132 (property_declaration): Ditto.
26133 (destructor_declaration): Ditto.
26135 * class.cs (Struct::Struct): Update constructors accordingly.
26136 (Class::Class): Ditto.
26137 (Field::Field): Ditto.
26138 (Method::Method): Ditto.
26139 (Property::Property): Ditto.
26140 (TypeContainer::OptAttribute): update property's return type.
26142 * interface.cs (Interface.opt_attributes): New member.
26143 (Interface::Interface): Update to take the extra Attributes argument.
26145 * parameter.cs (Parameter::Parameter): Ditto.
26147 * constant.cs (Constant::Constant): Ditto.
26149 * interface.cs (InterfaceMemberBase): New OptAttributes field.
26150 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
26151 the attributes as a parameter.
26152 (InterfaceProperty): Update constructor call.
26153 (InterfaceEvent): Ditto.
26154 (InterfaceMethod): Ditto.
26155 (InterfaceIndexer): Ditto.
26157 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
26158 pass the attributes too.
26159 (interface_event_declaration): Ditto.
26160 (interface_property_declaration): Ditto.
26161 (interface_method_declaration): Ditto.
26162 (interface_declaration): Ditto.
26164 2001-09-05 Miguel de Icaza <miguel@ximian.com>
26166 * class.cs (Method::Define): Track the "static Main" definition to
26167 create an entry point.
26169 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
26170 EntryPoint if we find it.
26172 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
26173 (EmitContext::ig): Make this variable public.
26175 * driver.cs: Make the default output file be the first file name
26176 with the .exe extension.
26178 Detect empty compilations
26180 Handle various kinds of output targets. Handle --target and
26181 rename -t to --dumper.
26183 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
26184 methods inherited from Expression return now an Expression. This
26185 will is used during the tree rewriting as we resolve them during
26188 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
26189 the spec. Missing entirely is the information about
26190 accessability of elements of it.
26192 (Expression::ExprClassFromMemberInfo): New constructor for
26193 Expressions that creates a fully initialized Expression based on
26194 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
26197 (Invocation::Resolve): Begin implementing resolution of invocations.
26199 * literal.cs (StringLiteral): Implement Emit.
26201 2001-09-05 Ravi Pratap <ravi@ximian.com>
26203 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
26206 2001-09-04 Ravi Pratap <ravi@ximian.com>
26208 * cs-parser.jay (attribute_arguments): Implement actions.
26209 (attribute): Fix bug in production. Implement action.
26210 (attribute_list): Implement.
26211 (attribute_target): Implement.
26212 (attribute_target_specifier, opt_target_specifier): Implement
26213 (CheckAttributeTarget): New method to check if the attribute target
26215 (attribute_section): Implement.
26216 (opt_attributes): Implement.
26218 * attribute.cs : New file to handle attributes.
26219 (Attribute): Class to hold attribute info.
26221 * cs-parser.jay (opt_attribute_target_specifier): Remove production
26222 (attribute_section): Modify production to use 2 different rules to
26223 achieve the same thing. 1 s/r conflict down !
26224 Clean out commented, useless, non-reducing dimension_separator rules.
26226 * class.cs (TypeContainer.attributes): New member to hold list
26227 of attributes for a type.
26228 (Struct::Struct): Modify to take one more argument, the attribute list.
26229 (Class::Class): Ditto.
26230 (Field::Field): Ditto.
26231 (Method::Method): Ditto.
26232 (Property::Property): Ditto.
26234 * cs-parser.jay (struct_declaration): Update constructor call to
26235 pass in the attributes too.
26236 (class_declaration): Ditto.
26237 (constant_declaration): Ditto.
26238 (field_declaration): Ditto.
26239 (method_header): Ditto.
26240 (fixed_parameter): Ditto.
26241 (parameter_array): Ditto.
26242 (property_declaration): Ditto.
26244 * constant.cs (Constant::Constant): Update constructor similarly.
26245 Use System.Collections.
26247 * parameter.cs (Parameter::Parameter): Update as above.
26249 2001-09-02 Ravi Pratap <ravi@ximian.com>
26251 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
26252 (TypeContainer.delegates): New member to hold list of delegates.
26254 * cs-parser.jay (delegate_declaration): Implement the action correctly
26255 this time as I seem to be on crack ;-)
26257 2001-09-02 Miguel de Icaza <miguel@ximian.com>
26259 * rootcontext.cs (RootContext::IsNamespace): new function, used to
26260 tell whether an identifier represents a namespace.
26262 * expression.cs (NamespaceExpr): A namespace expression, used only
26263 temporarly during expression resolution.
26264 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
26265 utility functions to resolve names on expressions.
26267 2001-09-01 Miguel de Icaza <miguel@ximian.com>
26269 * codegen.cs: Add hook for StatementExpressions.
26271 * class.cs: Fix inverted test for static flag in methods.
26273 2001-09-02 Ravi Pratap <ravi@ximian.com>
26275 * class.cs (Operator::CheckUnaryOperator): Correct error number used
26276 to make it coincide with MS' number.
26277 (Operator::CheckBinaryOperator): Ditto.
26279 * ../errors/errors.txt : Remove error numbers added earlier.
26281 * ../errors/cs1019.cs : Test case for error # 1019
26283 * ../errros/cs1020.cs : Test case for error # 1020
26285 * cs-parser.jay : Clean out commented cruft.
26286 (dimension_separators, dimension_separator): Comment out. Ostensibly not
26287 used anywhere - non-reducing rule.
26288 (namespace_declarations): Non-reducing rule - comment out.
26290 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
26291 with TypeContainer::AddEnum.
26293 * delegate.cs : New file for delegate handling classes.
26294 (Delegate): Class for declaring delegates.
26296 * makefile : Update.
26298 * cs-parser.jay (delegate_declaration): Implement.
26300 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
26302 * class.cs (Event::Define): Implement.
26303 (Event.EventBuilder): New member.
26305 * class.cs (TypeContainer::Populate): Update to define all enums and events
26307 (Events): New property for the events arraylist we hold. Shouldn't we move to using
26308 readonly fields for all these cases ?
26310 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
26312 * class.cs (Property): Revamp to use the convention of making fields readonly.
26313 Accordingly modify code elsewhere.
26315 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
26316 the Define method of the Property class.
26318 * class.cs : Clean up applied patch and update references to variables etc. Fix
26320 (TypeContainer::Populate): Update to define all the properties we have. Also
26321 define all enumerations.
26323 * enum.cs (Define): Implement.
26325 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
26327 * cs-parser.jay (overloadable_operator): The semantic value is an
26328 enum of the Operator class.
26329 (operator_declarator): Implement actions.
26330 (operator_declaration): Implement.
26332 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
26333 validity of definitions.
26334 (Operator::CheckBinaryOperator): Static method to check for binary operators
26335 (TypeContainer::AddOperator): New method to add an operator to a type.
26337 * cs-parser.jay (indexer_declaration): Added line to actually call the
26338 AddIndexer method so it gets added ;-)
26340 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
26341 already taken care of by the MS compiler ?
26343 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
26345 * class.cs (Operator): New class for operator declarations.
26346 (Operator::OpType): Enum for the various operators.
26348 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
26350 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
26351 ostensibly handle this in semantic analysis.
26353 * cs-parser.jay (general_catch_clause): Comment out
26354 (specific_catch_clauses, specific_catch_clause): Ditto.
26355 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
26356 (catch_args, opt_catch_args): New productions.
26357 (catch_clause): Rewrite to use the new productions above
26358 (catch_clauses): Modify accordingly.
26359 (opt_catch_clauses): New production to use in try_statement
26360 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
26361 and re-write the code in the actions to extract the specific and
26362 general catch clauses by being a little smart ;-)
26364 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
26365 Hooray, try and catch statements parse fine !
26367 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
26369 * statement.cs (Block::GetVariableType): Fix logic to extract the type
26370 string from the hashtable of variables.
26372 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
26373 I end up making that mistake ;-)
26374 (catch_clauses): Fixed gross error which made Key and Value of the
26375 DictionaryEntry the same : $1 !!
26377 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
26379 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
26381 * cs-parser.jay (event_declaration): Correct to remove the semicolon
26382 when the add and remove accessors are specified.
26384 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
26386 * cs-parser.jay (IndexerDeclaration): New helper class to hold
26387 information about indexer_declarator.
26388 (indexer_declarator): Implement actions.
26389 (parsing_indexer): New local boolean used to keep track of whether
26390 we are parsing indexers or properties. This is necessary because
26391 implicit_parameters come into picture even for the get accessor in the
26392 case of an indexer.
26393 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
26395 * class.cs (Indexer): New class for indexer declarations.
26396 (TypeContainer::AddIndexer): New method to add an indexer to a type.
26397 (TypeContainer::indexers): New member to hold list of indexers for the
26400 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
26402 * cs-parser.jay (add_accessor_declaration): Implement action.
26403 (remove_accessor_declaration): Implement action.
26404 (event_accessors_declaration): Implement
26405 (variable_declarators): swap statements for first rule - trivial.
26407 * class.cs (Event): New class to hold information about event
26409 (TypeContainer::AddEvent): New method to add an event to a type
26410 (TypeContainer::events): New member to hold list of events.
26412 * cs-parser.jay (event_declaration): Implement actions.
26414 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
26416 * cs-parser.jay (dim_separators): Implement. Make it a string
26417 concatenating all the commas together, just as they appear.
26418 (opt_dim_separators): Modify accordingly
26419 (rank_specifiers): Update accordingly. Basically do the same
26420 thing - instead, collect the brackets here.
26421 (opt_rank_sepcifiers): Modify accordingly.
26422 (array_type): Modify to actually return the complete type string
26423 instead of ignoring the rank_specifiers.
26424 (expression_list): Implement to collect the expressions
26425 (variable_initializer): Implement. We make it a list of expressions
26426 essentially so that we can handle the array_initializer case neatly too.
26427 (variable_initializer_list): Implement.
26428 (array_initializer): Make it a list of variable_initializers
26429 (opt_array_initializer): Modify accordingly.
26431 * expression.cs (New::NType): Add enumeration to help us
26432 keep track of whether we have an object/delegate creation
26433 or an array creation.
26434 (New:NewType, New::Rank, New::Indices, New::Initializers): New
26435 members to hold data about array creation.
26436 (New:New): Modify to update NewType
26437 (New:New): New Overloaded contructor for the array creation
26440 * cs-parser.jay (array_creation_expression): Implement to call
26441 the overloaded New constructor.
26443 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
26445 * class.cs (TypeContainer::Constructors): Return member
26446 constructors instead of returning null.
26448 2001-08-26 Miguel de Icaza <miguel@ximian.com>
26450 * typemanager.cs (InitCoreTypes): Initialize the various core
26451 types after we have populated the type manager with the user
26452 defined types (this distinction will be important later while
26453 compiling corlib.dll)
26455 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
26456 on Expression Classification. Now all expressions have a method
26457 `Resolve' and a method `Emit'.
26459 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
26460 generation from working. Also add some temporary debugging
26463 2001-08-24 Miguel de Icaza <miguel@ximian.com>
26465 * codegen.cs: Lots of code generation pieces. This is only the
26466 beginning, will continue tomorrow with more touches of polish. We
26467 handle the fundamentals of if, while, do, for, return. Others are
26468 trickier and I need to start working on invocations soon.
26470 * gen-treedump.cs: Bug fix, use s.Increment here instead of
26473 * codegen.cs (EmitContext): New struct, used during code
26474 emission to keep a context. Most of the code generation will be
26477 * cs-parser.jay: Add embedded blocks to the list of statements of
26478 this block. So code generation proceeds in a top down fashion.
26480 2001-08-23 Miguel de Icaza <miguel@ximian.com>
26482 * statement.cs: Add support for multiple child blocks.
26484 2001-08-22 Miguel de Icaza <miguel@ximian.com>
26486 * codegen.cs (EmitCode): New function, will emit the code for a
26487 Block of code given a TypeContainer and its ILGenerator.
26489 * statement.cs (Block): Standard public readonly optimization.
26490 (Block::Block constructors): Link children.
26491 (Block::Child): Child Linker.
26492 (Block::EmitVariables): Emits IL variable declarations.
26494 * class.cs: Drop support for MethodGroups here, delay until
26496 (Method::): Applied the same simplification that I did before, and
26497 move from Properties to public readonly fields.
26498 (Method::ParameterTypes): Returns the parameter types for the
26499 function, and implements a cache that will be useful later when I
26500 do error checking and the semantic analysis on the methods is
26502 (Constructor::GetCallingConvention): Renamed from CallingConvetion
26503 and made a method, optional argument tells whether this is a class
26504 or a structure to apply the `has-this' bit.
26505 (Method::GetCallingConvention): Implement, returns the calling
26507 (Method::Define): Defines the type, a second pass is performed
26508 later to populate the methods.
26510 (Constructor::ParameterTypes): implement a cache similar to the
26511 one on Method::ParameterTypes, useful later when we do semantic
26514 (TypeContainer::EmitMethod): New method. Emits methods.
26516 * expression.cs: Removed MethodGroup class from here.
26518 * parameter.cs (Parameters::GetCallingConvention): new method.
26520 2001-08-21 Miguel de Icaza <miguel@ximian.com>
26522 * class.cs (TypeContainer::Populate): Drop RootContext from the
26525 (Constructor::CallingConvention): Returns the calling convention.
26526 (Constructor::ParameterTypes): Returns the constructor parameter
26529 (TypeContainer::AddConstructor): Keep track of default constructor
26530 and the default static constructor.
26532 (Constructor::) Another class that starts using `public readonly'
26533 instead of properties.
26535 (Constructor::IsDefault): Whether this is a default constructor.
26537 (Field::) use readonly public fields instead of properties also.
26539 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
26540 track of static constructors; If none is used, turn on
26541 BeforeFieldInit in the TypeAttributes.
26543 * cs-parser.jay (opt_argument_list): now the return can be null
26544 for the cases where there are no arguments.
26546 (constructor_declarator): If there is no implicit `base' or
26547 `this', then invoke the default parent constructor.
26549 * modifiers.cs (MethodAttr): New static function maps a set of
26550 modifiers flags into a MethodAttributes enum
26551 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
26552 MethodAttr, TypeAttr to represent the various mappings where the
26553 modifiers are used.
26554 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
26556 2001-08-19 Miguel de Icaza <miguel@ximian.com>
26558 * parameter.cs (GetParameterInfo): Fix bug where there would be no
26561 * interface.cs (PopulateIndexer): Implemented the code generator
26562 for interface indexers.
26564 2001-08-17 Miguel de Icaza <miguel@ximian.com>
26566 * interface.cs (InterfaceMemberBase): Now we track the new status
26569 (PopulateProperty): Implement property population. Woohoo! Got
26570 Methods and Properties going today.
26572 Removed all the properties for interfaces, and replaced them with
26573 `public readonly' fields.
26575 2001-08-16 Miguel de Icaza <miguel@ximian.com>
26577 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
26578 initialize their hashtables/arraylists only when they are needed
26579 instead of doing this always.
26581 * parameter.cs: Handle refs and out parameters.
26583 * cs-parser.jay: Use an ArrayList to construct the arguments
26584 instead of the ParameterCollection, and then cast that to a
26587 * parameter.cs: Drop the use of ParameterCollection and use
26588 instead arrays of Parameters.
26590 (GetParameterInfo): Use the Type, not the Name when resolving
26593 2001-08-13 Miguel de Icaza <miguel@ximian.com>
26595 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
26596 and instead use public readonly fields.
26598 * class.cs: Put back walking code for type containers.
26600 2001-08-11 Miguel de Icaza <miguel@ximian.com>
26602 * class.cs (MakeConstant): Code to define constants.
26604 * rootcontext.cs (LookupType): New function. Used to locate types
26607 2001-08-08 Miguel de Icaza <miguel@ximian.com>
26609 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
26610 this System.Reflection code is. Kudos to Microsoft
26612 * typemanager.cs: Implement a type cache and avoid loading all
26613 types at boot time. Wrap in LookupType the internals. This made
26614 the compiler so much faster. Wow. I rule!
26616 * driver.cs: Make sure we always load mscorlib first (for
26617 debugging purposes, nothing really important).
26619 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
26620 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
26622 * rootcontext.cs: Lookup types on their namespace; Lookup types
26623 on namespaces that have been imported using the `using' keyword.
26625 * class.cs (TypeContainer::TypeAttr): Virtualize.
26626 (Class::TypeAttr): Return attributes suitable for this bad boy.
26627 (Struct::TypeAttr): ditto.
26628 Handle nested classes.
26629 (TypeContainer::) Remove all the type visiting code, it is now
26630 replaced with the rootcontext.cs code
26632 * rootcontext.cs (GetClassBases): Added support for structs.
26634 2001-08-06 Miguel de Icaza <miguel@ximian.com>
26636 * interface.cs, statement.cs, class.cs, parameter.cs,
26637 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
26638 Drop use of TypeRefs, and use strings instead.
26640 2001-08-04 Miguel de Icaza <miguel@ximian.com>
26644 * class.cs (Struct::Struct): set the SEALED flags after
26645 checking the modifiers.
26646 (TypeContainer::TypeAttr): new property, returns the
26647 TypeAttributes for a class.
26649 * cs-parser.jay (type_list): Oops, list production was creating a
26650 new list of base types.
26652 * rootcontext.cs (StdLib): New property.
26653 (GetInterfaceTypeByName): returns an interface by type name, and
26654 encapsulates error handling here.
26655 (GetInterfaces): simplified.
26656 (ResolveTree): Encapsulated all the tree resolution here.
26657 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
26660 * driver.cs: Add support for --nostdlib, to avoid loading the
26661 default assemblies.
26662 (Main): Do not put tree resolution here.
26664 * rootcontext.cs: Beginning of the class resolution.
26666 2001-08-03 Miguel de Icaza <miguel@ximian.com>
26668 * rootcontext.cs: Provide better error reporting.
26670 * cs-parser.jay (interface_base): set our $$ to be interfaces.
26672 * rootcontext.cs (CreateInterface): Handle the case where there
26673 are no parent interfaces.
26675 (CloseTypes): Routine to flush types at the end.
26676 (CreateInterface): Track types.
26677 (GetInterfaces): Returns an array of Types from the list of
26678 defined interfaces.
26680 * typemanager.c (AddUserType): Mechanism to track user types (puts
26681 the type on the global type hash, and allows us to close it at the
26684 2001-08-02 Miguel de Icaza <miguel@ximian.com>
26686 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
26687 RecordInterface instead.
26689 * cs-parser.jay: Updated to reflect changes above.
26691 * decl.cs (Definition): Keep track of the TypeBuilder type that
26692 represents this type here. Not sure we will use it in the long
26693 run, but wont hurt for now.
26695 * driver.cs: Smaller changes to accomodate the new code.
26697 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
26700 * rootcontext.cs (CreateInterface): New method, used to create
26701 the System.TypeBuilder type for interfaces.
26702 (ResolveInterfaces): new entry point to resolve the interface
26704 (CodeGen): Property, used to keep track of the code generator.
26706 2001-07-26 Miguel de Icaza <miguel@ximian.com>
26708 * cs-parser.jay: Add a second production for delegate_declaration
26711 (enum_body): Put an opt_comma here instead of putting it on
26712 enum_body or enum_member_declarations so we can handle trailing
26713 commas on enumeration members. Gets rid of a shift/reduce.
26715 (type_list): Need a COMMA in the middle.
26717 (indexer_declaration): Tell tokenizer to recognize get/set
26719 * Remove old targets.
26721 * Re-add the parser target.
26723 2001-07-13 Simon Cozens <simon@simon-cozens.org>
26725 * cs-parser.jay: Add precendence rules for a number of operators
26726 ot reduce the number of shift/reduce conflicts in the grammar.
26728 2001-07-17 Miguel de Icaza <miguel@ximian.com>
26730 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
26733 Get rid of old crufty code.
26735 * rootcontext.cs: Use this to keep track of the parsed
26736 representation and the defined types available to the program.
26738 * gen-treedump.cs: adjust for new convention.
26740 * type.cs: Split out the type manager, and the assembly builder
26743 * typemanager.cs: the type manager will live here now.
26745 * cil-codegen.cs: And the code generator here.
26747 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
26749 * makefile: Fixed up for easy making.
26751 2001-07-13 Simon Cozens <simon@simon-cozens.org>
26753 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
26756 (unary_expression): Expand pre_increment_expression and
26757 post_decrement_expression to reduce a shift/reduce.
26759 2001-07-11 Simon Cozens
26761 * cs-tokenizer.cs: Hex numbers should begin with a 0.
26763 Improve allow_keyword_as_indent name.
26765 2001-06-19 Miguel de Icaza <miguel@ximian.com>
26767 * Adjustments for Beta2.
26769 2001-06-13 Miguel de Icaza <miguel@ximian.com>
26771 * decl.cs: Added `Define' abstract method.
26772 (InTransit): new property, used to catch recursive definitions.
26774 * interface.cs: Implement `Define'.
26776 * modifiers.cs: Map Modifiers.constants to
26777 System.Reflection.TypeAttribute flags.
26779 * class.cs: Keep track of types and user-defined types.
26780 (BuilderInit): New method for creating an assembly
26781 (ResolveType): New function to launch the resolution process, only
26782 used by interfaces for now.
26784 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
26785 that are inserted into the name space.
26787 2001-06-08 Miguel de Icaza <miguel@ximian.com>
26789 * ARGH. I have screwed up my tree so many times due to the use of
26790 rsync rather than using CVS. Going to fix this at once.
26792 * driver.cs: Objetify driver. Load assemblies, use assemblies to
26795 2001-06-07 Miguel de Icaza <miguel@ximian.com>
26797 * Experiment successful: Use System.Type rather that our own
26800 2001-05-25 Miguel de Icaza <miguel@ximian.com>
26802 * cs-parser.jay: Removed nsAliases from here.
26804 Use new namespaces, handle `using XXX;'
26806 * namespace.cs: Reimplemented namespace handling, use a recursive
26807 definition of the class. Now we can keep track of using clauses
26808 and catch invalid using clauses.
26810 2001-05-24 Miguel de Icaza <miguel@ximian.com>
26812 * gen-treedump.cs: Adapted for all the renaming.
26814 * expression.cs (Expression): this class now has a Type property
26815 which returns an expression Type.
26817 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
26818 `Type', as this has a different meaning now in the base
26820 2001-05-22 Miguel de Icaza <miguel@ximian.com>
26822 * interface.cs, class.cs: Removed from all the sources the
26823 references to signature computation, as we can not do method
26824 signature computation during the parsing time, as we are not
26825 trying to solve at that point distinguishing:
26829 void a (NS.Blah x) {}
26832 Which depending on the context might be valid or not, as we do not
26833 know if Blah is the same thing as NS.Blah at that point.
26835 * Redid everything so the code uses TypeRefs now instead of
26836 Types. TypeRefs are just temporary type placeholders, that need
26837 to be resolved. They initially have a pointer to a string and the
26838 current scope in which they are used. This is used later by the
26839 compiler to resolve the reference to an actual Type.
26841 * DeclSpace is no longer a CIR.Type, and neither are
26842 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
26843 are all DeclSpaces, but no Types.
26845 * type.cs (TypeRefManager): This implements the TypeRef manager,
26846 which keeps track of all the types that need to be resolved after
26847 the parsing has finished.
26849 2001-05-13 Miguel de Icaza <miguel@ximian.com>
26851 * ARGH. We are going to have to store `foreach' as a class rather
26852 than resolving it, as we need to verify error 1579 after name
26853 resolution. *OR* we could keep a flag that says `This request to
26854 IEnumerator comes from a foreach statement' which we can then use
26855 to generate the error.
26857 2001-05-10 Miguel de Icaza <miguel@ximian.com>
26859 * class.cs (TypeContainer.AddMethod): we now add methods to the
26860 MethodGroup instead of the method hashtable.
26862 * expression.cs: Add MethodGroup abstraction, which gets us one
26863 step closer to the specification in the way we handle method
26866 * cs-parser.jay (primary_expression): qualified_identifier now
26867 tried to match up an identifier to a local variable reference or
26868 to a parameter reference.
26870 current_local_parameters is now a parser global variable that
26871 points to the current parameters for the block, used during name
26874 (property_declaration): Now creates an implicit `value' argument to
26877 2001-05-09 Miguel de Icaza <miguel@ximian.com>
26879 * parameter.cs: Do not use `param' arguments as part of the
26880 signature, per the spec.
26882 2001-05-08 Miguel de Icaza <miguel@ximian.com>
26884 * decl.cs: Base class for classes, structs and interfaces. This
26885 is the "Declaration Space"
26887 * cs-parser.jay: Use CheckDef for checking declaration errors
26888 instead of having one on each function.
26890 * class.cs: Factor out some code for handling error handling in
26891 accordance to the "Declarations" section in the "Basic Concepts"
26892 chapter in the ECMA C# spec.
26894 * interface.cs: Make all interface member classes derive from
26895 InterfaceMemberBase.
26897 2001-05-07 Miguel de Icaza <miguel@ximian.com>
26899 * Many things: all interfaces are parsed and generated in
26900 gen-treedump. Support for member variables, constructors,
26901 destructors, properties, constants is there.
26903 Beginning of the IL backend, but very little done, just there for
26906 2001-04-29 Miguel de Icaza <miguel@ximian.com>
26908 * cs-parser.jay: Fix labeled statement.
26910 * cs-tokenizer.cs (escape): Escape " and ' always.
26911 ref_line, ref_name: keep track of the line/filename as instructed
26912 by #line by the compiler.
26915 2001-04-27 Miguel de Icaza <miguel@ximian.com>
26917 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
26918 to match the values in System.CodeDOM.
26920 Divid renamed to Divide.
26922 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
26924 (Statements.set): remove.
26926 * System.CodeDOM/CodeCatchClause.cs: always have a valid
26929 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
26930 falseStatements always have valid values.
26932 * cs-parser.jay: Use System.CodeDOM now.