1 2006-10-09 Martin Baulig <martin@ximian.com>
4 (NullCoalescingOperator.DoResolve): Fix #78964; added gtest-294.cs.
6 2006-09-25 Martin Baulig <martin@ximian.com>
8 * class.cs: Remove after unification with mcs source.
10 2006-09-24 Raja R Harinath <harinath@gmail.com>
12 * convert.cs: Remove after unification with mcs source.
14 2006-09-24 Marek Safar <marek.safar@seznam.cz>
16 * class.cs (MemberBase.VerifyClsCompliance): When method has type
17 parameters verify them as well.
19 * generic.cs (Constraints.VerifyClsCompliance): Verify CLS-Compliance of
20 the type parameter constraints.
21 (Generics.VerifyClsCompliance): Ditto.
23 2006-09-24 Marek Safar <marek.safar@seznam.cz>
25 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
26 for anonymous block with out argument.
28 2006-09-24 Marek Safar <marek.safar@seznam.cz>
30 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
31 not used private events only.
33 2006-09-23 Marek Safar <marek.safar@seznam.cz>
35 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
37 * cs-parser.jay: Parse correctly cast of default (T).
39 * generic.cs (DefaultValueExpression.DoResolve): Check for void type.
40 Store original type via EmptyConstantCast.
42 2006-09-22 Martin Baulig <martin@ximian.com>
44 * delegate.cs: Removed; this file is now shared with mcs.
46 * attribute.cs: Removed; this file is now shared with mcs.
48 2006-09-22 Martin Baulig <martin@ximian.com>
50 * ecore.cs: Removed; this file is now shared with mcs.
52 2006-09-21 Marek Safar <marek.safar@seznam.cz>
54 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
56 * ecore.cs (NullCast): Derives from NullConstant.
58 * generic.cs (DefaultValueExpression): Fixed to cope with the constant
61 2006-09-21 Martin Baulig <martin@ximian.com>
63 * decl.cs: Removed; this file is now shared with mcs.
65 2006-09-21 Raja R Harinath <rharinath@novell.com>
67 * rootcontext.cs: Remove after unification with mcs source.
69 * report.cs: Remove after unification with mcs source.
70 * generic.cs (AddTypeParameter, LookupTypeParameter): Move to
72 (InitGenerics, CleanUpGenerics): Remove.
74 * support.cs: Remove after unification with mcs source.
76 2006-09-20 Raja R Harinath <rharinath@novell.com>
78 * codegen.cs: Remove after unification with mcs source.
80 2006-09-19 Martin Baulig <martin@ximian.com>
82 * expression.cs: Removed; this file is now shared with mcs.
84 2006-09-19 Martin Baulig <martin@ximian.com>
87 (TypeManager.IsEqual): Moved into ../mcs/typemanager.cs.
88 (TypeManager.DropGenericTypeArguments): Likewise.
89 (TypeManager.DropGenericMethodArguments): Likewise.
90 (TypeManager.GetTypeArguments): Likewise.
91 (TypeManager.HasGenericArguments): Likewise.
93 2006-09-19 Martin Baulig <martin@ximian.com>
95 * ecore.cs (PropertyExpr.InstanceResolve): Fix the CS1540 check.
97 2006-09-19 Martin Baulig <martin@ximian.com>
99 * typemanager.cs: Removed; this file is now shared with mcs.
101 2006-09-16 Raja R Harinath <rharinath@novell.com>
103 * Makefile (LOCAL_MCS_FLAGS): Use instead of PROFILE_MCS_FLAGS.
104 * AssemblyInfo.cs, driver.cs: Remove after unification with mcs source.
106 2006-09-16 Marek Safar <marek.safar@seznam.cz>
109 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
110 only if parent type is class.
111 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
114 2006-09-15 Marek Safar <marek.safar@seznam.cz>
117 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
119 * typemanager.cs(CSharpName): Converts NullType to null.
121 2006-09-15 Martin Baulig <martin@ximian.com>
123 * pending.cs: Removed; this file is now shared with mcs.
125 2006-09-15 Martin Baulig <martin@ximian.com>
127 * statement.cs: Removed; this file is now shared with mcs.
129 2006-09-15 Martin Baulig <martin@ximian.com>
131 * rootcontext.cs (RootContext.BrokenCircularDeps): Removed.
133 * driver.cs: Removed the `--broken-cycles' argument.
135 2006-09-15 Martin Baulig <martin@ximian.com>
137 * namespace.cs: Removed; this file is now shared with mcs.
139 2006-09-15 Martin Baulig <martin@ximian.com>
141 * decl.cs (MemberName): Minor code cleanups.
143 2006-09-15 Martin Baulig <martin@ximian.com>
145 * parameter.cs: Removed; this file is now shared with mcs.
147 2006-09-15 Martin Baulig <martin@ximian.com>
149 * enum.cs: Removed; this file is now shared with mcs.
151 2006-09-15 Martin Baulig <martin@ximian.com>
153 * Makefile: Define `GMCS_SOURCE'.
155 * flowanalysis.cs: Removed; this file is now shared with mcs.
157 2006-09-15 Martin Baulig <martin@ximian.com>
159 Removed modifiers.cs, literal.cs, location.cs, roottypes.cs,
160 assign.cs, const.cs, cfold.cs, constant.cs, symbolwriter.cs and
161 doc.cs - they are now shared with mcs.
163 * gmcs.exe.sources: Include these files from ../mcs/.
165 2006-09-15 Martin Baulig <martin@ximian.com>
167 * old-code.cs, gen-il.cs, gen-treedump.cs: Removed old stuff.
168 * g1.cs, sample-hello.cs, sample-stack.il: Likewise.
170 2006-09-14 Marek Safar <marek.safar@seznam.cz>
172 * assign.cs, ecore.cs, expression.cs: Share error message text.
173 * class.cs (FieldMember.Define): Check for variable of static type.
174 * decl.cs (check_type_parameter): Report correct type name.
175 * driver.cs (LoadAssembly): Uses error output for errors.
176 * generic.cs (Constraints.Resolve): Add check for constraint accessibility
177 (TypeArguments.Resolve): Static class cannot be used as an argument.
178 * statement.cs (ResolveMeta): Constants cannot be generic types.
180 2006-09-12 Martin Baulig <martin@ximian.com>
182 * generic.cs (TypeManager.IsIList): Moved into convert.cs.
184 * convert.cs (Convert.Array_To_IList): Moved here and correctly
185 implement it; fixes #79345.
187 2006-09-08 Marek Safar <marek.safar@seznam.cz>
189 * decl.cs (DeclSpace.SetParameterInfo): Check for nonexistent type
191 * expression.cs (TypeOf.GetAttributableValue): Check for open generic
193 * generic.cs: Improved error messages.
194 * typemanager.cs (RemoveGenericArity): Made public.
196 2006-09-08 Martin Baulig <martin@ximian.com>
198 * typemanager.cs (TypeManager.interlocked_type): New public field.
199 (TypeManager.int_interlocked_compare-exchange): New public field.
200 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
201 enumerator types here and call InitGenericCoreTypes().
202 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
203 after calling InitEnumUnderlyingTypes().
206 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
207 `classes_second_stage'.
209 2006-09-07 Marek Safar <marek.safar@seznam.cz>
211 * class.cs, generic.cs (GenericMethod.Define): Check for type parameter
213 * statement.cs (Block.Variables): Made public.
215 2006-09-07 Martin Baulig <martin@ximian.com>
218 (MainDriver): Revert r62663 from Marek; see #70506 for details.
220 2006-09-01 Martin Baulig <martin@ximian.com>
223 (TypeManager.IsIList): Also handle base classes and interfaces.
225 2006-09-01 Raja R Harinath <rharinath@novell.com>
228 * expression.cs (Invocation.MoreSpecific): Check for reference
231 2006-08-29 Miguel de Icaza <miguel@novell.com>
233 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
235 2006-08-17 Miguel de Icaza <miguel@novell.com>
237 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
238 #52019 and #79064, the use of the \uXXXX sequence in source code
239 to represent unicode characters.
241 2006-08-15 Marek Safar <marek.safar@seznam.cz>
243 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
245 * class.cs, ecore.cs, statement.cs: Merged to one error message.
247 2006-08-14 Raja R Harinath <rharinath@novell.com>
250 * cs-tokenizer.cs (parse_less_than): Allow '*' to appear in a type
251 parameter too. This only avoids a parse error -- the semantic
252 error is caught elsewhere.
254 2006-08-13 Miguel de Icaza <miguel@novell.com>
256 * assign.cs: Catch attempts to assign to a method groups in += and
259 2006-08-13 Marek Safar <marek.safar@seznam.cz>
262 * cs-parser.jay: Don't destroy current array type by typeof of array's.
264 2006-08-12 Marek Safar <marek.safar@seznam.cz>
266 * cs-parser.jay: Check whether a constraint clause has already been
267 specified for type parameter.
268 * generic.cs (Constraints): Exposed location.
270 2006-08-12 Marek Safar <marek.safar@seznam.cz>
272 * class.cs (Method.Define): Issue a warning when generic method looks like
274 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
276 * report.cs: New warning number.
278 2006-08-09 Marek Safar <marek.safar@seznam.cz>
280 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
282 * decl.cs (MemberCache.FindMembers): When container is interface we need to
283 search all base interfaces as a member can be ambiguous.
284 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
285 Constructor member type filter.
286 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
287 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
288 reporting for returned memberinfos.
289 * report.cs: Updated.
290 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
291 version to work on all runtimes.
292 (TypeManager.RealMemberLookup): Removed members filtering.
294 2006-08-08 Raja R Harinath <rharinath@novell.com>
296 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
297 (PropertyExpr.EmitAssign): Likewise.
298 * expression.cs (Indirection.EmitAssign): Likewise.
299 (LocalVariableReference.EmitAssign): Likewise.
300 (ParameterReference.EmitAssign): Likewise.
301 (Invocation.EmitArguments): Likewise.
302 (ArrayAccess.EmitAssign): Likewise.
303 (IndexerAccess.EmitAssign): Likewise.
304 (This.EmitAssign): Likewise.
305 (ConditionalLogicalOperator.Emit): Likewise.
308 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
309 instead of ArrayList. If the hashtable has a LocalBuilder, don't
310 leave it in after returning it.
311 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
313 2006-08-06 Marek Safar <marek.safar@seznam.cz>
315 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
318 2006-08-05 Marek Safar <marek.safar@seznam.cz>
320 * class.cs (TypeContainer.AddPartial): Add check for partial declarations
321 with different type names.
322 (TypeContainer.UpdateTypeParameterConstraints): Updated an error message.
324 2006-08-03 Raja R Harinath <rharinath@novell.com>
326 Fix cs0146-3.cs and cs0146-4.cs.
327 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
328 enclosing types don't depend on the current type.
330 2006-08-02 Raja R Harinath <rharinath@novell.com>
333 * class.cs (TypeContainer.DoDefineMembers): Use
334 FindBaseMemberWithSameName on Parent, since we're interested in
335 whether we hide inherited members or not.
336 (FindBaseMemberWithSameName): Make slightly more robust.
339 * codegen.cs (IResolveContext.GenericDeclContainer): New.
340 (EmitContext): Implement new interface requirement.
341 * namespace.cs (UsingEntry, LocalAliasEntry): Likewise.
342 * decl.cs (MemberCore): Likewise.
343 (DeclSpace.GenericDeclContainer): Rename from DeclContainer.
344 * ecore.cs (SimpleName.ResolveAsTypeTerminal): Use
345 ec.GenericDeclContainer to check for generic parameters.
346 (SimpleName.DoSimpleNameResolve): Likewise.
347 * generic.cs (TypeParameter.DeclContainer): Remove override.
349 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
350 declspaces for doppelgangers too.
351 (UsingEntry): Implement IResolveContext.
352 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
353 'this' as the resolve context.
354 (LocalAliasEntry): Likewise.
356 Implement parts of #77403
357 * roottypes.cs (RootDeclSpace): New. Used to represent the
358 toplevel declaration space. Each namespace declaration introduces
359 a "partial" root declaretion space.
360 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
361 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
362 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
363 from 'current_namespace.SlaveDeclSpace'.
364 (namespace_declaration): Likewise.
365 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
366 check. It can't happen now.
367 * decl.cs (DeclSpace.LookupType): Likewise.
368 * driver.cs (MainDriver): Sanity check.
370 2006-08-01 Raja R Harinath <rharinath@novell.com>
372 * decl.cs (DeclSpace.FindNestedType): Remove.
373 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
374 LookupTypeContainer to get the container of the nested type.
375 * class.cs (TypeContainer.FindNestedType): Make non-override.
377 2006-07-31 Raja R Harinath <rharinath@novell.com>
379 * decl.cs (DeclSpace.PartialContainer): Move field from ...
380 * class.cs (TypeContainer.PartialContainer): ... here.
381 (TypeContainer.AddBasesForPart): New helper.
382 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
384 * cs-parser.jay (current_class): Convert to DeclSpace.
385 (struct_declaration, interface_declaration, class_declaration):
386 Use AddBasesForPart instead of .Bases directly.
387 * const.cs, iterators.cs: Update to changes.
389 2006-07-28 Raja R Harinath <rharinath@novell.com>
391 * class.cs (TypeContainer.AddMemberType): Rename from
393 (TypeContainer.AddMember): Rename from AddToMemberContainer.
394 (AddTypeContainer): New. Combine AddClassOrStruct and
396 (AddPartial): Update. Add 'is_partial' argument.
397 * roottypes.cs: Update to changes.
398 * cs-parser.jay (push_current_class): New helper for handling
399 current_container and current_class.
400 (struct_declaration, interface_declaration, class_declaration):
403 2006-07-26 Raja R Harinath <rharinath@novell.com>
405 * roottypes.cs: Rename from tree.cs.
407 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
408 * tree.cs (Tree, ITreeDump): Remove types.
409 * rootcontext.cs (tree, Tree): Remove fields.
410 (root, ToplevelTypes): New.
411 * *.cs: Update to rename.
413 * tree.cs (Tree.RecordDecl): Remove.
414 (RootTypes.AddToTypeContainer): Record the toplevel type in its
416 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
418 2006-07-23 Raja R Harinath <harinath@gmail.com>
420 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
421 DoFlowAnalysis and OmitStructFlowAnalysis here.
422 (ec.With): Rename from WithUnsafe and generalize.
423 (ec.WithCheckState): Remove. All users can be handled by 'With'.
424 (ec.WithFlowAnalyis): New.
425 * ecore.cs, expression.cs, statement.cs: Update.
427 2006-07-22 Raja R Harinath <harinath@gmail.com>
429 * statement.cs (Block.ResolveMeta): Simplify slightly.
431 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
432 multiple boolean fields. Convert InUnsafe, constant_check_state,
433 check_state to flags.
434 (CheckState, ConstantCheckState): Update.
435 (InUnsafe): New read-only property.
436 (FlagsHandle): Rename from CheckStateHandle and convert to handle
438 (WithUnsafe): New helper similar to WithCheckState.
439 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
440 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
442 2006-07-21 Raja R Harinath <rharinath@novell.com>
444 Make comparisons use the same IL irrespective of whether they're
445 in a 'checked' or 'unchecked' context: one of the issues in #78899
446 * codegen.cs (EmitContext.CheckState): Make read-only property.
447 (EmitContext.ConstantCheckState): Likewise.
448 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
449 helper that implement a save/restore stack for CheckState
450 values. This is the only way to change check-state.
451 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
452 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
453 (CheckedExpr.EmitBranchable): New forwarding method.
454 (UnCheckedExpr): Likewise.
455 * statement.cs (Block.ResolveMeta): Use WithCheckState.
456 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
457 (Checked.Resolve, checked.DoEmit): Likewise.
459 2006-07-21 Martin Baulig <martin@ximian.com>
461 * generic.cs (TypeManager.InferType): When inferring an array
462 type, also allow IList<T> and ICollection<T>. Fixes #78900.
464 2006-07-21 Martin Baulig <martin@ximian.com>
466 * generic.cs (TypeManager.IsIEnumerable): Renamed into IsIList()
467 and allow IList`1 and all its base interfaces.
469 * convert.cs (Convert.ImplicitReferenceConversion): Allow
470 converting from an array-type of T to IList<T>.
472 2006-07-21 Martin Baulig <martin@ximian.com>
474 * ecore.cs (SimpleName.DoSimpleNameResolve): Added CS0307 check.
476 2006-07-20 Miguel de Icaza <miguel@novell.com>
478 * anonymous.cs: Cache the resolved anonymous delegate, and return
479 this so that the ResolveTopBlock is only triggered once, not
482 Currently we trigger ResolvetopBlock twice due to a first pass of
483 argument check compatibility, and a second pass that does the
486 2006-07-15 Marek Safar <marek.safar@seznam.cz>
488 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
490 * rootcontext.cs (Reset): Add helper_classes.
492 2006-07-15 Marek Safar <marek.safar@seznam.cz>
495 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
498 2006-07-13 Miguel de Icaza <miguel@novell.com>
500 * statement.cs (Lock): Handle expressions of type
501 TypeManager.null_type specially. Fixes #78770
503 2006-07-08 Marek Safar <marek.safar@seznam.cz>
505 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
508 2006-07-08 Marek Safar <marek.safar@seznam.cz>
510 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
511 for accessors as well.
512 * ecore.cs (EventExpr): Add AccessorTable.
514 2006-07-03 Martin Baulig <martin@ximian.com>
516 * ecore.cs (UnboxCast.Emit): Also use `Unbox_Any' for generic
517 instances of value types.
519 * convert.cs (Convert.ExplicitConversion): Correctly handle
520 object->nullable conversions.
522 2006-07-01 Marek Safar <marek.safar@seznam.cz>
525 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
526 for CS0122 where appropriate.
527 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
529 (Filter): Assembly can be null in the case of top level attributes.
531 2006-06-28 Raja R Harinath <rharinath@novell.com>
534 * generic.cs (TypeManager.InferParamsTypeArguments): If there are
535 no arguments, return 'false': nothing can be inferred.
537 2006-06-25 Marek Safar <marek.safar@seznam.cz>
541 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
542 is done at global level.
544 2006-06-24 Marek Safar <marek.safar@seznam.cz>
546 A fix for #77002, Implemented TypeForwarder support.
548 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
549 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Add TypeForwarder
551 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
552 * typemanager.cs (): Add type_forwarder_attr_type.
554 2006-06-24 Marek Safar <marek.safar@seznam.cz>
556 * report.cs: Add CS0469 warning.
558 2006-06-22 Martin Baulig <martin@ximian.com>
561 (TypeContainer.GetNormalBases): Also use ResolveAsBaseTerminal()
562 for interfaces; fixes #78686, which is a modification of #78380
563 with interfaces instead of classes.
565 2006-06-21 Martin Baulig <martin@ximian.com>
567 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
568 the `try'-block, so we also report CS0016 etc. there.
570 2006-06-21 Martin Baulig <martin@ximian.com>
572 * ecore.cs (FieldExpr.EmitAssign, FieldExpr.AddressOf): Correctly
573 handle SetAssigned() and SetMemberIsUsed() for generic types;
576 2006-06-21 Martin Baulig <martin@ximian.com>
579 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
581 2006-06-21 Martin Baulig <martin@ximian.com>
583 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
584 also report CS1686 for parameters.
586 2006-06-21 Martin Baulig <martin@ximian.com>
588 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
589 instead of an error if the value is not implicitly convertible to
590 the switch types; fixes #77964.
592 2006-06-21 Raja R Harinath <rharinath@novell.com>
595 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
596 FieldBuilder is null.
599 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
600 'left' and 'right' before error-checking.
602 2006-06-19 Martin Baulig <martin@ximian.com>
605 (Convert.ImplicitConversionStandard): Cleanup and correctly
606 implement nullable conversions.
607 (Convert.ImplicitStandardConversionExists): Likewise.
608 (Convert.ExplicitConversion): Likewise.
610 2006-06-19 Martin Baulig <martin@ximian.com>
613 (Nullable.Wrap.Create, Nullable.Unwrap.Create): New public static
614 methods; make the ctors protected.
616 2006-06-19 Martin Baulig <martin@ximian.com>
618 Fixed #78380; added gtest-273.cs.
621 (Expression.ResolveAsBaseTerminal): Move the constraint checking
622 into ResolveAsTypeTerminal().
625 (ConstraintChecker.HasDefaultConstructor): Use the non-cache based
626 TypeManager.FindMembers() to check for the default ctor.
628 2006-06-18 Marek Safar <marek.safar@seznam.cz>
630 * generic.cs: Fixed NullableInfo accessibility.
632 2006-06-16 Martin Baulig <martin@ximian.com>
635 (Constraints.InflatedConstraints.inflate): Correctly inflate
636 generic types; fixes #78400.
638 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
640 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
642 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
643 (FieldExpr.DoResolve): likewise.
644 (PropertyExpr.InstanceResolve): likewise.
645 (EventExpr.InstanceResolve): likewise.
647 2006-06-15 Martin Baulig <martin@ximian.com>
650 (SwitchLabel.ResolveAndReduce): Added `bool allow_nullable'
651 argument; always allow a `null' label if true.
652 (Switch.SwitchGoverningType): Take an `Expression expr' argument.
653 (Switch.TableSwitchEmit, Switch.SimpleSwitchEmit): Check whether
654 we have a `null' label and mark the new `null_target' label;
655 default to the `default' label.
656 (Switch.Resolve): Add support for nullable types. Fixes #78630.
658 2006-06-15 Martin Baulig <martin@ximian.com>
660 * class.cs (Operator.Define): Allow an implicit/explicit operator
661 to convert to/from a nullable value of the enclosing type.
663 * generic.cs (TypeManager.IsNullableTypeOf): New public method.
664 (Nullable.Unwrap, Nullable.Wrap): Make these classes public.
667 (Convert.ImplicitStandardConversionExists): Add support for lifted
668 implicit/explicit conversions.
669 (Convert.ImplicitConversionStandard): Likewise.
671 2006-06-13 Martin Baulig <martin@ximian.com>
673 * ecore.cs (SimpleName.DoSimpleNameResolve): Check whether we have
674 type arguments and create a ConstructedType if necessary. Fixes #78400.
676 2006-06-04 Marek Safar <marek.safar@seznam.cz>
678 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
679 attribute applicable tests for attribute argument.
681 2006-06-02 Raja R Harinath <rharinath@novell.com>
684 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
685 (Binary.OverloadResolve_PredefinedIntegral): New.
686 (Binary.OverloadResolve_PredefinedFloating): New.
687 (Binary.OverloadResolve_PredefinedString): New.
688 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
689 Follow the standard more closely, and treat numeric promotions in
690 terms of overload resolution.
691 (Binary.CheckShiftArguments): Simplify.
693 2006-06-01 Raja R Harinath <rharinath@novell.com>
695 * flowanalysis.cs (MyBitVector): Simplify representation.
696 (MyBitVector.Clone): Avoid allocating BitArray.
697 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
698 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
699 (*): Update. Change all references to MyBitVector.And and
700 MyBitVector.Or to &= and |=.
702 2006-05-31 Raja R Harinath <rharinath@novell.com>
704 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
705 Use bne.un instead of ceq+brfalse.
708 * typemanager.cs (IsUnmanagedType): Disallow generic types and
711 2006-05-29 Raja R Harinath <rharinath@novell.com>
714 * cs-parser.jay (formal_parameter_list): Extend the pattern below
715 to param arguments too.
717 2006-05-26 Miguel de Icaza <miguel@novell.com>
719 * cs-parser.jay: Catch another parsing form for arglist being
720 followed by other arguments. Fixes #78313.
722 2006-05-25 Raja R Harinath <rharinath@novell.com>
725 * expression.cs (Binary.DoResolve): Use Nullable.LiftedBinaryOperator
726 also when one of the operands is a null literal.
727 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality): Rewrite
728 to improve clarity, and generate slightly better code.
730 2006-05-24 Raja R Harinath <rharinath@novell.com>
732 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
733 checking of out parameters to ...
734 (FlowBranchingToplevel.Merge): ... here.
735 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
736 set, propagate the origin upward, and only complain if there was
738 (FlowBranchingException.AddContinueOrigin): Likewise.
739 (FlowBranchingException.AddReturnOrigin): Likewise.
740 (FlowBranchingException.AddGotoOrigin): Likewise.
742 2006-05-23 Raja R Harinath <rharinath@novell.com>
744 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
745 unreachable, skip it.
746 (FlowBranchingException.Merge): Always propagate jumps, even if
747 the finally block renders subsequent code unreachable.
749 2006-05-18 Raja R Harinath <rharinath@novell.com>
752 * statement.cs (Goto.Resolve): Move responsibility for resolving
753 'goto' to FlowBranching.AddGotoOrigin.
754 (Goto.SetResolvedTarget): New. Callback to set the
755 LabeledStatement that's the target of the goto.
756 (Goto.DoEmit): Use Leave instead of Br when crossing an
757 unwind-protect boundary.
758 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
759 LookupLabel and adjust to new semantics.
760 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
761 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
762 Goto.SetResolvedTarget to update target.
763 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
764 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
765 AddBreakOrigin & co. Delay propagation until ...
766 (FlowBranchingException.Merge): ... this.
768 * statement.cs (Block.Resolve): Always depend on flow-branching to
769 determine unreachability. Kill workaround that originally emitted
770 only one statement after an "unreachable" label (see infloop in
773 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
774 This is still "wrong", but anything better would probably need a
775 multi-pass algorithm.
776 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
777 usage vector. Force current usage vector to be reachable, to
778 optimistically signify backward jumps.
779 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
781 (FlowBranchingLabeled.Merge): New. If no backward jump was
782 detected, return the original salted-away usage vector instead,
783 updated with appropriate changes. Print unreachable warning if
785 * statement.cs (Block.Resolve): Don't print unreachable warning on
788 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
790 * driver.cs: Pass filename without path to AssemblyBuilder's
791 AddResourceFile. Fixes bug #78407.
793 2006-05-17 Raja R Harinath <rharinath@novell.com>
795 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
796 * flowanalysis.cs (FlowBranchingLabeled): ... here.
797 (FlowBranching.MergeChild): Overwrite
798 reachability information from Labeled branchings too.
800 2006-05-16 Raja R Harinath <rharinath@novell.com>
802 * statement.cs (Goto.Resolve): Merge jump origins here ...
803 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
805 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
806 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
807 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
808 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
810 * statement.cs (Goto.Resolve): ... not here.
811 (Goto.Emit): Remove CS1632 check.
813 2006-05-14 Marek Safar <marek.safar@seznam.cz>
815 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
818 2006-05-11 Raja R Harinath <rharinath@novell.com>
820 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
821 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
822 (FlowBranchingException.Label): Likewise.
824 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
826 (MyBitVector.Or): Use it to avoid losing information (Count).
827 (FlowBranching.MergeOrigins): Likewise.
829 * flowanalysis.cs (UsageVector.IsDirty): Remove.
830 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
831 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
832 (UsageVector.ToString): Simplify.
833 (UsageVector.MergeSiblings): Move here from ...
834 (FlowBranching.Merge): ... here.
835 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
838 2006-05-10 Raja R Harinath <rharinath@novell.com>
840 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
841 null bitvector is treated as all-true.
843 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
844 (MyBitVector): Rationalize invariants. 'vector != null' implies
845 that we have our own copy of the bitvector. Otherwise,
846 'InheritsFrom == null' implies all inherited bits are true.
848 2006-05-09 Marek Safar <marek.safar@seznam.cz>
850 * statement.cs (LocalInfo): Add IsConstant.
851 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
852 local variable for constants.
854 2006-05-09 Raja R Harinath <rharinath@novell.com>
856 * flowanalysis.cs (MyBitVector.Empty): New.
857 (MyBitVector): Don't allow InheritedFrom to be null.
858 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
859 (UsageVector, FlowBranching): Update to changes.
861 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
862 recursion. The 'Parent == null' condition isn't sufficient for
864 (FlowBranching.AddBreakOrigin): Likewise.
865 (FlowBranching.AddContinueOrigin): Likewise.
866 (FlowBranching.AddReturnOrigin): Likewise.
867 (FlowBranching.StealFinallyClauses): Likewise.
868 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
869 (FlowBranching.CheckOutParameters): Likewise.
870 (FlowBranchingToplevel): Terminate all the above recursions here.
871 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
872 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
874 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
876 (FlowBranchingToplevel): New. Empty for now.
877 (FlowBranching.MergeTopBlock): Update.
878 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
879 branching for the anonymous delegate.
880 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
882 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
883 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
884 information at the start of the merge. Reorganize.
886 2006-05-07 Marek Safar <marek.safar@seznam.cz>
888 * class.cs (MethodData.Define): Method cannot implement interface accessor.
890 2006-05-07 Marek Safar <marek.safar@seznam.cz>
892 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
893 to newly introduced ctor.
895 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
896 message to one place.
897 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
900 2006-05-07 Marek Safar <marek.safar@seznam.cz>
902 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
904 * ecore.cs (Expression.ResolveAsConstant): Updated.
906 * statement.cs (ResolveMeta): Updated.
908 2006-05-06 Marek Safar <marek.safar@seznam.cz>
910 * cs-parser.jay: __arglist cannot be used in initializer.
912 2006-05-06 Marek Safar <marek.safar@seznam.cz>
915 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
918 2006-05-05 Raja R Harinath <rharinath@novell.com>
920 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
921 (LabeledStatement): Add 'name' parameter.
922 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
923 (Block.AddLabel): Update to changes.
924 * cs-parser.jay (labeled_statement): Likewise.
926 * flowanalysis.cs (BranchingType.Labeled): New.
927 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
928 (FlowBranchingLabeled): New. Does nothing for now, but will
929 eventually handle 'goto' flows.
930 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
931 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
932 that's terminated ...
933 (Block.Resolve): ... here.
935 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
936 (UsageVector.MergeFinallyOrigins): Likewise.
937 (FlowBranching.InTryOrCatch): Likewise.
938 (FlowBranching.AddFinallyVector): Likewise.
939 (FlowBranchingException): Update to changes.
942 * statement.cs (Return.Resolve): Move error checking to ...
943 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
944 (FlowBranchingException): Handle return origins like break and
946 (FlowBranching.UsageVector.CheckOutParameters): Remove.
948 2006-05-04 Marek Safar <marek.safar@seznam.cz>
951 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
954 2006-05-04 Marek Safar <marek.safar@seznam.cz>
957 * class.cs (MethodData.Define): Do public accessor check only when method
958 implements an interface.
960 2006-05-04 Raja R Harinath <rharinath@novell.com>
962 Remove special handling of 'break'
963 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
964 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
965 (UsageVector.Break): Remove.
966 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
968 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
970 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
971 UsageVector.Breaks (). Don't set NeedsReturnLabel.
973 2006-05-03 Marek Safar <marek.safar@seznam.cz>
976 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
977 be the interface member.
979 2006-05-03 Marek Safar <marek.safar@seznam.cz>
982 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
983 for emitting small (int) values.
985 2006-05-03 Raja R Harinath <rharinath@novell.com>
988 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
989 control-flow passes through the 'finally' after merging-in all the
990 control-flows from 'try' and the 'catch' clauses.
992 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
993 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
994 always true at the only non-recursive entry point.
995 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
996 FlowBranchingBreakable.
997 (FlowBranchingLoop): Remove.
998 * statement.cs (Return.DoResolve): Update to changes.
1001 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
1002 (FlowBranching.CreateBranching): Handle it: create a
1003 FlowBranchingContinuable.
1004 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
1005 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
1006 except that it handles the 'continue' command.
1007 (FlowBranching.UsageVector.MergeOrigins): Rename from
1009 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
1010 except that it overrides AddContinueOrigin.
1011 (FlowBranchingException): Override AddContinueOrigin, similar to
1013 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
1014 Create a new branching around the embedded statement.
1015 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
1016 control flow after the embedded statement.
1017 (Continue.Resolve): Move all error checking to AddContinueOrigin.
1019 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
1020 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
1021 FlowBranchingBreakable.
1022 (FlowBranchingSwitch): Remove.
1025 * statement.cs (Break.Resolve): Simplify. Move responsibility for
1026 error reporting to ...
1027 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
1028 Rename from 'AddBreakVector'. Add new location argument. Return
1029 a bool indicating whether the 'break' crosses an unwind-protect.
1030 (FlowBranchingException.AddBreakOrigin): Add.
1031 (FlowBranchingException.Merge): Propagate 'break's to surrounding
1032 flowbranching after updating with the effects of the 'finally'
1034 (FlowBranchingBreakable): New common base class for
1035 FlowBranchingLoop and FlowBranchingSwitch.
1037 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
1039 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
1041 2006-05-02 Raja R Harinath <rharinath@novell.com>
1043 * statement.cs (Do.Resolve): If the loop is infinite, set the
1045 (While.Resolve, For.Resolve): Set a barrier after the embedded
1046 statement. There's no direct control flow that goes from the end
1047 of the embedded statement to the end of the loop.
1048 * flowanalysis.cs (FlowBranching.Infinite): Remove.
1049 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
1050 above ensure that the reachability is correctly computed.
1052 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
1053 (UsageVector.MergeBreakOrigins): If the current path is
1054 unreachable, treat it as if all parameters/locals are initialized.
1055 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
1056 infinite loops before merging-in break origins.
1058 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
1059 (Reachability.Reachable): Split part into ...
1060 (Reachability.Unreachable): ... this. Simplify.
1061 (Reachability.IsUnreachable): Use 'Unreachable' instead.
1063 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
1064 (Reachability.SetThrowsSometimes): Likewise.
1065 (FlowBranchingBlock.MergeTopBlock): Don't compare against
1066 TriState.Always, use corresponding property.
1067 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
1068 (Block.Resolve): Likewise. Remove some redundant checks.
1070 2006-05-02 Raja R Harinath <harinath@gmail.com>
1072 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
1073 (Reachability.Meet): Don't bother checking AlwaysThrows --
1074 barrier is always set.
1075 (FlowBranchingBlock.Merge): Likewise.
1077 2006-05-01 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
1079 * attribute.cs: fixed_buffer_cache is declared only if NET_2_0 is
1080 defined, so it's references should also compile only for NET_2_0
1081 (as occurs in mcs version)
1083 2006-05-01 Raja R Harinath <harinath@gmail.com>
1085 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
1086 checks for unreachable.
1088 2006-05-01 Marek Safar <marek.safar@seznam.cz>
1091 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
1093 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
1094 whether field is really assigned.
1096 2006-04-30 Raja R Harinath <harinath@gmail.com>
1098 * flowanalysis.cs (Reachability): Make 4-argument constructor
1100 (Reachability.Meet): Rename from 'And'. Remove static variant.
1101 (Reachability.Always): Rename from the highly misleading
1102 'Reachability.Never'.
1103 (FlowBranching.Merge): Update to changes. Mark an impossible
1104 situation with a 'throw'.
1105 (*): Update to changes.
1107 2006-04-29 Raja R Harinath <harinath@gmail.com>
1109 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
1111 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
1112 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
1113 (*): Update to changes.
1114 * statement.cs: Update to changes.
1116 2006-04-28 Marek Safar <marek.safar@seznam.cz>
1119 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
1121 2006-04-28 Raja R Harinath <harinath@gmail.com>
1123 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
1126 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
1127 argument to two arguments: an usage-vector and a bool. Move call
1128 to FlowBranching.Merge () ...
1129 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
1131 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
1132 handling of loop and switch reachability to ...
1133 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
1135 2006-04-27 Raja R Harinath <harinath@gmail.com>
1137 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
1138 handling to FlowBranchingLoop.InLoop.
1139 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
1141 2006-04-26 Marek Safar <marek.safar@seznam.cz>
1144 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
1145 anonymous method is allowed from AnonymousContainer here.
1147 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
1149 2006-04-24 Raja R Harinath <rharinath@novell.com>
1152 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
1154 2006-04-23 Marek Safar <marek.safar@seznam.cz>
1157 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
1158 (DoubleConstant.Reduce): Ditto.
1160 2006-04-23 Raja R Harinath <rharinath@novell.com>
1162 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
1163 Remove 'lvalue_right_side' argument. Move parts to ...
1164 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
1165 (LocalVariable.DoResolveLValue): ... these.
1167 2006-04-21 Raja R Harinath <rharinath@novell.com>
1170 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
1171 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
1172 (LocalVariableReference.DoResolveBase): Use it to implement new
1174 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
1175 (Argument.Resolve): Simplify. Move CS1510 check ...
1176 * ecore.cs (Expression.ResolveLValue): ... here.
1177 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
1178 (PropertyExpr.DoResolveLValue): Likewise.
1179 (FieldExpr.Report_AssignToReadonly): Likewise.
1180 (FieldExpr.DoResolve): Add 'out_access' argument. Use
1181 LValueMemberAccess or LValueMemberOutAccess on instance depending
1183 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
1184 DoResolve as appropriate.
1186 2006-04-20 Raja R Harinath <rharinath@novell.com>
1189 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
1190 implicit conversions on 'out' and 'ref' arguments.
1192 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
1193 improve clarity. Remove dead code.
1196 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
1197 (Catch.Resolve): Resolve VarBlock if it exists.
1199 2006-04-19 Miguel de Icaza <miguel@novell.com>
1201 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
1202 twice, this was some residual code, the enumerator was emitted
1203 properly in the two branche of if later.
1207 Thanks to Martin for finding the source of the problem
1209 2006-04-19 Raja R Harinath <rharinath@novell.com>
1211 * expression.cs (Cast.ResolveLValue): Remove. The result of a
1212 cast is never an lvalue.
1213 (Cast.DoResolve, Cast.ResolveRest): Combine.
1214 (Argument.Emit): Simplify slightly. Move 'Expr is
1215 IMemoryLocation' check ...
1216 (Argument.Resolve): ... here.
1217 (Argument.Error_LValueRequired): Remove. Inline into only user.
1219 Simplifications. Fix cs0191-2.cs
1220 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
1221 CS1649 and CS1651 to ...
1222 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
1223 the actual selection of the error code and message to a lookup
1224 table. Add a dummy return value to simplify callsites.
1225 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
1226 readonly fields of other instances of the same type. Move CS0197
1228 * expression.cs (Argument.Resolve): ... here. Simplify code.
1229 Ensure that ec.InRefOutArgumentResolving is only set during LValue
1230 resolution of an out or ref argument. The code simplification
1231 above uses this invariant.
1233 2006-04-18 Raja R Harinath <rharinath@novell.com>
1235 Possibly fix #77752. Fix cs1690-[4-7].cs.
1236 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
1237 CheckMarshallByRefAccess. Drop parameter.
1238 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
1240 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
1242 * report.cs (AllWarnings): Add CS1690.
1243 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
1245 (LocalVariableReference.DoResolveBase): Update.
1247 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1249 * class.cs (MethodOrOperator): Moved common parts from method class.
1250 detect obsolete attributes.
1251 (Method.Define): Simplified as it reuses code from base.
1252 (Constructor.ValidAttributeTargets): Fixed issue found during
1254 (Destructor.ValidAttributeTargets): Fixed issue found during
1256 (Operator): Finished refactoring set off by #78020. Operator class is now
1257 ordinary method class.
1259 * anonymous.cs: Updated.
1261 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1263 * class.cs (Constructor.Emit): Don't emit the attributes twice.
1265 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1267 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
1268 detect obsolete attributes.
1269 (Method.CreateEmitContext): Moved to MethodOrOperator.
1271 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1274 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
1275 customized exception to make crash detection easier.
1276 (MethodOrOperator): Started to work on new base class for methods and
1278 (Method): Derives from MethodOrOperator.
1279 (Constructor.Emit): Emits its own attributes.
1280 (AbstractPropertyEventMethod.Emit): Ditto.
1281 (Operator): Derives from MethodOrOperator, will refactor fully in extra
1283 (Operator.Emit): It's temporary more tricky than should be.
1285 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
1287 * report.cs (InternalErrorException): Add ctor with inner exception.
1289 2006-04-08 Marek Safar <marek.safar@seznam.cz>
1292 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
1295 2006-04-07 Marek Safar <marek.safar@seznam.cz>
1298 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
1301 2006-04-06 Marek Safar <marek.safar@seznam.cz>
1303 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
1304 attribute is present and Guid not.
1305 (Interface.ApplyAttributeBuilder): Ditto.
1307 * attribute.cs: Add error message.
1309 2006-04-06 Marek Safar <marek.safar@seznam.cz>
1313 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
1314 sources (it's composite) so hold them in extra array as they are used in
1315 Emit phase only. It worked in the previous versions by mistake.
1316 (Attribute.Emit): Emit attribute for more owners when exist.
1318 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
1319 it has now different behaviour.
1321 2006-04-04 Marek Safar <marek.safar@seznam.cz>
1323 * constant.cs (Constant.IsDefaultInitializer): New method.
1325 * class.cs: Updated.
1327 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
1328 re-initialize default values. It saves KBs almost for every assembly.
1329 Thanks Zoltan for the idea.
1330 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
1331 (ArrayCreation.DoResolve): Resolve only once.
1332 (ArrayCreation.Emit): Emit static initializer only when it is faster.
1333 (ArrayCreation.GetAttributableValue): Cope with optimized values.
1335 2006-04-03 Zoltan Varga <vargaz@gmail.com>
1337 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
1340 2006-04-01 Marek Safar <marek.safar@seznam.cz>
1342 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
1343 in an embedded statement too.
1345 2006-04-01 Raja R Harinath <rharinath@novell.com>
1348 * typemanager.cs (IsNestedChildOf): Drop generic arguments before
1352 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
1355 * report.cs (SymbolRelatedToPreviousError): Drop generic type
1356 arguments before checking whether a type is reflected or not.
1359 * expression.cs (Invocation.IsApplicable): Ensure a generic method
1360 definition doesn't take part in overload resolution.
1361 (Invocation.IsParamsMethodApplicable): Likewise.
1362 (Invocation.OverloadResolve): When replacing a reflected override
1363 method with its base definition, ensure that type arguments are
1366 2006-04-01 Marek Safar <marek.safar@seznam.cz>
1370 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
1373 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
1375 2006-03-31 Marek Safar <marek.safar@seznam.cz>
1377 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
1380 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
1381 LocalTemporary change.
1383 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1385 (ClassOrStruct.DefineFieldInitializers): Implemented static field
1386 initializers optimization.
1387 (ClassOrStruct.TypeAttr): Moved from modifiers.
1388 (Constructor.CheckBase): Don't crash when static ctor has parameters.
1389 (FieldBase.ResolveInitializer): Resolves initializer.
1390 (FieldBase.HasDefaultInitializer): New property.
1392 * cs-parser.jay: Removed message.
1394 * expression.cs (CompilerGeneratedThis): New specialization.
1396 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1398 2006-03-28 Marek Safar <marek.safar@seznam.cz>
1400 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1402 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1404 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1405 be now EnumConstants only.
1407 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1409 * attribute.cs, driver.cs: Reset more caches.
1411 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1413 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1415 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1417 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1418 for easier reuse. Updated all overrides.
1419 (IntegralConstant): New base class for all integral constants.
1420 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1421 of the constant range, report custom error.
1422 (UIntConstant.Reduce): Fixed uint conversion.
1424 * ecore.cs, literal.cs: Reduce updates.
1426 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1430 * class.cs (Constructor.Define): Removed extra if for default ctors.
1431 A patch from Atsushi Enomoto.
1433 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1435 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1436 GetAttributableValue.
1438 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1441 * convert.cs (ImplicitConversionRequired): Error message moved to
1444 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1445 automatic implicit conversion of an output value.
1446 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1448 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1450 (TypeOf.GetAttributableValue): Add extra handling for object type.
1452 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1453 special error message.
1455 2006-03-25 Marek Safar <marek.safar@seznam.cz>
1457 * class.cs (Constructor.Emit): Don't crash when struct ctor is
1459 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1460 compatible with MS runtime.
1462 2006-03-23 Marek Safar <marek.safar@seznam.cz>
1464 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1465 attribute arguments here.
1467 * class.cs (Indexer.Define): The check was moved to attribute class.
1469 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1471 * expression.cs (StringConcat.Append): Reverted back to no warning state.
1473 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1475 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1477 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1480 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
1482 * doc-bootstrap.cs : fix build.
1484 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1486 * expression.cs (StringConcat.Append): Issue a warning when empty string
1489 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1491 * assign.cs (CompoundAssign.ResolveSource): Removed.
1493 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1496 * class.cs (TypeContainer.FindMethods): Removed.
1497 (TypeContainer.CheckMemberUsage): Made static.
1499 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1501 * constant.cs (CheckRange): Removed unused type argument.
1502 (CheckUnsigned): Removed unused type argument.
1504 * cs-parser.jay: Updated after MemberAccess clean up.
1505 Uses Length for empty string test.
1507 * cs-tokenizer.cs: Uses Length for empty string test.
1508 (IsCastToken): Made static.
1509 (is_hex): Made static.
1510 (real_type_suffix): Made static.
1512 * decl.cs (SetupCache): Made static.
1513 (OnGenerateDocComment): Removed unused ds argument.
1515 * delegate.cs (VerifyDelegate): Removed unused argument.
1517 * doc.cs: Uses Length for empty string test.
1519 * driver.cs: Uses Length for empty string test.
1521 * enum.cs (IsValidEnumType): Made static
1523 * expression.cs (EnumLiftUp): Removed unused argument.
1524 (ResolveMethodGroup): Ditto.
1525 (BetterConversion): Ditto.
1526 (GetVarargsTypes): Ditto.
1527 (UpdateIndices): Ditto.
1528 (ValidateInitializers): Ditto.
1529 (MemberAccess.ctor): Ditto.
1530 (GetIndexersForType): Ditto.
1532 * flowanalysis.cs: (MergeFinally): Removed unused argument.
1534 * iterators.cs: Updated after MemberAccess clean up.
1536 * location.cs: Uses Length for empty string test.
1538 * namespace.cs: Uses Length for empty string test.
1540 * report.cs (CheckWarningCode): Made static.
1542 * statement.cs (LabeledStatement): Removed unused argument.
1544 * typemanager.cs (FilterNone): Removed.
1546 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1548 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1551 * class.cs: Updated.
1553 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1555 * cs-parser.jay.cs: __arglist is not allowed for delegates.
1557 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1561 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
1563 (AnonymousMethod.ImplicitStandardConversionExists): New method.
1564 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1565 Add more error reporting; Fixed issue with params.
1567 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1569 * cs-parser.jay: AnonymousMethod requires host container.
1571 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1573 2006-03-18 Raja R Harinath <harinath@gmail.com>
1575 * class.cs: Change 'TypeContainer ds' constructor argument to
1576 'DeclSpace parent'. Some classes were missed below due to
1577 different naming convention.
1579 * class.cs (MemberCore.Parent): Delete. This makes the
1580 ParentContainer changes below enforceable by the compiler.
1582 Treat pointers to enclosing declaration space as 'DeclSpace', not
1584 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1585 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1587 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1589 (Block.AddThisVariable): Likewise.
1590 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1591 (AbstractPropertyEventMethod.Emit): Likewise.
1592 (AbstractPropertyEventMethod.EmitMethod): Likewise.
1593 (GetMethod.Define, SetMethod.Define): Likewise.
1594 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1595 (DelegateMethod.EmitMethod): Likewise.
1597 Fix regression test-partial-13.cs.
1598 Rationalize use of PartialContainer. Ensure that the partial
1599 class semantics can be tied to type-correctness, i.e., any
1600 violation will cause a compile error.
1601 * class.cs, const.cs: Access all fields that belong to class
1602 TypeContainer via ParentContainer. Arguments of EmitContexts and
1603 Resolve()-like functions still use 'Parent'.
1605 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1606 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1607 (PropertyMethod.CheckModifiers): Remove unused argument.
1608 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1611 2006-03-28 Raja R Harinath <rharinath@novell.com>
1613 * decl.cs (DeclSpace.LookupGeneric): Update to changes.
1615 2006-03-17 Raja R Harinath <harinath@gmail.com>
1617 Make semantics of PartialContainer simpler.
1618 * decl.cs (DeclSpace.IsPartial): Remove.
1619 * class.cs (TypeContainer.IsPartial): Likewise.
1620 (TypeContainer..ctor): Set PartialContainer to point to self.
1621 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1622 (TypeContainer.FindNestedType): Likewise.
1623 (MemberCore.ParentContainer): Simplify. Remove deprecation.
1625 2006-03-17 Marek Safar <marek.safar@seznam.cz>
1627 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
1629 2006-03-15 Marek Safar <marek.safar@seznam.cz>
1631 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
1634 2006-03-15 Marek Safar <marek.safar@seznam.cz>
1636 * class.cs (Operator.Define): An error for base conversion was not
1639 2006-03-13 Marek Safar <marek.safar@seznam.cz>
1641 A fix for #77593, #77574.
1643 * class.cs (MethodCore.CheckBase): Another if for operator.
1645 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1649 * expression.cs (VerifyArgumentsCompat): Reverted to double error
1650 reporting, it's more tricky than I thought.
1652 2006-03-09 Marek Safar <marek.safar@seznam.cz>
1654 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
1657 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
1658 (DelegateCreation.ImplicitStandardConversionExists): New method for just
1661 * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
1664 2006-03-04 Marek Safar <marek.safar@seznam.cz>
1668 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
1669 (Event.Define): ditto
1670 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1672 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1673 Removed redundant code and set NewSlot for Invoke method too.
1675 * parameter.cs (Parameters.ctor): Add custom, type ctor.
1676 (Parameters.MergeGenerated): New method. Use this method when you merge
1677 compiler generated argument with user arguments.
1679 2006-03-03 Marek Safar <marek.safar@seznam.cz>
1681 * attribute.cs (ResolveAsTypeTerminal): Removed.
1683 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1684 specialization for predefined types; 30% speed up.
1685 Finally placed obsolete check to right place.
1686 (Expression.ResolveType): Removed.
1688 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1689 Updated after ResolveType was removed.
1691 * expression.cs (Cast.ctor): Check void cast.
1692 (Binary.ResolveAsTypeTerminal): Is never type.
1693 (Conditional.ResolveAsTypeTerminal): Is never type.
1695 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1697 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1699 * rootcontext.cs (ResolveCore): Removed System.INullableValue.
1701 2006-03-23 Martin Baulig <martin@ximian.com>
1703 * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
1704 type check if either of the types is an open generic type.
1706 2006-03-23 Martin Baulig <martin@ximian.com>
1709 (Convert.ExplicitTypeParameterConversion): New method; implement
1710 explicit type parameter conversions.
1712 2006-03-23 Martin Baulig <martin@ximian.com>
1714 * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
1715 blindly allow all conversions if we do not have any constraints.
1717 2006-02-27 Marek Safar <marek.safar@seznam.cz>
1719 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1720 these two separated members to simplify the code.
1721 (Attribute.Resolve): Refactored to use new fields and methods.
1722 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1723 implemented obsolete attribute checking.
1724 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
1725 implemented obsolete checking again. It look line never ending quest ;-)
1726 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
1728 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
1730 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
1732 *class.cs (Property.Define): Add RegisterProperty call.
1734 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
1735 argument groups (only 2).
1737 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
1738 encoding expression to arguments.
1739 (Expression.ExprClassToResolveFlags): Just turned to property.
1741 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
1742 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
1743 optimized as well as implemented support for zero-length attributes.
1745 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
1746 Add caching of PropertyInfo's.
1748 2006-02-25 Marek Safar <marek.safar@seznam.cz>
1750 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
1751 error multiple times.
1753 2006-02-25 Marek Safar <marek.safar@seznam.cz>
1755 New partial class implementation.
1756 A fix for #77027, #77029, #77403
1758 * attribute.cs (Attributable): Made attributes protected.
1760 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
1761 the replacements of ClassPart and PartialContainer.
1762 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
1763 (TypeContainer.AddInterface): Ditto.
1764 (TypeContainer.AddPartial): The main method for partial classes. It checks
1765 for errors and merges ModFlags and attributes. At the end class is added to
1767 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
1769 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
1770 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
1771 from the rest of partial classes.
1772 (TypeContainer.GetClassBases): Simplified.
1773 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
1775 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
1776 (TypeContainer.HasExplicitLayout): Uses Flags now.
1777 (PartialContainer): Removed.
1778 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
1779 (StaticClass): Was merged with Class.
1780 (Class.GetClassBases): class and static class bases are verified here.
1781 (Class.TypeAttr): Added static attributes when class is static.
1782 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
1783 (MemberBase): In some cases we need to call parent container for partial
1784 class. It should be eliminated but it's not easy now.
1786 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
1788 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
1789 partial classed to accumulate class comments.
1790 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
1792 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
1794 * driver.cs (MainDriver): Tree.GetDecl was removed.
1796 * modifiers.cs (Modifiers): Add partial modifier.
1798 * tree.cs (Tree.decl): Removed.
1799 (RootTypes): Started to use this class more often for root types
1802 2006-03-23 Raja R Harinath <rharinath@novell.com>
1804 * generic.cs (TypeParameter.UpdateConstraints): Update
1805 'constraints' if null.
1807 2006-02-22 Marek Safar <marek.safar@seznam.cz>
1811 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
1812 external interface does not have an attribute.
1814 2006-02-22 Marek Safar <marek.safar@seznam.cz>
1816 Another prerequisites for new partial classs implementation.
1818 * attribute.cs (Attribute.Equal): Implemented.
1819 (Attribute.Emit): Changed as attributes can be applied more than twice.
1820 (Attributes.Emit): Check for duplicate attributes here.
1822 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
1823 as a parameter, clean-up.
1825 2006-02-11 Marek Safar <marek.safar@seznam.cz>
1829 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
1830 contains obsolete attribute check which can in some cases look for base
1831 type of current class which is not initialized yet.
1832 (TypeContainer.BaseType): Replacement of ptype.
1834 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
1836 2006-02-11 Marek Safar <marek.safar@seznam.cz>
1838 First of prerequisites for new partial classs implemention.
1840 * attribute.cs (Attributable): Extended by ResolveContext;
1841 Attributes finally have correct context for resolving in all cases.
1842 (AttachTo): Attribute owner is assigned here.
1844 * codegen.cs (IResolveContext): Introduce new interface to hold
1845 all information needed in resolving phase.
1846 (EmitContext): Implements IResolveContext; more clean-up needed here.
1848 * decl.cs (MemberCore): Implemented IResolveContext.
1850 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
1851 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
1852 parameter.cs, statement.cs, tree.cs, typemanager.cs:
1853 Refactored to use new IResolveContext instead of EmitContext; cleanup
1855 2006-03-22 Raja R Harinath <rharinath@novell.com>
1857 Support ParameterDefaultValueAttribute in gmcs. Also applied to
1858 mcs to keep code differences small.
1859 * attribute.cs (Attribute.GetParameterDefaultValue): New.
1860 * typemanager.cs (parameter_default_value_attribute_type): New.
1861 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
1864 2006-03-22 Martin Baulig <martin@ximian.com>
1867 (Nullable.NullableLiteral): Derive from `NullLiteral'.
1870 (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
1871 instead of the normal `NullLiteral'.
1873 2006-03-21 Martin Baulig <martin@ximian.com>
1876 * generic.cs (TypeManager.InferType): If `pt' is a generic
1877 parameter, don't check whether `pt == at'.
1879 2006-03-20 Raja R Harinath <rharinath@novell.com>
1882 * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
1883 (TypeParameter.Resolve): Update to change.
1884 (ConstraintChecker.CheckConstraints): Resolve type-argument
1885 constraints before use.
1887 2006-03-16 Martin Baulig <martin@ximian.com>
1890 (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
1891 and don't have any instance constructors, also lookup in the base class.
1892 (TypeManager.IsNullableValueType): New public method.
1894 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
1895 `BindingFlags.DeclaredOnly' flag and set `used_cache'.
1896 (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
1898 * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
1899 instead of just TypeManager.IsNullableType() to determine whether
1900 a lifted operator exists.
1901 (UnaryMutator.DoResolve): Likewise.
1902 (Conditional.DoResolve): Likewise.
1903 (Binary.DoResolve): A lifted operator only exists if both operands
1904 are valuetypes and at least one of them is a nullable type.
1906 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
1908 * iterator.cs : yield break is allowed in try statement which has
1909 catch clauses. Fixed bug #77767.
1911 2006-03-12 Martin Baulig <martin@ximian.com>
1913 * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
1914 private IsSignatureEqual() to compare types; see the comment in
1915 that method; fixes #77674.
1917 2006-03-10 Raja R Harinath <rharinath@novell.com>
1919 * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
1920 (Expression.ResolveAsTypeTerminal): Likewise.
1921 * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
1922 * expression.cs, generic.cs, iterators.cs: Likewise.
1923 * parameter.cs, statement.cs, typemanager.cs: Likewise.
1925 2006-03-09 Martin Baulig <martin@ximian.com>
1927 * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
1928 TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
1930 2006-03-09 Martin Baulig <martin@ximian.com>
1932 * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
1933 `prepared' flag is set.
1935 * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
1936 (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
1937 issues; see gtest-254.cs.
1939 2006-03-07 Martin Baulig <martin@ximian.com>
1941 * generic.cs (TypeManager.InferType): Allow infering
1942 `IEnumerable<T>' with an array of T; see gtest-251.cs.
1944 2006-03-06 Martin Baulig <martin@ximian.com>
1947 (TypeManager.InferType): Fix gtest-250.cs.
1950 (TypeManager.IsSubclassOf): Also check the base class.
1953 (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
1956 2006-03-01 Raja R Harinath <rharinath@novell.com>
1959 * expression.cs (ParameterReference.DoResolveBase): Change return
1961 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
1965 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
1968 * typemanager.cs (GetFullNameSignature): Don't nullref on
1969 protected accessors.
1971 2006-02-16 Martin Baulig <martin@ximian.com>
1974 (TypeManager.GetGenericFieldDefinition): New public method; use it
1975 instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
1977 2006-02-14 Martin Baulig <martin@ximian.com>
1979 * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
1981 2006-02-14 Martin Baulig <martin@ximian.com>
1984 (TypeManager.DropGenericMethodArguments): New public method; don't
1985 use GetGenericMethodDefinition() on something which is not a
1988 2006-02-14 Martin Baulig <martin@ximian.com>
1991 (ConstraintChecker.CheckConstraints): If a type parameter has the
1992 `struct' constraint, the type must be a non-nullable valuetype.
1994 2006-02-10 Martin Baulig <martin@ximian.com>
1997 (TypeManager.IsOverride): Make this work for instantiated methods
1998 in a generic class; fixes #77509.
1999 (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
2000 rather than calling it directly; fixes #77488.
2002 2006-02-08 Martin Baulig <martin@ximian.com>
2004 * generic.cs (ConstraintChecker.CheckConstraints): Move the error
2005 reporting into CheckConstraint() so we can use the correctly
2008 2006-02-08 Martin Baulig <martin@ximian.com>
2010 * expression.cs (BaseAccess): Add support for generic methods.
2012 * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
2013 the new MethodGroupExpr.
2015 2006-02-07 Martin Baulig <martin@ximian.com>
2017 * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
2018 also reference types; fixes #77483.
2020 2006-02-07 Martin Baulig <martin@ximian.com>
2023 (TypeManager.IsGenericMethod): We now return whether something is
2024 an instantiated generic method (and not a generic method def).
2025 (TypeManager.IsGenericMethodDefinition): New public method.
2028 (TypeManager.CSharpSignature): Only include type arguments for
2029 "real" generic methods, not for any instantiated method.
2030 (TypeManager.GetMethodName): Likewise, but also allow generic
2031 method definitions here.
2033 2006-02-06 Miguel de Icaza <miguel@novell.com>
2035 * codegen.cs (EmitScopeInitFromBlock): check here the
2036 capture_context, there is no need to make two calls to the
2039 * anonymous.cs: Add some debugging messages that might help me
2040 track other instances of this problem in the future (the
2041 regression of test 467).
2043 * cs-parser.jay: track the variable block, as we need to initalize
2044 any captured variables declared in this block for the "catch"
2045 portion of the "Try" statement.
2047 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
2048 scope initialization for captured variables.
2050 Also, move the emit for the variables after the block location has
2053 2006-02-06 Marek Safar <marek.safar@seznam.cz>
2055 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
2057 2006-02-06 Martin Baulig <martin@ximian.com>
2059 * class.cs (TypeContainer.DefineType): If we're a struct, pass
2060 `TypeManager.value_type' as parent type to
2061 ModuleBuilder.DefineType(). Fixes #77358.
2063 2006-02-02 Miguel de Icaza <miguel@novell.com>
2065 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
2066 commit yesterday, the initialization for the roots is necessary.
2067 What is not necessary is the scope activation.
2069 2006-02-02 Raja R Harinath <rharinath@novell.com>
2071 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
2072 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
2074 (Argument.Resolve): Remove CS0206 checks.
2076 2006-02-01 Miguel de Icaza <miguel@novell.com>
2078 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
2079 scopes for all the roots, the scopes will now be emitted when the
2080 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
2082 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
2083 code. This reduces a lot of existing cruft.
2085 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
2086 that the ScopeInfo is generated as we enter the scope, not at the
2087 time of use, which is what we used to do before.
2089 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
2090 every time a Block is about to be emitted if we have a
2093 2006-02-01 Raja R Harinath <rharinath@novell.com>
2095 * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
2096 attribute for mscorlib too.
2098 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
2100 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
2102 * typemanager.cs (cons_param_array_attribute): Make private.
2103 (Reset): Set it to null.
2104 (InitCoreHelpers): Don't initialize it.
2105 (ConsParamArrayAttribute): New. Initialize it as needed.
2106 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
2108 2006-01-31 Miguel de Icaza <miguel@novell.com>
2110 * expression.cs: There might be errors reported during the
2111 selection of applicable methods. If there are errors, do not
2112 continue execution as it will lead the compiler to crash.
2114 2006-01-30 Miguel de Icaza <miguel@novell.com>
2116 * expression.cs: Member access is not allowed on anonymous
2117 methods. Fixes #77402.
2119 2006-01-30 Raja R Harinath <rharinath@novell.com>
2122 * cs-parser.jay (VariableDeclaration): Don't set
2123 current_array_type to null.
2124 (field_declaration, event_declaration, declaration_statement):
2125 Set it to null here.
2127 2006-01-29 Raja R Harinath <harinath@gmail.com>
2130 * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
2132 2006-01-28 Raja R Harinath <harinath@gmail.com>
2134 * typemanager.cs (GenericParameterPosition): New.
2137 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
2139 * doc.cs : To process "include" elements, first we should create
2140 another list than XmlNodeList, because it could result in node
2141 removal, which could result in that the XmlNodeList gives up
2144 2006-01-25 Miguel de Icaza <miguel@novell.com>
2146 * expression.cs: Introduce an error report that we were not
2147 catching before. Gonzalo ran into it.
2149 2006-01-23 Miguel de Icaza <miguel@novell.com>
2151 A fix for bug: #76957
2153 * iterators.cs (MoveNextMethod.CreateMethodHost): call
2154 ComputeMethodHost before creating the method, this is a new
2157 * anonymous.cs (AnonymousContainer): Now we track all the scopes
2158 that this method references (RegisterScope). The actual scope
2159 where the method is hosted is computed with the ComputeMethodHost
2160 before we create the method.
2162 Moved the Deepest routine here.
2164 (AnonymousContainer.ComputeMethodHost): New routine used to
2165 compute the proper ScopeInfo that will host the anonymous method.
2167 (ScopeInfo): Deal with multiple roots. The problem was that we
2168 did not have a unique root where all ScopeInfos could be hanged
2169 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
2172 Remove AdjustMethodScope which is now computed at the end. Remove
2173 LinkScope which did a partial link, instead link all ScopeInfos
2174 before code generation from the new "LinkScopes" routine.
2176 Simplify all the Add* routines as they no longer need to maintain
2177 the tree, they just need to record that they are using variables
2180 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
2181 routines to produce the forest of ScopeInfo trees.
2183 * class.cs (TypeContainer.AppendMethod): This is just like
2184 AddMethod, but ensures that an interface implementation method
2185 (IEnumerable.XXX) is not inserted at the beginning of the queue of
2186 methods, but at the end.
2188 We use this functionality to ensure that the generated MoveNext
2189 method in the iterator class is resolved/emitted before the
2190 enumerator methods created.
2192 This is required because the MoveNext method computes the right
2193 ScopeInfo for the method. And the other methods will eventually
2194 need to resolve and fetch information computed from the anonymous
2198 2006-01-23 Raja R Harinath <rharinath@novell.com>
2200 Improve implementation of section 14.4.2.2 (Better function member).
2201 * expression.cs (Invocation.MoreSpecific): Compare all type
2202 arguments before deciding if one type is more specific than
2203 another. Handle array types too. Return the more specific type.
2204 (Invocation.BetterFunction): Add more tie-breaking rules from
2205 section 14.4.2.2. Perform "more specific" check after
2206 other tie-breaking rules. Compare all parameter types before
2207 choosing the "more specific" method.
2209 2006-01-21 Raja R Harinath <harinath@gmail.com>
2210 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2213 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
2215 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
2216 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
2218 2006-01-18 Martin Baulig <martin@ximian.com>
2220 * class.cs (TypeContainer.AddToMemberContainer): Use
2221 `symbol.MemberName.MethodName' instead of just `symbol.Name';
2224 2006-01-18 Martin Baulig <martin@ximian.com>
2226 Fix #76417: a generic class may now have methods which may unify
2227 for some type parameter substitutions.
2229 * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
2230 for methods which may unify anymore.
2232 * expression.cs (Invocation.MoreSpecific): New private static
2233 method; checks whether one method is more specific than another
2234 according to 14.4.2.2 of the spec.
2235 (Invocation.BetterFunction): Implement the tie-breaking rules from
2236 14.4.2.2 of the spec: if two methods unify for some type parameter
2237 substitution, we need to pick the more specific one.
2239 2006-01-18 Raja R Harinath <rharinath@novell.com>
2241 Fix #76656, cs0231-2.cs.
2242 * cs-parser.jay (formal_parameter_list): Make error case catch
2244 (parenthesized_expression_0): Add CS1026 check.
2245 (invocation_expression): Remove unused { $$ = lexer.Location }.
2247 2006-01-17 Raja R Harinath <rharinath@novell.com>
2250 * cs-parser.jay (statement_expression): Don't list out the
2251 individual statement-expressions. Convert syntax error into
2254 2006-01-16 Raja R Harinath <rharinath@novell.com>
2257 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
2258 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
2259 CheckIntermediateModification.
2260 (FieldExpr.DoResolve): Add new two-argument version that
2261 allows us to resolve the InstanceExpression as an lvalue.
2262 The one-argument variant is now just a wrapper.
2263 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
2264 Resolve the lhs as an lvalue if the it has a value type.
2265 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
2266 from Assign.DoResolve.
2267 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
2268 resolved as an lvalue.
2269 (PropertyExpr.DoResolve): Update.
2270 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
2271 has a value type. Move CS1612 check here from
2272 CheckIntermediateModification.
2273 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
2274 * expression.cs (EmptyExpression.OutAccess): New. Used as the
2275 'right_side' of a ResolveLValue on an 'out' argument.
2276 (EmptyExpression.LValueMemberAccess): New. Used as the
2277 'right_side' of a propagated ResolveLValue on a value type.
2278 (LocalVariableReference.DoResolveBase): Recognize
2279 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
2281 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
2282 EmptyExpression.Null.
2284 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
2286 * typemanager.cs : added IsGenericParameter(). In gmcs it returns
2287 Type.IsGenericParameter(). Fixed bug #77183.
2288 * doc.cs : it is now identical to doc.cs in mcs.
2290 2006-01-16 Martin Baulig <martin@ximian.com>
2292 * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
2294 2006-01-16 Martin Baulig <martin@ximian.com>
2296 * typemanager.cs (TypeManager.CSharpSignature): Make this work for
2297 ctors; fixes #77250.
2299 2006-01-12 Miguel de Icaza <miguel@novell.com>
2301 This fixes the problem where we used ldfld instead of ldflda to
2302 load the "THIS" pointer on captured parameters, when THIS is a
2303 value type. See bug #77205.
2305 * iterators.cs (CapturedThisReference.Emit): Pass false to
2306 EmitThis (we do not need the address).
2308 * codegen.cs (EmitThis): it needs to know whether we need the
2309 address of `this' or not. This is used by value types.
2311 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
2312 every other call passes false.
2314 2006-01-12 Raja R Harinath <rharinath@novell.com>
2317 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
2319 * expression.cs (Invocation.OverloadResolve): Update.
2320 (Invocation.DoResolve): Avoid double resolution of invocation.
2322 2006-01-11 Raja R Harinath <rharinath@novell.com>
2325 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
2326 unary negation of floating point types as 0-expr; negation cannot
2327 overflow in floating point types.
2330 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
2331 on operands of 'void' type.
2334 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
2335 and ExclusiveOr for boolean constants too.
2337 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
2339 * expression.cs: Fix Console.WriteLine ((this = x).foo);
2341 2006-01-12 Miguel de Icaza <miguel@novell.com>
2343 * cs-tokenizer.cs (Position): New class used to save and restore
2344 the position state in the tokenizer. Before this patch the save
2345 and restore was not complete enough so the line and columns would
2346 start to drift and the debugger and stack traces will get the
2349 2006-01-10 Martin Baulig <martin@ximian.com>
2352 (TypeParameter.InflateConstraints): New public method.
2354 * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
2355 constraints; fixes #77042.
2357 2006-01-10 Martin Baulig <martin@ximian.com>
2359 * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
2360 instead of the `TypeBuilder' for this "<>THIS" variable; fixes
2363 2006-01-09 Raja R Harinath <rharinath@novell.com>
2366 * expression.cs (Invocation.OverloadResolve): Replace reflected
2367 override methods with their base virtual methods, rather than
2369 * typemanager.cs (TypeManager.GetOverride): New.
2371 2005-12-21 Miguel de Icaza <miguel@novell.com>
2373 * driver.cs: Report the case of no source files and no -out:
2376 2005-12-20 Raja R Harinath <rharinath@novell.com>
2379 * expression.cs (ComposedCast.GetSignatureForError): Define.
2381 2006-01-05 Jb Evain <jbevain@gmail.com>
2383 * class.cs (Property.Define, Indexer.Define): do not tag the
2384 properties as SpecialName | RTSpecialName.
2386 2006-01-04 Miguel de Icaza <miguel@novell.com>
2388 * class.cs (MethodCore.IsDuplicateImplementation): This method was
2389 doing a low-level comparission of parameter types. It was lacking
2390 a check for __argslist.
2392 2005-12-30 Miguel de Icaza <miguel@novell.com>
2394 * expression.cs (ParameterReference.DoResolveBase): Allow
2395 reference parameters if they are local to this block.
2397 This allows the ref and out parameters of a delegate to be used in
2398 an anonymous method, for example:
2400 delegate void set (out int x);
2402 set s = delegate (out int x){
2406 This is used by functionality introduced late in the C# language.
2408 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
2409 method that take ref and out parameters.
2411 Fixes #77119 which was a late change in the spec.
2413 2005-12-23 Miguel de Icaza <miguel@novell.com>
2415 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
2416 parent if its the same scope. Fixes #77060.
2418 2005-12-22 Marek Safar <marek.safar@seznam.cz>
2420 * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
2422 2005-12-21 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2424 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
2425 errors 1726 for strong named assemblies with InternalsVisibleToAttribute
2426 that doesn't contain the full public key. This is a update of the
2427 friend assemblies in .Net 2.0 release.
2429 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2433 * namespace.cs (NamespaceEntry): Add extern_aliases as a
2434 ListDictionary, to contain the ExternAliasEntry entries (in
2435 addition to the NamespaceEntry.aliases hashtable). This field is
2436 shared between the original entry and its doppelganger (bodyless
2438 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
2439 extern_aliases field.
2440 (NamespaceEntry.Lookup): Move the IsImplicit check after the
2441 lookup in extern_aliases.
2443 2005-12-16 Raja R Harinath <rharinath@novell.com>
2446 * class.cs (TypeContainer.Mark_HasEquals): New.
2447 (TypeContainer.Mark_HasGetHashCode): New.
2448 (ClassPart): Override them.
2449 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
2451 * generic.cs (GenericMethod.DefineMembers): Update to changes.
2452 (TypeParameter.TypeParameter): Change type of 'parent' argument to
2456 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
2457 'parent' argument to the base constructor.
2459 Remove all mention of TypeContainer from decl.cs.
2460 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
2461 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
2462 (DeclSpace.DeclSpace): Likewise.
2463 (DeclSpace.DefineMembers): Remove unused argument.
2464 * cs-parser.jay (pop_current_class): Update to changes. Simplify
2465 debugging check -- we don't care if the debug code throws an
2466 InvalidCastException instead of an InternalErrorException.
2467 * class.cs (TypeContainer.DefineMembers): Update to changes.
2468 (TypeContainer.DoDefineMembers): Likewise.
2469 (TypeContainer.GetMethods): Likewise.
2470 (PropertyMember.Define): Likewise.
2471 (MemberBase.Parent): New property that forwards to
2472 MemberCore.Parent, but ensures that we get a TypeContainer.
2473 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
2474 (RootContext.PopulateTypes): Likewise. Remove special case code
2475 for !RootContext.StdLib: DefineMembers is idempotent.
2477 2005-12-13 Marek Safar <marek.safar@seznam.cz>
2479 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
2481 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
2483 * doc.cs : The search for referenced namespace was insufficient to
2484 get global one as it used to do. Fixed bug #76965.
2486 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
2488 * doc.cs : check name in cref in the last phase that whether it is
2491 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2493 * cs-tokenizer.cs : reverted the latest change: it somehow broke
2496 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2498 * doc.cs : so it turned out that we cannot skip override check for
2499 interface members. Fixed bug #76954.
2501 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2503 * cs-tokenizer.cs : fixed bug #75984:
2504 - #warning and #error should not be handled when the source line
2506 - #line is not checked strictly when the source line is disabled.
2507 - #define and #undef is on the other hand checked strictly at any
2510 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
2512 * cs-tokenizer.cs : missing Location (actually, filename) in one of
2515 2005-12-15 Raja R Harinath <rharinath@novell.com>
2517 * generic.cs (TypeManager.IsGeneric): Remove unused method.
2519 * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
2522 2005-12-14 Martin Baulig <martin@ximian.com>
2524 * typemanager.cs (TypeManager.GetFullName): Make this public;
2525 `Type.Fullname' now never returns null.
2527 * class.cs (Method.Define): Use TypeManager.GetFullName() for
2528 explicit interface implementations; we're now using the same
2529 naming convention than csc does.
2531 2005-12-14 Miguel de Icaza <miguel@novell.com>
2533 * convert.cs (ExplicitConversionCore): Check the return value from
2534 ExplicitConversionCore which can return null on failure. Fixes #76914
2536 2005-12-09 Raja R Harinath <rharinath@novell.com>
2538 * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
2539 instead of IsGenericInstance.
2540 * generic.cs (TypeManager.IsEqual): Likewise. Delete redundant
2541 code that's now covered by the more general test.
2542 * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
2544 * generic.cs (DropGenericTypeArguments): New. Captures the common
2545 pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
2546 * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
2547 * generic.cs, report.cs, typemanager.cs: Likewise.
2549 2005-12-08 Martin Baulig <martin@ximian.com>
2551 * generic.cs (TypeArguments.Resolve): Added CS1547 check.
2553 * typemanager.cs (TypeManager.CSharpSignature): Include type
2554 arguments in the signature of a generic method.
2556 2005-12-07 Martin Baulig <martin@ximian.com>
2558 Add support for custom attributes on type parameters.
2560 * cs-parser.jay (type_arguments): Added `opt_attributes'.
2562 * generic.cs (TypeParameterName): New public class; we use this
2563 instead of a `string' to store the name of a type parameter, so we
2564 can also have `Attributes'.
2565 (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
2566 array instead of a `string[]' array.
2567 (TypeParameter.ctor): We now also take an `Attributes' argument.
2568 (TypeParameter.EmitAttributes): New public method; emit our
2569 `OptAttributes' here.
2570 (GenericMethod.EmitAttributes): New public method; emit the custom
2571 attributes on all our type parameters.
2573 * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
2574 our type parameters.
2575 (MethodData.Define): If we're a generic method, call
2576 EmitAttributes() on it.
2578 2005-12-07 Martin Baulig <martin@ximian.com>
2581 (ConstraintChecker): New public abstract class; move the
2582 constraint checking here from `ConstructedType' and also do
2583 constraint checking for generic methods here.
2585 * expression.cs (Invocation.OverloadResolve): Use
2586 ConstraintChecker.CheckConstraints() if we resolved to a generic
2589 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2591 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2593 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2595 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
2596 (FieldBase.Initializer): Initializer is now optional.
2597 (EventField.Define): Only event field can have initializer.
2599 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
2601 * const.cs (Const): Reuse initializer.
2603 * cs-parser.jay: Updated after FieldBase changes.
2604 Added current_array_type to simplify array initializers.
2606 * ecore.cs (NullCast.IsDefaultValue): Implemented.
2608 * expression.cs, iterators.cs: Updated.
2610 * namespace.cs (NamespaceEntry): Made UsingFound private.
2612 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2614 * parameterCollection.cs: Obsolete, removed.
2615 * parser.cs: Obsolete, removed.
2617 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2620 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2622 * enum.cs (Enum.Define): Set obsolete context here.
2624 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
2627 - FindDocumentedMember() now expects 1) paramList as null
2628 when "we don't have to check the number of parameters" and
2629 2) Type.EmptyTypes when "there is no arguments".
2630 - Introduced FoundMember struct to hold the exact type which was
2631 used to find the documented member (the above change broke
2632 test-xml-044; it might be better just to use DeclaringType than
2633 what MS does, like this change does, but it depends on usage.)
2635 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
2637 * doc.cs : documented member might be from DeclaringType for nested
2638 types. Fixed bug #76782.
2640 2005-12-03 Ben Maurer <bmaurer@ximian.com>
2642 * anonymous.cs: Have the param code handle leaving copies on the
2643 stack etc. Allows anonymous params to take part in the assignment
2644 code (++, +=, etc). Fixes bug #76550
2646 * expression.cs: Handle the prepare_for_load/leave_copy by passing
2647 it down to the anon code.
2649 * iterators.cs: Use dummy var here
2651 * codegen.cs: Handle new vars
2653 2005-12-01 Marek Safar <marek.safar@seznam.cz>
2656 * class.cs (MethodData.Define): Set proper Obsolete context.
2658 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
2660 (FieldExpr.DoResolve): Ditto.
2662 2005-12-01 Marek Safar <marek.safar@seznam.cz>
2665 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
2666 parent is not obsolete.
2668 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
2670 * doc.cs : (FindDocumentedMember) find parameterless members first
2671 and get CS0419 in the early stage. Fixed first case of bug #76727.
2673 2005-11-30 Marek Safar <marek.safar@seznam.cz>
2676 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2677 no error was reported.
2679 *expression.cs (Binary.DoResolve): left can be null.
2681 2005-12-06 Raja R Harinath <rharinath@novell.com>
2683 * class.cs (MethodCore.CheckGenericOverride): Delete unused
2684 abstract method and all overrides.
2685 * support.cs (ParameterData.GenericConstraints): Delete.
2686 (ReflectionParameters.type_params): Delete.
2687 (ReflectionParameters.ReflectionParameters): Make private.
2688 (ReflectionParameters.GetConstaints): New factory method.
2689 * generic.cs (TypeParameterDefineType): Use it.
2690 (TypeManager.GetTypeParameterConstraints): Likewise.
2692 2005-11-22 Marek Safar <marek.safar@seznam.cz>
2695 * class.cs (MethodData.Emit): Parameters should be labeled first.
2697 2005-11-21 Marek Safar <marek.safar@seznam.cz>
2700 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2702 2005-11-18 Marek Safar <marek.safar@seznam.cz>
2704 * attribute.cs (AreParametersCompliant): Moved to Parameter.
2706 * class.cs (MethodCore): Parameter clean up.
2707 (IMethodData): Added ParameterInfo.
2708 (MethodData): Parameter clean up.
2709 (Indexer.Define): Parameter clean up.
2721 * typemanager.cs: Parameter clean up.
2723 * delegate.cs (Define): Get rid of duplicated code.
2725 * expression.cs (ParameterReference): Removed useless parameters
2727 (Invocation): Ditto.
2729 * parameter.cs (ParamsParameter): New class, params specialization.
2730 (ArglistParameter): Attemp to separate arglist.
2731 (Parameter): Refactored to be reusable and faster.
2732 (Parameter.Modifier): Made understandable.
2733 (Parameters): Changed to be used as a class for `this' assembly
2734 parameters. Refactored to use new specialized classes.
2736 * support.cs (ParameterData): Added Types property.
2737 (InternalParameters): Deleted.
2739 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2741 * doc.cs : the previous patch does not actually fix the bug.
2742 PropertyInfo override check is now implemented and really fixed it.
2743 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2745 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2747 * doc.cs : apply "override filter" also to properties.
2750 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2752 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2753 no need to check overrides. For classes, omit those results from
2754 interfaces since they must exist in the class. Fixed bug #76726.
2756 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2758 * typemanager.cs : (GetFullNameSignature) differentiate indexers
2759 with different parameters. Fixed the second problem in #76685.
2761 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2763 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2764 get expected 'protected' access in CheckValidFamilyAccess()).
2767 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2769 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2770 Fixed bug #76705. CS1569 was incorrectly commented out.
2772 2005-11-23 Martin Baulig <martin@ximian.com>
2774 * generic.cs (Constraints.Define): Removed.
2775 (TypeParameter.DefineConstraints): Removed.
2776 (TypeParameter.DefineType): Call SetGenericParameterAttributes()
2777 on the GenericTypeParameterBuilder here.
2779 2005-11-23 Martin Baulig <martin@ximian.com>
2781 * typemanager.cs (TypeManager.GetProperty): Make this public.
2783 * generic.cs (Nullable.NullableInfo.ctor): Use
2784 TypeManager.GetProperty() rather than using reflection directly.
2786 2005-11-17 Martin Baulig <martin@ximian.com>
2788 * expression.cs (Indexers.GetIndexersForType): Added support for
2789 generic parameters; fixes #76587.
2791 2005-11-17 Martin Baulig <martin@ximian.com>
2794 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2795 inherit the scope from our parent. Fixes #76653.
2797 2005-11-15 Martin Baulig <martin@ximian.com>
2799 * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
2800 instead of `ScopeTypeBuilder' to refer to the "current" type.
2801 (AnonymousMethod.CreateScopeType): Correctly create the helper
2802 class if we're inside a generic type definition.
2804 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
2806 * doc.cs : use Invocation.IsOverride() to do real override check.
2807 * expression.cs : made Invocation.IsOverride() internal.
2809 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
2811 * doc.cs : use TypeManager.FindMembers() instead of (possible)
2812 TypeBuilder.FindMembers() and filter overriden base members out.
2815 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2817 * doc.cs : ref/out parameters are represented as '@' (instead of
2818 '&' in type FullName). Fixed bug #76630 (additionally crefs).
2820 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2822 * doc.cs : when there was no '.' in cref to methods in doc comment,
2823 then parameters were missing in the output. Fixed bug #76691.
2825 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2827 * driver.cs : don't output docs when there is an error.
2830 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2833 Now it should detect indexers. Fixed primary concern in bug #76685.
2834 Fixed CS0419 message to not show the identical member signature in
2837 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2839 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2840 instead of Type.FindMembers() since it does not handle events.
2843 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
2845 * codegen.cs: Fixed typo (speficied -> specified).
2847 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2850 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
2852 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2854 * attribute.cs: Changed error message.
2856 * cs-tokenizer.cs: One more check.
2858 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2860 * statement.cs (Block.Resolve): Ignore empty statement.
2862 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2864 * report.cs: Made error/warning methods more strict to avoid
2867 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
2868 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
2869 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
2870 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
2872 2005-11-11 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2874 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute):
2875 Use the more explicit AssemblyName.FullName instead of
2876 AssemblyName.Name to report errors.
2878 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2880 * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
2883 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2893 * report.cs: Fixed error reporting and typos.
2895 * generic.cs (TypeParameter.GetSignatureForError): New method.
2896 (ConstructedType.GetSignatureForError): Instead of DeclarationName.
2898 * typemanager.cs (GetFullName): Refactored.
2900 2005-11-08 Marek Safar <marek.safar@seznam.cz>
2902 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
2903 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
2905 * class.cs (TypeContainer.IsComImport): New property.
2906 (Constructor.Define): Create proper ctor for ComImport types.
2908 * expression.cs (New.CheckComImport): Fixed.
2910 2005-11-07 Miguel de Icaza <miguel@novell.com>
2912 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
2913 that a parameter has been captured does not mean that we do not
2914 have to do the rest of the processing. This fixes the second part
2915 of #76592. If there was another anonymous method capturing
2916 values in the past, the Scope would never be set for the second
2917 method that captured the same parameter.
2919 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
2920 properly manipulate the stack. Second part of fix for #76592.
2922 * expression.cs (New): Add support for invoking "new" on
2923 interfaces that have been flagged with the ComImport attribute and
2924 the CoClass. Fixes #76637
2926 * statement.cs (Try.DoEmit): When a variable is captured, do not
2927 try to emit the vi.LocalBuilder variable as it has been captured.
2928 Create a temporary variable and store the results on the
2929 FieldBuilder. Fixes #76642
2931 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2933 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
2935 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
2937 * expression.cs (Binary.DoResolve): Added && optimalization.
2939 * typemanager.cs (AddUserType): Removed useless argument.
2941 2005-11-04 Marek Safar <marek.safar@seznam.cz>
2943 * statement.cs (Block.variables): Uses ListDictionary.
2945 2005-11-03 Marek Safar <marek.safar@seznam.cz>
2948 * class.cs (PartialContainer.EmitType): Customized to emit
2949 security attributes.
2950 (ClassPart.ApplyAttributeBuilder): Transform security attribute
2951 for partial classes.
2953 2005-11-03 Marek Safar <marek.safar@seznam.cz>
2956 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
2957 access has to be fixed.
2959 * typemanager.cs (IsUnmanagedType): Wrong common field type.
2961 2005-11-01 Marek Safar <marek.safar@seznam.cz>
2964 * ecore.cs (NullCast.Reduce): Implemented.
2966 * expression.cs (ArrayCreation.CheckIndices): Correcly check
2969 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
2971 (Foreach.Resolve): Catch null properly.
2973 2005-10-29 Marek Safar <marek.safar@seznam.cz>
2975 * cs-tokenizer.cs: Warning text fix.
2977 * driver.cs: AllWarningNumbers exposed on public interface.
2979 * report.cs (): Reviewed warning numbers.
2980 (IsValidWarning): Use binary search.
2982 2005-10-29 Marek Safar <marek.safar@seznam.cz>
2984 * driver.cs: Implemeted resource visibility.
2985 (Resources): New class for code sharing between /res: and
2988 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2990 decl.cs (CurrentTypeParameters): Fixed to be public.
2992 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2994 generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
2996 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2998 gmcs.exe.sources: Use CryptoConvert.cs from corlib.
3000 2005-11-05 Kornél Pál <kornelpal@hotmail.com>
3002 * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
3004 2005-11-04 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3006 Add friend assembly access support.
3007 * typemanager.cs: assembly_internals_vis_attrs
3008 cache for friend assembly access.
3009 (TypeManager.IsFriendAssembly): New method for
3010 checking friend assembly access.
3011 (TypeManager.Error_FriendAccessNameNotMatching): New
3013 (TypeManager.CompareKeyTokens): Likewise.
3014 (TypeManager.Filter): Handle friend accessible
3017 * namespace.cs (RootNamespace.GetTypeInAssembly): Return
3018 friend accessible types.
3020 * ecore.cs (Expression.IsAccessorAccessible): Handle
3021 friend accessible properties.
3023 * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
3026 2005-10-28 Marek Safar <marek.safar@seznam.cz>
3029 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
3032 * convert (Convert.ImplicitReferenceConversion): NullCast holds
3035 * ecore.cs (NullCast): Child is contant only.
3037 * literal.cs (NullLiteral.Reduce): null can be converted to any
3040 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
3042 * driver.cs: Use Encoding.Default as default code page instead
3045 2005-10-27 Raja R Harinath <rharinath@novell.com>
3048 * expression.cs (Invocation.Error_InvalidArguments): Handle
3049 __arglist parameters.
3050 (Invocation.VerifyArgumentsCompat): Likewise.
3051 * support.cs (ReflectionParameters.GetSignatureForError): Print
3052 __arglist parameters.
3053 (InternalParamters.GetSignatureForError): Likewise.
3054 * parameter.cs (Parameters.GetSignatureForError): Likewise.
3056 2005-10-26 Marek Safar <marek.safar@seznam.cz>
3058 * attribute.cs (GetPropertyValue): Made public.
3060 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
3062 Add new property WrapNonExceptionThrows to handle 2.0 assembly
3064 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
3067 * driver.cs: Reflect method name change.
3069 * statement.cs (Try.Resolve): Warn when try has both general
3072 * typemanager.cs: runtime_compatibility_attr_type new predefined
3075 2005-10-26 Raja R Harinath <harinath@gmail.com>
3078 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
3079 treat it as an empty parameter list.
3081 2005-10-26 Raja R Harinath <rharinath@novell.com>
3084 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
3085 ResolveAsTypeStep silent.
3086 * statement.cs (Block.AddConstant): Mark block as used.
3087 (Block.ResolveMeta): Avoid piling on error messages
3088 if a constant initializer resolution fails.
3090 2005-10-25 Raja R Harinath <rharinath@novell.com>
3092 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
3094 (NamespaceEntry.VerifyAllUsing): New.
3095 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
3096 behaviour. Delegates actual resolution of alias to ...
3097 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
3098 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
3100 * driver.cs (Driver.MainDriver): Update.
3102 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
3103 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
3105 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
3107 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
3108 RootNamespace.DefineNamespacesForAll.
3110 2005-10-24 Raja R Harinath <harinath@gmail.com>
3112 * typemanager.cs (assemblies, external_aliases, modules)
3113 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
3114 (ComputeNamespaces, GetRootNamespace): Remove extra staging
3115 overhead. Move resposibility ...
3116 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
3117 * driver.cs, attribute.cs, codegen.cs: Update to changes.
3119 2005-10-23 Raja R Harinath <harinath@gmail.com>
3121 * namespace.cs (RootNamespace.all_namespaces): Renamed from
3122 cached_namespaces. Improve usage.
3123 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
3124 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
3125 Move from GlobalRootNamespace and simplify.
3126 (RootNamespace.Global): Make instance variable.
3127 (RootNamespace.RootNamespace): Add "alias name" parameter.
3128 (GlobalRootNamespace): Simplify drastically.
3129 (Namespace.Lookup): Don't use GetNamespace.
3130 * typemanager.cs (GetRootNamespace): Rename from
3131 ComputeNamespaceForAlias.
3132 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
3134 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3136 * anonymous.cs (AnonymousContainer): Don't crash when container
3139 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3141 * expression.cs (Binary.DoResolve): Warn when comparing same
3144 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3147 * expression.cs (Binary.DoResolve): It looks like there are no
3148 convetsion rules in enum context.
3150 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3152 Add support for extern alias qualifiers.
3153 * typemanager.cs: Move some LookupTypeReflection code
3154 to namespace.cs, to have cleaner code. Added some methods
3155 to help us keep track of the extern aliased references.
3156 * driver.cs: Add suport for extern alias assemblies on command
3157 line and check for their warnings/errors. Also keep track of the
3158 extern aliased assemblies.
3159 * namespace.cs: Move the global functionality of Namespace
3160 to GlobalRootNamespace/RootNamespace. Now the global namespace
3161 is GlobalRootNamespace.Globa. Also the code moved from
3162 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
3163 Finally added LocalAliasEntry (AliasEntry before) and
3164 ExternAliasEntry, to handle alias statements.
3165 * cs-parser.jay: Add support in the grammar for extern alias
3167 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
3168 Update callings to Namespace (now in GlobalRootNamespace).
3170 2005-10-25 Martin Baulig <martin@ximian.com>
3172 * convert.cs (ImplicitTypeParameterConversion): Make base
3173 interfaces actually work; fixes #76557.
3175 2005-10-25 Martin Baulig <martin@ximian.com>
3178 (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
3179 all the type parameters; fixes #76551.
3181 2005-10-25 Martin Baulig <martin@ximian.com>
3186 (GenericMethod.ctor): Added `Expression return_type' and
3187 `Parameters parameters' arguments.
3188 (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
3189 parameter and return types to check their constraints if they're
3192 * codegen.cs (EmitContext.ResolvingGenericMethod): New public
3195 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3196 constraints of a generic type if `ec.ResolvingGenericMethod'.
3198 * class.cs (MethodCore.DoDefineParameters): Set
3199 `ec.ResolvingGenericMethod' if we're a generic method.
3200 (MemberBase.MemberType): Likewise.
3202 2005-10-25 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3204 * typemanager.cs (TypeManager): Added
3205 TypeManager.internals_visible_attr_type to cache
3206 S.R.CompilerServices.InternalsVisibleToAttribute.
3208 * codegen.cs (AssemblyClass): Added checks for
3209 InternalsVisibleToAttribute in new method
3210 CheckInternalsVisibleAttribute () and also cache the
3211 AssemblyName in AssemblyClass.Name.
3213 2005-10-24 Martin Baulig <martin@ximian.com>
3216 (TypeManager.ExpandInterfaces): Added overloaded version which
3217 just takes a `Type[]' array.
3220 (Constraints.Resolve): Don't expand the interfaces here; ie. we
3221 just use the interfaces which were explicitly specified and not
3222 the interfaces they inherit. Fixes #76482.
3223 (TypeParameter.FindMembers): Expand the interfaces here.
3225 2005-10-21 Martin Baulig <martin@ximian.com>
3228 (Constraints.Resolve): Also resolve the actual types here.
3229 (Constraints.ResolveTypes): Just check the constraints here.
3230 Fixes #76363; see gtest-218.cs.
3232 2005-10-21 Martin Baulig <martin@ximian.com>
3235 (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
3236 instead of a `BoxedCast'; fixes gtest-217.cs.
3238 2005-10-20 Atsushi Enomoto <atsushi@ximian.com>
3240 * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
3241 1) "new()" is specified as generic parameter constraint and 2) the
3242 type is TypeBuilder and 3) the type is abstract even if it has a
3243 default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
3245 2005-10-20 Martin Baulig <martin@ximian.com>
3248 (GenericConstraints.TypeParameter): New public property.
3249 (TypeParameter.ctor): Also take a `DeclSpace' argument.
3250 (TypeParameter.DeclSpace): New public property.
3251 (TypeParameter.DefineType): Inflate the constraints if our
3252 `DeclSpace' is an `Iterator'.
3254 2005-10-19 Atsushi Enomoto <atsushi@ximian.com>
3256 * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added
3257 GenericMethod argument to compare methods' generic type arguments.
3260 2005-10-19 Martin Baulig <martin@ximian.com>
3262 * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
3263 not ResolveType() when resolving the base type, so we're not
3264 checking the constraints here.
3265 (TypeContainer.ResolveType): Call ResolveType() on our base_type
3268 2005-10-19 Martin Baulig <martin@ximian.com>
3270 * generic.cs (ConstructedType.CheckConstraints): Committing
3271 untested fix for #76441.
3273 2005-10-18 Raja R Harinath <rharinath@novell.com>
3276 * class.cs (TypeContainer.DefineType): Move updating of
3277 topological sort earlier in the code.
3278 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
3280 2005-10-18 Marek Safar <marek.safar@seznam.cz>
3283 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
3285 * constant.cs (Constant.TryReduce): Moved from Cast class.
3286 (Reduce): Made little bit more OO and fixed missing conversions.
3288 * ecore.cs (Reduce): Implemented.
3289 (Binary.EnumLiftUp): New method to upgrade values to enum values.
3291 * literal.cs (Reduce): Implemented.
3293 * class.cs: Reverted Miguel's wrong commit.
3295 2005-10-14 Miguel de Icaza <miguel@novell.com>
3297 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
3299 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
3301 * cs-parser.jay, expression.cs : CS0214 was missing error location
3302 for constants. Fixed bug #76404.
3304 2005-10-10 Raja R Harinath <rharinath@novell.com>
3306 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
3308 (PropertyExpr.EmitCall): Likewise.
3309 * expression.cs (Invocation.EmitArguments): Handle case where
3311 (Invocation.EmitCall): Avoid allocating temporary variable if
3312 there are no arguments.
3314 2005-10-11 Marek Safar <marek.safar@seznam.cz>
3317 * convert.cs (ExplicitConversionCore): Fixed object->enum
3320 2005-10-07 Raja R Harinath <rharinath@novell.com>
3323 * convert.cs (ImplicitConversionStandard): Move conversion of
3324 void* to arbitrary pointer types ...
3325 (ExplicitConversionStandard): .. here.
3326 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
3327 error to always print typenames.
3329 2005-10-07 Raja R Harinath <rharinath@novell.com>
3331 * convert.cs (GetConversionOperator): Rename from
3332 GetConversionOperators. Move operator selection code from ...
3333 (UserDefinedConversion): ... here.
3335 2005-10-06 Marek Safar <marek.safar@seznam.cz>
3337 * convert.cs (ExplicitConversionCore): Removed duplicate enum
3340 2005-10-05 Marek Safar <marek.safar@seznam.cz>
3342 * assign.cs (Assign.DoResolve): Error method changed.
3344 * cfold.cs (DoConstantNumericPromotions): Error method changed.
3346 * const.cs (ResolveValue): Reset in_transit immediately.
3348 * constant.cs: Error method changed.
3350 * convert.cs: Removed useless location parameter.
3351 (ExplicitNumericConversion): Don't do double enum check.
3352 (ExplicitConversionCore): Renamed from ExplicitConversion.
3353 (ExplicitUnsafe): Extracted from ExplicitConversion.
3354 (ExplicitConversion): Uses for error reporting.
3356 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
3358 (ResolveBoolean): Uses common error method.
3359 (CastToDecimal): Get rid of ec.
3360 (CastFromDecimal): Optimized.
3361 (ConvCast): Get rid of ec.
3363 * enum.cs (ResolveValue): Reset in_transit immediately.
3364 (Emit): Return after first error.
3366 * expression.cs: Convert changes.
3368 * literal.cs: Error method changed.
3370 * statement.cs: Error method changed.
3372 2005-10-06 Raja R Harinath <rharinath@novell.com>
3374 Fix gtest-131.cs and gtest-211.cs.
3375 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
3376 Only emit code for a label if it is used. Unreachable code can
3377 violate ECMA evaluation stack invariants.
3379 2005-09-27 Marek Safar <marek.safar@seznam.cz>
3381 * anonymous.cs: Implemented ExprClassName.
3383 * assign.cs (Assign.DoResolve): Don't chrash when type is not
3386 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
3389 * class.cs (StaticClass.DefineContainerMembers): Report protected
3392 * codegen.cs: if(ed) PRODUCTION.
3394 * convert.cs (Error_CannotImplicitConversion): Better error
3397 * cs-parser.jay: More error checks.
3399 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
3401 * driver.cs (CSCParseOption): Enabled wrong option check.
3403 * ecore.cs (Expression.ExprClassName): Turned to property.
3404 (MemberExpr.CheckIntermediateModification): For checking boxed
3405 value types modification.
3407 * statement.cs (Fixed.Resolve): Expression type must be
3408 convertible to fixed type.
3409 (CollectionForeach.GetEnumeratorFilter,TryType):
3410 Small refactoring for easier error checking.
3412 2005-09-26 Marek Safar <marek.safar@seznam.cz>
3414 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
3417 * class.cs (GeneratedBaseInitializer): New class for customization
3418 compiler generated initializers.
3419 (MemberBase.DoDefine): Check Obsolete attribute here.
3420 (FieldMember.DoDefine): Ditto.
3422 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
3425 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
3426 (MemberCore.GetObsoleteAttribute): Removed argument.
3427 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
3428 (MemberCore.CheckObsoleteType): New helper.
3432 * statement.cs: Updates after MemberCore changes.
3434 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
3435 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
3437 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
3438 obsolete attribute for compiler construct.
3439 (As.DoResolve): Cache result.
3441 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
3443 2005-10-01 Miguel de Icaza <miguel@novell.com>
3445 * expression.cs (Probe): instead of having a "Type probe_type"
3446 keep the extra information as a TypeExpr probe_type_expr since the
3447 "As" operator needs to perform some type checks.
3449 * (As.DoResolve): If the type is a type parameter, ensure that it
3450 is constrained by a class.
3452 2005-09-22 Miguel de Icaza <miguel@novell.com>
3454 * statement.cs (Lock): Use the TemporaryVariable class instead of
3455 manually using local variables as those do not work when variables
3458 * ecore.cs: Moved the TemporaryVariable class from being a nested
3459 class inside Foreach to be a public class that can be employed in
3462 2005-09-19 Marek Safar <marek.safar@seznam.cz>
3464 * cs-parser.jay: interface_accessors replaced by
3465 accessor_declarations.
3467 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
3470 * statement.cs (GotoCase.Resolve): Convert null constant to
3472 (SwitchLabel.ResolveAndReduce): Ditto.
3473 (SwitchLabel.NullStringCase): Custom null stamp.
3474 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
3476 typemanager.cs (CSharpSignature): Don't skip first argument
3479 2005-09-16 Marek Safar <marek.safar@seznam.cz>
3481 * cfold.cs, constant.cs, convert.cs, ecore.cs,
3482 expression.cs, iterators.cs, literal.cs: Store constants and
3485 * class.cs (MemberBase.ShortName): Pass location.
3487 * cs-parser.jay: Some location fixes.
3489 * ecore.cs (Expression.Location): Made virtual.
3491 2005-09-27 Marek Safar <marek.safar@seznam.cz>
3494 * const.cs (Const.ResolveValue): Check for assigning non-null
3495 value to reference type.
3497 2005-09-26 Raja R Harinath <rharinath@novell.com>
3500 * expression.cs (This.VerifyFixed): In a value type T, the type of
3501 'this' is T&, iow, 'this' is either an out or ref parameter. In a
3502 value type R, 'this' is treated as a value parameter.
3504 2005-09-05 Miguel de Icaza <miguel@novell.com>
3506 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3507 if the underlying types are the same, otherwise we need to produce
3508 code that will do the proper cast.
3510 This was exposed by Marek's constant rewrite which produced
3511 invalid code for the call site:
3514 void Method (X v) {}
3518 This fixes test-49.cs
3520 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3522 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
3523 Type/Object should be allowed as well. Fixed bug #75968.
3525 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3527 * expression.cs : (Binary.DoResolve): when one is enum constant and
3528 another is constant 0, then return enum one *as enum type*.
3531 2005-10-04 Martin Baulig <martin@ximian.com>
3533 * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
3534 `SetMemberIsUsed()' work for generics, too.
3536 2005-10-04 Martin Baulig <martin@ximian.com>
3538 * expression.cs (DelegateInvocation.EmitStatement): Make this work
3539 for corlib. Fixes #75691.
3541 2005-09-28 Marek Safar <marek.safar@seznam.cz>
3544 * driver.cs: Fix compilation files with full root path.
3546 2005-09-25 Miguel de Icaza <miguel@novell.com>
3548 * report.cs (SymbolRelatedToPreviousError): Format the output so
3549 it does not use an open parenthesis that is never closed.
3551 * driver.cs: Follow coding guidelines
3553 2005-09-18 Miguel de Icaza <miguel@novell.com>
3555 * driver.cs: Set InEmacs based on the environment variable EMACS.
3557 * location.cs (InEmacs): in this mode, do not report column
3558 location as it confuses Emacs.
3560 2005-10-03 Raja R Harinath <rharinath@novell.com>
3562 * support.cs (SeekableStreamReader.Position): Don't error out when
3563 the requested position is just beyond the end of the current
3566 2005-09-28 Raja R Harinath <rharinath@novell.com>
3568 * support.cs (SeekableStreamReader): Simplify drastically. Don't
3569 try to keep in sync with the byte count of the underlying Stream.
3570 However, this limits us to a window size of 2048 characters: i.e.,
3571 the maximum lookahead of our lexer/parser can be 2048 characters.
3573 2005-09-22 Martin Baulig <martin@ximian.com>
3575 * driver.cs: Removed a debugging FIXME.
3577 2005-09-21 Raja R Harinath <rharinath@novell.com>
3579 * cs-parser.jay (type_arguments): Add CS1644 check.
3580 * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
3582 2005-09-15 Raja R Harinath <rharinath@novell.com>
3584 * Makefile (PROGRAM): Make profile specific.
3585 (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
3586 the current directory.
3589 * expression.cs (Invocation.EmitCall): Remove optimization on
3590 this_call since it doesn't handle 'this' being a value type.
3592 2005-09-05 Geoff Norton <gnorton@customerdna.com>
3594 * driver.cs: Ensure file handles are closed after parsing
3596 2005-09-05 Miguel de Icaza <miguel@novell.com>
3598 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3599 if the underlying types are the same, otherwise we need to produce
3600 code that will do the proper cast.
3602 This was exposed by Marek's constant rewrite which produced
3603 invalid code for the call site:
3606 void Method (X v) {}
3610 This fixes test-49.cs
3612 2005-09-05 Martin Baulig <martin@ximian.com>
3614 * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
3615 instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
3617 * cs-parser.jay (delegate_declaration): Small fix for #75852.
3619 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3621 * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
3622 to be a pointer type due to the spec 25.2, so check if declaring
3623 type is generic type definition. Fixed bug #75772.
3625 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3628 * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
3629 both types are not defined by methods.
3630 * expression.cs : (Invocation.IsApplicable): it should work when
3631 the argument type is equal to the parameter type, not only when
3632 ImplicitConversionExists() returns true.
3634 2005-09-02 Raja R Harinath <rharinath@novell.com>
3636 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
3640 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
3641 flow-branching for LocalVariableReferences in case we were invoked
3642 from a MemberAccess.
3643 * expression.cs (LocalVariableReference.VerifyAssigned): New.
3645 (LocalVariableReference.DoResolveBase): ... this.
3646 (MemberAccess.Resolve): Do the check that was disabled during
3649 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
3652 (PartialContainer.Create): check abstract/sealed/static strictly
3653 but abstract/sealed can exist only at one side. Fixed bug #75883.
3655 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
3658 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
3659 specified, don't default to UnmanagedType.I4.
3661 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
3663 * expression.cs : conditional operator should check possibly
3664 incorrect assign expression. Fixed bug #75946.
3666 2005-08-30 Raja R Harinath <rharinath@novell.com>
3669 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3670 (ScopeInfo.EmitScopeType): Use it to construct field names from
3671 names of captured locals.
3674 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3675 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3676 Pass 'target_type' to BoxedCast. Don't default to 'object'.
3677 (ExplicitConversion): Remove enum cases already handled by
3678 implicit conversion. Move implicit conversion check to the beginning.
3679 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3680 * expression.cs (ArrayCreation.EmitDynamicInitializers):
3681 Don't treat System.Enum as a struct.
3683 2005-08-30 Jb Evain <jbevain@gmail.com>
3685 * attribute.cs: handles as expression in parameters.
3687 2005-08-30 Raja R Harinath <rharinath@novell.com>
3690 * class.cs (TypeContainer.VerifyClsName): Don't use a
3691 PartialContainer when verifying CLS compliance.
3692 (AbstractPropertyEventMethod): Set Parent here, ...
3693 (PropertyMethod): ... not here.
3695 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
3697 * attribute.cs : escaped attribute name should not be allowed to be
3698 resolved (e.g. @class as classAttribute). Fixed bug #75930.
3700 2005-08-29 Raja R Harinath <rharinath@novell.com>
3703 * convert.cs (ImplicitStandardConversionExists): Allow zero also
3704 when converting a long constant to unsigned long.
3705 * expression.cs (Invocation.OverloadResolve): Add sanity check to
3706 detect where IsApplicable and VerifyArgumentsCompat disagree.
3708 2005-08-29 Raja R Harinath <rharinath@novell.com>
3709 and Carlos Alberto Cortez <carlos@unixmexico.org>
3712 * class.cs (TypeContainer.CanElideInitializer): New helper.
3713 (TypeContainer.EmitFieldInitializers): Use it to determine if we
3714 can safely emitting the initializer of a field.
3716 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3718 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
3719 allowed inside a switch (without loop). Fixed bug #75433.
3721 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
3723 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3724 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3726 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3728 * driver.cs : kinda reverting the default encoding changes (not exact
3729 revert since I noticed that "codepage:reset" might not work fine).
3731 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3733 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
3734 Location. Now getter and setter store location correctly.
3735 (errors/cs0111-12.cs now reports the expected location.)
3737 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3739 * driver.cs : Use default encoding on the environment.
3740 Removed (now that) extra parameter for SeekableStreamReader.
3741 * support.cs : (SeekableStreamReader) third .ctor() argument for
3742 StreamReader is not required (always true). preamble size could
3743 be acquired in simpler and safe way.
3745 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
3747 * cs-parser.jay: report CS0642 at warning level 3
3748 and report CS0642 for an if else statement also
3749 fixes bug #74745. Patch by John Luke (and a bit
3751 Removed extra CS0642 warning check for "while",
3753 * statement.cs: In Block.Resolve(), CS0642 check
3754 is reimplemented to check a sequence of an empty
3755 statement and a block.
3757 Both fix bug #66777.
3759 2005-08-24 Marek Safar <marek.safar@seznam.cz>
3761 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
3762 detection until I fix it.
3764 * cs-tokenizer.cs: Changed error message.
3766 * cs-parser.jay: Fixed 2 error locations.
3768 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
3769 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
3772 * enum.cs (GetSignatureForError): Fixed.
3774 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
3778 * typemanager.cs (RegisterProperty): Removed.
3780 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
3782 2005-08-24 Raja R Harinath <rharinath@novell.com>
3785 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
3786 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
3788 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3790 * expression.cs : tiny fix is required for not warning positive ulong.
3793 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3795 * expression.cs : add CS0652 check for constant and integral
3796 expression. Fixed bug #53974.
3798 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3800 * expression.cs : in DoNumericPromotions(), check if there is implicit
3801 conversion overload for string (to check CS0034). Fixed bug #52492.
3803 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3805 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
3807 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3809 * ecore.cs : report location when it is *not* Null.
3811 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3817 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
3818 correctly. Fixed bug #75721.
3820 2005-08-23 Raja R Harinath <rharinath@novell.com>
3822 * support.cs (SeekableStreamReader.Position): Avoid an expensive
3823 loop that performs 'min (pos, char_count)'.
3826 * expression.cs (Unary.ResolveOperator): Don't discard implicit
3827 converted value in Operator.OnesComplement.
3829 2005-08-22 Ben Maurer <bmaurer@ximian.com>
3831 * anonymous.cs: If the anon method is pulled into a helper class,
3832 it needs to be `internal' not `private'. Fixes runtime behavior on
3835 2005-08-17 Marek Safar <marek.safar@seznam.cz>
3838 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
3841 2005-08-16 Marek Safar <marek.safar@seznam.cz>
3843 The big constants rewrite
3844 Fix #75746, #75685 and more
3845 As a side effect saved 1MB for MWF ;-)
3847 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
3848 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
3849 enum based for corlib compilation.
3851 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
3854 * class.cs (FixedField.Define): Use ResolveAsConstant.
3856 * const.cs (IConstant): Interface constants and enums.
3857 (Const.ResolveValue): New method for constant resolvning.
3858 (ExternalConstant): Constants from imported assemblies.
3860 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
3861 conversion; like enums.
3862 (Constant.ToType): Converts this constant to different type.
3863 (Constant.Increment): Adds 1.
3865 * convert.cs (ImplicitConversionRequired): Simplified.
3867 * cs-parser.jay: Create EnumMember directly.
3869 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
3871 * doc.cs (GenerateEnumDocComment): Removed.
3873 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
3874 (ConvertIntLiteral): Removed.
3875 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
3877 * enum.cs (EnumMember): Implement IConstant.
3878 (Enum.IsValidEnumConstant): Removed.
3879 (Enum.GetNextDefaultValue): Removed.
3880 (Enum.FindMembers): Updated.
3881 (Enum.GenerateDocComment): Iterate enum members.
3883 * expression.cs (Cast.TryReduce): Handle enums correctly.
3884 (New.Constantify): Made public.
3885 (MemberAccess.DoResolve): Removed contant specific if(s).
3887 * literal.cs (NullLiteral): Implement new abstract methods.
3889 * statement.cs (GotoCase.Resolve): Use new constant methods.
3890 (SwitchLabel.ResolveAndReduce): Use new constant methods.
3892 * typemanager.cs (LookupEnum): Removed.
3893 (IsEnumType): Fixed to work with corlib.
3894 (RegisterConstant): Removed.
3895 (LookupConstant): Removed.
3896 (GetConstant): Changed to work with IConstant.
3898 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
3900 * location.cs : Fixed overflown (>255) column number.
3902 2005-08-03 Raja R Harinath <rharinath@novell.com>
3904 First cut of the qualified-alias-member feature.
3905 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
3907 * cs-parser.jay (DOUBLE_COLON): New token.
3908 (namespace_or_type_name): Add rule for recognizing
3909 qualified-alias-members.
3910 (primary_expression): Likewise.
3911 (element_access): Allow QualifiedAliasMember as a possible
3912 type-bearing expression.
3913 (local_variable_type, local_variable_pointer_type): Likewise.
3914 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
3915 aliases in the current and enclosing namespace declarations.
3916 (NamespaceEntry.UsingAlias): Add CS0440 warning.
3917 * decl.cs (MemberName.is_double_colon): New.
3918 (MemberName.MemberName): Add new constructor for alias-member.
3919 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
3920 * expression.cs (QualifiedAliasMember): New expression type.
3922 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3924 * location.cs : it borked when no argument was specified.
3926 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3928 * location.cs : tiny ToString() format fix.
3930 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3932 * statement.cs : oops, it was missing.
3934 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3936 A set of fixes for precise line/column location.
3939 "token" field now holds a file/line "delta", a line number offset
3940 from the segment, and a column number. See also:
3941 http://lists.ximian.com/pipermail/mono-devel-list/2004-
3942 December/009508.html
3943 Removed static IsNull. Use instance IsNull property instead.
3945 For some tokens it stores Location. For Identifier it stores
3946 LocatedToken which is a pair of string name and location.
3947 Column numbers are adjusted only at getChar().
3949 Use Location.ToString() for reporting (it now contains column).
3951 Largely modified to use LocatedToken instead of
3952 string (IDENTIFIER), and to acquire Location from some tokens.
3953 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
3954 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
3956 Now MemberName holds Location. DeclSpace.ctor() receives Location
3957 as a parameter. Removed extra parameters to all derived classes.
3958 Replaced Location.IsNull() with instance property.
3959 * assign.cs, expression.cs :
3960 Added .ctor() overload that omits Location.
3962 Added "nameEscaped" flag that indicates the identifier was escaped
3963 in the source file. This fixes bug #57047.
3965 2005-09-02 Martin Baulig <martin@ximian.com>
3967 * class.cs: Make CS3005 a warning, not an error.
3969 2005-08-02 Marek Safar <marek.safar@seznam.cz>
3971 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
3972 New method, looking for lo-case imported cls type.
3974 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
3977 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
3979 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
3981 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
3983 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
3985 Optimized to save 3.5 MB for SWF compilation.
3987 2005-08-01 Marek Safar <marek.safar@seznam.cz>
3989 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
3990 (PartialContainer.Create): Moved logic AddToContainer.
3991 (PartialContainer.MarkForDuplicationCheck): Shares name.
3993 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
3996 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
3998 (Namespace.GetSignatureForError): New method.
4000 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
4001 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
4003 2005-08-01 Raja R Harinath <rharinath@novell.com>
4006 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
4007 member lookup rather than qualifier_type, since qualifier_type can
4010 2005-08-01 Marek Safar <marek.safar@seznam.cz>
4012 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
4015 2005-07-31 Miguel de Icaza <miguel@novell.com>
4017 * statement.cs: Copy the local exception into the exception
4018 captured local. Fixes 75674
4020 2005-07-31 Raja R Harinath <harinath@gmail.com>
4023 * expression.cs (Invocation.OverloadResolve): Don't report error
4024 CS1501 if error CS1502 has been reported.
4025 (New.DoResolve): Delegate CS1501 reporting to
4026 Invocation.OverloadResolve.
4029 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
4030 invariant-meaning-in-block property in an enclosing block if
4033 2005-07-29 Marek Safar <marek.safar@seznam.cz>
4035 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
4036 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
4037 (Switch.CheckSwitch): Just save 50kb for SWF.
4039 2005-07-27 Martin Baulig <martin@ximian.com>
4041 * anonymous.cs (CaptureContext.AddField): Added
4042 `AnonymousContainer am' argument; compute its toplevel scope if
4043 it's not already computed. Fixes #75649.
4045 2005-07-26 Raja R Harinath <rharinath@novell.com>
4048 * class.cs (Constructor.Emit): Reset block to null if the block
4051 2005-07-25 Marek Safar <marek.safar@seznam.cz>
4053 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
4055 2005-07-25 Marek Safar <marek.safar@seznam.cz>
4057 * class.cs (MethodData.Define): Check whether accessor implementing
4058 interface is public.
4060 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
4062 2005-07-22 Marek Safar <marek.safar@seznam.cz>
4065 * namespace.cs (LookupType): Moved same type check to...
4067 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
4070 2005-07-21 Raja R Harinath <rharinath@novell.com>
4072 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
4073 already found a typebuilder.
4074 * class.cs (MethodCore.IsDuplicateImplementation): Compare
4075 MemberNames, not strings.
4077 * const.cs (Error_ExpressionMustBeConst):
4078 Rename from Error_EpressionMustBeConst.
4079 * const.cs, class.cs, statement.cd: Update.
4081 2005-07-21 Marek Safar <marek.safar@seznam.cz>
4085 * const.cs (Const.LookupConstantValue): Report missing contant expression
4087 (Error_EpressionMustBeConstant): Only one error method.
4089 * class.cs, statement.c: Updated.
4091 2005-07-20 Raja R Harinath <rharinath@novell.com>
4093 * statement.cs (Block.Flags): Add back HasVarargs.
4094 (Block.flags): Make protected.
4095 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
4097 * typemanager.cs (types, typecontainers, user_types): Remove.
4098 (UserTypes, TypeContainers): Likewise.
4099 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
4100 (CleanUp, Reset): Update.
4101 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
4102 (GetNestedType): Use Type.GetNestedType.
4103 (CoreLookupType): Take two arguments, the namespace and the
4104 basename of the type. Update to use the Namespace.Lookup
4106 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
4107 (RealMemberLookup): Use IsNestedChildOf instead of playing with
4108 string concatenation and substring matches.
4109 * class.cs, enum.cs, delegate.cs: Update to changes.
4111 2005-07-20 Marek Safar <marek.safar@seznam.cz>
4113 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
4114 Expression and made virtual.
4116 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
4117 (ImplicitStandardConversionExists): Fixed `byte' typo ?
4119 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
4121 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
4124 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
4127 2005-07-18 Marek Safar <marek.safar@seznam.cz>
4130 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
4131 AssemblyCultureAttribute is not used on executable.
4134 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
4136 2005-07-16 Raja R Harinath <rharinath@novell.com>
4139 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
4140 New. Reports CS0252/CS0253.
4141 Mostly taken from preliminary patch by Duncak Mak.
4142 (Binary.DoResolveOperator): Store results of operator lookup.
4143 Use them to detect if we need to warn about unintended reference
4146 2005-07-15 Raja R Harinath <rharinath@novell.com>
4149 * namespace.cs (Namespace.Lookup): Add back location parameter.
4150 (Namespace.LookupType): Add CS0436 report. Add location parameter.
4151 * delegate.cs, ecore.cs, expression.cs: Update to changes.
4153 * codegen.cs (EmitContext.DeclSpace): Make readonly.
4154 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
4155 (Namespace.LookupType): ... this.
4156 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
4158 * typemanager.cs (LookupTypeReflection): Remove buggy code that
4159 purported to handle pointers.
4160 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
4163 2005-07-15 Marek Safar <marek.safar@seznam.cz>
4165 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4168 2005-07-15 Raja R Harinath <rharinath@novell.com>
4170 * namespace.cs (Namespace.Lookup): Drop location parameter.
4171 (NamespaceEntry.LookupAlias): Remove. Merge into ...
4172 (NamespaceEntry.Lookup): ... this.
4173 (NamespaceEntry.Error_AmbiguousTypeReference):
4174 Move here from DeclSpace.
4175 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
4177 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
4178 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
4179 Move to NamespaceEntry.
4180 * delegate.cs, expression.cs: Update to changes.
4182 2005-08-31 Martin Baulig <martin@ximian.com>
4184 Committing a patch from Atsushi Enomoto for #75850.
4186 * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
4187 Prefer a generic enumerator over a non-generic one.
4189 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
4191 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
4192 * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
4194 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4196 * driver.cs : reverting default encoding change as well as mcs.
4198 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4200 * driver.cs, support.cs : merged r48826.
4202 > could you integrate your mcs changes to gmcs otherwise
4203 > gmcs cannot compile some files.
4205 2005-08-20 Martin Baulig <martin@ximian.com>
4207 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4208 scope if we don't already have it.
4210 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
4211 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
4214 2005-07-31 Miguel de Icaza <miguel@novell.com>
4216 * statement.cs: Copy the local exception into the exception
4217 captured local. Fixes 75674
4219 2005-07-15 Marek Safar <marek.safar@seznam.cz>
4221 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4224 2005-08-12 Martin Baulig <martin@ximian.com>
4226 * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
4227 for nested types here to avoid hitting the cache too early.
4229 2005-08-09 Miguel de Icaza <miguel@novell.com>
4231 * enum.cs: On the new compiler CLS error 3005 is now a warning not
4234 2005-08-03 Martin Baulig <martin@ximian.com>
4236 Make iterators in generic methods work; see gtest-191.cs.
4239 (Constraints.Resolve): Protect against being called twice.
4242 (TypeContainer.GetClassBases): Make this `protected virtual'.
4244 * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
4245 (Iterator.GetClassBases): Override this and compute the base
4247 (Iterator.DefineNestedTypes): If we're a generic method, all our
4248 method type parameters become class type parameters on the proxy
4252 (ToplevelBlock.Parameters): Make this a property, not a field.
4253 (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
4255 2005-08-03 Martin Baulig <martin@ximian.com>
4257 * typemanager.cs (TypeManager.IsSubclassOf): Use
4258 `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
4259 (TypeManager.GetFullName_recursed): Improved.
4261 2005-07-27 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4264 * ecore.cs (Expression.IsAccessorAccessible): Change the check for
4265 Private accessor case, using TypeManager.IsPrivateAccessible instead of
4266 invocation_type == mi.DeclaringType, since the first one also checks
4267 other condition used by generic instances.
4269 2005-07-27 Martin Baulig <martin@ximian.com>
4271 * anonymous.cs (CaptureContext.AddField): Added
4272 `AnonymousContainer am' argument; compute its toplevel scope if
4273 it's not already computed. Fixes #75649.
4275 2005-07-14 Marek Safar <marek.safar@seznam.cz>
4277 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
4278 CheckAttributeType and refactored.
4279 (Attribute.ResolvePossibleAttributeType): Changed to reuse
4280 ResolveAsTypeTerminal error handling.
4281 (ResolveAsTypeTerminal): Introduced because of global attributes extra
4283 (GetSignatureForError): Print errors in same way.
4286 * codegen.cs: Reflect attribute GetSignatureForError change.
4289 * expression.cs: Add silent parameter to ResolveAsTypeStep.
4291 * namespace.cs (UsingEntry): Refactored to make fields private.
4294 statement.cs: Error_UnexpectedKind has extra parameter.
4296 2005-07-14 Raja R Harinath <rharinath@novell.com>
4298 * ecore.cs (IAlias): Remove.
4299 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
4300 that implement the interface.
4301 * namespace.cs (Namespace): Likewise.
4302 (Namespace.declspaces): Renamed from 'defined_names'.
4303 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
4304 DeclSpace instead of an IAlias.
4305 * tree.cs (Tree.AddDecl): Update.
4307 2005-07-12 Raja R Harinath <rharinath@novell.com>
4309 * statement.cs (Block.Flags); Remove HasVarargs.
4310 (Block.HasVarargs): Move to ToplevelBlock.
4311 (Block.ThisVariable, Block.AddThisVariable): Likewise.
4312 (Block.Variables): Make protected. Initialize variable hashtable
4314 (Block.AddVariable): Update.
4315 (Block.Resolve): Update to changes.
4316 (ToplevelBlock.HasVarargs): New boolean.
4317 (ToplevelBlock.ThisVariable): Move here from Block.
4318 (ToplevelBlock.AddThisVariable): Likewise.
4319 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
4320 * expression.cs (This.ResolveBase): Update to changes.
4321 (ArglistAccess.DoResolve): Likewise.
4323 2005-07-11 Marek Safar <marek.safar@seznam.cz>
4326 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
4328 * class.cs (TypeContainer.VerifyMembers): Distinguish between
4329 not used and not used & assigned.
4330 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
4332 2005-07-11 Marek Safar <marek.safar@seznam.cz>
4335 * expression.cs (Is.DoResolve): null is never provided type.
4337 2005-07-08 Marek Safar <marek.safar@seznam.cz>
4340 * cs-parser.jay: Less strict event error rule to catch more errors.
4342 2005-07-11 Martin Baulig <martin@ximian.com>
4344 * generic.cs (ConstructedType.CheckConstraints): Improve the check
4345 for the constructor constraint: we do not only have to check
4346 whether the class has a public constructor, but also ensure that
4347 it's parameterless. Fixes #75492.
4349 2005-07-11 Martin Baulig <martin@ximian.com>
4351 * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
4352 between type parameters if they either have the reference type
4353 constraint or the class constraint.
4355 2005-07-10 Kamil Skalski <nazgul@nemerle.org>
4357 * generic.cs: Use MakeGenericType instead of BindGenericParameters.
4359 2005-07-07 Marek Safar <marek.safar@seznam.cz>
4362 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
4363 (ExtractSecurityPermissionSet): Cope with self referencing security
4364 attributes properly.
4366 * driver.cs (SetOutputFile): Made public property OutputFile.
4368 2005-07-07 Raja R Harinath <rharinath@novell.com>
4371 * class.cs (TypeContainer.first_nonstatic_field): Rename from
4372 has_nonstatic_fields. Make into a FieldBase pointer.
4373 (TypeContainer.AddField): Add CS0282 check.
4374 (TypeContainer.EmitType): Update.
4376 2005-07-06 Miguel de Icaza <miguel@novell.com>
4378 * cs-tokenizer.cs (consume_identifier): Do not create strings to
4379 compare if they start with __.
4381 2005-07-06 Raja R Harinath <rharinath@novell.com>
4383 * statement.cs (Switch.SwitchGoverningType): Only look at
4384 UserCasts that don't need implicit standard conversions to one of
4385 the allowed switch types (Fixes test-322.cs).
4386 (LocalInfo.Resolve): Re-enable sanity-test.
4388 2005-07-06 Marek Safar <marek.safar@seznam.cz>
4390 * cs-tokenizer.cs (consume_identifier): Detect double undescores
4392 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
4394 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
4396 2005-07-06 Raja R Harinath <rharinath@novell.com>
4399 * ecore.cs (SimpleName.GetSignatureForError): Add.
4400 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
4401 (MemberAccess.GetSignatureForError): Add.
4403 2005-07-05 Marek Safar <marek.safar@seznam.cz>
4405 The big error and warning messages review.
4435 * typemanager.cs: Updated.
4437 * class.cs: (MethodCore.SetYields): Moved here to share.
4438 (PropertyMethod.Define): Moved iterator setup here.
4440 * iterators.cs: Add orig_method to have full access to parent
4443 2005-07-05 Raja R Harinath <rharinath@novell.com>
4445 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
4446 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
4447 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
4448 variable of struct type.
4449 * expression.cs (Unary.ResolveOperator): Update to change.
4450 (Indirection.VerifyFixed): Likewise.
4451 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
4452 (ParameterReference.VerifyFixed): Value parameters are fixed.
4453 (This.VerifyFixed): Treat 'this' as a value parameter.
4454 * statement.cs (LocalInfo.IsFixed): Remove.
4456 2005-07-01 Martin Baulig <martin@ximian.com>
4458 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4459 `ec.EmitThis ()' to get the correct scope.
4461 2005-07-01 Martin Baulig <martin@ximian.com>
4463 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
4464 instance is a ParameterReference; fixes #75299.
4466 2005-06-30 Raja R Harinath <rharinath@novell.com>
4469 * expression.cs (Indexers.map): Remove.
4470 (Indexers.Append): Filter out inaccessible setters and getters.
4471 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
4474 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
4476 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
4477 (FieldExpr.Emit, PropertyExpr.Emit): Update.
4478 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
4479 * expression.cs (Invocation.EmitCall): Add CS0120 check.
4481 2005-06-30 Marek Safar <marek.safar@seznam.cz>
4484 * class.cs (FieldBase.GetInitializerExpression): One more field
4487 2005-06-28 Miguel de Icaza <miguel@novell.com>
4489 * pending.cs: Do not define a proxy if the base method is virtual,
4490 it will be picked up by the runtime (bug 75270).
4492 2005-07-08 Martin Baulig <martin@ximian.com>
4494 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
4495 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
4497 2005-07-07 Martin Baulig <martin@ximian.com>
4499 * generic.cs (ConstructedType.CheckConstraint): Use
4500 ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
4501 called recursively; fixes #75329.
4503 2005-07-06 Martin Baulig <martin@ximian.com>
4505 * generic.cs (TypeManager.InferTypeArguments): Added support for
4506 anonymous methods; fixes #75461.
4508 2005-07-01 Martin Baulig <martin@ximian.com>
4510 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4511 `ec.EmitThis ()' to get the correct scope.
4513 2005-07-01 Martin Baulig <martin@ximian.com>
4515 * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
4516 instance is `This'; fixes #75299.
4518 2005-06-30 Martin Baulig <martin@ximian.com>
4520 * class.cs (Indexer): Implement IIteratorContainer; added support
4521 for iterators in indexers.
4524 (EmitContext.CurrentIterator): Make this a property, not a field.
4526 * anonymous.cs (AnonymousContainer.Iterator): New public property.
4528 2005-06-28 Miguel de Icaza <miguel@novell.com>
4530 * pending.cs: Do not define a proxy if the base method is virtual,
4531 it will be picked up by the runtime (bug 75270).
4533 2005-06-28 Martin Baulig <martin@ximian.com>
4535 * cs-parser.jay (interface_method_declaration): Avoid a
4536 reduce/reduce conflict by moving some of the code into a separate
4537 `interface_method_declaration_body' rule; fixes #75368.
4539 2005-06-28 Martin Baulig <martin@ximian.com>
4541 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
4542 array check after the check for TypeBuilder's.
4544 2005-06-21 Raja R Harinath <rharinath@novell.com>
4546 * convert.cs (FindMostEncompassedType): Add two trivial special
4547 cases (number_of_types == 0 || number_of_types == 1).
4548 (FindMostEncompasingType): Likewise.
4550 2005-06-17 Raja R Harinath <rharinath@novell.com>
4552 Some cleanups preparing for the fix of #75283.
4553 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
4555 (EventExpr.InstanceResolve): Likewise.
4556 (EventExpr.DoResolve): Remove redundant checks.
4558 2005-06-08 Miguel de Icaza <miguel@novell.com>
4560 * class.cs: Small fix.
4562 2005-06-08 Raja R Harinath <rharinath@novell.com>
4565 * class.cs (GetPartialBases): Fix return value check of
4568 2005-06-07 Raja R Harinath <rharinath@novell.com>
4570 Ensure that partial classes are registered in their enclosing
4571 namespace. Initial part of fix of #75160.
4572 * tree.cs (Tree.RecordDecl): Add new namespace argument.
4573 Register declspace with namespace here, not in
4574 DeclSpace.RecordDecl.
4575 * cs-parser.jay: Pass namespace to RecordDecl.
4576 * class.cs (PartialContainer.Create): Likewise.
4577 (ClassPart.DefineType): New sanity-check. Throws an exception if
4579 * decl.cs (Declspace.RecordDecl): Remove.
4580 * namespace.cs (NamespaceEntry.DefineName): Remove.
4582 2005-06-06 Marek Safar <marek.safar@seznam.cz>
4584 * rootcontext.cs: Reset TargetExt as well.
4586 2005-06-03 Raja R Harinath <rharinath@novell.com>
4588 * ecore.cs (Expression.Resolve): Emit CS0654 error when
4591 2005-06-02 Raja R Harinath <rharinath@novell.com>
4593 Fix #75080, cs0119.cs.
4594 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
4596 (Expression.Resolve): ... this. Use it. Remove bogus code
4597 allowing ExprClass.Type and ExprClass.Namespace for
4598 ResolveFlags.VariableOrValue.
4599 (Expression.Resolve) [1-argument variant]: Change default resolve
4600 flags based on language version.
4601 (Expression.Error_UnexpectedKind): Use a simple string array
4602 rather than an ArrayList.
4603 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
4605 (TypeOfVoid.DoResolve): Likewise.
4606 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
4607 flags argument -- it always has the same value.
4609 2005-05-31 Raja R Harinath <rharinath@novell.com>
4612 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
4613 Use it in the error message.
4614 * assign.cs, expression.cs, statement.cs: Update.
4616 2005-05-30 Raja R Harinath <rharinath@novell.com>
4619 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
4620 the "almostMatchedMember" case too.
4621 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
4622 that failed the accessibility checks to 'almost_match'.
4624 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
4626 * attribute.cs: Use internal MethodBuilder methods to set
4627 ExactSpelling and SetLastError on PInvoke methods, instead
4628 of passing them via charset. Fixes #75060.
4630 2005-05-27 Raja R Harinath <rharinath@novell.com>
4632 * parameter.cs (Parameter): Remove TODO comment.
4633 (Parameter.DefineParameter): Remove Location parameter.
4634 (Parameters.LabelParameters): Likewise.
4635 * class.cs (Constructor.Emit): Update to change.
4636 (MethodData.Emit): Likewise.
4637 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
4638 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
4640 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
4643 Removed Parameters.Location and added Parameter.Location instead.
4644 Removed Location parameter from Emit() and GetSignature().
4651 Modified all related calls.
4653 2005-06-21 Martin Baulig <martin@ximian.com>
4655 * generic.cs (NullCoalescingOperator.Emit): Make this work if the
4656 left-hand side is not a nullable type; fixes #75328.
4658 2005-06-21 Martin Baulig <martin@ximian.com>
4661 (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
4662 (TypeManager.GetFullNameSignature): Likewise.
4664 * convert.cs (Convert.Error_CannotImplicitConversion): Compare
4665 `source.FullName' and `target.FullName' to check whether there are
4666 two conflicting definitions.
4668 2005-06-21 Martin Baulig <martin@ximian.com>
4670 * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
4671 a BoxedCast - also for reference types - to be compatible with csc.
4673 2005-06-21 Martin Baulig <martin@ximian.com>
4675 * expression.cs (MemberAccess.DoResolve): Add support for nested
4676 types in a generic instance; fixes #75320.
4678 2005-06-20 Martin Baulig <martin@ximian.com>
4680 * generic.cs (TypeManager.InferType): Also walk the class
4681 hierarchy for generic instances; fixes #75261.
4683 2005-06-17 Martin Baulig <martin@ximian.com>
4685 * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
4686 to make things work for corlib.
4688 2005-06-15 Martin Baulig <martin@ximian.com>
4690 * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
4691 obsolete `SecurityAction' values.
4693 2005-06-06 Marek Safar <marek.safar@seznam.cz>
4695 * rootcontext.cs: Reset TargetExt as well.
4697 2005-06-09 Martin Baulig <martin@ximian.com>
4699 * delegate.cs (Delegate.VerifyMethod): Added
4700 `MethodGroupExpr old_mg' argument; inherit its
4701 `HasTypeParameters'; fix #75085.
4703 2005-06-09 Martin Baulig <martin@ximian.com>
4705 * expression.cs (Invocation.OverloadResolve): Correctly handle
4706 generic methods for the SetMemberIsUsed(); fix #75064.
4708 2005-06-09 Martin Baulig <martin@ximian.com>
4710 * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
4713 2005-06-08 Martin Baulig <martin@ximian.com>
4715 * cs-parser.jay (nullable_type_or_conditional): If we put the
4716 nullable back and our `type' is a `ComposedCast', remove the
4717 nullable from it. Fixes #75156.
4719 * expression.cs (ComposedCast.RemoveNullable): New public method.
4721 2005-06-08 Martin Baulig <martin@ximian.com>
4723 The big Iterators rewrite :-)
4725 * iterators.cs: Rewrite this to use the anonymous methods framework.
4727 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
4728 before the TypeContainers; see 2test-21.cs.
4731 (TypeContainer.DefineType): Don't create a new EmitContext if we
4732 already have one (this only happens if we're an Iterator).
4733 (TypeContainer.Define): Also call Define() on all our iterators.
4734 (Method.CreateEmitContext): Added support for iterators.
4737 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
4738 (AnonymousContainer.CreateMethodHost): Moved here from
4739 AnonymousMethod and made abstract.
4740 (AnonymousContainer.CreateScopeType): New abstract method.
4741 (AnonymousContainer.IsIterator): New public property.
4742 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
4743 get the ScopeTypeBuilder rather than manually defining it here.
4744 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
4747 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
4748 before RootContext.DefineTypes().
4750 * codegen.cs (EmitContext.RemapToProxy): Removed.
4751 (EmitContext.CurrentAnonymousMethod): Changed type from
4752 AnonymousMethod -> AnonymousContainer.
4753 (EmitContext.ResolveTopBlock): Protect from being called twice.
4754 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
4755 (EmitContext.EmitThis): Removed the iterators hacks; use the
4756 anonymous methods framework for that.
4759 (ToplevelBlock.Container): Make this a property, not a field.
4760 (ToplevelBlock.ReParent): New public method; move the
4761 ToplevelBlock into a new container.
4762 (Foreach.TemporaryVariable): Simplify.
4764 2005-06-05 Martin Baulig <martin@ximian.com>
4766 * statement.cs (LocalInfo.CompilerGenerated): New flag.
4767 (Block.AddTemporaryVariable): New public method; creates a new
4768 `LocalInfo' for a temporary variable.
4769 (Block.EmitMeta): Create the LocalBuilders for all the temporary
4771 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
4772 non-iterator variables.
4774 2005-06-05 Martin Baulig <martin@ximian.com>
4776 * statement.cs (Foreach.TemporaryVariable): Create the
4777 LocalBuilder in the Emit phase and not in Resolve since in some
4778 situations, we don't have an ILGenerator during Resolve; see
4779 2test-19.cs for an example.
4781 2005-06-04 Martin Baulig <martin@ximian.com>
4783 The big Foreach rewrite - Part II.
4785 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
4786 with `PropertyInfo ienumerator_getcurrent'.
4788 * codegen.cs (VariableStorage): Removed.
4791 (Foreach): Derive from Statement, not ExceptionStatement.
4792 (Foreach.CollectionForeach): New nested class. Moved all the code
4793 dealing with collection foreach here.
4794 (Foreach.ForeachHelperMethods): Removed.
4795 (Foreach.TemporaryVariable): Implement IMemoryLocation.
4797 2005-05-23 Martin Baulig <martin@ximian.com>
4799 * statement.cs (Try.DoResolve): Don't create a `finally' if we
4800 don't need to. Fix #75014.
4802 2005-05-26 Raja R Harinath <rharinath@novell.com>
4804 Improve user-defined conversion handling.
4805 * convert.cs (GetConversionOperators): Rewrite. Return only the
4806 applicable operators.
4807 (AddConversionOperators): New. Helper for GetConversionOperators.
4808 (FindMostEncompassedType, FindMostEncompassingType): Verify that
4809 there is only one most encompassed/encompassing type.
4810 (FindMostSpecificSource, FindMostSpecificTarget): Remove
4811 "applicable operator" handling.
4812 (UserConversion): Move cache here from GetConversionOperators.
4813 Directly cache the chosen operator, rather than the whole
4815 (ExplicitNumericConversion): Fix buggy implementation of Decimal
4816 case. Allow conversion of decimal to sbyte and byte too.
4817 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4818 New static methods. Used to avoid allocating EmptyExpressions in
4821 2005-05-24 Duncan Mak <duncan@novell.com>
4823 * ecore.cs (CastFromDecimal): New class for casting a decimal to
4824 another class, used in Convert.ExplicitNumericConversion.
4825 (CastToDecimal): New class, similar to above, but casts to
4826 System.Decimal, used in Convert.ImplicitNumericConversion and also
4827 in explicit convesion from double/float to decimal.
4829 * convert.cs (ImplicitNumericConversion): Handle implicit
4830 conversions to System.Decimal.
4831 (ExplicitNumericConversion): handle explicit conversions to
4836 2005-05-20 Miguel de Icaza <miguel@novell.com>
4838 * typemanager.cs: Do not throw an exception in the TypeBuilder
4839 case, we take care of it on the TypeCode.
4841 2005-05-17 Marek Safar <marek.safar@seznam.cz>
4843 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
4846 * cs-parser.jay: Catch more lexical errors.
4848 * report.cs: Add one more Error method.
4851 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
4853 2005-05-20 Martin Baulig <martin@ximian.com>
4855 * class.cs (TypeContainer.CircularDepException): Removed.
4856 (TypeContainer.DefineType): Removed the `InTransit' stuff.
4857 (TypeContainer.CheckRecursiveDefinition): Check for circular class
4858 (CS0146) and interface (CS0529) dependencies here.
4860 2005-05-20 Martin Baulig <martin@ximian.com>
4862 * expression.cs (New.DoResolve): Move the CS0712 check above the
4863 CS0144 check; otherwise it can never be reached.
4865 2005-05-20 Martin Baulig <martin@ximian.com>
4867 * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
4869 2005-05-20 Martin Baulig <martin@ximian.com>
4871 * class.cs (TypeContainer.DefineType): Fix CS0698 check.
4873 * typemanager.cs (TypeManager.IsAttributeType): New public method.
4875 2005-05-19 Martin Baulig <martin@ximian.com>
4878 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
4879 to disable error reporting.
4881 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
4882 here since we don't want to report an error; see the new test-336.cs.
4884 2005-05-19 Raja R Harinath <rharinath@novell.com>
4886 * statement.cs (ToplevelBlock.GetParameterReference)
4887 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
4888 Move here from class Block.
4889 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
4890 * expression.cs (ParameterReference.DoResolveBase): Likewise.
4892 2005-05-18 Martin Baulig <martin@ximian.com>
4897 (FlowBranching.Reachability): Add non-static public And() and Or()
4899 (FlowBranchingSwitch): New class; do the `break_origins' thing
4900 like in FlowBranchingLoop.
4901 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
4902 reachability, not just locals and parameters.
4903 (FlowBranching.MergeChild): Remove some of the hacks for loop and
4904 switch; MergeBreakOrigins() now takes care of that.
4906 2005-05-18 Martin Baulig <martin@ximian.com>
4908 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4909 a loop and may leave it, reset the barrier; fixes #74974.
4911 2005-05-16 Raja R Harinath <rharinath@novell.com>
4913 Fix test-382.cs. Emit values of decimal constants.
4914 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
4916 (TypeContainer.AddField): ... this.
4917 (TypeContainer.EmitFieldInitializers): Allow the list of fields
4918 with initializers to include 'Const's.
4919 (ClassPart.RegisterFieldForInitialization): Forward to
4921 * const.cs (Const.Const): Pass initializer to base class.
4922 (Const.Define): In case of decimal constants, register them for
4923 initialization in a static constructor.
4925 2005-05-14 Martin Baulig <martin@ximian.com>
4927 * statement.cs (Block.Resolve): Correctly handle unreachable code;
4928 do not call ResolveUnreachable() on unreachable statements in
4929 here, see the comment in the source code.
4931 2005-05-13 Raja R Harinath <rharinath@novell.com>
4934 * expression.cs (BinaryResolveOperator): If one of the operands of
4935 an equality comparison is 'null' and the other is a pointer type,
4936 convert the null to a NullPointer.
4937 * convert.cs (ImplicitReferenceConversion): If the expression is a
4938 NullLiteral and the target type is a pointer type, return a
4939 NullPointer instead.
4940 (ImplicitConversionStandard): Likewise.
4942 2005-05-13 Marek Safar <marek.safar@seznam.cz>
4944 * cs-parser.jay: Set readonly context based on special constructs.
4946 * expression.cs (LocalVariableReference.DoResolveBase): Improved
4947 readonly variable error handling.
4949 * rootcontext.cs (EmitCode): Don't verify members when error
4952 * statement.cs (LocalInfo): Add reaodnly context information.
4953 (SetReadOnlyContext, GetReadOnlyContext): New methods.
4955 2005-05-17 Martin Baulig <martin@ximian.com>
4957 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
4960 2005-05-13 Martin Baulig <martin@ximian.com>
4962 * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
4963 handle unreachable blocks.
4965 2005-05-13 Martin Baulig <martin@ximian.com>
4968 (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
4969 (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
4972 2005-05-13 Martin Baulig <martin@ximian.com>
4974 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
4975 instance variable, not a local. Fix #74873.
4976 (Block.ResolveUnreachable): Set it to true here.
4978 2005-05-12 Martin Baulig <martin@ximian.com>
4980 * cs-parser.jay (property_declaration): Pass the `current_class',
4981 not the `current_container' to Property's .ctor. Fixes #74912.
4983 2005-05-11 Martin Baulig <martin@ximian.com>
4985 * typemanager.cs (Closure): Copy this from MCS and merge all the
4986 GMCS-specific changes into it.
4988 2005-05-12 Raja R Harinath <harinath@gmail.com>
4991 * typemanager.cs (unmanaged_enclosing_types): New.
4992 (IsUnmanagedType): Avoid infloops by using
4993 'unmanaged_enclosing_types' to talk with recursive invocations.
4995 2005-05-11 Duncan Mak <duncan@novell.com>
4997 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
4998 continuing to process for 'arg'.
4999 (handle_preprocessing_directive): Check the argument of the #endif
5000 directive and report error CS1025 if there are any trailing
5003 According to the C# spec, having even whitespace after the #endif
5004 directive is illegal; however, because we call arg.TrimEnd ()
5005 beforehand, we have the same behavior as csc, allowing whitespace
5006 after the directive.
5010 2005-05-11 Marek Safar <marek.safar@seznam.cz>
5014 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
5015 (Constructor.GetObsoleteAttribute): Implemented correctly.
5017 2005-05-10 Martin Baulig <martin@ximian.com>
5019 * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
5020 resolve the type; fixes #74864.
5021 (DefaultValueExpression): Create the LocalTemporary in Emit(), not
5022 in DoResolve(); fixes #74862.
5024 2005-05-10 Martin Baulig <martin@ximian.com>
5026 * support.cs (ReflectionParameters.ParameterModifier): Use
5027 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
5028 and `ParameterAttributes.In'. Fixes #74884.
5030 2005-05-10 Martin Baulig <martin@ximian.com>
5032 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
5033 the cache if we're just looking for `MemberTypes.NestedType' in a
5036 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
5037 constraints if we're still resolving the type tree.
5038 (Expression.MemberLookup): If we're resolving the type tree, only
5039 look for `MemberTypes.NestedType' since we're only interested in
5042 * class.cs (TypeContainer.DefineType): Don't resolve the type
5043 parameters here; do this later in ResolveType() after the type
5044 tree has been resolved.
5045 (TypeContainer.ResolveType): New public method; this is called
5046 after the type tree is resolved and before the types are being
5047 populated. We resolve the generic constraints here.
5048 (TypeContainer.DoDefineMember): Check the constraints on our base
5049 class and interfaces.
5051 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
5052 set the `ResolvingTypeTree' flag on the EmitContext.
5054 * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
5056 2005-05-10 Marek Safar <marek.safar@seznam.cz>
5058 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
5060 * expression.cs (Argument.GetParameterModifier): Turned to property.
5061 (Invocation.Error_InvalidArguments): Add more descriptive errors.
5063 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
5066 2005-05-09 Raja R Harinath <rharinath@novell.com>
5069 * decl.cs (MemberCache.AddMethods): Register override methods,
5070 rather than non-override methods.
5071 * typemanager.cs (RegisterOverride): New.
5072 (IsOverride): Update.
5074 2005-05-09 Marek Safar <marek.safar@seznam.cz>
5076 * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
5078 2005-05-06 Martin Baulig <martin@ximian.com>
5081 (Attributable.IsClsComplianceRequired): Fix typo in the method name.
5082 (AttributeTester.AnalyzeTypeCompliance): Add generics support.
5084 2005-05-09 Marek Safar <marek.safar@seznam.cz>
5088 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
5089 recursive declaration.
5091 * statement.cs (Block.ResolveMeta): Report any error in resolving.
5093 2005-05-06 Marek Safar <marek.safar@seznam.cz>
5095 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
5097 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
5099 2005-05-05 Raja R Harinath <rharinath@novell.com>
5102 * decl.cs (DeclSpace.FamilyAccessible):
5103 Use TypeManager.IsNestedFamilyAccessible.
5105 Fix reopened #64812.
5106 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
5109 2005-05-04 Raja R Harinath <rharinath@novell.com>
5110 Abin Thomas <projectmonokochi@rediffmail.com>
5111 Anoob V E <projectmonokochi@rediffmail.com>
5112 Harilal P R <projectmonokochi@rediffmail.com>
5115 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
5116 allow access to all static members.
5118 2005-05-04 Martin Baulig <martin@ximian.com>
5120 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
5122 2005-05-04 Martin Baulig <martin@ximian.com>
5126 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
5127 section at the end; make things work if `default' is not the last
5130 2005-05-04 Martin Baulig <martin@ximian.com>
5134 * statement.cs (Switch): Replaced the `got_default' field with a
5135 `default_section' one.
5136 (Switch.CheckSwitch): Set `default_section' here.
5137 (Switch.Resolve): If we're a constant switch and the constant is
5138 not found, use the default section.
5140 2005-05-03 Martin Baulig <martin@ximian.com>
5142 * expression.cs (ArrayAccess.EmitGetLength): New public method.
5144 * statement.cs (Foreach.ArrayForeach): New nested class.
5145 (Foreach.TemporaryVariable): New nested class.
5146 (Foreach.EmitArrayForeach): Removed; this is now in the new
5149 2005-05-03 Raja R Harinath <rharinath@novell.com>
5151 * pending.cs (BaseImplements): Move the #74773 fix here. This is
5153 (VerifyPendingMethods): Revert change below.
5155 * typemanager.cs (IsOverride, RegisterNonOverride): New.
5156 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
5157 that used to trigger warning -28. Remove warning -28.
5158 * expression.cs (Invocation.OverloadResolve): Use
5159 TypeManager.IsOverride to distinguish override methods.
5162 * pending.cs (VerifyPendingMethods): If a base type implements the
5163 requested interface, don't bother checking individual methods of
5164 the base type. As a side-effect, this prevents the creation of
5165 unnecessary proxies.
5167 2005-05-02 Martin Baulig <martin@ximian.com>
5171 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5172 Also `And' the locals if the old vector is null.
5173 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
5174 null; in this case we basically reset all the variables.
5176 2005-05-02 Martin Baulig <martin@ximian.com>
5180 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
5181 Added `FlowBranching branching' argument; always `and' the
5182 variables instead of `or'ing them unless we're an infinite loop.
5184 * statement.cs (While.Resolve): Create a new sibling unless we're
5187 2005-05-02 Martin Baulig <martin@ximian.com>
5191 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
5192 arguments; use it instead of creating a new TopLevelBlock.
5193 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
5194 our ConstructorInitializer.
5197 (TopLevelBlock.TopLevelBranching): New public property.
5198 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
5199 and create our `TopLevelBranching'.
5201 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
5202 anonymous method host, use `block.TopLevelBranching' rather than
5203 creating a new branching.
5205 2005-04-20 Miguel de Icaza <miguel@novell.com>
5207 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
5208 a ScopeInfo, if any of the current children is a child of the new
5209 entry, move those children there.
5211 2005-04-30 Martin Baulig <martin@ximian.com>
5213 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
5214 at the beginning of a SwitchSection. Fix #73335.
5216 2005-04-27 Marek Safar <marek.safar@seznam.cz>
5219 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
5221 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
5222 (FieldExpr.DoResolve): Obsolete members are ignored for field
5225 2005-04-26 Marek Safar <marek.safar@seznam.cz>
5227 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
5228 of arrays detection.
5230 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
5232 (Field.VerifyClsCompliance): Volatile fields are not compliant.
5234 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
5237 2005-04-25 Ben Maurer <bmaurer@ximian.com>
5239 * cs-parser.jay: Use the prefered version of -unsafe in error
5242 2005-04-22 Marek Safar <marek.safar@seznam.cz>
5244 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
5247 2005-04-20 John Luke <john.luke@gmail.com>
5249 * driver.cs: fix typo in error message, --outout to --output
5251 2005-04-30 Martin Baulig <martin@ximian.com>
5253 * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
5254 handle the .NET 2.x security attributes.
5256 2005-04-30 Martin Baulig <martin@ximian.com>
5259 (TypeManager.ExpandInterfaces): Don't add things twice.
5262 (TypeContainer.VerifyClsCompliance): Allow generic instances.
5264 2005-04-29 Martin Baulig <martin@ximian.com>
5266 * generic.cs (Constraints.ResolveTypes): Expand interfaces.
5268 * anonymous.cs: Added support for anonymous generic methods.
5270 2005-04-29 Martin Baulig <martin@ximian.com>
5272 * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
5275 2005-04-29 Martin Baulig <martin@ximian.com>
5277 * generic.cs (TypeManager.HasConstructorConstraint): Removed.
5279 * expression.cs (New.DoResolve): Fix the CS0304 check.
5281 2005-04-29 Martin Baulig <martin@ximian.com>
5283 * typemanager.cs (TypeManager.GetFullName): Updated to the new
5286 * class.cs (MethodCore.IsDuplicateImplementation): If we're an
5287 explicit interface implementation, compare the interface types.
5288 (MethodData.Define): Use the new naming scheme from the latest
5290 (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
5292 * decl.cs (MemberName.GetMemberName): Removed.
5293 (MemberName.MethodName, FullName): New properties.
5295 2005-04-25 Raja R Harinath <rharinath@novell.com>
5297 * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
5299 2005-04-22 Martin Baulig <martin@ximian.com>
5301 * generic.cs (GenericMethod): Create the EmitContext in the
5302 `Define()'; in `Define(MethodBuilder)', create the type parameters
5303 before calling `Define()'. Fixes #73933.
5305 2005-04-22 Martin Baulig <martin@ximian.com>
5308 (Constraints.Resolve): Make things work wrt. the new type lookup system.
5309 (ConstructedType.ResolveAsTypeTerminal): Don't override this.
5311 * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
5312 ConstructedType, check its constraints.
5314 2005-04-20 Marek Safar <marek.safar@seznam.cz>
5316 * codegen.cs (InRefOutArgumentResolving): New field.
5318 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
5319 fields outside contructor.
5321 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
5323 2005-04-19 Miguel de Icaza <miguel@novell.com>
5325 * anonymous.cs (CaptureContext.EmitParameterInstance): The
5326 parameter code was not completed ever, so it was not as up-to-date
5327 as local variables. Must finish it.
5329 The bug fix was to compare the Toplevel of the block, not the
5330 current block. Thanks for Ben for pointing this out.
5332 2005-04-19 Raja R Harinath <rharinath@novell.com>
5334 * decl.cs (AddMethods): Use the declaring type of the problem
5335 method to determine if we want to squash a warning.
5337 2005-04-19 Marek Safar <marek.safar@seznam.cz>
5339 * attribute.cs: Removed debug output.
5341 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
5343 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
5346 2005-04-18 Raja R Harinath <rharinath@novell.com>
5349 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
5350 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
5351 all null comparisons against reference types.
5353 2005-04-18 Marek Safar <marek.safar@seznam.cz>
5356 * class.cs (TypeContainer.CircularDepException) New nested
5358 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
5359 (TypeContainer.DefineType): Removed error, reset InTransit before
5361 (Class.DefineType): Throw exception when is in Transit.
5362 Catch exception and report error.
5363 (Struct.DefineType): Throw exception when is in Transit.
5364 Catch exception and report error.
5365 (Interface.DefineType): Throw exception when is in Transit.
5366 Catch exception and report error.
5368 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
5369 handle nested exception handlers.
5371 * flowanalysis.cs (InTryWithCatch): New method, search for try with
5374 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
5375 InFinally and InCatch storage.
5377 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
5378 (Catch.Resolve): Set and Restore ec.InCatch.
5379 (Try.Resolve): Set and Restore ec.InFinally.
5380 (Try.HasCatch): True when try has catch.
5382 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
5384 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
5385 for the same event member, so exclude such cases from warning 419.
5388 2005-04-16 Miguel de Icaza <miguel@novell.com>
5390 * expression.cs (Binary.ResolveOperator): Apply patch from John
5391 Luke to fix bug 59864: operators &, | and ^ on enumerations
5392 require that the same enum type on both sides.
5394 * driver.cs: Add warnings to old flag usage, this is to assist
5395 people who produce Makefiles and hope that the Makefiles will be
5398 * class.cs (TypeContainer.EmitType): Moved the definition of the
5399 special $PRIVATE$ field from the resolve phase to the Emit phase.
5400 During resolve we do not know if we are a struct with
5401 HasExplicitLayout, we know this only after the attributes for the
5404 Set the FieldOffset to zero on the dummy field that we create for
5405 the class. Fixes 74590.
5407 2005-04-16 Raja R Harinath <rharinath@novell.com>
5410 * ecore.cs (PropertyExpr.resolved): New.
5411 (DoResolve): Use it to handle a case of double resolution here.
5412 Handle a case of identical-name-and-type-name.
5413 * expression.cs (ArrayCreation.CheckIndices): Avoid double
5414 resolution by storing the results of expression resolution back
5415 into the "probes" array.
5417 2005-04-15 Raja R Harinath <rharinath@novell.com>
5419 Fix cs0208-7.cs and cs0208-8.cs.
5420 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
5421 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
5422 error reporting to point out the reason a struct is not unmanaged.
5424 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5426 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
5427 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
5429 2005-04-13 Raja R Harinath <rharinath@novell.com>
5432 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
5433 IdenticalNameAndTypeName here.
5434 (EventExpr.InstanceResolve): Likewise.
5436 2005-04-13 Marek Safar <marek.safar@seznam.cz>
5438 C# 2.0 DefaultCharSetAttribute implementation
5440 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
5441 which allows us to set GlobalNamespace for every resolve.
5442 (Attribute.ResolveArguments): Cut from Resolve.
5443 (Attribute.GetCharSetValue): Returns CharSet named argument.
5444 (Attribute.DefinePInvokeMethod): Gets default charset from
5446 (GlobalAttribute.ResolveAsTypeStep): Override.
5447 (GlobalAttribute.ResolveArguments): Override.
5449 * class.cs (TypeAttr): Is protected.
5451 * codegen.cs (ModuleClass.DefaultCharSet): New member.
5452 (ModuleClass.DefaultCharSetType): New memeber.
5453 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
5455 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
5456 charset from module.
5458 * delegate.cs (TypeAttr): Override.
5459 (Delegate.DefineType): Use this TypeAttr.
5461 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
5462 at very early stage (before types are defined) to resolve model
5463 module attributes. It will probably not work with corlib but it
5466 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
5467 charset from module.
5469 * typemanager.cs (default_charset_type): New type.
5471 2005-04-13 Raja R Harinath <rharinath@novell.com>
5473 * decl.cs (MemberCache.AddMethods): Don't warn if
5474 System.Object.Finalize has buggy MethodAttributes.
5476 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
5479 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5481 * doc.cs : detect ambiguous reference to overloaded members.
5482 Fixed bug #71603. MS 1.1 csc does not detect it.
5484 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5486 * doc.cs : delegates must not be referenced with parameters.
5489 2005-04-12 Miguel de Icaza <miguel@novell.com>
5491 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
5493 2005-04-10 Miguel de Icaza <miguel@novell.com>
5495 * driver.cs (MainDriver): Stop processing if the CLS stage found
5498 (CompilerCallableEntryPoint.InvokeCompiler): Always
5499 reset after execution; Take a TextWriter argument for the
5502 * report.cs: Use the error stream instead of hardcoding stderr.
5504 2005-04-09 Miguel de Icaza <miguel@novell.com>
5506 * class.cs: Reduce code paths to test, too small of an
5507 optimization to make it worth the extra testing. Always perform
5510 2005-04-08 Raja R Harinath <rharinath@novell.com>
5513 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
5514 operators that had errors reported on them.
5516 2005-04-08 Marek Safar <marek.safar@seznam.cz>
5518 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
5520 (Attribute.Resolve): Add named argument type checking.
5522 * class.cs (FixedField.Define): Use IsPrimitiveType
5524 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
5526 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
5527 unsafe parameter types.
5529 * statement.cs (Using.ResolveExpression): Add better error description.
5531 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
5533 2005-04-08 Raja R Harinath <rharinath@novell.com>
5536 * attribute.cs (Attribute.GetAttributeUsage): Resolve
5537 AttributeUsageAttribute in the emitcontext of the attribute class,
5538 not in the emitcontext of the attributable entity it was attached to.
5539 * cs-parser.jay: Use 'current_class', not 'current_container',
5540 when creating a GlobalAttribute.
5542 2005-04-08 Alp Toker <alp@atoker.com>
5544 * pending.cs: The fix to #58413 failed to compile methods implementing
5545 interfaces with/without params modifiers and vice versa, even though
5546 params modifiers aren't part of the signature. Make the modifier check
5547 less strict as in csc.
5549 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
5550 Anoob V E <projectmonokochi@rediffmail.com>
5551 Harilal P R <projectmonokochi@rediffmail.com>
5554 * pending.cs (TypeAndMethods.mods): New. Store the parameter
5555 modifiers of pending methods.
5556 (PendingImplementation.PendingImplementation): Initialize it.
5557 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
5558 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
5559 with ParameterData. Add check for modifiers.
5560 * class.cs (MethodData.Define): Update to changes.
5562 2005-04-07 Raja R Harinath <rharinath@novell.com>
5564 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
5566 2005-04-07 Marek Safar <marek.safar@seznam.cz>
5568 * class.cs (PropertyMethod.Define): Check private accessor in abstract
5571 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
5574 * typemanager.cs: Registered RequiredAttributeAttribute.
5576 2005-04-06 Marek Safar <marek.safar@seznam.cz>
5578 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
5579 Warning CS0169 is back at level 3.
5580 (IMethodData.SetMemberIsUsed): New method.
5582 * decl.cs (IsUsed): New value; moved from FieldBase.Status
5583 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
5585 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
5587 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
5589 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
5592 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
5595 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
5596 to avoid the problems with nested types.
5598 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
5599 Anoob V.E <projectmonokochi@rediffmail.com>
5600 Harilal P.R <projectmonokochi@rediffmail.com>
5601 Raja R Harinath <rharinath@novell.com>
5604 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
5606 * typemanager (GetConstructor): Make public.
5608 2005-04-05 John Luke <john.luke@gmail.com>
5609 Raja R Harinath <rharinath@novell.com>
5612 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
5613 struct too. Return false quicker in a few cases.
5614 (VerifyUnManaged): Use it.
5616 2005-04-05 Raja R Harinath <rharinath@novell.com>
5619 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
5620 not 'unreachable_seen'.
5622 2005-04-04 Marek Safar <marek.safar@seznam.cz>
5624 * attribute.cs (Attribute.GetValue): Removed unused.
5626 * codegen.cs (CodeGen.TrimExt): Removed unused.
5628 * cs-parser.jay (output): Removed unused.
5630 * cs-tokenizer.cs (hex_digits): Removed unused.
5632 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
5634 * expression.cs (Indirection.LoadExprValue): Removed unused.
5635 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
5637 * iterators.cs (Iterator.param_types): Removed unused.
5639 * statement.cs (Goto.block): Removed unused.
5640 (ToplevelBlock.did): Removed unused.
5641 (Switch.ResolveConstantSwitch): Removed unused.
5643 2005-04-01 Ben Maurer <bmaurer@ximian.com>
5645 * rootcontext.cs: Allow mcs to bootstrap with the compilation
5648 2005-04-19 Martin Baulig <martin@ximian.com>
5650 Merged r42462 from MCS and made it work for GMCS.
5652 * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
5654 * generic.cs (GenericMethod.Define): Removed `return_type' argument.
5656 2005-04-01 Raja R Harinath <rharinath@novell.com>
5658 Fix #74232 and cs0208-3.cs.
5659 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
5660 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
5661 unmanaged type. Don't use FieldBuilders when 't' is a
5662 TypeBuilder. Use ModFlags and MemberType fields.
5663 * class.cs (MemberBase.member_type): Rename from MemberType.
5664 (MemberBase.MemberType): New property. Determines member_type on
5666 (MemberBase.DoDefine): Don't initialize MemberType here.
5667 (FieldMember.Define): Likewise.
5669 2005-04-01 Marek Safar <marek.safar@seznam.cz>
5672 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
5673 Attributes are emitted there.
5675 2005-04-01 Raja R Harinath <rharinath@novell.com>
5677 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
5678 keyword in 'partial enum' too.
5679 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
5681 Report from Kamil Skalski <nazgul@omega.pl>.
5684 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
5685 have partial containers too.
5687 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
5688 in block' checks to Block.CheckInvariantMeaningInBlock.
5689 * statement.cs (Block.GetKnownVariableInfo): Make private.
5690 (Block.IsVariableUsedInChildBlock): Remove.
5691 (Block.IsVariableUsedInBlock): Likewise.
5692 (Block.CheckInvariantMeaningInBlock): New. Show location of
5693 conflicting declaration.
5694 (Block.AddVariable): Make error messages less long-winded and more
5695 specific. Show location of conflicting declaration.
5696 * parameter.cs (Parameters.Location): New readonly property.
5698 2005-03-31 Raja R Harinath <rharinath@novell.com>
5700 Clean up semantics of invoking ResolveMemberAccess.
5701 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
5702 can have an instance, ensure that we pass in a non-TypeExpression
5703 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
5704 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
5705 argument. Update to changes and simplify.
5706 (FieldExpr.Emitinstance): Remove CS0120 check.
5707 (PropertyExpr.EmitInstance): Likewise.
5708 * expression.cs (Argument.Resolve): Likewise.
5709 (Invocation.DoResolve): Update to changes in semantics of
5712 2005-03-31 Marek Safar <marek.safar@seznam.cz>
5715 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
5718 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
5720 2005-03-31 Raja R Harinath <rharinath@novell.com>
5722 Fix difference in behaviour with commandline invocation.
5723 * driver.cs (Driver.Reset): New.
5724 (CompilerCallableEntryPoint): Call it.
5726 * statement.cs (If.Resolve): Avoid spurious "uninitialized
5727 variable" warnings if the boolean expression failed to resolve.
5729 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
5731 * attribute.cs: Fix the union of several permissions when some of them
5732 are unrestricted (so the result isn't an unrestricted permission set).
5735 2005-03-30 Raja R Harinath <rharinath@novell.com>
5737 * ecore.cs (MemberExpr): New class. Convert from interface
5739 (MemberExpr.ResolveMemberAccess): Refactor and move here from
5740 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
5742 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
5743 (MethodGroupExpr.IsExplicitImpl): Remove.
5744 (Expression.GetFieldFromEvent): Remove.
5745 (SimpleName.MemberStaticCheck): Remove.
5746 (SimpleName.DoSimpleNameResolve): Update to changes.
5747 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
5748 (MemberAccess.IdenticalNameAndTypeName): Remove.
5749 (MemberAccess.error176): Move to MemberExpr.
5750 (MemberAccess.DoResolve): Update to changes.
5751 (BaseAccess.DoResolve): Likewise.
5753 2005-03-30 Marek Safar <marek.safar@seznam.cz>
5755 C# 2.0 Conditional attribute class implementation
5757 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
5758 Analyzes class whether it has attribute which has ConditionalAttribute
5759 and its condition is not defined.
5761 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
5762 (Class.IsExcluded): New method. Search for at least one defined
5763 condition in ConditionalAttribute of attribute class.
5765 2005-03-30 Raja R Harinath <rharinath@novell.com>
5767 * ecore.cs (PropertyExpr): Derive from Expression, not
5768 ExpressionStatement.
5769 (PropertyExpr.EmitStatement): Remove.
5771 2005-03-29 Raja R Harinath <rharinath@novell.com>
5774 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
5775 internal field "value__" of an enum be private. The examples for
5776 "value__" that I found on MSDN all used FieldAttributes.Private.
5778 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
5779 Don't mention IL method attribute names.
5781 Fix #47991. Remove a TODO.
5782 * statement.cs (Block.Toplevel): Make into a field.
5783 (Block.Parameters): Move into ToplevelBlock.
5784 (Block.known_variables): Rename from child_variable_names.
5785 (Block.Block): Remove variants that take Parameters. Initialize
5786 'Toplevel' with the immediately surrounding toplevel block.
5787 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
5788 LocalInfo parameter.
5789 (Block.GetKnownVariableInfo): New.
5790 (Block.IsVariableNameUsedInChildBlock): Update.
5791 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
5792 the block, even though it may not be in scope.
5793 (Block.AddVariable): Remove Parameters parameter. Use
5794 Toplevel.Parameters instead.
5795 (Block.AddConstant): Remove Parameters parameter.
5796 (Block.GetParameterReference): Update to use Toplevel.Parameters.
5797 (Block.IsParamaterReference): Likewise.
5798 (Block.IsLocalParameter): Likewise. Simplify a lot.
5799 (ToplevelBlock.Parameters): New. Moved from Block.
5800 (ToplevelBlock.ToplevelBlock): Update to changes. Always
5801 initialize Parameters to a non-null value.
5802 * cs-parser.jay: Update to changes.
5803 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
5804 simple names that mean different things in the same block. Use
5805 Block.IsVariableNameUsedInBlock.
5807 2005-03-28 Raja R Harinath <rharinath@novell.com>
5809 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
5811 2005-03-26 Raja R Harinath <harinath@acm.org>
5814 * assign.cs (Assign.DoResolve): When the RHS of an assignment
5815 fails to resolve, ensure that the LHS is still resolved as an
5818 2005-03-25 Raja R Harinath <harinath@acm.org>
5820 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
5822 (Enum.current_ec): Remove.
5823 (Enum.LookupEnumValue): Remove EmitContext argument.
5824 Just uses the one created during DefineType.
5825 (Enum.FindMembers): Update.
5826 * expression.cs (MemberAccess.DoResolve): Update.
5828 2005-03-22 Marek Safar <marek.safar@seznam.cz>
5830 * assign.cs (Assign.DoResolve): Check for CS1717 when
5831 source and target are same (uses Equals).
5833 * expression.cs (LocalVariableReference, ParameterReference,
5834 This): Implemented Equals, GetHashCode.
5836 * statement.cs (Block.GetParameterReference): Removed useless
5839 2005-03-22 Raja R Harinath <rharinath@novell.com>
5842 * statement.cs (Block.AddVariable): Ensure that we skip implicit
5843 blocks before deciding whether the error is cs0136 or cs0128.
5845 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
5846 (using_alias_directive, using_namespace_directive): Pass
5847 MemberName, not an expression to Namespace.UsingAlias and
5849 (MakeName): Use the MemberName of the namespace.
5850 * namespace.cs (Namespace.MemberName): New.
5851 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
5852 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
5854 * decl.cs (MemberName.Name): Make readonly.
5855 (MemberName.FromDotted): New "constructor".
5856 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
5857 (MemberCore.Name): Compute from MemberName on demand.
5858 (MemberCore.SetMemberName): Provide a way to change the
5860 (MemberCore.AddToContainer): Don't take a fullname parameter.
5861 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
5862 fully qualified name of the container to the member name.
5863 (TypeContainer.AddToTypeContainer): Use a fully qualified name
5864 only if the type is a member of the root container.
5865 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
5866 MemberName.Left rather than searching for an embedded ".".
5867 (PartialContainer.CreatePart): Update to changes in RootContext.
5868 (MemberBase.ShortName): Turn into a property. Use
5869 MemberCore.SetMemberName.
5870 (MemberBase.ExplicitInterfaceName): Remove.
5871 (MemberBase.UpdateMemberName): Remove.
5872 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
5873 (PropertyBase.SetMemberName): New override.
5874 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
5875 (Tree.GetDecl): New.
5876 (Tree.AllDecls): Rename from Decls.
5877 * attribute.cs, enum.cs, report.cs: Update to changes.
5878 * driver.cs (MainDriver): Use MemberName.FromDotted on
5879 RootContext.MainClass.
5881 2005-03-21 Marek Safar <marek.safar@seznam.cz>
5883 * class.cs (FixedField.Define): Check for CS1664 and more sanity
5886 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
5888 2005-03-18 Marek Safar <marek.safar@seznam.cz>
5890 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
5891 property accessor modifiers.
5893 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
5894 fixed buffer attribute (CS1716).
5895 (PropertyMethod.HasCustomAccessModifier): When property accessor
5896 has custom modifier.
5898 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
5900 (PropertyExpr.DoResolveLValue): Add CS0272.
5902 2005-03-17 Miguel de Icaza <miguel@novell.com>
5904 * convert.cs: When converting to a pointer, use the proper Conv.U
5905 or Conv.I depending on the source data type.
5907 * cs-tokenizer.cs: Make the size for large decimal constants,
5910 2005-03-17 Martin Baulig <martin@ximian.com>
5912 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5913 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
5915 2005-03-17 Martin Baulig <martin@ximian.com>
5917 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5918 to bool so we can return an error condition.
5919 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5922 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
5924 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
5927 2005-03-16 Raja R Harinath <rharinath@novell.com>
5929 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
5930 Refactor to avoid traversing the list of assemblies, and to avoid
5931 string concatenation.
5932 * typemanager.cs (guid_attr_type): Remove.
5933 (negative_hits, pointers, references): Remove hashes.
5935 (GetConstructedType): New. Uses type_hash to handle constructed
5936 types (arrays, references, pointers).
5937 (GetReferenceType, GetPointerType): Use it.
5938 (GetNestedType): New. Uses type_hash to handle nested types of
5940 (LookupType, LookupTypeDirect): Remove.
5941 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
5942 'types' hash and LookupTypeReflection directly.
5943 (params_string, params_object): Use GetConstructedType.
5944 * namespace.cs (Namespace.cached_types): New. Cache of reflected
5946 (Namespace.Lookup): Use cached_types.
5947 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
5948 provided by old TypeManager.LookupType.
5949 * rootcontext.cs (MakeFQN): Remove.
5950 * decl.cs (DeclSpace.MakeFQN): Likewise.
5951 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
5952 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
5953 TypeManager.GetConstructedType.
5954 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
5956 2005-04-16 Zoltan Varga <vargaz@freemail.hu>
5958 * cs-parser.jay: Fix build.
5960 2005-03-15 Marek Safar <marek.safar@seznam.cz>
5962 * class.cs (TypeContainer.CircularDepException) New nested
5963 (MethodCore.CheckBase): Report CS1715 for properties and indexers.
5965 * cs-parser.jay: Reports CS1527 for any namespace element.
5967 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
5970 * expression.cs (ParameterReference.IsAssigned): Changed error to
5972 (Error_WrongNumArguments): Moved CS0245 detection here.
5974 * statement.cs (Return.Resolve): Add CS1622 report.
5976 2005-03-11 Marek Safar <marek.safar@seznam.cz>
5978 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
5980 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
5982 * attribute.cs expression.cs: Get rid of some allocations.
5984 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
5986 * doc.cs : just eliminate the latest change.
5988 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5990 * doc.cs : commented out the latest change. It breaks xml-030.cs
5992 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5994 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
5995 fail. So invoke CreateType() in FindDocumentedType().
5997 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5999 * cs-tokenizer.cs : added IsKeyword().
6000 * doc.cs : Detect keyword incorrectly used as identifier.
6001 Allow identifiers prefixed by @.
6003 2005-03-10 Marek Safar <marek.safar@seznam.cz>
6005 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
6006 It caused exception in namespace resolving (again!).
6008 * class.cs (Class.ctor): Removed exit.
6009 (PropertyMethod.ctor): ditto.
6011 * codegen.cs (Codegen.Reset): Reset static data.
6012 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
6014 * cs-tokenizer.cs (Cleanup): Removed.
6016 * driver.cs (GetSystemDir): Rewrote to one line command.
6017 It caused problem with unloaded dynamic modules.
6018 (UnixParseOption): Removed Exit.
6019 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
6020 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
6021 Now can be mcs used as library.
6023 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
6026 * location.cs (Reset): Reset static data.
6028 * namespace.cs (Reset): Reset static data.
6030 * report.cs (Report.Reset): Reset static data.
6032 * rootcontext.cs (RootContext.Reset): Reset static data.
6034 * tree.cs (RootTypes.ctor): Use Location.Null
6036 * typemanager.cs (TypeManager.Reset): Reset static data.
6037 (CoreLookupType): Removed Exit.
6038 (TypeHandle.Reset): Reset static data.
6040 2005-03-10 Raja R Harinath <rharinath@novell.com>
6043 * typemanager.cs (ComputeNamespaces): Import namespaces from
6044 referenced modules too.
6046 2005-03-09 Raja R Harinath <rharinath@novell.com>
6048 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
6051 2005-03-09 Raja R Harinath <rharinath@novell.com>
6053 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
6054 enclosing DeclSpace. This ensures that a name-lookup populates
6055 more caches and there are fewer 'TypeExpression's. Carve out
6056 nested type lookup into ...
6057 (LookupNestedTypeInHierarchy): ... this.
6059 2005-04-15 Martin Baulig <martin@ximian.com>
6061 Merged r41590 from MCS and make it work in the generics land.
6063 * generic.cs (TypeParameter.UpdateConstraints): Removed the
6066 * class.cs (PartialContainer.UpdateConstraints): Removed.
6067 (PartialContainer.CheckConstraints): Removed.
6068 (PartialContainer.SetParameterInfo): Store the constraints here.
6069 (PartialContainer.DefineTypeParameters): New public method;
6070 resolve the type parameter's constraints here. Note that the
6071 PartialContainer doesn't have an EmitContext anymore, so we must
6072 do this in the ClassPart.
6074 2005-03-09 Raja R Harinath <rharinath@novell.com>
6076 Clean up a few partial-class semantics.
6077 Fixes test-357.cs and cs1618-2.cs.
6078 * cs-parser.jay (struct_declaration): Use 'current_class' as
6079 parent of newly-created struct. Remove call to Register ().
6080 Use 'pop_current_class' to complete handing the current struct.
6081 (interface_declaration): Likewise.
6082 (class_declaration): Likewise.
6083 (enum_declaration): Use 'current_class' as parent of newly created
6085 (delegate_declaration): Likewise.
6086 (pop_current_class): New function. This is used to handle closing
6087 up the 'current_class' and 'current_container', and pointing them
6088 to the enclosing class/container.
6089 (CSharpParser): Initialize 'current_class' too.
6090 * decl.cs (MemberCore): Add check for invariant: a partial
6091 container is not a parsed entity, and thus does not enclose any
6093 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
6094 (DeclSpace.BaseTypeExpr): Use it.
6095 (DeclSpace.LookupType): Add check for invariant.
6096 * class.cs (TypeContainer): Add check for invariant: a nested
6097 class should have the same NamespaceEntry as its enclosing class.
6098 (TypeContainer.EmitFieldInitializers): Make virtual.
6099 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
6101 (TypeContainer.Register): Remove.
6102 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
6103 null. Use TypeResolveEmitContext for resolving base types and
6104 interfaces. Move initialization of Parts.TypeBuilder here from
6106 (TypeContainer.DefineNestedTypes): ... here.
6107 (PartialContainer): Take a Namespace not a NamespaceEntry.
6108 (PartialContainer.Create): Don't use Register. Call the
6109 appropriate Add... function directly.
6110 (ClassPart): Take both the PartialContainer and the enclosing
6111 class as constructor arguments.
6112 (ClassPart.EmitFieldInitializers): Override.
6113 (ClassPart.PartFindNestedTypes): Remove.
6114 (FieldBase.GetInitializerExpression): Resolve the initializer
6115 expression in the emit context of the enclosing class.
6116 * tree.cs (RootTypes): Remove Register ().
6118 2005-03-08 Marek Safar <marek.safar@seznam.cz>
6120 * cs-parser.jay: Removed CS0134.
6122 * driver.cs: Removed CS1901.
6124 * expression.cs (SizeOf.DoResolve): Don't report CS0233
6125 for predefined types.
6127 2005-03-07 Duncan Mak <duncan@novell.com>
6129 * codegen.cs (Save): Catch UnauthorizedAccessException as
6130 well. Fixes bug #73454.
6132 2005-03-07 Marek Safar <marek.safar@seznam.cz>
6134 * cs-tokenizer.cs (xtoken): Add CS1035.
6136 * class.cs (MethodData.Define): Add CS0683.
6137 (FieldMember.ctor): Add CS0681.
6139 2005-03-07 Raja R Harinath <rharinath@novell.com>
6141 * ecore.cs (SimpleName.DoResolve): Rename from
6142 SimpleName.DoResolveAllowStatic.
6143 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
6144 Pass 'intermediate' flag to MemberStaticCheck.
6145 (SimpleName.MemberStaticCheck): Skip "static check" only in case
6146 of "intermediate" lookups via MemberAccess.
6147 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
6148 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
6150 2005-03-07 Raja R Harinath <rharinath@novell.com>
6153 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
6154 slipped in because of variable names that are identical to a
6155 builtin type's BCL equivalent ('string String;', 'int Int32;').
6156 (PropertyExpr.EmitInstance): Likewise.
6158 2005-03-04 Marek Safar <marek.safar@seznam.cz>
6160 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
6162 * report.cs (warning_ignore_table): Made public.
6164 2005-03-04 Raja R Harinath <rharinath@novell.com>
6167 * class.cs (MethodData.Emit): Pass 'container' to
6168 container.GetObsoleteAttribute instead of 'container.Parent'.
6170 2005-03-03 Marek Safar <marek.safar@seznam.cz>
6172 * cs-parser.jay: Add 1534 error test.
6174 * iterators.cs (Yield.CheckContext): Add error 1629.
6175 (Iterator.ctor): Save unsafe modifier.
6176 (MoveNextMethod.DoEmit): Restore unsafe context.
6178 * namespace.cs (UsingAlias): Better error message.
6180 2005-03-03 Dan Winship <danw@novell.com>
6182 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
6183 the warning message [#73219]
6185 2005-03-03 Raja R Harinath <rharinath@novell.com>
6187 Fix compile with MCS 1.0.0.0.
6188 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
6189 w_restore to not depend on string constant folding.
6191 2005-03-03 Raja R Harinath <rharinath@novell.com>
6193 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
6194 CS0246 check to users who passed 'silent = false'.
6195 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
6197 (SimpleName.SimpleNameResolve): Update.
6198 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
6199 (MemberAccess.IdenticalNameAndTypeName): Update.
6200 * doc.cs (FindDocumentedTypeNonArray): Update.
6202 2005-03-03 Raja R Harinath <rharinath@novell.com>
6204 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
6205 * parameters.cs (ComputeAndDefineParameters): Remove.
6206 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
6207 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
6208 Use GetParameterInfo.
6210 2005-03-02 Marek Safar <marek.safar@seznam.cz>
6212 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
6214 2005-03-02 Raja R Harinath <rharinath@novell.com>
6216 Unify DeclSpace.LookupType and DeclSpace.FindType.
6217 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
6218 is in charge of defining nested types on demand.
6219 (DeclSpace.LookupType): Use it when the current_type is a
6220 TypeBuilder. Use LookupTypeDirect for reflected types.
6221 (DeclSpace.FindType): Remove.
6222 (DeclSpace.LookupInterfaceOrClass): Likewise.
6223 (DeclSpace.DefineTypeAndParents): Likewise.
6224 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
6225 DeclSpace.LookupType.
6226 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
6227 * typemanager.cs (LookupType): Simplify.
6228 (AddUserType): Remove type from negative_hits.
6229 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
6230 * class.cs (TypeContainer.FindMembers): Move handling of nested
6232 (TypeContainer.FindMembers_NestedTypes): ... here.
6233 (TypeContainer.FindNestedType): Implement override.
6234 (ClassPart.FindNestedType): Delegate to PartialContainer.
6235 (ClassPart.PartFindNestedType): Looks up the nested types of the
6238 2005-04-14 Martin Baulig <martin@ximian.com>
6240 * generic.cs (ConstructedType): Moved all the type lookup and
6241 nested class logic into SimpleName.
6242 (ConstructedType.ResolveConstructedType): Our underlying type is
6243 already fully resolved; all the type lookup stuff is in
6246 * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
6247 constructed types here instead of in ConstructedType.
6249 * decl.cs (MemberName.GetTypeExpression): Always create a
6250 SimpleName, not a ConstructedType.
6251 (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
6253 2005-03-02 Martin Baulig <martin@ximian.com>
6255 * class.cs (TypeContainer.DoDefineMembers): We also need a default
6256 static constructor in static classes.
6258 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
6260 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
6261 sizeParamIndex is not specified.
6263 2005-03-01 Marek Safar <marek.safar@seznam.cz>
6266 * report.cs (WarningMessage.IsEnabled): Missing null check.
6268 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6270 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
6271 in the fields and not in the properties.
6273 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
6275 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
6278 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6280 * attribute.cs: Small refactoring (improved robustness).
6281 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
6282 (ValidateGuid): Removed.
6283 (Resolve): Removed referenced to above mentioned.
6284 (GetAttributeUsage): Made private and changed to work without
6286 (GetIndexerAttributeValue): Don't crash.
6287 (GetConditionalAttributeValue): Ditto.
6288 (GetClsCompliantAttributeValue): Ditto.
6289 (ExtractSecurityPermissionSet): All attributes exceptions are
6291 (GetPropertyValue): New helper.
6292 (GetMethodImplOptions): New method.
6293 (DefinePInvokeMethod): Reuse common code. Implemented handling of
6294 some missing properties.
6296 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
6297 (Method.ApplyAttributeBuilder): Updated.
6299 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
6302 2005-02-28 Raja R Harinath <rharinath@novell.com>
6305 * report.cs (Report.SymbolRelatedToPreviousError): Handle
6306 non-simple types (array, pointer, reference).
6308 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6310 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
6312 * class.cs (MethodCore.IsDuplicateImplementation): Special error
6314 (Method.CheckBase): Catch wrong destructor here.
6315 (MethodData.Define): Add errors 550, 668.
6317 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
6319 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
6321 * pending.cs (VerifyPendingMethods): Add error 551.
6323 * typemanager.cs (CSharpName): Next error report helper.
6325 2005-02-25 Marek Safar <marek.safar@seznam.cz>
6327 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
6328 attributes. Removed useless attribute double check.
6329 It saves almost 2MBs for corlib.
6331 2005-02-25 Raja R Harinath <rharinath@novell.com>
6334 * statement.cs (ExpressionStatement.Resolve): Make robust to being
6335 called twice in case of error.
6337 2005-02-23 Chris Toshok <toshok@ximian.com>
6339 Fix compiler portions of #72827.
6340 * statement.cs (Block.Emit): call Begin/EndScope on the
6341 EmitContext instead of the ILGenerator.
6343 * codegen.cs (EmitContext.BeginScope): new method, call
6344 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
6346 (EmitContext.BeginScope): same, but EndScope and CloseScope
6348 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
6349 offset and call the superclass's OpenScope(int) with it.
6350 (SymbolWriter.CloseScope): get the current il
6351 offset and call superclass's CloseScope(int) with it.
6353 2005-02-23 Marek Safar <marek.safar@seznam.cz>
6355 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
6356 CS1677 for out and ref as well.
6358 * class.cs (Method.Define): Add error CS1599 detection.
6360 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
6362 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
6364 * delegate.cs (Delegate.Define): Add error CS1599 detection.
6366 * support.cs.cs (ModifierDesc): New helper method.
6368 2005-02-23 Raja R Harinath <rharinath@novell.com>
6369 Abin Thomas <projectmonokochi@rediffmail.com>
6370 Anoob V E <projectmonokochi@rediffmail.com>
6371 Harilal P R <projectmonokochi@rediffmail.com>
6374 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
6375 MemberLookup (used for error reporting) actually returns a result.
6376 Fix error report number (122, not 112).
6378 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
6379 Anoob V E <projectmonokochi@rediffmail.com>
6380 Harilal P R <projectmonokochi@rediffmail.com>
6383 * pending.cs (PendingImplementation.GetAbstractMethods):
6384 Find NonPublic members too.
6386 2005-02-22 Marek Safar <marek.safar@seznam.cz>
6388 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
6391 * class.cs (MethodCore.CheckMethodAgainstBase):
6392 Add error 239 report.
6394 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6396 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6398 * class.cs (Operator.Define): Add error 217 report.
6400 2005-02-21 Raja R Harinath <rharinath@novell.com>
6403 * expression.cs (Invocation.IsApplicable): Make public.
6404 (Invocation.IsParamsMethodApplicable): Likewise.
6405 * delegate.cs (Delegate.VerifyApplicability): Don't use
6406 Invocation.VerifyArgumentCompat for parameter applicability
6407 testing. Use Invocation.IsApplicable and
6408 Invocation.IsParamsMethodApplicable.
6410 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6412 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6414 * class.cs (Operator.Define): Add error 217 report.
6416 2005-02-21 Raja R Harinath <rharinath@novell.com>
6418 * namespace.cs (UsingEntry.Resolve): Undo change below.
6420 2005-02-21 Raja R Harinath <rharinath@novell.com>
6423 * ecore.cs (Expression.MemberLookupFailed): Add argument to
6424 disable the error message when the extended MemberLookup also
6426 (Expression.MemberLookupFinal): Update.
6427 (SimpleName.DoSimpleNameResolve): Update.
6428 * expression.cs (MemberAccess.ResolveNamespaceOrType):
6429 Don't use MemberLookupFinal.
6430 (New.DoResolve): Update.
6431 (BaseAccess.CommonResolve): Update.
6433 2005-02-21 Raja R Harinath <rharinath@novell.com>
6436 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
6437 occured previously, don't resolve again.
6439 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6442 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
6443 argument. Call ResolveAttributeUsage for unresolved.
6444 when types doesn't match ctor arguments.
6446 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
6447 for nested attribute classes.
6448 (Class.attribute_usage): Removed.
6449 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
6450 for attribute class.
6452 * ecore.cs (IsAttribute): Removed.
6454 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
6456 * rootcontext.cs (RegisterAttribute): Removed, attributes are
6458 (attribute_types): Removed.
6459 (EmitCode): Global attributes are emited as the latest.
6461 2005-02-18 Marek Safar <marek.safar@seznam.cz>
6463 * class.cs (EmitFieldInitializers): Don't emit field initializer
6464 for default values when optimilization is on.
6466 * constant.cs (Constant.IsDefaultValue): New property.
6468 * driver.cs: Add /optimize handling.
6472 * literal.cs: Implement new IsDefaultValue property.
6474 * rootcontext.cs (Optimize): New field, holds /optimize option.
6476 2005-02-18 Raja R Harinath <rharinath@novell.com>
6478 Fix crasher in re-opened #72347.
6479 * namespace.cs (Namespace.Lookup): Return null if
6480 DeclSpace.DefineType returns null.
6483 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
6485 2005-02-18 Raja R Harinath <rharinath@novell.com>
6487 Fix remainder of #63202. Change semantics of DoResolveLValue: it
6488 now returns null if it cannot resolve to an lvalue.
6489 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
6490 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
6491 returned null. Remove check for SimpleName.
6492 (EventExpr.DoResolveLValue): New.
6493 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
6494 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
6496 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
6498 (Unary.ResolveOperator): Move CS0211 check ...
6499 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
6501 (Unary.DoResolveLValue): Simplify.
6502 (AddressOf.DoResolveLValue): New.
6503 (ArrayAccess.DoResolveLValue): New.
6505 2005-02-16 Marek Safar <marek.safar@seznam.cz>
6507 * attribute.cs (Attribute.Resolve): Add arguments casting for
6508 when types doesn't match ctor arguments.
6510 2005-02-16 Raja R Harinath <rharinath@novell.com>
6512 Fix parts of #63202.
6513 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
6514 lookup of operator in base type. Ensure that all checks happen
6515 when the operator resolves to an "op_..." method.
6517 2005-02-15 Raja R Harinath <rharinath@novell.com>
6520 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
6521 'ignore_cs0104' parameter. Pass it to ...
6522 (NamespaceEntry.Lookup): ... this.
6523 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
6524 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
6525 (TypeLookupExpression.DoResolveAsTypeStep): Update.
6526 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
6527 Update. Request that cs0104 errors be ignored.
6528 (ComposedCast.ResolveAsTypeStep): Update.
6530 2005-02-14 Raja R Harinath <rharinath@novell.com>
6533 * expression.cs (Invocation.BetterFunction): Remove support for
6534 comparing virtual functions and their overrides.
6535 (Invocation.IsOverride): New.
6536 (Invocation.OverloadResolve): Don't consider 'override' functions
6537 during candidate selection. Store them in a lookaside list.
6538 If the selected method is a 'virtual' function, use the list to
6539 find any overrides that are closer to the LHS type.
6541 2005-02-14 Marek Safar <marek.safar@seznam.cz>
6543 * expression.cs (New.DoResolve): Add complex core type reduction.
6544 (New.Constantify): Converts complex core type syntax like 'new int ()'
6547 2005-02-14 Raja R Harinath <rharinath@novell.com>
6549 * decl.cs (EntryType.EntryType): New constructor to create an
6550 updated copy of a cache entry.
6551 (MemberCache.AddMethods): Use it.
6552 (MemberCache.ClearDeclaredOnly): Remove.
6553 (MemberCache.MemberCache): Update.
6555 2005-02-11 Miguel de Icaza <miguel@novell.com>
6557 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
6558 variable. This one is represents the actual low-level declaration
6559 of the method, as opposed to the semantic level `IsStatic'.
6561 An anonymous method which is hosted into a static method might be
6562 actually an instance method. IsStatic would reflect the
6563 container, while MethodIsStatic represents the actual code
6566 * expression.cs (ParameterReference): Use the new MethodIsStatic
6567 instead of IsStatic.
6569 * anonymous.cs (AnonymousMethod.Compatible): Pass the
6570 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
6571 set on the current EmitContext.
6573 * expression.cs (Cast): Overload DoResolveLValue so we can pass
6574 resolve our casted expression as an LValue. This triggers the
6575 proper LValue processing that is later required by Assign.
6579 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
6581 2005-02-11 Marek Safar <marek.safar@seznam.cz>
6583 C# 2.0 Fixed buffer implementation
6585 * anonymous.cs: Update after RegisterHelperClass renaming.
6587 * attribute.cs (AttributeTester.fixed_buffer_cache):
6588 Cache of external fixed buffers.
6589 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
6590 implementation if field is fixed buffer else null.
6593 (TypeContainer.AddField): Accept FieldMember instead of Field.
6594 (FieldBase.IsFieldClsCompliant): Extracted code from
6595 VerifyClsCompliance descendant customization.
6596 (FixedField): New class handles fixed buffer fields.
6597 (FixedFieldExternal): Keeps information about imported fixed
6599 (IFixedField): Make access to internal or external fixed buffer
6602 * cs-parser.jay: Add fixed buffer parsing.
6604 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
6607 * expression.cs (Indirection): Extended implementation to accept
6609 (PointerArithmetic.Emit): Get element from fixed buffer as well.
6610 (ElementAccess.MakePointerAccess): Get type as parameter.
6611 (DoResolve): Add fixed buffer field expression conversion.
6612 (DoResolveLValue): Ditto.
6613 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
6614 (ArrayPtr): Derives from FixedBufferPtr.
6615 (ArrayPtr.Emit): Add extra emit for array elements.
6617 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
6619 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
6620 for compiler generated types.
6621 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
6623 * statement.cs (Fixed): Refactored to be easier add fixed buffer
6624 and consume less memory.
6625 (Fixed.Resolve): Add fixed buffer case.
6627 * typemanager.cs (compiler_generated_attr_ctor,
6628 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
6629 (HasElementType): Add our own implementation to work on every
6632 2005-02-11 Miguel de Icaza <miguel@novell.com>
6634 * anonymous.cs (CaptureContext): Track whether `this' has been
6637 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
6638 only captured `this' if it was implicitly done (instance
6639 methods/variables were used).
6641 * codegen.cs (EmitContext.CaptureThis): New method to flag that
6642 `this' must be captured.
6644 2005-01-30 Miguel de Icaza <miguel@novell.com>
6646 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
6647 is null it means that there has been no need to capture anything,
6648 so we just create a sibling.
6650 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
6652 Just a partial fix. The other half is fairly elusive.
6654 2005-02-10 Raja R Harinath <rharinath@novell.com>
6656 Fix #52586, cs0121-4.cs.
6657 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
6658 and return a hashtable.
6659 (MemberCache.ClearDeclaredOnly): New.
6660 (MemberCache.MemberCache): Update to change. Make a deep copy of
6661 the method_hash of a base type too.
6662 (MemberCache.AddMethods): Adapt to having a deep copy of the base
6663 type methods. Overwrite entries with the same MethodHandle so
6664 that the ReflectedType is correct. The process leaves in base
6665 virtual functions and their overrides as distinct entries.
6666 (CacheEntry): Now a class instead of a struct. It shouldn't alter
6667 matters since it was boxed in a ArrayList before.
6668 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
6670 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
6671 case of a virtual function and its override (choose the overload
6673 (Invocation.OverloadResolve): Avoid 'override' members during
6674 'applicable_type' calculation.
6676 2005-03-28 Raja R Harinath <rharinath@novell.com>
6678 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
6679 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
6680 GetTypeHandle. It is possible for a reflected type to derive from
6681 a TypeBuilder (e.g., int[] derives from the TypeBuilder
6682 System.Array during mscorlib compilation).
6683 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
6684 contain a method_hash, don't create one either. Don't create a
6685 deep copy of the base cache's method_hash.
6686 (MemberCache.SetupCache): Rename back from DeepCopy.
6687 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
6688 already initialized. If we see an override function, add its
6689 underlying base virtual function to the member_hash too.
6691 2005-02-09 Raja R Harinath <rharinath@novell.com>
6693 Combine two near-redundant caches.
6694 * typemanager.cs (method_params): Rename from method_internal_params.
6695 (TypeManager.GetParameterData): New. Replace
6696 Invocation.GetParameterData.
6697 (TypeManager.LookupParametersByBuilder): Remove.
6698 * expression.cs (Invocation.method_parameter_cache): Remove.
6699 (Invocation.GetParameterData): Remove.
6701 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
6704 2005-02-08 Raja R Harinath <rharinath@novell.com>
6707 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
6708 TypeManager.multicast_delegate_type is null, resolve it by looking
6709 up "System.MulticastDelegate".
6710 * rootcontext.cs (RootContext.ResolveCore): Simplify.
6712 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
6713 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
6714 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
6717 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
6718 (LabeledStatement.AddReference): New. Set 'referenced'.
6719 (Goto.Resolve): Use it.
6721 2005-02-05 John Luke <john.luke@gmail.com>
6723 * driver.cs: remove duplicate -doc line in Usage ()
6725 2005-02-04 Raja R Harinath <rharinath@novell.com>
6727 * location.cs (Location.AddFile): Fix CS2002 error report.
6729 2005-02-02 Martin Baulig <martin@ximian.com>
6731 * delegate.cs (Delegate.DefineType): Report an internal error if
6732 TypeManager.multicast_delegate_type is null. See bug #72015 for
6735 2005-02-02 Raja R Harinath <rharinath@novell.com>
6737 Fix a crasher in a variant of #31984.
6738 * const.cs (Constant.CheckBase): New override that defers the
6739 new-or-override check in case the base type hasn't been populated
6741 (Constant.Define): Ensure the new-or-override check is performed.
6743 2005-02-01 Duncan Mak <duncan@ximian.com>
6745 * const.cs (LookupConstantValue): Check that `ce' is not null
6746 before calling GetValue ().
6748 2005-02-01 Raja R Harinath <rharinath@novell.com>
6750 Fix test-334.cs (#69519).
6751 * cs-parser.jay (using_alias_directive): Pass in an expression to
6752 NamespaceEntry.UsingAlias.
6753 (using_namespace_directive): Pass in an expression to
6754 NamespaceEntry.Using.
6755 (namespace_name): Don't flatten to a string.
6756 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
6757 (NamespaceEntry.AliasEntry.Resolve): Lookup using
6759 (NamespaceEntry.UsingEntry): Likewise.
6760 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
6762 (NamespaceEntry.LookupForUsing): Remove.
6763 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
6765 (NamespaceEntry.Lookup): Remove support for dotted names.
6767 2005-02-01 Raja R Harinath <rharinath@novell.com>
6769 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
6771 (NamespaceEntry.ImplicitParent): Compute on demand.
6772 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
6773 parallels the current.
6774 (NamespaceEntry.LookupForUsing): Use it.
6775 (NamespaceEntry.Lookup): If the current namespace-entry is
6776 implicit, don't search aliases and using tables.
6778 2005-02-01 Raja R Harinath <rharinath@novell.com>
6781 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
6783 (TypeContainer.BaseCache): Compute on demand.
6784 (TypeContainer.FindMembers): Define constants and types if they're
6785 not already created.
6786 (FieldMember.Define): Move resetting of ec.InUnsafe before error
6788 * const.cs (Constant.Define): Make idempotent.
6790 2005-01-29 Miguel de Icaza <miguel@novell.com>
6792 * pending.cs: Produce better code (no nops produced by using Ldarg
6795 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6796 i - 1' it should be arg + 1.
6800 2005-01-28 Raja R Harinath <rharinath@novell.com>
6802 * attribute.cs (Attribute.CheckAttributeType): Make private
6804 (Attribute.ResolveType): Make virtual.
6805 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
6806 handling of RootContext.Tree.Types.
6808 2005-01-27 Raja R Harinath <rharinath@novell.com>
6810 Update attribute-handling to use the SimpleName/MemberAccess
6812 * cs-parser.jay (attribute): Pass in an expression to the
6813 constructors of Attribute and GlobalAttribute.
6814 * attribute.cs (Attribute): Take an expression for the name.
6815 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
6816 passed in attribute name expression.
6817 (Attribute.CheckAttributeType): Use it.
6818 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
6819 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
6820 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
6821 argument to prevent error messages if the lookup fails.
6823 2005-01-27 Marek Safar <marek.safar@seznam.cz>
6825 * expression.cs (Indirection): Implemented IVariable interface
6826 to support indirection in AddressOf operator.
6827 (PointerArithmetic.Emit): Add optimalization for case where
6828 result can be precomputed.
6830 2005-01-26 Martin Baulig <martin@ximian.com>
6832 * class.cs (TypeContainer.AttributeTargets): Return the correct
6833 AttributeTargets depending on our `Kind' instead of throwing an
6834 exception; fixes #71632.
6836 2005-01-26 Marek Safar <marek.safar@seznam.cz>
6839 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
6842 2005-03-17 Martin Baulig <martin@ximian.com>
6844 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6845 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
6847 2005-03-17 Martin Baulig <martin@ximian.com>
6849 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6850 to bool so we can return an error condition.
6851 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6854 2005-03-17 Martin Baulig <martin@ximian.com>
6856 * generic.cs (TypeMananager.IsIEnumerable): New public method.
6858 * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
6859 converting from an array-type of T to `IEnumerable<T>'.
6861 2005-03-16 Martin Baulig <martin@ximian.com>
6863 * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
6864 (Nullable.LiftedUnaryMutator): New public class.
6866 * expression.cs (UnaryMutator.DoResolve): Added support for
6869 2005-03-14 Martin Baulig <martin@ximian.com>
6871 * generic.cs (Nullable.NullCoalescingOperator): Implemented.
6873 2005-03-14 Martin Baulig <martin@ximian.com>
6875 * generic.cs (Nullable.LiftedBinaryOperator): Added support for
6876 the comparision operators `<', `>', `<=' and `>='.
6878 2005-03-13 Martin Baulig <martin@ximian.com>
6881 (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
6882 avoid confusion with the `NullLiteral'.
6883 (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
6885 2005-03-13 Martin Baulig <martin@ximian.com>
6887 * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
6888 comparing arbitrary types with the null literal.
6890 2005-03-13 Martin Baulig <martin@ximian.com>
6892 * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
6893 boolean operators '&&', '||', '&' and '|'.
6894 (Nullable.OperatorTrueOrFalse): New public class.
6896 * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
6897 instead of a `StaticCallExpr'; added support for nullables.
6899 2005-03-10 Martin Baulig <martin@ximian.com>
6902 (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
6903 rather than `etype.IsSubclassOf (TypeManager.value_type)'.
6905 2005-03-07 Martin Baulig <martin@ximian.com>
6907 * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
6908 it work if `expr' is not an IMemoryLocation.
6909 (Nullable.Lifted): Implement IMemoryLocation.
6910 (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
6913 2005-03-05 Martin Baulig <martin@ximian.com>
6915 * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
6916 (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
6917 (Nullable): Added support for lifted unary and binary operators.
6919 * expression.cs (Unary.DoResolve): Added support for nullable types.
6920 (Binary.DoResolve): Likewise.
6921 (Conditional.DoResolve): Likewise.
6923 2005-03-02 Martin Baulig <martin@ximian.com>
6925 * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
6927 * class.cs (ClassPart.SetParameterInfo): Override this.
6928 (PartialContainer.SetParameterInfo): Override this.
6929 (TypeContainer.CheckConstraints): New protected method.
6930 (PartialContainer.CheckConstraints): Override this and check
6931 whether the same contraints were specified in all parts of a
6932 partial generic type definition.
6933 (PartialContainer.UpdateConstraints): New public method.
6935 * generic.cs (TypeParameter.UpdateConstraints): New public method.
6937 2005-03-02 Martin Baulig <martin@ximian.com>
6939 Committing a patch from Carlos Alberto Cortez to fix #72887.
6941 * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
6942 casts from `T []' to `int []'.
6944 2005-03-02 Martin Baulig <martin@ximian.com>
6946 * generic.cs (TypeManager.IsEqual): Make this symmetric.
6948 * expression.cs (Binary.ResolveOperator): When resolving a
6949 BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
6950 `=='. Fixes #71866. See gen-127.cs.
6952 2005-03-02 Martin Baulig <martin@ximian.com>
6954 * class.cs (TypeContainer.DoDefineMembers): We also need a default
6955 static constructor in static classes.
6957 2005-03-02 Martin Baulig <martin@ximian.com>
6960 (NullableType.Name, NullableType.FullName): Add a "?" to the name.
6961 (Nullable.LiftedConversion): Added support for user-defined
6964 * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
6966 * cs-parser.jay: Use ComposedCast everywhere instead of
6967 NullableType, so we don't need to check for NullableType
6969 (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
6970 case where we'll be resolved into a `parenthesized_expression_0'
6974 (Convert.UserDefinedConversion): Added nullable conversions.
6976 2005-02-28 Martin Baulig <martin@ximian.com>
6978 * generic.cs (TypeManager.IsNullableType): New static method.
6979 (Nullable): New abstract class.
6980 (Nullable.NullLiteral): New public class.
6981 (Nullable.LiftedConversion): New public class.
6983 * cs-parser.jay (non_expression_type): Changed `builtin_types' to
6984 `builtin_types opt_nullable'.
6987 (Convert.ImplicitConversionStandard): Added nullable conversions.
6988 (Convert.ExplicitConversionStandard): Likewise.
6989 (Convert.ExplicitConversion): Likewise.
6991 2005-02-26 Martin Baulig <martin@ximian.com>
6993 * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
6994 begin with a "?", for instance "?[]". Don't do a type lookup if
6997 2005-02-25 Martin Baulig <martin@ximian.com>
6999 The first part of Nullable Types :-)
7001 * generic.cs (NullableType): New public class.
7002 (NullCoalescingOperator): New public class.
7003 (TypeArguments.Resolve): Add a CS0306 check.
7005 * cs-parser.jay (opt_error_modifier): Removed, this was unused.
7006 (opt_nullable): New rule.
7007 (type): Added `opt_nullable' to `namespace_or_type_name',
7008 `builtin_types' and `pointer_type'.
7009 (array_type): Added `opt_nullable'.
7010 (opt_rank_specifier_or_nullable): New rule; this is the
7011 combination of `opt_rank_specifier' and `opt_nullable'.
7012 (opt_error): New rule; catch errors here.
7013 (nullable_type_or_conditional): New rule; we use this to check for
7014 nullable and still detect the conditional operator.
7015 (local_variable_type): Use `opt_rank_specifier_or_nullable'
7016 instead `opt_rank_specifier'.
7018 * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
7021 2005-02-24 Martin Baulig <martin@ximian.com>
7023 * README, README.Changes: Removed; they're old and obsolete.
7025 2005-02-22 Martin Baulig <martin@ximian.com>
7027 * generic.cs (TypeParameter.Resolve): If resolving the constraints
7028 returned an error, set `constraints' to null to avoid a crash
7030 (TypeParameter.ResolveType): Likewise.
7032 2005-02-22 Martin Baulig <martin@ximian.com>
7035 (Constraints.ResolveTypes): Protect against being called twice.
7036 (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
7037 (TypeParameter.ResolveType): New public method; calls
7038 constraints.ResolveTypes().
7039 (TypeParameter.DefineType): Moved constraints.ResolveType() out
7040 into the new ResolveType().
7041 (GenericMethod.Define): Call ResolveType() on all our
7044 2005-02-21 Martin Baulig <martin@ximian.com>
7047 (TypeManager.generic_nullable_type): New static public field.
7048 (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
7051 (RootContext.ResolveCore): Resolve "System.Nullable`1".
7053 2005-02-15 Martin Baulig <martin@ximian.com>
7055 * generic.cs (ConstructedType.Constraints): Correctly check
7056 constraints if the argument type is a type parameter; fixes
7059 2005-02-02 Martin Baulig <martin@ximian.com>
7061 * delegate.cs (Delegate.DefineType): Report an internal error if
7062 TypeManager.multicast_delegate_type is null. See bug #72015 for
7065 2005-01-29 Miguel de Icaza <miguel@novell.com>
7067 * pending.cs: Produce better code (no nops produced by using Ldarg
7070 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
7071 i - 1' it should be arg + 1.
7075 2005-01-26 Martin Baulig <martin@ximian.com>
7077 * cs-parser.jay (indexer_declarator): Don't report an error if we
7078 have type parameters since we can be an explicit interface
7079 implementation; fixes #71449.
7081 2005-01-26 Martin Baulig <martin@ximian.com>
7083 * class.cs (TypeContainer.AttributeTargets): Return the correct
7084 AttributeTargets depending on our `Kind' instead of throwing an
7085 exception; fixes #71632.
7087 2005-01-26 Martin Baulig <martin@ximian.com>
7089 * delegate.cs (Delegate.DefineType): Correctly define our type
7090 parameters. Fixes #71483.
7092 2005-01-25 Raja R Harinath <rharinath@novell.com>
7095 * expression.cs (MemberAccess.DoResolve): Don't complain with
7096 cs0572 when the LHS of a member access has identical name and type
7099 2005-01-25 Marek Safar <marek.safar@seznam.cz>
7102 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
7104 Create custom PermissionSet only for PermissionSetAttribute.
7106 2005-01-24 Marek Safar <marek.safar@seznam.cz>
7109 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
7110 delegates in static class.
7112 2005-01-24 Martin Baulig <martin@ximian.com>
7114 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7115 merging an implicit block, just use its reachability.
7117 * statement.cs (Block.Resolve): Make the unreachable code check
7118 work wrt. implicit blocks; see test-337 from #63842.
7120 2005-01-21 Alp Toker <alp@atoker.com>
7122 * cs-parser.jay: destructor_declaration's container is PartialContainer
7123 not Class when partial types are used, so use Kind prop instead of
7126 2005-01-22 Miguel de Icaza <miguel@ximian.com>
7128 * cs-parser.jay: Improve error reporting when an interface
7131 2005-01-20 Dick Porter <dick@ximian.com>
7133 * support.cs: SeekableStreamReader fix from Sandor Dobos
7134 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
7135 chars are read. Fixes bug 70369.
7137 2005-01-20 Raja R Harinath <rharinath@novell.com>
7139 * cs-parser.jay (catch_clause): Simplify current_block handling
7142 2005-01-17 Miguel de Icaza <miguel@ximian.com>
7144 * convert.cs (ImplicitStandardConversionExists): Synchronize the
7145 code with ImplicitStandardConversion to handle the implicit
7146 conversion of method groups into valid delegate invocations.
7148 The problem is that in parameter handling we were using this code
7149 path. Fixes bug #64698
7151 2005-01-19 Raja R Harinath <rharinath@novell.com>
7153 * cs-parser.jay: Fix several infelicities.
7154 - Avoid assigning to the parser value stack. Code like
7155 '$3 = null' is unclean. Synthesize a value for the code block
7157 - Avoid using oob_stack for storing location information. Use ...
7158 (_mark_): ... this. New (empty) rule. Saves the current location
7160 (foreach_statement): Avoid using oob_stack for current_block
7161 handling. Use technique used in for_statement and
7162 using_statement. Synthesize a value for the code block to store
7163 additional intermediate information.
7165 2005-01-13 Miguel de Icaza <miguel@ximian.com>
7167 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
7168 of a different type is only allowed to private fields of a
7169 containing type, not on fields of a base class.
7171 See test-174.cs and error cs0122-9.cs
7173 2005-01-13 Raja R Harinath <rharinath@novell.com>
7175 Fix test-335.cs (bug #58126).
7176 * cs-parser.jay (argument): Split out non-expression parts of the
7177 rule into 'non_simple_argument'.
7178 (invocation_expression): Support parenthesized invocations with
7179 multiple arguments, and with single non-simple arguments.
7181 2005-01-13 Raja R Harinath <rharinath@novell.com>
7183 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
7186 2005-01-12 Raja R Harinath <rharinath@novell.com>
7188 Fix cs0038-1.cs, cs1640-6.cs.
7189 * ecore.cs (Expression.Resolve): Remove special-case for
7190 SimpleName in error-handling.
7191 (Expression.almostMatchedMembers): Relax access permission to
7193 (Expression.MemberLookupFailed): Handle duplicates in
7194 almostMatchedMembers list.
7195 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
7196 * expression.cs (New.DoResolve): Report CS1540 for more cases.
7197 * typemanager.cs (GetFullNameSignature): Use the MethodBase
7198 overload if the passed in MemberInfo is a MethodBase.
7200 2005-01-25 Martin Baulig <martin@ximian.com>
7203 (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
7205 2005-01-12 Marek Safar <marek.safar@seznam.cz>
7208 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
7209 for non-CAS & merge permission sets properly.
7211 2005-01-11 Raja R Harinath <rharinath@novell.com>
7213 Improve standard-compliance of simple name and member access
7214 resolution. Fixes bugs #52697, #57200, #67520, #69519.
7215 * ecore.cs (FullNamedExpression): New abstract base class
7216 for Namespaces and TypeExpressions.
7217 (ResolveFlags.SimpleName): Remove.
7218 (SimpleName): Remove support for dotted names.
7219 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
7220 DeclSpace.FindType and DeclSpace.LookupType.
7221 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
7222 (Expression.ExprClassName): Make member function.
7223 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
7224 a namespace. Remove creation of dotted "SimpleName"s.
7225 (MemberAccess.DoResolve): Likewise.
7226 * decl.cs (DeclSpace.Cache): Make private.
7227 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
7228 (DeclSpace.FindType): Update.
7229 (DeclSpace.LookupType): Move here from RootContext. Return a
7230 FullNamedExpression.
7231 * namespace.cs (Namespace): Derive from FullNamedExpression
7232 so that it can be part of expression resolution.
7233 (Namespace.Lookup): Return an FullNamedExpression.
7234 (NamespaceEntry.LookupAlias): Lookup aliases only in current
7236 * rootcontext.cs (NamespaceLookup): Remove.
7237 (LookupType): Move to DeclSpace.
7238 * attribute.cs (CheckAttributeType): Update.
7239 * doc.cs (FindDocumentedType): Remove allowAlias argument.
7240 (FindDocumentedTypeNonArray): Likewise.
7242 2005-01-11 Raja R Harinath <rharinath@novell.com>
7244 Fix cs0509.cs, cs1632.cs.
7245 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
7246 is the same as IsInterface.
7247 (TypeContainer.GetClassBases): Likewise.
7248 * statement.cs (LabeledStatement.ig): New field.
7249 (LabeledStatement.LabelTarget): Save ILGenerator which created the
7251 (LabeledStatement.DoEmit): Check that the label was created with
7252 the same ILGenerator.
7254 2005-01-10 Marek Safar <marek.safar@seznam.cz>
7257 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
7258 accessors to its properties.
7260 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
7261 from accessors to property.
7263 2005-01-10 Marek Safar <marek.safar@seznam.cz>
7266 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
7269 2005-01-08 Miguel de Icaza <miguel@ximian.com>
7271 * attribute.cs: Check for null and empty strings.
7273 I have lost another battle to Paolo.
7275 2005-01-07 Marek Safar <marek.safar@seznam.cz>
7278 * class.cs (PropertyMethod): Set Parent field in ctors.
7279 (SetMethod.InternalParameters): Add unsafe switch hack.
7280 Override MarkForDuplicationCheck where it is appropriate.
7282 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
7283 It says whether container allows members with the same name.
7285 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
7286 Removed is_method parameter.
7288 2005-01-06 Duncan Mak <duncan@ximian.com>
7290 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
7291 because the previous change led to incorrect reporting of CS1032
7292 ("Cannot define/undefine preprocessor symbols after first token in
7293 file"). Instead of using `tokens_seen' as the only flag that
7294 triggers CS1040, introduce `comments_seen'. This new flag is used
7295 to signify having seen comments on the current line, so it is
7296 unset after a newline.
7298 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
7300 * doc.cs : When searching for a type, find nested type too.
7301 This fixes bug #71040.
7303 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
7306 - Warn missing member comment on those classes which also does not
7307 have doc comments. Fixed bug #71041.
7308 - Don't warn missing doc comment on default constructor.
7311 2005-01-06 Duncan Mak <duncan@ximian.com>
7313 * cs-tokenizer.cs (xtoken): After handling traditional C-style
7314 comments, set `tokens_seen' to true. This allows us to detect
7315 misplaced preprocessor directives (i.e. not at the beginning of
7316 the a line, nor after whitespaces). In that case, report error
7317 CS1040. This fixes bug #56460.
7319 * cs-parser.jay (interface_member_declaration): Add checks for
7320 IsExplicitImpl, and report CS0541 error if an interface member is
7321 defined as an explicit interface declaration.
7323 2005-01-06 Marek Safar <marek.safar@seznam.cz>
7326 * class.cs (PropertyMethod): Set Parent field in ctors.
7327 (SetMethod.InternalParameters): Add unsafe switch hack.
7329 * decl.cs (MemberCore.Parent): Cannot be readonly.
7331 2005-01-06 Raja R Harinath <rharinath@novell.com>
7333 * decl.cs (DeclSpace.ResolveType): Remove.
7334 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
7335 Merge in code from ...
7336 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
7337 * class.cs, enum.cs: Update to changes.
7339 2005-01-06 Miguel de Icaza <miguel@ximian.com>
7341 * anonymous.cs: Ensure that we init the scope of our parent if it
7342 has not been initialized yet.
7344 2004-12-30 Duncan Mak <duncan@ximian.com>
7346 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
7347 if field.FieldBuilder is null. Fixes #70758.
7349 * convert.cs: Fixed some typos and updated some of the comments.
7350 (ImplicitStandardConversionExists):
7351 (TryImplicitIntConversion): If `target_type' is an interface and
7352 the type of `ic' implements this interface, return true or a new
7353 BoxedCast instead of null. This fixes #70468.
7355 2004-12-29 Duncan Mak <duncan@ximian.com>
7357 * expression.cs (Argument.Emit): Check that Expr is
7358 IMemoryLocation before casting to it, and report CS1510 otherwise.
7362 2004-12-21 Ben Maurer <bmaurer@ximian.com>
7364 * statement.cs (Block.ThisVariable): remove the recursion here, to
7365 make the --profile more sane.
7367 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
7369 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
7370 assembly, by JB Evain.
7372 2004-12-17 Raja R Harinath <rharinath@novell.com>
7374 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
7375 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
7376 "parent" refers to enclosing type/class. "base" refers to superclass.
7378 2004-12-17 Raja R Harinath <rharinath@novell.com>
7380 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7381 Ensure that we only have GlobalAttributes.
7382 * attribute.cs (Attribute.Emit): Make non-virtual.
7383 (GlobalAttribute.Emit): Remove.
7384 (Attribute.Resolve): Make virtual.
7385 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
7386 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
7387 the argument. Don't create one.
7388 (Attribute.GetObsoleteAttribute): Likewise.
7389 (Attribute.GetClsCompliantAttributeValue): Likewise.
7390 * class.cs, decl.cs: Update to changes.
7392 2004-12-17 Marek Safar <marek.safar@seznam.cz>
7394 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
7396 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
7398 * statement.cs (Foreach.Resolve): Add error 186 report.
7400 2004-12-16 Marek Safar <marek.safar@seznam.cz>
7402 * expression.cs (Conditional.DoResolve): Add warning 429.
7404 * statement.cs (If.Resolve): Add warning 665.
7406 2004-12-16 Raja R Harinath <rharinath@novell.com>
7408 New invariant: RootContext.Tree.Types.NamespaceEntry == null
7409 except when in the parser, and in GlobalAttribute.
7410 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
7411 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
7412 RootContext.Tree.Types.NamespaceEntry once work is done.
7413 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
7414 and resets RootContext.Tree.Types.NamespaceEntry.
7416 2004-12-15 Marek Safar <marek.safar@seznam.cz>
7418 * cs-parser.jay: Don't create a block for every variable.
7420 2004-12-14 Miguel de Icaza <miguel@ximian.com>
7422 * location.cs: Provide extra information.
7424 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
7425 variables from the captured environment, it is the ldarg_0.
7427 2004-12-14 Marek Safar <marek.safar@seznam.cz>
7429 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
7432 * class.cs: Changed warning level for 169 to avoid developer
7433 displeasure from warning flooding. It will be changed back when they
7434 fix most of current BCL warnings.
7436 * RootContext.cs: Pushed default WarningLevel to 3.
7438 * statement.cs: Removed unused variable.
7440 2004-12-14 Marek Safar <marek.safar@seznam.cz>
7442 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
7443 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
7444 Add error 502 report.
7445 (StaticClass.DefineType): Add error 441 report.
7446 (Class.AllowedModifiersProp): New virtual property as temporary
7447 extension to AllowedModifiers.
7448 (Class.DefineType): Add error 418 report. Moved ModFlags check here
7449 to share implementation with StaticClass and don't call virtual
7452 * driver.cs (MainDriver): Add error 1558 test.
7454 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
7455 report. Moved error 36 test here.
7457 * statement.cs (Throw.Resolve): Add error 724 report.
7459 * typemanager.cs: Add out_attribute_type core type.
7461 2004-12-13 Marek Safar <marek.safar@seznam.cz>
7463 * class.cs (TypeContainer.VerifyClsCompliance): Add error
7465 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
7467 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
7470 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
7472 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
7473 Add error 3023 report.
7474 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
7476 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
7479 2004-12-12 John Luke <john.luke@gmail.com>
7481 * driver.cs (AddArgs): take -- into account when
7482 adding arguments, fixes bug 65710
7484 2004-12-12 Martin Baulig <martin@ximian.com>
7486 * expression.cs (Unary.TryReduceNegative): Added support for
7487 SByteConstant and ByteConstant.
7488 (Unary.Reduce): Check error values from TryReduceNegative().
7490 2004-12-10 Marek Safar <marek.safar@seznam.cz>
7492 * attributes.cs (Attribute.Resolve): Avoid multiple error report
7493 and report exception as error 182.
7495 2004-12-10 Raja R Harinath <rharinath@novell.com>
7497 * driver.cs (Main): Fix message when there are warnings.
7499 2004-12-09 Miguel de Icaza <miguel@ximian.com>
7501 * delegate.cs: Fixed my fix from yesterday, sorry about that.
7503 2004-12-09 Marek Safar <marek.safar@seznam.cz>
7505 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
7506 Reduced number of warnings.
7508 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
7510 2004-12-08 Miguel de Icaza <miguel@ximian.com>
7512 * driver.cs: Removed message.
7514 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
7516 2004-12-08 <vargaz@freemail.hu>
7518 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
7520 2004-12-08 Martin Baulig <martin@ximian.com>
7522 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7523 instead of a CS3002 for properties and indexer.
7525 2004-12-08 Martin Baulig <martin@ximian.com>
7527 * decl.cs (MemberName.ToString): Make this work again.
7529 2004-12-08 Marek Safar <marek.safar@seznam.cz>
7531 * attribute.cs (Resolve): Add error 591 detection.
7533 * class.cs (FieldMember.Define): Add error 1547 detection.
7534 (Indexer.Define): Add error 620 detection.
7535 (Operator.Define): Add error 590 detection.
7537 * ecore.cs: Missing argument for error 79.
7539 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
7542 2004-12-07 Marek Safar <marek.safar@seznam.cz>
7545 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
7548 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
7550 * cs-parser.jay : handle doc comments on implicit/explicit operators.
7551 Some operator comments were suppressed.
7552 * doc.cs : Implicit/explicit operator name in doc comments are like
7553 "op_Explicit(type)~returnType", so added suffix handling.
7555 2005-01-21 Alp Toker <alp@atoker.com>
7557 * cs-parser.jay: destructor_declaration's container is PartialContainer
7558 not Class when partial types are used, so use Kind prop instead of 'is'.
7560 2004-12-12 Martin Baulig <martin@ximian.com>
7562 * expression.cs (Unary.TryReduceNegative): Added support for
7563 SByteConstant and ByteConstant.
7564 (Unary.Reduce): Check error values from TryReduceNegative().
7566 2004-12-11 Martin Baulig <martin@ximian.com>
7568 * support.cs (ReflectionParameters.ParameterName): If we have a
7569 `gpd', call `ParameterName' on it.
7571 * parameter.cs (Parameter.GetParameterAttributes): New static method.
7573 * pending.cs (PendingImplementation.DefineProxy): Call
7574 DefineParameter() for all of the MethodBuilder's arguments.
7576 2004-12-09 Martin Baulig <martin@ximian.com>
7578 * doc.cs (DocUtil): Make this a static class.
7580 2004-12-09 Martin Baulig <martin@ximian.com>
7582 * expression.cs (Invocation.InferType): Moved the type inference
7583 implementation into TypeManager.
7585 * generics.cs (TypeManager): Moved the type inference
7586 implementation here.
7588 2004-12-09 Martin Baulig <martin@ximian.com>
7590 * typemanager.cs (TypeManager): Make this a partial class.
7593 (TypeManager): Move the generics part of `TypeManager' here.
7595 2004-12-08 Martin Baulig <martin@ximian.com>
7597 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7598 instead of a CS3002 for properties and indexer. Added CS3024
7599 check for generic interfaces.
7601 * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
7602 instances are not CLS-compliant.
7604 2004-12-08 Martin Baulig <martin@ximian.com>
7607 (void_pointer_expression): New rule for `void*', `void**' etc.
7608 (typeof_expression): Add `void_pointer_expression'; fixes #66846.
7610 2004-12-08 Martin Baulig <martin@ximian.com>
7612 * expression.cs (Invocation.InferType): Removed the hack for
7613 MethodCore.MayUnify().
7615 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
7618 * class.cs (MethodCore.MayUnify): Use
7619 TypeManager.MayBecomeEqualGenericTypes().
7621 2004-12-08 Martin Baulig <martin@ximian.com>
7623 * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
7624 parameter, box it. Fixes #69233.
7626 2004-12-08 Martin Baulig <martin@ximian.com>
7628 * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
7629 have the ctor constraint. Fixes #68326.
7631 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
7633 * cs-parser.jay : interface comment was not consumed because of
7634 extra opt_semicolon before doc handling.
7636 2004-12-03 Raja R Harinath <rharinath@novell.com>
7638 Fix test-327.cs, test-328.cs, and put in early infrastructure
7639 for eventually fixing #52697.
7640 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
7641 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
7643 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
7644 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
7645 (VerifyUsing, error246): Update.
7646 * rootcontext.cs (RootContext.NamespaceLookup): Just use
7647 'NamespaceEntry.LookupNamespaceOrType'.
7649 2004-12-07 Martin Baulig <martin@ximian.com>
7651 * driver.cs: Call it "BETA SOFTWARE" :-)
7653 2004-12-06 Raja R Harinath <rharinath@novell.com>
7655 Fix crash on cs0657-17.cs.
7656 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7657 Use RootContext.Tree.Types, not 'new RootTypes ()'.
7658 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
7659 the case where the NamespaceEntry gets overwritten.
7661 2004-12-06 Marek Safar <marek.safar@seznam.cz>
7663 Fixed #69195, #56821
7664 * ecore.cs (ResolveBoolean): Tiny refactoring.
7666 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
7667 of right expression resolving when left is false constant and
7668 operator is LogicalAnd OR true constant and operator is LogicalOr.
7670 * statement.cs (ResolveUnreachable): Always reports warning.
7672 2004-12-05 Miguel de Icaza <miguel@ximian.com>
7674 * class.cs: Distinguish between 1721 and 1722 (just a little help
7675 for the programmer).
7677 2004-12-03 Miguel de Icaza <miguel@ximian.com>
7679 * delegate.cs: Only allow this on new versions of the language.
7681 2004-12-02 Duncan Mak <duncan@ximian.com>
7683 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
7685 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
7686 here as a static method. Take an additional bool out parameter
7687 `must_do_cs1540_check' for signaling to InstanceResolve.
7688 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
7689 member field from PropertyExpr class and made it an argument of
7691 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
7692 check for MarshalByRefObject, and report CS0122 instead of CS1540.
7693 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
7694 and `remove_accessor' as well as InstanceResolve: report CS0122
7699 2004-12-07 Martin Baulig <martin@ximian.com>
7701 * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
7702 and CS0692 where appropriate.
7704 2004-12-06 Martin Baulig <martin@ximian.com>
7706 * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
7707 IsDuplicateImplementation() and improved it.
7709 * expression.cs (Invocation.InferTypeArguments): Added
7710 `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
7711 and removed the "ref" modifier from `infered_types'.
7713 * decl.cs (MemberName.ToString): Removed the exception.
7715 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
7717 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
7718 comments are allowed.
7720 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7722 * delegate.cs: Add checks for subtypes in paramaters and return values
7723 in VerifyMethod () to add support for Covariance/Contravariance
7726 2004-12-02 Miguel de Icaza <miguel@ximian.com>
7728 * report.cs: Remove extra closing parenthesis.
7730 * convert.cs (Error_CannotImplicitConversion): If the name of the
7731 types are the same, provide some extra information.
7733 2004-12-02 Marek Safar <marek.safar@seznam.cz>
7736 * attribute.cs (Resolve): Improved implementation of params
7737 attribute arguments.
7739 * support.cs (ParameterData): Add HasParams to be faster.
7741 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
7743 all things are for /doc support:
7745 * doc.cs: new file that supports XML documentation generation.
7746 * mcs.exe.sources: added doc.cs.
7748 Handle /doc command line option.
7749 Report error 2006 instead of 5 for missing file name for /doc.
7750 Generate XML documentation when required, after type resolution.
7752 Added support for picking up documentation (/// and /** ... */),
7753 including a new XmlCommentState enumeration.
7755 Added lines to fill Documentation element for field, constant,
7756 property, indexer, method, constructor, destructor, operator, event
7757 and class, struct, interface, delegate, enum.
7758 Added lines to warn incorrect comment.
7760 Added Documentation field (passed only when /doc was specified).
7762 Added DocComment, DocCommentHeader, GenerateDocComment() and
7763 OnGenerateDocComment() and some supporting private members for
7764 /doc feature to MemberCore.
7766 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
7768 Added overriden DocCommentHeader.
7770 Added overriden DocCommentHeader and GenerateDocComment().
7772 2004-12-01 Miguel de Icaza <miguel@ximian.com>
7774 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
7775 unwrapping the enumeration values, chain to
7776 DoConstantNumericPromotions again, so we can promote things to the
7777 fundamental types (takes care of enums that are bytes, sbytes).
7781 2004-12-01 Raja R Harinath <rharinath@novell.com>
7783 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
7784 Fix long-standing bug in type-lookup. Use FindType instead of
7785 LookupType when ec.ResolvingTypeTree.
7786 (Attribute.ResolveType, Attribute.Resolve)
7787 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
7789 (Attributes.Search): Remove internal version. Update.
7790 (Attributes.SearchMulti): Update.
7791 (Attributes.GetClsCompliantAttribute): Remove.
7792 (Attributes.GetIndexerNameAttribute): Remove.
7793 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
7794 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
7795 * class.cs (Indexer.Define): Likewise.
7797 2004-12-01 Marek Safar <marek.safar@seznam.cz>
7800 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
7801 MarshallByReference members access.
7803 * expression.cs: Use CheckMarshallByRefAccess;
7804 Better error CS0197 message.
7806 * report.cs: Print whole related error message.
7808 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7810 * class (GetClassBases): Better error 60 report.
7811 (EventProperty): Disabled warning 67 detection.
7813 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7816 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
7818 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
7821 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7824 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
7826 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
7828 2004-11-26 Miguel de Icaza <miguel@ximian.com>
7830 * attribute.cs (Attribute.Resolve): Refine error reporting and
7831 report a cs0117 if the identifier does not exist, to distinguish
7832 from 0617 which is a miss-use of the actual identifier.
7834 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
7835 between cs0070 and cs0079.
7837 * class.cs (MemberBase.DoDefine): When reporting a wrong
7838 accessibility level, we use MethodCore to compare instead of
7839 Method (this was a regression in some refactoring effort).
7841 So now we correctly report cs0056 again.
7843 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
7844 testing the target_type (which was known to be object_type) and
7845 not the source type (which is anonymous_method).
7847 Fixed reporting of error cs1660.
7849 * expression.cs (UserCast.Source): Expose the underlying cast.
7851 * statement.cs (Switch.SwitchGoverningType): Sort the list of
7852 allowed types to find a match to int32 first (most common).
7854 In addition, it ignores any ImplicitUserConversions that did an
7855 internal implicit conversion (as the switch statement allows only
7856 one integral conversion to exist).
7858 * class.cs (PartialContainer.Create): rename `name' to
7859 `member_name' for clarity. Then replace the string calls with a
7860 call to MemberName.GetPartialName, as now using
7861 MemberName.ToString is an error (this is due to the side effects
7862 it had, that were fixed in the past).
7864 This will restore the error reporting on a number of partial class
7865 errors that were missusing this (and getting an exception as a
7866 results, which is now just a plain textual warning, because
7867 yyparse debug output would crash otherwise).
7869 2004-11-26 Raja R Harinath <rharinath@novell.com>
7871 * Makefile (PROGRAM_INSTALL_DIR): Remove.
7873 2004-11-25 Ben Maurer <bmaurer@ximian.com>
7875 * rootcontext.cs (LookupType): Make sure to cache lookups that
7876 don't give us a negative result. This saves about 5% of corlib
7879 2004-11-25 Miguel de Icaza <miguel@ximian.com>
7881 * report.cs (AbstractMessage.Print): messages are sent to stderr
7883 * class.cs (TypeContainer.GetClassBases): It is an error to have a
7884 non-interface in the list of interfaces (at this point, either
7885 parent was properly set, or a base class is being listed in the
7886 interfaces section).
7888 This flags error 1722, and resolves the crash from bug 69259.
7890 2004-11-25 Ben Maurer <bmaurer@ximian.com>
7892 * statement.cs (Using.EmitExpressionFinally): make this work right
7893 for valuetypes. Fixes 69926.
7895 2004-11-25 Miguel de Icaza <miguel@ximian.com>
7897 * const.cs (Const.ChangeType): Cope with the "0 literal can be
7898 converted to an enum" here, before we try to change the underlying
7899 type. This code exists, but it is a different code path than the
7900 one used while encoding constants.
7902 (ImplicitReferenceConversionExists): In addition, resynchronized
7903 the code here, so it matches the same code in
7904 ImplicitReferenceConversionExists for the `from any class-type S
7905 to any interface-type T'.
7907 2004-11-25 Marek Safar <marek.safar@seznam.cz>
7909 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
7911 2004-11-24 Miguel de Icaza <miguel@ximian.com>
7913 * cs-parser.jay: Use verbosity accordingly.
7915 2004-11-24 Marek Safar <marek.safar@seznam.cz>
7917 * expression.cs (Unary.ResolveOperator): Do not report warning;
7918 AddressOf reads from variable.
7920 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
7922 2004-11-24 Marek Safar <marek.safar@seznam.cz>
7926 * attribute.cs (Attributable): Removed CheckTargets.
7927 (Attributes.Emit): Explicit attribute targets are tested here.
7929 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
7930 not enabled for interfaces.
7932 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
7933 (GetAssemblyName): Ouch next bug there.
7935 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7937 * expression.cs: Error 275 added.
7939 2004-11-23 Marek Safar <marek.safar@seznam.cz>
7941 Fix bug #69177 (Implemented decimal constant support)
7943 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
7944 (BinaryFold): Add DecimalConstant.
7946 * const.cs (Define): Decimal constant
7948 (ChangeType): Add decimal type handling.
7949 (LookupConstantValue): Don't set value for decimal type but
7950 emit DecimalConstantAttribute. Needed for constant optimization.
7952 * constant.cs (ToDecimal): New method.
7953 (ConvertToDecimal): New method.
7954 (IntConstant): Implemented ConvertToDecimal.
7955 (DecimalConstant.Emit): Emit optimized version for decimals in
7958 * expression.cs (ResolveOperator): Changed order of constant
7959 reduction to work correctly with native types which have
7960 overloaded operators.
7961 (ResolveMemberAccess): Extract constant value from attribute
7964 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
7966 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
7967 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
7968 (ChangeType): Decimal is special.
7969 (TypeToCoreType): Add decimal type.
7971 2004-11-22 Marek Safar <marek.safar@seznam.cz>
7973 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
7976 2004-11-22 Marek Safar <marek.safar@seznam.cz>
7978 * class.cs (EventField.ApplyAttributeBuilder): Fix error
7981 2004-11-19 Marek Safar <marek.safar@seznam.cz>
7983 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
7985 * pending.cs (PendingImplementation): Grab only interfaces.
7987 2004-11-19 Marek Safar <marek.safar@seznam.cz>
7989 * statement.cs (ForeachHelperMethods): Add location member and
7990 error 202 detection.
7992 2004-11-18 Marek Safar <marek.safar@seznam.cz>
7994 * expression.cs (DoResolveBase): Fixed wrong warning for out
7997 2004-12-04 Martin Baulig <martin@ximian.com>
7999 * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
8000 to check whether the conversion is ok.
8002 * typemanager.cs (TypeManager.GetTypeArguments): Just return
8003 `Type.EmptyTypes' if we're not a generic TypeContainer.
8005 2004-11-25 Miguel de Icaza <miguel@ximian.com>
8007 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
8008 old bug: when converting from the null literal to a pointer,
8009 return an EmptyCast, not the NullLiteral.
8011 This fixes #69921, the recent null_type changes probably made this
8014 2004-12-03 Martin Baulig <martin@ximian.com>
8016 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8017 method as our child, call AnonymousMethod.Compatible() on it.
8019 2004-12-02 Miguel de Icaza <miguel@ximian.com>
8021 * class.cs (FieldBase): Use an unused bit field from the field to
8022 encode the `has_offset' property from the FieldMember. This saves
8023 a couple of Ks on bootstrap compilation.
8025 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8026 method as our child, return the AnonymousMethod resolved
8029 * expression.cs (New.DoResolve): Allow return values from
8030 NewDelegate to also include AnonymousMethods.
8034 2004-11-29 Raja R Harinath <rharinath@novell.com>
8036 * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
8038 * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
8039 System.Runtime.InteropServices._Exception, since it's a base
8040 interface of the core type System.Exception in the net_2_0 profile.
8042 2004-11-27 Martin Baulig <martin@ximian.com>
8044 * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
8046 2004-11-26 Raja R Harinath <rharinath@novell.com>
8048 * Makefile: Convert to use executable.make.
8049 * gmcs.exe.sources: New.
8051 2004-11-25 Martin Baulig <martin@ximian.com>
8053 * expression.cs (Invocation.InferType): Added support for byref types.
8055 2004-11-25 Martin Baulig <martin@ximian.com>
8057 * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
8058 in TypeManager.TypeToCoreType().
8060 2004-11-25 Martin Baulig <martin@ximian.com>
8062 * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
8063 "Dispose" method from the `current_type'.
8064 (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
8065 DoDefineMembers() instead of using the MethodBuilder; this is
8066 required for generic iterators.
8068 * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
8070 2004-11-24 Martin Baulig <martin@ximian.com>
8072 * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
8074 2004-11-20 Martin Baulig <martin@ximian.com>
8076 * expression.cs (Invocation.InferType): Correctly infer generic
8077 instances; see gen-103.cs.
8078 (Invocation.InferTypeArguments): If a generic method doesn't have
8079 any unbound type parameters, we don't need to infer anything.
8081 2004-11-19 Raja R Harinath <rharinath@novell.com>
8083 * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
8085 2004-11-17 Raja R Harinath <rharinath@novell.com>
8087 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
8088 (TypeHandle.GetMemberCache): New.
8089 (TypeHandle.TypeHandle): Update.
8090 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
8091 (TypeManager.LookupParentInterfacesCache):
8092 Rename from LookupInterfaceCache. Optimize slightly.
8093 (TypeManager.MemberLookup_FindMembers): Update.
8094 * decl.cs (MemberCache.MemberCache): Set Container to null in the
8096 (AddCacheContents): Rename from AddHashtable.
8097 * class.cs (TypeContainer.parent_container): Remove.
8098 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
8099 (TypeContainer.DoDefineMembers): Don't initialize it.
8100 Update to name changes.
8102 2004-11-17 Miguel de Icaza <miguel@ximian.com>
8104 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
8105 that factors the code to check access modifiers on override.
8107 (PropertyBase): Use the code here.
8109 Patch from Lluis S'anchez, fixes bug #69361.
8111 2004-11-15 Miguel de Icaza <miguel@ximian.com>
8113 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
8114 routine that is used to report the use of a captured variable
8115 whose address has been taken.
8117 There are two checks: one when variables are being captured and
8118 the other check is when the address of a variable is taken.
8120 (because an anonymous methods might be resolved before *or* after
8121 the address has been taken) and
8123 * expression.cs (Conditional.DoResolve): Remove the special
8124 casing that Martin added to trueExpr and falseExpr being both
8125 NullLiteral. We get the right behavior now just by introducing
8126 the null_type into the compiler.
8128 * convert.cs (ExplicitConversion): Change the code to use
8129 null_type instead of testing `expr is NullLiteral'.
8130 (ImplicitConversionStandard): use null_type too.
8131 (ImplicitReferenceConversionExists): use null_type too.
8132 (ImplicitReferenceConversion): use null_type too.
8134 * literal.cs: The type of `NullLiteral' is now null_type instead
8136 (Resolve): Set the type here.
8138 * typemanager.cs: Introduce null_type.
8140 2004-11-18 Martin Baulig <martin@ximian.com>
8143 (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
8145 2004-11-18 Martin Baulig <martin@ximian.com>
8147 * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
8149 2004-11-18 Martin Baulig <martin@ximian.com>
8151 * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
8152 of a `DeclSpace'. If one of our constraints is a `ConstructedType',
8153 call ResolveConstructedType() on it to resolve it without checking
8155 (Constraints.ResolveTypes): Check them here.
8156 (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
8157 but don't check constraints.
8158 (ConstructedType.ResolveAsTypeTerminal): Override this and also
8159 check constraints here.
8160 (ConstructedType.ResolveConstructedType): New public method. This
8161 is called from DoResolveAsTypeStep() and Constraints.Resolve() to
8162 resolve ourselves without checking constraints.
8164 * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
8166 2004-11-18 Martin Baulig <martin@ximian.com>
8169 (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
8171 * delegate.cs (Delegate.DefineType): Always create the EmitContext.
8173 2004-11-18 Martin Baulig <martin@ximian.com>
8175 * ecore.cs (TypeExpr.ResolveType): Removed.
8176 (Expression.ResolveAsTypeTerminal): We always return a fully
8177 resolved `TypeExpr', so we can just access its `Type'.
8179 * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
8181 2004-11-17 Martin Baulig <martin@ximian.com>
8183 * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
8184 sure we don't return any unresolved TypeExpr's.
8185 (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
8187 (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
8189 * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
8190 unresolved `ConstructedType's.
8192 2004-11-17 Martin Baulig <martin@ximian.com>
8194 * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
8196 2004-11-17 Martin Baulig <martin@ximian.com>
8199 (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
8201 * decl.cs (DeclSpace.ResolveType): Removed.
8202 (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
8204 2004-11-17 Martin Baulig <martin@ximian.com>
8206 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
8207 direction, like FindMembers() does. Fixes #69546, testcase is in
8210 2004-11-16 Martin Baulig <martin@ximian.com>
8212 This is based on a patch from Marek Safar, see bug #69082.
8213 Fixes bugs #63705 and #67130.
8215 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
8216 method; create a MemberCache for an interface type and cache the
8219 * decl.cs (IMemberContainer.ParentContainer): Removed.
8220 (IMemberContainer.ParentCache): New property.
8221 (MemberCache.SetupCacheForInterface): Removed.
8222 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
8223 to create a cache for an interface's "parent".
8225 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
8228 2004-11-14 Ben Maurer <bmaurer@ximian.com>
8230 * statement.cs: Avoid adding bools to a hashtable.
8232 2004-11-15 Martin Baulig <martin@ximian.com>
8234 * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
8236 2004-11-11 Martin Baulig <martin@ximian.com>
8238 * typemanager.cs (TypeManager.GetMethodName): New method.
8240 * class.cs (MethodData.Define): Include the generic arity in the
8241 name of an explicit interface; also add it to the method name.
8243 * pending.cs (PendingImplementation.InterfaceMethod): The method
8244 name now includes the generic arity.
8246 2004-11-07 Miguel de Icaza <miguel@ximian.com>
8248 * expression.cs (Invocation.OverloadResolve): Flag error if we are
8249 calling an unsafe method from a safe location.
8251 2004-11-06 Marek Safar <marek.safar@seznam.cz>
8254 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
8256 2004-11-06 Miguel de Icaza <miguel@ximian.com>
8258 * namespace.cs (VerifyUsing): use GetPartialName instead of
8261 2004-11-05 Miguel de Icaza <miguel@ximian.com>
8263 * statement.cs (Return.Resolve): Fix regression in typo: if
8264 `in_exc', we have to request a NeedReturnLabel, this was a typo
8265 introduced in the anonymous method check-in. Fixes #69131.
8267 * Indexers were using the ShortName when defining themselves,
8268 causing a regression in the compiler bootstrap when applying the
8269 patch from 2004-11-02 (first part), now they use their full name
8270 and the bug is gone.
8272 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
8274 * driver.cs: Strip the path from the names of embedded resources. Fixes
8277 2004-11-04 Raja R Harinath <rharinath@novell.com>
8279 Fix error message regression: cs0104-2.cs.
8280 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
8281 (AliasEntry.Resolve): Update.
8282 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
8284 (RootContext.LookupType): Update.
8286 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
8288 * cs-parser.jay: Add support for handling accessor modifiers
8289 * class: Add support port accessor modifiers and error checking,
8290 define PropertyMethod.Define as virtual (not abstract anymore)
8291 * ecore.cs: Add checking for proeprties access with access modifiers
8292 * iterators.cs: Modify Accessor constructor call based in the modified
8294 2004-11-02 Ben Maurer <bmaurer@ximian.com>
8296 * expression.cs (StringConcat): Handle being called twice,
8297 as when we have a concat in a field init with more than two
8300 2004-11-02 Miguel de Icaza <miguel@ximian.com>
8302 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
8303 special case explicit implementations, we should always produce
8304 the .property or .event declaration.
8306 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
8307 since it will not return correct data if people use this
8308 unresolved in the presence of using statements (see test-313).
8310 * class.cs (MethodData.Define): If we are an explicit interface
8311 implementation, set the method name to the full name of the
8312 interface plus the name of the method.
8314 Notice that using the method.MethodName.GetFullName() does not
8315 work, as it will only contain the name as declared on the source
8316 file (it can be a shorthand in the presence of using statements)
8317 and not the fully qualifed type name, for example:
8321 class D : ICloneable {
8322 object ICloneable.Clone () {
8326 Would produce a method called `ICloneable.Clone' instead of
8327 `System.ICloneable.Clone'.
8329 * namespace.cs (Alias.Resolve): Use GetPartialName.
8331 2004-11-01 Marek Safar <marek.safar@seznam.cz>
8333 * cs-parser.jay: Add error 1055 report.
8335 2004-11-01 Miguel de Icaza <miguel@ximian.com>
8337 * assign.cs (Assign.DoResolve): Only do the transform of
8338 assignment into a New if the types are compatible, if not, fall
8339 through and let the implicit code deal with the errors and with
8340 the necessary conversions.
8342 2004-11-01 Marek Safar <marek.safar@seznam.cz>
8344 * cs-parser.jay: Add error 1031 report.
8346 * cs-tokenizer.cs: Add location for error 1038.
8348 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8350 * cs-parser.jay: Add error 1016 report.
8352 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8354 * cs-parser.jay: Add errors 1575,1611 report.
8356 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8358 * cs-parser.jay: Add error 1001 report.
8360 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8363 * attribute.cs (GetMarshal): Add method argument for
8364 caller identification.
8366 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
8367 agument for GetMarshal and RuntimeMissingSupport.
8369 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8371 * attribute.cs (ExtractSecurityPermissionSet): Removed
8372 TypeManager.code_access_permission_type.
8374 * typemanager.cs: Removed TypeManager.code_access_permission_type.
8376 2004-10-27 Miguel de Icaza <miguel@ximian.com>
8378 * expression.cs (LocalVariableReference.DoResolveLValue): Check
8379 for obsolete use of a variable here. Fixes regression on errors
8380 cs0619-25 and cs0619-26.
8382 2004-10-27 Marek Safar <marek.safar@seznam.cz>
8384 Fix #62358, implemented security attribute encoding.
8386 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
8387 Tests permitted SecurityAction for assembly or other types.
8388 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
8389 data from SecurityPermissionAttribute to PermisionSet class.
8391 * class.cs (ApplyAttributeBuilder): Added special handling
8392 for System.Security.Permissions.SecurityAttribute based types.
8394 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
8395 special handling for System.Security.Permissions.SecurityAttribute
8398 * enum.cs (ApplyAttributeBuilder): Added special handling
8399 for System.Security.Permissions.SecurityAttribute based types.
8401 * parameter.cs (ApplyAttributeBuilder): Added special handling
8402 for System.Security.Permissions.SecurityAttribute based types.
8404 * rootcontext.cs: Next 2 core types.
8406 * typemanager.cs (TypeManager.security_permission_attr_type):
8407 Built in type for the SecurityPermission Attribute.
8408 (code_access_permission_type): Build in type.
8410 2004-10-17 Miguel de Icaza <miguel@ximian.com>
8412 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
8413 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
8414 all of this information into
8415 EmitContext.EmitCapturedVariableInstance.
8417 * codegen.cs (EmitCapturedVariableInstance): move here the
8418 funcionality of emitting an ldarg.0 in the presence of a
8419 remapping. This centralizes the instance emit code.
8421 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
8422 then emit a load of this: it means that we have reached the
8423 topmost ScopeInfo: the one that contains the pointer to the
8424 instance of the class hosting the anonymous method.
8426 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
8427 captures to the topmost CaptureContext.
8429 2004-10-12 Miguel de Icaza <miguel@ximian.com>
8431 * expression.cs (LocalVariableReference): Move the knowledge about
8432 the iterators into codegen's EmitCapturedVariableInstance.
8434 2004-10-11 Miguel de Icaza <miguel@ximian.com>
8436 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
8437 all code paths return a value from an anonymous method (it is the
8438 same as the 161 error, but for anonymous methods).
8440 2004-10-08 Miguel de Icaza <miguel@ximian.com>
8442 The introduction of anonymous methods in the compiler changed
8443 various ways of doing things in the compiler. The most
8444 significant one is the hard split between the resolution phase
8445 and the emission phases of the compiler.
8447 For instance, routines that referenced local variables no
8448 longer can safely create temporary variables during the
8449 resolution phase: they must do so from the emission phase,
8450 since the variable might have been "captured", hence access to
8451 it can not be done with the local-variable operations from the runtime.
8455 (Block.Flags): New flag `IsTopLevel' to indicate that this block
8456 is a toplevel block.
8458 (ToplevelBlock): A new kind of Block, these are the blocks that
8459 are created by the parser for all toplevel method bodies. These
8460 include methods, accessors and anonymous methods.
8462 These contain some extra information not found in regular blocks:
8463 A pointer to an optional CaptureContext (for tracking captured
8464 local variables and parameters). A pointer to the parent
8467 (Return.Resolve): Catch missmatches when returning a value from an
8468 anonymous method (error 1662).
8469 Invoke NeedReturnLabel from the Resolve phase instead of the emit
8472 (Break.Resolve): ditto.
8474 (SwitchLabel): instead of defining the labels during the
8475 resolution phase, we now turned the public ILLabel and ILLabelCode
8476 labels into methods called GetILLabelCode() and GetILLabel() that
8477 only define the label during the Emit phase.
8479 (GotoCase): Track the SwitchLabel instead of the computed label
8480 (its contained therein). Emit the code by using
8481 SwitchLabel.GetILLabelCode ().
8483 (LocalInfo.Flags.Captured): A new flag has been introduce to track
8484 whether the Local has been captured or not.
8486 (LocalInfo.IsCaptured): New property, used to tell whether the
8487 local has been captured.
8489 * anonymous.cs: Vastly updated to contain the anonymous method
8492 The main classes here are: CaptureContext which tracks any
8493 captured information for a toplevel block and ScopeInfo used to
8494 track the activation frames for various local variables.
8496 Each toplevel block has an optional capture context associated
8497 with it. When a method contains an anonymous method both the
8498 toplevel method and the anonymous method will create a capture
8499 context. When variables or parameters are captured, they are
8500 recorded on the CaptureContext that owns them, for example:
8504 MyDelegate d = delegate {
8509 Here `a' will be recorded as captured on the toplevel
8510 CapturedContext, the inner captured context will not have anything
8511 (it will only have data if local variables or parameters from it
8512 are captured in a nested anonymous method.
8514 The ScopeInfo is used to track the activation frames for local
8515 variables, for example:
8517 for (int i = 0; i < 10; i++)
8518 for (int j = 0; j < 10; j++){
8519 MyDelegate d = delegate {
8524 At runtime this captures a single captured variable `i', but it
8525 captures 10 different versions of the variable `j'. The variable
8526 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
8527 recorded on a child.
8529 The toplevel ScopeInfo will also track information like the `this'
8530 pointer if instance variables were referenced (this is necessary
8531 as the anonymous method lives inside a nested class in the host
8532 type of the method).
8534 (AnonymousMethod): Expanded to track the Toplevel, implement
8535 `AnonymousMethod.Compatible' to tell whether an anonymous method
8536 can be converted to a target delegate type.
8538 The routine now also produces the anonymous method content
8540 (AnonymousDelegate): A helper class that derives from
8541 DelegateCreation, this is used to generate the code necessary to
8542 produce the delegate for the anonymous method that was created.
8544 * assign.cs: API adjustments for new changes in
8545 Convert.ImplicitStandardConversionExists.
8547 * class.cs: Adjustments to cope with the fact that now toplevel
8548 blocks are of type `ToplevelBlock'.
8550 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
8551 insteda of standard blocks.
8553 Flag errors if params arguments are passed to anonymous methods.
8555 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
8556 `CurrentAnonymousMethod' which points to the current Anonymous
8557 Method. The variable points to the AnonymousMethod class that
8558 holds the code being compiled. It is set in the new EmitContext
8559 created for the anonymous method.
8561 (EmitContext.Phase): Introduce a variable and an enumeration to
8562 assist in enforcing some rules about when and where we are allowed
8563 to invoke certain methods (EmitContext.NeedsReturnLabel is the
8564 only one that enfonces this right now).
8566 (EmitContext.HaveCaptureInfo): new helper method that returns
8567 whether we have a CapturedContext initialized.
8569 (EmitContext.CaptureVariable): New method used to register that a
8570 LocalInfo must be flagged for capturing.
8572 (EmitContext.CapturedParameter): New method used to register that a
8573 parameters must be flagged for capturing.
8575 (EmitContext.CapturedField): New method used to register that a
8576 field must be flagged for capturing.
8578 (EmitContext.HaveCapturedVariables,
8579 EmitContext.HaveCapturedFields): Return whether there are captured
8580 variables or fields.
8582 (EmitContext.EmitMethodHostInstance): This is used to emit the
8583 instance for the anonymous method. The instance might be null
8584 (static methods), this (for anonymous methods that capture nothing
8585 and happen to live side-by-side with the current method body) or a
8586 more complicated expression if the method has a CaptureContext.
8588 (EmitContext.EmitTopBlock): Routine that drives the emission of
8589 code: it will first resolve the top block, then emit any metadata
8590 and then emit the code. The split is done so that we can extract
8591 any anonymous methods and flag any captured variables/parameters.
8593 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
8594 during this phase, the ILGenerator should not be used as labels
8595 and local variables declared here might not be accessible to any
8596 code that is part of an anonymous method.
8598 Exceptions to this include the temporary variables that are
8599 created by some statements internally for holding temporary
8602 (EmitContext.EmitMeta): New routine, in charge of emitting all the
8605 (EmitContext.TemporaryReturn): This method is typically called
8606 from the Emit phase, and its the only place where we allow the
8607 ReturnLabel to be defined other than the EmitMeta. The reason is
8608 that otherwise we would have to duplicate a lot of logic in the
8609 Resolve phases of various methods that today is on the Emit
8612 (EmitContext.NeedReturnLabel): This no longer creates the label,
8613 as the ILGenerator is not valid during the resolve phase.
8615 (EmitContext.EmitThis): Extended the knowledge in this class to
8616 work in anonymous methods in addition to iterators.
8618 (EmitContext.EmitCapturedVariableInstance): This emits whatever
8619 code is necessary on the stack to access the instance to a local
8620 variable (the variable will be accessed as a field).
8622 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
8623 EmitContext.EmitAddressOfParameter): Routines to support
8624 parameters (not completed at this point).
8626 Removals: Removed RemapLocal and RemapLocalLValue. We probably
8627 will also remove the parameters.
8629 * convert.cs (Convert): Define a `ConstantEC' which points to a
8630 null. This is just to prefity some code that uses
8631 ImplicitStandardConversion code and do not have an EmitContext
8634 The idea is to flag explicitly that at that point in time, it is
8635 known that the conversion will not trigger the delegate checking
8636 code in implicit conversions (which requires a valid
8639 Everywhere: pass new EmitContext parameter since
8640 ImplicitStandardConversionExists now requires it to check for
8641 anonymous method conversions.
8643 (Convert.ImplicitStandardConversionExists): If the type of an
8644 expression is the anonymous_method_type, and the type is a
8645 delegate, we invoke the AnonymousMethod.Compatible method to check
8646 whether an implicit conversion is possible.
8648 (Convert.ImplicitConversionStandard): Only do implicit method
8649 group conversions if the language level is not ISO_1.
8651 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
8652 MethodInfo for the Invoke method. used by Delegate and
8655 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
8656 method conversions if the target type is a delegate.
8658 Removed extra debugging nops.
8660 (LocalVariableReference): Turn the `local_info' into a public
8663 Add `prepared' field, the same hack used for FieldExprs to cope
8664 with composed assignments, as Local variables do not necessarily
8665 operate purely on the stack as they used to: they can be captured
8668 Add `temp' for a temporary result, like fields.
8670 Refactor DoResolve and DoResolveLValue into DoResolveBase.
8672 It now copes with Local variables that are captured and emits the
8673 proper instance variable to load it from a field in the captured
8676 (ParameterReference.DoResolveBase): During the resolve phase,
8677 capture parameters if we are in an anonymous method.
8679 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
8680 anonymous method, use the EmitContext helper routines to emit the
8681 parameter reference.
8683 * iterators.cs: Set RemapToProxy to true/false during the
8686 * parameters.cs (GetParameterByName): New helper method.
8688 * typemanager.cs (anonymous_method_type) a new type that
8689 represents an anonyous method. This is always an internal type,
8690 used as a fencepost to test against the anonymous-methodness of an
8693 2004-10-20 Marek Safar <marek.safar@seznam.cz>
8695 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
8697 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
8699 2004-11-10 Martin Baulig <martin@ximian.com>
8701 * expression.cs (Invocation.BetterFunction): If two methods have
8702 equal parameter types, but only one of them is generic, the
8703 non-generic one wins.
8704 (New.DoResolve): Don't set `is_struct' to false if we're a generic
8705 instance; just use `Type.IsValueType' to determine whether
8706 something is a struct or not.
8707 (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
8708 so we can be called multiple times.
8710 2004-11-10 Martin Baulig <martin@ximian.com>
8712 * generic.cs (TypeParameter.DefineConstraints): New public method.
8713 (TypeParameter.CheckAccessLevel): Override this and return true.
8714 (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
8715 override ResolveType() anymore.
8716 (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
8718 2004-11-10 Martin Baulig <martin@ximian.com>
8720 * rootcontext.cs (RootContext.LookupType): If we're a nested type,
8721 call DeclSpace.ResolveNestedType() on it.
8723 2004-11-10 Martin Baulig <martin@ximian.com>
8725 * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
8726 non-null, call ParameterModifier() on it.
8728 2004-11-10 Martin Baulig <martin@ximian.com>
8731 (Iterators): Added `current_type' and `this_type' fields.
8732 (Iterators.DefineIterator): Create a new EmitContext and store it
8733 in `ec'; compute `this_type'.
8735 2004-11-10 Martin Baulig <martin@ximian.com>
8738 (TypeManager.IsPrivateAccessible): New public method.
8739 (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
8741 2004-11-10 Martin Baulig <martin@ximian.com>
8743 * class.cs (TypeContainer.DefineType): Call
8744 TypeBuilder.DefineGenericParameters() before resolving the type
8746 (MethodData.parent_method): New protected field.
8747 (MethodData..ctor): Added `MethodInfo parent_method' argument.
8748 (MethodData.Define): Compute `parent_method'.
8751 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
8752 (MemberCore.GetClsCompliantAttributeValue): Likewise.
8753 (DeclSpace.ec): New protected field; store the EmitContext here.
8754 (DeclSpace.EmitContext): New public property.
8755 (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
8756 (DeclSpace.ResolveNestedType): New public method.
8757 (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
8758 (DeclSpace.NestedAccessible): Added `Type tb' argument.
8759 (DeclSpace.FamilyAccessible): Likewise.
8760 (DeclSpace.FindType): Call ResolveNestedType() for nested types.
8761 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
8764 * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
8767 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
8768 (Enum.Emit): Don't create a new EmitContext.
8770 2004-10-18 Martin Baulig <martin@ximian.com>
8772 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
8773 `Type' directly, but call ResolveType() on it.
8774 (Catch.Resolve): Likewise.
8775 (Foreach.Resolve): Likewise.
8777 2004-10-18 Martin Baulig <martin@ximian.com>
8779 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
8780 `Type' directly, but call ResolveType() on it.
8781 (Probe.DoResolve): Likewise.
8782 (ArrayCreation.LookupType): Likewise.
8783 (TypeOf.DoResolve): Likewise.
8784 (SizeOf.DoResolve): Likewise.
8786 2004-10-18 Raja R Harinath <rharinath@novell.com>
8788 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
8791 2004-10-17 John Luke <john.luke@gmail.com>
8793 * class.cs (Operator.GetSignatureForError): use CSharpName
8795 * parameter.cs (Parameter.GetSignatureForError): Returns
8796 correct name even if was not defined.
8798 2004-10-13 Raja R Harinath <rharinath@novell.com>
8801 * class.cs (TypeContainer.EmitContext): New property.
8802 (DefineNestedTypes): Create an emitcontext for each part.
8803 (MethodCore.DoDefineParameters): Use container's emitcontext.
8804 Pass type array to InternalParameters.
8805 (MemberBase.DoDefine): Use container's emitcontext.
8806 (FieldMember.Define): Likewise.
8807 (Event.Define): Likewise.
8808 (SetMethod.GetParameterInfo): Change argument to EmitContext.
8809 Pass type array to InternalParameters.
8810 (SetIndexerMethod.GetParameterInfo): Likewise.
8811 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8812 * delegate.cs (Define): Pass emitcontext to
8813 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
8814 array to InternalParameters.
8815 * expression.cs (ParameterReference.DoResolveBase): Pass
8816 emitcontext to GetParameterInfo.
8817 (ComposedCast.DoResolveAsTypeStep): Remove check on
8818 ec.ResolvingTypeTree.
8819 * parameter.cs (Parameter.Resolve): Change argument to
8820 EmitContext. Use ResolveAsTypeTerminal.
8821 (Parameter.GetSignature): Change argument to EmitContext.
8822 (Parameters.ComputeSignature): Likewise.
8823 (Parameters.ComputeParameterTypes): Likewise.
8824 (Parameters.GetParameterInfo): Likewise.
8825 (Parameters.ComputeAndDefineParameterTypes): Likewise.
8826 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
8827 * support.cs (InternalParameters..ctor): Remove variant that takes
8829 * typemanager.cs (system_intptr_expr): New.
8830 (InitExpressionTypes): Initialize it.
8832 2004-10-12 Chris Toshok <toshok@ximian.com>
8834 * cs-parser.jay: fix location for try_statement and catch_clause.
8836 2004-10-18 Martin Baulig <martin@ximian.com>
8838 * class.cs (FieldMember.Define): Don't access the TypeExpr's
8839 `Type' directly, but call ResolveType() on it.
8840 (MemberBase.DoDefine): Likewise.
8842 * expression.cs (New.DoResolve): Don't access the TypeExpr's
8843 `Type' directly, but call ResolveType() on it.
8844 (ComposedCast.DoResolveAsTypeStep): Likewise.
8846 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
8847 `Type' directly, but call ResolveType() on it.
8849 2004-10-17 John Luke <john.luke@gmail.com>
8851 * class.cs (Operator.GetSignatureForError): use CSharpName
8853 * parameter.cs (Parameter.GetSignatureForError): Returns
8854 correct name even if was not defined.
8856 2004-10-13 Raja R Harinath <rharinath@novell.com>
8859 * class.cs (TypeContainer.EmitContext): New property.
8860 (DefineNestedTypes): Create an emitcontext for each part.
8861 (MethodCore.DoDefineParameters): Use container's emitcontext.
8862 Pass type array to InternalParameters.
8863 (MemberBase.DoDefine): Use container's emitcontext.
8864 (FieldMember.Define): Likewise.
8865 (Event.Define): Likewise.
8866 (SetMethod.GetParameterInfo): Change argument to EmitContext.
8867 Pass type array to InternalParameters.
8868 (SetIndexerMethod.GetParameterInfo): Likewise.
8869 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8870 * delegate.cs (Define): Pass emitcontext to
8871 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
8872 array to InternalParameters.
8873 * expression.cs (ParameterReference.DoResolveBase): Pass
8874 emitcontext to GetParameterInfo.
8875 (ComposedCast.DoResolveAsTypeStep): Remove check on
8876 ec.ResolvingTypeTree.
8877 * parameter.cs (Parameter.Resolve): Change argument to
8878 EmitContext. Use ResolveAsTypeTerminal.
8879 (Parameter.GetSignature): Change argument to EmitContext.
8880 (Parameters.ComputeSignature): Likewise.
8881 (Parameters.ComputeParameterTypes): Likewise.
8882 (Parameters.GetParameterInfo): Likewise.
8883 (Parameters.ComputeAndDefineParameterTypes): Likewise.
8884 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
8885 * support.cs (InternalParameters..ctor): Remove variant that takes
8887 * typemanager.cs (system_intptr_expr): New.
8888 (InitExpressionTypes): Initialize it.
8890 2004-10-12 Chris Toshok <toshok@ximian.com>
8892 * cs-parser.jay: fix location for try_statement and catch_clause.
8894 2004-10-07 Raja R Harinath <rharinath@novell.com>
8896 More DeclSpace.ResolveType avoidance.
8897 * decl.cs (MemberCore.InUnsafe): New property.
8898 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
8899 with newly created EmitContext.
8900 (FieldMember.Define): Likewise.
8901 * delegate.cs (Delegate.Define): Likewise.
8902 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
8903 only if normal name-lookup fails.
8904 (TypeExpr.DoResolve): Enable error-checking.
8905 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
8906 (SizeOf.DoResolve): Likewise.
8907 (ComposedCast.DoResolveAsTypeStep): Likewise.
8908 (StackAlloc.DoResolve): Likewise.
8909 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
8910 (Block.Unsafe): New property.
8911 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
8912 (Unsafe): Set 'unsafe' flag of contained block.
8913 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
8914 (Fixed.Resolve): Likewise.
8915 (Catch.Resolve): Likewise.
8916 (Using.ResolveLocalVariableDecls): Likewise.
8917 (Foreach.Resolve): Likewise.
8919 2004-10-05 John Luke <john.luke@gmail.com>
8921 * cs-parser.jay: add location to error CS0175
8923 2004-10-04 Miguel de Icaza <miguel@ximian.com>
8925 * ecore.cs (Expression.Constantity): Add support for turning null
8928 * const.cs (Const.Define): Allow constants to be reference types
8929 as long as the value is Null.
8931 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
8933 * namespace.cs (NamespaceEntry.Using): No matter which warning
8934 level is set, check if this namespace name has already been added.
8936 2004-10-03 Ben Maurer <bmaurer@ximian.com>
8938 * expression.cs: reftype [!=]= null should always use br[true,false].
8941 2004-10-03 Marek Safar <marek.safar@seznam.cz>
8944 * attribute.cs: Enum conversion moved to
8945 GetAttributeArgumentExpression to be applied to the all
8948 2004-10-01 Raja R Harinath <rharinath@novell.com>
8950 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
8951 * class.c (TypeContainer.DefineType): Flag error if
8952 base types aren't accessible due to access permissions.
8953 * decl.cs (DeclSpace.ResolveType): Move logic to
8954 Expression.ResolveAsTypeTerminal.
8955 (DeclSpace.ResolveTypeExpr): Thin layer over
8956 Expression.ResolveAsTypeTerminal.
8957 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
8958 Refactor code into NestedAccess. Use it.
8959 (DeclSpace.NestedAccess): New.
8960 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
8961 argument to silence errors. Check access permissions.
8962 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
8963 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
8964 (Cast.DoResolve): Likewise.
8965 (New.DoResolve): Likewise.
8966 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
8967 (TypeOf.DoResolve): Likewise.
8969 * expression.cs (Invocation.BetterConversion): Return the Type of
8970 the better conversion. Implement section 14.4.2.3 more faithfully.
8971 (Invocation.BetterFunction): Make boolean. Make correspondence to
8972 section 14.4.2.2 explicit.
8973 (Invocation.OverloadResolve): Update.
8974 (Invocation): Remove is_base field.
8975 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
8976 (Invocation.Emit): Likewise.
8978 2004-09-24 Marek Safar <marek.safar@seznam.cz>
8980 * cs-parser.jay: Reverted 642 warning fix.
8982 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8985 * decl.cs (FindMemberWithSameName): Indexer can have more than
8988 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8990 * expression.cs (LocalVariableReference.DoResolveLValue):
8991 Do not report warning 219 for out values.
8992 (EmptyExpression.Null): New member to avoid extra allocations.
8994 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8996 * cs-parser.jay: Fix wrong warning 642 report.
8998 * cs-tokenizer.cs (CheckNextToken): New helper;
8999 Inspect next character if is same as expected.
9001 2004-09-23 Martin Baulig <martin@ximian.com>
9003 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9004 (Convert.ImplicitReferenceConversionExists): Likewise.
9006 2004-11-09 Raja R Harinath <rharinath@novell.com>
9008 * Makefile (DISTFILES): Comment out a few missing files.
9010 2004-10-29 Raja R Harinath <rharinath@novell.com>
9012 * Makefile (bootstrap_libs,bootstrap_libfiles): New.
9013 (bootstrap-libs): New target. Invokes the net_2_0_bootstrap profile.
9014 (gmcs.exe): Invoke bootstrap-libs.
9015 (clean-local): Clean the net_2_0_bootstrap profile too.
9016 (PROGRAM_INSTALL_DIR): New.
9017 (install-local): Use it.
9019 2004-10-13 Martin Baulig <martin@ximian.com>
9021 * generic.cs (TypeManager.InflatedConstraints): New nested class.
9022 (TypeParameter.DefineType): If we're a method type parameter and
9023 that method is overriding something, "inflate" its constraints.
9025 2004-10-12 Martin Baulig <martin@ximian.com>
9027 * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
9028 and have type arguments, create and resolve a ConstructedType.
9030 2004-10-12 Martin Baulig <martin@ximian.com>
9032 * decl.cs (MemberCache.FindMemberToOverride): Use
9033 TypeManager.IsEqual() to compare the parameters and Type.Equals()
9034 to compare the invocationType.
9036 * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
9037 When comparing two type parameters, only do the signature-only
9038 comparision for method type parameters.
9040 2004-10-11 Martin Baulig <martin@ximian.com>
9042 * report.cs: Don't make --fatal abort on warnings, we have
9043 -warnaserror for that.
9045 2004-10-11 Martin Baulig <martin@ximian.com>
9048 (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
9049 (TypeManager.IsEqual): Call ourself recursively instead of using
9052 2004-10-11 Martin Baulig <martin@ximian.com>
9054 * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
9055 on our own type parameters, not on the ones we inherit from a containing
9058 * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
9061 * generic.cs (TypeParameter.Define): We may only be called once.
9063 * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
9064 instead of TypeManager.IsEqual().
9066 2004-09-28 Martin Baulig <martin@ximian.com>
9069 (GenericConstraints.EffectiveBaseClass): New public property.
9070 (TypeParameter.GenericConstraints): New public property.
9071 (ConstructedType.CheckConstraints): Improved.
9073 * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
9074 (Convert.TypeParameterConversion): New private method; use this in
9075 ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
9076 for all conversions related to type parameters.
9078 2004-09-24 Martin Baulig <martin@ximian.com>
9080 * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
9081 type parameter conversions for type parameters which are known to
9084 2004-09-24 Martin Baulig <martin@ximian.com>
9086 * generic.cs (GenericConstraints): Added `IsReferenceType' and
9087 `IsValueType' properties.
9089 * support.cs (ReflectionConstraints): Use
9090 Type.GetGenericParameterConstraints() instead of the old hack.
9092 2004-09-24 Martin Baulig <martin@ximian.com>
9094 * generic.cs (GenericConstraints): Moved here and made it an
9097 * support.cs (GenericConstraints): Moved to generic.cs.
9099 2004-09-24 Martin Baulig <martin@ximian.com>
9102 (ReflectionConstraints): Un-nested this class and made it public.
9105 (TypeManager.GetTypeParameterConstraints): New public method.
9106 (TypeManager.HasConstructorConstraint): Use the attributes.
9108 2004-09-24 Martin Baulig <martin@ximian.com>
9110 * support.cs (GenericConstraints): Replaced `HasConstructor',
9111 `IsReferenceType' and `IsValueType' with `Attributes'.
9112 (ReflectionParameters.ReflectionConstraints): Removed the Create()
9113 method and made the .ctor public.
9115 * generic.cs (Constraints.Attributes): New public property.
9116 (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
9117 `IsReferenceType' -> `HasReferenceTypeConstraint' and
9118 `IsValueType' -> `HasValueTypeConstraint'.
9120 2004-09-23 Martin Baulig <martin@ximian.com>
9122 * generic.cs (Constraints): Reflect latest runtime changes.
9124 2004-09-23 Martin Baulig <martin@ximian.com>
9126 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9127 (Convert.ImplicitReferenceConversionExists): Likewise.
9129 2004-09-23 Marek Safar <marek.safar@seznam.cz>
9131 * class.cs (Operator.Define): Add error 448 and 559 report.
9133 2004-09-22 Marek Safar <marek.safar@seznam.cz>
9135 * class.cs (MemberBase.IsTypePermitted): New protected
9136 method for checking error CS0610.
9138 2004-09-22 Marek Safar <marek.safar@seznam.cz>
9140 * class.cs (TypeContainer.HasExplicitLayout): New property
9141 Returns whether container has StructLayout attribute set Explicit.
9142 (FieldMember): New abstract class for consts and fields.
9143 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
9144 (Field): Reuse FieldMember.
9146 * const.cs (Const): Reuse FieldMember.
9148 * rootcontext.cs: EmitConstants call moved to class.
9150 2004-09-22 Martin Baulig <martin@ximian.com>
9152 Marek and me just fixed one of our oldest bugs: #28562 :-)
9154 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
9156 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
9157 we're an EnumConstant, just return that.
9158 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
9159 an EnumConstant. In this case, we need to use GetValueAsEnumType()
9160 to get the value which'll actually be written into the attribute.
9161 However, we have to use GetValue() to access the attribute's value
9164 2004-09-22 Marek Safar <marek.safar@seznam.cz>
9166 * constant.cs (Constant.IsNegative): New abstract property
9169 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
9170 (StackAlloc.DoResolve): Reused IsNegative.
9172 2004-09-22 Martin Baulig <martin@ximian.com>
9174 * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
9175 public method; like LookupTypeContainer, but also works for
9178 * report.cs (Report.SymbolRelatedToPreviousError): Use
9179 TypeManager.LookupGenericTypeContainer().
9181 2004-09-22 Martin Baulig <martin@ximian.com>
9183 Thanks to Peter Sestoft for this bug report.
9185 * expression.cs (Conditional): If both the `trueExpr' and the
9186 `falseExpr' is a NullLiteral, return a NullLiteral.
9188 2004-09-22 Martin Baulig <martin@ximian.com>
9190 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
9191 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
9192 for the "get_Current" call.
9194 2004-09-21 Martin Baulig <martin@ximian.com>
9196 * convert.cs (Convert.ImplicitReferenceConversion): When
9197 converting to an interface type, first check whether we're
9198 converting from a reference type.
9200 2004-09-14 Martin Baulig <martin@ximian.com>
9202 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
9204 2004-09-14 Marek Safar <marek.safar@seznam.cz>
9207 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
9208 called and is obsolete then this member suppress message
9209 when call is inside next [Obsolete] method or type.
9211 * expression.cs: Use TestObsoleteMethodUsage member.
9213 2004-09-14 Martin Baulig <martin@ximian.com>
9215 * genericparser.cs: Removed.
9217 2004-09-13 Marek Safar <marek.safar@seznam.cz>
9219 * class.cs (MethodCore.CheckBase): Fix bug #65757.
9221 2004-09-12 Marek Safar <marek.safar@seznam.cz>
9223 * attribute.cs (Attribute.Resolve): Add error 653 report.
9225 * class.cs (Class.ApplyAttributeBuilder): Add error 641
9227 (Method.ApplyAttributeBuilder): Add error 685 report.
9228 (Operator.Define): Add error 564 report.
9230 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
9232 * expression.cs (Invocation.DoResolve): Add error
9235 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
9238 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9240 * class.cs (ConstructorInitializer.Resolve):
9241 Wrong error number (515->516).
9243 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9245 * class.cs (Indexer.Define): Add error 631 report.
9247 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9249 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
9251 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9253 * expression.cs (Probe.DoResolve): Add error CS0241 report.
9255 2004-09-10 Marek Safar <marek.safar@seznam.cz>
9257 * cs-parser.jay: Added error CS0241 report.
9259 2004-09-10 Raja R Harinath <rharinath@novell.com>
9261 * cs-parser.jay (fixed_statement): Introduce a scope for the
9262 declaration in the 'fixed' statement.
9264 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9266 * cs-parser.jay: Added CS0230 error report.
9268 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9270 * cs-parser.jay: Added errors CS0231 and CS0257 report.
9272 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9274 * expression.cs (Argument.Resolve): Added error CS0192 and
9277 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9279 C# 2.0 #pragma warning feature
9281 * cs-tokenizer.cs (PreProcessPragma): New method;
9282 Handles #pragma directive.
9284 * report.cs (WarningRegions): New class; Support
9285 class for #pragma warning directive. It tests whether
9286 warning is enabled for a given line.
9288 2004-09-08 Miguel de Icaza <miguel@ximian.com>
9290 * const.cs: Add more descriptive error report, tahnks to
9293 2004-09-08 Marek Safar <marek.safar@seznam.cz>
9295 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
9297 2004-09-07 Miguel de Icaza <miguel@ximian.com>
9299 * expression.cs: Apply patch from Ben: Remove dead code from
9300 ArrayCreation, and remove the TurnintoConstant call in const.cs,
9301 as that code just threw an exception anwyays.
9303 * const.cs: Remove the call to the turnintoconstant, for details
9306 * literal.cs: The type of the null-literal is the null type; So
9307 we use a placeholder type (literal.cs:System.Null, defined here)
9310 * expression.cs (Conditional.DoResolve): Remove some old code that
9311 is no longer needed, conversions have been fixed.
9313 (ArrayCreationExpression.DoResolve): Return false if we fail to
9314 resolve the inner expression.
9316 2004-09-07 Raja R Harinath <rharinath@novell.com>
9319 * cs-parser.jay (delegate_declaration): Record a delegate
9320 declaration as a type declaration.
9321 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
9323 2004-09-06 Miguel de Icaza <miguel@ximian.com>
9325 * parameter.cs: Do not crash if the type can not be resolved.
9327 * expression.cs: Report errors with unsafe pointers, fixes #64896
9329 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
9331 * expression.cs: Pointer arith always needs to do a conv.i
9332 if the operand is a long. fix 65320
9334 2004-09-04 Marek Safar <marek.safar@seznam.cz>
9336 Fixed cs0619-37.cs, cs0619-38.cs
9338 * enum.cs (GetObsoleteAttribute): Removed.
9340 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
9341 on Enum member is double staged. The first is tested member
9344 2004-09-04 Marek Safar <marek.safar@seznam.cz>
9346 Fixed #56986, #63631, #65231
9348 * class.cs: (TypeContainer.AddToMemberContainer): New method,
9349 adds member to name container.
9350 (TypeContainer.AddToTypeContainer): New method, adds type to
9352 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
9353 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
9354 AddOperator): Simplified by reusing AddToMemberContainer.
9355 (TypeContainer.UserDefinedStaticConstructor): Changed to property
9357 (Method.CheckForDuplications): Fixed implementation to test all
9359 (MemberBase): Detection whether member is explicit interface
9360 implementation is now in constructor.
9361 (MemberBase.UpdateMemberName): Handles IndexerName.
9362 (Accessor): Changed to keep also location information.
9363 (AbstractPropertyEventMethod): Is derived from MemberCore.
9364 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
9365 will be emited or not.
9366 (PropertyBase.AreAccessorsDuplicateImplementation):
9367 Tests whether accessors are not in collision with some method.
9368 (Operator): Is derived from MethodCore to simplify common
9371 * decl.cs (Flags.TestMethodDuplication): Test for duplication
9373 (DeclSpace.AddToContainer): Adds the member to defined_names
9374 table. It tests for duplications and enclosing name conflicts.
9376 * enum.cs (EnumMember): Clean up to reuse the base structures
9378 2004-09-03 Martin Baulig <martin@ximian.com>
9380 Merged latest changes into gmcs. Please keep this comment in
9381 here, it makes it easier for me to see what changed in MCS since
9382 the last time I merged.
9384 2004-09-03 Martin Baulig <martin@ximian.com>
9386 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9387 into TypeContainer, to make partial classes work again.
9389 2004-09-03 Martin Baulig <martin@ximian.com>
9391 * rootcontext.cs (RootContext.V2): Removed.
9393 2004-03-23 Martin Baulig <martin@ximian.com>
9395 * expression.cs (Invocation.OverloadResolve): Added `bool
9396 may_fail' argument and use it instead of the Location.IsNull() hack.
9398 2004-09-09 Martin Baulig <martin@ximian.com>
9400 * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
9402 2004-09-09 Martin Baulig <martin@ximian.com>
9404 * generic.cs (TypeParameter.DefineType): Added support for
9405 explicit interface methods.
9407 2004-09-09 Martin Baulig <martin@ximian.com>
9409 * README.Changes: New document. Started to list important changes
9410 between MCS and GMCS here.
9412 2004-09-08 Martin Baulig <martin@ximian.com>
9415 (TypeContainer.CheckRecursiveDefinition): New protected method.
9416 (TypeContainer.DefineType): Move the CS0146 check into
9417 CheckRecursiveDefinition().
9419 2004-09-06 Martin Baulig <martin@ximian.com>
9421 * generic.cs (ConstructedType.CheckConstraints): Allow builtin
9422 types for the constructor constraint.
9424 2004-09-03 Martin Baulig <martin@ximian.com>
9426 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9427 into TypeContainer, to make partial classes work again.
9429 2004-09-03 Martin Baulig <martin@ximian.com>
9431 * rootcontext.cs (RootContext.V2): Removed.
9433 2004-03-23 Martin Baulig <martin@ximian.com>
9435 * expression.cs (Invocation.OverloadResolve): Added `bool
9436 may_fail' argument and use it instead of the Location.IsNull() hack.
9438 2004-09-03 Martin Baulig <martin@ximian.com>
9440 Merged latest changes into gmcs. Please keep this comment in
9441 here, it makes it easier for me to see what changed in MCS since
9442 the last time I merged.
9444 2004-09-03 Raja R Harinath <rharinath@novell.com>
9447 * expression.cs (BetterConversion): Don't allow either conversion
9448 to be null. Remove redundant implicit conversion test when 'q ==
9449 null' -- when this function is invoked, we already know that the
9450 implicit conversion exists.
9451 (BetterFunction): Assume that 'best' is non-null. Remove
9452 redundant reimplementation of IsApplicable when 'best' is null.
9453 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
9454 number of arguments.
9455 (IsAncestralType): Extract from OverloadResolve.
9456 (OverloadResolve): Make robust to the MethodGroupExpr being
9457 unsorted. Implement all the logic of Section 14.5.5.1, and
9458 support overloading of methods from multiple applicable types.
9459 Clean up logic somewhat. Don't pass null methods to BetterFunction.
9461 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
9462 (RealError, Warning): Append type of report to related symbol.
9464 2004-09-03 Marek Safar <marek.safar@seznam.cz>
9466 * enum.cs: Fixed CLS-Compliance checks for enum members.
9467 Error tests cs3008-8.cs, cs3014-8.cs
9469 2004-09-02 Marek Safar <marek.safar@seznam.cz>
9471 Fixed bug #62342, #63102
9472 * class.cs: ImplementIndexer uses member.IsExplicitImpl
9473 like ImplementMethod.
9475 2004-09-02 Marek Safar <marek.safar@seznam.cz>
9477 * attribute.cs (Attribute.GetAttributeArgumentExpression):
9480 2004-09-02 Martin Baulig <martin@ximian.com>
9482 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9483 TypeManager.GetArgumentTypes() rather than calling GetParameters()
9486 2004-09-01 Marek Safar <marek.safar@seznam.cz>
9488 C# 2.0 Static classes implemented
9490 * class.cs (TypeContainer): instance_constructors,
9491 initialized_fields, initialized_static_fields,
9492 default_constructor, base_inteface_types are protected to be
9493 accessible from StaticClass.
9494 (TypeContainer.DefineDefaultConstructor): New virtual method
9495 for custom default constructor generating
9496 (StaticClass): New class to handle "Static classes" feature.
9498 * cs-parser.jay: Handle static keyword on class like instance
9501 * driver.cs: Added "/langversion" command line switch with two
9502 options (iso-1, default).
9504 2004-08-31 Marek Safar <marek.safar@seznam.cz>
9506 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
9508 2004-08-31 Miguel de Icaza <miguel@ximian.com>
9510 * delegate.cs: Style.
9512 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
9514 * delegate.cs: Add seperate instance expr field for miguel.
9516 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
9518 * PointerArithmetic (Resolve): make sure we are not doing
9519 pointer arith on void*. Also, make sure we are resolved
9520 by not setting eclass until resolve.
9522 All callers: Make sure that PointerArithmetic gets resolved.
9524 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
9526 * ArrayCreation (LookupType): If the type does not resolve
9527 to an array, give an error.
9529 2004-08-27 Marek Safar <marek.safar@seznam.cz>
9531 * statement.cs (Try.Resolve): Fixed bug #64222
9533 2004-08-27 Martin Baulig <martin@ximian.com>
9536 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9539 2004-08-26 Marek Safar <marek.safar@seznam.cz>
9541 * ecore.cs (Constantify): Get underlying type via
9542 System.Enum.GetUnderlyingType to avoid StackOverflow on the
9543 Windows in special cases.
9545 2004-08-26 Marek Safar <marek.safar@seznam.cz>
9547 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
9548 for obtaining also private methods.
9549 (GetRemoveMethod): Used GetRemoveMethod (true)
9550 for obtaining also private methods.
9552 2004-09-02 Martin Baulig <martin@ximian.com>
9554 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9555 TypeManager.GetArgumentTypes() rather than calling GetParameters()
9558 2004-08-27 Martin Baulig <martin@ximian.com>
9561 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9564 2004-08-25 Martin Baulig <martin@ximian.com>
9566 * support.cs (ReflectionParameters..ctor): If this is a generic
9567 method, retrieve and store its type parameters.
9568 (InternalParameters..ctor): Added `TypeParameter[]' argument.
9569 (ReflectionParameters.GenericConstraints): The argument specifies
9570 the type parameter, not the method parameter.
9571 (InternalParameters.GenericConstraints): Likewise.
9573 * generic.cs (TypeParameter.DefineType): Correctly handle
9574 constraints wrt. generic methods in interfaces and their
9577 2004-08-24 Martin Baulig <martin@ximian.com>
9579 * generic.cs (TypeParameter.IsSubclassOf): New public method.
9580 (Constraints.IsSubclassOf): New internal method.
9582 * typemanager.cs (TypeManager.FindMembers): Added special support
9583 for GenericTypeParameterBuilder's.
9584 (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
9587 2004-08-24 Martin Baulig <martin@ximian.com>
9590 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
9591 this for accessibility checks.
9592 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
9593 IsNestedFamilyAccessible.
9594 (TypeManager.IsSubclassOf): New method, do what the name actually
9597 2004-08-24 Martin Baulig <martin@ximian.com>
9599 * expression.cs (MemberAccess.DoResolve): When resolving ourselves
9600 as a SimpleName, include the generic arity.
9602 2004-08-24 Martin Baulig <martin@ximian.com>
9604 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
9605 MethodAttributes.HideBySig for operators.
9607 2004-08-23 Martin Baulig <martin@ximian.com>
9609 Back to the old error reporting system :-)
9611 * report.cs (Message): Removed.
9612 (Report.MessageData, ErrorData, WarningData): Removed.
9613 (Report.Error, Warning): Back to the old system.
9615 2004-08-23 Martin Baulig <martin@ximian.com>
9617 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
9619 * class.cs (TypeContainer.ParentContainer): New public virtual
9620 method; replaces the explicit interface implementation.
9621 (ClassPart.ParentContainer): Override.
9623 2004-08-23 Martin Baulig <martin@ximian.com>
9625 * statement.cs (Switch): Added support for constant switches; see
9626 #59428 or test-285.cs.
9628 2004-08-22 Marek Safar <marek.safar@seznam.cz>
9631 * statement.cs (GetEnumeratorFilter): Removed useless
9632 logic because C# specs is strict. GetEnumerator must be
9635 2004-08-22 Martin Baulig <martin@ximian.com>
9637 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9638 a switch and may break, reset the barrier. Fixes #59867.
9640 2004-08-22 Marek Safar <marek.safar@seznam.cz>
9642 CLS-Compliance speed up (~5% for corlib)
9644 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
9645 New method. Tests container for CLS-Compliant names
9647 * class.cs (TypeContainer.VerifyClsName): New method.
9648 Checks whether container name is CLS Compliant.
9649 (Constructor): Implements IMethodData.
9651 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
9652 low-case table for CLS Compliance test.
9653 (MemberCache.VerifyClsParameterConflict): New method.
9654 Checks method parameters for CS3006 error.
9656 * enum.cs (EnumMember): Is derived from MemberCore.
9657 (Enum.VerifyClsName): Optimized for better performance.
9659 2004-08-06 Marek Safar <marek.safar@seznam.cz>
9661 * report.cs: Renamed Error_T to Error and changed all
9664 2004-08-06 Marek Safar <marek.safar@seznam.cz>
9666 * class.cs (TypeContainer.IndexerArrayList): New inner class
9667 container for indexers.
9668 (TypeContainer.DefaultIndexerName): New constant for default
9669 indexer name. Replaced all "Item" with this constant.
9670 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
9672 * typemanager.cs (TypeManager.default_member_ctor): Cache here
9673 DefaultMemberAttribute constructor.
9675 2004-08-05 Martin Baulig <martin@ximian.com>
9677 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9680 2004-08-05 Marek Safar <marek.safar@seznam.cz>
9682 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
9683 multi platforms problem.
9685 * compiler.csproj: Included shared files.
9687 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9689 Fix bug 60333, 55971 in the more general way
9690 * attribute.cs (Attribute.GetAttributeArgumentExpression):
9691 Added arg_type argument for constant conversion.
9692 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
9694 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9697 * class.cs (TypeContainer ): New inner classes MethodArrayList,
9698 OperatorArrayList, MethodCoreArrayList for typecontainer
9699 containers. Changed class member types to these new types.
9700 (MethodArrayList.DefineMembers): Added test for CS0659.
9702 2004-08-04 Miguel de Icaza <miguel@ximian.com>
9704 * cfold.cs: Synchronize the folding with the code in expression.cs
9705 Binary.DoNumericPromotions for uint operands.
9707 * attribute.cs: Revert patch from Raja, it introduced a regression
9708 while building Blam-1.2.1 (hard to isolate a test case).
9710 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9714 (TypeContainer.Define): Renamed to DefineContainerMembers because of
9716 (MethodCore.parent_method): New member. The method we're overriding
9717 if this is an override method.
9718 (MethodCore.CheckBase): Moved from Method class and made common.
9719 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
9721 (MethodCore.CheckForDuplications): New abstract method. For custom
9722 member duplication search in a container
9723 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
9724 method and its return type.
9725 (Event.conflict_symbol): New member. Symbol with same name in the
9729 (MemberCache.FindMemberWithSameName): New method. The method
9730 is looking for conflict with inherited symbols.
9732 2004-08-04 Martin Baulig <martin@ximian.com>
9734 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9736 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9738 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9740 * report.cs (Message): New enum for better error, warning reference in
9742 (MessageData): New inner abstract class. It generally handles printing of
9743 error and warning messages.
9744 Removed unused Error, Warning, Message methods.
9746 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9748 Fix for cs0592-8.cs test
9750 (Attributable.ValidAttributeTargets): Made public.
9751 (Attribute.ExplicitTarget): New member for explicit target value.
9752 (Attribute.CheckTargets): Now we translate explicit attribute
9753 target to Target here.
9755 2004-08-03 Ben Maurer <bmaurer@ximian.com>
9757 * ecore.cs (MethodGroupExpr): new IsBase property.
9759 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
9761 * delegate.cs (DelegateCreation): store a MethodGroupExpr
9762 rather than an instance expr.
9764 (DelegateCreation.Emit): Use the method group rather than
9765 the instance expression. Also, if you have base.Foo as the
9766 method for a delegate, make sure to emit ldftn, not ldftnvirt.
9768 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
9770 (NewDelegate.DoResolve): Only check for the existance of Invoke
9771 if the method is going to be needed. Use MethodGroupExpr.
9773 (NewDelegate.Emit): Remove, DelegateCreation implements this.
9775 * expression.cs: For pointer arith., make sure to use
9776 the size of the type, not the size of the pointer to
9779 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9782 * class.cs (Class): Added error CS0502 test.
9784 2004-08-03 John Luke <jluke@cfl.rr.com>
9785 Raja R Harinath <rharinath@novell.com>
9788 * attribute.cs (Attribute.complained_before): New flag.
9789 (Attribute.ResolveType, Attribute.Resolve),
9790 (Attribute.DefinePInvokeMethod): Set it.
9791 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
9793 2004-08-03 Martin Baulig <martin@ximian.com>
9795 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9796 use a user-defined operator; we still need to do numeric
9797 promotions in case one argument is a builtin type and the other
9798 one has an implicit conversion to that type. Fixes #62322.
9800 2004-08-18 Martin Baulig <martin@ximian.com>
9802 * class.cs (Method.Define): Use the correct method name when
9803 creating the MethodBuilder for a generic method.
9805 2004-08-17 Martin Baulig <martin@ximian.com>
9807 * generic.cs (Constraints): Support type parameter constraints.
9809 2004-08-16 Martin Baulig <martin@ximian.com>
9811 * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
9812 (Token.GENERIC_DIMENSION): New token; this is returned if we
9813 encounter an unbound generic type in a typeof() expression.
9815 * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
9816 this token is only generated while parsing a typeof() expression.
9817 (typeof_expression): Removed the old unbound_type hack.
9819 * generic.cs (TypeArguments.IsUnbound): New public property.
9821 * decl.cs (MemberName): Added support for unbound types.
9823 2004-08-14 Martin Baulig <martin@ximian.com>
9826 (TypeManager.IsEqualGenericInstance): New static method.
9827 (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
9828 just used to check accessibility, so follow the rules of 26.1.6.
9830 * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
9831 ConstructedType instead of a TypeExpression if we have type arguments.
9833 * cs-parser.jay (typeof_expression): Support unbound generic types.
9835 * ecore.cs (UnboundTypeExpression): New public class.
9837 2004-08-12 Martin Baulig <martin@ximian.com>
9839 * typemanager.cs (TypeManager.IsNestedChildOf): Use
9840 TypeManager.IsEqual() rather than `=='.
9842 * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
9843 generic instances as well.
9845 2004-08-12 Martin Baulig <martin@ximian.com>
9847 * expression.cs (Invocation.InferType): We can only infer method
9848 type parameters. Fixes #62647.
9850 2004-08-11 Martin Baulig <martin@ximian.com>
9852 * class.cs (TypeContainer.DefineType): Create the TypeBuilder
9853 before resolving the base classes.
9855 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9857 * Makefile: install .mdb file too.
9859 2004-08-05 Martin Baulig <martin@ximian.com>
9861 * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
9862 initializer, the current type is just the TypeBuilder, not the
9863 instantiated generic type.
9864 (FieldExpr.IsFieldInitializer): New public property.
9866 2004-08-04 Martin Baulig <martin@ximian.com>
9868 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9870 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9872 2004-08-03 Martin Baulig <martin@ximian.com>
9874 * class.cs (MethodData.Define): If we're an explicit
9875 implementation, remove the generic arity from the type name.
9877 2004-08-03 Martin Baulig <martin@ximian.com>
9879 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9880 use a user-defined operator; we still need to do numeric
9881 promotions in case one argument is a builtin type and the other
9882 one has an implicit conversion to that type. Fixes #62322.
9884 2004-08-02 Martin Baulig <martin@ximian.com>
9886 * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
9888 (TypeContainer.GetClassBases): Return the unexpanded list of
9889 interfaces; we expand them later.
9890 (TypeContainer.DefineType): After creating the TypeBuilder, call
9891 TypeManager.ExpandInterfaces() to get an expanded and resolved
9894 * ecore.cs (TypeExpr.GetInterfaces): Removed
9896 * generics.cs (Constraints.InterfaceConstraints): Remove.
9897 (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
9898 register the interface constraints.
9901 (TypeManager.AddUserType): Removed the `ifaces' argument.
9902 (TypeManager.AddTypeParameter): Likewise.
9903 (TypeManager.AddUserInterface): Removed, was unused.
9904 (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
9905 `TypeExpr[]' array for the interfaces.
9906 (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
9907 has been defined, returns a list of the resolved interfaces types.
9908 (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
9909 (TypeManager.GetExplicitInterfaces): Likewise.
9911 2004-08-02 Martin Baulig <martin@ximian.com>
9913 * expression.cs (Invocation.EmitCall): If we're invoking a method
9914 on a type parameter, use the new `Constrained' prefix opcode.
9916 2004-08-02 Martin Baulig <martin@ximian.com>
9918 * statement.cs (LocalInfo.Flags): Added `IsThis'.
9919 (LocalInfo.IsThis): New public property.
9920 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
9922 2004-08-01 Martin Baulig <martin@ximian.com>
9924 * class.cs (TypeContainer.GetClassBases): Don't set the default
9925 here since we may get called from GetPartialBases().
9926 (TypeContainer.DefineType): If GetClassBases() didn't return a
9927 parent, use the default one.
9929 2004-07-30 Martin Baulig <martin@ximian.com>
9931 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
9933 * class.cs (SourceMethod): New public class, derive from the
9934 symbol writer's ISourceMethod.
9935 (Method): Use the new symbol writer API.
9937 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
9938 as argument and use the new symbol writer.
9941 (SourceFile): Implement the symbol writer's ISourceFile.
9942 (Location.SymbolDocument): Removed.
9943 (Location.SourceFile): New public property.
9945 * symbolwriter.cs: Use the new symbol writer API.
9947 2004-07-30 Raja R Harinath <rharinath@novell.com>
9949 * Makefile (install-local): Remove. Functionality moved to
9952 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
9954 * Makefile: Install mcs.exe.config file together with mcs.exe.
9955 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
9956 correct runtime version.
9958 2004-07-25 Martin Baulig <martin@ximian.com>
9961 (TypeContainer.RegisterOrder): Removed, this was unused.
9962 (TypeContainer, interface_order): Removed.
9963 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
9964 TypeContainer as argument since we can also be called with a
9965 `PartialContainer' for a partial class/struct/interface.
9966 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
9967 of checking whether we're an `Interface' - we could be a
9969 (PartialContainer.Register): Override; call
9970 AddClass()/AddStruct()/AddInterface() on our parent.
9972 * cs-parser.jay (interface_member_declaration): Add things to the
9973 `current_container', not the `current_class'.
9975 * rootcontext.cs (RegisterOrder): The overloaded version which
9976 takes an `Interface' was unused, removed.
9978 * typemanager.cs (TypeManager.LookupInterface): Return a
9979 `TypeContainer', not an `Interface'.
9980 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
9981 contain a `PartialContainer' for an interface, so check it's
9982 `Kind' to figure out what it is.
9984 2004-07-25 Martin Baulig <martin@ximian.com>
9986 * class.cs (Class.DefaultTypeAttributes): New public constant.
9987 (Struct.DefaultTypeAttributes): Likewise.
9988 (Interface.DefaultTypeAttributes): Likewise.
9989 (PartialContainer.TypeAttr): Override this and add the
9990 DefaultTypeAttributes.
9992 2004-07-25 Martin Baulig <martin@ximian.com>
9994 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
9995 we can just use the `Parent' field instead.
9997 2004-07-25 Martin Baulig <martin@ximian.com>
9999 * class.cs (TypeContainer.Emit): Renamed to EmitType().
10001 2004-07-25 Martin Baulig <martin@ximian.com>
10003 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
10004 our parts before defining any methods.
10005 (TypeContainer.VerifyImplements): Make this virtual.
10006 (ClassPart.VerifyImplements): Override and call VerifyImplements()
10007 on our PartialContainer.
10009 2004-07-25 Martin Baulig <martin@ximian.com>
10011 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
10013 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
10014 argument, we can just use the `Parent' field instead.
10017 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
10018 (MemberBase.DoDefine): Likewise.
10020 2004-07-24 Martin Baulig <martin@ximian.com>
10022 * decl.cs (MemberCore.Parent): New public field.
10023 (DeclSpace.Parent): Moved to MemberCore.
10025 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
10026 (MemberBase.ctor): Added TypeContainer argument, pass it to our
10028 (FieldBase, Field, Operator): Likewise.
10029 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
10030 (EventField, Event): Likewise.
10032 2004-07-23 Martin Baulig <martin@ximian.com>
10034 * class.cs (PartialContainer): New public class.
10035 (ClassPart): New public class.
10036 (TypeContainer): Added support for partial classes.
10037 (TypeContainer.GetClassBases): Splitted some of the functionality
10038 out into GetNormalBases() and GetPartialBases().
10040 * cs-tokenizer.cs (Token.PARTIAL): New token.
10041 (Tokenizer.consume_identifier): Added some hacks to recognize
10042 `partial', but only if it's immediately followed by `class',
10043 `struct' or `interface'.
10045 * cs-parser.jay: Added support for partial clases.
10047 2004-07-23 Martin Baulig <martin@ximian.com>
10049 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
10050 a `DeclSpace' and also made it readonly.
10051 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
10052 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
10053 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
10055 * cs-parser.jay: Pass the `current_class', not the
10056 `current_container' (at the moment, this is still the same thing)
10057 to a new Method, Property, Event, Indexer or Constructor.
10059 2004-07-23 Martin Baulig <martin@ximian.com>
10061 * cs-parser.jay (CSharpParser): Added a new `current_class' field
10062 and removed the `current_interface' one.
10063 (struct_declaration, class_declaration, interface_declaration):
10064 Set `current_class' to the newly created class/struct/interface;
10065 set their `Bases' and call Register() before parsing their body.
10067 2004-07-23 Martin Baulig <martin@ximian.com>
10069 * class.cs (Kind): New public enum.
10070 (TypeContainer): Made this class abstract.
10071 (TypeContainer.Kind): New public readonly field.
10072 (TypeContainer.CheckDef): New public method; moved here from
10074 (TypeContainer.Register): New public abstract method.
10075 (TypeContainer.GetPendingImplementations): New public abstract
10077 (TypeContainer.GetClassBases): Removed the `is_class' and
10078 `is_iface' parameters.
10079 (TypeContainer.DefineNestedTypes): Formerly known as
10081 (ClassOrStruct): Made this class abstract.
10083 * tree.cs (RootTypes): New public type.
10085 2004-07-20 Martin Baulig <martin@ximian.com>
10087 * tree.cs (Tree.RecordNamespace): Removed.
10088 (Tree.Namespaces): Removed.
10090 * rootcontext.cs (RootContext.IsNamespace): Removed.
10092 * cs-parser.jay (namespace_declaration): Just create a new
10093 NamespaceEntry here.
10095 2004-07-21 Lluis Sanchez Gual <lluis@novell.com>
10097 * Makefile: Install gmcs.exe.config file together with gmcs.exe.
10098 * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
10099 entry to make sure it runs in the correct runtime version.
10101 2004-07-18 Martin Baulig <martin@ximian.com>
10103 * generic.cs (ConstructedType.CheckConstraints): Improved
10104 constraints checking.
10106 2004-07-18 Martin Baulig <martin@ximian.com>
10108 * expression.cs (Invocation.BetterMethod): Call
10109 TypeManager.TypeToCoreType() on all types and removed my previous
10110 hack; we're already doig the right thing here.
10112 2004-07-17 Martin Baulig <martin@ximian.com>
10114 * decl.cs (MemberName.MakeName): Create the "class`1" names here.
10116 2004-07-16 Martin Baulig <martin@ximian.com>
10118 * iterators.cs: Added generics support.
10120 2004-07-16 Martin Baulig <martin@ximian.com>
10122 * iterators.cs: Rewrote this. We're now using one single Proxy
10123 class for both the IEnumerable and the IEnumerator interface and
10124 `Iterator' derives from Class so we can use the high-level API.
10126 * class.cs (TypeContainer.AddIterator): New method.
10127 (TypeContainer.DoDefineType): New protected virtual method, which
10128 is called from DefineType().
10129 (TypeContainer.DoDefineMembers): Call DefineType() and
10130 DefineMembers() on all our iterators.
10131 (TypeContainer.Emit): Call Emit() on all our iterators.
10132 (TypeContainer.CloseType): Call CloseType() on all our iterators.
10134 * codegen.cs (EmitContext.CurrentIterator): New public field.
10136 2004-07-15 Martin Baulig <martin@ximian.com>
10139 (TypeManager.not_supported_exception_type): New type.
10141 2004-07-14 Martin Baulig <martin@ximian.com>
10144 (TypeManager.generic_ienumerable_type): New type.
10145 (TypeManager.generic_ienumerator_type): New type.
10148 (RootContext.interfaces_first_stage): Added
10149 "System.Collections.Generic.IEnumerator`1" and
10150 "System.Collections.Generic.IEnumerable`1".
10152 2004-07-14 Martin Baulig <martin@ximian.com>
10154 * iterators.cs: Use real error numbers.
10156 2004-07-14 Martin Baulig <martin@ximian.com>
10158 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
10159 requires this to be a System.Collection.IEnumerable and not a
10160 class implementing that interface.
10161 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
10163 2004-07-13 Marek Safar <marek.safar@seznam.cz>
10165 * class.cs: Fixed previous fix, it broke some error tests.
10167 2004-07-12 Martin Baulig <martin@ximian.com>
10169 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
10172 2004-07-14 Martin Baulig <martin@ximian.com>
10174 * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
10175 an exclamation mark (!) for the generic arity to reflect the
10176 latest spec changes; ie. use "System.Collections.Generic.IList`1".
10178 2004-07-13 Martin Baulig <martin@ximian.com>
10180 * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
10181 specifiers being part of a type argument.
10183 2004-07-13 Martin Baulig <martin@ximian.com>
10185 * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
10186 name for generic types.
10188 2004-07-13 Martin Baulig <martin@ximian.com>
10190 * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
10193 2004-07-09 Miguel de Icaza <miguel@ximian.com>
10195 * assign.cs (LocalTemporary): Add new argument: is_address,If
10196 `is_address' is true, then the value that we store is the address
10197 to the real value, and not the value itself.
10199 * ecore.cs (PropertyExpr): use the new local temporary
10200 stuff to allow us to handle X.Y += z (where X is a struct)
10202 2004-07-08 Martin Baulig <martin@ximian.com>
10204 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
10205 not always return, just like we're doing in Using.Resolve().
10207 2004-07-07 Miguel de Icaza <miguel@ximian.com>
10209 * cs-parser.jay (fixed_statement): flag this as Pinned.
10211 2004-07-06 Miguel de Icaza <miguel@ximian.com>
10213 * typemanager.cs (TypeManager): Removed MakePinned method, this
10214 mechanism is replaced with the .NET 2.x compatible mechanism of
10215 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
10217 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
10218 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
10219 `IsFixed' property which has a different meaning.
10221 2004-07-02 Raja R Harinath <rharinath@novell.com>
10223 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
10224 visible from inside a nested class, not just the names of the
10225 immediately enclosing class.
10226 Fix for bug #60730.
10228 2004-06-24 Raja R Harinath <rharinath@novell.com>
10230 * expression.cs (BetterConversion): Remove buggy special-case
10231 handling of "implicit constant expression conversions". At this
10232 point, we already know that the conversion is possible -- we're
10233 only checking to see which is better.
10235 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10237 * cs-parser.jay: Added error CS0210 test.
10239 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10241 * cs-parser.jay: Added error CS0134 test.
10243 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10246 * cs-parser.jay: Added error CS0145 test.
10248 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10250 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
10252 2004-06-23 Ben Maurer <bmaurer@ximian.com>
10254 * expression.cs (StackAlloc.Resolve): The argument may not
10255 be a constant; deal with this case.
10257 2004-06-23 Marek Safar <marek.safar@seznam.cz>
10259 * attribute.cs (IndexerName_GetIndexerName): Renamed to
10260 GetIndexerAttributeValue.
10261 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
10263 * class.cs (Indexer.Define): Added error tests for CS0415,
10266 2004-06-23 Miguel de Icaza <miguel@ximian.com>
10268 * attribute.cs (Attribute.Resolve): Keep field code in sync with
10271 2004-06-23 Martin Baulig <martin@ximian.com>
10273 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
10274 neither return nor throw, reset the barrier as well. Fixes #60457.
10276 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
10278 * class.cs : EventAttributes is now set to None by default.
10279 This fixes bug #60459.
10281 2004-06-18 Marek Safar <marek.safar@seznam.cz>
10284 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10285 Don't throw exception but return null (it's sufficient now).
10287 2004-06-18 Marek Safar <marek.safar@seznam.cz>
10289 * typemanager.cs (GetArgumentTypes): Faster implementation.
10291 2004-06-18 Martin Baulig <martin@ximian.com>
10293 * attribute.cs (Attribute.Resolve): Check whether we're an
10294 EmptyCast which a Constant child. Fixes #60333.
10296 2004-06-17 Ben Maurer <bmaurer@ximian.com>
10298 * statement.cs (EmitCollectionForeach): Account for the fact that
10299 not all valuetypes are in areas which we can take the address of.
10300 For these variables, we store to a temporary variable. Also, make
10301 sure that we dont emit a `callvirt' on a valuetype method.
10303 2004-06-15 Marek Safar <marek.safar@seznam.cz>
10305 * expression.cs (StackAlloc.DoReSolve): Added test for
10306 negative parameter (CS0247).
10308 2004-06-15 Marek Safar <marek.safar@seznam.cz>
10311 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
10313 2004-06-15 Marek Safar <marek.safar@seznam.cz>
10316 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
10319 2004-06-14 Marek Safar <marek.safar@seznam.cz>
10321 Fix bug #58254 & cs1555.cs, cs1556.cs
10322 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
10324 2004-06-14 Marek Safar <marek.safar@seznam.cz>
10326 * cs-parser.jay: Added error CS1669 test for indexers.
10328 2004-06-18 Martin Baulig <martin@ximian.com>
10330 * generics.cs (GenericMethod.ctor): Don't take an Attributes
10331 argument. Fixes #60441.
10333 2004-06-16 Ben Maurer <bmaurer@ximian.com>
10334 * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
10335 The name needs to have the actual name of the method in order
10336 for other tests (such as the one in OverloadResolve for Invoke
10337 on a delegate) to work. As well, it does not really help
10338 error reporting because the method group had multiple methods.
10339 * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
10340 Make profiling work.
10342 2004-06-13 Martin Baulig <martin@ximian.com>
10344 * cs-parser.jay: Don't allow generic attributes.
10346 2004-06-13 Martin Baulig <martin@ximian.com>
10348 * class.cs (MemberBase.DoDefineBase): New protected method.
10349 (MemberBase.DoDefine): Compute the `flags' in the new
10350 DoDefineBase() which must be called first.
10351 (Method.Define): Call DoDefineBase() first so we have the flags
10352 when defining the generic method.
10354 * cs-parser.jay (interface_method_declaration): Support generic methods.
10356 2004-06-13 Martin Baulig <martin@ximian.com>
10358 * decl.cs (TypeName): Removed.
10359 (MemberName): Removed TypeName and MemberNow; now we just have
10362 * cs-parser.jay: Don't distinguish between type arguments and type
10363 parameters in the grammar and simplified the rules a bit. The
10364 reduce/reduce conflicts are now gone (except the one we inherited
10367 2004-06-11 Martin Baulig <martin@ximian.com>
10369 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
10370 call this twice: for params and varargs methods.
10372 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10375 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
10377 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10379 * attribute.cs (Attribute.GetValidTargets): Made public.
10382 (AbstractPropertyEventMethod): New class for better code sharing.
10383 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
10385 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
10387 2004-06-09 Martin Baulig <martin@ximian.com>
10389 * cs-parser.jay: Removed a reduce/reduce conflict.
10391 2004-06-03 Martin Baulig <martin@ximian.com>
10393 * generic.cs (ConstructedType.GetMemberAccess): Renamed to
10394 GetSimpleName() and return a SimpleName.
10396 * ecore.cs (SimpleName.Arguments): New public field.
10397 (SimpleName): Added overloaded ctor which takes an additional
10398 TypeArguments argument.
10399 (SimpleName.SimpleNameResolve): Added support for generic methods.
10400 (MethodGroupExpr.ResolveGeneric): New public method. The code was
10401 formerly in MemberAccess.DoResolve(), but we also need it in
10402 SimpleNameResolve().
10404 * expression.cs (MemberAccess.DoResolve): Use the new
10405 MethodGroupExpr.ResolveGeneric().
10407 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10409 * decl.cs: If possible, use lookuptypedirect here. We can only do
10410 this if there is no `.' after the namespace. Avoids using
10411 LookupType, which does lots of slow processing.
10412 (FindNestedType) New method, does what it says :-).
10413 * namespace.cs: use LookupTypeDirect.
10414 * rootcontext.cs: use membercache, if possible.
10415 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10417 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10420 According to the spec,
10422 In a member access of the form E.I, if E is a single identifier,
10423 and if the meaning of E as a simple-name (§7.5.2) is a constant,
10424 field, property, localvariable, or parameter with the same type as
10425 the meaning of E as a type-name (§3.8), then both possible
10426 meanings of E are permitted.
10428 We did not check that E as a simple-name had the same type as E as
10431 This trivial check gives us 5-7% on bootstrap time.
10433 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10435 * expression.cs (Invocation.OverloadResolve): Avoid the
10436 use of hashtables and boxing here by allocating on demand.
10438 2004-05-30 Martin Baulig <martin@ximian.com>
10440 * rootcontext.cs (RootContext.LookupType): Don't cache things if
10441 we're doing a silent lookup. Don't try to lookup nested types in
10442 TypeManager.object_type (thanks to Ben Maurer).
10444 2004-05-30 Martin Baulig <martin@ximian.com>
10446 Committing a patch from Ben Maurer.
10448 * rootcontext.cs (RootContext.LookupType): Cache negative results.
10450 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10452 * convert.cs: add a trivial cache for overload operator resolution.
10454 2004-05-31 Marek Safar <marek.safar@seznam.cz>
10457 (AttributeTester.GetObsoleteAttribute): Returns instance of
10458 ObsoleteAttribute when type is obsolete.
10461 (TypeContainer.VerifyObsoleteAttribute): Override.
10462 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
10463 (MethodCode.VerifyObsoleteAttribute): Override.
10464 (MemberBase.VerifyObsoleteAttribute): Override.
10467 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
10468 and report proper error.
10471 (Delegate.VerifyObsoleteAttribute): Override.
10474 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
10475 and report proper error.
10476 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
10479 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
10483 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
10484 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
10485 Added test for ObsoleteAttribute.
10488 (Catch): Derived from Statement.
10490 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10492 * decl.cs: If possible, use lookuptypedirect here. We can only do
10493 this if there is no `.' after the namespace. Avoids using
10494 LookupType, which does lots of slow processing.
10495 (FindNestedType) New method, does what it says :-).
10496 * namespace.cs: use LookupTypeDirect.
10497 * rootcontext.cs: use membercache, if possible.
10498 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10500 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10503 According to the spec,
10505 In a member access of the form E.I, if E is a single identifier,
10506 and if the meaning of E as a simple-name (§7.5.2) is a constant,
10507 field, property, localvariable, or parameter with the same type as
10508 the meaning of E as a type-name (§3.8), then both possible
10509 meanings of E are permitted.
10511 We did not check that E as a simple-name had the same type as E as
10514 This trivial check gives us 5-7% on bootstrap time.
10516 2004-05-30 Marek Safar <marek.safar@seznam.cz>
10518 Fixed bug #59071 & cs0160.cs
10519 * statement.cs (Try.Resolve): Check here whether order of catch
10520 clauses matches their dependencies.
10522 2004-05-30 Marek Safar <marek.safar@seznam.cz>
10525 * ecore.cs (SimpleName.SimpleNameResolve): Added test for
10528 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10530 * expression.cs (Invocation.OverloadResolve): Avoid the
10531 use of hashtables and boxing here by allocating on demand.
10533 2004-05-30 Martin Baulig <martin@ximian.com>
10535 * rootcontext.cs (RootContext.LookupType): Don't cache things if
10536 we're doing a silent lookup. Don't try to lookup nested types in
10537 TypeManager.object_type (thanks to Ben Maurer).
10539 2004-05-30 Martin Baulig <martin@ximian.com>
10541 Committing a patch from Ben Maurer.
10543 * rootcontext.cs (RootContext.LookupType): Cache negative results.
10545 2004-05-29 Martin Baulig <martin@ximian.com>
10547 * class.cs (IMethodData.ShouldIgnore): New method.
10549 * typemanager.cs (TypeManager.MethodFlags): Don't take a
10550 `Location' argument, we don't need it anywhere. Use
10551 `IMethodData.ShouldIgnore ()' instead of
10552 `MethodData.GetMethodFlags ()'.
10553 (TypeManager.AddMethod): Removed.
10554 (TypeManager.AddMethod2): Renamed to AddMethod.
10556 2004-05-29 Martin Baulig <martin@ximian.com>
10558 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
10560 * convert.cs (Convert.ImplicitReferenceConversion): If we're
10561 converting from a class type S to an interface type and we already
10562 have an object on the stack, don't box it again. Fixes #52578.
10564 2004-05-29 Martin Baulig <martin@ximian.com>
10566 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10567 Added support for `params' parameters. Fixes #59267.
10569 2004-05-29 Martin Baulig <martin@ximian.com>
10571 * literal.cs (NullPointer): Provide a private .ctor which sets
10572 `type' to TypeManager.object_type. Fixes #59048.
10574 2004-05-29 Martin Baulig <martin@ximian.com>
10576 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
10577 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
10579 * ecore.cs (EventExpr.instance_expr): Make the field private.
10581 2004-05-26 Marek Safar <marek.safar@seznam.cz>
10583 Fixed bug #50080 & cs0214-2.cs
10584 * expression.cs (Cast.DoResolve): Check unsafe context here.
10586 * statement.cs (Resolve.DoResolve): Likewise.
10588 2004-05-26 Martin Baulig <martin@ximian.com>
10590 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
10592 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
10593 (RootContext.LookupType): Pass down the `silent' flag.
10595 2004-05-25 Martin Baulig <martin@ximian.com>
10598 (MethodGroupExpr.IdenticalTypeName): New public property.
10599 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
10600 expression actually refers to a type.
10602 2004-05-25 Martin Baulig <martin@ximian.com>
10604 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
10605 for #56176 and made it actually work.
10607 2004-05-25 Martin Baulig <martin@ximian.com>
10609 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
10610 (FieldExpr, PropertyExpr): Override and implement
10611 CacheTemporaries. Fixes #52279.
10613 2004-05-25 Miguel de Icaza <miguel@ximian.com>
10615 * location.cs: In the new compiler listing a file twice is a
10616 warning, not an error.
10618 2004-05-24 Martin Baulig <martin@ximian.com>
10620 * enum.cs (Enum.DefineType): For the `BaseType' to be a
10621 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
10623 2004-05-24 Martin Baulig <martin@ximian.com>
10625 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
10626 walking the `using' list. Fixes #53921.
10628 2004-05-24 Martin Baulig <martin@ximian.com>
10630 * const.cs (Const.LookupConstantValue): Added support for
10631 EmptyCast's; fixes #55251.
10633 2004-05-24 Martin Baulig <martin@ximian.com>
10635 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
10636 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
10637 which does the CS0135 check. The reason is that we first need to
10638 check whether the variable actually exists.
10640 2004-05-24 Martin Baulig <martin@ximian.com>
10642 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
10643 than RootContext.LookupType() to find the explicit interface
10644 type. Fixes #58584.
10646 2004-05-24 Raja R Harinath <rharinath@novell.com>
10648 * Makefile: Simplify. Use executable.make.
10649 * mcs.exe.sources: New file. List of sources of mcs.exe.
10651 2004-05-24 Anders Carlsson <andersca@gnome.org>
10655 Use the invariant culture when doing String.Compare for CLS case
10658 2004-05-23 Martin Baulig <martin@ximian.com>
10660 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
10661 don't have any dots. Fixes #52622, added cs0246-8.cs.
10663 * namespace.cs (NamespaceEntry.Lookup): Likewise.
10665 2004-05-23 Marek Safar <marek.safar@seznam.cz>
10667 * class.cs (MemberBase.Define): Reuse MemberType member for
10668 resolved type. Other methods can use it too.
10670 2004-05-23 Martin Baulig <martin@ximian.com>
10672 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
10673 the variable also exists in the current block (otherwise, we need
10674 to report a CS0103). Fixes #58670.
10676 2004-05-23 Martin Baulig <martin@ximian.com>
10678 * flowanalysis.cs (Reachability.Reachable): Compute this
10679 on-the-fly rather than storing it as a field.
10681 2004-05-23 Martin Baulig <martin@ximian.com>
10683 * flowanalysis.cs (Reachability.And): Manually compute the
10684 resulting `barrier' from the reachability.
10686 2004-05-23 Marek Safar <marek.safar@seznam.cz>
10689 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
10690 instance of ObsoleteAttribute when symbol is obsolete.
10693 (IMethodData): Extended interface for ObsoleteAttribute support.
10695 2004-05-22 Marek Safar <marek.safar@seznam.cz>
10697 * attribute.cs: Fix bug #55970
10699 2004-05-22 Marek Safar <marek.safar@seznam.cz>
10703 (GetObsoleteAttribute): New method. Creates the instance of
10705 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
10706 ObsoleteAttribute when member is obsolete.
10707 (AttributeTester.Report_ObsoleteMessage): Common method for
10708 Obsolete error/warning reporting.
10711 (TypeContainer.base_classs_type): New member for storing parent type.
10714 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
10715 for this MemberCore.
10717 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10719 * attribute.cs, const.cs: Fix bug #58590
10721 2004-05-21 Martin Baulig <martin@ximian.com>
10723 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
10724 out parameters if the end of the method is unreachable. Fixes
10727 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10729 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
10730 Hari was right, why extra method.
10732 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10734 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
10736 2004-05-20 Martin Baulig <martin@ximian.com>
10738 * delegate.cs: Convert this file to Unix mode - like the original
10741 2004-05-20 Martin Baulig <martin@ximian.com>
10743 * attribute.cs: Convert this file to Unix mode - like the original
10746 2004-05-19 Marek Safar <marek.safar@seznam.cz>
10748 Fix bug #58688 (MCS does not report error when the same attribute
10751 * attribute.cs (Attribute.Emit): Distinction between null and default.
10753 2004-05-19 Raja R Harinath <rharinath@novell.com>
10755 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
10756 of a top-level attribute without an attribute target.
10757 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
10759 (Attribute.Conditional_GetConditionName),
10760 (Attribute.Obsolete_GetObsoleteMessage): Update.
10761 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
10762 part of ScanForIndexerName.
10763 (Attribute.CanIgnoreInvalidAttribute): New function.
10764 (Attribute.ScanForIndexerName): Move to ...
10765 (Attributes.ScanForIndexerName): ... here.
10766 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
10767 (Attributes.Search): New internal variant that can choose not to
10768 complain if types aren't resolved. The original signature now
10770 (Attributes.GetClsCompliantAttribute): Use internal variant, with
10771 complaints suppressed.
10772 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
10773 only if it not useful.
10774 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
10775 top-level for attributes that are shared between the assembly
10776 and a top-level class.
10777 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
10778 * class.cs: Update to reflect changes.
10779 (DefineIndexers): Fuse loops.
10780 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
10781 a couple more variants of attribute names.
10783 2004-05-18 Marek Safar <marek.safar@seznam.cz>
10785 Fix bug #52585 (Implemented explicit attribute declaration)
10788 (Attributable.ValidAttributeTargets): New abstract method. It gets
10789 list of valid attribute targets for explicit target declaration.
10790 (Attribute.Target): It holds target itself.
10791 (AttributeSection): Removed.
10792 (Attribute.CheckTargets): New method. It checks whether attribute
10793 target is valid for the current element.
10796 (EventProperty): New class. For events that are declared like
10797 property (with add and remove accessors).
10798 (EventField): New class. For events that are declared like field.
10801 * cs-parser.jay: Implemented explicit attribute target declaration.
10803 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
10804 Override ValidAttributeTargets.
10807 (ReturnParameter): Class for applying custom attributes on
10809 (ParameterAtribute): New class. Class for applying custom
10810 attributes on the parameter type.
10812 2004-05-17 Miguel de Icaza <miguel@ximian.com>
10814 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
10817 (Method): Allow UNSAFE here.
10819 * modifiers.cs: Support unsafe reporting.
10821 2004-05-17 Marek Safar <marek.safar@seznam.cz>
10823 * decl.cs: Fix bug #58478.
10825 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10827 * statement.cs: When checking for unreachable code on an EmptyStatement,
10828 set the location. Fixes bug #58488.
10830 2004-05-13 Miguel de Icaza <miguel@ximian.com>
10832 * driver.cs: Add -pkg handling.
10834 From Gonzalo: UseShelLExecute=false
10836 2004-05-12 Marek Safar <marek.safar@seznam.cz>
10839 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
10841 (Attribute.IsClsCompliaceRequired): Moved to base for better
10843 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
10844 when attribute is AttributeUsageAttribute.
10845 (Attribute.GetValidTargets): Simplified.
10846 (Attribute.GetAttributeUsage): New method returns AttributeUsage
10847 attribute for this type.
10848 (Attribute.ApplyAttributes): Method renamed to Emit and make
10850 (GlobalAttributeSection): New class for special handling of global
10851 attributes (assembly, module).
10852 (AttributeSection.Emit): New method.
10854 * class.cs: Implemented Attributable abstract methods.
10855 (MethodCore.LabelParameters): Moved to Parameter class.
10856 (Accessor): Is back simple class.
10857 (PropertyMethod): Implemented Attributable abstract class.
10858 (DelegateMethod): Implemented Attributable abstract class.
10859 (Event): New constructor for disctintion between normal Event
10860 and Event with accessors.
10862 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
10864 * codegen.cs, const.cs, decl.cs, delegate.cs:
10865 (CommonAssemblyModulClass): Implemented Attributable abstract class
10868 * enum.cs: Implement IAttributeSupport interface.
10869 (EnumMember): New class for emum members. Implemented Attributable
10873 (ParameterBase): Is abstract.
10874 (ReturnParameter): New class for easier [return:] attribute handling.
10876 * typemanager.cs: Removed builder_to_attr.
10878 2004-05-11 Raja R Harinath <rharinath@novell.com>
10881 * attribute.cs (Attribute.GetPositionalValue): New function.
10882 * class.cs (TypeContainer.VerifyMembers): New function.
10883 (TypeContainer.Emit): Use it.
10884 (ClassOrStruct): New base class for Class and Struct.
10885 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
10886 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
10888 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
10889 then each non-static field should have a FieldOffset attribute.
10890 Otherwise, none of the fields should have a FieldOffset attribute.
10891 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
10892 and FieldOffset attributes.
10893 * typemanager.cs (TypeManager.struct_layout_attribute_type)
10894 (TypeManager.field_offset_attribute_type): New core types.
10895 (TypeManager.InitCoreTypes): Initialize them.
10897 2004-05-11 Michal Moskal <malekith@pld-linux.org>
10899 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
10900 Return correct type.
10903 2004-05-09 Miguel de Icaza <miguel@ximian.com>
10905 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
10906 be implicitly converted to ulong.
10908 * expression.cs: The logic for allowing operator &, | and ^ worked
10909 was wrong, it worked before because we did not report an error in
10910 an else branch. Fixes 57895.
10912 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
10913 allow volatile fields to be reference types.
10915 2004-05-07 Miguel de Icaza <miguel@ximian.com>
10917 * driver.cs: Add support for /debug-
10919 2004-05-07 Raja R Harinath <rharinath@novell.com>
10921 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
10922 Add a 'complain' parameter to silence errors.
10923 (Attribute.Resolve): Update to changes. Put in sanity check to catch
10924 silently overlooked type-resolutions.
10925 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
10926 to reflect changes.
10927 (Attributes.Search): New function.
10928 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
10929 (Attributes.GetAttributeFullName): Remove hack.
10930 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
10931 Update to reflect changes.
10932 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10933 Use Attributes.Search instead of nested loops.
10935 2004-05-07 Marek Safar <marek.safar@seznam.cz>
10938 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
10939 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
10940 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
10942 * report.cs: (Report.Warning): Renamed to Warning_T because of
10943 parameter collision.
10945 2004-05-05 Raja R Harinath <rharinath@novell.com>
10947 * expression.cs (MemberAccess.ResolveMemberAccess):
10948 Exit with non-zero status after Report.Error.
10949 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
10951 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
10953 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
10955 * support.cs: Don't hang when the file is empty.
10957 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
10959 * support.cs: In SeekableStreamReader, compute the preamble size of the
10960 underlying stream. Position changes should take into account that initial
10963 2004-05-03 Todd Berman <tberman@sevenl.net>
10965 * driver.cs: remove unused GetSysVersion function.
10967 2004-05-03 Todd Berman <tberman@sevenl.net>
10969 * driver.cs: Remove the hack from saturday, as well as the hack
10970 from jackson (LoadAssemblyFromGac), also adds the CWD to the
10971 link_paths to get that bit proper.
10973 2004-05-01 Todd Berman <tberman@sevenl.net>
10975 * driver.cs: Try a LoadFrom before a Load, this checks the current
10976 path. This is currently a bug in mono that is be fixed, however, this
10977 provides a workaround for now. This will be removed when the bug
10980 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
10982 * CryptoConvert.cs: Updated to latest version. Fix issue with
10983 incomplete key pairs (#57941).
10985 2004-05-01 Todd Berman <tberman@sevenl.net>
10987 * driver.cs: Remove '.' from path_chars, now System.* loads properly
10990 2004-04-30 Jackson Harper <jackson@ximian.com>
10992 * codegen.cs: Open keys readonly.
10994 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10996 * typemanager.cs: don't report cyclic struct layout when a struct
10997 contains 2 or more fields of the same type. Failed for Pango.AttrShape
10998 which has 2 Pango.Rectangle fields.
11000 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
11002 * expression.cs: Handle IntPtr comparisons with IL code
11003 rather than a method call.
11005 2004-04-29 Martin Baulig <martin@ximian.com>
11007 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
11008 the list of PropertyInfo's in class hierarchy and find the
11009 accessor. Fixes #56013.
11011 2004-04-29 Martin Baulig <martin@ximian.com>
11013 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
11015 2004-04-29 Martin Baulig <martin@ximian.com>
11017 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11019 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
11021 2004-04-29 Martin Baulig <martin@ximian.com>
11023 * class.cs (ConstructorInitializer.Resolve): Check whether the
11024 parent .ctor is accessible. Fixes #52146.
11026 2004-04-29 Martin Baulig <martin@ximian.com>
11028 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11030 * statement.cs (Using.EmitLocalVariableDecls): Use
11031 TypeManager.idisposable_type, not typeof (IDisposable).
11032 (Foreach.EmitCollectionForeach): Added support for valuetypes.
11034 2004-04-29 Martin Baulig <martin@ximian.com>
11036 * class.cs (Event.Define): Don't emit the field and don't set
11037 RTSpecialName and SpecialName for events on interfaces. Fixes
11040 2004-04-29 Raja R Harinath <rharinath@novell.com>
11042 Refactor Attribute.ApplyAttributes.
11043 * attribute.cs (Attributable): New base class for objects that can
11044 have Attributes applied on them.
11045 (Attribute): Make AttributeUsage fields public.
11046 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
11047 (Attribute.IsInternalCall): New property.
11048 (Attribute.UsageAttr): Convert to a public read-only property.
11049 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
11050 (Attribute.ResolveType, Attribute.Resolve)
11051 (Attribute.ScanForIndexerName): Update to reflect changes.
11052 (Attribute.CheckAttributeTarget): Re-format.
11053 (Attribute.ApplyAttributes): Refactor, to various
11054 Attributable.ApplyAttributeBuilder methods.
11055 * decl.cs (MemberCore): Make Attributable.
11056 * class.cs (Accessor): Make Attributable.
11057 (MethodData.ApplyAttributes): Use proper attribute types, not
11059 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
11060 (TypeContainer.ApplyAttributeBuilder)
11061 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
11062 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
11063 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
11064 (Operator.ApplyAttributeBuilder): New factored-out methods.
11065 * const.cs (Const.ApplyAttributeBuilder): Likewise.
11066 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
11067 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
11068 * parameter.cs (ParameterBase): New Attributable base class
11069 that can also represent Return types.
11070 (Parameter): Update to the changes.
11072 2004-04-29 Jackson Harper <jackson@ximian.com>
11074 * driver.cs: Prefer the corlib system version when looking for
11075 assemblies in the GAC. This is still a hack, but its a better hack
11078 2004-04-29 Marek Safar <marek.safar@seznam.cz>
11080 * decl.cs, enum.cs: Improved error 3005 reporting.
11082 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
11083 (related_symbols): New private member for list of symbols
11084 related to reported error/warning.
11086 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
11088 2004-04-29 Martin Baulig <martin@ximian.com>
11090 * ecore.cs (Expression.Constantify): If we're an enum and
11091 TypeManager.TypeToCoreType() doesn't give us another type, use
11092 t.UnderlyingSystemType. Fixes #56178.
11094 2004-04-29 Martin Baulig <martin@ximian.com>
11096 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
11097 interfaces and for each interface, only add members directly
11098 declared in that interface. Fixes #53255.
11100 2004-04-28 Martin Baulig <martin@ximian.com>
11102 * expression.cs (ConditionalLogicalOperator): Use a temporary
11103 variable for `left' to avoid that we evaluate it more than once;
11106 2004-04-28 Martin Baulig <martin@ximian.com>
11108 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
11111 2004-04-28 Martin Baulig <martin@ximian.com>
11113 * statement.cs (LocalInfo.Resolve): Check whether the type is not
11116 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
11117 whether the type is not void (CS1547).
11119 2004-04-28 Martin Baulig <martin@ximian.com>
11121 * expression.cs (Unary.DoResolveLValue): Override this and report
11122 CS0131 for anything but Operator.Indirection.
11124 2004-04-28 Martin Baulig <martin@ximian.com>
11126 Committing a patch from Ben Maurer; see bug #50820.
11128 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11131 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11134 2004-04-28 Martin Baulig <martin@ximian.com>
11136 Committing a patch from Ben Maurer; see bug #50820.
11138 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11141 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11144 2004-04-28 Martin Baulig <martin@ximian.com>
11146 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
11147 (Block.AddLabel): Call DoLookupLabel() to only search in the
11150 2004-04-28 Martin Baulig <martin@ximian.com>
11152 * cfold.cs (ConstantFold.BinaryFold): Added special support for
11153 comparing StringConstants and NullLiterals in Equality and Inequality.
11155 2004-04-28 Jackson Harper <jackson@ximian.com>
11157 * driver.cs: Attempt to load referenced assemblies from the
11158 GAC. This is the quick and dirty version of this method that
11159 doesnt take into account versions and just takes the first
11160 canidate found. Will be good enough for now as we will not have more
11161 then one version installed into the GAC until I update this method.
11163 2004-04-28 Martin Baulig <martin@ximian.com>
11165 * typemanager.cs (TypeManager.CheckStructCycles): New public
11166 static method to check for cycles in the struct layout.
11168 * rootcontext.cs (RootContext.PopulateTypes): Call
11169 TypeManager.CheckStructCycles() for each TypeContainer.
11170 [Note: We only need to visit each type once.]
11172 2004-04-28 Martin Baulig <martin@ximian.com>
11174 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
11176 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
11177 success and added `out object value'. Use a `bool resolved' field
11178 to check whether we've already been called rather than
11179 `ConstantValue != null' since this breaks for NullLiterals.
11181 2004-04-28 Raja R Harinath <rharinath@novell.com>
11183 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
11184 setting of this flag, since the 'set' method may be non-public.
11186 2004-04-28 Raja R Harinath <rharinath@novell.com>
11188 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
11189 check on current_vector.Block.
11191 2004-04-27 Martin Baulig <martin@ximian.com>
11193 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
11194 a field initializer. Fixes #56459.
11196 2004-04-27 Martin Baulig <martin@ximian.com>
11198 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
11199 we're not attempting to use an indexer. Fixes #52154.
11201 2004-04-27 Martin Baulig <martin@ximian.com>
11203 * statement.cs (Return): Don't create a return label if we don't
11204 need it; reverts my change from January 20th. Thanks to Ben
11207 2004-04-27 Martin Baulig <martin@ximian.com>
11209 According to the spec, `goto' can only leave a nested scope, but
11212 * statement.cs (Block.LookupLabel): Only lookup in the current
11213 block, don't recurse into parent or child blocks.
11214 (Block.AddLabel): Check in parent and child blocks, report
11215 CS0140/CS0158 if we find a duplicate.
11216 (Block): Removed this indexer for label lookups.
11217 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
11218 this already does the error reporting for us.
11221 (FlowBranching.UsageVector.Block): New public variable; may be null.
11222 (FlowBranching.CreateSibling): Added `Block' argument.
11223 (FlowBranching.LookupLabel): New public virtual method. Lookup a
11224 label for the target of a `goto' and check whether we're not
11225 leaving a `finally'.
11227 2004-04-27 Martin Baulig <martin@ximian.com>
11229 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11230 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
11233 2004-04-27 Martin Baulig <martin@ximian.com>
11235 * statement.cs (Block.AddLabel): Also check for implicit blocks
11236 and added a CS0158 check.
11238 2004-04-27 Martin Baulig <martin@ximian.com>
11240 * flowanalysis.cs (FlowBranchingLoop): New class.
11241 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
11242 UsageVector's instead of an ArrayList.
11243 (FlowBranching.Label): Likewise.
11244 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
11245 (FlowBranching.AddBreakVector): New method.
11247 2004-04-27 Miguel de Icaza <miguel@ximian.com>
11249 * attribute.cs: Small regression fix: only convert the type if we
11250 the type is different, fixes System.Drawing build.
11252 2004-04-27 Martin Baulig <martin@ximian.com>
11254 * attribute.cs (Attribute.Resolve): If we have a constant value
11255 for a named field or property, implicity convert it to the correct
11258 2004-04-27 Raja R Harinath <rharinath@novell.com>
11260 * statement.cs (Block.Block): Implicit blocks share
11261 'child_variable_names' fields with parent blocks.
11262 (Block.AddChildVariableNames): Remove.
11263 (Block.AddVariable): Mark variable as "used by a child block" in
11264 every surrounding block.
11265 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
11266 been used in a child block, complain about violation of "Invariant
11267 meaning in blocks" rule.
11268 * cs-parser.jay (declare_local_variables): Don't use
11269 AddChildVariableNames.
11270 (foreach_statement): Don't create an implicit block: 'foreach'
11271 introduces a scope.
11273 2004-04-23 Miguel de Icaza <miguel@ximian.com>
11275 * convert.cs (ImplicitNumericConversion): 0 is also positive when
11276 converting from 0L to ulong. Fixes 57522.
11278 2004-04-22 Marek Safar <marek.safar@seznam.cz>
11280 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
11281 derived class hides via 'new' keyword field from base class (test-242.cs).
11282 TODO: Handle this in the more general way.
11284 * class.cs (CheckBase): Ditto.
11286 2004-04-22 Marek Safar <marek.safar@seznam.cz>
11288 * decl.cs (caching_flags): New member for storing cached values
11290 (MemberCore.Flags): New enum where bit flags for caching_flags
11292 (MemberCore.cls_compliance): Moved to caching_flags.
11293 (DeclSpace.Created): Moved to caching_flags.
11295 * class.cs: Use caching_flags instead of DeclSpace.Created
11297 2004-04-21 Miguel de Icaza <miguel@ximian.com>
11299 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
11300 if we are only a derived class, not a nested class.
11302 * typemanager.cs: Same as above, but do this at the MemberLookup
11303 level (used by field and methods, properties are handled in
11304 PropertyExpr). Allow for the qualified access if we are a nested
11307 2004-04-21 Marek Safar <marek.safar@seznam.cz>
11309 * class.cs: Refactoring.
11310 (IMethodData): New inteface; Holds links to parent members
11311 to avoid member duplication (reduced memory allocation).
11312 (Method): Implemented IMethodData interface.
11313 (PropertyBase): New inner classes for get/set methods.
11314 (PropertyBase.PropertyMethod): Implemented IMethodData interface
11315 (Event): New inner classes for add/remove methods.
11316 (Event.DelegateMethod): Implemented IMethodData interface.
11318 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
11319 EmitContext (related to class.cs refactoring).
11321 2004-04-21 Raja R Harinath <rharinath@novell.com>
11323 * delegate.cs (Delegate.VerifyApplicability): If the number of
11324 arguments are the same as the number of parameters, first try to
11325 verify applicability ignoring any 'params' modifier on the last
11329 2004-04-08 Martin Baulig <martin@ximian.com>
11331 Merged latest changes into gmcs. Please keep this comment in
11332 here, it makes it easier for me to see what changed in MCS since
11333 the last time I merged.
11335 2004-04-16 Raja R Harinath <rharinath@novell.com>
11337 * class.cs (TypeContainer.AddIndexer): Use
11338 'ExplicitInterfaceName' to determine if interface name was
11339 explicitly specified. 'InterfaceType' is not initialized at this time.
11340 (TypeContainer.DefineIndexers): Remove use of temporary list. The
11341 Indexers array is already in the required order. Initialize
11342 'IndexerName' only if there are normal indexers.
11343 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
11344 (TypeContainer.Emit): Emit DefaultMember attribute only if
11345 IndexerName is initialized.
11348 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
11350 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
11353 2004-04-15 Raja R Harinath <rharinath@novell.com>
11355 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
11359 * attribute.cs (Attribute.Resolve): Check for duplicate named
11363 2004-04-15 Miguel de Icaza <miguel@ximian.com>
11365 * iterators.cs (MarkYield): track whether we are in an exception,
11366 and generate code accordingly. Use a temporary value to store the
11367 result for our state.
11369 I had ignored a bit the interaction of try/catch with iterators
11370 since their behavior was not entirely obvious, but now it is
11371 possible to verify that our behavior is the same as MS .NET 2.0
11375 2004-04-14 Miguel de Icaza <miguel@ximian.com>
11377 * iterators.cs: Avoid creating temporaries if there is no work to
11380 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
11381 Enumerations, use TypeManager.EnumToUnderlying and call
11384 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
11387 (This.Emit): Use EmitContext.EmitThis to emit our
11390 (This.EmitAssign): Ditto.
11392 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
11393 codepaths, we will move all the functionality into
11396 (FieldExpr.EmitAssign): Ditto.
11398 This fixes several hidden bugs that I uncovered while doing a code
11399 review of this today.
11401 * codegen.cs (EmitThis): reworked so the semantics are more clear
11402 and also support value types "this" instances.
11404 * iterators.cs: Changed so that for iterators in value types, we
11405 do not pass the value type as a parameter.
11407 Initialization of the enumerator helpers is now done in the caller
11408 instead of passing the parameters to the constructors and having
11409 the constructor set the fields.
11411 The fields have now `assembly' visibility instead of private.
11413 2004-04-11 Miguel de Icaza <miguel@ximian.com>
11415 * expression.cs (Argument.Resolve): Check if fields passed as ref
11416 or out are contained in a MarshalByRefObject.
11418 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
11419 another compiler type.
11421 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
11423 * class.cs (Indexer.Define): use the new name checking method.
11424 Also, return false on an error.
11425 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
11426 (is_identifier_[start/part]_character): make static.
11428 2004-04-10 Miguel de Icaza <miguel@ximian.com>
11430 * expression.cs (Binary.ResolveOperator): Do no append strings
11431 twice: since we can be invoked more than once (array evaluation)
11432 on the same concatenation, take care of this here. Based on a fix
11433 from Ben (bug #56454)
11435 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
11437 * codegen.cs: Fix another case where CS1548 must be reported (when
11438 delay-sign isn't specified and no private is available #56564). Fix
11439 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
11440 error when MCS is used on the MS runtime and we need to delay-sign
11441 (which seems unsupported by AssemblyBuilder - see #56621).
11443 2004-04-08 Marek Safar <marek.safar@seznam.cz>
11445 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
11446 (TypeManager.ComputeNamespaces): Faster implementation for
11449 * compiler.csproj: Updated AssemblyName to mcs.
11451 2004-05-11 Jackson Harper <jackson@ximian.com>
11453 * Makefile: Preserve MONO_PATH
11455 2004-05-11 Jackson Harper <jackson@ximian.com>
11457 * Makefile: Use mono and mcs to build gmcs
11459 2004-05-03 Miguel de Icaza <miguel@ximian.com>
11461 * codegen.cs: Add patch from Robert Shade
11462 <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
11465 2004-05-02 Sebastien Pouliot <sebastien@ximian.com>
11467 * CryptoConvert.cs: Updated to latest version. Fix issue with
11468 incomplete key pairs (#57941).
11470 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
11472 * codegen.cs: Fix another case where CS1548 must be reported (when
11473 delay-sign isn't specified and no private is available #56564). Fix
11474 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
11475 error when MCS is used on the MS runtime and we need to delay-sign
11476 (which seems unsupported by AssemblyBuilder - see #56621).
11478 2004-04-29 Jackson Harper <jackson@ximian.com>
11480 * Makefile: Set MONO_PATH to use the bootstrap corlib
11481 * driver.cs: Check the GAC for referenced assemblies.
11483 2004-04-29 Martin Baulig <martin@ximian.com>
11485 * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
11487 2004-04-07 Martin Baulig <martin@ximian.com>
11489 * expression.cs (Binary.ResolveOperator): Added special case for
11490 Equality/Inequality between a type parameter and a null literal.
11492 2004-04-07 Martin Baulig <martin@ximian.com>
11494 * convert.cs: Check null literal -> type parameter conversions.
11496 2004-04-07 Martin Baulig <martin@ximian.com>
11498 * generic.cs (ConstructedType.CheckConstraints): Enforce the
11499 `class' and `struct' constraints.
11501 2004-04-07 Martin Baulig <martin@ximian.com>
11503 * generic.cs (SpecialConstraint): New public enum.
11504 (Constraints.Resolve): Added support for the `class' and `struct'
11507 * cs-parser.jay (type_parameter_constraint): Added support for the
11508 `class' and `struct' constraints.
11510 2004-04-07 Martin Baulig <martin@ximian.com>
11512 * support.cs (GenericConstraints): Replaced `Types' by
11513 `ClassConstraint' and `InterfaceConstraints'; added
11514 `HasClassConstraint'.
11516 2004-04-07 Martin Baulig <martin@ximian.com>
11519 (Constraints.InterfaceConstraints): New public property.
11520 (Constraints.Types): Make this property public
11521 (TypeParameter): Implement IMemberContainer.
11522 (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
11523 instead of a TypeBuilder/MethodBuilder; pass the interface
11524 constraints to TypeManager.AddTypeParameter().
11525 (TypeParameter.DefineType): Just take an EmitContext and no
11526 TypeBuilder/MethodBuilder. Use the new public API.
11528 * typemanager.cs (TypeManager.AddTypeParameter): Added
11529 `TypeExpr[]' argument; add the interfaces to the
11530 `builder_to_ifaces' hash.
11531 (TypeManager.LookupMemberContainer): For
11532 GenericTypeParameterBuilders, get the TypeParameter from the
11533 `builder_to_type_param'.
11534 (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
11535 the TypeParameter and call FindMembers on it.
11537 2004-04-07 Martin Baulig <martin@ximian.com>
11540 (MethodCore.GenericMethod): Moved this field here from Method.
11541 (MethodCore.IsDuplicateImplementation): Take the number of type
11542 parameters into account if we're a generic method.
11544 * expression.cs (Invocation.InferTypeArguments): Don't return true
11545 if `arguments' is null; we still need to check whether we actually
11546 don't need to infer anything in this case.
11547 (MemberAccess): Merged the functionality from GenericMemberAccess
11550 * generic.cs (GenericMemberAccess): Removed.
11552 2004-04-05 Martin Baulig <martin@ximian.com>
11554 * decl.cs (MemberCore): For generic classes, interfaces and
11555 structs, `Name' now includes the number of type parameters
11556 ("Stack!1.Node!1").
11557 (DeclSpace.FindType): Removed the `num_type_args' argument; we now
11558 encode the number of type arguments in the type name.
11560 * expression.cs (Expression.MemberLookup): Removed the
11561 `num_type_args' argument; we now encode the number of type
11562 arguments in the type name.
11564 * ecore.cs (SimpleName): Encode the number of type arguments in
11565 the type name itself.
11567 * generic.cs (ConstructedType): Likewise.
11569 * tree.cs (Tree.RecordDecl): Take a `string' instead of a
11570 `MemberName'; we now include the number of type parameters in the
11573 * typemanager.cs (TypeManager.CheckGeneric): Removed.
11574 (TypeManager.MemberLookup): Removed the
11575 `num_type_args' argument; we now encode the number of type
11576 arguments in the type name.
11578 2004-04-03 Martin Baulig <martin@ximian.com>
11580 * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
11581 (MemberCore.MemberName): Moved here from MemberBase.
11582 (DeclSpace.SetParameterInfo): Just take the constraints as an
11583 ArrayList; we already have the type parameters in our
11584 `MemberName'; also do the CS0080 reporting here.
11586 * cs-parser.jay (struct_declaration): Use `member_name' instead of
11587 `IDENTIFIER opt_type_parameter_list'; when constructing our
11588 `MemberName', it'll already include our type parameters.
11589 (class_declaration, interface_declaration): Likewise.
11590 (delegate_declaration): Likewise.
11591 (MakeName): Take a MemberName and return a MemberName.
11592 The following two changes are required to avoid shift/reduce conflicts:
11593 (member_name): Don't include a TypeName anymore; ie. this is now
11594 just 'IDENTIFIER opt_type_parameter_list'.
11595 (property_declaration, event_declaration): Use a
11596 `namespace_or_type_name' instead of a `member_name'.
11598 2004-04-03 Martin Baulig <martin@ximian.com>
11600 * decl.cs (MemberName): Renamed to `TypeName' and created a new
11601 `MemberName' class.
11602 (TypeName): Formerly known as MemberName.
11604 * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
11605 instead of a `MemberName'.
11607 * cs-parser.jay (namespace_or_type_name): Create a TypeName.
11608 (member_name): New rule; create a MemberName.
11610 2004-04-02 Martin Baulig <martin@ximian.com>
11612 * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
11613 (CS0305 and CS0308).
11615 2004-04-02 Martin Baulig <martin@ximian.com>
11617 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
11618 support for nested types.
11620 2004-04-02 Martin Baulig <martin@ximian.com>
11622 * ecore.cs (IAlias): New public interface.
11623 (TypeExpr, TypeExpression): Implement IAlias.
11624 (TypeAliasExpression): New public class.
11626 * namespace.cs (Namespace): Implement IAlias.
11627 (Namespace.Lookup): Return an IAlias instead on an object.
11628 (Namespace.DefineName): Take an IAlias instead of an object.
11629 (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
11631 (NamespaceEntry.UsingAlias): Take a Membername instead of an
11633 (NamespaceEntry.LookupAlias): Return an IAlias instead on an
11635 (NamespaceEntry.Lookup): Likewise.
11637 * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
11640 * decl.cs (DeclSpace): Implement IAlias.
11641 (DeclSpace.LookupAlias): Return an IAlias instead of a string.
11643 * generic.cs (ConstructedType): Improved error checking.
11645 2004-04-02 Martin Baulig <martin@ximian.com>
11647 * convert.cs: Added type parameter conversions.
11650 (UnboxCast.Emit): Emit an `unbox.any' for type params.
11651 (ClassCast.Emit): If the source type is a type parameter, box it.
11652 If the target type is a type parameter, emit an `unbox.any'
11653 instead of a `classcast'.1
11655 2004-04-01 Martin Baulig <martin@ximian.com>
11657 * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
11659 2004-04-01 Martin Baulig <martin@ximian.com>
11661 * generic.cs (ConstructedType.CheckConstraints): Use
11662 Convert.ImplicitStandardConversionExists(); user-defined implicit
11663 conversions are not allowed according to the spec.
11665 2004-03-30 Martin Baulig <martin@ximian.com>
11667 * expression.cs (New): Added support for type parameters.
11670 (TypeManager.activator_type): New public static field.
11671 (TypeManager.activator_create_instance): Likewise.
11673 2004-03-30 Martin Baulig <martin@ximian.com>
11675 * typemanager.cs (TypeManager.HasConstructorConstraint): New
11678 2004-03-30 Martin Baulig <martin@ximian.com>
11680 * generic.cs (ConstructedType.CheckConstraints): Actually follow
11681 the spec here: the argument type must be convertible to the
11684 2004-03-30 Martin Baulig <martin@ximian.com>
11687 (TypeParameter.Define, TypeParameter.DefineMethod): Call
11688 TypeManager.AddTypeParameter().
11689 (ConstructedType.CheckConstraints): Re-enable this and actually
11690 check whether we have a constructor constraint.
11693 (TypeManager.builder_to_type_param): New static field.
11694 (TypeManager.AddTypeParameter): New static method.
11695 (TypeManager.LookupTypeParameter): New public method.
11697 2004-03-30 Martin Baulig <martin@ximian.com>
11699 * generic.cs (TypeParameter.DefineType): Return a boolean and use
11700 the new API to actually define the constructor constraint.
11703 (TypeManager.new_constraint_attr_type): New static field.
11704 (TypeManager.InitCoreTypes): Initialize it.
11706 2004-03-30 Martin Baulig <martin@ximian.com>
11708 * generic.cs (Constraints): Completed error checking, use correct
11711 2004-03-29 Martin Baulig <martin@ximian.com>
11713 * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
11715 * expression.cs (Invocation.InferTypeArguments): Added overloaded
11716 public version which takes a `ParameterData pd' instead of an
11719 2004-03-29 Martin Baulig <martin@ximian.com>
11721 * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
11724 2004-03-29 Martin Baulig <martin@ximian.com>
11726 * expression.cs (Argument.ResolveMethodGroup): If we're a
11727 ConstructedType, call GetMemberAccess() on it.
11729 2004-03-29 Martin Baulig <martin@ximian.com>
11731 * class.cs (MethodBase.CheckGenericOverride): New abstract method.
11732 (MethodCore.CheckGenericOverride): When overriding a generic
11733 method, check whether the constraints match.
11735 * support.cs (GenericConstraints): New public interface.
11736 (ParameterData.GenericConstraints): New public method.
11738 * parameter.cs (Parameter.Resolve): Check whether we're a generic
11739 method parameter and compute our constraints if appropriate.
11740 (Parameter.GenericConstraints): New public property.
11742 * generic.cs (Constraints): Implement GenericConstraints.
11744 2004-03-29 Martin Baulig <martin@ximian.com>
11746 * decl.cs (MemberCache.FindMemberToOverride): Use
11747 `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
11749 2004-03-29 Martin Baulig <martin@ximian.com>
11751 * generic.cs (GenericMethod.Define): Resolve our type parameters.
11753 2004-03-29 Martin Baulig <martin@ximian.com>
11755 * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
11756 not allowed on non-generic declarations").
11758 2004-03-29 Martin Baulig <martin@ximian.com>
11760 * expression.cs (Invocation.InferTypeArguments): Added overloaded
11761 public version of this method.
11763 * class.cs (MethodCore.IsDuplicateImplementation): Use
11764 Invocation.InferTypeArguments() to check this.
11766 2004-03-29 Martin Baulig <martin@ximian.com>
11768 * convert.cs: Use TypeManager.IsDelegateType() instead of
11769 comparing types correctly.
11771 2004-03-29 Martin Baulig <martin@ximian.com>
11773 * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
11774 types directly to make it work for generic instances.
11776 * typemanager.cs (TypeManager.IsSubclassOf): New static method.
11778 2004-03-29 Martin Baulig <martin@ximian.com>
11780 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
11781 support for arrays.
11783 2004-03-24 Martin Baulig <martin@ximian.com>
11785 * decl.cs (DeclSpace.FindType): Also use
11786 TypeManager.CheckGeneric() for types from the using clauses.
11788 2004-03-23 Martin Baulig <martin@ximian.com>
11790 * expression.cs (Invocation.OverloadResolve): Added `bool
11791 may_fail' argument and use it instead of the Location.IsNull() hack.
11793 2004-03-23 Martin Baulig <martin@ximian.com>
11795 * expression.cs (Invocation.InferType): Use correct type inference
11798 2004-03-23 Martin Baulig <martin@ximian.com>
11800 * ecore.cs (MethodGroupExpr.Name): Use
11801 TypeManager.CSharpSignature() instead of just the name.
11803 * expression.cs (Invocation.OverloadResolve): Provide better error
11805 (Invocation.DoResolve): OverloadResolve() never returns null
11806 without reporting an error, so removed the error -6 reporting here.
11808 2004-03-23 Martin Baulig <martin@ximian.com>
11810 * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
11813 * cs-parser.jay (delegate_declaration): Support generic delegates.
11815 * delegate.cs: Support generic delegates.
11817 2004-03-22 Martin Baulig <martin@ximian.com>
11819 * expression.cs (Invocation.InferParamsTypeArguments): New static
11820 method; does type inference for params arguments.
11822 2004-03-21 Martin Baulig <martin@ximian.com>
11824 * typemanager.cs (TypeManager.IsGenericMethod): New public static
11825 method; checks whether a method is a generic method.
11827 * expression.cs (Invocation.InferTypeArguments): New static method;
11828 infer type arguments for generic method invocation.
11830 * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
11831 property; we set this to true if we're resolving a generic method
11832 invocation and the user specified type arguments, ie. we're not
11833 doing type inference.
11835 2004-03-20 Martin Baulig <martin@ximian.com>
11837 * class.cs (MethodData.DeclaringType): New public property.
11838 (MethodData.Define): Set DeclaringType here.
11839 (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
11840 instead of OperatorMethodBuilder.DeclaringType.
11842 2004-03-20 Martin Baulig <martin@ximian.com>
11844 * cs-tokenizer.cs (xtoken): Return a special
11845 Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
11847 * cs-parser.jay (default_value_expression): Switch to the new
11850 2004-03-19 Martin Baulig <martin@ximian.com>
11852 * decl.cs (MemberName): New class. We use this to "construct"
11853 namespace_or_type_name's.
11855 * generics.cs (TypeArguments.GetDeclarations): New public method;
11856 returns the type arguments as a string[] and reports a CS0081 if
11857 one of them is not an identifier.
11859 * class.cs (MemberBase): The .ctor now takes the name as a
11860 MemberName instead of a string.
11861 (MemberBase.ExplicitInterfaceName): Changed type from string to
11863 (MemberBase.DoDefine): If we're an explicit implementation, the
11864 InterfaceType may be a generic instance.
11866 * cs-parser.jay (namespace_or_type_name): Return a MemberName.
11867 (namespace_name): Call MemberName.GetName () to transform the
11868 MemberName into a string and ensure we don't have any type
11870 (type_name): Call MemberName.GetTypeExpression() to transfrom the
11871 MemberName into an expression.
11872 (method_header): Use namespace_or_type_name instead of member_name.
11874 2004-04-07 Miguel de Icaza <miguel@ximian.com>
11876 * rootcontext.cs: Add new types to the boot resolution.
11878 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
11879 MulticastDelegate is not allowed.
11881 * typemanager.cs: Add new types to lookup: System.TypedReference
11884 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
11885 check for TypedReference or ArgIterator, they are not allowed.
11887 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
11888 makes us properly catch 1510 in some conditions (see bug 56016 for
11891 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
11893 * CryptoConvert.cs: update from corlib version
11896 2004-04-05 Miguel de Icaza <miguel@ximian.com>
11898 * class.cs (Indexer.Define): Check indexername declaration
11900 2004-04-05 Marek Safar <marek.safar@seznam.cz>
11902 * attribute.cs (IsClsCompliant): Fixed problem with handling
11903 all three states (compliant, not-compliant, undetected).
11905 2004-03-30 Marek Safar <marek.safar@seznam.cz>
11907 * attribute.cs (Attribute): Location is now public.
11908 (Resolve): Store resolved arguments (pos_values) in attribute class.
11909 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
11910 (GetClsCompliantAttributeValue): New method that gets
11911 CLSCompliantAttribute value.
11912 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
11913 if exists else null.
11914 (AttributeTester): New class for CLS-Compliant verification routines.
11916 * class.cs (Emit): Add CLS-Compliant verification.
11917 (Method.GetSignatureForError): Implemented.
11918 (Constructor.GetSignatureForError): Implemented
11919 (Constructor.HasCompliantArgs): Returns if constructor has
11920 CLS-Compliant arguments.
11921 (Constructor.Emit): Override.
11922 (Construcor.IsIdentifierClsCompliant): New method; For constructors
11923 is needed to test only parameters.
11924 (FieldBase.GetSignatureForError): Implemented.
11925 (TypeContainer): New member for storing base interfaces.
11926 (TypeContainer.FindMembers): Search in base interfaces too.
11928 * codegen.cs (GetClsComplianceAttribute): New method that gets
11929 assembly or module CLSCompliantAttribute value.
11930 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
11932 (ModuleClass.Emit): Add error 3012 test.
11934 * const.cs (Emit): Override and call base for CLS-Compliant tests.
11936 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
11937 state for all decl types.
11938 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
11939 if CLS-Compliant tests are required.
11940 (IsClsCompliaceRequired): New method. Analyze whether code
11941 must be CLS-Compliant.
11942 (IsExposedFromAssembly): New method. Returns true when MemberCore
11943 is exposed from assembly.
11944 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
11945 value or gets cached value.
11946 (HasClsCompliantAttribute): New method. Returns true if MemberCore
11947 is explicitly marked with CLSCompliantAttribute.
11948 (IsIdentifierClsCompliant): New abstract method. This method is
11949 used to testing error 3005.
11950 (IsIdentifierAndParamClsCompliant): New method. Common helper method
11951 for identifier and parameters CLS-Compliant testing.
11952 (VerifyClsCompliance): New method. The main virtual method for
11953 CLS-Compliant verifications.
11954 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
11955 null. I don't know why is null (too many public members !).
11956 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
11957 and get value of first CLSCompliantAttribute that found.
11959 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
11960 (VerifyClsCompliance): Override and add extra tests.
11962 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
11963 clscheck- disable CLS-Compliant verification event if assembly is has
11964 CLSCompliantAttribute(true).
11966 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
11967 ApllyAttribute is now called in emit section as in the other cases.
11968 Possible future Emit integration.
11969 (IsIdentifierClsCompliant): New override.
11970 (VerifyClsCompliance): New override.
11971 (GetEnumeratorName): Returns full enum name.
11973 * parameter.cs (GetSignatureForError): Implemented.
11975 * report.cs (WarningData): New struct for Warning message information.
11976 (LocationOfPreviousError): New method.
11977 (Warning): New method. Reports warning based on the warning table.
11978 (Error_T): New method. Reports error based on the error table.
11980 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
11981 verifications are done here.
11983 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
11985 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
11986 CLSCompliantAttribute.
11987 (all_imported_types): New member holds all imported types from other
11989 (LoadAllImportedTypes): New method fills static table with exported types
11990 from all referenced assemblies.
11991 (Modules): New property returns all assembly modules.
11993 2004-03-30 Miguel de Icaza <miguel@ximian.com>
11995 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
11996 throwing a parser error.
11998 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
11999 which removes the hardcoded get_/set_ prefixes for properties, as
12000 IL allows for the properties to be named something else.
12004 * expression.cs: Do not override operand before we know if it is
12005 non-null. Fix 56207
12007 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
12009 * typemanager.cs: support for pinned variables.
12011 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
12013 * decl.cs, typemanager.cs: Avoid using an arraylist
12014 as a buffer if there is only one result set.
12016 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
12018 * expression.cs: Make sure you cant call a static method
12019 with an instance expression, bug #56174.
12021 2004-03-29 Miguel de Icaza <miguel@ximian.com>
12023 * class.cs (IsDuplicateImplementation): Improve error reporting to
12024 flag 663 (method only differs in parameter modifier).
12026 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
12027 in preprocessor directives.
12029 * location.cs (LookupFile): Allow for the empty path.
12031 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
12032 better approach for some of that patch, but its failing with the
12033 CharSet enumeration. For now try/catch will do.
12035 * typemanager.cs: Do not crash if a struct does not have fields.
12038 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
12040 * expression.cs: cs0213, cant fix a fixed expression.
12043 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
12045 * cs-parser.jay: detect invalid embeded statements gracefully.
12048 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
12050 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
12053 the invocation type may not be a subclass of the tye of the item/
12054 The type of the item must be a subclass of the invocation item.
12059 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
12061 * attribute.cs: Added methods to get a string and a bool from an
12062 attribute. Required to information from AssemblyKeyFileAttribute,
12063 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
12064 * codegen.cs: Modified AssemblyName creation to include support for
12065 strongnames. Catch additional exceptions to report them as CS1548.
12066 * compiler.csproj: Updated include CryptoConvert.cs.
12067 * compiler.csproj.user: Removed file - user specific configuration.
12068 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
12069 Mono.Security assembly. The original class is maintained and tested in
12070 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
12071 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
12072 like CSC 8.0 (C# v2) supports.
12073 * Makefile: Added CryptoConvert.cs to mcs sources.
12074 * rootcontext.cs: Added new options for strongnames.
12076 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
12078 * driver.cs: For --expect-error, report error code `2'
12079 if the program compiled with no errors, error code `1' if
12080 it compiled with an error other than the one expected.
12082 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
12084 * compiler.csproj: Updated for Visual Studio .NET 2003.
12085 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
12086 * compiler.sln: Updated for Visual Studio .NET 2003.
12088 2004-03-24 Ravi Pratap M <ravi@ximian.com>
12090 * expression.cs: Fix bug #47234. We basically need to apply the
12091 rule that we prefer the conversion of null to a reference type
12092 when faced with a conversion to 'object' (csc behaviour).
12094 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12096 * statement.cs: Shorter form for foreach, eliminates
12097 a local variable. r=Martin.
12099 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12101 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
12102 checks if we can use brtrue/brfalse to test for 0.
12103 * expression.cs: use the above in the test for using brtrue/brfalse.
12104 cleanup code a bit.
12106 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12108 * expression.cs: Rewrite string concat stuff. Benefits:
12110 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
12111 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
12112 rather than a concat chain.
12114 * typemanager.cs: Add lookups for more concat overloads.
12116 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12118 * expression.cs: Emit shorter il code for array init.
12135 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
12137 * statement.cs: Before, two switch blocks would be merged if the
12138 total size of the blocks (end_item - begin_item + 1) was less than
12139 two times the combined sizes of the blocks.
12141 Now, it will only merge if after the merge at least half of the
12146 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
12148 * class.cs : csc build fix for GetMethods(). See bug #52503.
12150 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
12152 * expression.cs: Make sure fp comparisons work with NaN.
12153 This fixes bug #54303. Mig approved this patch a long
12154 time ago, but we were not able to test b/c the runtime
12157 2004-03-19 Miguel de Icaza <miguel@ximian.com>
12159 * ecore.cs (TypExpr.GetHashCode): implement this overload.
12161 2004-03-19 Martin Baulig <martin@ximian.com>
12163 * class.cs (MemberCore.IsDuplicateImplementation): Check whether
12164 two overloads may unify for some type parameter substitutions and
12165 report a CS0408 if appropriate.
12167 2004-03-19 Martin Baulig <martin@ximian.com>
12169 * class.cs (MemberCore.IsDuplicateImplementation): Report the
12170 error here and not in our caller.
12172 2004-03-19 Martin Baulig <martin@ximian.com>
12174 * interface.cs: Completely killed this file.
12175 (Interface): We're now a TypeContainer and live in class.cs.
12177 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
12178 argument; we're now also called for interfaces.
12179 (TypeContainer.DefineMembers): Allow this method being called
12181 (TypeContainer.GetMethods): New public method; formerly known as
12182 Interface.GetMethod(). This is used by PendingImplementation.
12183 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
12184 it's now private and non-static.
12185 (Interface): Moved this here; it's now implemented similar to
12187 (Method, Property, Event, Indexer): Added `bool is_interface'
12188 argument to their .ctor's.
12189 (MemberBase.IsInterface): New public field.
12191 * cs-parser.jay: Create normal Method, Property, Event, Indexer
12192 instances instead of InterfaceMethod, InterfaceProperty, etc.
12193 (opt_interface_base): Removed; we now use `opt_class_base' instead.
12194 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
12196 2004-03-19 Martin Baulig <martin@ximian.com>
12198 * class.cs (MethodCore.IsDuplicateImplementation): New private
12199 method which does the CS0111 checking.
12200 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
12201 Use IsDuplicateImplementation().
12203 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
12205 * decl.cs (FindMemberToOverride): New method to find the correct
12206 method or property to override in the base class.
12208 - Make Method/Property use the above method to find the
12209 version in the base class.
12210 - Remove the InheritableMemberSignatureCompare as it is now
12213 This patch makes large code bases much faster to compile, as it is
12214 O(n) rather than O(n^2) to do this validation.
12216 Also, it fixes bug 52458 which is that nested classes are not
12217 taken into account when finding the base class member.
12219 Reviewed/Approved by Martin.
12221 2004-03-17 Martin Baulig <martin@ximian.com>
12223 * expression.cs (MemberAccess.DoResolve): Take the parent's number
12224 of type arguments into account; use the `real_num_type_args'
12225 approach like in DoResolveAsTypeStep().
12227 * generic.cs (GenericMemberAccess.DoResolve): Make this work for
12230 2004-03-17 Marek Safar <marek.safar@seznam.cz>
12232 * interface.cs: In all interface classes removed redundant
12233 member initialization.
12235 2004-03-16 Martin Baulig <martin@ximian.com>
12237 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12239 2004-03-15 Miguel de Icaza <miguel@ximian.com>
12241 * decl.cs (DefineTypeAndParents): New helper method to define a
12242 type's containers before the type itself is defined; This is a
12243 bug exposed by the recent changes to Windows.Forms when an
12244 implemented interface was defined inside a class that had not been
12247 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
12249 (Check): Loop correctly to report errors modifiers
12250 (UNSAFE was not in the loop, since it was the same as TOP).
12252 * interface.cs: Every interface member now takes a ModFlags,
12253 instead of a "is_new" bool, which we set on the base MemberCore.
12255 Every place where we called "UnsafeOk" in the interface, now we
12256 call the proper member (InterfaceMethod.UnsafeOK) instead to get
12257 the unsafe settings from the member declaration instead of the
12258 container interface.
12260 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
12262 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12263 `set_indexer_name' to the pending bits (one per type).
12265 We fixed a bug today that was picking the wrong method to
12266 override, since for properties the existing InterfaceMethod code
12267 basically ignored the method name. Now we make sure that the
12268 method name is one of the valid indexer names.
12270 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
12272 * support.cs (SeekableStreamReader): Keep track of stream byte
12273 positions and don't mix them with character offsets to the buffer.
12275 Patch from Gustavo Giráldez
12277 2004-03-15 Marek Safar <marek.safar@seznam.cz>
12279 * interface.cs (InterfaceSetGetBase): Removed double member
12280 initialization, base class does it as well.
12282 2004-03-13 Martin Baulig <martin@ximian.com>
12284 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
12285 when compiling corlib.
12287 2004-03-13 Miguel de Icaza <miguel@ximian.com>
12289 * convert.cs (ExplicitConversion): We were reporting an error on
12290 certain conversions (object_type source to a value type, when the
12291 expression was `null') before we had a chance to pass it through
12292 the user defined conversions.
12294 * driver.cs: Replace / and \ in resource specifications to dots.
12297 * class.cs: Add check for duplicate operators. Fixes 52477
12299 2004-03-11 Miguel de Icaza <miguel@ximian.com>
12301 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
12302 that are in the middle of the statements, not only at the end.
12305 * class.cs (TypeContainer.AddField): No longer set the
12306 `HaveStaticConstructor' flag, now we call it
12307 `UserDefineStaticConstructor' to diferentiate the slightly
12308 semantic difference.
12310 The situation is that we were not adding BeforeFieldInit (from
12311 Modifiers.TypeAttr) to classes that could have it.
12312 BeforeFieldInit should be set to classes that have no static
12317 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
12319 And most importantly Zoltan's comment:
12321 http://bugzilla.ximian.com/show_bug.cgi?id=44229
12323 "I think beforefieldinit means 'it's ok to initialize the type sometime
12324 before its static fields are used', i.e. initialization does not need
12325 to be triggered by the first access to the type. Setting this flag
12326 helps the JIT to compile better code, since it can run the static
12327 constructor at JIT time, and does not need to generate code to call it
12328 (possibly lots of times) at runtime. Unfortunately, mcs does not set
12329 this flag for lots of classes like String.
12331 csc sets this flag if the type does not have an explicit static
12332 constructor. The reasoning seems to be that if there are only static
12333 initalizers for a type, and no static constructor, then the programmer
12334 does not care when this initialization happens, so beforefieldinit
12337 This bug prevents the AOT compiler from being usable, since it
12338 generates so many calls to mono_runtime_class_init that the AOT code
12339 is much slower than the JITted code. The JITted code is faster,
12340 because it does not generate these calls if the vtable is type is
12341 already initialized, which is true in the majority of cases. But the
12342 AOT compiler can't do this."
12344 2004-03-10 Miguel de Icaza <miguel@ximian.com>
12346 * class.cs (MethodData.Emit): Refactor the code so symbolic
12347 information is generated for destructors; For some reasons we
12348 were taking a code path that did not generate symbolic information
12351 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
12353 * class.cs: Create a Constructor.CheckBase method that
12354 takes care of all validation type code. The method
12355 contains some code that was moved from Define.
12357 It also includes new code that checks for duplicate ctors.
12358 This fixes bug #55148.
12360 2004-03-09 Joshua Tauberer <tauberer@for.net>
12362 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
12363 a { ... }-style array creation invokes EmitStaticInitializers
12364 which is not good for reference-type arrays. String, decimal
12365 and now null constants (NullCast) are not counted toward
12366 static initializers.
12368 2004-03-05 Martin Baulig <martin@ximian.com>
12370 * location.cs (SourceFile.HasLineDirective): New public field;
12371 specifies whether the file contains or is referenced by a "#line"
12373 (Location.DefineSymbolDocuments): Ignore source files which
12374 either contain or are referenced by a "#line" directive.
12376 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
12378 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
12379 direct access to our parent, so check the method inline there.
12381 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
12383 * expression.cs (Invocation.EmitCall): Miguel's last commit
12384 caused a regression. If you had:
12389 In Foo the implict this would be null.
12391 2004-02-27 Miguel de Icaza <miguel@ximian.com>
12393 * expression.cs (Invocation.EmitCall): If the method is not
12394 virtual, do not emit a CallVirt to it, use Call.
12396 * typemanager.cs (GetFullNameSignature): Improve the method to
12397 cope with ".ctor" and replace it with the type name.
12399 * class.cs (ConstructorInitializer.Resolve): Now the method takes
12400 as an argument the ConstructorBuilder where it is being defined,
12401 to catch the recursive constructor invocations.
12403 2004-03-16 Martin Baulig <martin@ximian.com>
12405 * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
12406 ConstructedType, call ResolveType() on it to get the type rather
12407 than just using `expr.Type'.
12409 2004-03-16 Martin Baulig <martin@ximian.com>
12411 * generics.cs (ConstructedType.GetMemberAccess): Take the
12412 EmitContext instead on the TypeExpr and use
12413 ec.TypeContainer.CurrentType/ec.ContainerType.
12415 2004-03-16 Martin Baulig <martin@ximian.com>
12417 * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
12418 parameters before aliases.
12420 2004-03-16 Martin Baulig <martin@ximian.com>
12422 * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
12423 New oublic function; checks whether two generic instances may become
12424 equal under some instantiations (26.3.1).
12426 * class.cs (TypeContainer.Define): Call
12427 TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
12430 2004-03-16 Martin Baulig <martin@ximian.com>
12432 * class.cs (TypeContainer.GetClassBases): Moved
12433 Error_TypeParameterAsBase() here and also check whether the base
12434 class is not an attribute.
12436 2004-03-16 Martin Baulig <martin@ximian.com>
12438 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12440 2004-03-16 Martin Baulig <martin@ximian.com>
12442 * class.cs (Error_TypeParameterAsBase): Use correct error number
12445 2004-03-16 Martin Baulig <martin@ximian.com>
12447 * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
12450 * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
12453 2004-03-15 Martin Baulig <martin@ximian.com>
12455 * typemanager.cs (TypeManager.GetFullName): New public method.
12456 (TypeManager.MemberLookup): Added `int_num_type_arguments'
12457 argument; only return members with the correct number of type
12459 (TypeManager.CheckGeneric): Allow -1 to bypass the check.
12460 (TypeManager.FilterWithClosure): Call CheckGeneric() to check
12461 whether the number of type arguments matches.
12463 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
12464 not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
12466 * expression.cs (MemberAccess): Added public `NumTypeArguments'
12467 field; it's set by the protected .ctor when we're actually a
12468 GenericMemberAccess.
12469 (MemberAccess.ResolveAsTypeStep): Compute the total number of type
12470 arguments and pass it to MemberLookupFinal ().
12472 * ecore.cs (Expression.MemberLookup): Added `int
12473 num_type_arguments' argument; only return members with the correct
12474 number of type arguments.
12475 (Expression.MemberLookupFailed): Check whether the MemberLookup
12476 failed because we did not have the correct number of type
12477 arguments; report CS0305 in this case.
12479 * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
12480 `e.ResolveAsTypeTerminal()' already did so.
12482 2004-03-15 Martin Baulig <martin@ximian.com>
12484 * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
12485 we're a ConstructedType; in this case, the caller must report an
12486 error (for instance CS0131).
12488 * generic.cs (TypeArguments): Added Location argument to the .ctor.
12489 (TypeArguments.Resolve): Actually report errors here.
12491 2004-03-15 Miguel de Icaza <miguel@ximian.com>
12493 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12494 `set_indexer_name' to the pending bits (one per type).
12496 We fixed a bug today that was picking the wrong method to
12497 override, since for properties the existing InterfaceMethod code
12498 basically ignored the method name. Now we make sure that the
12499 method name is one of the valid indexer names.
12501 2004-03-15 Martin Baulig <martin@ximian.com>
12503 * typemanager.cs (TypeManager.IndexerPropertyName): Added support
12504 for generic instances.
12506 2004-03-13 Martin Baulig <martin@ximian.com>
12508 * class.cs (TypeContainer.DefineType): Call
12509 TypeManager.AddUserType() immediately after creating the
12510 TypeBuilder; pass all type parameters when creating the
12513 * decl.cs (DeclSpace.FindNestedType): New public method.
12514 (DeclSpace.FindType): Added `int num_type_args' argument; only
12515 return types with the correct number of type parameters.
12516 (DeclSpace.CountTypeParams): New public property.
12518 * ecore.cs (SimpleName.ctor): Added overloaded version which takes
12519 the number of type parameters; defaults to zero.
12521 * generic.cs (TypeArguments.Count): New public property.
12522 (ConstructedType.DoResolveAsTypeStep): First call
12523 ds.FindNestedType() to find out whether we're nested in the
12524 current generic type; in this case, we inherit all type parameters
12525 from the current class.
12527 * rootcontext.cs (RootContext.NamespaceLookup): Added `int
12528 num_type_args' argument.
12529 (RootContext.LookupType): Added overloaded version which takes the
12530 number of type arguments; only return types with the correct
12531 number of type arguments.
12533 * typemanager.cs (TypeManager.CheckGeneric): New public function;
12534 checks whether `Type t' has `int num_type_args'.
12536 2004-03-13 Martin Baulig <martin@ximian.com>
12538 * generic.cs (GenericMethod.DefineType): New method; calls
12539 DefineType() on all the type parameters.
12541 * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
12542 (MethodData.Define): If we're a generic method, call
12543 GenericMethod.DefineType() to define the type parameters.
12545 2004-03-10 Martin Baulig <martin@ximian.com>
12547 * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
12548 instead of IsAssignableFrom.
12550 2004-03-10 Martin Baulig <martin@ximian.com>
12552 * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
12554 * support.cs (ParameterData.HasArrayParameter): New property.
12555 (ReflectionParameters.ctor): Take a MethodBase instead of a
12556 ParameterInfo[]. If we have any type parameters, get the generic
12557 method definition and ask it whether we have variable arguments.
12559 2004-02-26 Miguel de Icaza <miguel@ximian.com>
12561 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
12562 routines to check if a type is an enumerable/enumerator allow
12563 classes that implement the IEnumerable or IEnumerator interfaces.
12565 * class.cs (Property, Operator): Implement IIteratorContainer, and
12566 implement SetYields.
12568 (Property.Define): Do the block swapping for get_methods in the
12569 context of iterators. We need to check if Properties also
12570 include indexers or not.
12572 (Operator): Assign the Block before invoking the
12573 OperatorMethod.Define, so we can trigger the Iterator code
12576 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
12577 Property and Operator classes are not created when we parse the
12578 declarator but until we have the block completed, so we use a
12579 singleton SimpleIteratorContainer.Simple to flag whether the
12580 SetYields has been invoked.
12582 We propagate this setting then to the Property or the Operator to
12583 allow the `yield' to function.
12585 2004-02-25 Marek Safar <marek.safar@seznam.cz>
12587 * codegen.cs: Implemented attribute support for modules.
12588 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
12589 Assembly/Module functionality.
12591 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
12592 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
12593 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
12595 2004-02-16 Marek Safar <marek.safar@seznam.cz>
12597 * interface.cs (FindMembers): The operation is performed on all base
12598 interfaces and not only on the first. It is required for future CLS Compliance patch.
12600 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
12602 * statement.cs, codegen.cs:
12603 This patch deals with patterns such as:
12605 public class List : IEnumerable {
12607 public MyEnumerator GetEnumerator () {
12608 return new MyEnumerator(this);
12611 IEnumerator IEnumerable.GetEnumerator () {
12615 public struct MyEnumerator : IEnumerator {
12620 Before, there were a few things we did wrong:
12621 1) we would emit callvirt on a struct, which is illegal
12622 2) we emited ldarg when we needed to emit ldarga
12623 3) we would mistakenly call the interface methods on an enumerator
12624 type that derived from IEnumerator and was in another assembly. For example:
12626 public class MyEnumerator : IEnumerator
12628 Would have the interface methods called, even if there were public impls of the
12629 method. In a struct, this lead to invalid IL code.
12631 2004-02-11 Marek Safar <marek.safar@seznam.cz>
12633 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
12636 * delegate.cs (Define): Fixed crash when delegate type is undefined.
12638 2004-02-11 Miguel de Icaza <miguel@ximian.com>
12640 * cs-parser.jay: Fix small regression: we were not testing V2
12641 compiler features correctly.
12643 * interface.cs: If the emit context is null, then create one
12645 2004-02-09 Marek Safar <marek.safar@seznam.cz>
12647 * decl.cs (GetSignatureForError): New virtual method to get full name
12648 for error messages.
12650 * attribute.cs (IAttributeSupport): New interface for attribute setting.
12651 Now it is possible to rewrite ApplyAttributes method to be less if/else.
12653 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
12654 Duplicated members and code in these classes has been removed.
12655 Better encapsulation in these classes.
12657 2004-02-07 Miguel de Icaza <miguel@ximian.com>
12659 * assign.cs (Assign.DoResolve): When dealing with compound
12660 assignments, there is a new rule in ECMA C# 2.4 (might have been
12661 there before, but it is documented here) that states that in:
12665 If b is of type int, and the `op' is a shift-operator, then the
12666 above is evaluated as:
12670 * expression.cs (Binary.ResolveOperator): Instead of testing for
12671 int/uint/long/ulong, try to implicitly convert to any of those
12672 types and use that in pointer arithmetic.
12674 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
12675 method to print information for from the type, not from the
12676 null-method we were given.
12678 2004-02-01 Duncan Mak <duncan@ximian.com>
12680 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
12681 parsing for cmd, fixes bug #53694.
12683 2004-02-04 Marek Safar <marek.safar@seznam.cz>
12685 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
12686 in the member name duplication tests. Property and operator name duplication
12687 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
12689 2004-02-03 Marek Safar <marek.safar@seznam.cz>
12691 * interface.cs (PopulateMethod): Fixed crash when interface method
12692 returns not existing type (error test cs0246-3.cs).
12694 2004-02-02 Ravi Pratap M <ravi@ximian.com>
12696 * cs-parser.jay (interface_accessors): Re-write actions to also
12697 store attributes attached to get and set methods. Fix spelling
12700 (inteface_property_declaration): Modify accordingly.
12702 (InterfaceAccessorInfo): New helper class to store information to pass
12703 around between rules that use interface_accessors.
12705 * interface.cs (Emit): Apply attributes on the get and set
12706 accessors of properties and indexers too.
12708 * attribute.cs (ApplyAttributes): Modify accordingly to use the
12709 right MethodBuilder when applying attributes to the get and set accessors.
12711 2004-01-31 Miguel de Icaza <miguel@ximian.com>
12713 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
12715 2004-01-26 Miguel de Icaza <miguel@ximian.com>
12717 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
12719 2004-01-25 Miguel de Icaza <miguel@ximian.com>
12721 * cs-parser.jay: Remove YIELD token, instead use the new grammar
12722 changes that treat `yield' specially when present before `break'
12723 or `return' tokens.
12725 * cs-tokenizer.cs: yield is no longer a keyword.
12727 2004-01-23 Marek Safar <marek.safar@seznam.cz>
12729 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
12730 setting for default constructors.
12731 For default constructors are almost every time set wrong Modifier. The
12732 generated IL code has been alright. But inside mcs this values was
12733 wrong and this was reason why several of my CLS Compliance tests
12736 2004-02-27 Martin Baulig <martin@ximian.com>
12738 * generics.cs (ConstructedType.ResolveType): Make the nested type
12739 stuff actually work.
12741 2004-02-25 Martin Baulig <martin@ximian.com>
12743 * decl.cs (DeclSpace.CurrentTypeParameters): New protected
12744 property; returns the type parameters just from the current type,
12745 ie. with the ones from outer classes.
12746 (DeclSpace.LookupGeneric): First search in the current class, then
12748 (DeclSpace.initialize_type_params): When hiding a type parameter
12749 from an outer class, put it into the `type_param_list' anyways.
12751 * expression.cs (MemberAccess.expr): Made this field protected.
12753 * class.cs (TypeContainer.Define): The `CurrentType' just contains
12754 the type parameters from the current class.
12756 * generic.cs (ConstructedType.ResolveType): Support nested generic
12757 types by taking the type parameters which we inherit from outer
12758 classes into account.
12759 (GenericMemberAccess.ResolveAsTypeStep): Override this and added
12760 support for nested generic types.
12762 2004-02-23 Martin Baulig <martin@ximian.com>
12764 * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
12765 field and check whether we're nested inside a generic type.
12766 (DeclSpace.ResolveType): If we're resolving to a generic type
12767 definition, create a ConstructedType and return its resolved type.
12768 (DeclSpace.initialize_type_params): New private method;
12769 initializes the `type_param_list' field from the type parameters
12770 from this and all enclosing classes.
12771 (DeclSpace.TypeParameters): Call initialize_type_params() unless
12772 we're already initialized.
12774 2004-02-23 Martin Baulig <martin@ximian.com>
12776 * class.cs (Method.Define): Create the generic method before
12777 calling DoDefine().
12778 (Memberbase.DoDefine): Added DeclSpace argument (in addition to
12779 the TypeContainer one); we use this for generic methods.
12781 * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
12782 parent's TypeBuilder.
12784 2004-02-18 Martin Baulig <martin@ximian.com>
12786 * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
12787 to check for equality.
12789 2004-02-05 Martin Baulig <martin@ximian.com>
12791 * ecore.cs (FieldExpr.DoResolveLValue): If we have an
12792 `ec.TypeContainer.CurrentType', use it instead of
12793 `ec.ContainerType' to check whether we're in the type's ctor.
12795 2004-01-29 Martin Baulig <martin@ximian.com>
12797 * expression.cs (Invocation.DoResolve): If we're a
12798 `ConstructedType', then we're actually a generic method, so
12799 rewrite the expr as a GenericMemberAccess.
12801 * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
12802 here; manually parse it into a string.
12804 2004-01-28 Martin Baulig <martin@ximian.com>
12806 * typemanager.cs (TypeManager.IsEqual): New static method.
12807 (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
12808 check for equality instead of using `=='.
12810 2004-01-26 Martin Baulig <martin@ximian.com>
12812 * decl.cs (DeclSpace.CurrentType): New public field.
12814 * expression.cs (This.ResolveBase): If we have an
12815 `ec.TypeContainer.CurrentType', use it instead of
12816 `ec.ContainerType'.
12818 * class.cs (TypeContainer.DefineType): If we're a generic type,
12819 create the `CurrentType' (unresolved).
12820 (TypeContainer.GenericType): New private field.
12821 (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
12822 it and store it in `GenericType' before creating the MemberCache.
12823 (TypeContainer.GetMembers): If we have a `GenericType', call
12824 TypeManager.FindMembers() on it.
12826 * interface.cs (Interface.GenericType): New private field.
12827 (Interface.DefineType): If we're a generic type, create the
12828 `CurrentType' (unresolved).
12829 (Interface.DefineMembers): If we have a `CurrentType', resolve it
12830 and store it in `GenericType' before creating the MemberCache.
12831 (Interface.GetMembers): If we have a `GenericType', call
12832 TypeManager.FindMembers() on it.
12834 2004-01-22 Martin Baulig <martin@ximian.com>
12836 * cs-parser.jay (namespace_or_type_name): Return an Expression,
12837 not a QualifiedIdentifier. This is what `type_name_expression'
12838 was previously doing.
12839 (type_name_expression): Removed; the code is now in
12840 `namespace_or_type_name'.
12841 (qualified_identifier): Removed, use `namespace_or_type_name'
12843 (QualifiedIdentifier): Removed this class.
12845 2004-01-22 Martin Baulig <martin@ximian.com>
12847 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
12848 not a string as alias name.
12850 2004-01-21 Miguel de Icaza <miguel@ximian.com>
12852 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
12853 #52730 bug, and instead compute correctly the need to use a
12854 temporary variable when requesting an address based on the
12855 static/instace modified of the field and the constructor.
12857 2004-01-21 Martin Baulig <martin@ximian.com>
12859 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
12860 class and namespace before looking up aliases. Fixes #52517.
12862 2004-01-21 Martin Baulig <martin@ximian.com>
12864 * flowanalysis.cs (UsageVector.Merge): Allow variables being
12865 assinged in a 'try'; fixes exception4.cs.
12867 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12868 * class.cs : Implemented parameter-less constructor for TypeContainer
12870 * decl.cs: Attributes are now stored here. New property OptAttributes
12872 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
12874 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
12876 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12878 * typemanager.cs (CSharpSignature): Now reports also inner class name.
12879 (CSharpSignature): New method for indexer and property signature.
12881 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12883 * pending.cs (IsVirtualFilter): Faster implementation.
12885 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12887 * typemanager.cs: Avoid inclusion of same assembly more than once.
12889 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12891 * cs-parser.jay: Fixed problem where the last assembly attribute
12892 has been applied also to following declaration (class, struct, etc.)
12894 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12896 * class.cs: Added error CS0538, CS0539 reporting.
12897 Fixed crash on Microsoft runtime when field type is void.
12899 * cs-parser.jay: Added error CS0537 reporting.
12901 * pending.cs: Added error CS0535 reporting.
12902 Improved error report for errors CS0536, CS0534.
12904 2004-01-20 Miguel de Icaza <miguel@ximian.com>
12906 Merge a few bits from the Anonymous Method MCS tree.
12908 * statement.cs (ToplevelBlock): New class for toplevel methods,
12909 will hold anonymous methods, lifted variables.
12911 * cs-parser.jay: Create toplevel blocks for delegates and for
12912 regular blocks of code.
12914 2004-01-20 Martin Baulig <martin@ximian.com>
12916 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
12917 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
12918 and `NeedExplicitReturn'; added `IsLastStatement'.
12919 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
12920 have a `ReturnLabel' or we're not unreachable.
12922 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
12923 child's reachability; don't just override ours with it. Fixes
12924 #58058 (lluis's example).
12925 (FlowBranching): Added public InTryOrCatch(), InCatch(),
12926 InFinally(), InLoop(), InSwitch() and
12927 BreakCrossesTryCatchBoundary() methods.
12929 * statement.cs (Return): Do all error checking in Resolve().
12930 Unless we are the last statement in a top-level block, always
12931 create a return label and jump to it.
12932 (Break, Continue): Do all error checking in Resolve(); also make
12933 sure we aren't leaving a `finally'.
12934 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
12935 statement in a top-level block.
12936 (Block.Flags): Added `IsDestructor'.
12937 (Block.IsDestructor): New public property.
12939 2004-01-20 Martin Baulig <martin@ximian.com>
12941 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
12943 2004-01-20 Martin Baulig <martin@ximian.com>
12945 * statement.cs (Statement.ResolveUnreachable): New public method.
12946 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
12947 (Block.Resolve): Resolve unreachable statements.
12949 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
12951 * expression.cs: We need to fix the case where we do
12952 not have a temp variable here.
12954 * assign.cs: Only expression compound assignments need
12955 temporary variables.
12957 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
12959 * flowanalysis.cs: Reduce memory allocation in a few ways:
12960 - A block with no variables should not allocate a bit
12962 - A method with no out parameters does not need any tracking
12963 for assignment of the parameters, so we need not allocate
12966 public readonly Type[] VariableTypes;
12967 public readonly string[] VariableNames;
12968 Are redundant. The data is already stored in the variable
12969 map, so we need not allocate another array for it.
12970 - We need to add alot of checks for if (params | locals) == null
12971 due to the first two changes.
12973 2004-01-18 Miguel de Icaza <miguel@ximian.com>
12975 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
12976 implement IMemoryLocation, we store a copy on a local variable and
12977 take the address of it. Patch from Benjamin Jemlich
12979 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
12980 to use a special "type_name_expression" rule which reduces the
12981 number of "QualifiedIdentifier" classes created, and instead
12982 directly creates MemberAccess expressions.
12984 2004-01-17 Miguel de Icaza <miguel@ximian.com>
12986 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
12987 that fixes #52853. Null literal assignment to ValueType
12989 * class.cs (MethodData.Emit): Instead of checking the name of the
12990 method to determine if its a destructor, create a new derived
12991 class from Method called Destructor, and test for that.
12993 * cs-parser.jay: Create a Destructor object instead of a Method.
12995 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
12999 2004-01-16 Miguel de Icaza <miguel@ximian.com>
13001 * expression.cs (Binary.ResolveOperator): Perform an implicit
13002 conversion from MethodGroups to their delegate types on the
13003 Addition operation.
13005 * delegate.cs: Introduce a new class DelegateCreation that is the
13006 base class for `NewDelegate' and `ImplicitDelegateCreation',
13007 factor some code in here.
13009 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
13010 conversion from MethodGroups to compatible delegate types.
13012 * ecore.cs (Expression.Resolve): Do not flag error 654
13013 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
13014 we allow conversions from MethodGroups to delegate types now.
13016 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
13017 assignments in v2 either.
13019 2004-01-10 Miguel de Icaza <miguel@ximian.com>
13021 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
13022 static read-only fields in ctors.
13024 Applied patch from Benjamin Jemlich
13026 * expression.cs (UnaryMutator): Avoid leaking local variables.
13028 2004-01-09 Miguel de Icaza <miguel@ximian.com>
13030 * cs-tokenizer.cs (IsCastToken): Allow the various native types
13031 here to return true, as they can be used like this:
13033 (XXX) int.MEMBER ()
13035 Fixed 49836 and all the other dups
13037 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
13039 * driver.cs: Implement /win32res and /win32icon.
13041 2004-01-08 Miguel de Icaza <miguel@ximian.com>
13043 * cs-parser.jay: Add a rule to improve error handling for the
13044 common mistake of placing modifiers after the type.
13046 2004-01-07 Miguel de Icaza <miguel@ximian.com>
13048 * cs-parser.jay (interface_event_declaration): Catch
13049 initialization of events on interfaces, and report cs0068
13051 * cs-parser.jay (interface_event_declaration): Catch
13052 initialization of events.
13054 * ecore.cs: Better report missing constructors.
13056 * expression.cs (Binary.ResolveOperator): My previous bug fix had
13057 the error reporting done in the wrong place. Fix.
13059 * expression.cs (Binary.ResolveOperator): Catch the
13060 operator + (E x, E y) error earlier, and later allow for implicit
13061 conversions in operator +/- (E e, U x) from U to the underlying
13064 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
13065 52596, if the container class is abstract, the default constructor
13066 is protected otherwise its public (before, we were always public).
13068 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
13071 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
13072 Jemlich that fixes bug #52597, MCS was generating invalid code for
13073 idisposable structs. Thanks to Ben for following up with this
13076 2004-01-06 Miguel de Icaza <miguel@ximian.com>
13078 * driver.cs: Allow assemblies without code to be generated, fixes
13081 2004-01-07 Nick Drochak <ndrochak@gol.com>
13083 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
13085 2004-01-05 Miguel de Icaza <miguel@ximian.com>
13087 * cs-parser.jay: Add rules to improve error reporting if fields or
13088 methods are declared at the namespace level (error 116)
13090 * Add rules to catch event add/remove
13092 2004-01-04 David Sheldon <dave-mono@earth.li>
13094 * expression.cs: Added matching ")" to error message for
13097 2004-01-03 Todd Berman <tberman@gentoo.org>
13099 * ecore.cs, attribute.cs:
13100 Applying fix from #52429.
13102 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13104 * ecore.cs, expression.cs, statement.cs:
13105 Total rewrite of how we handle branching. We
13106 now handle complex boolean expressions with fewer
13107 jumps. As well if (x == 0) no longer emits a ceq.
13109 if (x is Foo) is much faster now, because we generate
13112 Overall, we get a pretty big improvement on our benchmark
13113 tests. The code we generate is smaller and more readable.
13115 I did a full two-stage bootstrap. The patch was reviewed
13116 by Martin and Miguel.
13118 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13120 * cs-parser.jay: Make primary_expression not take a QI.
13121 we dont need this because the member_access rule covers
13122 us here. So we replace the rule with just IDENTIFIER.
13124 This has two good effects. First, we remove a s/r conflict.
13125 Second, we allocate many fewer QualifiedIdentifier objects.
13127 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13129 * attribute.cs: Handle MarshalAs attributes as pseudo, and
13130 set the correct information via SRE. This prevents
13131 hanging on the MS runtime. Fixes #29374.
13133 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13135 * convert.cs: correctly handle conversions to value types
13136 from Enum and ValueType as unboxing conversions.
13138 Fixes bug #52569. Patch by Benjamin Jemlich.
13140 2004-01-02 Ravi Pratap <ravi@ximian.com>
13142 * expression.cs (BetterConversion): Prefer int -> uint
13143 over int -> ulong (csc's behaviour). This fixed bug #52046.
13145 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
13147 * decl.cs (MemberCache.FindMembers): now returns a
13150 * typemanager.cs: In general, go with with ^^.
13151 (CopyNewMethods): take an IList.
13152 (RealMemberLookup): Only allocate an arraylist
13153 if we copy from two sets of methods.
13155 This change basically does two things:
13156 1) Fewer array lists allocated due to CopyNewMethods.
13157 2) the explicit cast in MemberList costed ALOT.
13159 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
13161 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
13162 a hashtable to avoid needless string allocations when an identifier is
13163 used more than once (the common case).
13165 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
13167 * pending.cs: MS's TypeBuilder.GetInterfaces ()
13168 is broken, it will not return anything. So, we
13169 have to use the information we have in mcs to
13172 * typemanager.cs: Add a cache for GetInterfaces,
13173 since this will now be used more often (due to ^^)
13175 (GetExplicitInterfaces) New method that gets the
13176 declared, not effective, interfaces on a type
13177 builder (eg, if you have interface IFoo, interface
13178 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
13181 This patch makes MCS able to bootstrap itself on
13184 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
13186 * expression.cs: Remove the Nop's that Miguel put
13189 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
13191 * report.cs, codegen.cs: Give the real stack trace to
13192 the error when an exception is thrown.
13194 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
13196 * decl.cs: only allocate hashtables for ifaces if
13199 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
13201 * expression.cs: fix the error from cs0121-2.cs
13202 (a parent interface has two child interfaces that
13203 have a function with the same name and 0 params
13204 and the function is called through the parent).
13206 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
13208 * class.cs, rootcontext.cs, typmanager.cs: do not
13211 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
13213 * codegen.cs: remove stack for the ec flow branching.
13214 It is already a linked list, so no need.
13216 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
13218 * Makefile: Allow custom profiler here.
13220 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
13222 * typemanager.cs (LookupType):
13223 - Use a static char [], because split takes
13224 a param array for args, so it was allocating
13226 - Do not store true in a hashtable, it boxes.
13228 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
13230 * flowanalysis.cs: bytify common enums.
13232 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
13234 * modifiers.cs: Add a new set of flags for the
13235 flags allowed on explicit interface impls.
13236 * cs-parser.jay: catch the use of modifiers in
13237 interfaces correctly.
13238 * class.cs: catch private void IFoo.Blah ().
13240 All related to bug #50572.
13242 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
13244 * decl.cs: Rewrite the consistant accessability checking.
13245 Accessability is not linear, it must be implemented in
13246 a tableish way. Fixes #49704.
13248 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
13250 * expression.cs: Handle negation in a checked context.
13251 We must use subtraction from zero. Fixes #38674.
13253 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
13255 * class.cs: Ignore static void main in DLLs.
13256 * rootcontext.cs: Handle the target type here,
13257 since we are have to access it from class.cs
13258 * driver.cs: account for the above.
13260 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
13262 * report.cs: Give line numbers and files if available.
13264 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
13266 * driver.cs: Implement /addmodule.
13268 * typemanager.cs: Change 'modules' field so it now contains Modules not
13271 2003-12-20 Martin Baulig <martin@ximian.com>
13273 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
13274 (FieldBase.IsAssigned): Removed this field.
13275 (FieldBase.SetAssigned): New public method.
13276 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
13278 2003-12-20 Martin Baulig <martin@ximian.com>
13280 * expression.cs (LocalVariableReference.DoResolve): Don't set
13281 `vi.Used' if we're called from DoResolveLValue().
13283 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
13284 returns the usage vector it just merged into the current one -
13285 pass this one to UsageWarning().
13286 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
13287 of the `EmitContext', don't call this recursively on our children.
13289 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
13291 * driver.cs: Implement /target:module.
13293 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
13295 * support.cs (CharArrayHashtable): New helper class.
13297 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
13298 char arrays, not strings, so we can avoid creating a string in
13299 consume_identifier if the identifier is a keyword.
13301 2003-12-16 Martin Baulig <martin@ximian.com>
13303 * statement.cs (LocalInfo.Assigned): Removed this property.
13304 (LocalInfo.Flags): Removed `Assigned'.
13305 (LocalInfo.IsAssigned): New public method; takes the EmitContext
13306 and uses flow analysis.
13307 (Block.UsageWarning): Made this method private.
13308 (Block.Resolve): Call UsageWarning() if appropriate.
13310 * expression.cs (LocalVariableReference.DoResolve): Always set
13311 LocalInfo.Used here.
13313 2003-12-13 Martin Baulig <martin@ximian.com>
13315 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
13316 any value here; we're now using flow analysis to figure out
13317 whether a statement/block returns a value.
13319 2003-12-13 Martin Baulig <martin@ximian.com>
13321 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
13323 (FlowBranching.MergeFinally): Don't call
13324 `branching.CheckOutParameters()' here, this is called in
13326 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
13327 when adding the `finally' vector.
13329 2003-12-13 Martin Baulig <martin@ximian.com>
13332 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
13333 actually work and also fix #48962.
13335 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
13337 * decl.cs: Do not check System.Object for nested types,
13338 since we know it does not have any. Big bang for buck:
13341 Run 1: 8.35 seconds
13342 Run 2: 8.32 seconds
13343 corlib: 17.99 seconds
13345 Run 1: 8.17 seconds
13346 Run 2: 8.17 seconds
13347 corlib: 17.39 seconds
13349 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
13351 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
13352 time we are returning 0 members, so we save alot here.
13354 2003-12-11 Martin Baulig <martin@ximian.com>
13356 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
13357 `MergeChild()', also just take the `FlowBranching' as argument;
13358 call Merge() on it and return the result.
13359 (FlowBranching.Merge): We don't need to do anything if we just
13362 2003-12-11 Martin Baulig <martin@ximian.com>
13364 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
13365 them in an `ArrayList' to reduce memory usage. Thanks to Ben
13366 Maurer for this idea.
13368 2003-12-11 Martin Baulig <martin@ximian.com>
13370 * flowanalysis.cs (MergeResult): This class is now gone; we now
13371 use the `UsageVector' for this. The reason for this is that if a
13372 branching just has one sibling, we don't need to "merge" them at
13373 all - that's the next step to do.
13374 (FlowBranching.Merge): We now return a `UsageVector' instead of a
13377 2003-12-11 Martin Baulig <martin@ximian.com>
13379 Reworked flow analyis and made it more precise and bug-free. The
13380 most important change is that we're now using a special `Reachability'
13381 class instead of having "magic" meanings of `FlowReturns'. I'll
13382 do some more cleanups and optimizations and also add some more
13383 documentation this week.
13385 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
13386 largely reworked this class.
13387 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
13388 the new `Reachability' class instead of having "magic" values here.
13389 (FlowBranching): We're now using an instance of `Reachability'
13390 instead of having separate `Returns', `Breaks' etc. fields.
13392 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
13393 based on flow analysis; ignore the return value of block.Emit ().
13395 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
13397 * driver.cs typemanager.cs: Find the mono extensions to corlib even
13398 if they are private.
13400 2003-12-09 Martin Baulig <martin@ximian.com>
13402 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
13403 call them directly on the UsageVector.
13405 2003-12-09 Martin Baulig <martin@ximian.com>
13407 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
13408 Changed return type from `FlowReturns' to `Reachability'.
13410 2003-12-09 Martin Baulig <martin@ximian.com>
13412 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
13413 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
13414 `Reachable' fields with a single `Reachability' one.
13416 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13418 * class.cs (FindMembers): Remove foreach's.
13423 Run 1: 8.74 seconds
13424 Run 2: 8.71 seconds
13427 Run 1: 8.64 seconds
13428 Run 2: 8.58 seconds
13431 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13436 This patch does a few things:
13437 1. EmptyStatement is now a singleton, so it is never reallocated.
13438 2. All blah is EmptyStatement constructs have been changed to
13439 blah == EmptyStatement.Value, which is much faster and valid
13440 now that EmptyStatement is a singleton.
13441 3. When resolving a block, rather than allocating a new array for
13442 the non-empty statements, empty statements are replaced with
13443 EmptyStatement.Value
13444 4. Some recursive functions have been made non-recursive.
13445 Mainly the performance impact is from (3), however (1) and (2) are needed for
13446 this to work. (4) does not make a big difference in normal situations, however
13447 it makes the profile look saner.
13452 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13453 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13454 Total memory allocated: 56397 KB
13457 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
13458 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
13459 Total memory allocated: 55666 KB
13461 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13463 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
13464 than the hashtable in a hashtable version
13466 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
13467 we always end up concating a string. This results in a huge perf
13468 loss, because many strings have to be tracked by the GC. In this
13469 patch, we first use a hashtable that works with two keys, so that
13470 the strings do not need to be concat'ed.
13474 Run 1: 8.74 seconds
13475 Run 2: 8.71 seconds
13478 Run 1: 8.65 seconds
13479 Run 2: 8.56 seconds
13481 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13483 * Makefile: Add a new target `do-time' that does a quick and simple
13484 profile, leaving easy to parse output.
13486 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
13488 * codegen.cs (Init): Create the dynamic assembly with
13489 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
13491 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
13493 * support.cs: Make the PtrHashtable use only one
13494 instance of its comparer.
13496 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
13498 * typemanager.cs: Fix lookup of GetNamespaces.
13500 2003-11-29 Miguel de Icaza <miguel@ximian.com>
13502 * expression.cs: Removed redundant line.
13504 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
13505 ArrayLists, use for loops with bounds.
13507 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
13510 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
13511 arraylists, use for loop with bounds.
13513 The above three changes give us a 0.071 second performance
13514 improvement out of 3.294 seconds down to 3.223. On my machine
13515 the above changes reduced the memory usage by 1,387 KB during
13516 compiler bootstrap.
13518 * cs-parser.jay (QualifiedIdentifier): New class used to represent
13519 QualifiedIdentifiers. Before we created a new string through
13520 concatenation, and mostly later on, the result would be
13521 manipulated by DecomposeQI through string manipulation.
13523 This reduced the compiler memory usage for bootstrapping from
13524 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
13525 compile times in 0.05 seconds.
13527 2003-11-28 Dick Porter <dick@ximian.com>
13529 * support.cs: Do string compares with the Invariant culture.
13537 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
13538 the comparison is done with the Invariant culture.
13540 2003-11-27 Miguel de Icaza <miguel@ximian.com>
13542 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
13543 GetEnumerator method.
13545 (ProbeCollectionType): Iterate starting at the most specific type
13546 upwards looking for a GetEnumerator
13548 * expression.cs: Shift count can be up to 31 for int/uint and 63
13551 2003-11-26 Miguel de Icaza <miguel@ximian.com>
13553 * statement.cs (Block.LookupLabel): Also look for the label on the
13554 children blocks. Use a hash table to keep track of visited
13557 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
13558 we actually did transform the other operand, otherwise fall back
13559 to the common codepath that casts to long.
13561 * cs-tokenizer.cs: Use the same code pattern as the int case.
13562 Maybe I should do the parsing myself, and avoid depending on the
13563 Parse routines to get this done.
13565 2003-11-25 Miguel de Icaza <miguel@ximian.com>
13567 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
13568 which fixes bug 51347. This time test it.
13570 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
13571 attributes for example can not tell the difference between these.
13572 The difference was only a syntax feature of the language.
13574 * attribute.cs: Apply attributes to delegates.
13576 * delegate.cs: Call the apply attributes method.
13578 2003-11-24 Miguel de Icaza <miguel@ximian.com>
13580 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
13581 comparing 0 vs Byte.MinValue, not the value
13583 (ImplicitConversionRequired): When reporting a conversion error,
13584 use error 31 to print out the constant error instead of the
13587 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
13588 which fixes bug 51347.
13590 2003-11-22 Miguel de Icaza <miguel@ximian.com>
13592 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
13593 which fixes the -warnaserror command line option.
13595 2003-11-21 Miguel de Icaza <miguel@ximian.com>
13597 * cfold.cs (DoNumericPromotions): During constant folding of
13598 additions on UIntConstant, special case intconstants with
13599 IntConstants like we do on the expression binary operator.
13601 2003-11-12 Miguel de Icaza <miguel@ximian.com>
13603 * convert.cs (ImplicitReferenceConversion): We were missing a case
13604 (System.Enum are not value types or class types, so we need to
13605 classify them separatedly).
13607 * driver.cs: We do not support error 2007.
13609 2003-11-12 Jackson Harper <jackson@ximian.com>
13611 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
13612 system directory. Also use the full file name so users can
13613 libraries names mscorlib-o-tron.dll in a non system dir.
13615 2004-01-04 David Sheldon <dave-mono@earth.li>
13617 * expression.cs: Added matching ")" to error message for CS0077.
13619 2003-12-19 Martin Baulig <martin@ximian.com>
13621 * typemanager.cs (TypeManager.IsEqualGenericType): New public
13622 static method; see documentation in the method.
13623 (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
13625 * convert.cs (Convert.ImplicitReferenceConversion,
13626 Convert.ImplicitReferenceConversionExists): Add support for
13627 generic type declarations; see gen-36.cs.
13629 2003-12-19 Martin Baulig <martin@ximian.com>
13631 * pending.cs (Pending.InterfaceMethod): Use
13632 `Type.IsAssignableFrom()' instead of `=='.
13634 2003-12-18 Martin Baulig <martin@ximian.com>
13636 * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
13639 * convert.cs (Convert.ImplicitStandardConversionExists): Use
13640 `expr_type.Equals (target_type)' instead of `=='.
13642 2003-12-08 Martin Baulig <martin@ximian.com>
13644 * generics.cs (Constraints.Types): Removed.
13645 (Constraints.Resolve): Just resolve everything to TypeExpr's, not
13647 (Constraints.ResolveTypes): New public method; resolves the
13648 TypeExpr's to Type's.
13649 (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
13650 longer takes the constraints.
13651 (TypeParameter.DefineMethod): Likewise.
13652 (TypeParameter.DefineType): New public method. Calls
13653 `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
13656 2003-12-08 Martin Baulig <martin@ximian.com>
13658 * convert.cs (Convert.ImplicitConversionStandard): Use
13659 `expr_type.Equals (target_type)' instead of `=='.
13661 2003-12-08 Martin Baulig <martin@ximian.com>
13663 * typemanager.cs (TypeManager.GetReferenceType): Call
13664 `Type.MakeByRefType ()'.
13666 2003-12-08 Martin Baulig <martin@ximian.com>
13668 * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
13669 just has some special meaning in some situations. For instance,
13670 it is allowed to use `where' as the name of a variable etc.
13672 2003-12-04 Martin Baulig <martin@ximian.com>
13674 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
13675 `Type.MakeArrayType()' for array types.
13677 2003-11-18 Miguel de Icaza <miguel@ximian.com>
13679 * expression.cs (Invocation.VerifyArgumentsCompat): Remove
13682 (SizeOf.DoResolve): assign the `type_queried' field. This gets
13685 2003-11-16 Martin Baulig <martin@ximian.com>
13687 * codegen.cs (EmitContext.IsGeneric): Removed.
13689 * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
13690 ResolveGeneric() on the DeclSpace.
13692 2003-11-16 Martin Baulig <martin@ximian.com>
13694 * generic.cs (TypeArguments.Resolve):
13695 `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
13696 `ResolveType()' on it to get the Type.
13698 2003-11-15 Martin Baulig <martin@ximian.com>
13700 * generic.cs (ConstructedType.GetInterfaces): Override this.
13702 2003-11-14 Martin Baulig <martin@ximian.com>
13704 * interface.cs (Interface.DefineType): Define all type parameters
13705 before adding the interfaces we inherit.
13707 2003-11-11 Martin Baulig <martin@ximian.com>
13709 * generic.cs (ConstructedType.ResolveType): Always call
13710 `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
13712 2003-11-10 Martin Baulig <martin@ximian.com>
13714 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
13715 (TypeManager.InitCoreTypes): Initialize them here, but instead of
13716 calling `ResolveType()' on them, directly assign their `Type'.
13718 2003-11-08 Martin Baulig <martin@ximian.com>
13720 * generic.cs (ConstructedType): Override `IsClass' etc.
13722 2003-11-08 Martin Baulig <martin@ximian.com>
13724 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
13725 return value and the `out parent' parameter.
13726 (TypeContainer.DefineType): Moved the CS0644 check into
13727 GetClassBases(). Don't pass the interface types to the
13728 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
13729 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
13731 * ecore.cs (TypeExpr.IsAttribute): New property.
13732 (TypeExpr.GetInterfaces): New method.
13734 * interface.cs (Interface.GetInterfaceTypeByName): Return a
13735 TypeExpr instead of a Type.
13736 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
13737 (Interface.DefineType): Don't pass the interface types to the
13738 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
13739 them later and then call `TypeBulider.AddInterfaceImplementation()'.
13741 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
13742 instead of a `Type[]'.
13743 (TypeManager.RegisterBuilder): Likewise.
13744 (TypeManager.AddUserInterface): Likewise.
13745 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
13746 `Type[]' and also return a `TypeExpr[]'.
13747 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
13749 2003-11-08 Martin Baulig <martin@ximian.com>
13751 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
13754 2003-11-08 Martin Baulig <martin@ximian.com>
13756 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
13757 TypeManager.ResolveExpressionTypes().
13759 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
13760 instead of an Expression.
13761 (TypeExpr): This is now an abstract base class for `TypeExpression'.
13762 (TypeExpression): New public class; formerly known as `TypeExpr'.
13764 * expression.cs (ComposedCast): Derive from TypeExpr.
13766 * typemanager.cs (TypeManager.system_*_expr): These are now
13767 TypExpr's instead of Expression's.
13768 (TypeManager.ResolveExpressionTypes): New public static function;
13769 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
13772 2003-11-06 Miguel de Icaza <miguel@ximian.com>
13774 * expression.cs (New.DoResolve): Do not dereference value that
13775 might be a null return.
13777 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
13778 sure that the constant value has the right type. Fixes an
13779 unreported bug, similar to 50425.
13781 * const.cs (Const.LookupConstantValue): Call
13782 ImplicitStandardConversionExists before doing a conversion to
13783 avoid havng the TypeManager.ChangeType do conversions.
13785 Reduced the number of casts used
13787 (Const.ChangeType): New routine to enable reuse of the constant
13788 type changing code from statement.
13790 * typemanager.cs (ChangeType): Move common initialization to
13791 static global variables.
13795 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
13796 every value type to go through, even if it was void. Fix that.
13798 * cs-tokenizer.cs: Use is_identifier_start_character on the start
13799 character of the define, and the is_identifier_part_character for
13800 the rest of the string.
13802 2003-11-05 Miguel de Icaza <miguel@ximian.com>
13804 * expression.cs (UnaryMutator.EmitCode): When I updated
13805 LocalVariableReference.DoResolve, I overdid it, and dropped an
13806 optimization done on local variable references.
13808 2003-11-04 Miguel de Icaza <miguel@ximian.com>
13810 * ecore.cs: Convert the return from Ldlen into an int.
13812 2003-10-20 Miguel de Icaza <miguel@ximian.com>
13814 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
13815 the accessibility, this is a special case for toplevel non-public
13816 classes (internal for instance).
13818 2003-10-20 Nick Drochak <ndrochak@gol.com>
13820 * ecore.cs: Fix typo and build. Needed another right paren.
13822 2003-10-19 Miguel de Icaza <miguel@ximian.com>
13824 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
13825 `internal' case regular and protected, but not allowing protected
13826 to be evaluated later. Bug 49840
13828 2003-10-15 Miguel de Icaza <miguel@ximian.com>
13830 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
13831 to kb.Nlast, and not the kb.nFirst to isolate the switch
13834 Extract the underlying type, so enumerations of long/ulong are
13835 treated like long/ulong.
13837 2003-10-14 Miguel de Icaza <miguel@ximian.com>
13839 * expression.cs (New): Overload the meaning of RequestedType to
13840 track the possible creation of the NewDelegate type, since
13841 DoResolve is invoked more than once for new constructors on field
13844 See bugs: #48800 and #37014
13846 * cs-parser.jay (declare_local_constants): Take an arraylist
13847 instead of a single constant.
13849 (local_constant_declaration): It should take a
13850 constant_declarators, not a constant_declarator. Fixes 49487
13852 * convert.cs: Fix error report.
13854 2003-10-13 Jackson Harper <jackson@ximian.com>
13856 * typemanager.cs (TypeToCoreType): Add float and double this fixes
13859 2003-11-03 Martin Baulig <martin@ximian.com>
13861 * expression.cs (ArrayAccess.GetStoreOpcode): Added
13862 `out bool has_type_arg'; if set, we need to pass the type to
13864 (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
13865 Stelem_Any/Ldelem_Any for generic parameters.
13867 2003-11-02 Martin Baulig <martin@ximian.com>
13869 * expression.cs (Invocation.EmitCall): Use
13870 `TypeManager.IsValueType()' to check whether it's a value type.
13871 Don't set `struct_call' when calling a method on a type parameter.
13873 2003-11-02 Martin Baulig <martin@ximian.com>
13875 * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
13876 and removed the TypeBuilder argument.
13878 * typemanager.cs (TypeManager.IsValueType): Return
13879 `t.IsGenericParameter || t.IsValueType'.
13881 2003-10-25 Martin Baulig <martin@ximian.com>
13883 * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
13884 call ConstructedType.Resolve() on it.
13886 * generic.cs (ConstructedType.Resolve): Set `type' on success.
13888 2003-10-25 Martin Baulig <martin@ximian.com>
13890 * class.cs (TypeContainer.GetClassBases): Changed
13891 `out Type parent' into `out TypeExpr parent'. Moved CS0644 and
13892 CS8214 reporting here.
13893 (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
13894 instead of a `Type' for our parent. In case of a recursive
13895 declaration (see tests/gen-23.cs for an example), our parent is a
13896 ConstructedType and it doesn't have its type set. So, first
13897 create our own TypeBuilder, then call constructed.Resolve() to get
13898 the parent's type and finally TypeBuilder.SetParent() it.
13900 * ecore.cs (TypeExpr.Name): New public virtual property.
13903 (ConstructedType): We're now a TypeExpr and not just an Expression.
13904 (ConstructedType.ResolveAsTypeStep): Don't resolve our type
13905 arguments here; this is done later.
13906 (ConstructedType.Resolve): New public method to resolve the type
13907 arguments and bind them.
13909 2003-10-21 Martin Baulig <martin@ximian.com>
13911 * convert.cs: Use `TypeManager.IsValueType' instead of
13912 'type.IsValueType' everywhere.
13914 * typemanager.cs (TypeManager.IsValueType): Return true for type
13915 parameters. The reason for this is that we need to box a type
13916 parameter when converting it to a reference type.
13918 * cs-parser.jay: Added support for default value expressions.
13920 * generics.cs (DefaultValueExpression): New public class.
13922 2003-10-17 Martin Baulig <martin@ximian.com>
13924 * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
13925 TypeContainer so we can also use this for Interfaces.
13926 (TypeParameter.Resolve): Likewise.
13928 * interface.cs (Interface.DefineType): Added support for generic
13931 * cs-parser.jay: Added support for generic structs and interfaces.
13933 2003-10-17 Martin Baulig <martin@ximian.com>
13935 * generic.cs (GenericMemberAccess.DoResolve): We can now actually
13936 call generic methods :-)
13938 2003-10-16 Martin Baulig <martin@ximian.com>
13940 * cs-parser.jay (namespace_or_type_name): Only create a
13941 GenericMemberAccess if we actually have type arguments.
13943 2003-10-13 Martin Baulig <martin@ximian.com>
13945 * class.cs (Method.Define): If we're a generic method, call
13946 TypeBuilder.DefineGenericMethod () before resolving
13948 (MethodData): Added .ctor which takes an additional MethodBuilder
13949 argument; this is used for generic methods.
13950 (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
13951 we already have a MethodBuilder.
13953 2003-10-10 Martin Baulig <martin@ximian.com>
13955 * class.cs (Method): Added .ctor which takes a `GenericMethod'
13956 instead of a `DeclSpace'. This is used for generic methods.
13958 * cs-parser.jay (method_header): Added support for generic
13959 methods; create a `GenericMethod' instance and pass it to the
13960 `Method's .ctor; it'll be used as the `DeclSpace' to lookup
13961 parameters and locals.
13963 * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
13964 since we already have the location. Check whether we're a generic
13965 type declaration or a generic method and create the correct type
13968 * generic.cs (TypeParameter.DefineMethod): New public method.
13969 (GenericMethod): New public class; derives from DeclSpace and is
13970 used for generic methods.
13972 2003-10-09 Martin Baulig <martin@ximian.com>
13974 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
13976 (MethodCore.DoDefineParameters): Removed the TypeContainer
13977 argument; use the DeclSpace which was passed to the .ctor instead.
13978 (MethodCore.CheckParameter): Take a DeclSpace instead of a
13979 TypeContainer; we only need a DeclSpace here.
13981 2003-10-09 Martin Baulig <martin@ximian.com>
13983 * class.cs (MethodData): Added additional `DeclSpace ds' argument
13985 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
13986 EmitContext's .ctor.
13988 2003-10-09 Martin Baulig <martin@ximian.com>
13990 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
13991 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
13992 AsAccessible(), moved them as well.
13994 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
13996 2003-10-07 Miguel de Icaza <miguel@ximian.com>
13998 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
13999 generation for >=, as spotted by Paolo, bug 48679.
14000 Patch from David Waite.
14002 * cs-tokenizer.cs: Add handling for #pragma.
14004 * cs-parser.jay: Allow for both yield and yield return in the
14005 syntax. The anti-cobolization of C# fight will go on!
14007 * class.cs (TypeBuilder.DefineType): Catch error condition here
14008 (Parent.DefineType erroring out and returning null).
14010 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14011 coping with enumerations variables, we were mistakenly processing
14012 them as a regular value type instead of built-in types. Fixes the
14015 * typemanager.cs (IsBuiltinOrEnum): New method.
14017 2003-09-30 Miguel de Icaza <miguel@ximian.com>
14019 * cs-parser.jay: Upgrade: yield now needs the return clause.
14021 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
14023 * cs-parser.jay : Renamed yyName to yyNames related to jay.
14025 2003-09-29 Martin Baulig <martin@ximian.com>
14027 * typemanager.cs (TypeManager.GetMethodFlags): Added support for
14028 inflated generic methods.
14030 * generics.cs (ConstructedType): Distinguish between open and
14031 closed constructed types; correctly resolve the arguments.
14033 2003-09-22 Martin Baulig <martin@ximian.com>
14035 * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
14036 all type arguments meet their constraints.
14038 2003-09-19 Martin Baulig <martin@ximian.com>
14040 * decl.cs (MemberCache.SetupCacheForInterface): Take a
14041 `MemberCache parent' argument. Normally, an interface doesn't
14042 have a parent type except System.Object, but we use this in gmcs
14043 for generic type parameters.
14045 2003-09-18 Martin Baulig <martin@ximian.com>
14047 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
14048 on `type.IsInterface'; don't check whether the type has a parent
14049 to determine whether it's an interface.
14051 2003-09-17 Martin Baulig <martin@ximian.com>
14053 * generic.cs (ConstructedType.ToString): Always use `name' as the
14056 2003-09-15 Martin Baulig <martin@ximian.com>
14058 * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
14060 * generic.cs (Constraints.Resolve): New public method; this is
14061 called to resolve the constraint types and to check whether all
14062 the constraints are correct.
14063 (Constraints.Types): New public property.
14064 (TypeParameter.Resolve): New public method; resolves all the
14065 type's constraints.
14067 * class.cs (TypeContainer.DefineType): Call
14068 TypeParameter.Resolve() before actually defining the type.
14070 2003-09-15 Martin Baulig <martin@ximian.com>
14072 * class.cs (TypeContainer.DefineType): Added an error flag to
14073 avoid reporting duplicate CS0146's ("class definition is
14076 * driver.cs (Driver.MainDriver): Abort if
14077 RootContext.ResolveTree() reported any errors.
14079 2003-09-07 Martin Baulig <martin@ximian.com>
14081 * report.cs (Error, Warning): Added overloaded versions which take
14082 a `params object[] args' and call String.Format().
14084 2003-09-07 Martin Baulig <martin@ximian.com>
14086 * decl.cs (DeclSpace..ctor): Don't call
14087 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
14088 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
14089 (DeclSpace.RecordDecl): New method.
14091 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
14093 2003-09-02 Ravi Pratap <ravi@ximian.com>
14095 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
14096 value attributes to be applied to ParameterBuilders.
14098 * class.cs (MethodCore.LabelParameters): Make static and more
14099 generic so that it can be used from other places - like interface
14100 methods, for instance.
14102 * interface.cs (Interface.Emit): Call LabelParameters before
14103 emitting attributes on the InterfaceMethod.
14105 2003-09-07 Martin Baulig <martin@ximian.com>
14107 * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
14108 if the number of type parameters doesn't match.
14110 2003-09-04 Martin Baulig <martin@ximian.com>
14112 * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
14113 for arrays of generic type params (ie. `!0[]').
14115 2003-09-04 Martin Baulig <martin@ximian.com>
14117 * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
14120 2003-09-04 Martin Baulig <martin@ximian.com>
14122 * decl.cs (DeclSpace.LookupGeneric): New method.
14123 (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
14126 * generic.cs (TypeParameterExpr): Take a TypeParameter as
14127 argument, not just a string.
14128 (TypeParameter.Define): New public method; this is called to
14129 actually define the generic parameter; after this, you can use the
14130 new `Type' property to get the type.
14132 2003-09-04 Martin Baulig <martin@ximian.com>
14134 * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
14135 is now an ArrayList; initialize the result of the `TypeParameters'
14137 (DeclSpace.GetGenericData): Removed.
14138 (DeclSpace.LookupGeneric): Temporarily removed; we need to
14139 implement this in a different way.
14140 (DeclSpace.GetTypeParameters): Removed; there's now a
14141 `TypeParameters' property.
14142 (DeclSpace.TypeParameters): New public property.
14144 * generic.cs (Constraints): Make this class public.
14145 (TypeParameter): New public class.
14147 2003-09-04 Martin Baulig <martin@ximian.com>
14149 * decl.cs (DeclSpace.GetTypeParameters): New method to return the
14150 generic parameters.
14152 * class.cs (TypeContainer.DefineType): Call
14153 TypeBuilder.DefineGenericParameter () on all generic parameters if
14154 this is a generic type.
14156 2003-08-28 Martin Baulig <martin@ximian.com>
14158 * sample-stack.il: Compile this with ilasm: "ilasm /dll
14161 * sample-hello.cs: Compile this with gmcs: "gmcs
14162 /r:sample-stack.dll sample-hello.cs".
14164 2003-08-28 Martin Baulig <martin@ximian.com>
14166 * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
14167 the parameters to the generic type.
14169 2003-08-28 Martin Baulig <martin@ximian.com>
14171 * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
14173 2003-08-28 Martin Baulig <martin@ximian.com>
14175 * cs-parser.jay (opt_type_argument_list): Use
14176 `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
14177 (primary_expression): Replace `qualified_identifier' with `type_name'.
14178 (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
14180 * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
14181 parser to check whether it is syntactically a type parameter list;
14182 return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
14185 2003-08-26 Martin Baulig <martin@ximian.com>
14187 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
14188 resolving aliases; fixes #47927.
14190 2003-08-26 Martin Baulig <martin@ximian.com>
14192 * statement.cs (Using.DoResolve): This is internally emitting a
14193 try/finally clause, so we need to set ec.NeedExplicitReturn if we
14194 do not always return. Fixes #47681.
14196 2003-08-26 Martin Baulig <martin@ximian.com>
14198 * decl.cs (MemberCore): Moved WarningNotHiding(),
14199 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
14201 (AdditionResult): Make this nested in DeclSpace.
14202 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
14203 argument; call NamespaceEntry.Define() unless we're nested in a
14206 * namespace.cs (Namespace.DefineName): New public function. This
14207 is called from DeclSpace's .ctor to add
14208 (Namespace.Lookup): Include DeclSpaces in the lookup.
14210 * class.cs (Operator): Derive from MemberBase, not MemberCore.
14212 * const.cs (Const): Derive from MemberBase, not MemberCore.
14214 2003-08-25 Martin Baulig <martin@ximian.com>
14216 * convert.cs (Convert.ExplicitReferenceConversion): When
14217 converting from an interface type to a class, unbox if the target
14218 type is a struct type. Fixes #47822.
14220 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14222 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
14225 2003-08-22 Martin Baulig <martin@ximian.com>
14227 * class.cs (TypeManager.DefineType): When defining a nested type,
14228 call DefineType() on our parent; fixes #47801.
14230 2003-08-22 Martin Baulig <martin@ximian.com>
14232 * class.cs (MethodData.Define): While checking if a method is an
14233 interface implementation, improve the test a bit more to fix #47654.
14235 2003-08-22 Martin Baulig <martin@ximian.com>
14237 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
14238 correctly; fixes #47722.
14240 2003-08-22 Martin Baulig <martin@ximian.com>
14242 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
14243 LocalVariableReference, ensure it's not read-only. Fixes #47536.
14245 * statement.cs (Fixed.DoResolve): Make all variables read-only.
14247 2003-08-22 Martin Baulig <martin@ximian.com>
14249 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
14250 can only be assigned in static constructors. Fixes #47161.
14252 2003-08-22 Martin Baulig <martin@ximian.com>
14254 Rewrote and improved the flow analysis code.
14256 * flowbranching.cs (FlowBranching): Make this class abstract.
14257 (FlowBranching.CreateBranching): New static function to create a
14258 new flow branching.
14259 (FlowBranchingBlock, FlowBranchingException): New classes.
14260 (FlowBranching.UsageVector.Type): New public readonly field.
14261 (FlowBranching.UsageVector.Breaks): Removed the setter.
14262 (FlowBranching.UsageVector.Returns): Removed the setter.
14263 (FlowBranching.UsageVector): Added Break(), Return(),
14264 NeverReachable() and Throw() methods to modify the reachability.
14265 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
14266 done by FlowBranching.Merge().
14267 (FlowBranching.UsageVector.MergeChild): New method; merges the
14268 merge result into the current vector.
14269 (FlowBranching.Merge): New abstract method to merge a branching.
14271 2003-08-12 Martin Baulig <martin@ximian.com>
14273 * expression.cs (Indirection.CacheTemporaries): Create the
14274 LocalTemporary with the pointer type, not its element type.
14276 2003-08-10 Miguel de Icaza <miguel@ximian.com>
14278 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
14279 token was a keyword or not.
14281 Add `error' options where an IDENTIFIER was expected; Provide
14282 CheckToken and CheckIdentifierToken convenience error reporting
14285 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
14287 * decl.cs: Rename `NamespaceEntry Namespace' public field into
14288 NameSpaceEntry NameSpaceEntry.
14290 (LookupInterfaceOrClass): Avoid creating a full qualified name
14291 from namespace and name: avoid doing lookups when we know the
14292 namespace is non-existant. Use new Tree.LookupByNamespace which
14293 looks up DeclSpaces based on their namespace, name pair.
14295 * driver.cs: Provide a new `parser verbose' to display the
14296 exception thrown during parsing. This is turned off by default
14297 now, so the output of a failure from mcs is more graceful.
14299 * namespace.cs: Track all the namespaces defined in a hashtable
14302 (IsNamespace): New method
14304 2003-08-09 Miguel de Icaza <miguel@ximian.com>
14306 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
14307 we know that we need to concatenate (full typename can never be
14312 * statement.cs: Use a bitfield; Do not initialize to null things
14313 which are done by the constructor by default.
14315 * cs-parser.jay: bug fix, parameter was 4, not 3.
14317 * expression.cs: Just use the property;
14319 * statement.cs: No need for GetVariableInfo method.
14321 2003-08-08 Martin Baulig <martin@ximian.com>
14323 * flowanalysis.cs (FlowReturns): This is now nested in the
14324 `FlowBranching' class.
14325 (MyBitVector): Moved this here from statement.cs.
14326 (FlowBranching.SiblingType): New enum type.
14327 (FlowBranching.CreateSibling): Added `SiblingType' argument.
14329 2003-08-07 Martin Baulig <martin@ximian.com>
14331 * flowanalysis.cs (FlowBranchingType): This is now nested in the
14332 `FlowBranching' class and called `BranchingType'.
14334 2003-08-07 Martin Baulig <martin@ximian.com>
14336 * flowanalysis.cs: Moved all the control flow analysis code into
14339 2003-08-07 Martin Baulig <martin@ximian.com>
14341 * assign.cs (Assign.DoResolve): `target' must either be an
14342 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
14345 2003-08-07 Miguel de Icaza <miguel@ximian.com>
14347 * expression.cs (BinaryMethod): This kind of expression is created by the
14348 Binary class if it determines that the operator has to be handled
14351 (BinaryDelegate): This kind of expression is created if we are
14352 dealing with a + or - operator on delegates.
14354 (Binary): remove method, argumetns, and DelegateOperator: when
14355 dealing with methods,
14357 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
14359 * statement.cs (Block): use bitfields for the three extra booleans
14360 we had in use. Remove unused topblock parameter.
14362 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
14364 * assign.cs: Drop extra unneeded tests.
14366 2003-08-06 Miguel de Icaza <miguel@ximian.com>
14368 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
14370 * statement.cs (Foreach): Use VariableStorage instead of
14373 * codegen.cs (VariableStorage): New class used by clients that
14374 require a variable stored: locals or fields for variables that
14375 need to live across yield.
14377 Maybe provide a convenience api for EmitThis+EmitLoad?
14379 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
14382 2003-08-05 Miguel de Icaza <miguel@ximian.com>
14384 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
14385 RemapParameterLValue): New methods that are used to turn a
14386 precomputed FieldInfo into an expression like this:
14390 The idea is to use this instead of making LocalVariableReference
14391 have more than one meaning.
14393 * cs-parser.jay: Add error production to BASE.
14395 * ecore.cs: Deal with TypeManager.GetField returning null, which
14396 is now a valid return value.
14398 (FieldExprNoAddress): New expression for Fields whose address can
14401 * expression.cs (LocalVariableReference): During the resolve
14402 phases, create new expressions if we are in a remapping context.
14403 Remove code that dealt with remapping here.
14405 (ParameterReference): same.
14407 (ProxyInstance): New expression, like the `This' expression, but
14408 it is born fully resolved. We know what we are doing, so remove
14409 the errors that are targeted to user-provided uses of `this'.
14411 * statement.cs (Foreach): our variable is now stored as an
14412 Expression; During resolution, follow the protocol, dont just
14413 assume it will return this.
14415 2003-08-06 Martin Baulig <martin@ximian.com>
14417 * support.cs (SeekableStreamReader.cs): New public class.
14419 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
14420 SeekableStreamReader instead of the normal StreamReader.
14422 2003-08-04 Martin Baulig <martin@ximian.com>
14424 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
14425 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
14426 deambiguate casts and delegate invocations.
14427 (parenthesized_expression): Use the new tokens to ensure this is
14428 not a cast of method invocation.
14430 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
14431 when reading a `)' and Deambiguate_CloseParens () was previously
14434 * expression.cs (ParenthesizedExpression): New class. This is
14435 just used for the CS0075 test.
14436 (Binary.DoResolve): Check for CS0075.
14438 2003-07-29 Ravi Pratap <ravi@ximian.com>
14440 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
14441 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
14442 reference comparison.
14444 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
14445 examine the ReturnType for equality - this is necessary in the
14446 cases of implicit and explicit operators whose signature also
14447 includes the return type.
14449 2003-07-26 Miguel de Icaza <miguel@ximian.com>
14451 * namespace.cs: Cache the result of the namespace computation,
14452 instead of computing it every time.
14454 2003-07-24 Miguel de Icaza <miguel@ximian.com>
14456 * decl.cs: Use a global arraylist that we reuse over invocations
14457 to avoid excesive memory consumption. Reduces memory usage on an
14458 mcs compile by one meg (45 average).
14460 * typemanager.cs (LookupTypeReflection): In .NET pointers are
14461 private, work around that.
14463 2003-07-23 Miguel de Icaza <miguel@ximian.com>
14465 * literal.cs (IntLiteral): Define Zero and One static literals.
14467 * cs-parser.jay (integer_literal): use static literals to reduce
14468 memory usage for the most used literals (0, 1 and -1). 211kb
14469 reduced in memory usage.
14471 Replace all calls to `new ArrayList' with `new
14472 ArrayList(4)' which is a good average number for most allocations,
14473 and also requires only 16 bytes of memory for its buffer by
14476 This reduced MCS memory usage in seven megabytes for the RSS after
14479 2003-07-28 Ravi Pratap <ravi@ximian.com>
14481 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
14482 handle params methods the correct way by forming only one
14483 applicable set with params and normal methods in them. Earlier we
14484 were looking at params methods only if we found no normal methods
14485 which was not the correct thing to do.
14487 (Invocation.BetterFunction): Take separate arguments indicating
14488 when candidate and the best method are params methods in their
14491 This fixes bugs #43367 and #46199.
14493 * attribute.cs: Documentation updates.
14495 (CheckAttribute): Rename to CheckAttributeTarget.
14496 (GetValidPlaces): Rename to GetValidTargets.
14498 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
14499 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
14503 2003-07-28 Miguel de Icaza <miguel@ximian.com>
14505 * codegen.cs: Compute IsGeneric correctly.
14507 * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
14510 Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
14511 OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN. There were too many
14512 regressions, and I was chasing more bugs than I required.
14514 * interface.cs: Use expressions for base type names (like classes
14515 and structs have been doing for a while now), and resolve that.
14516 This patch should probably go into head as well.
14518 This makes it one less user of FindType.
14520 2003-07-24 Miguel de Icaza <miguel@ximian.com>
14522 This compiler can not self host currently. Need to fix that.
14524 * Makefile: compile to `gmcs.exe'
14526 * driver.cs: Turn on v2 by default on gmcs.
14528 * generic.cs (ConstructedType): Does no longer take a container
14529 type argument; That will be taken care of later.
14531 (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
14532 Use SimpleName to resolve for now, so we can continue the work on
14533 the parser, until we get Type.GetType that understands generics.
14535 (ConstructedType.ToString): Implement
14537 (TypeArguments.Resolve): Resolve the child expressions as types.
14539 * cs-parser.jay: Rename interface_constraints to
14540 type_parameter_constraints
14542 (namespace_or_type_name): Only use constructed types for the basic
14543 construction, we will deal with identifier<...> later.
14545 (type/type_name): No longer call DecomposeQI, as
14546 namespace_or_type_name is always decoded now.
14548 2003-07-22 Ravi Pratap <ravi@ximian.com>
14550 * expression.cs (Invocation.OverloadResolve): Follow the spec more
14551 closely: we eliminate methods in base types when we have an
14552 applicable method in a top-level type.
14554 Please see section 14.5.5.1 for an exact description of what goes
14557 This fixes bug #45127 and a host of other related to corlib compilation.
14559 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
14560 array is the method corresponding to the top-level type (this is
14561 because of the changes made to icall.c) so we change this
14564 (MethodGroupExpr.Name): This too.
14566 * typemanager.cs (GetElementType): New method which does the right
14567 thing when compiling corlib.
14569 * everywhere: Make use of the above in the relevant places.
14571 2003-07-22 Martin Baulig <martin@ximian.com>
14573 * cs-parser.jay (invocation_expression): Moved
14574 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
14575 `cast_expression', but create a InvocationOrCast which later
14576 resolves to either an Invocation or a Cast.
14578 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
14579 method; call this before EmitStatement() to make sure that this
14580 expression can be used as a statement.
14582 * expression.cs (InvocationOrCast): New class; resolves to either
14583 an Invocation or a Cast.
14585 * statement.cs (StatementExpression): Call ResolveStatement() on
14586 the ExpressionStatement before emitting it.
14588 2003-07-21 Martin Baulig <martin@ximian.com>
14590 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
14591 `ref' and `out' attributes match; fixes #46220.
14592 (MemberAccess.ResolveMemberAccess): You can't reference a type
14593 through an expression; fixes #33180.
14594 (Indexers.GetIndexersForType): Don't return the indexers from
14595 interfaces the class implements; fixes #46502.
14597 2003-07-21 Martin Baulig <martin@ximian.com>
14599 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
14600 CS0661 checks; fixes bug #30442.
14602 2003-07-21 Martin Baulig <martin@ximian.com>
14604 * decl.cs (AdditionResult): Added `Error'.
14606 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
14608 * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
14609 cs0031.cs actually work.
14611 2003-07-20 Miguel de Icaza <miguel@ximian.com>
14613 * cs-parser.jay (namespace_name): do not use
14614 namespace_or_type_name, use qualified_identifier, because
14615 namespace_or_type_name will soon return a composed expression
14616 instead of a string.
14618 (namespace_or_type_name): Instead of returning a string, now this
14619 production returns an expression.
14621 * codegen.cs (EmitContext): Setup IsGeneric property based on
14622 whether our DeclSpace is generic, our the method is generic.
14624 * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
14625 the method is generic.
14627 * cs-parser.jay (type_arguments, opt_type_argument_list,
14628 type_parameters, type_parameter_list, opt_type_parameter_list,
14629 type_parameter,, opt_type_parameter_constraints_clauses,
14630 type_parameter_constraints_clauses,
14631 type_parameter_constraint_clause, type_parameter_constraint,
14632 interface_constraints): Add new production
14634 * decl.cs (DeclSpace): IsGeneric, flag to track whether this
14635 DeclSpace is generic or not.
14637 (DeclSpace.SetParameterInfo): New routine, used to set the
14638 parameter info for a type.
14640 (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
14641 returns a GenericTypeExpr
14643 * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
14644 generic, lookup the generic argument.
14646 * attribute.cs: Do not allow TypeParameterExpressions in
14649 * class.cs: Do not allow the Main method to be defined in a
14652 * expression.cs (SizeOf): Do not allow generic types to be used as
14653 arguments to sizeof.
14655 * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
14656 it: whether a type is generic or not. Only works for types we are
14657 currently building for now.
14659 2003-07-20 Martin Baulig <martin@ximian.com>
14661 * namespace.cs: Fixed that bug which caused a crash when compiling
14662 the debugger's GUI.
14664 2003-07-20 Miguel de Icaza <miguel@ximian.com>
14666 * typemanager.cs (LookupTypeReflection): Never expose types which
14667 are NotPublic, NestedPrivate, NestedAssembly, or
14668 NestedFamANDAssem. We used to return these, and later do a check
14669 that would report a meaningful error, but the problem is that we
14670 would not get the real match, if there was a name override.
14672 2003-07-18 Miguel de Icaza <miguel@ximian.com>
14674 * namespace.cs (Namespace, Name): Do not compute the namespace
14675 name dynamically, compute it in the constructor. This reduced
14676 memory usage by 1697 KB.
14678 * driver.cs: Use --pause to pause at the end.
14680 2003-07-17 Peter Williams <peter@newton.cx>
14682 * Makefile: Change the name of the test target so that it doesn't
14683 conflict with the recursive test target.
14685 2003-07-17 Miguel de Icaza <miguel@ximian.com>
14687 * expression.cs (LocalVariableReference.Emit, EmitAssign,
14688 AddressOf): Do not use EmitThis, that was wrong, use the actual
14691 2003-07-15 Miguel de Icaza <miguel@ximian.com>
14693 * class.cs (MethodData.Define): While checking if a method is an
14694 interface implementation, improve the test: If we are not public
14695 (use new test here: use the computed MethodAttributes directly,
14696 instead of the parsed modifier flags) check if the `implementing'
14697 method comes from an interface or not.
14699 * pending.cs (VerifyPendingMethods): Slightly better error
14702 * makefile: add test target that does the mcs bootstrap.
14704 2003-07-16 Ravi Pratap <ravi@ximian.com>
14706 * interface.cs (Define): Do nothing here since there are no
14707 members to populate etc. Move the attribute emission out of here
14708 since this was just totally the wrong place to put it. Attribute
14709 application happens during the 'Emit' phase, not in the 'Define'
14712 (Emit): Add this method and move the attribute emission here
14714 * rootcontext.cs (EmitCode): Call the Emit method on interface
14717 2003-07-14 Ravi Pratap M <ravi@ximian.com>
14719 * expression.cs (OverloadResolve): Report error only if Location
14720 is not 'Null' which means that there was a probe going on.
14722 2003-07-14 Martin Baulig <martin@ximian.com>
14724 * expression.cs (ConditionalLogicalOperator): New public class to
14725 implement user defined conditional logical operators.
14726 This is section 14.11.2 in the spec and bug #40505.
14728 2003-07-14 Martin Baulig <martin@ximian.com>
14730 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
14732 2003-07-14 Martin Baulig <martin@ximian.com>
14734 * codegen.cs (EmitContext.InFixedInitializer): New public field.
14736 * ecore.cs (IVariable.VerifyFixed): New interface method.
14738 * expression.cs (Unary.ResolveOperator): When resolving the `&'
14739 operator, check whether the variable is actually fixed. Fixes bug
14740 #36055. Set a variable definitely assigned when taking its
14741 address as required by the spec.
14743 * statement.cs (LocalInfo.IsFixed): New field.
14744 (LocalInfo.MakePinned): Set `IsFixed' to true.
14746 2003-07-14 Ravi Pratap M <ravi@ximian.com>
14748 * attribute.cs (Attribute.Resolve): While doing a Member lookup
14749 for .ctors, ensure that we only ask for members declared in the
14750 attribute type (BindingFlags.DeclaredOnly).
14754 * expression.cs (Error_WrongNumArguments): Report error 1501
14755 correctly the way CSC does.
14757 2003-07-13 Martin Baulig <martin@ximian.com>
14759 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
14760 lookup on the fully qualified name, to make things like "X.X" work
14761 where "X.X" is a fully qualified type name, but we also have a
14762 namespace "X" in the using list. Fixes #41975.
14764 2003-07-13 Martin Baulig <martin@ximian.com>
14766 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
14767 function. If we're a CompoundAssign, we need to create an embedded
14768 CompoundAssign, not an embedded Assign.
14769 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
14772 2003-07-13 Martin Baulig <martin@ximian.com>
14774 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
14775 work to fix bug #46088.
14777 2003-07-13 Ravi Pratap <ravi@ximian.com>
14779 * class.cs (Operator.Emit): Do not emit attributes here - it is
14780 taken care of by the Method class that we delegate too. This takes
14781 care of bug #45876.
14783 2003-07-10 Martin Baulig <martin@ximian.com>
14785 * expression.cs (TypeOfVoid): New class.
14786 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
14788 2003-07-10 Martin Baulig <martin@ximian.com>
14790 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
14793 2003-07-10 Martin Baulig <martin@ximian.com>
14795 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
14796 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
14798 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
14800 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
14802 2003-07-10 Martin Baulig <martin@ximian.com>
14804 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
14805 of decimal. Fixes #42850.
14807 NOTE: I also fixed the created byte blob, but this doesn't work on
14808 the MS runtime and csc never produces any byte blobs for decimal
14811 2003-07-10 Martin Baulig <martin@ximian.com>
14813 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
14814 structs; fixes #32068.
14815 (Block.AddChildVariableNames): Fixed #44302.
14817 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14819 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
14821 2003-07-07 Miguel de Icaza <miguel@ximian.com>
14823 * attribute.cs: And this test is onger needed.
14825 2003-07-08 Martin Baulig <martin@ximian.com>
14827 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
14828 inaccessible types. Fixes #36313.
14830 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
14832 * namespace.cs (NamespaceEntry): Create implicit entries for all
14833 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
14834 implicit entries for N1.N2 and N1.
14836 2003-07-08 Martin Baulig <martin@ximian.com>
14838 Rewrote the handling of namespaces to fix a lot of the issues
14839 wrt. `using' aliases etc.
14841 * namespace.cs (Namespace): Splitted this class into a
14842 per-assembly `Namespace' and a per-file `NamespaceEntry'.
14844 * typemanager.cs (TypeManager.IsNamespace): Removed.
14845 (TypeManager.ComputeNamespaces): Only compute namespaces from
14846 loaded assemblies here, not the namespaces from the assembly we're
14847 currently compiling.
14849 2003-07-08 Martin Baulig <martin@ximian.com>
14851 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
14853 2003-07-07 Miguel de Icaza <miguel@ximian.com>
14855 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
14858 I thought about the memory savings here, but LookupTypeReflection
14859 is used under already very constrained scenarios. Compiling
14860 corlib or mcs only exposes one hit, so it would not really reduce
14861 any memory consumption.
14863 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14865 * typemanager.cs: fixes bug #45889 by only adding public types from
14866 other assemblies to the list of known types.
14868 2003-07-07 Miguel de Icaza <miguel@ximian.com>
14870 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
14871 on the type we resolved.
14873 2003-07-05 Martin Baulig <martin@ximian.com>
14875 * pending.cs (PendingImplementation.ParentImplements): Don't
14876 create the proxy if the parent is abstract.
14878 * class.cs (TypeContainer.DefineIndexers): Process explicit
14879 interface implementations first. Fixes #37714.
14881 2003-07-04 Miguel de Icaza <miguel@ximian.com>
14883 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
14884 defined recursively; but since we modify the input parameters
14885 (left is set to `this' temporarily), we reset this value if the
14886 left_is_explicit is false, which gives the original semantics to
14889 * literal.cs (NullPointer): new class used to represent a null
14890 literal in a pointer context.
14892 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
14893 type is a pointer, use a NullPointer object instead of a
14894 NullLiteral. Closes 43687
14896 (ExplicitConversion): Convert pointer values using
14897 the conv opcode to the proper type.
14899 * ecore.cs (New): change ValueTypeVariable property into a method,
14900 that returns whether the valuetype is suitable for being used.
14902 * expression.cs (Binary.DoNumericPromotions): Only return if we
14903 the int constant was a valid uint, and we can return both left and
14904 right as uints. If not, we continue processing, to trigger the
14905 type conversion. This fixes 39018.
14907 * statement.cs (Block.EmitMeta): During constant resolution, set
14908 the CurrentBlock property on the emitcontext, so that we resolve
14909 constants propertly.
14911 2003-07-02 Martin Baulig <martin@ximian.com>
14913 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
14914 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
14916 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
14917 than emitting it here.
14919 * statement.cs: Fixed some more flow analysis bugs.
14921 2003-07-02 Martin Baulig <martin@ximian.com>
14923 * class.cs (MethodData.Define): When implementing interface
14924 methods, set Final unless we're Virtual.
14926 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
14927 check work for interface methods.
14929 2003-07-01 Martin Baulig <martin@ximian.com>
14931 * ecore.cs (EmitContext.This): Replaced this property with a
14932 GetThis() method which takes a Location argument. This ensures
14933 that we get the correct error location for a CS0188.
14935 2003-07-01 Miguel de Icaza <miguel@ximian.com>
14937 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
14938 ImplicitStandardConversion.
14940 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
14942 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
14944 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
14947 2003-06-30 Miguel de Icaza <miguel@ximian.com>
14949 * class.cs (Constructor.Define): Turn off initlocals for unsafe
14952 (MethodData.Define): Turn off initlocals for unsafe methods.
14954 2003-06-29 Miguel de Icaza <miguel@ximian.com>
14956 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
14957 complete; Fixes #37521.
14959 * delegate.cs: Use Modifiers.TypeAttr to compute the
14960 TypeAttributes, instead of rolling our own. This makes the flags
14961 correct for the delegates.
14963 2003-06-28 Miguel de Icaza <miguel@ximian.com>
14965 * class.cs (Constructor.Define): Set the private flag for static
14966 constructors as well.
14968 * cs-parser.jay (statement_expression): Set the return value to
14969 null, to avoid a crash when we catch an error.
14971 2003-06-24 Miguel de Icaza <miguel@ximian.com>
14973 * cs-parser.jay: Applied patch from Jackson that adds support for
14974 extern and unsafe modifiers to destructor declarations.
14976 * expression.cs: Report error 21 if the user is trying to index a
14979 * driver.cs: Add an error message, suggested by the bug report.
14981 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
14982 if we do not have a ": this ()" constructor initializer. Fixes 45149
14984 2003-06-14 Miguel de Icaza <miguel@ximian.com>
14986 * namespace.cs: Add some information to reduce FAQs.
14988 2003-06-13 Miguel de Icaza <miguel@ximian.com>
14990 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
14991 underlying enumeration types. Fixes #43915.
14993 * expression.cs: Treat ushort/short as legal values to be used in
14994 bitwise operations.
14996 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
14998 * delegate.cs: transfer custom attributes for paramenters from
14999 the delegate declaration to Invoke and BeginInvoke.
15001 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
15003 * attribute.cs: handle custom marshalers and emit marshal info
15006 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
15008 * makefile.gnu: Added anonymous.cs to the compiler sources.
15010 2003-05-28 Miguel de Icaza <miguel@ximian.com>
15012 * iterators.cs: Change the name of the proxy class to include two
15015 * cs-parser.jay: Update grammar to include anonymous methods.
15017 * anonymous.cs: new file.
15019 2003-05-27 Miguel de Icaza <miguel@ximian.com>
15021 * class.cs (Field.Define): Add missing test for pointers and
15024 2003-05-27 Ravi Pratap <ravi@ximian.com>
15026 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
15027 we use the stobj opcode.
15029 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
15030 since it wasn't the correct fix.
15032 It still is puzzling that we are required to use stobj for IntPtr
15033 which seems to be a ValueType.
15035 2003-05-26 Miguel de Icaza <miguel@ximian.com>
15037 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
15038 during regular simple name resolution. Now, the trick is that
15039 instead of returning for processing the simplename, we do a
15040 TypeManager.LookupType (ie, a rooted lookup as opposed to a
15041 contextual lookup type). If a match is found, return that, if
15042 not, return for further composition.
15044 This fixes long-standing 30485.
15046 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15047 using the address to initialize an object, do an Stobj instead of
15048 using the regular Stelem.
15050 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
15051 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
15052 Because if we are a BaseIndexerAccess that value will be true.
15055 * statement.cs (GotoCase.Resolve): Return after reporting an
15056 error, do not attempt to continue.
15058 * expression.cs (PointerArithmetic.Emit): If our operand is a
15059 long, convert our constants to match the operand before
15060 multiplying. Convert to I type before adding. Fixes 43670.
15062 2003-05-14 Ravi Pratap <ravi@ximian.com>
15064 * enum.cs (ImplicitConversionExists) : Rename to
15065 ImplicitEnumConversionExists to remove ambiguity.
15067 * ecore.cs (NullCast): New type of cast expression class which
15068 basically is very similar to EmptyCast with the difference being
15069 it still is a constant since it is used only to cast a null to
15071 (eg. (string) null)
15073 * convert.cs (ImplicitReferenceConversion): When casting a null
15074 literal, we return a NullCast.
15076 * literal.cs (NullLiteralTyped): Remove - I don't see why this
15077 should be around anymore.
15079 The renaming (reported was slightly wrong). Corrections:
15081 ConvertImplicitStandard -> ImplicitConversionStandard
15082 ConvertExplicitStandard -> ExplicitConversionStandard
15084 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
15085 before passing them in !
15087 * convert.cs (ImplicitConversionStandard): When comparing for
15088 equal expr and target types, ensure that expr is not a
15091 In general, we must not be checking (expr_type ==
15092 target_type) in the top level conversion methods
15093 (ImplicitConversion, ExplicitConversion etc). This checking is
15094 done in the methods that they delegate to.
15096 2003-05-20 Miguel de Icaza <miguel@ximian.com>
15098 * convert.cs: Move Error_CannotConvertType,
15099 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
15100 ImplicitNumericConversion, ImplicitConversionExists,
15101 ImplicitUserConversionExists, StandardConversionExists,
15102 FindMostEncompassedType, FindMostSpecificSource,
15103 FindMostSpecificTarget, ImplicitUserConversion,
15104 ExplicitUserConversion, GetConversionOperators,
15105 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
15106 TryImplicitIntConversion, Error_CannotConvertImplicit,
15107 ConvertImplicitRequired, ConvertNumericExplicit,
15108 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
15109 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
15112 Perform the following renames:
15114 StandardConversionExists -> ImplicitStandardConversionExists
15115 ConvertImplicit -> ImplicitConversion
15116 ConvertImplicitStandard -> ImplicitStandardConversion
15117 TryImplicitIntConversion -> ImplicitIntConversion
15118 ConvertImplicitRequired -> ImplicitConversionRequired
15119 ConvertNumericExplicit -> ExplicitNumericConversion
15120 ConvertReferenceExplicit -> ExplicitReferenceConversion
15121 ConvertExplicit -> ExplicitConversion
15122 ConvertExplicitStandard -> ExplicitStandardConversion
15124 2003-05-19 Martin Baulig <martin@ximian.com>
15126 * statement.cs (TypeInfo.StructInfo): Made this type protected.
15127 (TypeInfo): Added support for structs having structs as fields.
15129 * ecore.cs (FieldExpr): Implement IVariable.
15130 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
15131 VariableInfo for the field.
15133 2003-05-18 Martin Baulig <martin@ximian.com>
15135 * expression.cs (This.DoResolve): Report a CS0027 if we're
15136 emitting a field initializer.
15138 2003-05-18 Martin Baulig <martin@ximian.com>
15140 * expression.cs (This.ResolveBase): New public function.
15141 (This.DoResolve): Check for CS0188.
15143 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
15146 * ecore.cs (MethodGroupExpr.DoResolve): Set the
15147 `instance_expression' to null if we don't have any non-static
15150 2003-05-18 Martin Baulig <martin@ximian.com>
15152 Reworked the way how local variables and parameters are handled by
15153 the flow analysis code.
15155 * statement.cs (TypeInfo, VariableMap): New public classes.
15156 (VariableInfo): New public class. This is now responsible for
15157 checking whether a variable has been assigned. It is used for
15158 parameters and local variables.
15159 (Block.EmitMeta): Take the InternalParameters as argument; compute
15160 the layout of the flow vectors here.
15161 (Block.LocalMap, Block.ParameterMap): New public properties.
15162 (FlowBranching): The .ctor doesn't get the InternalParameters
15163 anymore since Block.EmitMeta() now computes the layout of the flow
15165 (MyStructInfo): This class is now known as `StructInfo' and nested
15166 in `TypeInfo'; we don't access this directly anymore.
15168 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
15169 property and removed IsAssigned(), IsFieldAssigned(),
15170 SetAssigned() and SetFieldAssigned(); we now call them on the
15171 VariableInfo so we don't need to duplicate this code everywhere.
15173 * expression.cs (ParameterReference): Added `Block block' argument
15175 (LocalVariableReference, ParameterReference, This): The new
15176 VariableInfo class is now responsible for all the definite
15179 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
15180 IsParameterAssigned, SetParameterAssigned): Removed.
15182 2003-05-18 Martin Baulig <martin@ximian.com>
15184 * typemanager.cs (InitCoreTypes): Try calling
15185 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
15186 the 3-args-version. Corlib now also needs our `void_type'.
15187 (GetMethod): Added overloaded version which takes an optional
15188 `bool report_errors' to allow lookups of optional methods.
15190 2003-05-12 Martin Baulig <martin@ximian.com>
15192 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
15193 only used for locals and not for parameters.
15195 2003-05-12 Miguel de Icaza <miguel@ximian.com>
15197 * support.cs (InternalParameters.ParameterType): Return the
15198 ExternalType of the parameter.
15200 * parameter.cs (Parameter.ExternalType): drop the two arguments,
15203 2003-05-11 Miguel de Icaza <miguel@ximian.com>
15205 * class.cs (MethodData.Define): Do not set the `newslot' on
15206 interface members, if they are also flagged as "override".
15208 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
15209 better code for ++i and i++. This only works for static fields
15210 and local variables.
15212 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
15213 want to pull the DeclSpace out of the builder_to_declspace instead
15214 of the TypeBuilder (like in TypeContainer.FindMembers).
15216 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
15217 instead of LookupTypeContainer. Fixes the crash on .NET for
15218 looking up interface members.
15220 * const.cs: Create our own emit context during the Definition
15221 stage, so that constants are evaluated in the proper context, when
15222 a recursive definition happens.
15224 2003-05-11 Martin Baulig <martin@ximian.com>
15226 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
15227 new block for a switch section.
15228 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
15229 the adding/lookup in the switch block. Fixes #39828.
15231 2003-05-09 Miguel de Icaza <miguel@ximian.com>
15233 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
15234 functionality: I needed to convert the data after I had performed
15235 the add/sub operation into the operands type size.
15237 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
15238 pass the type for the box operation, otherwise the resulting
15239 object would have been of type object.
15241 (BoxedCast): Add constructor to specify the type to box as.
15243 2003-05-07 Miguel de Icaza <miguel@ximian.com>
15245 * iterators.cs: I was reusing the `count' variable inadvertently,
15246 take steps to not allow this to happen.
15248 2003-05-06 Miguel de Icaza <miguel@ximian.com>
15250 * attribute.cs (Attribute.Resolve): Params attributes are encoded
15251 by creating an array at the point where the params starts and
15252 putting all those arguments there, then adjusting the size of the
15255 2003-05-05 Miguel de Icaza <miguel@ximian.com>
15257 * expression.cs (New.AddressOf): Implement interface
15258 IMemoryLocation. This is used when the `new' operator is used in
15259 the context of an invocation to a method on a value type.
15261 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
15264 * namespace.cs: Also check the using aliases here.
15266 * driver.cs: Move the test for using validity after the types have
15267 been entered, so we do a single pass that also includes the using
15270 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
15271 in the regular case. CreateSiblingForFinally is doing extra
15274 * attribute.cs (GetAttributeArgumentExpression): Store the result
15275 on an out value, and use the return value to indicate failure
15276 instead of using null (which is a valid return for Constant.GetValue).
15278 * statement.cs: Perform the analysis flow for the increment
15279 portion after the statement, because this will be the real flow of
15280 execution. Fixes #42385
15282 * codegen.cs (EmitContext.EmitArgument,
15283 EmitContext.EmitStoreArgument): New helper functions when the
15284 RemapToProxy flag is set.
15286 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
15289 Add support for remapping parameters.
15291 * iterators.cs: Propagate parameter values; Store parameter
15292 values in the proxy classes.
15294 2003-05-04 Miguel de Icaza <miguel@ximian.com>
15296 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
15297 need a proxy reference; I do not know what I was thinking
15299 * cs-parser.jay (constructor_initializer): catch another error,
15300 and display nice message.
15302 (field_declaration): catch void field declaration
15303 to flag a better error.
15305 * class.cs (MemberBase.CheckBase): Report an error instead of a
15306 warning if a new protected member is declared in a struct.
15307 (Field.Define): catch the error of readonly/volatile.
15309 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
15311 (FieldExpr.AddressOf): ditto. Catch error where the address of a
15312 volatile variable is taken
15314 2003-05-02 Miguel de Icaza <miguel@ximian.com>
15316 * statement.cs (Fixed.Resolve): Report an error if we are not in
15319 2003-05-01 Miguel de Icaza <miguel@ximian.com>
15321 * typemanager.cs: reuse the code that handles type clashes for
15322 delegates and enumerations.
15324 * class.cs (Report28): Always report.
15326 * expression.cs (EncodeAsAttribute): Allow nulls here.
15328 2003-04-28 Miguel de Icaza <miguel@ximian.com>
15330 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
15331 the functionality for testing whether an expression is valid for
15332 an attribute here. Also handle the case of arrays of elements
15335 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
15336 encoding a linear array into an array of objects that are suitable
15337 to be passed to an CustomAttributeBuilder.
15339 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
15341 * ecore.cs: (FieldExpr): Handle field remapping here.
15343 * iteratators.cs: Pass the instance variable (if the method is an
15344 instance method) to the constructors, so we can access the field
15345 variables on the class.
15347 TODO: Test this with structs. I think the THIS variable on
15348 structs might have to be a pointer, and not a refenrece
15350 2003-04-27 Miguel de Icaza <miguel@ximian.com>
15352 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
15353 local variables to fields in a proxy class.
15355 * iterators.cs (PopulateProxy): Rename our internal fields to
15357 Create a <THIS> field if we are an instance method, so we can
15358 reference our parent container variables.
15359 (MapVariable): Called back from the EmitContext code to enter a
15360 new variable to field mapping into the proxy class (we just create
15364 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
15365 for using the remapped locals to fields.
15367 I placed the code here, because that gives the same semantics to
15368 local variables, and only changes the Emit code.
15370 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
15371 statements inside iterators.
15372 (VariableInfo): Add a FieldBuilder for the cases when we are
15373 remapping local variables to fields in a proxy class
15375 * ecore.cs (SimpleNameResolve): Avoid testing two times for
15376 current_block != null.
15378 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
15379 not cope with strings, as it has been moved to the
15380 TableSwitchEmit. Fixed bug in switch generation.
15382 * expression.cs (New.DoResolve): Provide more context for the user
15383 when reporting an error.
15385 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
15388 * expression.cs (MemberAccess.DoResolve): When we get a type back,
15389 check the permissions for it. Note than in a type-resolution
15390 context the check was already present in DeclSpace.ResolveType,
15391 but was missing from the MemberAccess.
15393 (ArrayCreation.CheckIndices): warn if the user has
15394 more nested levels of expressions, but there are no more
15395 dimensions specified. Avoids crash on bug 41906.
15397 2003-04-26 Miguel de Icaza <miguel@ximian.com>
15399 * statement.cs (Block): replace Implicit bool, for a generic
15401 New flag: `Unchecked'. This is used during the EmitMeta phase
15402 (which is out-of-line with the regular Resolve/Emit process for a
15403 statement, as this is done ahead of time, but still gets a chance
15404 to call constant resolve).
15406 (Block.Flags): new enum for adding a new flag.
15408 (Block.EmitMeta): track the state of unchecked.
15410 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
15411 to enable constant resolution to work there as well.
15413 2003-04-22 Miguel de Icaza <miguel@ximian.com>
15415 * typemanager.cs (ienumerable_type): Also look up
15416 System.Collections.IEnumerable.
15418 2003-04-21 Miguel de Icaza <miguel@ximian.com>
15420 TODO: Test more than one conditional per method.
15422 * class.cs (Indexer.Define): Report the location where the user is
15423 referencing the unsupported feature.
15425 (MethodData): Overload the use of `conditionals' to
15426 minimize the creation of needless ArrayLists. This saves roughly
15427 212kb on my machine.
15429 (Method): Implement the new IIteratorContainer interface.
15430 (Method.SetYields): Implement the method by setting the ModFlags
15431 to contain METHOD_YIELDS.
15433 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
15434 which just got set to null.
15436 * iterators.cs: New file.
15438 (Yield, YieldBreak): New statements.
15440 * statement.cs (Return.Resolve): Flag an error if we are used in
15441 an iterator method.
15443 * codegen.cs (InIterator): New flag set if the code is being
15444 compiled in an iterator method.
15446 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
15447 internal modifier, and we just use it to avoid adding extra
15448 fields, as this is seldom used.
15450 * cs-parser.jay: Add yield_statement (yield and yield break).
15452 * driver.cs: New flag -v2 to turn on version 2 features.
15454 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
15455 hashtable when v2 is enabled.
15457 2003-04-20 Miguel de Icaza <miguel@ximian.com>
15459 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
15460 there is already a namespace defined with this name.
15462 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
15463 people upgraded their corlibs.
15465 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
15466 always use fully qualified types, no need to use the compiler
15469 (TypeManager.IsNamespace): Use binarysearch.
15471 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
15472 AddDelegate): I did not quite use the new IsValid API properly: I
15473 have to pass the short-name and the fullname. I was passing only
15474 the basename instead of the fullname sometimes.
15476 (TypeContainer.DefineType): call NamespaceClash.
15478 * interface.cs (Interface.DefineType): use NamespaceClash before
15481 * delegate.cs (Delegate.DefineType): use NamespaceClash before
15484 * enum.cs: (Enum.DefineType): use NamespaceClash before
15487 * typemanager.cs (: 3-line patch that gives us some tasty 11%
15488 speed increase. First, use the negative_hits cache when we get a
15489 negative. Second, add the type with its full original name
15490 instead of the new . and + encoded name (reflection uses + to
15491 separate type from a nested type). Use LookupTypeReflection
15492 directly which bypasses the type->name hashtable (that we already
15493 know does not contain the type.
15495 * decl.cs (DeclSpace.ResolveTypeExpr): track the
15496 location/container type.
15498 * driver.cs: When passing utf8, use directly the UTF8Encoding.
15500 2003-04-19 Miguel de Icaza <miguel@ximian.com>
15502 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
15504 * delegate.cs (NewDelegate.Resolve): Test whether an instance
15505 method is being referenced in the method group from a static
15506 context, and report error 120 if so.
15508 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
15511 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
15512 is created, we create the A namespace).
15514 * cs-parser.jay: A namespace also introduces a DeclarationFound.
15517 2003-04-18 Miguel de Icaza <miguel@ximian.com>
15519 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
15520 invocation to ModuleBuilder.GetType with the same values will
15521 return a new type instance, so we need to cache its return
15524 * expression.cs (Binary.ResolveOperator): Only allow the compare
15525 operators on enums if they are of the same type.
15527 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
15528 types of ValueType on their own case. Before we were giving them
15529 the same treatment as objects.
15531 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
15532 fullname. Short name is used to compare against container name.
15533 Fullname is used to check against defined namespace names.
15535 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
15536 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
15538 (Method.CheckBase): Call parent.
15539 (MemberBase.CheckBase): Check for protected members on sealed
15541 (PropertyBase.CheckBase): Call parent.
15542 (Field.Define): Call parent.
15544 * report.cs: Negative error codes are now mapped to 8000 - code,
15545 so that the display is render more nicely.
15547 * typemanager.cs: Do not use try/catch, instead report a regular
15550 (GetPointerType, GetReferenceType): These methods provide
15551 mechanisms to obtain the T* and T& from a T. We had the code
15552 previously scattered around the code base, and it also used
15553 TypeManager.LookupType that would go through plenty of caches.
15554 This one goes directly to the type source.
15556 In some places we did the Type.GetType followed by
15557 ModuleBuilder.GetType, but not in others, so this unifies the
15558 processing as well.
15560 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
15561 statements now that we have namespace information.
15563 * typemanager.cs (IsNamespace): New method, returns whether the
15564 string presented is a namespace or not.
15566 (ComputeNamespaces): New public entry point, computes the list of
15567 available namespaces, using the GetNamespaces API call in Mono, or
15568 the slower version in MS.NET.
15570 Now before we start the semantic analysis phase, we have a
15571 complete list of namespaces including everything that the user has
15574 Deleted old code to cache namespaces in .nsc files.
15576 2003-04-17 Miguel de Icaza <miguel@ximian.com>
15578 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
15579 class/struct location definition Location for the implicit
15580 constructor location.
15582 (Operator.Define): Use the location of the operator for the
15583 implicit Method definition.
15585 (Constructor.Emit): use the constructor location for the implicit
15586 base initializer constructor.
15588 * ecore.cs: Remove ITypeExpression. This interface is now gone,
15589 and the Expression class now contains two new methods:
15591 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
15592 isolate type lookup from the rest of the resolution process.
15594 Since we use Expressions to hold type definitions due to the way
15595 we parse the input we have historically overloaded Resolve to
15596 perform the Type lookups if a special flag is passed. Now this is
15597 eliminated and two methods take their place.
15599 The differences in the two methods between xStep and xTerminal is
15600 that xStep is involved in our current lookup system that uses
15601 SimpleNames to compose a name, while xTerminal is used just to
15602 catch the case where the simplename lookup failed.
15604 2003-04-16 Miguel de Icaza <miguel@ximian.com>
15606 * expression.cs (ResolveMemberAccess): Remove redundant code.
15607 TypeExpr expressions are always born fully resolved.
15609 * interface.cs (PopulateMethod): Do not lookup the types twice.
15610 We were doing it once during SemanticAnalysis and once during
15613 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
15614 in local variable type definitions, were being returned as a
15615 SimpleName (we decomposed everything into a string), that is
15616 because primary_expression was being used instead of a type in the
15617 grammar (reduce/reduce conflicts).
15619 The part that was wrong is that we converted the expression into a
15620 string (an oversimplification in one hand, compounded with primary
15621 expressions doing string concatenation).
15627 Would return "A.B.C[]" as a SimpleName. This stopped things like
15628 using clauses from working on this particular context. And a type
15629 was being matched directly against "A.B.C[]".
15631 We now use the correct approach, and allow for ComposedCast to be
15632 part of the unary expression. So the "A.B.C []" become a composed
15633 cast of "A.B.C" (as a nested group of MemberAccess with a
15634 SimpleName at the end) plus the rank composition "[]".
15638 2003-04-10 Miguel de Icaza <miguel@ximian.com>
15640 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
15641 for the access level checking.
15643 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
15644 `TypeContainer container', because I kept getting confused when I
15645 was debugging this code.
15647 * expression.cs (Indexers): Instead of tracking getters/setters,
15648 we now track them in parallel. We create one arraylist less, but
15649 most importantly it is possible now for the LValue code to find a
15650 matching get for a set.
15652 (IndexerAccess.DoResolveLValue): Update the code.
15653 GetIndexersForType has been modified already to extract all the
15654 indexers from a type. The code assumed it did not.
15656 Also make the code set the correct return type for the indexer.
15657 This was fixed a long time ago for properties, but was missing for
15658 indexers. It used to be void_type.
15660 (Binary.Emit): Test first for doubles instead of
15661 floats, as they are more common.
15663 (Binary.EmitBranchable): Use the .un version of the branch opcodes
15664 when dealing with floats and the <=, >= operators. This fixes bug
15667 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
15668 to load the array value by emitting a load on the foreach variable
15669 type. This was incorrect.
15671 We now emit the code to load an element using the the array
15672 variable type, and then we emit the conversion operator.
15676 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
15678 * attribute.cs: Avoid allocation of ArrayLists in the common case.
15680 2003-04-09 Miguel de Icaza <miguel@ximian.com>
15682 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
15683 test for protection before we test for signatures.
15685 (MethodSignature.ToString): implement.
15687 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
15688 to the case where we reduced into a LongConstant.
15690 * decl.cs (CheckAccessLevel): If the type is an array, we can not
15691 depend on whether the information is acurrate, because the
15692 Microsoft runtime will always claim that the array type is public,
15693 regardless of the real state.
15695 If the type is a pointer, another problem happens: the type is
15696 reported as non-public in Microsoft.
15698 In both cases we have to call CheckAccessLevel recursively with
15699 the underlying type as the argument to be tested.
15701 2003-04-08 Miguel de Icaza <miguel@ximian.com>
15703 * assign.cs (Assign.Emit): If we are dealing with a compound
15704 assignment expression, we should use the code path that stores the
15705 intermediate result in a temporary value. This fixes #40903.
15707 *expression.cs (Indirection.ToString): Provide ToString method for
15710 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
15712 * class.cs: Null out fields holding references to Block objects so
15713 they can be garbage collected.
15715 * expression.cs (OverloadResolve): Remove unused local.
15717 2003-04-07 Martin Baulig <martin@ximian.com>
15719 * codegen.cs (EmitContext.CurrentFile): New public field.
15720 (EmitContext.Mark): Use the CurrentFile to check whether the
15721 location is in the correct file.
15722 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
15724 2003-04-07 Martin Baulig <martin@ximian.com>
15726 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
15728 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
15729 location. [FIXME: The location argument which gets passed to this
15730 method is sometimes wrong!]
15732 2003-04-07 Nick Drochak <ndrochak@gol.com>
15734 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
15736 2003-04-07 Miguel de Icaza <miguel@ximian.com>
15738 * expression.cs (Indirection.EmitAssign): We were using the
15739 temporary, but returning immediately instead of continuing the
15742 2003-04-06 Martin Baulig <martin@ximian.com>
15744 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
15745 if it's a nested child, but also deriving from the outer class.
15748 * typemanager.cs (IsNestedChildOf): Make this work if it's a
15749 nested child, but also deriving from the outer class. See
15751 (FilterWithClosure): We may access private members of the outer
15752 class if we're a nested child and deriving from the outer class.
15753 (RealMemberLookup): Only set `closure_private_ok' if the
15754 `original_bf' contained BindingFlags.NonPublic.
15756 2003-04-05 Martin Baulig <martin@ximian.com>
15758 * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
15759 probe if its a type parameter, and if so, flag an error.
15761 * decl.cs: Move here the SetParameterInfo code from class.cs.
15762 Handle IsGeneric here.
15764 Handle a variety of errors in the parameter info definition.
15766 * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
15767 type parameters here.
15769 * cs-parser.jay (class_declaration): report errors for parameters
15772 2003-01-21 Miguel de Icaza <miguel@ximian.com>
15774 * generic.cs: New file, contains support code for generics.
15776 * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
15777 OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
15779 Update parser for the above removals.
15781 * cs-tokenizer.cs: Do not handle <<= or >>= specially. This is
15782 now taken care of in the parser.
15784 2003-04-02 Miguel de Icaza <miguel@ximian.com>
15786 * class.cs (Event.Define): Do not allow abstract events to have
15789 2003-04-01 Miguel de Icaza <miguel@ximian.com>
15791 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
15792 block in event declarations.
15794 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
15795 value type, get its address.
15797 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
15798 leaving a class on the stack instead of a boolean value (int
15799 0/1). Change the code so we compare against null, and then the
15800 result against zero.
15802 * class.cs (TypeContainer.GetClassBases): We were checking for the
15803 parent class being sealed too late.
15805 * expression.cs (Binary.Emit): For <= and >= when dealing with
15806 floating point values, use cgt.un and clt.un instead of cgt and
15809 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
15811 * statement.cs: Apply the same optimization as MS: skip the
15812 GetEnumerator returning an IEnumerator, and use the one returning a
15813 CharEnumerator instead. This allows us to avoid the try-finally block
15816 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
15818 * cs-parser.jay: Attributes cannot be applied to
15819 namespaces. Fixes #40473
15821 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15824 (Add*): check if the name is valid using the full name for constants,
15825 fields, properties and events.
15827 2003-03-28 Miguel de Icaza <miguel@ximian.com>
15829 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
15830 char constants to be part of the enumeration.
15832 * expression.cs (Conditional.DoResolve): Add support for operator
15833 true. Implements the missing functionality from 14.12
15835 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
15836 operator true/false as required by the spec.
15838 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
15839 implicit conversion to boolean.
15841 * statement.cs (Statement.ResolveBoolean): A boolean expression is
15842 also one where the type implements `operator true'.
15844 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
15845 get an expression that will invoke operator true based on an
15848 (GetConversionOperators): Removed the hack that called op_True
15851 (Expression.ResolveBoolean): Move this from Statement.
15853 2003-03-17 Miguel de Icaza <miguel@ximian.com>
15855 * ecore.cs (FieldExpr): do not allow initialization of initonly
15856 fields on derived classes
15858 2003-03-13 Martin Baulig <martin@ximian.com>
15860 * statement.cs (Block.Emit): Call ig.BeginScope() and
15861 ig.EndScope() when compiling with debugging info; call
15862 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
15864 2003-03-08 Miguel de Icaza <miguel@ximian.com>
15866 * expression.cs (Indexers): Do not construct immediately, allow
15867 for new members to be appended as we go. Fixes 38143
15869 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15871 * expression.cs: save/restore context when resolving an unchecked
15874 2003-03-05 Miguel de Icaza <miguel@ximian.com>
15876 * cfold.cs: Catch division by zero in modulus operator during
15879 2003-03-03 Miguel de Icaza <miguel@ximian.com>
15881 * interface.cs (Interface.DefineMembers): Avoid defining members
15884 2003-02-27 Miguel de Icaza <miguel@ximian.com>
15886 * driver.cs: handle the +/- options for -noconfig
15888 * statement.cs (Unckeched.Resolve): Also track the state of
15889 unchecked in the Resolve phase.
15891 2003-02-27 Martin Baulig <martin@ximian.com>
15893 * ecore.cs (Expression.MemberLookup): Don't create a
15894 MethodGroupExpr for something which is not a method. Fixes #38291.
15896 2003-02-25 Miguel de Icaza <miguel@ximian.com>
15898 * class.cs (MemberBase.CheckParameters): Also check that the type
15899 is unmanaged if it is a pointer.
15901 * expression.cs (SizeOf.Resolve): Add location information.
15903 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
15904 a managed type is declared.
15906 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
15907 parameter modifiers as well. Fixes bug 38606
15909 * class.cs: Very sad. Am backing out the speed up changes
15910 introduced by the ArrayList -> Array in the TypeContainer, as they
15911 were not actually that much faster, and introduced a bug (no error
15912 reports on duplicated methods).
15914 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
15915 source first, this will guarantee that we have a valid expression
15916 before calling in lower levels functions that will require a
15917 resolved object. Then use this original_source in the
15918 target.ResolveLValue instead of the original source that was
15921 Another change. Use target.Resolve instead of LValueResolve.
15922 Although we are resolving for LValues, we will let the Assign code
15923 take care of that (it will be called again from Resolve). This
15924 basically allows code like this:
15926 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
15927 class Y { void A (X x) { x [0] += o; }
15929 The problem was that the indexer was trying to resolve for
15930 set_Item (idx, object o) and never finding one. The real set_Item
15931 was set_Item (idx, X). By delaying the process we get the right
15936 2003-02-23 Martin Baulig <martin@ximian.com>
15938 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
15939 while calling DoEmit ().
15941 * codegen.cs (EmitContext.Mark): Don't mark locations in other
15942 source files; if you use the #line directive inside a method, the
15943 compiler stops emitting line numbers for the debugger until it
15944 reaches the end of the method or another #line directive which
15945 restores the original file.
15947 2003-02-23 Martin Baulig <martin@ximian.com>
15949 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
15951 2003-02-23 Martin Baulig <martin@ximian.com>
15953 * statement.cs (Block.AddChildVariableNames): We need to call this
15954 recursively, not just for our immediate children.
15956 2003-02-23 Martin Baulig <martin@ximian.com>
15958 * class.cs (Event.Define): Always make the field private, like csc does.
15960 * typemanager.cs (TypeManager.RealMemberLookup): Make events
15961 actually work, fixes bug #37521.
15963 2003-02-23 Miguel de Icaza <miguel@ximian.com>
15965 * delegate.cs: When creating the various temporary "Parameters"
15966 classes, make sure that we call the ComputeAndDefineParameterTypes
15967 on those new parameters (just like we do with the formal ones), to
15968 allow them to be resolved in the context of the DeclSpace.
15970 This fixes the bug that Dick observed in Bugzilla #38530.
15972 2003-02-22 Miguel de Icaza <miguel@ximian.com>
15974 * expression.cs (ResolveMemberAccess): When resolving a constant,
15975 do not attempt to pull a constant if the value was not able to
15976 generate a valid constant.
15978 * const.cs (LookupConstantValue): Do not report more errors than required.
15980 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15982 * expression.cs: fixes bug #38328.
15984 2003-02-18 Miguel de Icaza <miguel@ximian.com>
15986 * class.cs: Changed all the various members that can be part of a
15987 class from being an ArrayList to be an Array of the right type.
15988 During the DefineType type_list, interface_list, delegate_list and
15989 enum_list are turned into types, interfaces, delegates and enums
15992 And during the member population, indexer_list, event_list,
15993 constant_list, field_list, instance_constructor_list, method_list,
15994 operator_list and property_list are turned into their real arrays.
15996 Although we could probably perform this operation earlier, for
15997 good error reporting we need to keep the lists and remove the
15998 lists for longer than required.
16000 This optimization was triggered by Paolo profiling the compiler
16001 speed on the output of `gen-sample-program.pl' perl script.
16003 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
16004 not crash in methods like MemberLookupFailed that use this field.
16006 This problem arises when the compiler fails to resolve a type
16007 during interface type definition for example.
16009 2003-02-18 Miguel de Icaza <miguel@ximian.com>
16011 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
16012 inherit from System.Object, so we have to stop at null, not only
16013 when reaching System.Object.
16015 2003-02-17 Miguel de Icaza <miguel@ximian.com>
16017 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
16018 DeclaredOnly because the parent indexer might have had a different
16019 name, but did not loop until the top of the hierarchy was reached.
16021 The problem this one fixes is 35492: when a class implemented an
16022 indexer from an interface, we were getting the interface method
16023 (which was abstract) and we were flagging an error (can not invoke
16026 This also keeps bug 33089 functioning, and test-148 functioning.
16028 * typemanager.cs (IsSpecialMethod): The correct way of figuring
16029 out if a method is special is to see if it is declared in a
16030 property or event, or whether it is one of the predefined operator
16031 names. This should fix correctly #36804.
16033 2003-02-15 Miguel de Icaza <miguel@ximian.com>
16035 The goal here is to remove the dependency on EmptyCast.Peel ().
16036 Killing it completely.
16038 The problem is that currently in a number of places where
16039 constants are expected, we have to "probe" for an EmptyCast, and
16040 Peel, which is not the correct thing to do, as this will be
16041 repetitive and will likely lead to errors.
16043 The idea is to remove any EmptyCasts that are used in casts that
16044 can be reduced to constants, so we only have to cope with
16047 This bug hunt was triggered by Bug 37363 and the desire to remove
16048 the duplicate pattern where we were "peeling" emptycasts to check
16049 whether they were constants. Now constants will always be
16052 * ecore.cs: Use an enumconstant here instead of wrapping with
16055 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
16056 throwing me off. By handling this we can get rid of a few hacks.
16058 * statement.cs (Switch): Removed Peel() code.
16060 2003-02-14 Miguel de Icaza <miguel@ximian.com>
16062 * class.cs: Location information for error 508
16064 * expression.cs (New.DoResolve): Add a guard against double
16065 resolution of an expression.
16067 The New DoResolve might be called twice when initializing field
16068 expressions (see EmitFieldInitializers, the call to
16069 GetInitializerExpression will perform a resolve on the expression,
16070 and later the assign will trigger another resolution
16072 This leads to bugs (#37014)
16074 * delegate.cs: The signature for EndInvoke should contain any ref
16075 or out parameters as well. We were not doing this in the past.
16077 * class.cs (Field.Define): Do not overwrite the type definition
16078 inside the `volatile' group. Turns out that volatile enumerations
16079 were changing the type here to perform a validity test, which
16082 2003-02-12 Miguel de Icaza <miguel@ximian.com>
16084 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
16085 and structs, we do not want to load the instance variable
16087 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
16088 enum_type has to be handled like an object reference (implicit
16089 conversions exists from this to object), but the regular IsClass
16090 and IsValueType tests will never return true for this one.
16092 Also we use TypeManager.IsValueType instead of type.IsValueType,
16093 just for consistency with the rest of the code (this is only
16094 needed if we ever use the construct exposed by test-180.cs inside
16095 corlib, which we dont today).
16097 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
16099 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
16102 2003-02-09 Martin Baulig <martin@ximian.com>
16104 * namespace.cs (Namespace..ctor): Added SourceFile argument.
16105 (Namespace.DefineNamespaces): New static public method; this is
16106 called when we're compiling with debugging to add all namespaces
16107 to the symbol file.
16109 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
16110 pass it to the Namespace's .ctor.
16112 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
16113 and MethodBase arguments; pass the namespace ID to the symwriter;
16114 pass the MethodBase instead of the token to the symwriter.
16115 (SymbolWriter.DefineNamespace): New method to add a namespace to
16118 2003-02-09 Martin Baulig <martin@ximian.com>
16120 * symbolwriter.cs: New file. This is a wrapper around
16121 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
16122 methods here in near future.
16124 2003-02-09 Martin Baulig <martin@ximian.com>
16126 * codegen.cs (EmitContext.Mark): Just pass the arguments to
16127 ILGenerator.MarkSequencePoint() which are actually used by the
16130 2003-02-09 Martin Baulig <martin@ximian.com>
16132 * location.cs (SourceFile): New public sealed class. This
16133 contains the name and an index which is used in the location's token.
16134 (Location): Reserve an appropriate number of bits in the token for
16135 the source file instead of walking over that list, this gives us a
16136 really huge performance improvement when compiling with debugging.
16138 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
16139 `SourceFile' argument instead of a string.
16140 (Driver.ProcessFile): Add all the files via Location.AddFile(),
16141 but don't parse/tokenize here, we need to generate the list of all
16142 source files before we do that.
16143 (Driver.ProcessFiles): New static function. Parses/tokenizes all
16146 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
16147 instead of a string.
16149 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
16152 2003-02-09 Martin Baulig <martin@ximian.com>
16154 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
16155 filename on `#line default'.
16157 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
16159 * statement.cs: don't clear the pinned var when the fixed statement
16160 returns from the method (fixes bug#37752).
16162 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
16164 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
16167 2003-02-07 Martin Baulig <martin@ximian.com>
16169 * driver.cs: Removed the `--debug-args' command line argument.
16171 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
16172 automatically by the AsssemblyBuilder.
16173 (CodeGen.InitializeSymbolWriter): We don't need to call any
16174 initialization function on the symbol writer anymore. This method
16175 doesn't take any arguments.
16177 2003-02-03 Miguel de Icaza <miguel@ximian.com>
16179 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
16180 from referenced assemblies as well.
16182 2003-02-02 Martin Baulig <martin@ximian.com>
16184 * class.cs (MethodData.Emit): Generate debugging info for external methods.
16186 2003-02-02 Martin Baulig <martin@ximian.com>
16188 * class.cs (Constructor.Emit): Open the symbol writer before
16189 emitting the constructor initializer.
16190 (ConstructorInitializer.Emit): Call ec.Mark() to allow
16191 single-stepping through constructor initializers.
16193 2003-01-30 Miguel de Icaza <miguel@ximian.com>
16195 * class.cs: Handle error 549: do not allow virtual methods in
16198 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
16200 * decl.cs: Check access levels when resolving types
16202 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
16204 * statement.cs: Add parameters and locals set in catch blocks that might
16205 return to set vector
16207 2003-01-29 Miguel de Icaza <miguel@ximian.com>
16209 * class.cs (Operator): Set the SpecialName flags for operators.
16211 * expression.cs (Invocation.DoResolve): Only block calls to
16212 accessors and operators on SpecialName methods.
16214 (Cast.TryReduce): Handle conversions from char constants.
16217 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
16219 * statement.cs: small memory and time optimization in FlowBranching.
16221 2003-01-28 Pedro Mart <yoros@wanadoo.es>
16223 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
16224 problem that the last fix but in the other sid (Set).
16226 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
16227 access when there is no indexer in the hierarchy.
16229 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
16231 * class.cs: Combine some if statements.
16233 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16235 * driver.cs: fixed bug #37187.
16237 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
16239 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
16240 any indexer, it's needed to build a list with all the indexers in the
16241 hierarchy (AllGetters), else we have problems. Fixes #35653.
16243 2003-01-23 Miguel de Icaza <miguel@ximian.com>
16245 * class.cs (MethodData.Define): It is wrong for an interface
16246 implementation to be static in both cases: explicit and implicit.
16247 We were only handling this in one case.
16249 Improve the if situation there to not have negations.
16251 * class.cs (Field.Define): Turns out that we do not need to check
16252 the unsafe bit on field definition, only on usage. Remove the test.
16254 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16256 * driver.cs: use assembly.Location instead of Codebase (the latest
16257 patch made mcs fail when using MS assemblies).
16259 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
16261 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
16262 get the path to *corlib.dll.
16264 2003-01-21 Nick Drochak <ndrochak@gol.com>
16268 * typemanager.cs: Remove compiler warnings
16270 2003-01-20 Duncan Mak <duncan@ximian.com>
16272 * AssemblyInfo.cs: Bump the version number to 0.19.
16274 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16276 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
16278 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
16280 * class.cs (Constructor::Emit): Emit debugging info for constructors.
16282 2003-01-17 Miguel de Icaza <miguel@ximian.com>
16284 * cs-parser.jay: Small fix: we were not comparing the constructor
16285 name correctly. Thanks to Zoltan for the initial pointer.
16287 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
16289 * cs-tokenizer.cs: Set file name when specified with #line
16291 2003-01-15 Miguel de Icaza <miguel@ximian.com>
16293 * cs-parser.jay: Only perform the constructor checks here if we
16294 are named like the class; This will help provider a better
16295 error. The constructor path is taken when a type definition is
16296 not found, but most likely the user forgot to add the type, so
16297 report that rather than the constructor error.
16299 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
16301 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
16304 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16306 * cs-parser.jay: Add cleanup call.
16308 2003-01-13 Duncan Mak <duncan@ximian.com>
16310 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
16311 consistent with other methods.
16313 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16315 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
16317 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
16319 * attribute.cs: only set GuidAttr to true when we have a
16322 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16326 * typemanager.cs: fixes to allow mcs compile corlib with the new
16327 Type.IsSubclassOf fix.
16329 2003-01-08 Miguel de Icaza <miguel@ximian.com>
16331 * expression.cs (LocalVariableReference.DoResolve): Classify a
16332 constant as a value, not as a variable. Also, set the type for
16335 * cs-parser.jay (fixed_statement): take a type instead of a
16336 pointer_type, so we can produce a better error message later.
16338 * statement.cs (Fixed.Resolve): Flag types that are not pointers
16341 (For.DoEmit): Make inifinite loops have a
16342 non-conditional branch back.
16344 (Fixed.DoEmit): First populate the pinned variables, then emit the
16345 statement, then clear the variables. Before I was emitting the
16346 code once for each fixed piece.
16349 2003-01-08 Martin Baulig <martin@ximian.com>
16351 * statement.cs (FlowBranching.MergeChild): A break in a
16352 SWITCH_SECTION does not leave a loop. Fixes #36155.
16354 2003-01-08 Martin Baulig <martin@ximian.com>
16356 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
16357 lives in the same number space than `param_map'. Fixes #36154.
16359 2003-01-07 Miguel de Icaza <miguel@ximian.com>
16361 * cs-parser.jay (constructor_declaration): Set the
16362 Constructor.ModFlags before probing for it. This makes the
16363 compiler report 514, 515 and 132 (the code was there, but got
16366 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
16367 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
16368 (GotoCase.Resolve): Set `Returns' to ALWAYS.
16370 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
16372 * enum.cs: create the enum static fields using the enum type.
16374 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
16376 * class.cs: don't try to create the ParamBuilder for the return
16377 type if it's not needed (and handle it breaking for the ms runtime
16380 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
16382 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
16384 2002-12-29 Miguel de Icaza <miguel@ximian.com>
16386 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
16387 the command. This showed up while compiling the JANET source
16388 code, which used \r as its only newline separator.
16390 2002-12-28 Miguel de Icaza <miguel@ximian.com>
16392 * class.cs (Method.Define): If we are an operator (because it
16393 reuses our code), then set the SpecialName and HideBySig. #36128
16395 2002-12-22 Miguel de Icaza <miguel@ximian.com>
16397 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
16398 exception, report error 120 `object reference required'.
16400 * driver.cs: Add --pause option, used during to measure the size
16401 of the process as it goes with --timestamp.
16403 * expression.cs (Invocation.DoResolve): Do not allow methods with
16404 SpecialName to be invoked.
16406 2002-12-21 Miguel de Icaza <miguel@ximian.com>
16408 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
16409 number before adding it.
16411 2002-12-21 Ravi Pratap <ravi@ximian.com>
16413 * ecore.cs (StandardImplicitConversion): When in an unsafe
16414 context, we allow conversion between void * to any other pointer
16415 type. This fixes bug #35973.
16417 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
16419 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
16420 is not thrown when extensionless outputs are used
16422 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16424 * rootcontext.cs: fixed compilation of corlib.
16426 2002-12-19 Miguel de Icaza <miguel@ximian.com>
16428 * attribute.cs (Attributes.Contains): Add new method.
16430 * class.cs (MethodCore.LabelParameters): if the parameter is an
16431 `out' parameter, check that no attribute `[In]' has been passed.
16433 * enum.cs: Handle the `value__' name in an enumeration.
16435 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
16437 * decl.cs: Added special case to allow overrides on "protected
16440 2002-12-18 Ravi Pratap <ravi@ximian.com>
16442 * attribute.cs (Attributes.AddAttributeSection): Rename to this
16443 since it makes much more sense.
16445 (Attributes.ctor): Don't require a Location parameter.
16447 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
16449 * attribute.cs (ApplyAttributes): Remove extra Location parameters
16450 since we already have that information per attribute.
16452 * everywhere : make appropriate changes.
16454 * class.cs (LabelParameters): Write the code which actually
16455 applies attributes to the return type. We can't do this on the MS
16456 .NET runtime so we flag a warning in the case an exception is
16459 2002-12-18 Miguel de Icaza <miguel@ximian.com>
16461 * const.cs: Handle implicit null conversions here too.
16463 2002-12-17 Ravi Pratap <ravi@ximian.com>
16465 * class.cs (MethodCore.LabelParameters): Remove the extra
16466 Type [] parameter since it is completely unnecessary. Instead
16467 pass in the method's attributes so that we can extract
16468 the "return" attribute.
16470 2002-12-17 Miguel de Icaza <miguel@ximian.com>
16472 * cs-parser.jay (parse): Use Report.Error to flag errors instead
16473 of ignoring it and letting the compile continue.
16475 * typemanager.cs (ChangeType): use an extra argument to return an
16476 error condition instead of throwing an exception.
16478 2002-12-15 Miguel de Icaza <miguel@ximian.com>
16480 * expression.cs (Unary.TryReduce): mimic the code for the regular
16481 code path. Perform an implicit cast in the cases where we can
16482 implicitly convert to one of the integral types, and then reduce
16483 based on that constant. This fixes bug #35483.
16485 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16487 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
16489 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16491 * namespace.cs: fixed bug #35489.
16493 2002-12-12 Miguel de Icaza <miguel@ximian.com>
16495 * class.cs: Remove some dead code.
16497 * cs-parser.jay: Estimate the number of methods needed
16498 (RootContext.MethodCount);
16500 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
16501 numbers instead of StringBuilders.
16503 * support.cs (PtrHashtable): Add constructor with initial size;
16504 We can now reduce reallocations of the method table.
16506 2002-12-10 Ravi Pratap <ravi@ximian.com>
16508 * attribute.cs (ApplyAttributes): Keep track of the emitted
16509 attributes on a per-target basis. This fixes bug #35413.
16511 2002-12-10 Miguel de Icaza <miguel@ximian.com>
16513 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
16514 default to the Windows 1252 encoding.
16516 (UnixParseOption): Support version, thanks to Alp for the missing
16519 * AssemblyInfo.cs: Add nice assembly information.
16521 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
16524 * cs-parser.jay: Allow a trailing comma before the close bracked
16525 in the attribute_section production.
16527 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
16528 address of the instance was being taken, I will take this out,
16529 because we take the address of the object immediately here.
16531 2002-12-09 Ravi Pratap <ravi@ximian.com>
16533 * typemanager.cs (AreMultipleAllowed): Take care of the most
16534 obvious case where attribute type is not in the current assembly -
16537 2002-12-08 Miguel de Icaza <miguel@ximian.com>
16539 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
16540 definitions, instead of doing that afterwards.
16542 Also we use a nice little hack, depending on the constructor, we
16543 know if we are a "composed" name or a simple name. Hence, we
16544 avoid the IndexOf test, and we avoid
16546 * codegen.cs: Add code to assist in a bug reporter to track down
16547 the source of a compiler crash.
16549 2002-12-07 Ravi Pratap <ravi@ximian.com>
16551 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
16552 types have been emitted for a given element and flag an error
16553 if something which does not have AllowMultiple set is used more
16556 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
16557 attribute types and their corresponding AllowMultiple properties
16559 (AreMultipleAllowed): Check the property for a given type.
16561 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
16562 property in the case we have a TypeContainer.
16564 (Attributes.AddAttribute): Detect duplicates and just skip on
16565 adding them. This trivial fix catches a pretty gross error in our
16566 attribute emission - global attributes were being emitted twice!
16568 Bugzilla bug #33187 is now fixed.
16570 2002-12-06 Miguel de Icaza <miguel@ximian.com>
16572 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
16573 instead of pp_and).
16575 * expression.cs (Binary.ResolveOperator): I can only use the
16576 Concat (string, string, string) and Concat (string, string,
16577 string, string) if the child is actually a concatenation of
16580 2002-12-04 Miguel de Icaza <miguel@ximian.com>
16582 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
16583 context where we need a 2-character lookahead.
16585 * pending.cs (PendingImplementation): Rework so we can keep track
16586 of interface types all the time, and flag those which were
16587 implemented by parents as optional.
16589 2002-12-03 Miguel de Icaza <miguel@ximian.com>
16591 * expression.cs (Binary.ResolveOperator): Use
16592 String.Concat(string,string,string) or
16593 String.Concat(string,string,string,string) when possible.
16595 * typemanager: More helper methods.
16598 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
16600 * pending.cs: remove the bogus return from GetMissingInterfaces()
16601 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
16603 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16605 * namespace.cs: avoid duplicated 'using xxx' being added to
16606 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
16607 when we get more than one 'using' statement for the same namespace.
16608 Report a CS0105 warning for it.
16610 2002-11-30 Miguel de Icaza <miguel@ximian.com>
16612 * cs-tokenizer.cs (consume_identifier): use read directly, instead
16613 of calling getChar/putback, uses internal knowledge of it.
16615 (xtoken): Reorder tokenizer so most common patterns are checked
16616 first. This reduces the compilation time in another 5% (from 8.11s
16617 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
16619 The parsing time is 22% of the compilation in mcs, and from that
16620 64% is spent on the tokenization process.
16622 I tried using a binary search for keywords, but this is slower
16623 than the hashtable. Another option would be to do a couple of
16626 * Not use a StringBuilder, instead use an array of chars,
16627 with a set value. Notice that this way we could catch
16628 the 645 error without having to do it *afterwards*.
16630 * We could write a hand-parser to avoid the hashtable
16631 compares altogether.
16633 The identifier consumption process takes 37% of the tokenization
16634 time. Another 15% is spent on is_number. 56% of the time spent
16635 on is_number is spent on Int64.Parse:
16637 * We could probably choose based on the string length to
16638 use Int32.Parse or Int64.Parse and avoid all the 64-bit
16641 Another 3% is spend on wrapping `xtoken' in the `token' function.
16643 Handle 0xa0 as whitespace (#34752)
16645 2002-11-26 Miguel de Icaza <miguel@ximian.com>
16647 * typemanager.cs (IsCLRType): New routine to tell whether a type
16648 is one of the builtin types.
16650 Maybe it needs to use TypeCodes to be faster. Maybe we could use
16651 typecode in more places instead of doing pointer comparissions.
16652 We could leverage some knowledge about the way the typecodes are
16655 New code to cache namespaces in assemblies, it is currently not
16656 invoked, to be used soon.
16658 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
16660 * expression.cs (Binary.ResolveOperator): specially handle
16661 strings, and do not perform user-defined operator overloading for
16664 2002-11-24 Miguel de Icaza <miguel@ximian.com>
16666 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
16667 internalcall as it is a pretty simple operation; Avoid whenever
16668 possible to call Char.IsLetter.
16670 (consume_identifier): Cut by half the number of
16671 hashtable calls by merging the is_keyword and GetKeyword behavior.
16673 Do not short-circuit, because if we do, we
16674 report errors (ie, #if false && true would produce an invalid
16678 2002-11-24 Martin Baulig <martin@ximian.com>
16680 * expression.cs (Cast.TryReduce): If we're in checked syntax,
16681 check constant ranges and report a CS0221. Fixes #33186.
16683 2002-11-24 Martin Baulig <martin@ximian.com>
16685 * cs-parser.jay: Make this work for uninitialized variable
16686 declarations in the `for' initializer. Fixes #32416.
16688 2002-11-24 Martin Baulig <martin@ximian.com>
16690 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
16691 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
16693 2002-11-24 Martin Baulig <martin@ximian.com>
16695 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
16696 argument; if true, we also check for user-defined conversions.
16697 This is only needed if both arguments are of a user-defined type.
16698 Fixes #30443, added test-175.cs.
16699 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
16701 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
16703 2002-11-24 Martin Baulig <martin@ximian.com>
16705 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
16706 function to get the store opcode.
16707 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
16708 only emit the Ldelema if the store opcode is Stobj. You must run
16709 both test-34 and test-167 to test this. Fixes #34529.
16711 2002-11-23 Martin Baulig <martin@ximian.com>
16713 * ecore.cs (Expression.MemberLookup): Added additional
16714 `qualifier_type' argument which is used when we're being called
16715 from MemberAccess.DoResolve() and null if we're called from a
16717 (Expression.MemberLookupFailed): New method to report errors; this
16718 does the CS1540 check and reports the correct error message.
16720 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
16721 argument for the CS1540 check and redone the way how we're dealing
16722 with private members. See the comment in the source code for details.
16723 (FilterWithClosure): Reverted this back to revision 1.197; renamed
16724 `closure_start_type' to `closure_qualifier_type' and check whether
16725 it's not null. It was not this filter being broken, it was just
16726 being called with the wrong arguments.
16728 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
16729 and pass it the correct `qualifier_type'; this also does the error
16732 2002-11-22 Miguel de Icaza <miguel@ximian.com>
16734 * expression.cs (Invocation.EmitParams): If the we are dealing
16735 with a non-built-in value type, load its address as well.
16737 (ArrayCreation): Use a a pretty constant instead
16738 of the hardcoded value 2. Use 6 instead of 2 for the number of
16739 static initializers.
16741 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
16742 because they are not really value types, just glorified integers.
16744 * driver.cs: Do not append .exe, the CSC compiler does not do it.
16746 * ecore.cs: Remove redundant code for enumerations, make them use
16747 the same code path as everything else, fixes the casting issue
16748 with enumerations in Windows.Forms.
16750 * attribute.cs: Do only cast to string if it is a string, the
16751 validation happens later.
16753 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
16754 people upgrade their corlibs.
16756 * ecore.cs: Oops, enumerations were not following the entire code path
16758 2002-11-21 Miguel de Icaza <miguel@ximian.com>
16760 * typemanager.cs (FilterWithClosure): Commented out the test for
16761 1540 in typemanager.cs, as it has problems when accessing
16762 protected methods from a parent class (see test-174.cs).
16764 * attribute.cs (Attribute.ValidateGuid): new method.
16765 (Attribute.Resolve): Use above.
16767 2002-11-19 Miguel de Icaza <miguel@ximian.com>
16769 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
16771 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
16772 handling for enumerations, as we only needed the TypeContainer
16773 functionality to begin with (this is required for the fix below to
16774 work for enums that reference constants in a container class for
16777 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
16779 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
16780 a valid TypeBuilder to perform lookups on.o
16782 * class.cs (InheritableMemberSignatureCompare): Use true in the
16783 call to GetGetMethod and GetSetMethod, because we are comparing
16784 the signature, and we need to get the methods *even* if they are
16787 (PropertyBase.CheckBase): ditto.
16789 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
16790 GotoCase.Resolve): Use Peel on EmpytCasts.
16792 * ecore.cs (EmptyCast): drop child, add Peel method.
16794 2002-11-17 Martin Baulig <martin@ximian.com>
16796 * ecore.cs (EmptyCast.Child): New public property.
16798 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
16799 label resolved to an EmptyCast. Fixes #34162.
16800 (GotoCase.Resolve): Likewise.
16801 (Block.EmitMeta): Likewise.
16803 2002-11-17 Martin Baulig <martin@ximian.com>
16805 * expression.cs (Invocation.BetterConversion): Prefer int over
16806 uint; short over ushort; long over ulong for integer literals.
16807 Use ImplicitConversionExists instead of StandardConversionExists
16808 since we also need to check for user-defined implicit conversions.
16809 Fixes #34165. Added test-173.cs.
16811 2002-11-16 Martin Baulig <martin@ximian.com>
16813 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
16814 with the `true' and `false' literals. Fixes #33151.
16816 2002-11-16 Martin Baulig <martin@ximian.com>
16818 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
16819 October 22nd; don't do the cs1540 check for static members.
16821 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
16822 now using our own filter here and doing the cs1540 check again.
16824 2002-11-16 Martin Baulig <martin@ximian.com>
16826 * support.cs (InternalParameters): Don't crash if we don't have
16827 any fixed parameters. Fixes #33532.
16829 2002-11-16 Martin Baulig <martin@ximian.com>
16831 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
16832 when looking up static methods to make this work on Windows.
16835 2002-11-16 Martin Baulig <martin@ximian.com>
16837 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
16838 a setter rather than using PropertyInfo.CanWrite.
16840 2002-11-15 Nick Drochak <ndrochak@gol.com>
16842 * class.cs: Allow acces to block member by subclasses. Fixes build
16845 2002-11-14 Martin Baulig <martin@ximian.com>
16847 * class.cs (Constructor.Emit): Added the extern/block check.
16850 2002-11-14 Martin Baulig <martin@ximian.com>
16852 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
16853 iteration while looking for indexers, this is needed because the
16854 indexer may have a different name in our base classes. Fixed the
16855 error reporting (no indexers at all, not get accessor, no
16856 overloaded match). Fixes bug #33089.
16857 (IndexerAccess.DoResolveLValue): Likewise.
16859 2002-11-14 Martin Baulig <martin@ximian.com>
16861 * class.cs (PropertyBase.CheckBase): Make this work for multiple
16862 indexers. Fixes the first part of bug #33089.
16863 (MethodSignature.InheritableMemberSignatureCompare): Added support
16866 2002-11-13 Ravi Pratap <ravi@ximian.com>
16868 * attribute.cs (Attribute.Resolve): Catch the
16869 NullReferenceException and report it since it isn't supposed to
16872 2002-11-12 Miguel de Icaza <miguel@ximian.com>
16874 * expression.cs (Binary.EmitBranchable): Also handle the cases for
16875 LogicalOr and LogicalAnd that can benefit from recursively
16876 handling EmitBranchable. The code now should be nice for Paolo.
16878 2002-11-08 Miguel de Icaza <miguel@ximian.com>
16880 * typemanager.cs (LookupType): Added a negative-hit hashtable for
16881 the Type lookups, as we perform quite a number of lookups on
16882 non-Types. This can be removed once we can deterministically tell
16883 whether we have a type or a namespace in advance.
16885 But this might require special hacks from our corlib.
16889 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
16890 and double which avoids a conversion from an integer to a double.
16892 * expression.cs: tiny optimization, avoid calling IsConstant,
16893 because it effectively performs the lookup twice.
16895 2002-11-06 Miguel de Icaza <miguel@ximian.com>
16897 But a bogus return here to keep the semantics of the old code
16898 until the Mono runtime is fixed.
16900 * pending.cs (GetMissingInterfaces): New method used to remove all
16901 the interfaces that are already implemented by our parent
16902 classes from the list of pending methods.
16904 * interface.cs: Add checks for calls after ResolveTypeExpr.
16906 2002-11-05 Miguel de Icaza <miguel@ximian.com>
16908 * class.cs (Class.Emit): Report warning 67: event not used if the
16909 warning level is beyond 3.
16911 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
16912 being a NullLiteral.
16914 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
16917 * class.cs (TypeContainer.GetClassBases): Cover a missing code
16918 path that might fail if a type can not be resolved.
16920 * expression.cs (Binary.Emit): Emit unsigned versions of the
16923 * driver.cs: use error 5.
16925 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
16927 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
16929 2002-11-01 Miguel de Icaza <miguel@ximian.com>
16931 * cs-parser.jay (switch_section): A beautiful patch from Martin
16932 Baulig that fixed 33094.
16934 2002-10-31 Miguel de Icaza <miguel@ximian.com>
16936 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
16937 Check whether the base is abstract and report an error if so.
16939 * expression.cs (IndexerAccess.DoResolveLValue,
16940 IndexerAccess.DoResolve): ditto.
16942 (Invocation.DoResolve): ditto.
16944 (Invocation.FullMethodDesc): Improve the report string.
16946 * statement.cs (Block): Eliminate IsVariableDefined as it is
16947 basically just a wrapper for GetVariableInfo.
16949 * ecore.cs (SimpleName): Use new
16951 * support.cs (ReflectionParamter.ParameterType): We unwrap the
16952 type, as we return the actual parameter ref/unref state on a
16955 2002-10-30 Miguel de Icaza <miguel@ximian.com>
16957 * support.cs: Return proper flags REF/OUT fixing the previous
16960 * expression.cs: Reverted last patch, that was wrong. Is_ref is
16961 not used to mean `ref' but `ref or out' in ParameterReference
16963 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
16964 full type signature instead of calling TypeManger.CSharpName
16967 * support.cs (InternalParameters.ParameterDesc): Do not compare
16968 directly to the modflags, because REF/OUT will actually be bitsets
16971 * delegate.cs (VerifyMethod): Check also the modifiers.
16973 * cs-tokenizer.cs: Fix bug where floating point values with an
16974 exponent where a sign was missing was ignored.
16976 * driver.cs: Allow multiple assemblies to be specified in a single
16979 2002-10-28 Miguel de Icaza <miguel@ximian.com>
16981 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
16982 because identifiers after a parenthesis would end up in this kind
16983 of production, and we needed to desamiguate it for having casts
16986 (UserDefinedType *) xxx
16988 2002-10-24 Miguel de Icaza <miguel@ximian.com>
16990 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
16991 we should set on the Bindingflags.NonPublic, but not turn on
16992 private_ok. private_ok controls whether a Private member is
16993 returned (this is chekced on the filter routine), while the
16994 BindingFlags.NonPublic just controls whether private/protected
16995 will be allowed. This fixes the problem part of the problem of
16996 private properties being allowed to be used in derived classes.
16998 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
16999 so we can call the children DoResolveLValue method (this will
17000 properly signal errors on lvalue assignments to base properties)
17002 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
17003 getter are null, and we have a property info, we know that this
17004 happened because the lookup failed, so we report an error 122 for
17005 protection level violation.
17007 We also silently return if setter and getter are null in the
17008 resolve functions, this condition only happens if we have flagged
17009 the error before. This is the other half of the problem.
17011 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
17012 not have accessibility information, that is why we were returning
17013 true in the filter function in typemanager.cs.
17015 To properly report 122 (property is inaccessible because of its
17016 protection level) correctly, we report this error in ResolveAccess
17017 by failing if both the setter and the getter are lacking (ie, the
17020 DoResolve and DoLResolve have been modified to check for both
17021 setter/getter being null and returning silently, the reason being
17022 that I did not want to put the knowledge about this error in upper
17025 int old = Report.Errors;
17026 x = new PropertyExpr (...);
17027 if (old != Report.Errors)
17032 So the property expr is returned, but it is invalid, so the error
17033 will be flagged during the resolve process.
17035 * class.cs: Remove InheritablePropertySignatureCompare from the
17036 class, as we no longer depend on the property signature to compute
17037 whether it is possible to implement a method or not.
17039 The reason is that calling PropertyInfo.GetGetMethod will return
17040 null (in .NET, in Mono it works, and we should change this), in
17041 cases where the Get Method does not exist in that particular
17046 class X { public virtual int A { get { return 1; } } }
17048 class Z : Y { public override int A { get { return 2; } } }
17050 Would fail in Z because the parent (Y) would not have the property
17051 defined. So we avoid this completely now (because the alternative
17052 fix was ugly and slow), and we now depend exclusively on the
17055 (PropertyBase.CheckBase): Use a method-base mechanism to find our
17056 reference method, instead of using the property.
17058 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
17059 routines are gone now.
17061 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
17062 names, they were incorrectly named.
17064 * cs-tokenizer.cs: Return are more gentle token on failure.
17066 * pending.cs (PendingImplementation.InterfaceMethod): This routine
17067 had an out-of-sync index variable, which caused it to remove from
17068 the list of pending methods the wrong method sometimes.
17070 2002-10-22 Miguel de Icaza <miguel@ximian.com>
17072 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
17073 CanWrite, because those refer to this particular instance of the
17074 property, and do not take into account the fact that we can
17075 override single members of a property.
17077 Constructor requires an EmitContext. The resolution process does
17078 not happen here, but we need to compute the accessors before,
17079 because the resolution does not always happen for properties.
17081 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
17082 subclass, before we did not update this flag, but we did update
17085 (GetAccessors): Drop this routine, as it did not work in the
17086 presence of partially overwritten set/get methods.
17088 Notice that this broke the cs1540 detection, but that will require
17091 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17095 * driver.cs: issue a warning instead of an error if we don't support
17096 debugging for the platform. Also ignore a couple of errors that may
17097 arise when trying to write the symbols. Undo my previous patch.
17099 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17101 * driver.cs: ignore /debug switch except for Unix platforms.
17103 2002-10-23 Nick Drochak <ndrochak@gol.com>
17105 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
17107 2002-10-21 Miguel de Icaza <miguel@ximian.com>
17109 * driver.cs: Do not make mcs-debug conditional, so we do not break
17110 builds that use it.
17112 * statement.cs (UsageVector.MergeChildren): I would like Martin to
17113 review this patch. But basically after all the children variables
17114 have been merged, the value of "Breaks" was not being set to
17115 new_breaks for Switch blocks. I think that it should be set after
17116 it has executed. Currently I set this to the value of new_breaks,
17117 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
17118 conservative, but I do not understand this code very well.
17120 I did not break anything in the build, so that is good ;-)
17122 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
17124 2002-10-20 Mark Crichton <crichton@gimp.org>
17126 * cfold.cs: Fixed compile blocker. Really fixed it this time.
17128 2002-10-20 Nick Drochak <ndrochak@gol.com>
17130 * cfold.cs: Fixed compile blocker.
17132 2002-10-20 Miguel de Icaza <miguel@ximian.com>
17134 * driver.cs: I was chekcing the key, not the file.
17136 2002-10-19 Ravi Pratap <ravi@ximian.com>
17138 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
17139 message that we were generating - we just need to silently return
17142 2002-10-19 Miguel de Icaza <miguel@ximian.com>
17144 * class.cs (Event.Define): Change my previous commit, as this
17145 breaks the debugger. This is a temporary hack, as it seems like
17146 the compiler is generating events incorrectly to begin with.
17148 * expression.cs (Binary.ResolveOperator): Added support for
17149 "U operator - (E x, E y)"
17151 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
17154 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
17155 init-only variables, but this path did not take into account that
17156 there might be also instance readonly variables. Correct this
17159 This fixes bug 32253
17161 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
17164 * driver.cs: Change the extension for modules to `netmodule'
17166 * cs-parser.jay: Improved slightly the location tracking for
17167 the debugger symbols.
17169 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
17170 modifiers that were specified instead of the hardcoded value
17171 (FamAndAssem). This was basically ignoring the static modifier,
17172 and others. Fixes 32429.
17174 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
17175 fixed a bug in the process (32476)
17177 * expression.cs (ArrayAccess.EmitAssign): Patch from
17178 hwang_rob@yahoo.ca that fixes bug 31834.3
17180 2002-10-18 Miguel de Icaza <miguel@ximian.com>
17182 * driver.cs: Make the module extension .netmodule.
17184 2002-10-16 Miguel de Icaza <miguel@ximian.com>
17186 * driver.cs: Report an error if the resource file is not found
17187 instead of crashing.
17189 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
17190 false, like Emit does.
17192 2002-10-16 Nick Drochak <ndrochak@gol.com>
17194 * typemanager.cs: Remove unused private member. Also reported mcs
17195 bug to report this as a warning like csc.
17197 2002-10-15 Martin Baulig <martin@gnome.org>
17199 * statement.cs (Statement.Emit): Made this a virtual method; emits
17200 the line number info and calls DoEmit().
17201 (Statement.DoEmit): New protected abstract method, formerly knows
17202 as Statement.Emit().
17204 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
17206 2002-10-11 Miguel de Icaza <miguel@ximian.com>
17208 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
17209 have fixed a remaining problem: not every AddXXXX was adding a
17210 fully qualified name.
17212 Now everyone registers a fully qualified name in the DeclSpace as
17213 being defined instead of the partial name.
17215 Downsides: we are slower than we need to be due to the excess
17216 copies and the names being registered this way.
17218 The reason for this is that we currently depend (on the corlib
17219 bootstrap for instance) that types are fully qualified, because
17220 we dump all the types in the namespace, and we should really have
17221 types inserted into the proper namespace, so we can only store the
17222 basenames in the defined_names array.
17224 2002-10-10 Martin Baulig <martin@gnome.org>
17226 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
17227 from bug #31834, see the bug report for a testcase which is
17230 2002-10-10 Martin Baulig <martin@gnome.org>
17232 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
17233 flow analysis code for this.
17235 * statement.cs (Do, While, For): Tell the flow analysis code about
17237 (FlowBranching.UsageVector): Added support for infinite loops.
17238 (Block.Resolve): Moved the dead code elimination here and use flow
17241 2002-10-09 Miguel de Icaza <miguel@ximian.com>
17243 * class.cs (Field.Define): Catch cycles on struct type
17246 * typemanager.cs (IsUnmanagedtype): Do not recursively check
17247 fields if the fields are static. We only need to check instance
17250 * expression.cs (As.DoResolve): Test for reference type.
17252 * statement.cs (Using.ResolveExpression): Use
17253 ConvertImplicitRequired, not ConvertImplicit which reports an
17255 (Using.ResolveLocalVariableDecls): ditto.
17257 * expression.cs (Binary.ResolveOperator): Report errors in a few
17258 places where we had to.
17260 * typemanager.cs (IsUnmanagedtype): Finish implementation.
17262 2002-10-08 Miguel de Icaza <miguel@ximian.com>
17264 * expression.cs: Use StoreFromPtr instead of extracting the type
17265 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
17267 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
17268 an enumeration value to a System.Enum, but System.Enum is not a
17269 value type, but an class type, so we need to box.
17271 (Expression.ConvertExplicit): One codepath could return
17272 errors but not flag them. Fix this. Fixes #31853
17274 * parameter.cs (Resolve): Do not allow void as a parameter type.
17276 2002-10-06 Martin Baulig <martin@gnome.org>
17278 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
17279 if it's a class type and not a struct. Fixes #31815.
17281 2002-10-06 Martin Baulig <martin@gnome.org>
17283 * statement.cs: Reworked the flow analysis code a bit to make it
17284 usable for dead code elimination.
17286 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17288 * cs-parser.jay: allow empty source files. Fixes bug #31781.
17290 2002-10-04 Miguel de Icaza <miguel@ximian.com>
17292 * expression.cs (ComposedCast.DoResolveType): A quick workaround
17293 to fix the test 165, will investigate deeper.
17295 2002-10-04 Martin Baulig <martin@gnome.org>
17297 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
17298 finally blocks actually work.
17299 (Try.Resolve): We don't need to create a sibling for `finally' if
17300 there is no finally block.
17302 2002-10-04 Martin Baulig <martin@gnome.org>
17304 * class.cs (Constructor.Define): The default accessibility for a
17305 non-default constructor is private, not public.
17307 2002-10-04 Miguel de Icaza <miguel@ximian.com>
17309 * class.cs (Constructor): Make AllowedModifiers public, add
17312 * cs-parser.jay: Perform the modifiers test here, as the
17313 constructor for the Constructor class usually receives a zero
17314 because of the way we create it (first we create, later we
17315 customize, and we were never checking the modifiers).
17317 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
17318 is a version of LookupTypeReflection that includes the type-name
17319 cache. This can be used as a fast path for functions that know
17320 the fully qualified name and are only calling into *.GetType() to
17321 obtain a composed type.
17323 This is also used by TypeManager.LookupType during its type
17326 (LookupType): We now also track the real type name, as sometimes
17327 we can get a quey for the real type name from things like
17328 ComposedCast. This fixes bug 31422.
17330 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
17331 complete type fullname, it does not have to go through the type
17332 resolution system to obtain the composed version of the type (for
17333 obtaining arrays or pointers).
17335 (Conditional.Emit): Use the EmitBoolExpression to
17336 generate nicer code, as requested by Paolo.
17338 (ArrayCreation.CheckIndices): Use the patch from
17339 hwang_rob@yahoo.ca to validate the array initializers.
17341 2002-10-03 Miguel de Icaza <miguel@ximian.com>
17343 * class.cs (ConstructorInitializer.Emit): simplify code by using
17344 Invocation.EmitCall, and at the same time, fix the bugs in calling
17345 parent constructors that took variable arguments.
17347 * ecore.cs (Expression.ConvertNumericExplicit,
17348 Expression.ImplicitNumericConversion): Remove the code that
17349 manually wrapped decimal (InternalTypeConstructor call is now gone
17352 * expression.cs (Cast.TryReduce): Also handle decimal types when
17353 trying to perform a constant fold on the type.
17355 * typemanager.cs (IsUnmanagedtype): Partially implemented.
17357 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
17358 that only turned off an error report, and did nothing else.
17360 2002-10-02 Miguel de Icaza <miguel@ximian.com>
17362 * driver.cs: Handle and ignore /fullpaths
17364 2002-10-01 Miguel de Icaza <miguel@ximian.com>
17366 * expression.cs (Binary.ResolveOperator): Catch the case where
17367 DoNumericPromotions returns true,
17369 (Binary.DoNumericPromotions): Simplify the code, and the tests.
17371 2002-09-27 Miguel de Icaza <miguel@ximian.com>
17373 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
17376 2002-09-26 Miguel de Icaza <miguel@ximian.com>
17378 * ecore.cs (ConvertNumericExplicit): It is not enough that the
17379 conversion exists, but it is also required that the conversion be
17380 performed. This manifested in "(Type64Enum) 2".
17382 * class.cs (TypeManager.AddMethod): The fix is not to change
17383 AddEnum, because that one was using a fully qualified name (every
17384 DeclSpace derivative does), but to change the AddMethod routine
17385 that was using an un-namespaced name. This now correctly reports
17386 the duplicated name.
17388 Revert patch until I can properly fix it. The issue
17389 is that we have a shared Type space across all namespaces
17390 currently, which is wrong.
17392 Options include making the Namespace a DeclSpace, and merge
17393 current_namespace/current_container in the parser.
17395 2002-09-25 Miguel de Icaza <miguel@ximian.com>
17397 * cs-parser.jay: Improve error reporting when we get a different
17398 kind of expression in local_variable_type and
17399 local_variable_pointer_type.
17401 Propagate this to avoid missleading errors being reported.
17403 * ecore.cs (ImplicitReferenceConversion): treat
17404 TypeManager.value_type as a target just like object_type. As
17409 Is valid, and needs to result in the int 1 being boxed before it
17410 is assigned to the value type v.
17412 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
17413 to validate the enumeration name.
17415 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
17416 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
17417 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
17419 * ecore.cs (TryImplicitIntConversion): When doing an
17420 implicit-enumeration-conversion, check if the type is 64-bits and
17421 perform a conversion before passing to EnumConstant.
17423 2002-09-23 Miguel de Icaza <miguel@ximian.com>
17425 * decl.cs (Error_AmbiguousTypeReference); New routine used to
17426 report ambiguous type references. Unlike the MS version, we
17427 report what the ambiguity is. Innovation at work ;-)
17429 (DeclSpace.FindType): Require a location argument to
17430 display when we display an ambiguous error.
17432 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
17434 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
17436 * expression.cs (EmitDynamicInitializers): Apply patch from
17437 hwang_rob@yahoo.ca that fixes the order in which we emit our
17440 2002-09-21 Martin Baulig <martin@gnome.org>
17442 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
17443 delegate takes no arguments.
17445 2002-09-20 Miguel de Icaza <miguel@ximian.com>
17447 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
17450 * expression.cs: Extract the underlying type.
17452 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
17454 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
17456 2002-09-19 Miguel de Icaza <miguel@ximian.com>
17458 * class.cs (TypeContainer.DefineType): We can not use the nice
17459 PackingSize with the size set to 1 DefineType method, because it
17460 will not allow us to define the interfaces that the struct
17463 This completes the fixing of bug 27287
17465 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
17466 means also structs. This fixes part of the problem.
17467 (Expresion.ImplicitReferenceConversionExists): ditto.
17469 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
17470 error if there were no errors reported during the type lookup
17471 process, to avoid duplicates or redundant errors. Without this
17472 you would get an ambiguous errors plus a type not found. We have
17473 beaten the user enough with the first error.
17475 (DeclSparce.FindType): Emit a warning if we have an ambiguous
17478 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
17479 during the resolution process, stop the lookup, this avoids
17480 repeated error reports (same error twice).
17482 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
17484 * typemanager.cs (LookupType): Redo the type lookup code to match
17485 the needs of System.Reflection.
17487 The issue is that System.Reflection requires references to nested
17488 types to begin with a "+" sign instead of a dot. So toplevel
17489 types look like: "NameSpace.TopLevelClass", and nested ones look
17490 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
17493 2002-09-19 Martin Baulig <martin@gnome.org>
17495 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
17496 says that a method always returns or always throws an exception,
17497 don't report the CS0161.
17499 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
17500 set `Returns = new_returns'.
17502 2002-09-19 Martin Baulig <martin@gnome.org>
17504 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
17505 to an enum constant, check for a CS0176.
17507 2002-09-18 Miguel de Icaza <miguel@ximian.com>
17509 * class.cs (TypeContainer.CheckPairedOperators): Now we check
17510 for operators that must be in pairs and report errors.
17512 * ecore.cs (SimpleName.DoResolveType): During the initial type
17513 resolution process, when we define types recursively, we must
17514 check first for types in our current scope before we perform
17515 lookups in the enclosing scopes.
17517 * expression.cs (MakeByteBlob): Handle Decimal blobs.
17519 (Invocation.VerifyArgumentsCompat): Call
17520 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
17521 I thought we were supposed to always call this, but there are a
17522 few places in the code where we dont do it.
17524 2002-09-17 Miguel de Icaza <miguel@ximian.com>
17526 * driver.cs: Add support in -linkres and -resource to specify the
17527 name of the identifier.
17529 2002-09-16 Miguel de Icaza <miguel@ximian.com>
17531 * ecore.cs (StandardConversionExists): Sync with the conversion
17532 code: allow anything-* to void* conversions.
17534 (FindMostSpecificSource): Use an Expression argument
17535 instead of a Type, because we might be handed over a Literal which
17536 gets a few more implicit conversions that plain types do not. So
17537 this information was being lost.
17539 Also, we drop the temporary type-holder expression when not
17542 2002-09-17 Martin Baulig <martin@gnome.org>
17544 * class.cs (PropertyBase.CheckBase): Don't check the base class if
17545 this is an explicit interface implementation.
17547 2002-09-17 Martin Baulig <martin@gnome.org>
17549 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
17550 different `IndexerName' attributes.
17552 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
17553 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
17554 virtual CommonResolve().
17556 2002-09-16 Miguel de Icaza <miguel@ximian.com>
17558 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
17559 and convert that to the UnderlyingType.
17561 * statement.cs (Foreach.Resolve): Indexers are just like variables
17562 or PropertyAccesses.
17564 * cs-tokenizer.cs (consume_string): Track line numbers and columns
17565 inside quoted strings, we were not doing this before.
17567 2002-09-16 Martin Baulig <martin@gnome.org>
17569 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
17570 resolve it. This is needed for the definite assignment check of the
17571 instance expression, fixes bug #29846.
17572 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
17574 2002-09-16 Nick Drochak <ndrochak@gol.com>
17576 * parameter.cs: Fix compile error. Cannot reference static member
17577 from an instance object. Is this an mcs bug?
17579 2002-09-14 Martin Baulig <martin@gnome.org>
17581 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
17582 multiple times. Fixes bug #30295, added test-166.cs.
17584 2002-09-14 Martin Baulig <martin@gnome.org>
17586 * statement.cs (Block.Emit): Don't emit unreachable code.
17587 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
17588 `break' statements.
17589 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
17591 2002-09-14 Martin Baulig <martin@gnome.org>
17593 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
17596 2002-09-14 Martin Baulig <martin@gnome.org>
17598 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
17599 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
17600 be false on the ms runtime.
17602 2002-09-13 Martin Baulig <martin@gnome.org>
17604 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
17605 the CS0038 error message.
17607 2002-09-12 Miguel de Icaza <miguel@ximian.com>
17609 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
17610 constant inside, return it.
17612 2002-09-12 Martin Baulig <martin@gnome.org>
17614 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
17615 implicit conversion can be done between enum types.
17617 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
17618 check whether an implicit conversion to the current enum's UnderlyingType
17619 exists and report an error if not.
17621 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
17622 without debugging support.
17624 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
17625 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
17627 2002-09-12 Martin Baulig <martin@gnome.org>
17629 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
17631 * ecore.cs (IMemberExpr.DeclaringType): New property.
17632 (SimpleName.SimpleNameResolve): Check whether we're accessing a
17633 nonstatic member of an outer type (CS0038).
17635 2002-09-11 Miguel de Icaza <miguel@ximian.com>
17637 * driver.cs: Activate the using-error detector at warning level
17638 4 (at least for MS-compatible APIs).
17640 * namespace.cs (VerifyUsing): Small buglett fix.
17642 * pending.cs (PendingImplementation): pass the container pointer.
17644 * interface.cs (GetMethods): Allow for recursive definition. Long
17645 term, I would like to move every type to support recursive
17646 definitions, not the current ordering mechanism that we have right
17649 The situation is this: Attributes are handled before interfaces,
17650 so we can apply attributes to interfaces. But some attributes
17651 implement interfaces, we will now handle the simple cases
17652 (recursive definitions will just get an error).
17654 * parameter.cs: Only invalidate types at the end if we fail to
17657 2002-09-09 Martin Baulig <martin@gnome.org>
17659 * ecore.cs (PropertyExpr.Emit): Also check for
17660 TypeManager.system_int_array_get_length so this'll also work when
17661 compiling corlib. Fixes #30003.
17663 2002-09-09 Martin Baulig <martin@gnome.org>
17665 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
17666 and throw an exception if we can't get the type's size. Fixed #30040,
17669 2002-09-09 Martin Baulig <martin@gnome.org>
17671 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
17673 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
17674 context. Fixes bug #30027.
17676 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
17677 virtual functions. Fixes bug #30043, added test-164.cs.
17679 2002-09-08 Ravi Pratap <ravi@ximian.com>
17681 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
17683 2002-09-08 Nick Drochak <ndrochak@gol.com>
17685 * driver.cs: Use an object to get the windows codepage since it's not a
17688 2002-09-08 Miguel de Icaza <miguel@ximian.com>
17690 * statement.cs (For.Emit): for infinite loops (test == null)
17691 return whether there is a break inside, not always "true".
17693 * namespace.cs (UsingEntry): New struct to hold the name of the
17694 using definition, the location where it is defined, and whether it
17695 has been used in a successful type lookup.
17697 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
17702 2002-09-06 Ravi Pratap <ravi@ximian.com>
17704 * attribute.cs : Fix incorrect code which relied on catching
17705 a NullReferenceException to detect a null being passed in
17706 where an object was expected.
17708 2002-09-06 Miguel de Icaza <miguel@ximian.com>
17710 * statement.cs (Try): flag the catch variable as assigned
17712 * expression.cs (Cast): Simplified by using ResolveType instead of
17713 manually resolving.
17715 * statement.cs (Catch): Fix bug by using ResolveType.
17717 2002-09-06 Ravi Pratap <ravi@ximian.com>
17719 * expression.cs (BetterConversion): Special case for when we have
17720 a NullLiteral as the argument and we have to choose between string
17721 and object types - we choose string the way csc does.
17723 * attribute.cs (Attribute.Resolve): Catch the
17724 NullReferenceException and report error #182 since the Mono
17725 runtime no more has the bug and having this exception raised means
17726 we tried to select a constructor which takes an object and is
17729 2002-09-05 Ravi Pratap <ravi@ximian.com>
17731 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
17732 message (1502, 1503) when we can't locate a method after overload
17733 resolution. This is much more informative and closes the bug
17736 * interface.cs (PopulateMethod): Return if there are no argument
17737 types. Fixes a NullReferenceException bug.
17739 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
17740 expressions too. Previously we were checking only in one place for
17741 positional arguments leaving out named arguments.
17743 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
17744 type to the enum type is not allowed. Remove code corresponding to
17747 (ConvertNumericExplicit): Allow explicit conversions from
17748 the underlying type to enum type. This precisely follows the spec
17749 and closes a bug filed by Gonzalo.
17751 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17754 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
17756 2002-09-03 Miguel de Icaza <miguel@ximian.com>
17758 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
17759 it was important that we stored the right value after the
17760 reduction in `converted'.
17762 2002-09-04 Martin Baulig <martin@gnome.org>
17764 * location.cs (Location.SymbolDocument): Use full pathnames for the
17767 2002-08-30 Miguel de Icaza <miguel@ximian.com>
17769 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
17770 of the expression resolve mechanism, because that will catch the
17771 SimpleName error failures.
17773 (Conditional): If we can not resolve the
17774 expression, return, do not crash.
17776 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17779 (location): display token name instead of its number.
17781 2002-08-28 Martin Baulig <martin@gnome.org>
17783 * expression.cs (Binary.ResolveOperator): Don't silently return
17784 but return an error if an operator cannot be applied between two
17787 2002-08-28 Martin Baulig <martin@gnome.org>
17789 * class.cs (Constructor.Define): Set the permission attributes
17790 correctly instead of making all constructors public.
17792 2002-08-28 Martin Baulig <martin@gnome.org>
17794 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
17795 for private members before reporting a CS0103; if we find anything,
17798 2002-08-28 Martin Baulig <martin@gnome.org>
17800 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
17801 to check whether `closure_start_type == closure_invocation_type',
17802 we also need to check whether `m.DeclaringType == closure_invocation_type'
17803 before bypassing the permission checks. We might be accessing
17804 protected/private members from the base class.
17805 (TypeManager.RealMemberLookup): Only set private_ok if private
17806 members were requested via BindingFlags.NonPublic.
17808 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
17810 * expression.cs (MemberAccess.ResolveMemberAccess): Set
17811 MethodGroupExpr.IsExplicitImpl if appropriate.
17812 (Invocation.DoResolve): Don't report the CS0120 for explicit
17813 interface implementations.
17815 2002-08-27 Martin Baulig <martin@gnome.org>
17817 * expression.cs (Invocation.DoResolve): If this is a static
17818 method and we don't have an InstanceExpression, we must report
17821 2002-08-25 Martin Baulig <martin@gnome.org>
17823 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
17824 `==' between a valuetype and an object.
17826 2002-08-25 Miguel de Icaza <miguel@ximian.com>
17828 * ecore.cs (TypeExpr): Provide a ToString method.
17830 2002-08-24 Martin Baulig <martin@gnome.org>
17832 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
17833 now called proggie.dbg and it's a binary file.
17835 2002-08-23 Martin Baulig <martin@gnome.org>
17837 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
17839 2002-08-23 Martin Baulig <martin@gnome.org>
17841 * struct.cs (MyStructInfo.ctor): Make this work with empty
17842 structs; it's not allowed to use foreach() on null.
17844 2002-08-23 Martin Baulig <martin@gnome.org>
17846 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
17847 writer the full pathname of the generated assembly.
17849 2002-08-23 Martin Baulig <martin@gnome.org>
17851 * statements.cs (FlowBranching.UsageVector.MergeChildren):
17852 A `finally' block never returns or breaks; improved handling of
17855 2002-08-23 Martin Baulig <martin@gnome.org>
17857 * statement.cs (Throw.Resolve): Allow `throw null'.
17859 2002-08-23 Martin Baulig <martin@gnome.org>
17861 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
17862 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
17863 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
17864 MemberLookup would return a wrong event if this is an explicit
17865 interface implementation and the class has an event with the same
17868 2002-08-23 Martin Baulig <martin@gnome.org>
17870 * statement.cs (Block.AddChildVariableNames): New public method.
17871 (Block.AddChildVariableName): Likewise.
17872 (Block.IsVariableNameUsedInChildBlock): Likewise.
17873 (Block.AddVariable): Check whether a variable name has already
17874 been used in a child block.
17876 * cs-parser.jay (declare_local_variables): Mark all variable names
17877 from the current block as being used in a child block in the
17880 2002-08-23 Martin Baulig <martin@gnome.org>
17882 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
17883 find the symbol writer.
17885 * driver.cs: csc also allows the arguments to /define being
17886 separated by commas, not only by semicolons.
17888 2002-08-23 Martin Baulig <martin@gnome.org>
17890 * interface.cs (Interface.GetMembers): Added static check for events.
17892 2002-08-15 Martin Baulig <martin@gnome.org>
17894 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
17895 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
17897 * ecore.cs (Expression.MemberLookup): Added documentation and explained
17898 why the MethodData.EmitDestructor() change was necessary.
17900 2002-08-20 Martin Baulig <martin@gnome.org>
17902 * class.cs (TypeContainer.FindMembers): Added static check for events.
17904 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
17906 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
17907 use Type.GetEvents(), not Type.FindMembers().
17909 2002-08-20 Martin Baulig <martin@gnome.org>
17911 * decl.cs (MemberCache): Added a special method cache which will
17912 be used for method-only searched. This ensures that a method
17913 search will return a MethodInfo with the correct ReflectedType for
17916 2002-08-20 Martin Baulig <martin@gnome.org>
17918 * decl.cs (DeclSpace.FindMembers): Made this public.
17920 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17922 * delegate.cs: fixed build on windows.
17923 [FIXME: Filed as bug #29150: MCS must report these errors.]
17925 2002-08-19 Ravi Pratap <ravi@ximian.com>
17927 * ecore.cs (StandardConversionExists): Return a false
17928 if we are trying to convert the void type to anything else
17929 since that is not allowed.
17931 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
17932 we flag error 70 in the event an event is trying to be accessed
17933 directly from outside the declaring type.
17935 2002-08-20 Martin Baulig <martin@gnome.org>
17937 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
17938 MemberCache from typemanager.cs to decl.cs.
17940 2002-08-19 Martin Baulig <martin@gnome.org>
17942 * class.cs (TypeContainer): Implement IMemberContainer.
17943 (TypeContainer.DefineMembers): Create the MemberCache.
17944 (TypeContainer.FindMembers): Do better BindingFlags checking; only
17945 return public members if BindingFlags.Public was given, check
17946 whether members are static.
17948 2002-08-16 Martin Baulig <martin@gnome.org>
17950 * decl.cs (DeclSpace.Define): Splitted this in Define and
17951 DefineMembers. DefineMembers is called first and initializes the
17954 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
17955 DefineMembers() on all our DeclSpaces.
17957 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
17958 but call DefineMembers() on all nested interfaces. We call their
17959 Define() in our new Define() function.
17961 * interface.cs (Interface): Implement IMemberContainer.
17962 (Interface.Define): Moved all code except the attribute stuf to
17964 (Interface.DefineMembers): Initialize the member cache.
17966 * typemanager.cs (IMemberFinder): Removed this interface, we don't
17967 need this anymore since we can use MemberCache.FindMembers directly.
17969 2002-08-19 Martin Baulig <martin@gnome.org>
17971 * typemanager.cs (MemberCache): When creating the cache for an
17972 interface type, add all inherited members.
17973 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
17974 to `out bool used_cache' and documented it.
17975 (TypeManager.MemberLookup): If we already used the cache in the first
17976 iteration, we don't need to do the interfaces check.
17978 2002-08-19 Martin Baulig <martin@gnome.org>
17980 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
17981 here from IMemberFinder and don't implement this interface anymore.
17982 (DeclSpace.MemberCache): Moved here from IMemberFinder.
17984 * typemanager.cs (IMemberFinder): This interface is now only used by
17985 classes which actually support the member cache.
17986 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
17987 since we only put DeclSpaces into this Hashtable.
17988 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
17989 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
17991 2002-08-16 Martin Baulig <martin@gnome.org>
17993 * typemanager.cs (ICachingMemberFinder): Removed.
17994 (IMemberFinder.MemberCache): New property.
17995 (TypeManager.FindMembers): Merged this with RealFindMembers().
17996 This function will never be called from TypeManager.MemberLookup()
17997 so we can't use the cache here, just the IMemberFinder.
17998 (TypeManager.MemberLookup_FindMembers): Check whether the
17999 IMemberFinder has a MemberCache and call the cache's FindMembers
18001 (MemberCache): Rewrote larger parts of this yet another time and
18002 cleaned it up a bit.
18004 2002-08-15 Miguel de Icaza <miguel@ximian.com>
18006 * driver.cs (LoadArgs): Support quoting.
18008 (Usage): Show the CSC-like command line arguments.
18010 Improved a few error messages.
18012 2002-08-15 Martin Baulig <martin@gnome.org>
18014 * typemanager.cs (IMemberContainer.Type): New property.
18015 (IMemberContainer.IsInterface): New property.
18017 The following changes are conditional to BROKEN_RUNTIME, which is
18018 defined at the top of the file.
18020 * typemanager.cs (MemberCache.MemberCache): Don't add the base
18021 class'es members, but add all members from TypeHandle.ObjectType
18022 if we're an interface.
18023 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
18024 is the current type.
18025 (MemberCache.CacheEntry.Container): Removed this field.
18026 (TypeHandle.GetMembers): Include inherited members.
18028 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18030 * typemanager.cs: fixed compilation and added a comment on a field that
18033 2002-08-15 Martin Baulig <martin@gnome.org>
18035 * class.cs (ConstructorInitializer.Resolve): In the
18036 Expression.MemberLookup call, use the queried_type as
18039 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
18040 declared' attribute, it's always true.
18041 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
18042 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
18043 temporary wrapper for FindMembers which tells MemberLookup whether
18044 members from the base classes are included in the return value.
18045 This will go away soon.
18046 (TypeManager.MemberLookup): Use this temporary hack here; once the
18047 new MemberCache is completed, we don't need to do the DeclaredOnly
18048 looping here anymore since the MemberCache will take care of this.
18049 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
18050 (MemberCache): When creating the MemberCache for a class, get
18051 members from the current class and all its base classes.
18052 (MemberCache.CacheEntry.Container): New field. This is a
18053 temporary hack until the Mono runtime is fixed to distinguish
18054 between ReflectedType and DeclaringType. It allows us to use MCS
18055 with both the MS runtime and the unfixed Mono runtime without
18056 problems and without accecting performance.
18057 (MemberCache.SearchMembers): The DeclaredOnly looping from
18058 TypeManager.MemberLookup is now done here.
18060 2002-08-14 Martin Baulig <martin@gnome.org>
18062 * statement.cs (MyStructInfo.MyStructInfo): Don't call
18063 Type.GetFields on dynamic types but get the fields from the
18064 corresponding TypeContainer.
18065 (MyStructInfo.GetStructInfo): Added check for enum types.
18067 * typemanager.cs (MemberList.IsSynchronized): Implemented.
18068 (MemberList.SyncRoot): Implemented.
18069 (TypeManager.FilterWithClosure): No need to check permissions if
18070 closure_start_type == closure_invocation_type, don't crash if
18071 closure_invocation_type is null.
18073 2002-08-13 Martin Baulig <martin@gnome.org>
18075 Rewrote TypeContainer.FindMembers to use a member cache. This
18076 gives us a speed increase of about 35% for the self-hosting MCS
18077 build and of about 15-20% for the class libs (both on GNU/Linux).
18079 * report.cs (Timer): New class to get enhanced profiling. This
18080 whole class is "TIMER" conditional since it remarkably slows down
18083 * class.cs (MemberList): New class. This is an IList wrapper
18084 which we're now using instead of passing MemberInfo[]'s around to
18085 avoid copying this array unnecessarily.
18086 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
18087 (ICachingMemberFinder, IMemberContainer): New interface.
18088 (TypeManager.FilterWithClosure): If `criteria' is null, the name
18089 has already been checked, otherwise use it for the name comparision.
18090 (TypeManager.FindMembers): Renamed to RealMemberFinder and
18091 provided wrapper which tries to use ICachingMemberFinder.FindMembers
18092 if possible. Returns a MemberList, not a MemberInfo [].
18093 (TypeHandle): New class, implements IMemberContainer. We create
18094 one instance of this class per type, it contains a MemberCache
18095 which is used to do the member lookups.
18096 (MemberCache): New class. Each instance of this class contains
18097 all members of a type and a name-based hash table.
18098 (MemberCache.FindMembers): This is our new member lookup
18099 function. First, it looks up all members of the requested name in
18100 the hash table. Then, it walks this list and sorts out all
18101 applicable members and returns them.
18103 2002-08-13 Martin Baulig <martin@gnome.org>
18105 In addition to a nice code cleanup, this gives us a performance
18106 increase of about 1.4% on GNU/Linux - not much, but it's already
18107 half a second for the self-hosting MCS compilation.
18109 * typemanager.cs (IMemberFinder): New interface. It is used by
18110 TypeManager.FindMembers to call FindMembers on a TypeContainer,
18111 Enum, Delegate or Interface.
18112 (TypeManager.finder_to_member_finder): New PtrHashtable.
18113 (TypeManager.finder_to_container): Removed.
18114 (TypeManager.finder_to_delegate): Removed.
18115 (TypeManager.finder_to_interface): Removed.
18116 (TypeManager.finder_to_enum): Removed.
18118 * interface.cs (Interface): Implement IMemberFinder.
18120 * delegate.cs (Delegate): Implement IMemberFinder.
18122 * enum.cs (Enum): Implement IMemberFinder.
18124 * class.cs (TypeContainer): Implement IMemberFinder.
18126 2002-08-12 Martin Baulig <martin@gnome.org>
18128 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
18130 2002-08-12 Martin Baulig <martin@gnome.org>
18132 * ecore.cs (ITypeExpression): New interface for expressions which
18134 (TypeExpression): Renamed to TypeLookupExpression.
18135 (Expression.DoResolve): If we're doing a types-only lookup, the
18136 expression must implement the ITypeExpression interface and we
18137 call DoResolveType() on it.
18138 (SimpleName): Implement the new ITypeExpression interface.
18139 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
18140 hack, the situation that we're only looking up types can't happen
18141 anymore when this method is called. Moved the type lookup code to
18142 DoResolveType() and call it.
18143 (SimpleName.DoResolveType): This ITypeExpression interface method
18144 is now doing the types-only lookup.
18145 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
18146 (ResolveFlags): Added MaskExprClass.
18148 * expression.cs (MemberAccess): Implement the ITypeExpression
18150 (MemberAccess.DoResolve): Added support for a types-only lookup
18151 when we're called via ITypeExpression.DoResolveType().
18152 (ComposedCast): Implement the ITypeExpression interface.
18154 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
18155 Expression.Resolve() with ResolveFlags.Type instead.
18157 2002-08-12 Martin Baulig <martin@gnome.org>
18159 * interface.cs (Interface.Define): Apply attributes.
18161 * attribute.cs (Attribute.ApplyAttributes): Added support for
18162 interface attributes.
18164 2002-08-11 Martin Baulig <martin@gnome.org>
18166 * statement.cs (Block.Emit): Only check the "this" variable if we
18167 do not always throw an exception.
18169 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
18170 whether the property has a set accessor.
18172 2002-08-11 Martin Baulig <martin@gnome.org>
18174 Added control flow analysis support for structs.
18176 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
18177 with control flow analysis turned off.
18178 (IVariable): New interface.
18179 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
18180 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
18181 (FieldExpr.DoResolve): Resolve the instance expression with flow
18182 analysis turned off and do the definite assignment check after the
18183 resolving when we know what the expression will resolve to.
18185 * expression.cs (LocalVariableReference, ParameterReference):
18186 Implement the new IVariable interface, only call the flow analysis
18187 code if ec.DoFlowAnalysis is true.
18188 (This): Added constructor which takes a Block argument. Implement
18189 the new IVariable interface.
18190 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
18191 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
18192 This does the definite assignment checks for struct members.
18194 * class.cs (Constructor.Emit): If this is a non-static `struct'
18195 constructor which doesn't have any initializer, call
18196 Block.AddThisVariable() to tell the flow analysis code that all
18197 struct elements must be initialized before control returns from
18200 * statement.cs (MyStructInfo): New public class.
18201 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
18202 argument to this indexer. If non-zero, check an individual struct
18203 member, not the whole struct.
18204 (FlowBranching.CheckOutParameters): Check struct members.
18205 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
18206 overloaded versions of these methods which take an additional
18207 `int field_idx' argument to check struct members.
18208 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
18209 overloaded versions of these methods which take an additional
18210 `string field_name' argument to check struct member.s
18211 (VariableInfo): Implement the IVariable interface.
18212 (VariableInfo.StructInfo): New public property. Returns the
18213 MyStructInfo instance of the variable if it's a struct or null.
18214 (Block.AddThisVariable): New public method. This is called from
18215 Constructor.Emit() for non-static `struct' constructor which do
18216 not have any initializer. It creates a special variable for the
18217 "this" instance variable which will be checked by the flow
18218 analysis code to ensure that all of the struct's fields are
18219 initialized before control returns from the constructor.
18220 (UsageVector): Added support for struct members. If a
18221 variable/parameter is a struct with N members, we reserve a slot
18222 in the usage vector for each member. A struct is considered fully
18223 initialized if either the struct itself (slot 0) or all its
18224 members are initialized.
18226 2002-08-08 Martin Baulig <martin@gnome.org>
18228 * driver.cs (Driver.MainDriver): Only report an error CS5001
18229 if there were no compilation errors.
18231 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
18232 `UnsafeContext' property to determine whether the parent is in
18233 unsafe context rather than checking the parent's ModFlags:
18234 classes nested in an unsafe class are unsafe as well.
18236 2002-08-08 Martin Baulig <martin@gnome.org>
18238 * statement.cs (UsageVector.MergeChildren): Distinguish between
18239 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
18240 we return. Added test17() and test18() to test-154.cs.
18242 2002-08-08 Martin Baulig <martin@gnome.org>
18244 * typemanager.cs (TypeManager.FilterWithClosure): If we have
18245 Family access, make sure the invoking type isn't a subclass of the
18246 queried type (that'd be a CS1540).
18248 * ecore.cs (Expression.MemberLookup): Added overloaded version of
18249 this method which takes an additional `Type invocation_type'.
18251 * expression.cs (BaseAccess.DoResolve): Use the base type as
18252 invocation and query type.
18253 (MemberAccess.DoResolve): If the lookup failed and we're about to
18254 report a CS0122, try a lookup with the ec.ContainerType - if this
18255 succeeds, we must report a CS1540.
18257 2002-08-08 Martin Baulig <martin@gnome.org>
18259 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
18260 (MethodGroupExpr): Implement the IMemberExpr interface.
18262 * expression (MemberAccess.ResolveMemberAccess): No need to have
18263 any special code for MethodGroupExprs anymore, they're now
18266 2002-08-08 Martin Baulig <martin@gnome.org>
18268 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
18269 Family, FamANDAssem and FamORAssem permissions.
18270 (TypeManager.IsSubclassOrNestedChildOf): New public method.
18272 2002-08-08 Martin Baulig <martin@gnome.org>
18274 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
18275 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
18278 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
18280 * driver.cs: implemented /resource option to embed managed resources.
18282 2002-08-07 Martin Baulig <martin@gnome.org>
18284 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
18285 (FieldBase.HasFieldInitializer): New public property.
18286 (FieldBase.GetInitializerExpression): New public method. Resolves and
18287 returns the field initializer and makes sure it is only resolved once.
18288 (TypeContainer.EmitFieldInitializers): Call
18289 FieldBase.GetInitializerExpression to get the initializer, this ensures
18290 that it isn't resolved multiple times.
18292 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
18293 the resolving process (SimpleName/MemberLookup) that we're currently
18294 emitting a field initializer (which must not access any instance members,
18295 this is an error CS0236).
18297 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
18298 argument, if the `IsFieldInitializer' flag is set, we must report and
18299 error CS0236 and not an error CS0120.
18301 2002-08-07 Martin Baulig <martin@gnome.org>
18303 * ecore.cs (IMemberExpr): New public interface.
18304 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
18305 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
18306 if the expression is an IMemberExpr.
18308 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
18309 to be null, implicitly default to `this' if we're non-static in
18310 this case. Simplified the code a lot by using the new IMemberExpr
18311 interface. Also fixed bug #28176 here.
18313 2002-08-06 Martin Baulig <martin@gnome.org>
18315 * cs-parser.jay (SimpleLookup): Removed. We need to create
18316 ParameterReferences during semantic analysis so that we can do a
18317 type-only search when resolving Cast, TypeOf and SizeOf.
18318 (block): Pass the `current_local_parameters' to the Block's
18321 * class.cs (ConstructorInitializer): Added `Parameters parameters'
18322 argument to the constructor.
18323 (ConstructorInitializer.Resolve): Create a temporary implicit
18324 block with the parameters.
18326 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
18327 references here if we aren't doing a type-only search.
18329 * statement.cs (Block): Added constructor which takes a
18330 `Parameters parameters' argument.
18331 (Block.Parameters): New public property.
18333 * support.cs (InternalParameters.Parameters): Renamed `parameters'
18334 to `Parameters' and made it public readonly.
18336 2002-08-06 Martin Baulig <martin@gnome.org>
18338 * ecore.cs (Expression.Warning): Made this public as well.
18340 * report.cs (Report.Debug): Print the contents of collections.
18342 2002-08-06 Martin Baulig <martin@gnome.org>
18344 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
18345 used to tell Resolve() which kinds of expressions it may return.
18346 (Expression.Resolve): Added overloaded version of this method which
18347 takes a `ResolveFlags flags' argument. This can be used to tell
18348 Resolve() which kinds of expressions it may return. Reports a
18350 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
18351 ResolveFlags.SimpleName.
18352 (Expression.Error118): Added overloaded version of this method which
18353 takes a `ResolveFlags flags' argument. It uses the flags to determine
18354 which kinds of expressions are allowed.
18356 * expression.cs (Argument.ResolveMethodGroup): New public method.
18357 Resolves an argument, but allows a MethodGroup to be returned.
18358 This is used when invoking a delegate.
18360 * TODO: Updated a bit.
18362 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18364 Fixed compilation with csc.
18366 * ecore.cs: Expression.Error made public. Is this correct? Should
18367 Warning be made public too?
18369 * expression.cs: use ea.Location instead of ea.loc.
18370 [FIXME: Filed as bug #28607: MCS must report these errors.]
18372 2002-08-06 Martin Baulig <martin@gnome.org>
18374 * ecore.cs (Expression.loc): Moved the location here instead of
18375 duplicating it in all derived classes.
18376 (Expression.Location): New public property.
18377 (Expression.Error, Expression.Warning): Made them non-static and
18378 removed the location argument.
18379 (Expression.Warning): Added overloaded version which takes an
18380 `int level' argument.
18381 (Expression.Error118): Make this non-static and removed the
18382 expression and location arguments.
18383 (TypeExpr): Added location argument to the constructor.
18385 * expression.cs (StaticCallExpr): Added location argument to
18387 (Indirection, PointerArithmetic): Likewise.
18388 (CheckedExpr, UnCheckedExpr): Likewise.
18389 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
18390 (StringPtr): Likewise.
18393 2002-08-05 Martin Baulig <martin@gnome.org>
18395 * expression.cs (BaseAccess.DoResolve): Actually report errors.
18397 * assign.cs (Assign.DoResolve): Check whether the source
18398 expression is a value or variable.
18400 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
18401 while resolving the corresponding blocks.
18403 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
18404 an error, don't silently return null.
18406 * statement.cs (Block.AddVariable): Do the error reporting here
18407 and distinguish between CS0128 and CS0136.
18408 (Block.DoResolve): Report all unused labels (warning CS0164).
18409 (LabeledStatement): Pass the location to the constructor.
18410 (LabeledStatement.HasBeenReferenced): New property.
18411 (LabeledStatement.Resolve): Set it to true here.
18413 * statement.cs (Return.Emit): Return success even after reporting
18414 a type mismatch error (CS0126 or CS0127), this is what csc does and
18415 it avoids confusing the users with any consecutive errors.
18417 2002-08-05 Martin Baulig <martin@gnome.org>
18419 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
18421 * const.cs (Const.LookupConstantValue): Catch circular definitions.
18423 * expression.cs (MemberAccess.DoResolve): Silently return if an
18424 error has already been reported.
18426 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
18427 error has already been reported.
18429 2002-08-05 Martin Baulig <martin@gnome.org>
18431 * statement.cs (UsageVector): Only initialize the `parameters'
18432 vector if we actually have any "out" parameters.
18434 2002-08-05 Martin Baulig <martin@gnome.org>
18436 * expression.cs (Binary.ResolveOperator): When combining delegates,
18437 they must have the same type.
18439 2002-08-05 Martin Baulig <martin@gnome.org>
18441 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
18442 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
18443 work with the ms runtime and we also don't need it: if we're a
18444 PropertyBuilder and not in the `indexer_arguments' hash, then we
18445 are a property and not an indexer.
18447 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
18448 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
18449 since the latter one doesn't work with the ms runtime.
18451 2002-08-03 Martin Baulig <martin@gnome.org>
18453 Fixed bugs #27998 and #22735.
18455 * class.cs (Method.IsOperator): New public field.
18456 (Method.CheckBase): Report CS0111 if there's already a method
18457 with the same parameters in the current class. Report CS0508 when
18458 attempting to change the return type of an inherited method.
18459 (MethodData.Emit): Report CS0179 if a method doesn't have a body
18460 and it's not marked abstract or extern.
18461 (PropertyBase): New abstract base class for Property and Indexer.
18462 (PropertyBase.CheckBase): Moved here from Property and made it work
18464 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
18465 the same so we can reuse it there.
18466 (Property, Indexer): Derive from PropertyBase.
18467 (MethodSignature.inheritable_property_signature_filter): New delegate
18468 to find properties and indexers.
18470 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
18471 argument and improved error reporting.
18473 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
18474 EmptyReadOnlyParameters and made it a property.
18476 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
18477 version of this method which takes a `PropertyInfo indexer'.
18478 (TypeManager.RegisterIndexer): New method.
18480 * class.cs: Added myself as author of this file :-)
18482 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18484 * class.cs: fixed compilation on windoze.
18486 2002-08-03 Martin Baulig <martin@gnome.org>
18488 * interface.cs (Interface.GetInterfaceBases): Check whether all
18489 base interfaces are at least as accessible than the current one.
18491 * class.cs (TypeContainer.GetClassBases): Check whether base types
18492 are at least as accessible than the current type.
18493 (TypeContainer.AsAccessible): Implemented and made non-static.
18494 (MemberBase.CheckParameters): Report errors if the accessibility
18497 * delegate.cs (Delegate.Delegate): The default visibility is
18498 internal for top-level types and private for nested types.
18499 (Delegate.Define): Report errors if the accessibility checks fail.
18501 * enum.cs (Enum.Enum): The default visibility is internal for
18502 top-level types and private for nested types.
18503 (Enum.DefineType): Compute the correct visibility.
18505 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
18506 function which takes a `bool is_toplevel' instead of a TypeContainer.
18508 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
18511 2002-08-02 Martin Baulig <martin@gnome.org>
18513 * expression.cs (LocalVariableReferenc): Added constructor which
18514 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
18515 (LocalVariableReference.IsReadOnly): New property.
18516 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
18517 variable is readonly, use our own readonly flag to do this; you can
18518 use the new constructor to get a writable reference to a read-only
18521 * cs-parser.jay (foreach_statement, using_statement): Get a writable
18522 reference to the local variable.
18524 2002-08-01 Miguel de Icaza <miguel@ximian.com>
18526 * rootcontext.cs (ResolveCore): Also include System.Exception
18528 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
18529 we reach an EmptyStatement.
18531 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
18534 * expression.cs (Binary.ResolveOperator): Check error result in
18537 use brtrue/brfalse directly and avoid compares to null.
18539 2002-08-02 Martin Baulig <martin@gnome.org>
18541 * class.cs (TypeContainer.Define): Define all nested interfaces here.
18542 Fixes bug #28407, added test-155.cs.
18544 2002-08-01 Martin Baulig <martin@gnome.org>
18546 * class.cs (Event.EmitDefaultMethod): Make this work with static
18547 events. Fixes #28311, added verify-3.cs.
18549 2002-08-01 Martin Baulig <martin@gnome.org>
18551 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
18552 `is_disposable' fields.
18553 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
18554 `hm.is_disposable' if we're using the collection pattern.
18555 (Foreach.EmitCollectionForeach): Use the correct type for the
18556 enumerator's local variable, only emit the try/finally block if
18557 necessary (fixes #27713).
18559 2002-08-01 Martin Baulig <martin@gnome.org>
18561 * ecore.cs (Expression.report118): Renamed to Error118 and made
18564 * statement.cs (Throw.Resolve): Check whether the expression is of
18565 the correct type (CS0118) and whether the type derives from
18566 System.Exception (CS0155).
18567 (Catch.Resolve): New method. Do the type lookup here and check
18568 whether it derives from System.Exception (CS0155).
18569 (Catch.CatchType, Catch.IsGeneral): New public properties.
18571 * typemanager.cs (TypeManager.exception_type): Added.
18573 2002-07-31 Miguel de Icaza <miguel@ximian.com>
18575 * driver.cs: Updated About function.
18577 2002-07-31 Martin Baulig <martin@gnome.org>
18579 Implemented Control Flow Analysis.
18581 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
18582 (EmitContext.CurrentBranching): Added.
18583 (EmitContext.StartFlowBranching): Added.
18584 (EmitContext.EndFlowBranching): Added.
18585 (EmitContext.KillFlowBranching): Added.
18586 (EmitContext.IsVariableAssigned): Added.
18587 (EmitContext.SetVariableAssigned): Added.
18588 (EmitContext.IsParameterAssigned): Added.
18589 (EmitContext.SetParameterAssigned): Added.
18590 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
18591 Added control flow analysis stuff here.
18593 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
18594 resolve the expression as lvalue.
18595 (LocalVariableReference.DoResolve): Check whether the variable has
18596 already been assigned.
18597 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
18598 the parameter as assigned here.
18599 (ParameterReference.DoResolve): Check whether the parameter has already
18601 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
18602 expression as lvalue.
18604 * statement.cs (FlowBranching): New class for the flow analysis code.
18605 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
18606 (LabeledStatement.IsDefined): New public property.
18607 (LabeledStatement.AddUsageVector): New public method to tell flow
18608 analyis that the label may be reached via a forward jump.
18609 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
18611 (VariableInfo.Number): New public field. This is used by flow analysis
18612 to number all locals of a block.
18613 (Block.CountVariables): New public property. This is the number of
18614 local variables in this block (including the locals from all parent
18616 (Block.EmitMeta): Number all the variables.
18618 * statement.cs: Added flow analysis support to all classes.
18620 2002-07-31 Martin Baulig <martin@gnome.org>
18622 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
18623 To get debugging messages, compile mcs with /define:MCS_DEBUG and
18624 then use this argument.
18626 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
18628 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
18629 use this to specify /define options.
18631 2002-07-29 Martin Baulig <martin@gnome.org>
18633 * statement.cs (Fixed): Moved all code that does variable lookups
18634 and resolvings from Emit to Resolve.
18636 * statement.cs (For): Moved all code that does variable lookups
18637 and resolvings from Emit to Resolve.
18639 * statement.cs (Using): Moved all code that does variable lookups
18640 and resolvings from Emit to Resolve.
18642 2002-07-29 Martin Baulig <martin@gnome.org>
18644 * attribute.cs (Attribute.Resolve): Explicitly catch a
18645 System.NullReferenceException when creating the
18646 CustromAttributeBuilder and report a different warning message.
18648 2002-07-29 Martin Baulig <martin@gnome.org>
18650 * support.cs (ParameterData.ParameterName): Added method to
18651 get the name of a parameter.
18653 * typemanager.cs (TypeManager.IsValueType): New public method.
18655 2002-07-29 Martin Baulig <martin@gnome.org>
18657 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
18658 is a flag which specifies that it's either ref or out.
18659 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
18660 the out parameter to `out Parameter.Modifier mod', also set the
18661 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
18663 * support.cs (InternalParameters.ParameterModifier): Distinguish
18664 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18665 Parameter.Modifier.ISBYREF flag if it's either ref or out.
18667 * expression.cs (Argument.GetParameterModifier): Distinguish
18668 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18669 Parameter.Modifier.ISBYREF flag if it's either ref or out.
18671 2002-07-29 Martin Baulig <martin@gnome.org>
18673 * expression.cs (ParameterReference.ParameterReference): Added
18674 `Location loc' argument to the constructor.
18676 * cs-parser.jay: Pass location to ParameterReference.
18678 2002-07-28 Miguel de Icaza <miguel@ximian.com>
18680 * statement.cs (Try): Initialize the location.
18682 * cs-parser.jay: pass location to Try.
18684 * expression.cs (Unary.Reduce): Change the prototype to return
18685 whether a constant fold could be performed or not. The result is
18686 returned in an out parameters. In the case of Indirection and
18687 AddressOf, we want to perform the full tests.
18689 2002-07-26 Miguel de Icaza <miguel@ximian.com>
18691 * statement.cs (Statement.Emit): Flag dead code.
18693 2002-07-27 Andrew Birkett <andy@nobugs.org>
18695 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
18697 2002-07-27 Martin Baulig <martin@gnome.org>
18699 * class.cs (MethodData.Define): Put back call to
18700 TypeManager.AddMethod(), accidentally commented this out.
18702 * report.cs (Debug): New public method to print debugging information,
18703 this is `[Conditional ("DEBUG")]'.
18705 2002-07-26 Martin Baulig <martin@gnome.org>
18707 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
18708 (switch_statement): Push the current_block to the switch_stack and
18709 pop it again when we're done with the switch.
18710 (switch_section): The new block is a child of the current_block.
18711 Fixes bug #24007, added test-152.cs.
18713 2002-07-27 Martin Baulig <martin@gnome.org>
18715 * expression.cs (Invocation.EmitArguments): When calling a varargs
18716 function with only its fixed arguments, we need to pass an empty
18719 2002-07-27 Martin Baulig <martin@gnome.org>
18721 Mono 0.13 has been released.
18723 2002-07-25 Miguel de Icaza <miguel@ximian.com>
18725 * driver.cs: Rename --resource to --linkres, because that is what
18726 we do currently, we dont support --resource yet.
18728 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
18730 2002-07-25 Martin Baulig <martin@gnome.org>
18732 * class.cs (MethodData): New public class. This is a `method builder'
18733 class for a method or one accessor of a Property/Indexer/Event.
18734 (MethodData.GetMethodFlags): Moved here from MemberBase.
18735 (MethodData.ApplyAttributes): Likewise.
18736 (MethodData.ApplyObsoleteAttribute): Likewise.
18737 (MethodData.ApplyConditionalAttribute): Likewise.
18738 (MethodData.ApplyDllImportAttribute): Likewise.
18739 (MethodData.CheckAbstractAndExternal): Likewise.
18740 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
18741 (MethodData.Emit): Formerly known as Method.Emit().
18742 (MemberBase): Moved everything which was specific to a single
18743 accessor/method to MethodData.
18744 (Method): Create a new MethodData and call Define() and Emit() on it.
18745 (Property, Indexer, Event): Create a new MethodData objects for each
18746 accessor and call Define() and Emit() on them.
18748 2002-07-25 Martin Baulig <martin@gnome.org>
18750 Made MethodCore derive from MemberBase to reuse the code from there.
18751 MemberBase now also checks for attributes.
18753 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
18754 (MemberBase.GetMethodFlags): Moved here from class Method and marked
18756 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
18757 `CallingConventions cc' and `Attributes opt_attrs' arguments.
18758 (MemberBase.ApplyAttributes): New virtual method; applies the
18759 attributes to a method or accessor.
18760 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
18761 (MemberBase.ApplyConditionalAttribute): Likewise.
18762 (MemberBase.ApplyDllImportAttribute): Likewise.
18763 (MemberBase.CheckAbstractAndExternal): Likewise.
18764 (MethodCore.ParameterTypes): This is now a property instead of a
18765 method, it's initialized from DoDefineParameters().
18766 (MethodCore.ParameterInfo): Removed the set accessor.
18767 (MethodCore.DoDefineParameters): New protected virtual method to
18768 initialize ParameterTypes and ParameterInfo.
18769 (Method.GetReturnType): We can now simply return the MemberType.
18770 (Method.GetMethodFlags): Override the MemberBase version and add
18771 the conditional flags.
18772 (Method.CheckBase): Moved some code from Define() here, call
18773 DoDefineParameters() here.
18774 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
18775 here to avoid some larger code duplication.
18776 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
18777 ensure that abstract and external accessors don't declare a body.
18779 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
18780 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
18781 lookup in the attribute's parent classes, so we need to abort as soon
18782 as we found the first match.
18783 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
18784 the attribute has no arguments.
18786 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
18789 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18791 * cs-parser.jay: reverted previous patch.
18793 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18795 * cs-parser.jay: fixed bug #22119.
18797 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18799 * attribute.cs: fixed compilation. The error was:
18800 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
18801 be assigned to before control leaves the current method."
18802 [FIXME: Filed as bug #28186: MCS must report this error.]
18804 2002-07-25 Martin Baulig <martin@gnome.org>
18806 * attribute.cs (Attribute.Conditional_GetConditionName): New static
18807 method to pull the condition name ouf of a Conditional attribute.
18808 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
18809 the obsolete message and error flag out of an Obsolete attribute.
18811 * class.cs (Method.GetMethodFlags): New public method to get the
18812 TypeManager.MethodFlags for this method.
18813 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
18815 (Method.Define): Get and apply the Obsolete and Conditional attributes;
18816 if we're overriding a virtual function, set the new private variable
18817 `parent_method'; call the new TypeManager.AddMethod().
18819 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
18820 the MethodBuilder and the Method in a PtrHashtable.
18821 (TypeManager.builder_to_method): Added for this purpose.
18822 (TypeManager.MethodFlags): Added IsObsoleteError.
18823 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
18824 Obsolete and Conditional arguments in MethodBuilders. If we discover
18825 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
18826 the message from the attribute.
18828 2002-07-24 Martin Baulig <martin@gnome.org>
18830 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
18831 preprocessor directives, ensure that the argument to #define/#undef is
18832 exactly one identifier and that it's actually an identifier.
18834 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
18837 2002-07-24 Martin Baulig <martin@gnome.org>
18839 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
18840 initialize it to TypeManager.object_type in the constructor.
18841 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
18842 of the `hm.get_current' method if we're using the collection pattern.
18843 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
18844 for the explicit conversion to make it work when we're using the collection
18845 pattern and the `Current' property has a different return type than `object'.
18848 2002-07-24 Martin Baulig <martin@gnome.org>
18850 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
18851 does not match, but don't report any errors. This method is called in
18852 order for all methods in a MethodGroupExpr until a matching method is
18853 found, so we don't want to bail out if the first method doesn't match.
18854 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
18855 matches, report the 123. Fixes #28070.
18857 2002-07-24 Martin Baulig <martin@gnome.org>
18859 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
18860 TypeManager.TypeToCoreType() to the top of the method so the
18861 following equality checks will work. Fixes #28107.
18863 2002-07-24 Martin Baulig <martin@gnome.org>
18865 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
18866 operand is of type uint, and the other operand is of type sbyte,
18867 short or int, the operands are converted to type long." -
18868 Actually do what this comment already told us. Fixes bug #28106,
18871 2002-07-24 Martin Baulig <martin@gnome.org>
18873 * class.cs (MethodBase): New abstract class. This is now a base
18874 class for Property, Indexer and Event to avoid some code duplication
18875 in their Define() and DefineMethods() methods.
18876 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
18877 generic methods for Define() and DefineMethods().
18878 (FieldBase): Derive from MemberBase, not MemberCore.
18879 (Property): Derive from MemberBase, not MemberCore.
18880 (Property.DefineMethod): Moved all the code from this method to the
18881 new MethodBase.DefineAccessor(), just call it with appropriate
18883 (Property.Define): Call the new Property.DoDefine(), this does some
18884 sanity checks and we don't need to duplicate the code everywhere.
18885 (Event): Derive from MemberBase, not MemberCore.
18886 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
18887 accessors, this will also make them work with interface events.
18888 (Indexer): Derive from MemberBase, not MemberCore.
18889 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
18890 (Indexer.Define): Use the new MethodBase functions.
18892 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
18893 argument to the constructor.
18894 (Interface.FindMembers): Added support for interface events.
18895 (Interface.PopluateEvent): Implemented.
18897 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
18899 2002-07-22 Miguel de Icaza <miguel@ximian.com>
18901 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
18902 but this is required to check for a method name being the same as
18903 the containing class.
18907 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18909 * interface.cs: initialize variable.
18911 2002-07-23 Martin Baulig <martin@gnome.org>
18913 Implemented the IndexerName attribute in interfaces.
18915 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
18916 name if this is an explicit interface implementation.
18917 (Indexer.InterfaceIndexerName): New public variable. If we're
18918 implementing an interface indexer, this is the IndexerName in that
18919 interface. Otherwise, it's the IndexerName.
18920 (Indexer.DefineMethod): If we're implementing interface indexer,
18921 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
18922 and Pending.ImplementIndexer methods.
18923 (Indexer.Define): Also define the PropertyBuilder if we're
18924 implementing an interface indexer and this is neither an explicit
18925 interface implementation nor do the IndexerName match the one in
18928 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
18929 If a method is defined here, then we always need to create a proxy
18930 for it. This is used when implementing interface indexers.
18931 (Pending.IsInterfaceIndexer): New public method.
18932 (Pending.ImplementIndexer): New public method.
18933 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
18934 This is used when implementing interface indexers to define a proxy
18936 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
18937 define a proxy if necessary.
18939 * interface.cs (Interface.IndexerName): New public variable.
18940 (Interface.PopulateIndexer): Set the IndexerName.
18941 (Interface.DefineIndexers): New private method. Populate all the
18942 indexers and make sure their IndexerNames match.
18944 * typemanager.cs (IndexerPropertyName): Added support for interface
18947 2002-07-22 Martin Baulig <martin@gnome.org>
18949 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
18950 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
18951 ret if HasReturnLabel.
18952 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
18955 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
18956 and set the ec.LoopBeginTryCatchLevel.
18957 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
18958 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
18959 the current ec.TryCatchLevel, the branch goes out of an exception
18960 block. In this case, we need to use Leave and not Br.
18962 2002-07-22 Martin Baulig <martin@gnome.org>
18964 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
18965 block unless the block does not always return or it is contained in
18966 another try { ... } catch { ... } block. Fixes bug #26506.
18967 Added verify-1.cs to the test suite.
18969 2002-07-22 Martin Baulig <martin@gnome.org>
18971 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
18972 then we do not always return. Fixes bug #24985.
18974 2002-07-22 Martin Baulig <martin@gnome.org>
18976 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
18977 lookup on a per-class level; ie. walk up the class hierarchy until we
18978 found at least one applicable method, then choose the best among them.
18979 Fixes bug #24463 and test-29.cs.
18981 2002-07-22 Martin Baulig <martin@gnome.org>
18983 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
18984 return types of the methods. The return type is not part of the
18985 signature and we must not check it to make the `new' modifier work.
18986 Fixes bug #27999, also added test-147.cs.
18987 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
18989 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
18990 on the method's return type.
18992 2002-07-21 Martin Baulig <martin@gnome.org>
18994 * assign.cs: Make this work if the rightmost source is a constant and
18995 we need to do an implicit type conversion. Also adding a few more tests
18996 to test-38.cs which should have caught this.
18998 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
18999 target in the makefile for this. The makefile.gnu is primarily intended
19000 for end-users who don't want to debug the compiler.
19002 2002-07-21 Martin Baulig <martin@gnome.org>
19004 * assign.cs: Improved the Assign class so it can now handle embedded
19005 assignments (X = Y = Z = something). As a side-effect this'll now also
19006 consume less local variables. test-38.cs now passes with MCS, added
19007 a few new test cases to that test.
19009 2002-07-20 Martin Baulig <martin@gnome.org>
19011 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
19012 instructions. Fixes bug #27977, also added test-146.cs.
19014 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19016 * cs-tokenizer.cs: fixed getHex ().
19018 2002-07-19 Martin Baulig <martin@gnome.org>
19020 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
19021 not Type.GetType() to lookup the array type. This is needed when
19022 we're constructing an array of a user-defined type.
19023 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
19024 single-dimensional arrays, but also for single-dimensial arrays of
19027 2002-07-19 Martin Baulig <martin@gnome.org>
19029 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
19030 this function is called, it's not allowed to share LocalBuilders
19031 among ILGenerators.
19033 2002-07-19 Martin Baulig <martin@gnome.org>
19035 * expression.cs (Argument.Resolve): Report an error 118 when trying
19036 to pass a type as argument.
19038 2002-07-18 Martin Baulig <martin@gnome.org>
19040 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
19041 Conv_R_Un for the signed `long' type.
19043 2002-07-15 Miguel de Icaza <miguel@ximian.com>
19045 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
19046 `expr' for the temporary result, as that will fail if we do
19047 multiple resolves on the same expression.
19049 2002-07-05 Miguel de Icaza <miguel@ximian.com>
19051 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
19052 ec.TypeContainer for looking up aliases.
19054 * class.cs (TypeContainer): Remove LookupAlias from here.
19056 * decl.cs (DeclSpace); Move here.
19058 2002-07-01 Miguel de Icaza <miguel@ximian.com>
19060 * class.cs (FindMembers): Only call filter if the constructor
19061 bulider is not null.
19063 Also handle delegates in `NestedTypes' now. Now we will perform
19064 type lookups using the standard resolution process. This also
19067 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
19068 This uses Expressions (the limited kind that can be parsed by the
19069 tree) instead of strings.
19071 * expression.cs (ComposedCast.ToString): Implement, used to flag
19072 errors since now we have to render expressions.
19074 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
19077 * ecore.cs (SimpleName.ToString): ditto.
19079 * cs-parser.jay: Instead of using strings to assemble types, use
19080 Expressions to assemble the type (using SimpleName, ComposedCast,
19081 MemberAccess). This should fix the type lookups in declarations,
19082 because we were using a different code path for this.
19084 * statement.cs (Block.Resolve): Continue processing statements
19085 even when there is an error.
19087 2002-07-17 Miguel de Icaza <miguel@ximian.com>
19089 * class.cs (Event.Define): Also remove the `remove' method from
19090 the list of pending items.
19092 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
19093 generate more compact code.
19095 2002-07-17 Martin Baulig <martin@gnome.org>
19097 * const.cs (Const.LookupConstantValue): Add support for constant
19098 `unchecked' and `checked' expressions.
19099 Also adding test case test-140.cs for this.
19101 2002-07-17 Martin Baulig <martin@gnome.org>
19103 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
19104 check whether mi.ReturnType implements the IEnumerator interface; the
19105 `==' and the IsAssignableFrom() will fail in this situation.
19107 2002-07-16 Ravi Pratap <ravi@ximian.com>
19109 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
19112 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19114 * expression.cs: fixed bug #27811.
19116 2002-07-14 Miguel de Icaza <miguel@ximian.com>
19118 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
19119 Molaro: when we are a ref, the value already contains a pointer
19120 value, do not take the address of it.
19122 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
19123 * removed mb-parser.jay and mb-tokenizer.cs
19125 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19127 * expression.cs: check against the building corlib void type.
19129 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
19131 * ecore.cs: fix for valuetype static readonly fields: when
19132 initializing them, we need their address, not the address of a copy.
19134 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
19136 * typemanager.cs: register also enum_type in corlib.
19138 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19140 * class.cs: allow calling this (but not base) initializers in structs.
19142 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
19144 * ecore.cs: make sure we compare against the building base types
19147 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
19149 * typemanager.cs: fix TypeToCoreType() to handle void and object
19150 (corlib gets no more typerefs after this change).
19152 2002-07-12 Miguel de Icaza <miguel@ximian.com>
19154 * expression.cs (ArrayCreation.EmitArrayArguments): use
19155 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
19157 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
19158 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
19159 array indexes, the runtime actually forbids them.
19161 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
19162 for array arguments here.
19164 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
19165 instead of the default for ValueTypes.
19167 (New.DoEmit): Use IsValueType instead of
19168 IsSubclassOf (value_type)
19169 (New.DoResolve): ditto.
19170 (Invocation.EmitCall): ditto.
19172 * assign.cs (Assign): ditto.
19174 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
19175 Statements *are* currently doing part of their resolution during
19178 Expressions do always resolve during resolve, but statements are
19179 only required to propagate resolution to their children.
19181 2002-07-11 Miguel de Icaza <miguel@ximian.com>
19183 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
19185 (LoadAssembly): Do not add the dll if it is already specified
19187 (MainDriver): Add the System directory to the link path at the end,
19188 after all the other -L arguments.
19190 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
19191 wrong opcode for loading bytes and bools (ldelem.i1 instead of
19192 ldelem.u1) and using the opposite for sbytes.
19194 This fixes Digger, and we can finally run it.
19196 * driver.cs (UnixParseOption): Move the option parsing here.
19197 (CSCParseOption): Implement CSC-like parsing of options.
19199 We now support both modes of operation, the old Unix way, and the
19200 new CSC-like way. This should help those who wanted to make cross
19201 platform makefiles.
19203 The only thing broken is that /r:, /reference: and /lib: are not
19204 implemented, because I want to make those have the same semantics
19205 as the CSC compiler has, and kill once and for all the confussion
19206 around this. Will be doing this tomorrow.
19208 * statement.cs (Unsafe.Resolve): The state is checked during
19209 resolve, not emit, so we have to set the flags for IsUnsfe here.
19211 2002-07-10 Miguel de Icaza <miguel@ximian.com>
19213 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
19214 not catch the Error_ObjectRefRequired in SimpleName (as it is
19215 possible to have a class/instance variable name that later gets
19216 deambiguated), we have to check this here.
19218 2002-07-10 Ravi Pratap <ravi@ximian.com>
19220 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
19221 make static and put into Expression.
19223 (Event.Define): Register the private field of the event with the
19224 TypeManager so that GetFieldFromEvent can get at it.
19226 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
19227 keep track of the private field associated with an event which
19230 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
19233 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
19235 2002-07-10 Miguel de Icaza <miguel@ximian.com>
19237 * expression.cs (Binary.EmitBranchable): this routine emits the
19238 Binary expression in a branchable context. This basically means:
19239 we need to branch somewhere, not just get the value on the stack.
19241 This works together with Statement.EmitBoolExpression.
19243 * statement.cs (Statement.EmitBoolExpression): Use
19246 2002-07-09 Miguel de Icaza <miguel@ximian.com>
19248 * statement.cs (For): Reduce the number of jumps in loops.
19250 (For): Implement loop inversion for the For statement.
19252 (Break): We can be breaking out of a Try/Catch controlled section
19253 (foreach might have an implicit try/catch clause), so we need to
19254 use Leave instead of Br.
19256 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
19257 now). If the instace expression supports IMemoryLocation, we use
19258 the AddressOf method from the IMemoryLocation to extract the
19259 address instead of emitting the instance.
19261 This showed up with `This', as we were emitting the instance
19262 always (Emit) instead of the Address of This. Particularly
19263 interesting when This is a value type, as we dont want the Emit
19264 effect (which was to load the object).
19266 2002-07-08 Miguel de Icaza <miguel@ximian.com>
19268 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
19270 * statement.cs (Checked): Set the CheckedState during the resolve
19271 process too, as the ConvCast operations track the checked state on
19272 the resolve process, and not emit.
19274 * cs-parser.jay (namespace_member_declaration): Flag that we have
19275 found a declaration when we do. This is used to flag error 1529
19277 * driver.cs: Report ok when we display the help only.
19279 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
19281 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
19283 2002-07-04 Miguel de Icaza <miguel@ximian.com>
19285 * cs-tokenizer.cs (define): We also have to track locally the
19286 defines. AllDefines is just used for the Conditional Attribute,
19287 but we also need the local defines for the current source code.
19289 2002-07-03 Miguel de Icaza <miguel@ximian.com>
19291 * statement.cs (While, For, Do): These loops can exit through a
19292 Break statement, use this information to tell whether the
19293 statement is the last piece of code.
19295 (Break): Flag that we break.
19297 * codegen.cs (EmitContexts): New `Breaks' state variable.
19299 2002-07-03 Martin Baulig <martin@gnome.org>
19301 * class.cs (TypeContainer.MethodModifiersValid): Allow override
19302 modifiers in method declarations in structs. Otherwise, you won't
19303 be able to override things like Object.Equals().
19305 2002-07-02 Miguel de Icaza <miguel@ximian.com>
19307 * class.cs (Method, Property, Indexer): Do not allow the public
19308 modifier to be used in explicit interface implementations.
19310 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
19311 override modifiers in method declarations in structs
19313 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
19315 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
19316 integer or real overflow, report an error
19318 2002-07-02 Martin Baulig <martin@gnome.org>
19320 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
19321 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
19322 to tell the runtime about our newly created System.Object and
19323 System.ValueType types.
19325 2002-07-02 Miguel de Icaza <miguel@ximian.com>
19327 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
19328 struct instead of Ldarg/Starg.
19330 2002-07-02 Martin Baulig <martin@gnome.org>
19332 * expression.cs (Indirection.Indirection): Call
19333 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
19335 2002-07-02 Martin Baulig <martin@gnome.org>
19337 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
19338 ValueType, call TypeManager.TypeToCoreType() on it.
19339 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
19340 the OpCodes.Newarr argument.
19342 2002-07-02 Martin Baulig <martin@gnome.org>
19344 * expression.cs (Invocation.EmitCall): When compiling corlib,
19345 replace all calls to the system's System.Array type to calls to
19346 the newly created one.
19348 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
19349 System.Array methods.
19350 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
19351 from the system's System.Array type which must be replaced.
19353 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
19355 * typemanager.cs: load unverifiable_code_ctor so we can build
19356 corlib using the correct type. Avoid using GetTypeCode() with
19358 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
19359 TypeManager.object_type to allow building corlib.
19361 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
19363 * ecore.cs: handle System.Enum separately in LoadFromPtr().
19365 2002-07-01 Martin Baulig <martin@gnome.org>
19367 * class.cs: Make the last change actually work, we need to check
19368 whether `ifaces != null' to avoid a crash.
19370 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19372 * class.cs: when we build structs without fields that implement
19373 interfaces, we need to add the interfaces separately, since there is
19374 no API to both set the size and add the interfaces at type creation
19377 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19379 * expression.cs: the dimension arguments to the array constructors
19380 need to be converted if they are a long.
19382 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
19384 * class.cs: don't emit ldarg.0 if there is no parent constructor
19385 (fixes showstopper for corlib).
19387 2002-06-29 Martin Baulig <martin@gnome.org>
19389 MCS now compiles corlib on GNU/Linux :-)
19391 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
19392 ie. check for MethodImplOptions.InternalCall.
19394 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
19395 and TypeManager.attribute_type are null, so we must explicitly check
19396 whether parent is not null to find out whether it's an attribute type.
19397 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
19398 and SetBuilder, not only if the property is neither abstract nor external.
19399 This is necessary to set the MethodImplOptions on the accessor methods.
19400 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
19401 SetBuilder, see Property.Emit().
19403 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
19404 populate "System.Object", "System.ValueType" and "System.Attribute" since
19405 they've already been populated from BootCorlib_PopulateCoreTypes().
19407 2002-06-29 Martin Baulig <martin@gnome.org>
19409 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
19410 is the NullLiteral, we also need to make sure that target_type is not
19413 2002-06-29 Martin Baulig <martin@gnome.org>
19415 * rootcontext.cs (RootContext.ResolveCore): We must initialize
19416 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
19417 before calling BootstrapCorlib_ResolveDelegate ().
19419 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19421 * statement.cs: fixed build-breaker. All tests passed ok.
19423 2002-06-27 Martin Baulig <martin@gnome.org>
19425 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
19426 for System.Decimal when compiling corlib.
19428 2002-06-27 Martin Baulig <martin@gnome.org>
19430 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
19431 switch blocks which contain nothing but a default clause.
19433 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
19435 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
19437 2002-06-27 Martin Baulig <martin@gnome.org>
19439 * ecore.cs (PropertyExpr.PropertyExpr): Call
19440 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
19442 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
19443 is already a TypeBuilder.
19445 2002-06-27 Martin Baulig <martin@gnome.org>
19447 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
19448 `target_type == TypeManager.array_type', not IsAssignableFrom() in
19449 the "from an array-type to System.Array" case. This makes it work
19450 when compiling corlib.
19452 2002-06-27 Martin Baulig <martin@gnome.org>
19454 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
19455 non-static PropertyExpr, set its InstanceExpression. This makes
19456 the `ICollection.Count' property work in System/Array.cs.
19458 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
19460 * driver.cs: Made error handling more consistent. Errors now
19461 tracked by Report class, so many methods which used to return int
19462 now return void. Main() now prints success/failure and
19463 errors/warnings message.
19465 Renamed '--probe' compiler argument to '--expect-error'. Removed
19466 the magic number return values (123 and 124). Now, if the
19467 expected error occurs, the compiler exits with success (exit value
19468 0). If the compilation completes without seeing that particular
19469 error, the compiler exits with failure (exit value 1). The
19470 makefile in mcs/errors has been changed to handle the new behaviour.
19472 * report.cs: Made 'expected error' number a property and renamed
19473 it from 'Probe' to 'ExpectedError'.
19475 * genericparser.cs: Removed error handling support, since it is
19476 now all done by Report class.
19478 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
19479 class, so parse() no longer returns an int.
19481 * namespace.cs: Use Report.Error instead of GenericParser.error
19483 2002-06-22 Miguel de Icaza <miguel@ximian.com>
19485 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
19486 TypeContainer.AddOperator): At the front of the list put the
19487 explicit implementations, so they get resolved/defined first.
19489 2002-06-21 Miguel de Icaza <miguel@ximian.com>
19491 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
19492 interface type is implemented by this TypeContainer. Used during
19493 explicit interface implementation.
19495 (Property.Define, Indexer.Define, Method.Define): Validate that
19496 the given interface in the explicit implementation is one of the
19497 base classes for the containing type.
19499 Also if we are explicitly implementing an interface, but there is
19500 no match in the pending implementation table, report an error.
19502 (Property.Define): Only define the property if we are
19503 not explicitly implementing a property from an interface. Use the
19504 correct name also for those properties (the same CSC uses,
19505 although that is really not needed).
19507 (Property.Emit): Do not emit attributes for explicitly implemented
19508 properties, as there is no TypeBuilder.
19510 (Indexer.Emit): ditto.
19512 Hiding then means that we do not really *implement* a pending
19513 implementation, which makes code fail.
19515 2002-06-22 Martin Baulig <martin@gnome.org>
19517 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
19518 the return value of Object.GetType(). [FIXME: we need to do this whenever
19519 we get a type back from the reflection library].
19521 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
19523 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
19525 2002-06-20 Miguel de Icaza <miguel@ximian.com>
19527 * attribute.cs: Return null if we can not look up the type.
19529 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
19530 the interface types found.
19532 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
19533 interface types found.
19535 * typemanager.cs (GetInterfaces): Make this routine returns alll
19536 the interfaces and work around the lame differences between
19537 System.Type and System.Reflection.Emit.TypeBuilder in the results
19538 result for GetInterfaces.
19540 (ExpandInterfaces): Given an array of interface types, expand and
19541 eliminate repeated ocurrences of an interface. This expands in
19542 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
19545 2002-06-21 Martin Baulig <martin@gnome.org>
19547 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
19550 2002-06-21 Martin Baulig <martin@gnome.org>
19552 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
19553 and called with one of the core types, return the corresponding typebuilder for
19556 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
19559 2002-06-21 Martin Baulig <martin@gnome.org>
19561 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
19562 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
19563 (Expression.ConvertReferenceExplicit): Likewise.
19565 * expression.cs (ElementAccess.DoResolve): Likewise.
19566 (ElementAccess.DoResolveLValue): Likewise.
19568 2002-06-10 Martin Baulig <martin@gnome.org>
19570 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
19571 add the "value" parameter to the parameter list.
19573 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
19576 2002-06-19 Miguel de Icaza <miguel@ximian.com>
19578 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
19579 the argument to an int, uint, long or ulong, per the spec. Also
19580 catch negative constants in array creation.
19582 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
19584 * class.cs: do not allow the same interface to appear twice in
19585 the definition list.
19587 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
19589 * ecore.cs: don't use ldlen with System.Array.
19591 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
19593 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
19595 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
19597 * modifiers.cs: produce correct field attributes for protected
19598 internal. Easy fix so miguel can work on ther harder stuff:-)
19600 2002-06-18 Miguel de Icaza <miguel@ximian.com>
19602 * pending.cs: New file. Move the code from class.cs here.
19603 Support clearning the pending flag for all methods (when not doing
19604 explicit interface implementation).
19606 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
19608 * rootcontext.cs: added a couple more types needed to bootstrap.
19610 2002-06-17 Miguel de Icaza <miguel@ximian.com>
19612 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
19613 constructor in the type, instead of any constructor in the type
19614 hierarchy. Thanks to Paolo for finding this bug (it showed up as
19615 a bug in the Mono runtime when applying the params attribute).
19617 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
19618 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
19620 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
19622 * expression.cs (Unary.ResolveOperator): Use TypeManager
19623 to resolve the type.
19625 2002-06-13 Ravi Pratap <ravi@ximian.com>
19627 * cs-parser.jay (enum_member_declaration): Pass in the attributes
19630 * enum.cs (AddEnumMember): Add support to store the attributes associated
19631 with each member too.
19633 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
19634 field builders too - this takes care of the enum member case.
19636 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
19638 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
19639 address-of operator on both value types and pointers.
19641 2002-06-10 Martin Baulig <martin@gnome.org>
19643 * interface.cs (Interface.PopulateIndexer): Add the indexer's
19644 PropertyBuilder to the `property_builders' list.
19646 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
19647 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
19648 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
19649 find any indexers which are inherited from an interface.
19651 2002-06-09 Martin Baulig <martin@gnome.org>
19653 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
19654 the same type as the constant if necessary. There's also a test-130.cs
19657 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
19659 * typemanager.cs (TypeManager.ChangeType): Previously known as
19660 Enum.ChangeEnumType().
19662 2002-06-09 Martin Baulig <martin@gnome.org>
19664 * expression.cs (Cast.TryReduce): Added support for consts.
19666 2002-06-08 Ravi Pratap <ravi@ximian.com>
19668 * class.cs (Accessor): Hold attributes information so we can pass
19671 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
19672 Modify to pass in attributes attached to the methods.
19674 (add_accessor_declaration, remove_accessor_declaration): Ditto.
19676 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
19677 to handle the Accessor kind :-)
19679 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
19681 2002-06-08 Martin Baulig <martin@gnome.org>
19683 * expression.cs (Unary.TryReduceNegative): Added support for
19686 2002-06-08 Martin Baulig <martin@gnome.org>
19688 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
19689 name can't be found in the `defined_names' - the caller will do a
19690 MemberLookup in this case and thus find methods in System.Enum
19691 such as Enum.IsDefined().
19693 2002-06-08 Martin Baulig <martin@gnome.org>
19695 * enum.cs (Enum.ChangeEnumType): This is a custom version of
19696 Convert.ChangeType() which works with TypeBuilder created types.
19697 (Enum.LookupEnumValue, Enum.Define): Use it here.
19699 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
19700 `TypeBuilder.BaseType != null' check.
19701 (TypeContainer.FindMembers): Only lookup parent members if we
19702 actually have a parent.
19703 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
19704 (ConstructorInitializer.Resolve): Likewise.
19706 * interface.cs (Interface.FindMembers): Added
19707 `TypeBuilder.BaseType != null' check.
19709 * rootcontext.cs (RootContext.ResolveCore): Added
19710 "System.Runtime.CompilerServices.IndexerNameAttribute" to
19711 classes_second_stage.
19713 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
19714 debug_type and trace_type when compiling with --nostdlib.
19716 2002-06-07 Martin Baulig <martin@gnome.org>
19718 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
19719 (AddField): Set it to true when adding a non-static field.
19720 (DefineType): Use `have_nonstatic_fields' to find out whether we
19721 have non-static fields, not `Fields != null'.
19723 2002-06-02 Miguel de Icaza <miguel@ximian.com>
19725 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
19726 dereferencing a null on the static-field code path)
19728 2002-05-30 Martin Baulig <martin@gnome.org>
19730 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
19731 to take command line arguments. Use reflection to call the new
19732 custom `Initialize' function on the symbol writer and pass it the
19733 command line arguments.
19735 * driver.cs (--debug-args): New command line argument to pass command
19736 line arguments to the symbol writer.
19738 2002-05-28 Miguel de Icaza <miguel@ximian.com>
19740 * assign.cs (DoResolve): Forgot to do the implicit conversion to
19741 the target type for indexers and properties. Thanks to Joe for
19744 2002-05-27 Miguel de Icaza <miguel@ximian.com>
19746 * typemanager.cs (MethodFlags): returns the method flags
19747 (Obsolete/ShouldIgnore) that control warning emission and whether
19748 the invocation should be made, or ignored.
19750 * expression.cs (Invocation.Emit): Remove previous hack, we should
19751 not do this on matching a base type, we should do this based on an attribute
19753 Only emit calls to System.Diagnostics.Debug and
19754 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
19755 on the command line.
19757 * rootcontext.cs: Global settings for tracing and debugging.
19759 * cs-tokenizer.cs (define): New utility function to track
19760 defines. Set the global settings for TRACE and DEBUG if found.
19762 2002-05-25 Ravi Pratap <ravi@ximian.com>
19764 * interface.cs (Populate*): Pass in the TypeContainer as well as
19765 the DeclSpace as parameters so that we can create EmitContexts and
19766 then use that to apply attributes etc.
19768 (PopulateMethod, PopulateEvent, PopulateProperty)
19769 (PopulateIndexer): Apply attributes everywhere.
19771 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
19774 (ApplyAttributes): Update accordingly.
19776 We now apply interface attributes for all members too.
19778 2002-05-26 Miguel de Icaza <miguel@ximian.com>
19780 * class.cs (Indexer.Define); Correctly check if we are explicit
19781 implementation (instead of checking the Name for a ".", we
19782 directly look up if the InterfaceType was specified).
19784 Delay the creation of the PropertyBuilder.
19786 Only create the PropertyBuilder if we are not an explicit
19787 interface implementation. This means that explicit interface
19788 implementation members do not participate in regular function
19789 lookups, and hence fixes another major ambiguity problem in
19790 overload resolution (that was the visible effect).
19792 (DefineMethod): Return whether we are doing an interface
19795 * typemanager.cs: Temporary hack until we get attributes in
19796 interfaces (Ravi is working on that) and we get IndexerName
19797 support in interfaces.
19799 * interface.cs: Register the indexers as properties.
19801 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
19802 warning, I have verified that this is a bug in the .NET runtime
19803 (JavaScript suffers of the same problem).
19805 * typemanager.cs (MemberLookup): When looking up members for
19806 interfaces, the parent of an interface is the implicit
19807 System.Object (so we succeed in searches of Object methods in an
19808 interface method invocation. Example: IEnumerable x; x.ToString
19811 2002-05-25 Miguel de Icaza <miguel@ximian.com>
19813 * class.cs (Event): Events should also register if they do
19814 implement the methods that an interface requires.
19816 * typemanager.cs (MemberLookup); use the new GetInterfaces
19819 (GetInterfaces): The code used to lookup interfaces for a type is
19820 used in more than one place, factor it here.
19822 * driver.cs: Track the errors at the bottom of the file, we kept
19825 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
19826 instance if the method we are calling is static!
19828 2002-05-24 Miguel de Icaza <miguel@ximian.com>
19830 * attribute.cs (ApplyAttributes): Make this function filter out
19831 the IndexerName attribute (as that attribute in reality is never
19832 applied) and return the string constant for the IndexerName
19835 * class.cs (TypeContainer.Emit): Validate that all the indexers
19836 have the same IndexerName attribute, and if so, set the
19837 DefaultName attribute on the class.
19839 * typemanager.cs: The return value might contain other stuff (not
19840 only methods). For instance, consider a method with an "Item"
19841 property and an Item method.
19843 * class.cs: If there is a problem with the parameter types,
19846 2002-05-24 Ravi Pratap <ravi@ximian.com>
19848 * ecore.cs (ImplicitConversionExists): Wrapper function which also
19849 looks at user defined conversion after making a call to
19850 StandardConversionExists - we need this for overload resolution.
19852 * expression.cs : Update accordingly the various method calls.
19854 This fixes 2 bugs filed against implicit user defined conversions
19856 2002-05-22 Miguel de Icaza <miguel@ximian.com>
19858 * statement.cs: Track the result of the assignment.
19860 2002-05-21 Miguel de Icaza <miguel@ximian.com>
19862 * expression.cs (MemberAccess): Improved error reporting for
19863 inaccessible members.
19865 2002-05-22 Martin Baulig <martin@gnome.org>
19867 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
19868 itself with debugging support.
19870 2002-05-22 Martin Baulig <martin@gnome.org>
19872 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
19873 Removed, this isn't needed anymore.
19875 2002-05-20 Martin Baulig <martin@gnome.org>
19877 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
19878 be underlying type for an enum.
19880 2002-05-20 Miguel de Icaza <miguel@ximian.com>
19882 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
19883 that splits out the loading of just the core types.
19885 * rootcontext.cs (ResolveCore): Split the struct resolution in
19886 two, so we can load the enumeration underlying types before any
19889 * expression.cs (Is): Bandaid until we fix properly Switch (see
19890 bug #24985 for details).
19892 * typemanager.cs (ImplementsInterface): The hashtable will contain
19893 a null if there are no interfaces implemented.
19895 2002-05-18 Miguel de Icaza <miguel@ximian.com>
19897 * cs-parser.jay (indexer_declarator): It is fine to have array
19900 2002-05-17 Miguel de Icaza <miguel@ximian.com>
19902 * typemanager.cs: (RegisterBuilder): New function used to register
19903 TypeBuilders that implement interfaces. Since
19904 TypeBuilder.GetInterfaces (as usual) does not work with lame
19906 (AddUserType): register interfaces.
19908 (ImplementsInterface): Use the builder_to_ifaces hash if we are
19909 dealing with TypeBuilder. Also, arrays are showing up as
19910 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
19911 methods can not be invoked on them!
19913 * ecore.cs (ExplicitReferenceConversionExists): Made public.
19914 (ImplicitReferenceConversionExists): Split out from
19915 StandardConversionExists.
19917 * expression.cs (As): We were only implementing one of the three
19918 cases for the as operator. We now implement them all.
19919 (Is): Implement the various other cases for Is as well.
19921 * typemanager.cs (CACHE): New define used to control if we want or
19922 not the FindMembers cache. Seems to have a negative impact on
19923 performance currently
19925 (MemberLookup): Nested types have full acess to
19926 enclosing type members
19928 Remove code that coped with instance/static returns for events, we
19929 now catch this in RealFindMembers.
19931 (RealFindMembers): only perform static lookup if the instance
19932 lookup did not return a type or an event.
19934 2002-05-17 Miguel de Icaza <miguel@ximian.com>
19936 * assign.cs (CompoundAssign): We pass more semantic information
19937 now to Compound Assignments than we did before: now we have all
19938 the information at hand, and now we resolve the target *before* we
19939 do the expression expansion, which allows the "CacheValue" method
19940 to have the effect we intended (before, a [x] += 1 would generate
19941 two differen ArrayAccess expressions from the ElementAccess,
19942 during the resolution process).
19944 (CompoundAssign.DoResolve): Resolve target and original_source here.
19946 2002-05-16 Miguel de Icaza <miguel@ximian.com>
19948 * expression.cs (ArrayAccess): dropped debugging information.
19950 * typemanager.cs: Small bug fix: I was always returning i_members,
19951 instead of one of i_members or s_members (depending on which had
19954 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
19955 method is invoked before any code generation takes place, and it
19956 is a mechanism to inform that the expression will be invoked more
19957 than once, and that the method should use temporary values to
19958 avoid having side effects
19960 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
19962 * ecore.cs (Expression.CacheTemporaries): Provide empty default
19965 * expression.cs (Indirection, ArrayAccess): Add support for
19966 CacheTemporaries in these two bad boys.
19968 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
19969 ldobj or ldind_ref.
19970 (StoreFromPtr): Handle stobj as well.
19972 * expression.cs (UnaryMutator): Share more code.
19974 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
19975 down: I was not tracking the Filter function as well, which
19976 was affecting the results of the cache.
19978 2002-05-15 Miguel de Icaza <miguel@ximian.com>
19980 * attribute.cs: Remove the hack to handle the CharSet property on
19983 2002-05-14 Miguel de Icaza <miguel@ximian.com>
19985 * attribute.cs (DoResolve): More uglyness, we now only try to
19986 resolve the attribute partially, to extract the CharSet
19987 information (only if we are a StructLayout attribute). Otherwise
19989 (GetExtraTypeInfo): Add some code to conditionally kill in the
19990 future this. I am more and more convinced that the .NET
19991 framework has special code to handle the attribute setting on
19994 * expression.cs (IsParamsMethodApplicable): Revert my previous
19995 foreach change here, it was wrong.
19997 2002-05-13 Miguel de Icaza <miguel@ximian.com>
19999 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
20000 (pp_expr): do not abort on unknown input, just return.
20001 (eval): abort if there are pending chars.
20003 * attribute.cs (Attribute.Resolve): Positional parameters are
20004 optional. Deal with that case.
20006 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
20007 the Ansi/Unicode/Auto information for the type.
20009 (TypeContainer.DefineType): instantiate the EmitContext here, as
20010 we will be using it during the type definition (to resolve
20011 attributes) and during the emit phase.
20013 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
20014 to pull type information out of the attributes
20016 (Attribute.Resolve): track the constructor builder, and allow for
20017 multiple invocations (structs and classes will use this).
20019 * ecore.cs (MemberLookupFinal): new version with all the
20020 parameters customizable.
20022 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
20023 constructors. Return if the result value is null (as the error
20024 would have been flagged already by MemberLookupFinal)
20026 Do not allow instances of abstract classes or interfaces to be
20029 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
20030 We have to compare the assembly property here when dealing with
20031 FamANDAssem and Assembly access modifiers, because we might be
20032 creating an assembly from *modules* (that means that we are not
20033 getting TypeBuilders for types defined in other modules that are
20034 part of this assembly).
20036 (Method.Emit): If the method is marked abstract and has a body,
20039 (TypeContainer.DefineMembers): If both the defined member and the
20040 parent name match are methods, then do not emit any warnings: let
20041 the Method.Define routine take care of flagging warnings. But if
20042 there is a mismatch (method overrides something else, or method is
20043 overriwritten by something, then emit warning).
20045 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
20046 set to null, this means `do not check for the return type on the
20049 (Method.Define): set the return type for the method signature to
20050 null, so that we get methods with the same name and parameters and
20051 different return types. This is used to flag warning 114 (you are
20052 hiding a method, and you probably want to use the new/override
20055 * typemanager.cs (MemberLookup): Implemented proper access
20056 control, closing a long standing set of bug reports. The problem
20057 was that the Framework only has two bits: Public and NonPublic,
20058 and NonPublic includes private and protected methods, but we need
20059 to enforce the FamANDAssem, FamOrAssem and Family.
20061 2002-05-11 Miguel de Icaza <miguel@ximian.com>
20063 * statement.cs (GotoCase): Return true: Ammounts to giving up
20064 knowledge on whether we return or not, and letting the other case
20065 be responsible for it.
20067 2002-05-10 Miguel de Icaza <miguel@ximian.com>
20069 * driver.cs: Do not load directories for each file processed, only
20070 do it if there is a pattern.
20072 * ecore.cs: Report readonly assigns here as well, as we might have
20073 been resolved only by MemberAccess.
20075 (SimpleName.SimpleNameResolve): Also be useful for LValue
20076 resolution. We need this to propagate assign to local readonly variables
20078 * typemanager.cs: Use a ptrhashtable for the criteria, because we
20079 do not want to reuse potential criteria memory.
20081 * class.cs (MyEventBuilder): Set reflected_type;
20083 * ecore.cs (Constantify): Added support for constifying bools.
20085 (RootContext.LookupType): Added a cache for values looked up in
20086 the declaration space.
20088 * typemanager.cs (FindMembers): Now is a front-end to
20089 RealFindMembers, and provides a two-level hashtable-based cache to
20092 15% performance improvement: from 22.5 to 19.2 seconds.
20094 * expression.cs (IsParamsMethodApplicable): use foreach.
20095 (Invocation.DoResolve): ditto.
20096 (New.DoResolve): ditto.
20097 (ArrayCreation.DoResolve): ditto.
20099 * ecore.cs (FindMostEncompassingType): use foreach.
20101 * delegate.cs (NewDelegate.DoResolve): Use foreach
20103 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
20104 (RemoveMethods): use foreach.
20106 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
20107 nested foreach statements instead of for, and also break out of
20108 the inner loop once a match is found.
20110 (Invocation.OverloadResolve): Use foreach, simplify the code.
20112 2002-05-08 Miguel de Icaza <miguel@ximian.com>
20114 * cfold.cs (BinaryFold): During an enumeration evaluation context,
20115 we actually unwrap the expression to allow for extra information
20118 * expression.cs: Use Shr_Un on unsigned operations.
20120 2002-05-08 Ravi Pratap <ravi@ximian.com>
20122 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
20123 applicable operators was not being considered correctly. This closes
20124 the bug Miguel reported.
20126 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
20128 * attribute.cs: check that the type derives from System.Attribute
20129 and report the correct error in that case (moved the duplicate code to
20130 its own method, too).
20132 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
20134 * attribute.cs: lookup attribute type name as the spec says: first the
20135 bare attribute name and then name + "Attribute" (nant compiles with
20136 mcs after this fix).
20138 2002-05-07 Miguel de Icaza <miguel@ximian.com>
20140 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
20141 Because of the way we parse things, we should try to see if a
20142 UIntConstant can fit in an integer.
20144 2002-05-07 Ravi Pratap <ravi@ximian.com>
20146 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
20147 when we are in an explicit context.
20149 (ConvertReferenceExplicit): When converting from Iface type S to Class
20150 T make sure the rules are implemented as an OR.
20152 * parameter.cs (ParameterType): Make it a property for now although the
20153 purpose really isn't anything immediate.
20155 * expression.cs (Is*Applicable): Do better checking on the parameter type
20156 of a ref/out parameter. The ones from the system assemblies are already
20157 marked with the correct type so we don't need to do any correction.
20159 * ecore.cs (StandardConversionExists): Conversion from Interface types to
20160 the object type is standard too so include that.
20162 2002-05-06 Miguel de Icaza <miguel@ximian.com>
20164 * ecore.cs (StandardConversionExists): Augment with missing code:
20165 deal with IntConstant, LongConstants and Enumerations.
20167 * assign.cs: Report the error, instead of failing silently
20169 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
20170 typecontainer that they are declared, because the
20171 typecontainer/namespace will have the list of using clauses that
20172 need to be applied.
20174 Assembly Attributes were escaping the normal registration
20177 (EmitCode): Apply attributes within an EmitContext that represents
20178 the container they were declared on.
20180 * cs-parser.jay: Track bases for structs. How did I get this wrong?
20182 2002-05-06 Ravi Pratap <ravi@ximian.com>
20184 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
20185 Revamp completely - make much cleaner as we now operate only
20188 (FindMostSpecificSource, FindMostSpecificTarget): New methods
20189 to implement the logic detailed in the spec more correctly.
20191 (UserDefinedConversion): Update accordingly.
20193 2002-05-06 Miguel de Icaza <miguel@ximian.com>
20195 * statement.cs: Return flow analysis information up.
20197 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
20200 (token): Do not consume an extra character before calling
20203 2002-05-06 Piers Haken <piersh@friskit.com>
20205 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
20207 2002-05-06 Miguel de Icaza <miguel@ximian.com>
20209 * class.cs (Constructor.Emit): Set the IsStatic flag in the
20210 EmitContext during the instance constructor initializer
20211 resolution, to stop access to instance variables.
20213 This is mandated by the spec, last paragraph of the `constructor
20214 initializers' section.
20216 2002-05-05 Miguel de Icaza <miguel@ximian.com>
20218 * cs-parser.jay, class.cs (Accessor): new class used to represent
20219 an accessor (get or set). In the past we used `null' to represent
20220 a missing accessor. But this is ambiguous because there was no
20221 way to tell in abstract indexers/properties if one of them was
20224 Now there is a way of addressing that.
20226 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
20227 instead of FindMembers.
20229 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
20230 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
20232 * attribute.cs: Treat indexers and properties as the same in terms
20233 of applying attributes
20235 * ecore.cs (FindMostEncompassedType): Use statically initialized
20236 EmptyExpressions()s like we do elsewhere to avoid creating useless
20237 objects (and we take this out of the tight loop).
20239 (GetConversionOperators): Move the code to extract the actual
20240 operators to a separate routine to clean things up.
20242 2002-05-04 Miguel de Icaza <miguel@ximian.com>
20244 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
20245 events are always registered FieldBuilders.
20247 * class.cs (FieldBase): New class shared by Fields
20249 * delegate.cs: If we are a toplevel delegate, use our full name.
20250 If we are a nested delegate, then only use our tail name.
20252 2002-05-02 Ravi Pratap <ravi@ximian.com>
20254 * expression.cs (IsApplicable): Ensure that we add the "&" to
20255 ref/out types before comparing it with the type of the argument.
20257 (IsParamsMethodApplicable): Ditto.
20259 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
20262 * delegate.cs : Handle the case when we have more than one applicable
20263 method. Flag an error only when we finish checking all.
20265 2002-05-02 Miguel de Icaza <miguel@ximian.com>
20267 * expression.cs: Add support for boolean static initializers.
20269 2002-05-01 Miguel de Icaza <miguel@ximian.com>
20271 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
20273 * parameter.cs (ComputeParameterTypes,
20274 ComputeAndDefineParameterTypes): Better error handling: now we
20275 clear the `types' cache if we fail during any of the type lookups.
20276 We also return the status code correctly to our caller
20278 * delegate.cs: If we fail to define a delegate, abort the extra
20281 * expression.cs (Binary.ResolveOperator): for
20282 operator==(object,object) and operator !=(object, object) we also
20283 have to verify that there is an implicit conversion from one to
20286 (ArrayAccess.DoResolve): Array Access can operate on
20289 2002-04-30 Miguel de Icaza <miguel@ximian.com>
20291 * assign.cs (CompoundAssign): A new class used as a "flag" that
20292 the assignment actually is happening as part of a compound
20293 assignment operator.
20295 During compound assignment, a few new rules exist to enable things
20302 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
20303 to the type of x) if y is implicitly convertible to the type of x,
20304 and the operator is a builtin operator and the return type of the
20305 operator is explicitly convertible to the type of x.
20307 * rootcontext.cs: Reset warning level to 2. 4 catches various
20308 "interesting" features in mcs, we must clean this up at some
20309 point, but currently am trying to kill other bugs ;-)
20311 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
20312 in container classes as well.
20314 * expression.cs (Binary.ResolveOperator): Handle string case
20315 before anything else (as operator overloading does emit an error
20316 before doing anything else).
20318 This code could go away when we move to a table driven model, but
20319 i could not come up with a good plan last night.
20321 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
20323 * typemanager.cs (CSharpName): reimplementation using regex.
20324 * class.cs: added null check for fields in Emit
20325 * rootcontext.cs: set warninglevel to 4
20327 2002-04-29 Miguel de Icaza <miguel@ximian.com>
20329 * typemanager.cs (CSharpName): reimplemented with Lupus
20332 2002-04-28 Miguel de Icaza <miguel@ximian.com>
20334 * statement.cs (If): correclty implement Resolve, because we were
20335 not catching sem errors in there. The same process is needed
20337 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
20340 (Statement.Warning_DeadCodeFound): Factorize code.
20341 (While): Report dead code here too.
20343 (Statement): Added Resolve virtual method to allow
20344 for resolution split from the emit code.
20346 2002-04-26 Miguel de Icaza <miguel@ximian.com>
20348 * statement.cs (EmitBoolExpression): No longer try to resolve the
20350 (MakeBoolean): New utility function that resolve, implicitly
20351 converts to boolean and tags the expression.
20354 (If, Do): Implement dead code elimination.
20355 (While): Implement loop inversion
20357 (Do, While, For, If): Resolve the expression prior to calling our
20360 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
20363 - added method Report28 (warning: program has more than one entry point)
20364 - added method IsEntryPoint, implements paragraph 10.1 of the spec
20365 - modified method Method.Define, the part at the end of the method
20367 * rootcontext.cs: added static public Location EntryPointLocation;
20369 * ../errors/cs0028.cs : Add test case for the above warning.
20372 - modified method CSharpName to allow arrays of primitive type to
20373 be printed nicely (e.g. instead of System.Int32[][] it now prints
20375 - added method CSharpSignature: returns the signature of a method
20376 in string format to be used in reporting errors, warnings, etc.
20378 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
20381 2002-04-26 Ravi Pratap <ravi@ximian.com>
20383 * delegate.cs (Define): Fix extremely silly bug where I was
20384 setting the type of the 'object' parameter of the BeginInvoke
20385 method to System.IAsyncResult instead of System.Object ;-)
20387 2002-04-26 Miguel de Icaza <miguel@ximian.com>
20389 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
20392 (Constructor.Emit): return if we fail to initialize the
20393 constructor. Another door closed!
20395 * expression.cs (New.DoResolve): Improve error message (from -6 to
20396 1501). Use DeclaredOnly lookup to find the exact constructor.
20398 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
20399 loop. This is useful.
20401 * cs-parser.jay: Adjust the default parameters so that destructors
20402 have the proper signature.
20404 2002-04-26 Martin Baulig <martin@gnome.org>
20406 * driver.cs (LoadAssembly): If `assembly' contains any characters
20407 which are only valid in path names and not in assembly names
20408 (currently slash, backslash and point), use Assembly.LoadFrom ()
20409 instead of Assembly.Load () on the `assembly' (before iteration
20410 over the link_paths).
20412 2002-04-26 Martin Baulig <martin@gnome.org>
20414 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
20416 2002-04-25 Miguel de Icaza <miguel@ximian.com>
20418 * class.cs (Property): use the new typemanager.MemberLookup
20420 (TypeContainer.MemberLookup): Implement using the
20421 TypeManager.MemberLookup now.
20423 * typemanager.cs: Make MemberLookup a function of the TypeManager,
20424 and return MemberInfos, so that these can be used without an
20425 EmitContext (what we had before).
20427 2002-04-24 Miguel de Icaza <miguel@ximian.com>
20429 * expression.cs: Fix the case where the argument to params if the
20430 type of the params. I omitted handling this before. Fixed
20432 2002-04-22 Miguel de Icaza <miguel@ximian.com>
20434 * driver.cs: Call BootCorlib_PopulateCoreType
20436 * class.cs (Property.CheckBase): Check for properties only, not
20439 * interface.cs: Temporary hack: try/catch around the
20440 CustomAttributeBuilder, because I am getting an exception that I
20443 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
20444 types whose definitions are required to be there (attributes are
20445 defined before standard types).
20447 Compute definitions as we boot the various types, as they are used
20448 immediately (value_type class will need object_type, but if we do
20449 not initialize object_type, we will pass a null, which will let
20450 the runtime pick the System.Object from the existing corlib, which
20451 is not what we want).
20453 2002-04-22 Patrik Torstensson <totte@labs2.com>
20455 * cs-tokenizer.cs: fixed a number of trim() issues.
20457 2002-04-22 Ravi Pratap <ravi@ximian.com>
20459 * expression.cs (Argument.Type): Ensure that we return the correct
20460 type when we have out or ref parameters [in which case we
20463 2002-04-22 Miguel de Icaza <miguel@ximian.com>
20465 * class.cs (Property, Indexer): Allow extern modifier in there.
20467 * typemanager.cs (InitBaseTypes): Initializes object_type and
20468 value_type, since those will be used early on during the bootstrap
20469 process to compile corlib.
20471 (InitCoreTypes): Move code from here to InitBaseTypes.
20473 2002-04-21 Miguel de Icaza <miguel@ximian.com>
20475 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
20476 single-dimension arrays as using the ldlen opcode.
20478 Daniel Lewis discovered this optimization.
20480 * typemanager.cs: Add signature for System.Array::get_Length
20482 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20484 * statement.cs: report the error when the foreach does not apply to an
20485 array nor a collection.
20487 2002-04-19 Miguel de Icaza <miguel@ximian.com>
20489 * expression.cs: Add implicit conversions to the operator ~.
20491 * constant.cs (DecimalConstant.Emit): Emit decimal value.
20493 * typemanager.cs: Locate the decimal constructor.
20495 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20497 * attribute.cs: use the new property of TypeOf.
20498 * expression.cs: added 'get' property around typearg.
20500 These changes fix a build breaker reported by NickD. Is this the
20501 correct way to fix? If not, please, revert my changes and make it
20504 2002-04-17 Miguel de Icaza <miguel@ximian.com>
20506 * attribute.cs: Add support for typeof in attribute invocations.
20507 I am not sure that this is right though.
20509 2002-04-14 Duncan Mak <duncan@ximian.com>
20511 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
20512 Binary.Operator.Division case.
20514 2002-04-13 Ravi Pratap <ravi@ximian.com>
20516 * class.cs (DefineType): Ensure that we do a proper check on
20517 attribute types and also register it with the TypeManager.
20519 (TypeContainer.Targets): The default for attribute types is
20520 AttributeTargets.All.
20522 * attribute.cs (ApplyAttributes): Registering the attribute type
20523 is done elsewhere, not when we discover we have a Usage attribute.
20525 2002-04-12 Ravi Pratap <ravi@ximian.com>
20527 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
20528 and get rid of is_delegate parameter.
20530 * everywhere : update.
20532 2002-04-12 Ravi Pratap <ravi@ximian.com>
20534 * cs-parser.jay (compilation_unit): Revamp completely to use
20535 some new ideas that I got from Rhys' grammar to solve the problems
20536 with assembly level attributes.
20538 (outer_declaration): New grammar production.
20540 (attribute_sections): Add.
20542 (opt_attributes): Base on attribute_sections
20544 (namespace_declaration): Allow opt_attributes to tackle the case
20545 when we have assembly level attributes - we are clever in this
20548 * attribute.cs (ApplyAttributes): Do not worry about assembly
20549 attributes in the non-global context.
20551 * rootcontext.cs (AddGlobalAttributes): Go back to using this
20552 instead of SetGlobalAttributes.
20554 * class.cs, rootcontext.cs : Ensure we define and generate
20555 attribute types before anything else.
20557 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
20558 and flag the new error -20 for the case when the attribute type
20559 does not have valid targets specified. csc does not catch this.
20561 * ../errors/errors.txt : update for error # -20
20563 2002-04-11 Ravi Pratap <ravi@ximian.com>
20565 * support.cs (InternalParameters.ParameterModifier): Do some null
20566 checking and return sane values.
20568 * class.cs (Method.Define): If we are a PInvoke method, ensure
20569 that we are static and extern. Report error # 601
20571 * ../errors/cs0601.cs : Add test case for the above error.
20573 2002-04-07 Ravi Pratap <ravi@ximian.com>
20575 * rootcontext.cs (attribute_types): We need to keep type of
20576 all attribute types separately and emit code for them first.
20578 (RegisterAttribute) : Implement.
20580 * class.cs (DefineType): Check if the current Type is a custom
20581 attribute type and register it accordingly.
20583 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
20584 adding the first attribute twice and rename to
20586 (SetGlobalAttributes): this.
20588 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
20591 * attribute.cs (ApplyAttributes): Take an additional argument telling us
20592 if we are processing global arguments. Hmm, I am unsure of this.
20594 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20596 * expression.cs: added static array of strings to avoid calling
20597 Enum.ToString () for Operator in Binary. Significant recover of
20600 2002-04-10 Miguel de Icaza <miguel@ximian.com>
20602 * class.cs (FindMembers): Allow the Builders of the various
20603 members to be null. If they are skip them. This only happens
20604 during the PInvoke declaration.
20606 2002-04-09 Miguel de Icaza <miguel@ximian.com>
20608 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
20609 failure, so we do not keep going afterwards.
20611 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
20612 wanted to pass `false' as the `is_delegate' argument. If this is
20613 the case, why not use delegate_type == null to mean `is_delegate =
20614 false' and anything else as is_delegate = true.
20616 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
20618 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
20619 code for the section, not the beginning of the tests.
20621 2002-04-08 Miguel de Icaza <miguel@ximian.com>
20623 * cfold.cs: Handle operator + (Enum x, Underlying x)
20625 * expression.cs (Binary): same. Warn about errors where we have
20626 Enum/Enum in operator + as well.
20628 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
20631 - added support for switch(bool)
20632 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
20633 - add TableSwitchEmit() to handle table-based switch statements
20635 2002-04-05 Ravi Pratap <ravi@ximian.com>
20637 * expression.cs (Invocation.OverloadResolve): Factor out code which
20638 does parameter compatibility checking with arguments so that we can
20639 re-use the code even from Delegate.VerifyApplicability
20641 (VerifyArgumentsCompat): Move above code here.
20643 * delegate.cs (VerifyApplicability): Get rid of duplicate code
20644 and instead make a call to the above method.
20646 2002-03-31 Ravi Pratap <ravi@ximian.com>
20648 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
20649 We use it to keep track of classes which are attribute types.
20651 2002-04-02 Miguel de Icaza <miguel@ximian.com>
20653 * delegate.cs (Delegate.Define): Correctly define the types in the
20654 presence of fixed and array parameters.
20656 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
20659 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
20660 include NonPublic after the first iteration.
20662 * class.cs (Indexer.CheckBase): Only check if both parents are
20665 * cs-parser.jay (accessor_body): If empty, set to null.
20667 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
20668 same code path here to resolve constants names that we did have in
20669 MemberAccess.DoResolve. There is too much code duplicated here.
20671 2002-04-01 Miguel de Icaza <miguel@ximian.com>
20673 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
20675 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
20678 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
20679 tokens, numbers and strings.
20681 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
20684 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
20685 asyncronous parameters and the regular parameters.
20687 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
20688 specify the target directory.
20690 * expression.cs: (This.DoResolve): Simplify
20691 (As.Emit): Optimize, do not generate IsInst if the expression is
20692 always of the given type.
20694 (Is.DoResolve): Bug fix, we were reporting both always/never for
20697 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
20698 creating too many unnecessary arrays.
20700 2002-03-31 Miguel de Icaza <miguel@ximian.com>
20702 * class.cs (EmitFieldInitializer): Use Assign expression to assign
20703 fields instead of rolling our own initializer. Takes care of all
20704 implicit conversions, and drops unnecessary static checks/argument.
20706 2002-03-31 Dick Porter <dick@ximian.com>
20708 * driver.cs: use the GetDirectories() return values properly, and
20709 use "/" as path separator.
20711 2002-03-30 Miguel de Icaza <miguel@ximian.com>
20713 * expression.cs (Unary): Optimize - - expr into expr.
20714 (Binary): Optimize a + (-b) into a -b.
20716 * codegen.cs (CodeGen): Made all methods static.
20718 2002-03-29 Miguel de Icaza <miguel@ximian.com>
20722 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
20723 TypeBuilder property.
20725 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
20728 * tree.cs: Removed the various RecordXXXX, and replaced with a
20729 single RecordDecl. Removed all the accessor methods, and just
20730 left a single access point Type
20732 * enum.cs: Rename DefineEnum to DefineType.
20734 * decl.cs: New abstract method `DefineType' used to unify the
20735 Defines for Enumerations, Interfaces, TypeContainers and
20738 (FindType): Moved LookupInterfaceOrClass here. Moved the
20739 LookupBaseClasses method that used to live in class.cs and
20740 interface.cs here, and renamed to FindType.
20742 * delegate.cs: Implement DefineType. Take advantage of the
20743 refactored pattern for locating the parent builder without taking
20744 the parent_builder argument (which we know does not work if we are
20745 nested, and triggering a toplevel definition).
20747 2002-03-28 Miguel de Icaza <miguel@ximian.com>
20749 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
20750 accessibility of a member has changed during override and report
20753 * class.cs (Method.Define, Property.Define): Only complain on
20754 overrides if the method is private, any other accessibility is
20755 fine (and since we just checked the permission is the same, we are
20758 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
20759 and elif are processed always. The other pre-processing
20760 directives are only processed if we are "taking" the path
20762 2002-03-29 Martin Baulig <martin@gnome.org>
20764 * class.cs (Method.Emit): Only emit symbolic debugging info if the
20765 current location is not Null.
20767 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
20768 a separate method so we can profile it.
20770 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
20771 `span.Seconds' are just seconds, but no minutes or hours.
20772 (MainDriver): Profile the CodeGen.SaveSymbols calls.
20774 2002-03-28 Miguel de Icaza <miguel@ximian.com>
20776 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
20777 Remove the gratuitous set of Final:
20779 // If an interface implementation, then we can set Final.
20780 if (((flags & MethodAttributes.Abstract) == 0) &&
20781 implementing.DeclaringType.IsInterface)
20782 flags |= MethodAttributes.Final;
20784 I do not know what I was smoking when I used that.
20787 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
20788 step into fixing the name resolution issues for delegates and
20789 unifying the toplevel name resolution.
20791 2002-03-28 Martin Baulig <martin@gnome.org>
20793 * class.cs (Method.Emit): If we have a symbol writer, call its
20794 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
20795 tell it about the current method.
20797 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
20798 writer that we're going to emit the first byte of IL code for a new
20799 statement (a new source line).
20800 (EmitContext.EmitTopBlock): If we have a symbol writer, call
20801 EmitContext.Mark() before emitting any code.
20803 * location.cs (SymbolDocument): Return null when we're Null.
20805 * statement.cs (Statement): Moved the `Location loc' variable here.
20806 (Statement.EmitBoolExpression): If we have a symbol writer, call
20807 ec.Mark() before emitting any code to tell it that we're at the
20808 beginning of a new statement.
20809 (StatementExpression): Added `Location' argument to the constructor.
20810 (Block): Added public readonly variable `StartLocation' and public
20811 variable `EndLocation'. The latter is to be set using SetEndLocation().
20812 (Block): Added constructor which takes a start and end location.
20813 (Block.SetEndLocation): New method. This sets the end location.
20814 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
20815 local variables we create.
20816 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
20817 each statement and do also mark the begin and end of the block.
20819 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
20820 tell it the current lexer.Location, use Location.Null for the end of the
20822 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
20823 current block, set its end location using SetEndLocation().
20824 (statement_expression): StatementExpression constructor now takes the
20825 lexer.Location as additional argument.
20826 (for_statement, declare_local_variables): Likewise.
20827 (declare_local_variables): When creating a new implicit block, use the
20828 new Block constructor and pass it the lexer.Location.
20830 2002-03-28 Miguel de Icaza <miguel@ximian.com>
20832 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
20833 members also on the parent interfaces recursively.
20835 2002-03-27 Miguel de Icaza <miguel@ximian.com>
20837 * report.cs: Use new formats, since Gonzalo finished the missing
20840 * expression.cs (Binary.ResolveOperator): added missing operator|
20841 operator& and operator^ for bool/bool.
20843 * cs-parser.jay: CheckDef now takes a Location argument that is
20844 used to report errors more precisly (instead of reporting the end
20845 of a definition, we try to track something which is a lot closer
20846 to the source of the problem).
20848 * cs-tokenizer.cs: Track global token use, so we can properly flag
20849 the use of #define/#undef after the first token has been seen.
20851 Also, rename the reportXXXX to Error_DescriptiveName
20853 * decl.cs (DeclSpace.IsTopLevel): Move property here from
20854 TypeContainer, so that Enum and Interface can use this too.
20856 * class.cs (TypeContainer.LookupInterfaceOrClass,
20857 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
20858 `builder' argument. Typically this was used to pass the parent
20859 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
20862 The problem is that a nested class could trigger the definition of
20863 a toplevel class, and the builder would be obviously wrong in that
20866 So we drop this argument, and we compute dynamically the
20867 TypeBuilder/ModuleBuilder (the correct information was available
20868 to us anyways from DeclSpace.Parent)
20870 * interface.cs (Interface.DefineInterface): Drop builder
20871 parameter cleanup like class.cs
20873 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
20876 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
20879 (Try.Emit): Propagate the returns value from the statement.
20881 (Return.Emit): Even if we are leavning
20883 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
20885 * modifiers.cs: Fix the computation of MethodAttributes flags.
20887 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
20889 * driver.cs: allow compilation of files that start with '/'.
20890 Add a default case when checking the argument of --target.
20892 2002-03-25 Miguel de Icaza <miguel@ximian.com>
20894 * interface.cs: Implement the same search algorithm for types in
20895 the interface code.
20897 * delegate.cs: Do not allow multiple definition.
20899 * Recovered ChangeLog that got accidentally amputated
20901 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
20903 * rootcontext.cs: Load manually enum to allow core classes to
20904 contain enumerations.
20906 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
20907 Update to new static methods in TypeManager.
20909 * typemanager.cs (GetMethod, GetConstructor): Use our
20910 implementation of FindMembers to find the members, since during
20911 corlib compilation, the types are TypeBuilders and GetMethod and
20912 GetConstructor do not work.
20914 Make all methods in TypeManager static.
20916 (InitCodeHelpers): Split the functionality from
20917 the InitCodeTypes function.
20919 * driver.cs: Call InitCodeHelpers after we have populated the
20922 * cs-parser.jay (delegate_declaration): we did not used to compute
20923 the delegate name correctly for void delegates.
20925 2002-03-24 Miguel de Icaza <miguel@ximian.com>
20927 * rootcontext.cs (RootContext): Init the interface_resolve_order
20928 and type_container_resolve_order always.
20930 (ResolveCore, BootstrapCorlib_ResolveClass,
20931 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
20932 compiler when compiling with --nostdlib
20934 * class.cs (TypeContainer.DefineType): Check that our parent is
20935 not null. This test is most important when we are bootstraping
20938 * codegen.cs: Split out the symbol writing code.
20940 2002-03-25 Martin Baulig <martin@gnome.org>
20942 * driver.cs (-g): Made -g an alias for --debug.
20944 2002-03-24 Martin Baulig <martin@gnome.org>
20946 * codegen.cs (SymbolWriter): New public variable. Returns the
20947 current symbol writer.
20948 (CodeGen): Added `bool want_debugging_support' argument to the
20949 constructor. If true, tell the ModuleBuild that we want debugging
20950 support and ask it for the ISymbolWriter.
20951 (Save): If we have a symbol writer, call it's Close() method after
20952 saving the assembly.
20954 * driver.c (--debug): New command line argument to create a
20955 debugger information file.
20957 * location.cs (SymbolDocument): New public property. Returns an
20958 ISymbolDocumentWriter object for the current source file or null
20959 if we don't have a symbol writer.
20961 2002-03-21 Miguel de Icaza <miguel@ximian.com>
20963 * driver.cs (LoadAssembly): Correctly return when all the paths
20964 have been tried and not before.
20966 * statement.cs (Switch.Emit): return the actual coverage for this
20967 statement (returns/not-returns)
20969 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
20970 switch of the statement if we are the last switch section. That
20971 kills two problems: try/catch problems (we used to emit an empty
20972 nop at the end) and switch statements where all branches would
20975 2002-03-19 Miguel de Icaza <miguel@ximian.com>
20977 * driver.cs: Add default assemblies (the equivalent to the
20978 Microsoft CSC.RSP file)
20980 * cs-tokenizer.cs: When updating `cols and setting it to zero,
20981 also update tokens_seen and set it to false.
20983 * driver.cs: Implement --recurse for Mike.
20985 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
20986 correctly splitting out the paths.
20988 2002-03-18 Miguel de Icaza <miguel@ximian.com>
20990 * interface.cs (Interface.PopulateProperty): Instead of using
20991 `parent' as the declaration space for the set parameters, use
20994 * support.cs (InternalParameters): InternalParameters constructor
20995 takes a DeclSpace instead of a TypeContainer.
20997 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
20998 types are being initialized, load the address of it before calling
21001 (New): Provide a mechanism to disable the generation of local
21002 value type temporaries when the caller will be providing us with
21003 an address to store it.
21005 (ArrayCreation.EmitDynamicInitializers): Use it.
21007 2002-03-17 Miguel de Icaza <miguel@ximian.com>
21009 * expression.cs (Invocation.EmitArguments): Only probe for array
21010 property if there is more than one argument. Sorry about that.
21012 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
21013 empty param arrays.
21015 * class.cs (Method.LabelParameters): Fix incorrect code path that
21016 prevented the `ParamArrayAttribute' from being applied to the
21019 2002-03-16 Miguel de Icaza <miguel@ximian.com>
21021 * support.cs (ReflectionParameters): Correctly compute whether the
21022 last argument is a params array. Fixes the problem with
21025 * typemanager.cs: Make the assemblies array always be non-null
21026 (empty, but non-null)
21028 * tree.cs (RecordDecl): New function that abstracts the recording
21029 of names. This reports error 101, and provides a pointer to the
21030 previous declaration. Fixes a crash in the compiler.
21032 * cs-parser.jay (constructor_declaration): Update to new grammar,
21033 and provide a constructor_body that can be empty.
21035 2002-03-15 Miguel de Icaza <miguel@ximian.com>
21037 * driver.cs: Add support for --resources.
21039 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
21040 Make all types for the various array helper methods be integer.
21042 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
21043 CheckState to ConvCast.
21045 (ConvCast): Now it takes a `checked' state argument, to avoid
21046 depending on the emit context for the conversion, and just using
21047 the resolve time setting.
21049 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
21050 instead of Invocation.EmitArguments. We do not emit the original
21051 arguments, instead we emit those which have been converted to
21052 unsigned int expressions.
21054 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
21056 * codegen.cs: ditto.
21058 * expression.cs (LocalVariableReference): Drop the use of the
21059 Store function that depended on the variable index.
21061 * statement.cs (VariableInfo): Drop the `Idx' property from this
21062 class, as this is not taking into account the indexes for
21063 temporaries tat we generate during the execution, getting the
21066 * class.cs: First emit class initializers, then call the parent
21069 * expression.cs (Binary): Fix opcode emision.
21070 (UnaryMutator.EmitCode): Support checked code generation
21072 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
21073 matches for events for both the Static and Instance scans,
21074 pointing to the same element. Fix that.
21076 2002-03-14 Miguel de Icaza <miguel@ximian.com>
21078 * rootcontext.cs (ResolveTree): Always set the
21079 interface_resolve_order, because nested interfaces will be calling
21082 * class.cs (GetInterfaceOrClass): Track the same resolution
21083 process used by TypeManager.LookupType. This fixes the nested
21084 type lookups in class declarations (separate path from
21087 (TypeContainer.DefineType): Also define nested interfaces.
21088 (TypeContainer.RegisterOrder): New public function used to
21089 register the order in which child interfaces need to be closed.
21091 Nested interfaces need to be closed after their parents have been
21094 * interface.cs (InterfaceAttr): Put all the logic for computing
21095 the interface attribute here.
21097 (DefineInterface): Register our interface order with the
21098 RootContext or with the TypeContainer depending on the case.
21100 2002-03-12 Miguel de Icaza <miguel@ximian.com>
21102 * cs-parser.jay: rework foreach statement to work with the new
21103 changes to the policy on SimpleNames.
21105 * report.cs: support Stacktrace on warnings as well.
21107 * makefile: drop --unsafe and /unsafe from the compile.
21109 2002-03-13 Ravi Pratap <ravi@ximian.com>
21111 * ecore.cs (StandardConversionExists): Modify to take an Expression
21112 as the first parameter. Ensure we do null -> reference type conversion
21115 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
21116 temporary Expression objects.
21118 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
21120 * interface.cs: workaround bug in method overloading resolution
21121 (there is already a bugzilla bug for it).
21123 2002-03-12 Miguel de Icaza <miguel@ximian.com>
21125 We could also solve this problem by having a separate path for
21126 performing type lookups, instead of DoResolve, we could have a
21127 ResolveType entry point, and only participating pieces of the
21128 production (simplename, deref, array) would implement this.
21130 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
21131 signal SimpleName to only resolve type names and not attempt to
21132 resolve anything else.
21134 * expression.cs (Cast): Set the flag.
21136 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
21138 * class.cs: Only report 108 if there is no `new' modifier.
21140 * cs-parser.jay: rework foreach statement to work with the new
21141 changes to the policy on SimpleNames.
21143 * report.cs: support Stacktrace on warnings as well.
21145 * makefile: drop --unsafe and /unsafe from the compile.
21147 2002-03-11 Miguel de Icaza <miguel@ximian.com>
21149 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21150 lookups here, instead of doing that at parse time. This means
21151 that our grammar will not introduce `LocalVariableReferences' as
21152 expressions at this point. That solves the problem of code like
21156 static void Main ()
21160 This is only half the fix. The full fix requires parameters to
21161 also be handled in this way.
21163 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
21164 makes the use more obvious of the DeclSpace. The
21165 ec.TypeContainer.TypeBuilder is now only used to pull the
21166 TypeBuilder for it.
21168 My theory is that I can get rid of the TypeBuilder completely from
21169 the EmitContext, and have typecasts where it is used (from
21170 DeclSpace to where it matters).
21172 The only pending problem is that the code that implements Aliases
21173 is on TypeContainer, and probably should go in DeclSpace.
21175 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21176 lookups here, instead of doing that at parse time. This means
21177 that our grammar will not introduce `LocalVariableReferences' as
21178 expressions at this point. That solves the problem of code like
21182 static void Main ()
21186 This is only half the fix. The full fix requires parameters to
21187 also be handled in this way.
21189 * class.cs (Property.DefineMethod): When implementing an interface
21190 method, set newslot, when implementing an abstract method, do not
21191 set the flag (before we tried never setting it, or always setting
21192 it, which is the difference).
21193 (Indexer.DefineMethod): same.
21194 (Method.DefineMethod): same.
21196 * ecore.cs: Only set the status used flag if we get back a Field.
21198 * attribute.cs: Temporary hack, so Paolo can keep working.
21200 2002-03-08 Ravi Pratap <ravi@ximian.com>
21202 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
21203 the unmanaged type in the case we have a MarshalAs attribute.
21205 (Resolve): Handle the case when we are parsing the special MarshalAs
21206 attribute [we need to store the unmanaged type to use later]
21208 * typemanager.cs (marshal_as_attr_type): Built in type for the
21209 MarshalAs Attribute.
21211 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
21212 on parameters and accordingly set the marshalling info.
21214 2002-03-09 Miguel de Icaza <miguel@ximian.com>
21216 * class.cs: Optimizing slightly by removing redundant code after
21217 we switched to the `NoTypes' return value.
21218 (Property.DefineMethod): use NoTypes here too.
21220 This fixes the bug I introduced in my last batch of changes.
21222 2002-03-05 Ravi Pratap <ravi@ximian.com>
21224 * tree.cs (RecordEnum): Add. We now keep track of enums too.
21226 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
21227 Enums since those are types too.
21229 * cs-parser.jay (enum_declaration): Record enums as we parse them.
21231 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
21232 thanks to a call during the lookup process.
21234 2002-03-07 Miguel de Icaza <miguel@ximian.com>
21236 * statement.cs (Foreach): Lots of work to accomodate a particular
21237 kind of foreach statement that I had not kept in mind. It is
21238 possible to have foreachs on classes that provide a GetEnumerator
21239 method that return objects that implement the "pattern" for using
21240 a foreach, there is no need to support GetEnumerator
21243 This is needed to compile nant.
21245 * decl.cs: Only report 114 if the member is not `Finalize' and if
21246 the warning level is at least 2.
21248 * class.cs: Moved the compare function from Method to
21251 (MethodSignature.InheritableMemberSignatureCompare): Add new
21252 filter function that is used to extract inheritable methods from a
21255 (Method.Define): Use the new `inheritable_method_signature_filter'
21258 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
21261 2002-03-06 Miguel de Icaza <miguel@ximian.com>
21263 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
21265 * cs-parser.jay: Add opt_semicolon to the interface declaration.
21267 * expression.cs: Pass location information to
21268 ConvertImplicitStandard.
21270 * class.cs: Added debugging code to track return values from
21273 2002-03-05 Miguel de Icaza <miguel@ximian.com>
21275 * expression.cs (Is.DoResolve): If either side of the `is' is an
21276 interface, do not flag the warning.
21278 * ecore.cs (ImplicitReferenceConversion): We need a separate test
21281 * report.cs: Allow for --fatal to be used with --probe.
21283 * typemanager.cs (NoTypes): Move the definition for the empty Type
21286 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
21288 (TypeContainer.DefineProxy): New function used to proxy to parent
21289 implementations when implementing interfaces.
21290 (TypeContainer.ParentImplements): used to lookup if our parent
21291 implements a public function that is required by an interface.
21292 (TypeContainer.VerifyPendingMethods): Hook this up.
21294 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
21295 `modules' and `assemblies' arraylists into arrays. We only grow
21296 these are the very early start up of the program, so this improves
21297 the speedof LookupType (nicely measured).
21299 * expression.cs (MakeByteBlob): Replaced unsafe code with
21300 BitConverter, as suggested by Paolo.
21302 * cfold.cs (ConstantFold.Binary): Special case: perform constant
21303 folding of string concatenation, but if either side is a string,
21304 and the other is not, then return null, and let the runtime use
21305 the concatenation on the string plus the object (using
21306 `Object.ToString').
21308 2002-03-04 Miguel de Icaza <miguel@ximian.com>
21310 Constant Folding has been implemented now.
21312 * expression.cs (Unary.Reduce): Do not throw an exception, catch
21313 the error instead on types that are not supported in one's
21316 * constant.cs (Constant and all children): New set of functions to
21317 perform implict and explicit conversions.
21319 * ecore.cs (EnumConstant): Implement the new functions to perform
21320 conversion by proxying to the child expression.
21322 * codegen.cs: (ConstantCheckState): Constant evaluation has its
21323 own separate setting that can not be turned off from the command
21324 line using --unchecked or --checked and is only controlled using
21325 the checked/unchecked statements and expressions. This setting is
21326 used by the constant folder to flag errors.
21328 * expression.cs (CheckedExpr, UncheckedExpr): Set the
21329 ConstantCheckState as well.
21331 During Resolve, they also have to flag the state, because the
21332 constant folder runs completely in the Resolve phase.
21334 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
21337 2002-03-01 Miguel de Icaza <miguel@ximian.com>
21339 * cfold.cs: New file, this file contains the constant folder.
21341 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
21342 argument to track whether we are using the resulting address to
21343 load or store a value and provide better error messages.
21345 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
21346 new AddressOf arguments.
21348 * statement.cs (Foreach.EmitCollectionForeach): Update
21350 * expression.cs (Argument.Emit): Call AddressOf with proper
21351 arguments to track usage.
21353 (New.DoEmit): Call AddressOf with new arguments.
21355 (Unary.Emit): Adjust AddressOf call.
21357 2002-03-01 Ravi Pratap <ravi@ximian.com>
21359 * cs-parser.jay (member_access): Change the case for pre-defined types
21360 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
21363 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
21366 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
21367 essentially like methods and apply attributes like MethodImplOptions to them too.
21369 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
21372 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
21373 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
21376 * Update code everywhere accordingly.
21378 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
21380 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
21382 2002-02-28 Ravi Pratap <ravi@ximian.com>
21384 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
21385 try performing lookups against those instead of jumping straight into using
21386 the 'using' clauses.
21388 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
21390 (LookupType): Perform lookups in implicit parents too.
21392 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
21393 sequence as RootContext.LookupType.
21395 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
21396 the various cases of namespace lookups into this method.
21398 2002-03-01 Miguel de Icaza <miguel@ximian.com>
21400 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
21401 in positional arguments)
21403 * class.cs (Operator): Update the AllowedModifiers to contain
21406 * cs-parser.jay: Update operator declaration to allow for the
21407 operator body to be empty.
21409 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
21412 2002-02-27 Miguel de Icaza <miguel@ximian.com>
21414 * class.cs (Method.Emit): Label parameters.
21416 * driver.cs: Return 1 or 0 as the program exit code.
21418 2002-02-26 Miguel de Icaza <miguel@ximian.com>
21420 * expression.cs: Special case the `null' object when trying to
21421 auto-compute the type, as anything can be explicitly converted to
21424 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
21425 spotting this Paolo.
21427 (Expression.ImplicitNumericConversion): Perform comparissions of
21428 the type using the underlying type in the case of an enumeration
21429 rather than using the enumeration type for the compare.
21431 Cope with the underlying == type case, which is not possible to
21434 (Expression.ConvertNumericExplicit): Perform comparissions of
21435 the type using the underlying type in the case of an enumeration
21436 rather than using the enumeration type for the compare.
21438 * driver.cs: If the user does not supply an extension, assume .exe
21440 * cs-parser.jay (if_statement): Rewrote so that we can track the
21441 location for the if statement.
21443 * expression.cs (Binary.ConstantFold): Only concat strings when
21444 the operation is "+", not everything ;-)
21446 * statement.cs (Statement.EmitBoolExpression): Take a location
21448 (If, While, Do): Track location.
21450 * expression.cs (Binary.ResolveOperator): In the object + string
21451 case, I was missing a call to ConvertImplicit
21453 2002-02-25 Ravi Pratap <ravi@ximian.com>
21455 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
21456 Location arguments. Ensure we use RootContext.LookupType to do our work
21457 and not try to do a direct Type.GetType and ModuleBuilder.GetType
21459 * interface.cs (PopulateMethod): Handle the type of the parameter being
21462 * expression.cs (Invocation.BetterFunction): Handle the case when we
21463 have a params method with no fixed arguments and a call is made with no
21466 2002-02-25 Miguel de Icaza <miguel@ximian.com>
21468 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
21469 the verbatim-string-literal
21471 * support.cs (InternalParameters.ParameterModifier): handle null
21473 (InternalParameters.ParameterType): ditto.
21475 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
21476 duplicating the name of the variable parameter.
21477 (GetParameterByName): Fix bug where we were not looking up array
21478 paramters if they were the only present (thanks Paolo!).
21479 (GetParameterInfo): We only have an empty set of types if both
21480 fixed and array are set to null.
21481 (GetParameterInfo-idx): Handle FixedParameter == null
21483 * cs-parser.jay: Handle the case where there is no catch
21484 statements (missing null test).
21486 2002-02-22 Miguel de Icaza <miguel@ximian.com>
21488 * driver.cs (MainDriver): Be conservative on our command line
21491 Catch DirectoryNotFoundException when calling GetFiles.
21493 (SplitPathAndPattern): Used to split the input specification into
21494 a path and a pattern that we can feed to Directory.GetFiles.
21496 2002-02-21 Miguel de Icaza <miguel@ximian.com>
21498 * statement.cs (Fixed): Implement the last case of the Fixed
21499 statement (string handling).
21501 * expression.cs (StringPtr): New class used to return a char * to
21502 a string; Used by the Fixed statement.
21504 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
21506 * expression.cs (Binary.ResolveOperator): Remove redundant
21507 MemberLookup pn parent type.
21508 Optimize union call, we do not need a union if the types are the same.
21509 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
21512 Specialize the use of MemberLookup everywhere, instead of using
21513 the default settings.
21515 (StackAlloc): Implement stackalloc keyword.
21517 * cs-parser.jay: Add rule to parse stackalloc.
21519 * driver.cs: Handle /h, /help, /?
21521 * expression.cs (MakeByteBlob): Removed the hacks we had in place
21522 before we supported unsafe code.
21524 * makefile: add --unsafe to the self compilation of mcs.
21526 2002-02-20 Miguel de Icaza <miguel@ximian.com>
21528 * expression.cs (PointerArithmetic): New class that is used to
21529 perform pointer arithmetic.
21530 (Binary.Resolve): Handle pointer arithmetic
21531 Handle pointer comparission.
21532 (ArrayPtr): Utility expression class that is used to take the
21533 address of an array.
21535 (ElementAccess): Implement array access for pointers
21537 * statement.cs (Fixed): Implement fixed statement for arrays, we
21538 are missing one more case before we are done.
21540 * expression.cs (Indirection): Implement EmitAssign and set the
21541 ExprClass to Variable. This allows pointer dereferences to be
21542 treated as variables, and to have values assigned to them.
21544 * ecore.cs (Expression.StoreFromPtr): New utility function to
21545 store values dereferencing.
21547 2002-02-20 Ravi Pratap <ravi@ximian.com>
21549 * expression.cs (Binary.ResolveOperator): Ensure that we are
21550 not trying to operate on a void type - this fixes the reported
21553 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
21554 the parent implementation is sealed.
21556 * ../errors/cs0239.cs : Add.
21558 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
21560 * typemanager.cs (unverifiable_code_type): Corresponds to
21561 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
21562 which have unsafe code in them.
21564 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
21567 2002-02-19 Miguel de Icaza <miguel@ximian.com>
21569 * cs-tokenizer.cs: Add support for @"litreal strings"
21571 Make tokenizer accept pre-processor directives
21572 on any column (remove the old C-like limitation).
21574 * rootcontext.cs (EmitCode): Emit any global attributes.
21575 (AddGlobalAttributes): Used to keep track of assembly attributes.
21577 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
21579 * cs-parser.jay: Add support for global attributes.
21581 2002-02-17 Miguel de Icaza <miguel@ximian.com>
21583 * expression.cs (Indirection): New helper class. Unary will
21584 create Indirection classes to be able to implement the
21585 IMemoryLocation interface on it.
21587 2002-02-16 Miguel de Icaza <miguel@ximian.com>
21589 * cs-parser.jay (fixed_statement): reference the right statement.
21591 * statement.cs (Fixed.Emit): Finish implementing the fixed
21592 statement for the &x case.
21594 2002-02-14 Miguel de Icaza <miguel@ximian.com>
21596 * class.cs (Property.Define, Method.Define): Remove newslot when
21599 * modifiers.cs: My use of NewSlot when `Abstract' was set was
21600 wrong. NewSlot should only be used if the `new' keyword is present.
21602 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
21603 locating our system dir. Sorry about this.
21605 2002-02-13 Miguel de Icaza <miguel@ximian.com>
21607 * driver.cs (GetSystemDir): Compute correctly the location of our
21608 system assemblies. I was using the compiler directory instead of
21609 the library directory.
21611 2002-02-13 Ravi Pratap <ravi@ximian.com>
21613 * expression.cs (BetterFunction): Put back in what Miguel commented out
21614 since it is the correct fix. The problem is elsewhere ;-)
21616 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
21617 parameters of the parms method are themselves compatible or not !
21619 (StandardConversionExists): Fix very dangerous bug where we were forgetting
21620 to check that a class implements an interface before saying that an implicit
21621 conversion was allowed. Use ImplementsInterface to do the checking.
21623 2002-02-13 Miguel de Icaza <miguel@ximian.com>
21625 * class.cs (Method.Define): Track whether we are an explicit
21626 implementation or not. And only call DefineMethodOverride if we
21627 are an explicit implementation.
21629 (Property.DefineMethod): Ditto.
21631 2002-02-11 Ravi Pratap <ravi@ximian.com>
21633 * expression.cs (BetterFunction): Catch hideous bug which was
21634 preventing us from detecting ambiguous calls due to implicit casts i.e
21637 2002-01-29 Miguel de Icaza <miguel@ximian.com>
21639 * support.cs (Pair): Remove un-needed method. I figured why I was
21640 getting the error in cs-parser.jay, the variable in a foreach loop
21641 is readonly, and the compiler does not really treat this as a variable.
21643 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
21644 instead of EQUALS in grammar.
21646 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
21648 * expression.cs (Unary.DoResolve): Check whether the argument is
21651 2002-01-28 Miguel de Icaza <miguel@ximian.com>
21653 * support.cs: Api for Pair to set a value. Despite the fact that
21654 the variables are public the MS C# compiler refuses to compile
21655 code that accesses the field if the variable is part of a foreach
21658 * statement.cs (Fixed): Begin implementation of the fixed
21661 (Block.AddVariable): Return the VariableInfo on success and null
21662 on failure instead of true/false.
21664 * cs-parser.jay (foreach): Catch errors on variables already
21665 defined (we were ignoring this value before) and properly unwind
21666 the block hierarchy
21668 (fixed_statement): grammar for the fixed statement.
21670 2002-01-25 Miguel de Icaza <miguel@ximian.com>
21672 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
21673 pointer types to be incretemented.
21675 (SizeOf): Implement.
21677 * cs-parser.jay (pointer_member_access): Implement
21678 expr->IDENTIFIER production.
21680 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
21681 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
21684 (Unary): Implement indirection.
21686 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
21687 use in non-unsafe context).
21689 (SimpleName.DoResolve): Check for pointers in field access on safe
21692 (Expression.LoadFromPtr): Factor the load-indirect code in this
21693 function. This was duplicated in UnboxCast and ParameterReference
21695 2002-01-24 Miguel de Icaza <miguel@ximian.com>
21697 * expression.cs (ComposedCast): report an error if a pointer cast
21698 is used in a safe region.
21700 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
21701 pointer type casts in unsafe context.
21703 * codegen.cs (EmitContext): Set up IsUnsafe.
21705 * cs-parser.jay (non_expression_type): Add productions for pointer
21708 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
21709 code. We should not use force into static mode if the method is
21710 not virtual. Fixes bug in MIS
21712 * statement.cs (Do.Emit, While.Emit, For.Emit,
21713 Statement.EmitBoolExpression): Add support to Do and While to
21714 propagate infinite loop as `I do return' semantics.
21716 Improve the For case to also test for boolean constants.
21718 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
21719 to the list of attributes we can add.
21721 Remove `EmitContext' argument.
21723 * class.cs (Method.Define): Apply parameter attributes.
21724 (Constructor.Define): Apply parameter attributes.
21725 (MethodCore.LabelParameters): Move here the core of labeling
21728 * support.cs (ReflectionParameters.ParameterModifier,
21729 InternalParameters.ParameterModifier): Use IsByRef on the type and
21730 only return the OUT bit for these parameters instead of in/out/ref
21733 This is because I miss-understood things. The ParameterInfo.IsIn
21734 and IsOut represent whether the parameter has the [In] and [Out]
21737 2002-01-22 Miguel de Icaza <miguel@ximian.com>
21739 * ecore.cs (FieldExpr.Emit): Release temporaries.
21741 * assign.cs (LocalTemporary.Release): new function.
21743 * codegen.cs (EmitContext.GetTemporaryStorage,
21744 EmitContext.FreeTemporaryStorage): Rework the way we deal with
21745 temporary storage. Now we can "put back" localbuilders when we
21748 2002-01-21 Miguel de Icaza <miguel@ximian.com>
21750 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
21751 need to make a copy of the variable to generate verifiable code.
21753 2002-01-19 Miguel de Icaza <miguel@ximian.com>
21755 * driver.cs: Compute dynamically the system directory.
21757 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
21758 Slower, but more generally useful. Used by the abstract
21759 registering implementation.
21761 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
21762 the rules for the special rule on Type/instances. First check if
21763 we have the same name, and if so, try that special static path
21764 rather than the instance path.
21766 2002-01-18 Miguel de Icaza <miguel@ximian.com>
21768 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
21771 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
21772 Enum, ValueType, Delegate or Array for non-corlib compiles.
21774 * cs-tokenizer.cs: Catch long identifiers (645)
21776 * typemanager.cs (IndexerPropetyName): Ravi never tested this
21779 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
21780 fix, we were returning too early, so we were not registering
21781 pending methods from abstract classes.
21783 Do not register pending methods if the class is abstract.
21785 * expression.cs (Conditional.DoResolve): Report circular implicit
21786 conversions when we neecd to compute it for conditional
21789 (Is.DoResolve): If the expression is always of the provided type,
21790 flag warning 183. If the expression can not ever be of the
21791 provided type flag warning 184.
21793 * class.cs: Catch 169 as well.
21795 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
21798 2002-01-18 Nick Drochak <ndrochak@gol.com>
21800 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
21802 2002-01-17 Miguel de Icaza <miguel@ximian.com>
21804 * interface.cs: (PopulateMethod): Check for pointers being defined
21805 only if the unsafe context is active.
21806 (PopulateProperty): ditto.
21807 (PopulateIndexer): ditto.
21809 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
21810 specified. If pointers are present, make sure that they are
21811 present in an unsafe context.
21812 (Constructor, Constructor.Define): ditto.
21813 (Field, Field.Define): ditto.
21814 (Property, Property.Define): ditto.
21815 (Event, Event.Define): ditto.
21817 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
21818 hashtable if there are classes or structs defined.
21820 * expression.cs (LocalVariableReference.DoResolve): Simplify this
21821 code, as the constant resolution moved.
21823 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
21824 the metadata, so we can flag error 133.
21826 * decl.cs (MemberCore.UnsafeOK): New function to test that a
21827 pointer is being declared in an unsafe context.
21829 2002-01-16 Miguel de Icaza <miguel@ximian.com>
21831 * modifiers.cs (Modifiers.Check): Require a Location argument.
21832 Report error 227 for Unsafe use.
21834 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
21836 * statement.cs (For.Emit): If the test is null, then report that
21837 we do `return', as we wont reach anything afterwards.
21839 (Switch.SwitchGoverningType): Track the expression that matched
21842 * driver.cs: Allow negative numbers as an error code to flag.
21844 * cs-parser.jay: Handle 1551.
21846 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
21848 2002-01-15 Miguel de Icaza <miguel@ximian.com>
21850 * cs-parser.jay: Report 1518 (type declaration can only contain
21851 class, struct, interface, enum or delegate)
21853 (switch_label): Report 1523 (keywords `case' or `default' must
21856 (opt_switch_sections): Report 1522 (empty switch)
21858 * driver.cs: Report 1515 (response file specified multiple times)
21859 Report 1516 (Source file specified multiple times).
21861 * expression.cs (Argument.Resolve): Signal 1510
21863 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
21864 access not allowed in static code)
21866 2002-01-11 Ravi Pratap <ravi@ximian.com>
21868 * typemanager.cs (IsPointerType): Utility method which we are going
21871 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
21872 the object type, so we take care of that.
21874 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
21876 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
21877 added to non-params parameters :-)
21879 * typemanager.cs (CSharpName): Include 'void' type too.
21881 (void_ptr_type): Include in the set of core types.
21883 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
21886 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
21889 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
21890 completely forgotten about it.
21892 2002-01-10 Ravi Pratap <ravi@ximian.com>
21894 * cs-parser.jay (pointer_type): Add. This begins our implementation
21895 of parsing rules for unsafe code.
21897 (unsafe_statement): Implement.
21899 (embedded_statement): Modify to include the above.
21901 * statement.cs (Unsafe): Implement new class for unsafe blocks.
21903 * codegen.cs (EmitContext.InUnsafe): Add. This determines
21904 if the current context is an unsafe one.
21906 * cs-parser.jay (local_variable_pointer_type): Since local variable types
21907 are handled differently, we need separate rules for them.
21909 (local_variable_declaration): Update to use local_variable_pointer_type
21910 to allow variable declarations of unmanaged pointer types.
21912 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
21913 in unsafe contexts.
21915 * ../errors/cs0214.cs : Add.
21917 2002-01-16 Nick Drochak <ndrochak@gol.com>
21919 * makefile: remove 'response' file when cleaning.
21921 2002-01-15 Miguel de Icaza <miguel@ximian.com>
21923 * cs-parser.jay: Report 1524.
21925 2002-01-14 Miguel de Icaza <miguel@ximian.com>
21927 * typemanager.cs (RegisterMethod): drop checking if we have
21928 registered this from here
21930 2002-01-12 Miguel de Icaza <miguel@ximian.com>
21932 * class.cs (Method.EmitDestructor): Implement calling our base
21935 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
21936 value of InFinally.
21938 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
21939 this routine and will wrap the call in a try/catch block. Deal
21942 2002-01-11 Miguel de Icaza <miguel@ximian.com>
21944 * ecore.cs (Expression.MemberLookup): instead of taking a
21945 parameter `same_type' that was used to tell whether we could
21946 access private members we compute our containing type from the
21949 (FieldExpr): Added partial support for volatile fields. This does
21950 not work for volatile fields exposed from assemblies, as I can not
21951 figure out how to extract the modreq from it.
21953 Updated all the source files to use this.
21955 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
21956 because it is referenced by MemberLookup very often.
21958 2002-01-09 Ravi Pratap <ravi@ximian.com>
21960 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
21961 TypeBuilder.GetCustomAttributes to retrieve what we need.
21963 Get rid of redundant default_member_attr_type as this is the same as
21964 default_member_type which already exists.
21966 * interface.cs, attribute.cs : Update accordingly.
21968 2002-01-08 Miguel de Icaza <miguel@ximian.com>
21970 * typemanager.cs: Enable IndexerPropertyName again. It does not
21971 work for TYpeBuilders though. Ravi, can you please fix this?
21973 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
21975 * expression.cs (Argument.Emit): Handle the case of ref objects
21976 being passed to ref functions;
21978 (ParameterReference.EmitLoad): Loads the content of the pointer
21979 without dereferencing.
21981 2002-01-07 Miguel de Icaza <miguel@ximian.com>
21983 * cs-tokenizer.cs: Implemented the pre-processing expressions.
21985 2002-01-08 Ravi Pratap <ravi@ximian.com>
21987 * class.cs (Indexer.DefineMethod): Incorporate the interface
21988 type in the name of the method if we are doing explicit interface
21991 * expression.cs (ConversionExists): Remove as it is completely obsolete.
21993 (BetterConversion): Fix extremely trivial bug where we were referring to
21994 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
21997 * ../errors/bug16.cs : Add although we have fixed it.
21999 2002-01-07 Miguel de Icaza <miguel@ximian.com>
22001 * expression.cs (BaseIndexer): Begin implementation.
22003 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
22005 * cs-parser.jay (indexer_declarator): Use qualified_identifier
22006 production directly to remove a shift/reduce, and implement
22007 explicit interface implementation.
22009 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
22010 after a floating point suffix.
22012 * expression.cs (DoNumericPromotions): Improved the conversion for
22013 uint/uint. If we have a constant, we avoid doing a typecast to a
22016 * class.cs (Indexer): Implement explicit interface implementation
22019 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
22021 * class.cs: make the default instance constructor public and hidebysig.
22023 2001-01-03 Ravi Pratap <ravi@ximian.com>
22025 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
22026 so we can call it from elsewhere.
22028 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
22029 we emit it internally if the class has a defined indexer; otherwise the user
22030 emits it by decorating the class definition with the DefaultMemberAttribute.
22032 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
22033 attribute is not used on a type which defines an indexer.
22035 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
22036 character when we skip whitespace.
22038 * ../errors/cs0646.cs : Add.
22040 2002-01-03 Miguel de Icaza <miguel@ximian.com>
22042 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
22045 * makefile: Add practical target `mcs3.exe' which builds the third
22046 generation compiler.
22048 * expression.cs (New): Fix structures constructor calling.
22050 * class.cs (Property, Method, Indexer): Emit Final flag on the
22051 method if we are an interface implementation and we are not
22054 * ecore.cs (PropertyExpr): New public field `IsBase', tells
22055 whether this property is referencing a `base' method.
22057 * expression.cs (Invocation.EmitCall): take an extra argument:
22058 is_base, this is used to determine whether the `call' or
22059 `callvirt' opcode should be used.
22062 * delegate.cs: update EmitCall.
22064 * class.cs (Method.Define): Set NewSlot for the cases where we are
22065 not implementing an interface method.
22067 (Property.Define): ditto.
22069 2002-01-02 Miguel de Icaza <miguel@ximian.com>
22071 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
22072 'r'. Allows mcs to parse itself fully.
22074 2002-01-02 Ravi Pratap <ravi@ximian.com>
22076 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
22077 of the number of initializers that require the InitializeArray method.
22079 (CheckIndices): Store the Expression in all cases - not the plain value. Also
22080 update the above field where necessary.
22082 (MakeByteBlob): Update accordingly.
22084 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
22087 (EmitDynamicInitializers): Update in accordance with the new optimization.
22089 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
22090 same OpCode applies.
22092 * cs-parser.jay : Fix some glaring errors I introduced.
22094 2002-01-01 Ravi Pratap <ravi@ximian.com>
22096 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
22097 so that we can check for name clashes there too.
22099 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
22100 for interface indexers.
22102 * interfaces.cs (Define): Emit the default member attribute.
22104 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
22105 variable was being referred to while setting the value ;-)
22107 2002-01-01 Miguel de Icaza <miguel@ximian.com>
22109 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
22110 byte-by-byte information when we know the data is zero.
22112 Make the block always a multiple of 4, because
22113 DefineInitializedData has a bug.
22115 * assign.cs: Fix, we should assign from the temporary, not from
22118 * expression.cs (MakeByteBlob): Fix my incorrect code.
22120 2001-12-31 Miguel de Icaza <miguel@ximian.com>
22122 * typemanager.cs (EnumToUnderlying): This function is used to get
22123 the underlying type from an enumeration, because it does not
22126 * constant.cs: Use the I4_S form for values between -128 and 127.
22128 * statement.cs (Block.LookupLabel): Looks up a label.
22129 (Block): Drop support for labeled blocks.
22131 (LabeledStatement): New kind of statement that represents a label
22134 (Goto): Finally implement this bad boy.
22136 * cs-parser.jay: Update to reflect new mechanism to implement
22139 2001-12-30 Miguel de Icaza <miguel@ximian.com>
22141 * codegen.cs (EmitContext.This): a codegen property that keeps the
22142 a single instance of this instead of creating many different this
22145 * delegate.cs (Delegate.DoResolve): Update to use the property;
22147 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
22149 * expression.cs (BaseAccess.DoResolve): Ditto.
22151 2001-12-29 Ravi Pratap <ravi@ximian.com>
22153 * typemanager.cs (methodimpl_attr_type): Add to hold the type
22154 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
22156 (InitCoreTypes): Update accordingly.
22158 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
22159 so we can quickly store the state.
22161 (ApplyAttributes): Set the correct implementation flags
22162 for InternalCall methods.
22164 2001-12-29 Miguel de Icaza <miguel@ximian.com>
22166 * expression.cs (EmitCall): if a method is not virtual, then do
22167 not use callvirt on it.
22169 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
22170 user defined stuff) requires the use of stobj, which takes an
22171 address on the stack instead of an array and an index. So emit
22172 the Ldelema operation for it.
22174 (EmitStoreOpcode): Use stobj for valuetypes.
22176 (UnaryMutator.EmitCode): Use the right 1 value depending on
22177 whether we are dealing with int64/uint64, float or doubles.
22179 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
22180 constructors that I implemented last night.
22182 (Constructor.IsDefault): Fix to work properly for static
22185 * cs-parser.jay (CheckDef): report method signature errors.
22186 Update error number 103 to be 132.
22188 * decl.cs: New AdditionResult enumeration value: MethodExists.
22189 Although we do this check for methods later on in the semantic
22190 analysis, catching repeated default constructors is so easy that
22191 we catch these here.
22193 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
22196 (ParameterReference.EmitAssign, Emit): handle
22199 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
22200 (ArrayAccess.EmitStoreOpcode): ditto.
22202 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
22204 * expression.cs (MakeByteBlob): Complete all the missing types
22205 (uint, short, ushort, byte, sbyte)
22207 * class.cs: Only init instance field initializers on instance
22210 Rename `constructors' to instance_constructors.
22212 (TypeContainer.AddConstructor): Only add constructors to the list
22213 if it is not static.
22215 Make sure that we handle default_static_constructor independently
22216 everywhere where we handle instance_constructors
22218 2001-12-28 Miguel de Icaza <miguel@ximian.com>
22220 * class.cs: Do not lookup or create a base initializer for a
22221 static constructor.
22223 (ConstructorInitializer.Resolve): use the proper type to lookup
22226 * cs-parser.jay: Report error 1585 (modifiers between type and name).
22228 * enum.cs, interface.cs: Remove CloseType, this is taken care by
22231 * decl.cs: CloseType is now an virtual method, the default
22232 implementation just closes this type.
22234 2001-12-28 Ravi Pratap <ravi@ximian.com>
22236 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
22237 to PreserveSig by default. Also emit HideBySig on such methods.
22239 Basically, set the defaults to standard values.
22241 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
22242 argument, if candidate is better, it can't be worse than the best !
22244 (Invocation): Re-write bits to differentiate between methods being
22245 applicable in their expanded form and their normal form - for params
22248 Get rid of use_standard everywhere as only standard conversions are allowed
22249 in overload resolution.
22251 More spec conformance.
22253 2001-12-27 Miguel de Icaza <miguel@ximian.com>
22255 * driver.cs: Add --timestamp, to see where the compiler spends
22258 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
22259 `this' in static code.
22261 (SimpleName.DoResolve): Implement in terms of a helper function
22262 that allows static-references to be passed upstream to
22265 (Expression.ResolveWithSimpleName): Resolve specially simple
22266 names when called by MemberAccess to implement the special
22269 (Expression.ImplicitReferenceConversion): Handle conversions from
22270 Null to reference types before others, as Null's type is
22273 * expression.cs (Invocation.EmitCall): Handle the special case of
22274 calling methods declared on a reference type from a ValueType
22275 (Base classes System.Object and System.Enum)
22277 (MemberAccess.Resolve): Only perform lookups on Enumerations if
22278 the left hand side is a TypeExpr, not on every enumeration.
22280 (Binary.Resolve): If types are reference types, then do a cast to
22281 object on operators != and == of both arguments.
22283 * typemanager.cs (FindMembers): Extract instance and static
22284 members if requested.
22286 * interface.cs (PopulateProperty): Use void_type instead of null
22287 as the return type for the setter method.
22289 (PopulateIndexer): ditto.
22291 2001-12-27 Ravi Pratap <ravi@ximian.com>
22293 * support.cs (ReflectionParameters): Fix minor bug where we
22294 were examining the wrong parameter for the ParamArray attribute.
22296 Cope with requests for the type of the parameter at position
22297 greater than the params parameter's. We now return the element
22298 type of the params array as that makes more sense.
22300 * expression.cs (Invocation.IsParamsMethodApplicable): Update
22301 accordingly as we no longer have to extract the element type
22304 (Invocation.OverloadResolve): Update.
22306 2001-12-27 Miguel de Icaza <miguel@ximian.com>
22308 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
22309 against IEnumerator, test whether the return value is a descendant
22310 of the IEnumerator interface.
22312 * class.cs (Indexer.Define): Use an auxiliary method to implement
22313 the other bits of the method definition. Begin support for
22314 explicit interface implementation.
22316 (Property.DefineMethod): Use TypeManager.void_type instead of null
22317 for an empty return value.
22319 2001-12-26 Miguel de Icaza <miguel@ximian.com>
22321 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
22322 dealing with a FieldExpr which is composed of a FieldBuilder, in
22323 the code path we did extract the constant, but we should have
22324 obtained the underlying value to be able to cast it (otherwise we
22325 end up in an infinite loop, this is what Ravi was running into).
22327 (ArrayCreation.UpdateIndices): Arrays might be empty.
22329 (MemberAccess.ResolveMemberAccess): Add support for section
22330 14.5.4.1 that deals with the special case of E.I when E is a type
22331 and something else, that I can be a reference to a static member.
22333 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
22334 handle a particular array type to create byte blobs, it is just
22335 something we dont generate byteblobs for.
22337 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
22340 * location.cs (Push): remove the key from the hashtable that we
22341 are about to add. This happens for empty files.
22343 * driver.cs: Dispose files after we have parsed them.
22345 (tokenize): new function that only runs the tokenizer on its
22346 input, for speed testing.
22348 2001-12-26 Ravi Pratap <ravi@ximian.com>
22350 * class.cs (Event.Define): Define the private field only if there
22351 are no accessors defined.
22353 * expression.cs (ResolveMemberAccess): If there is no associated
22354 field with the event, that means we have an event defined with its
22355 own accessors and we should flag error cs0070 since transforming
22356 ourselves into a field is not valid in that case.
22358 * ecore.cs (SimpleName.DoResolve): Same as above.
22360 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
22361 and charset to sane values.
22363 2001-12-25 Ravi Pratap <ravi@ximian.com>
22365 * assign.cs (DoResolve): Perform check on events only if they
22366 are being accessed outside the declaring type.
22368 * cs-parser.jay (event_declarations): Update rules to correctly
22369 set the type of the implicit parameter etc.
22371 (add_accessor, remove_accessor): Set current local parameters.
22373 * expression.cs (Binary): For delegate addition and subtraction,
22374 cast the return value from the method into the appropriate delegate
22377 2001-12-24 Ravi Pratap <ravi@ximian.com>
22379 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
22380 of these as the workaround is unnecessary.
22382 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
22383 delegate data - none of that is needed at all.
22385 Re-write bits to extract the instance expression and the delegate method
22388 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
22391 * attribute.cs (ApplyAttributes): New method to take care of common tasks
22392 of attaching attributes instead of duplicating code everywhere.
22394 * everywhere : Update code to do attribute emission using the above method.
22396 2001-12-23 Miguel de Icaza <miguel@ximian.com>
22398 * expression.cs (IsParamsMethodApplicable): if there are not
22399 parameters, return immediately.
22401 * ecore.cs: The 0 literal can be implicity converted to an enum
22404 (SimpleName.DoResolve): First lookup the type, then lookup the
22407 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
22408 want to get its address. If the InstanceExpression is not
22409 addressable, store the result in a temporary variable, then get
22412 * codegen.cs: Only display 219 errors on warning level or above.
22414 * expression.cs (ArrayAccess): Make it implement the
22415 IMemoryLocation interface.
22417 (Binary.DoResolve): handle the operator == (object a, object b)
22418 and operator != (object a, object b) without incurring into a
22419 BoxedCast (because 5 != o should never be performed).
22421 Handle binary enumerator operators.
22423 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
22424 value type, otherwise use Ldelem_ref.
22426 Use precomputed names;
22428 (AddressOf): Implement address of
22430 * cs-parser.jay (labeled_statement): Fix recursive block
22431 addition by reworking the production.
22433 * expression.cs (New.DoEmit): New has a special case:
22435 If we are dealing with a ValueType, we have a few
22436 situations to deal with:
22438 * The target of New is a ValueType variable, that is
22439 easy, we just pass this as the variable reference
22441 * The target of New is being passed as an argument,
22442 to a boxing operation or a function that takes a
22445 In this case, we need to create a temporary variable
22446 that is the argument of New.
22449 2001-12-23 Ravi Pratap <ravi@ximian.com>
22451 * rootcontext.cs (LookupType): Check that current_type is not null before
22452 going about looking at nested types.
22454 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
22455 not implement the IAssignMethod interface any more.
22457 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
22458 where we tranform them into FieldExprs if they are being resolved from within
22459 the declaring type.
22461 * ecore.cs (SimpleName.DoResolve): Do the same here.
22463 * assign.cs (DoResolve, Emit): Clean up code considerably.
22465 * ../errors/bug10.cs : Add.
22467 * ../errors/cs0070.cs : Add.
22469 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
22471 * assign.cs : Get rid of EventIsLocal everywhere.
22473 2001-12-23 Miguel de Icaza <miguel@ximian.com>
22475 * ecore.cs (ConvertIntLiteral): finished the implementation.
22477 * statement.cs (SwitchLabel): Convert the value we are using as a
22478 key before looking up the table.
22480 2001-12-22 Miguel de Icaza <miguel@ximian.com>
22482 * codegen.cs (EmitTopBlock): Require a Location argument now.
22484 * cs-parser.jay (constructor_declarator): We need to setup
22485 current_local_parameters before we parse the
22486 opt_constructor_initializer, to allow the variables to be bound
22487 to the constructor arguments.
22489 * rootcontext.cs (LookupType): First lookup nested classes in our
22490 class and our parents before we go looking outside our class.
22492 * expression.cs (ConstantFold): Extract/debox the values at the
22495 * rootcontext.cs (EmitCode): Resolve the constants first before we
22496 resolve the types. This is not really needed, but it helps debugging.
22498 * statement.cs: report location.
22500 * cs-parser.jay: pass location to throw statement.
22502 * driver.cs: Small bug fix.
22504 * report.cs: Updated format to be 4-zero filled digits.
22506 2001-12-22 Ravi Pratap <ravi@ximian.com>
22508 * expression.cs (CheckIndices): Fix minor bug where the wrong
22509 variable was being referred to ;-)
22511 (DoEmit): Do not call EmitStaticInitializers when the
22512 underlying type is System.Object.
22514 2001-12-21 Ravi Pratap <ravi@ximian.com>
22516 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
22517 and do the usual workaround for SRE.
22519 * class.cs (MyEventBuilder.EventType): New member to get at the type
22520 of the event, quickly.
22522 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
22524 * assign.cs (Assign.DoResolve): Handle the case when the target
22525 is an EventExpr and perform the necessary checks.
22527 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
22530 (SimpleName.MemberStaticCheck): Include check for EventExpr.
22532 (EventExpr): Set the type in the constructor itself since we
22533 are meant to be born fully resolved.
22535 (EventExpr.Define): Revert code I wrote earlier.
22537 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
22538 instance expression is null. The instance expression is a This in that case
22539 or a null, depending on whether it is a static method or not.
22541 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
22542 refers to more than one method.
22544 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
22545 and accordingly flag errors.
22547 2001-12-21 Miguel de Icaza <miguel@ximian.com>
22549 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
22551 2001-12-22 Miguel de Icaza <miguel@ximian.com>
22553 * location.cs (ToString): Provide useful rutine.
22555 2001-12-21 Miguel de Icaza <miguel@ximian.com>
22557 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
22558 objects, return the actual integral boxed.
22560 * statement.cs (SwitchLabel): define an ILLabel for each
22563 (Switch.CheckSwitch): If the value is a Literal, extract
22564 the underlying literal.
22566 Also in the unused hashtable we had, add the SwitchLabel so we can
22567 quickly look this value up.
22569 * constant.cs: Implement a bunch of new constants. Rewrite
22570 Literal based on this. Made changes everywhere to adapt to this.
22572 * expression.cs (Expression.MakeByteBlob): Optimize routine by
22573 dereferencing array only once, and also copes with enumrations.
22575 bytes are two bytes wide, not one.
22577 (Cast): Perform constant conversions.
22579 * ecore.cs (TryImplicitIntConversion): Return literals instead of
22580 wrappers to the literals here.
22582 * expression.cs (DoNumericPromotions): long literals can converted
22583 to ulong implicity (this is taken care of elsewhere, but I was
22584 missing this spot).
22586 * ecore.cs (Expression.Literalize): Make the return type Literal,
22587 to improve type checking.
22589 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
22591 2001-12-20 Miguel de Icaza <miguel@ximian.com>
22593 * literal.cs: Revert code from ravi that checked the bounds. The
22594 bounds are sane by the definition of the type itself.
22596 * typemanager.cs: Fix implementation of ImplementsInterface. We
22597 need to actually look up in our parent hierarchy for interfaces
22600 * const.cs: Use the underlying type for enumerations
22602 * delegate.cs: Compute the basename for the delegate creation,
22603 that should fix the delegate test case, and restore the correct
22604 Type Lookup semantics in rootcontext
22606 * rootcontext.cs: Revert Ravi's last patch. The correct way of
22607 referencing a nested type with the Reflection API is using the "+"
22610 * cs-parser.jay: Do not require EOF token at the end.
22612 2001-12-20 Ravi Pratap <ravi@ximian.com>
22614 * rootcontext.cs (LookupType): Concatenate type names with
22615 a '.' instead of a '+' The test suite passes again.
22617 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
22618 field of the enumeration.
22620 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
22621 the case when the member is an EventExpr.
22623 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
22624 static has an associated instance expression.
22626 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
22628 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
22630 * class.cs (Event.Define): Register event and perform appropriate checks
22633 We define the Add and Remove methods even if the use provides none because
22634 in that case, we provide default implementations ourselves.
22636 Define a private field of the type of the event. This is done by the CSC compiler
22637 and we should be doing it too ;-)
22639 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
22640 More methods we use in code we generate.
22642 (multicast_delegate_type, delegate_type): Two separate types since the distinction
22645 (InitCoreTypes): Update accordingly for the above.
22647 * class.cs (Event.Emit): Generate code for default accessors that we provide
22649 (EmitDefaultMethod): Do the job in the above.
22651 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
22654 2001-12-20 Miguel de Icaza <miguel@ximian.com>
22656 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
22657 builders even if we were missing one.
22659 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
22660 pass the Basename as our class name instead of the Name. The
22661 basename will be correctly composed for us.
22663 * parameter.cs (Paramters): Now takes a Location argument.
22665 * decl.cs (DeclSpace.LookupType): Removed convenience function and
22666 make all the code call directly LookupType in RootContext and take
22667 this chance to pass the Location information everywhere.
22669 * Everywhere: pass Location information.
22671 2001-12-19 Miguel de Icaza <miguel@ximian.com>
22673 * class.cs (Constructor.Define): Updated way of detecting the
22674 length of the parameters.
22676 (TypeContainer.DefineType): Use basename as the type name for
22679 (TypeContainer.Define): Do not recursively define types here, as
22680 definition is taken care in order by the RootContext.
22682 * tree.cs: Keep track of namespaces in a per-file basis.
22684 * parameter.cs (Parameter.ComputeSignature): Update to use
22687 (Parameters.GetSignature): ditto.
22689 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
22690 instead of a TypeContainer.
22692 (Interface.SemanticAnalysis): Use `this' instead of our parent to
22693 resolve names. Because we need to be resolve in our context, not
22696 * driver.cs: Implement response files.
22698 * class.cs (TypeContainer.DefineType): If we are defined, do not
22699 redefine ourselves.
22701 (Event.Emit): Emit the code for add/remove handlers.
22702 (Event.Define): Save the MethodBuilders for add/remove.
22704 * typemanager.cs: Use pair here too.
22706 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
22707 DictionaryEntry requires the first argument to be non-null.
22709 (enum_declaration): Compute full name for registering the
22712 (delegate_declaration): Instead of using
22713 formal_parameter_list, use opt_formal_parameter_list as the list
22716 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
22717 (EventParsing): New property that controls whether `add' and
22718 `remove' are returned as tokens or identifiers (for events);
22720 2001-12-19 Ravi Pratap <ravi@ximian.com>
22722 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
22723 use MyEventBuilder only and let it wrap the real builder for us.
22725 (MyEventBuilder): Revamp constructor etc.
22727 Implement all operations that we perform on EventBuilder in precisely the same
22730 (FindMembers): Update to use the EventBuilder member.
22732 (Event.Emit): Update accordingly.
22734 2001-12-18 Ravi Pratap <ravi@ximian.com>
22736 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
22737 by calling the appropriate methods.
22739 (GetCustomAttributes): Make stubs as they cannot possibly do anything
22742 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
22744 2001-12-17 Ravi Pratap <ravi@ximian.com>
22746 * delegate.cs (Delegate.Populate): Check that the return type
22747 and various parameters types are indeed accessible.
22749 * class.cs (Constructor.Define): Same here.
22751 (Field.Define): Ditto.
22753 (Event.Define): Ditto.
22755 (Operator.Define): Check that the underlying Method defined itself
22756 correctly - so it's MethodBuilder should not be null.
22758 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
22759 expression happens to be null.
22761 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
22762 members but as of now we don't seem to be able to do anything really useful with it.
22764 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
22765 not the EventBuilder.
22767 2001-12-18 Miguel de Icaza <miguel@ximian.com>
22769 * cs-tokenizer.cs: Add support for defines.
22770 Add support for #if, #elif, #else, #endif
22772 (eval_var): evaluates a variable.
22773 (eval): stubbed for evaluating functions.
22775 * cs-parser.jay: Pass the defines information
22777 * driver.cs: Add --define command line option.
22779 * decl.cs: Move MemberCore here.
22781 Make it the base class for DeclSpace. This allows us to catch and
22782 report 108 and 109 for everything now.
22784 * class.cs (TypeContainer.Define): Extract all the members
22785 before populating and emit the warning 108 (new keyword required
22786 to override) instead of having each member implement this.
22788 (MemberCore.Define): New abstract method, we will be using this in
22789 the warning reporting engine in Populate.
22791 (Operator.Define): Adjust to new MemberCore protocol.
22793 * const.cs (Const): This does not derive from Expression, it is a
22794 temporary object we use to create fields, it is a MemberCore.
22796 * class.cs (Method.Define): Allow the entry point to be in a
22799 * driver.cs: Rewrite the argument handler to clean it up a bit.
22801 * rootcontext.cs: Made it just an auxiliary namespace feature by
22802 making everything static.
22804 * driver.cs: Adapt code to use RootContext type name instead of
22807 * delegate.cs: Remove RootContext argument.
22809 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
22812 * class.cs (Event.Define): The lookup can fail.
22814 * cs-tokenizer.cs: Begin implementation of pre-procesor.
22816 * expression.cs: Resolve the this instance before invoking the code.
22818 2001-12-17 Miguel de Icaza <miguel@ximian.com>
22820 * cs-parser.jay: Add a production in element_access that allows
22821 the thing to become a "type" reference. This way we can parse
22822 things like "(string [])" as a type.
22824 Note that this still does not handle the more complex rules of
22828 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
22830 * ecore.cs: (CopyNewMethods): new utility function used to
22831 assemble the list of methods from running FindMembers.
22833 (MemberLookup): Rework FindMembers so that
22835 2001-12-16 Miguel de Icaza <miguel@ximian.com>
22837 * class.cs (TypeContainer): Remove Delegates who fail to be
22840 * delegate.cs (Populate): Verify that we dont get null return
22841 values. TODO: Check for AsAccessible.
22843 * cs-parser.jay: Use basename to emit error 574 (destructor should
22844 have the same name as container class), not the full name.
22846 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
22847 possible representation.
22849 Also implements integer type suffixes U and L.
22851 2001-12-15 Miguel de Icaza <miguel@ximian.com>
22853 * expression.cs (ArrayCreation.DoResolve): We need to do the
22854 argument resolution *always*.
22856 * decl.cs: Make this hold the namespace. Hold the root context as
22858 (LookupType): Move here.
22860 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
22862 * location.cs (Row, Name): Fixed the code, it was always returning
22863 references to the first file.
22865 * interface.cs: Register properties defined through interfaces.
22867 * driver.cs: Add support for globbing on the command line
22869 * class.cs (Field): Make it derive from MemberCore as well.
22872 2001-12-15 Ravi Pratap <ravi@ximian.com>
22874 * class.cs (Event::Define): Check that the type of the event is a delegate
22875 type else flag error #66.
22877 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
22880 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
22881 values of EntryPoint, CharSet etc etc.
22883 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
22885 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
22886 be null and we should ignore this. I am not sure if this is really clean. Apparently,
22887 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
22888 which needs this to do its work.
22890 * ../errors/cs0066.cs : Add.
22892 2001-12-14 Miguel de Icaza <miguel@ximian.com>
22894 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
22897 * class.cs: (MethodSignature.MethodSignature): Removed hack that
22898 clears out the parameters field.
22899 (MemberSignatureCompare): Cleanup
22901 (MemberCore): New base class used to share code between MethodCore
22904 (RegisterRequiredImplementations) BindingFlags.Public requires
22905 either BindingFlags.Instace or Static. Use instance here.
22907 (Property): Refactored code to cope better with the full spec.
22909 * parameter.cs (GetParameterInfo): Return an empty array instead
22912 * class.cs (Property): Abstract or extern properties have no bodies.
22914 * parameter.cs (GetParameterInfo): return a zero-sized array.
22916 * class.cs (TypeContainer.MethodModifiersValid): Move all the
22917 method modifier validation to the typecontainer so we can reuse
22918 this on properties.
22920 (MethodCore.ParameterTypes): return an empty sized array of types.
22922 (Property.Define): Test property modifier validity.
22924 Add tests for sealed/override too.
22926 (Method.Emit): abstract or extern methods have no bodies.
22928 2001-12-14 Ravi Pratap <ravi@ximian.com>
22930 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
22933 (Method::Define, ::Emit): Modify accordingly.
22935 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
22937 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
22939 * makefile: Pass in /unsafe.
22941 2001-12-13 Miguel de Icaza <miguel@ximian.com>
22943 * class.cs (MakeKey): Kill routine.
22945 * class.cs (TypeContainer.Define): Correctly define explicit
22946 method implementations (they require the full interface name plus
22949 * typemanager.cs: Deply the PtrHashtable here and stop using the
22950 lame keys. Things work so much better.
22952 This of course broke everyone who depended on `RegisterMethod' to
22953 do the `test for existance' test. This has to be done elsewhere.
22955 * support.cs (PtrHashtable): A hashtable that avoid comparing with
22956 the object stupid Equals method (because, that like fails all over
22957 the place). We still do not use it.
22959 * class.cs (TypeContainer.SetRequiredInterface,
22960 TypeContainer.RequireMethods): Killed these two routines and moved
22961 all the functionality to RegisterRequiredImplementations.
22963 (TypeContainer.RegisterRequiredImplementations): This routine now
22964 registers all the implementations required in an array for the
22965 interfaces and abstract methods. We use an array of structures
22966 which can be computed ahead of time to reduce memory usage and we
22967 also assume that lookups are cheap as most classes will not
22968 implement too many interfaces.
22970 We also avoid creating too many MethodSignatures.
22972 (TypeContainer.IsInterfaceMethod): Update and optionally does not
22973 clear the "pending" bit if we find that there are problems with
22976 (TypeContainer.VerifyPendingMethods): Update to report errors of
22977 methods that look like implementations but are not.
22979 (TypeContainer.Define): Add support for explicit interface method
22982 2001-12-12 Miguel de Icaza <miguel@ximian.com>
22984 * typemanager.cs: Keep track of the parameters here instead of
22985 being a feature of the TypeContainer.
22987 * class.cs: Drop the registration of parameters here, as
22988 InterfaceMethods are also interface declarations.
22990 * delegate.cs: Register methods with the TypeManager not only with
22991 the TypeContainer. This code was buggy.
22993 * interface.cs: Full registation here.
22995 2001-12-11 Miguel de Icaza <miguel@ximian.com>
22997 * expression.cs: Remove reducer for binary expressions, it can not
23000 * const.cs: Put here the code that used to go into constant.cs
23002 * constant.cs: Put here the code for constants, this is a new base
23003 class for Literals.
23005 * literal.cs: Make Literal derive from Constant.
23007 2001-12-09 Miguel de Icaza <miguel@ximian.com>
23009 * statement.cs (Return.Emit): Report error 157 if the user
23010 attempts to return from a finally block.
23012 (Return.Emit): Instead of emitting a return, jump to the end of
23015 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
23016 LocalBuilder to store the result of the function. ReturnLabel is
23017 the target where we jump.
23020 2001-12-09 Radek Doulik <rodo@ximian.com>
23022 * cs-parser.jay: remember alias in current namespace
23024 * ecore.cs (SimpleName::DoResolve): use aliases for types or
23027 * class.cs (LookupAlias): lookup alias in my_namespace
23029 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
23031 (LookupAlias): lookup alias in this and if needed in parent
23034 2001-12-08 Miguel de Icaza <miguel@ximian.com>
23038 * rootcontext.cs: (ModuleBuilder) Made static, first step into
23039 making things static. I need this to avoid passing the
23040 TypeContainer when calling ParameterType.
23042 * support.cs (InternalParameters.ParameterType): Remove ugly hack
23043 that did string manipulation to compute the type and then call
23044 GetType. Use Parameter.ParameterType instead.
23046 * cs-tokenizer.cs: Consume the suffix for floating values.
23048 * expression.cs (ParameterReference): figure out whether this is a
23049 reference parameter or not. Kill an extra variable by computing
23050 the arg_idx during emission.
23052 * parameter.cs (Parameters.GetParameterInfo): New overloaded
23053 function that returns whether a parameter is an out/ref value or not.
23055 (Parameter.ParameterType): The type of the parameter (base,
23056 without ref/out applied).
23058 (Parameter.Resolve): Perform resolution here.
23059 (Parameter.ExternalType): The full type (with ref/out applied).
23061 * statement.cs (Using.Emit, Using.EmitExpression): Implement
23062 support for expressions on the using statement.
23064 2001-12-07 Miguel de Icaza <miguel@ximian.com>
23066 * statement.cs (Using.EmitLocalVariableDecls): Split the
23067 localvariable handling of the using statement.
23069 (Block.EmitMeta): Keep track of variable count across blocks. We
23070 were reusing slots on separate branches of blocks.
23072 (Try.Emit): Emit the general code block, we were not emitting it.
23074 Check the type of the declaration to be an IDisposable or
23075 something that can be implicity converted to it.
23077 Emit conversions if required.
23079 * ecore.cs (EmptyExpression): New utility class.
23080 (Expression.ImplicitConversionExists): New utility function.
23082 2001-12-06 Miguel de Icaza <miguel@ximian.com>
23084 * statement.cs (Using): Implement.
23086 * expression.cs (LocalVariableReference): Support read only variables.
23088 * statement.cs: Remove the explicit emit for the Leave opcode.
23089 (VariableInfo): Add a readonly field.
23091 2001-12-05 Miguel de Icaza <miguel@ximian.com>
23093 * ecore.cs (ConvCast): new class used to encapsulate the various
23094 explicit integer conversions that works in both checked and
23095 unchecked contexts.
23097 (Expression.ConvertNumericExplicit): Use new ConvCast class to
23098 properly generate the overflow opcodes.
23100 2001-12-04 Miguel de Icaza <miguel@ximian.com>
23102 * statement.cs: The correct type for the EmptyExpression is the
23103 element_type, not the variable type. Ravi pointed this out.
23105 2001-12-04 Ravi Pratap <ravi@ximian.com>
23107 * class.cs (Method::Define): Handle PInvoke methods specially
23108 by using DefinePInvokeMethod instead of the usual one.
23110 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
23111 above to do the task of extracting information and defining the method.
23113 2001-12-04 Ravi Pratap <ravi@ximian.com>
23115 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
23116 of the condition for string type.
23118 (Emit): Move that here.
23120 (ArrayCreation::CheckIndices): Keep string literals in their expression
23123 (EmitDynamicInitializers): Handle strings appropriately.
23125 2001-12-04 Miguel de Icaza <miguel@ximian.com>
23127 * codegen.cs (EmitContext): Replace multiple variables with a
23128 single pointer to the current Switch statement.
23130 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
23133 2001-12-03 Miguel de Icaza <miguel@ximian.com>
23137 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
23140 (Foreach.Emit): Foreach on arrays was not setting
23141 up the loop variables (for break/continue).
23143 (GotoCase): Semi-implented.
23145 2001-12-03 Ravi Pratap <ravi@ximian.com>
23147 * attribute.cs (CheckAttribute): Handle system attributes by using
23148 Attribute.GetAttributes to examine information we need.
23150 (GetValidPlaces): Same here.
23152 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
23154 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
23156 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
23158 (Method::Define): Set appropriate flags if we have a DllImport attribute.
23160 (Method::Emit): Handle the case when we are a PInvoke method.
23162 2001-12-03 Miguel de Icaza <miguel@ximian.com>
23164 * expression.cs: Use ResolveWithSimpleName on compound names.
23166 2001-12-02 Ravi Pratap <ravi@ximian.com>
23168 * constant.cs (EmitConstant): Make sure we resolve the associated expression
23169 before trying to reduce it.
23171 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
23173 * constant.cs (LookupConstantValue): Implement.
23175 (EmitConstant): Use the above in emitting the constant.
23177 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
23178 that are user-defined by doing a LookupConstantValue on them.
23180 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
23183 2001-11-29 Miguel de Icaza <miguel@ximian.com>
23185 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
23187 (BaseAccess.DoResolve): Implement.
23189 (MemberAccess.DoResolve): Split this routine into a
23190 ResolveMemberAccess routine that can be used independently
23192 2001-11-28 Miguel de Icaza <miguel@ximian.com>
23194 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
23195 As that share bits of the implementation. Is returns a boolean,
23196 while As returns the Type that is being probed.
23198 2001-12-01 Ravi Pratap <ravi@ximian.com>
23200 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
23201 instead of a Literal - much easier.
23203 (EnumInTransit): Remove - utterly useless :-)
23205 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
23207 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
23209 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
23210 chain when we have no associated expression.
23212 2001-11-30 Ravi Pratap <ravi@ximian.com>
23214 * constant.cs (Define): Use Location while reporting the errror.
23216 Also emit a warning when 'new' is used and there is no inherited
23219 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
23222 (LookupEnumValue): Implement to lookup an enum member's value and define it
23225 (Populate): Re-write accordingly to use the above routine.
23227 2001-11-27 Miguel de Icaza <miguel@ximian.com>
23229 * expression.cs (This): Fix prototype for DoResolveLValue to
23230 override the base class DoResolveLValue.
23232 * cs-parser.cs: Report errors cs574 and cs575 (destructor
23235 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
23236 (we need to load the address of the field here). This fixes
23239 (FieldExpr.DoResolveLValue): Call the DoResolve
23240 function to initialize the Instance expression.
23242 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
23243 correctly the GetEnumerator operation on a value type.
23245 * cs-parser.jay: Add more simple parsing error catches.
23247 * statement.cs (Switch): Add support for string switches.
23248 Handle null specially.
23250 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
23252 2001-11-28 Ravi Pratap <ravi@ximian.com>
23254 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
23256 (declare_local_constant): New helper function.
23258 * statement.cs (AddConstant): Keep a separate record of constants
23260 (IsConstant): Implement to determine if a variable is a constant.
23262 (GetConstantExpression): Implement.
23264 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
23266 * statement.cs (IsVariableDefined): Re-write.
23268 2001-11-27 Ravi Pratap <ravi@ximian.com>
23270 * class.cs (TypeContainer::FindMembers): Look for constants
23271 in the case when we are looking for MemberTypes.Field
23273 * expression.cs (MemberAccess::DoResolve): Check that in the
23274 case we are a FieldExpr and a Literal, we are not being accessed
23275 by an instance reference.
23277 * cs-parser.jay (local_constant_declaration): Implement.
23279 (declaration_statement): Implement for constant declarations.
23281 2001-11-26 Miguel de Icaza <miguel@ximian.com>
23283 * statement.cs (Switch): Catch double defaults.
23285 (Switch): More work on the switch() statement
23286 implementation. It works for integral values now, need to finish
23290 2001-11-24 Miguel de Icaza <miguel@ximian.com>
23292 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
23293 integer literals into other integer literals. To be used by
23296 2001-11-24 Ravi Pratap <ravi@ximian.com>
23298 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
23301 (EmitDynamicInitializers): Cope with the above since we extract data
23302 directly from ArrayData now.
23304 (ExpectInitializers): Keep track of whether initializers are mandatory
23307 (Bounds): Make it a hashtable to prevent the same dimension being
23308 recorded for every element in that dimension.
23310 (EmitDynamicInitializers): Fix bug which prevented the Set array method
23313 Also fix bug which was causing the indices to be emitted in the reverse
23316 2001-11-24 Miguel de Icaza <miguel@ximian.com>
23318 * expression.cs (ArrayCreation): Implement the bits that Ravi left
23319 unfinished. They do not work, because the underlying code is
23322 2001-11-22 Miguel de Icaza <miguel@ximian.com>
23324 * cs-parser.jay: Remove bogus fixme.
23326 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
23327 on Switch statement.
23329 2001-11-23 Ravi Pratap <ravi@ximian.com>
23331 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
23334 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
23335 parameter. Apparently, any expression is allowed.
23337 (ValidateInitializers): Update accordingly.
23339 (CheckIndices): Fix some tricky bugs thanks to recursion.
23341 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
23342 I was being completely brain-dead.
23344 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
23345 and re-write acordingly.
23347 (DelegateInvocation): Re-write accordingly.
23349 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
23351 (MakeByteBlob): Handle types more correctly.
23353 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
23354 initialization from expressions but it is incomplete because I am a complete
23357 2001-11-22 Miguel de Icaza <miguel@ximian.com>
23359 * statement.cs (If.Emit): Fix a bug that generated incorrect code
23360 on If. Basically, we have to return `true' (ie, we do return to
23361 our caller) only if both branches of the if return.
23363 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
23364 short-circuit operators, handle them as short circuit operators.
23366 (Cast.DoResolve): Resolve type.
23367 (Cast.Cast): Take an expression as the target type.
23369 * cs-parser.jay (cast_expression): Remove old hack that only
23370 allowed a limited set of types to be handled. Now we take a
23371 unary_expression and we resolve to a type during semantic
23374 Use the grammar productions from Rhys to handle casts (this is
23375 not complete like Rhys syntax yet, we fail to handle that corner
23376 case that C# has regarding (-x), but we will get there.
23378 2001-11-22 Ravi Pratap <ravi@ximian.com>
23380 * class.cs (EmitFieldInitializer): Take care of the case when we have a
23381 field which is an array type.
23383 * cs-parser.jay (declare_local_variables): Support array initialization too.
23385 * typemanager.cs (MakeKey): Implement.
23387 (everywhere): Use the above appropriately.
23389 * cs-parser.jay (for_statement): Update for array initialization while
23390 declaring variables.
23392 * ecore.cs : The error message was correct, it's the variable's names that
23393 were misleading ;-) Make the code more readable.
23395 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
23396 the correct type etc.
23398 (ConvertExplicit): Handle Enum types by examining the underlying type.
23400 2001-11-21 Ravi Pratap <ravi@ximian.com>
23402 * parameter.cs (GetCallingConvention): Always return
23403 CallingConventions.Standard for now.
23405 2001-11-22 Miguel de Icaza <miguel@ximian.com>
23407 * expression.cs (Binary.ResolveOperator): Update the values of `l'
23408 and `r' after calling DoNumericPromotions.
23410 * ecore.cs: Fix error message (the types were in the wrong order).
23412 * statement.cs (Foreach.ProbeCollectionType): Need to pass
23413 BindingFlags.Instance as well
23415 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
23416 implicit int literal conversion in an empty cast so that we
23417 propagate the right type upstream.
23419 (UnboxCast): new class used to unbox value types.
23420 (Expression.ConvertExplicit): Add explicit type conversions done
23423 (Expression.ImplicitNumericConversion): Oops, forgot to test for
23424 the target type before applying the implicit LongLiterals to ULong
23427 2001-11-21 Miguel de Icaza <miguel@ximian.com>
23429 * cs-parser.jay (for_statement): Reworked the way For works: now
23430 we declare manually any variables that are introduced in
23431 for_initializer to solve the problem of having out-of-band code
23432 emition (that is what got for broken).
23434 (declaration_statement): Perform the actual variable declaration
23435 that used to be done in local_variable_declaration here.
23437 (local_variable_declaration): Do not declare anything, just pass
23438 the information on a DictionaryEntry
23440 2001-11-20 Ravi Pratap <ravi@ximian.com>
23442 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
23443 re-write of the logic to now make it recursive.
23445 (UpdateIndices): Re-write accordingly.
23447 Store element data in a separate ArrayData list in the above methods.
23449 (MakeByteBlob): Implement to dump the array data into a byte array.
23451 2001-11-19 Ravi Pratap <ravi@ximian.com>
23453 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
23456 * constant.cs (Define): Implement.
23458 (EmitConstant): Re-write fully.
23460 Pass in location info.
23462 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
23465 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
23466 DictionaryEntry since we need location info too.
23468 (constant_declaration): Update accordingly.
23470 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
23471 code into another method : UpdateIndices.
23473 2001-11-18 Ravi Pratap <ravi@ximian.com>
23475 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
23476 some type checking etc.
23478 2001-11-17 Ravi Pratap <ravi@ximian.com>
23480 * expression.cs (ArrayCreation::ValidateInitializers): Implement
23481 bits to provide dimension info if the user skips doing that.
23483 Update second constructor to store the rank correctly.
23485 2001-11-16 Ravi Pratap <ravi@ximian.com>
23487 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
23488 and try to implement.
23490 * ../errors/cs0150.cs : Add.
23492 * ../errors/cs0178.cs : Add.
23494 2001-11-16 Miguel de Icaza <miguel@ximian.com>
23496 * statement.cs: Implement foreach on multi-dimensional arrays.
23498 * parameter.cs (Parameters.GetParameterByName): Also lookup the
23499 name of the params argument.
23501 * expression.cs: Use EmitStoreOpcode to get the right opcode while
23502 initializing the array.
23504 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
23505 we can use this elsewhere.
23507 * statement.cs: Finish implementation of foreach for single
23510 * cs-parser.jay: Use an out-of-band stack to pass information
23511 around, I wonder why I need this.
23513 foreach_block: Make the new foreach_block the current_block.
23515 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
23516 function used to return a static Parameters structure. Used for
23517 empty parameters, as those are created very frequently.
23519 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
23521 2001-11-15 Ravi Pratap <ravi@ximian.com>
23523 * interface.cs : Default modifier is private, not public. The
23524 make verify test passes again.
23526 2001-11-15 Ravi Pratap <ravi@ximian.com>
23528 * support.cs (ReflectionParameters): Fix logic to determine
23529 whether the last parameter is a params one. Test 9 passes again.
23531 * delegate.cs (Populate): Register the builders we define with
23532 RegisterParameterForBuilder. Test 19 passes again.
23534 * cs-parser.jay (property_declaration): Reference $6 instead
23535 of $$ to get at the location.
23537 (indexer_declaration): Similar stuff.
23539 (attribute): Ditto.
23541 * class.cs (Property): Register parameters for the Get and Set methods
23542 if they exist. Test 23 passes again.
23544 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
23545 call to EmitArguments as we are sure there aren't any params arguments.
23546 Test 32 passes again.
23548 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
23549 IndexOutOfRangeException.
23551 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
23552 Test 33 now passes again.
23554 2001-11-15 Miguel de Icaza <miguel@ximian.com>
23556 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
23557 broke a bunch of things. Will have to come up with a better way
23558 of tracking locations.
23560 * statement.cs: Implemented foreach for single dimension arrays.
23562 2001-11-09 Miguel de Icaza <miguel@ximian.com>
23564 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
23565 an error. This removes the lookup from the critical path.
23567 * cs-parser.jay: Removed use of temporary_loc, which is completely
23570 2001-11-14 Miguel de Icaza <miguel@ximian.com>
23572 * support.cs (ReflectionParameters.ParameterModifier): Report
23573 whether the argument is a PARAMS argument or not.
23575 * class.cs: Set the attribute `ParamArrayAttribute' on the
23576 parameter argument.
23578 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
23579 and cons_param_array_attribute (ConstructorInfo for
23580 ParamArrayAttribute).,
23582 * codegen.cs: Emit the return using the `Return' statement, that
23583 way we can report the error correctly for missing return values.
23585 * class.cs (Method.Emit): Clean up.
23587 * expression.cs (Argument.Resolve): Take another argument: the
23588 location where this argument is used. Notice that this is not
23589 part of the "Argument" class as to reduce the size of the
23590 structure (we know the approximate location anyways).
23592 Test if the argument is a variable-reference, if not, then
23593 complain with a 206.
23595 (Argument.Emit): Emit addresses of variables.
23597 (Argument.FullDesc): Simplify.
23599 (Invocation.DoResolve): Update for Argument.Resolve.
23601 (ElementAccess.DoResolve): ditto.
23603 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
23604 method should be virtual, as this method is always virtual.
23606 (NewDelegate.DoResolve): Update for Argument.Resolve.
23608 * class.cs (ConstructorInitializer.DoResolve): ditto.
23610 * attribute.cs (Attribute.Resolve): ditto.
23612 2001-11-13 Miguel de Icaza <miguel@ximian.com>
23614 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
23616 * expression.cs (ParameterReference): Drop IStackStorage and implement
23617 IAssignMethod instead.
23619 (LocalVariableReference): ditto.
23621 * ecore.cs (FieldExpr): Drop IStackStorage and implement
23622 IAssignMethod instead.
23624 2001-11-13 Miguel de Icaza <miguel@ximian.com>
23626 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
23627 enumerations that are used in heavily used structures derive from
23628 byte in a laughable and pathetic attempt to reduce memory usage.
23629 This is the kind of pre-optimzations that you should not do at
23630 home without adult supervision.
23632 * expression.cs (UnaryMutator): New class, used to handle ++ and
23633 -- separatedly from the other unary operators. Cleans up the
23634 code, and kills the ExpressionStatement dependency in Unary.
23636 (Unary): Removed `method' and `Arguments' from this class, making
23637 it smaller, and moving it all to SimpleCall, so I can reuse this
23638 code in other locations and avoid creating a lot of transient data
23639 strucutres when not required.
23641 * cs-parser.jay: Adjust for new changes.
23643 2001-11-11 Miguel de Icaza <miguel@ximian.com>
23645 * enum.cs (Enum.Populate): If there is a failure during
23648 * cs-parser.jay (opt_enum_base): we used to catch type errors
23649 here, but this is really incorrect. The type error should be
23650 catched during semantic analysis.
23652 2001-12-11 Ravi Pratap <ravi@ximian.com>
23654 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
23655 current_local_parameters as expected since I, in my stupidity, had forgotten
23658 * attribute.cs (GetValidPlaces): Fix stupid bug.
23660 * class.cs (Method::Emit): Perform check on applicability of attributes.
23662 (Constructor::Emit): Ditto.
23664 (Field::Emit): Ditto.
23666 (Field.Location): Store location information.
23668 (Property, Event, Indexer, Operator): Ditto.
23670 * cs-parser.jay (field_declaration): Pass in location for each field.
23672 * ../errors/cs0592.cs : Add.
23674 2001-11-12 Ravi Pratap <ravi@ximian.com>
23676 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
23678 (InitCoreTypes): Update accordingly.
23680 (RegisterAttrType, LookupAttr): Implement.
23682 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
23683 info about the same.
23685 (Resolve): Update to populate the above as necessary.
23687 (Error592): Helper.
23689 (GetValidPlaces): Helper to the above.
23691 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
23693 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
23695 2001-11-12 Ravi Pratap <ravi@ximian.com>
23697 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
23699 * ../errors/cs0617.cs : Add.
23701 2001-11-11 Ravi Pratap <ravi@ximian.com>
23703 * enum.cs (Emit): Rename to Populate to be more consistent with what
23704 we expect it to do and when exactly it is called.
23706 * class.cs, rootcontext.cs : Update accordingly.
23708 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
23709 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
23711 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
23713 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
23714 of a fieldinfo using the above, when dealing with a FieldBuilder.
23716 2001-11-10 Ravi Pratap <ravi@ximian.com>
23718 * ../errors/cs0031.cs : Add.
23720 * ../errors/cs1008.cs : Add.
23722 * ../errrors/cs0543.cs : Add.
23724 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
23727 (FindMembers): Implement.
23729 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
23730 enums and delegates too.
23732 (enum_types): Rename to builder_to_enum.
23734 (delegate_types): Rename to builder_to_delegate.
23736 * delegate.cs (FindMembers): Implement.
23738 2001-11-09 Ravi Pratap <ravi@ximian.com>
23740 * typemanager.cs (IsEnumType): Implement.
23742 * enum.cs (Emit): Re-write parts to account for the underlying type
23743 better and perform checking etc.
23745 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
23746 of the underlying type.
23748 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
23751 * enum.cs (error31): Helper to report error #31.
23753 * cs-parser.jay (enum_declaration): Store location of each member too.
23755 * enum.cs (member_to_location): New hashtable.
23757 (AddEnumMember): Update location hashtable.
23759 (Emit): Use the location of each member while reporting errors.
23761 2001-11-09 Miguel de Icaza <miguel@ximian.com>
23763 * cs-parser.jay: A for_initializer if is a
23764 local_variable_declaration really ammount to have an implicit
23765 block with the variable declaration and no initializer for for.
23767 * statement.cs (For.Emit): Cope with null initializers.
23769 This fixes the infinite loop on for initializers.
23771 2001-11-08 Miguel de Icaza <miguel@ximian.com>
23773 * enum.cs: More cleanup.
23775 * ecore.cs: Remove dead code.
23777 * class.cs (Property.Emit): More simplification.
23778 (Event.Emit): ditto.
23780 Reworked to have less levels of indentation.
23782 2001-11-08 Ravi Pratap <ravi@ximian.com>
23784 * class.cs (Property): Emit attributes.
23794 * enum.cs (Emit): Ditto.
23796 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
23799 * class.cs (Field, Event, etc.): Move attribute generation into the
23800 Emit method everywhere.
23802 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
23803 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
23804 as we had no way of defining nested enums !
23806 * rootcontext.cs : Adjust code accordingly.
23808 * typemanager.cs (AddEnumType): To keep track of enum types separately.
23810 2001-11-07 Ravi Pratap <ravi@ximian.com>
23812 * expression.cs (EvalConstantExpression): Move into ecore.cs
23814 * enum.cs (Enum): Rename some members and make them public and readonly
23815 according to our convention.
23817 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
23820 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
23822 (Enum::Emit): Write a simple version for now which doesn't try to compute
23823 expressions. I shall modify this to be more robust in just a while.
23825 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
23827 (TypeContainer::CloseType): Create the Enum types too.
23829 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
23831 * expression.cs (EvalConstantExpression): Get rid of completely.
23833 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
23834 user-defined values and other cases.
23836 (IsValidEnumLiteral): Helper function.
23838 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
23839 out there in the case we had a literal FieldExpr.
23841 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
23843 (Literalize): Revamp a bit to take two arguments.
23845 (EnumLiteral): New class which derives from Literal to wrap enum literals.
23847 2001-11-06 Ravi Pratap <ravi@ximian.com>
23849 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
23851 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
23853 (Resolve): Use the above to ensure we have proper initializers.
23855 2001-11-05 Ravi Pratap <ravi@ximian.com>
23857 * expression.cs (Expression::EvalConstantExpression): New method to
23858 evaluate constant expressions.
23860 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
23862 2001-11-07 Miguel de Icaza <miguel@ximian.com>
23864 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
23867 (Binary.ResolveOperator): Handle operator != (object a, object b)
23868 and operator == (object a, object b);
23870 (Binary.DoNumericPromotions): Indicate whether the numeric
23871 promotion was possible.
23873 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
23876 Made the ArrayAccess implement interface IAssignMethod instead of
23877 IStackStore as the order in which arguments are passed reflects
23880 * assign.cs: Instead of using expr.ExprClass to select the way of
23881 assinging, probe for the IStackStore/IAssignMethod interfaces.
23883 * typemanager.cs: Load InitializeArray definition.
23885 * rootcontext.cs (RootContext.MakeStaticData): Used to define
23886 static data that can be used to initialize arrays.
23888 2001-11-05 Miguel de Icaza <miguel@ximian.com>
23890 * expression.cs: Handle operator== and operator!= for booleans.
23892 (Conditioal.Reduce): Implement reducer for the ?: operator.
23894 (Conditional.Resolve): Implement dead code elimination.
23896 (Binary.Resolve): Catch string literals and return a new
23897 concatenated string.
23899 (Unary.Reduce): Implement reduction of unary expressions.
23901 * ecore.cs: Split out the expression core handling here.
23903 (Expression.Reduce): New method used to perform constant folding
23904 and CSE. This is needed to support constant-expressions.
23906 * statement.cs (Statement.EmitBoolExpression): Pass true and false
23907 targets, and optimize for !x.
23909 2001-11-04 Ravi Pratap <ravi@ximian.com>
23911 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
23912 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
23913 set custom atttributes.
23915 * literal.cs (Literal::GetValue): New abstract method to return the actual
23916 value of the literal, cast as an object.
23918 (*Literal): Implement GetValue method.
23920 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
23921 expressions to the arraylist but objects of type Argument.
23923 * class.cs (TypeContainer::Emit): Emit our attributes too.
23925 (Method::Emit, Constructor::Emit): Ditto.
23927 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
23928 to be ignoring earlier.
23930 2001-11-03 Ravi Pratap <ravi@ximian.com>
23932 * attribute.cs (AttributeSection::Define): Implement to do the business
23933 of constructing a CustomAttributeBuilder.
23935 (Attribute): New trivial class. Increases readability of code.
23937 * cs-parser.jay : Update accordingly.
23939 (positional_argument_list, named_argument_list, named_argument): New rules
23941 (attribute_arguments): Use the above so that we are more correct.
23943 2001-11-02 Ravi Pratap <ravi@ximian.com>
23945 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
23946 to perform all checks for a method with a params parameter.
23948 (Invocation::OverloadResolve): Update to use the above method and therefore
23949 cope correctly with params method invocations.
23951 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
23954 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
23955 constructors in our parent too because we can't afford to miss out on
23958 * attribute.cs (AttributeSection): New name for the class Attribute
23960 Other trivial changes to improve readability.
23962 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
23963 use the new class names.
23965 2001-11-01 Ravi Pratap <ravi@ximian.com>
23967 * class.cs (Method::Define): Complete definition for params types too
23969 (Indexer::Define): Ditto.
23971 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
23972 Cope everywhere with a request for info about the array parameter.
23974 2001-11-01 Ravi Pratap <ravi@ximian.com>
23976 * tree.cs (RecordNamespace): Fix up to check for the correct key.
23978 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
23979 local_variable_type to extract the string corresponding to the type.
23981 (local_variable_type): Fixup the action to use the new helper method.
23983 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
23986 * expression.cs : Clean out code which uses the above.
23988 2001-10-31 Ravi Pratap <ravi@ximian.com>
23990 * typemanager.cs (RegisterMethod): Check if we already have an existing key
23991 and bale out if necessary by returning a false.
23993 (RegisterProperty): Ditto.
23995 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
23996 and print out appropriate error messages.
23998 * interface.cs (everywhere): Ditto.
24000 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
24001 location to constructor.
24003 * class.cs (Property, Event, Indexer): Update accordingly.
24005 * ../errors/cs111.cs : Added.
24007 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
24008 of a method, as laid down by the spec.
24010 (Invocation::OverloadResolve): Use the above method.
24012 2001-10-31 Ravi Pratap <ravi@ximian.com>
24014 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
24015 now take a TypeContainer and a Parameters object.
24017 (ParameterData): Modify return type of ParameterModifier method to be
24018 Parameter.Modifier and not a string.
24020 (ReflectionParameters, InternalParameters): Update accordingly.
24022 * expression.cs (Argument::GetParameterModifier): Same here.
24024 * support.cs (InternalParameters::ParameterType): Find a better way of determining
24025 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
24026 symbol in it at all so maybe this is only for now.
24028 2001-10-30 Ravi Pratap <ravi@ximian.com>
24030 * support.cs (InternalParameters): Constructor now takes an extra argument
24031 which is the actual Parameters class.
24033 (ParameterDesc): Update to provide info on ref/out modifiers.
24035 * class.cs (everywhere): Update call to InternalParameters to pass in
24036 the second argument too.
24038 * support.cs (ParameterData): Add ParameterModifier, which is a method
24039 to return the modifier info [ref/out etc]
24041 (InternalParameters, ReflectionParameters): Implement the above.
24043 * expression.cs (Argument::ParameterModifier): Similar function to return
24044 info about the argument's modifiers.
24046 (Invocation::OverloadResolve): Update to take into account matching modifiers
24049 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
24050 a new SetFormalParameters object which we pass to InternalParameters.
24052 2001-10-30 Ravi Pratap <ravi@ximian.com>
24054 * expression.cs (NewArray): Merge into the ArrayCreation class.
24056 2001-10-29 Ravi Pratap <ravi@ximian.com>
24058 * expression.cs (NewArray): Merge classes NewBuiltinArray and
24059 NewUserdefinedArray into one as there wasn't much of a use in having
24062 * expression.cs (Argument): Change field's name to ArgType from Type.
24064 (Type): New readonly property which returns the proper type, taking into
24065 account ref/out modifiers.
24067 (everywhere): Adjust code accordingly for the above.
24069 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
24070 whether we are emitting for a ref or out parameter.
24072 * expression.cs (Argument::Emit): Use the above field to set the state.
24074 (LocalVariableReference::Emit): Update to honour the flag and emit the
24077 * parameter.cs (Attributes): Set the correct flags for ref parameters.
24079 * expression.cs (Argument::FullDesc): New function to provide a full desc.
24081 * support.cs (ParameterData): Add method ParameterDesc to the interface.
24083 (ReflectionParameters, InternalParameters): Implement the above method.
24085 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
24088 (Invocation::FullMethodDesc): Ditto.
24090 2001-10-29 Miguel de Icaza <miguel@ximian.com>
24092 * cs-parser.jay: Add extra production for the second form of array
24095 * expression.cs (ArrayCreation): Update to reflect the above
24098 * Small changes to prepare for Array initialization.
24100 2001-10-28 Miguel de Icaza <miguel@ximian.com>
24102 * typemanager.cs (ImplementsInterface): interface might be null;
24103 Deal with this problem;
24105 Also, we do store negative hits on the cache (null values), so use
24106 this instead of calling t.GetInterfaces on the type everytime.
24108 2001-10-28 Ravi Pratap <ravi@ximian.com>
24110 * typemanager.cs (IsBuiltinType): New method to help determine the same.
24112 * expression.cs (New::DoResolve): Get rid of array creation code and instead
24113 split functionality out into different classes.
24115 (New::FormArrayType): Move into NewBuiltinArray.
24117 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
24120 (NewBuiltinArray): New class to handle creation of built-in arrays.
24122 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
24123 account creation of one-dimensional arrays.
24125 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
24127 (NewUserdefinedArray::DoResolve): Implement.
24129 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
24131 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
24132 we maintain inside the TypeManager. This is necessary to perform lookups on the
24135 (LookupType): Update to perform GetType on the module builders too.
24137 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
24139 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
24141 2001-10-23 Ravi Pratap <ravi@ximian.com>
24143 * expression.cs (New::DoResolve): Implement guts of array creation.
24145 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
24147 2001-10-27 Miguel de Icaza <miguel@ximian.com>
24149 * expression.cs: Fix bug I introduced lsat night that broke
24152 (Expression.Resolve): Report a 246 error (can not resolve name)
24153 if we find a SimpleName in the stream.
24155 (Expression.ResolveLValue): Ditto.
24157 (Expression.ResolveWithSimpleName): This function is a variant of
24158 ResolveName, this one allows SimpleNames to be returned without a
24159 warning. The only consumer of SimpleNames is MemberAccess
24161 2001-10-26 Miguel de Icaza <miguel@ximian.com>
24163 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
24164 might arrive here. I have my doubts that this is correct.
24166 * statement.cs (Lock): Implement lock statement.
24168 * cs-parser.jay: Small fixes to support `lock' and `using'
24170 * cs-tokenizer.cs: Remove extra space
24172 * driver.cs: New flag --checked, allows to turn on integer math
24175 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
24176 Threading.Monitor.Exit
24178 2001-10-23 Miguel de Icaza <miguel@ximian.com>
24180 * expression.cs (IndexerAccess::DoResolveLValue): Set the
24181 Expression Class to be IndexerAccess.
24183 Notice that Indexer::DoResolve sets the eclass to Value.
24185 2001-10-22 Miguel de Icaza <miguel@ximian.com>
24187 * class.cs (TypeContainer::Emit): Emit code for indexers.
24189 * assign.cs (IAssignMethod): New interface implemented by Indexers
24190 and Properties for handling assignment.
24192 (Assign::Emit): Simplify and reuse code.
24194 * expression.cs (IndexerAccess, PropertyExpr): Implement
24195 IAssignMethod, clean up old code.
24197 2001-10-22 Ravi Pratap <ravi@ximian.com>
24199 * typemanager.cs (ImplementsInterface): New method to determine if a type
24200 implements a given interface. Provides a nice cache too.
24202 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
24205 (ConvertReferenceExplicit): Ditto.
24207 * delegate.cs (Delegate::Populate): Update to define the parameters on the
24208 various methods, with correct names etc.
24210 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
24211 Operator.UnaryNegation.
24213 * cs-parser.jay (operator_declarator): Be a little clever in the case where
24214 we have a unary plus or minus operator.
24216 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
24219 * everywhere : update accordingly.
24221 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
24224 * class.cs (Method::Define): For the case where we are implementing a method
24225 inherited from an interface, we need to set the MethodAttributes.Final flag too.
24226 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
24228 2001-10-21 Ravi Pratap <ravi@ximian.com>
24230 * interface.cs (FindMembers): Implement to work around S.R.E
24233 * typemanager.cs (IsInterfaceType): Implement.
24235 (FindMembers): Update to handle interface types too.
24237 * expression.cs (ImplicitReferenceConversion): Re-write bits which
24238 use IsAssignableFrom as that is not correct - it doesn't work.
24240 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
24241 and accordingly override EmitStatement.
24243 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
24244 using the correct logic :-)
24246 2001-10-19 Ravi Pratap <ravi@ximian.com>
24248 * ../errors/cs-11.cs : Add to demonstrate error -11
24250 2001-10-17 Miguel de Icaza <miguel@ximian.com>
24252 * assign.cs (Assign::Resolve): Resolve right hand side first, and
24253 then pass this as a hint to ResolveLValue.
24255 * expression.cs (FieldExpr): Add Location information
24257 (FieldExpr::LValueResolve): Report assignment to readonly
24260 (Expression::ExprClassFromMemberInfo): Pass location information.
24262 (Expression::ResolveLValue): Add new method that resolves an
24265 (Expression::DoResolveLValue): Default invocation calls
24268 (Indexers): New class used to keep track of indexers in a given
24271 (IStackStore): Renamed from LValue, as it did not really describe
24272 what this did. Also ResolveLValue is gone from this interface and
24273 now is part of Expression.
24275 (ElementAccess): Depending on the element access type
24277 * typemanager.cs: Add `indexer_name_type' as a Core type
24278 (System.Runtime.CompilerServices.IndexerNameAttribute)
24280 * statement.cs (Goto): Take a location.
24282 2001-10-18 Ravi Pratap <ravi@ximian.com>
24284 * delegate.cs (Delegate::VerifyDelegate): New method to verify
24285 if two delegates are compatible.
24287 (NewDelegate::DoResolve): Update to take care of the case when
24288 we instantiate a delegate from another delegate.
24290 * typemanager.cs (FindMembers): Don't even try to look up members
24291 of Delegate types for now.
24293 2001-10-18 Ravi Pratap <ravi@ximian.com>
24295 * delegate.cs (NewDelegate): New class to take care of delegate
24298 * expression.cs (New): Split the delegate related code out into
24299 the NewDelegate class.
24301 * delegate.cs (DelegateInvocation): New class to handle delegate
24304 * expression.cs (Invocation): Split out delegate related code into
24305 the DelegateInvocation class.
24307 2001-10-17 Ravi Pratap <ravi@ximian.com>
24309 * expression.cs (New::DoResolve): Implement delegate creation fully
24310 and according to the spec.
24312 (New::DoEmit): Update to handle delegates differently.
24314 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
24315 because of which we were printing out arguments in reverse order !
24317 * delegate.cs (VerifyMethod): Implement to check if the given method
24318 matches the delegate.
24320 (FullDelegateDesc): Implement.
24322 (VerifyApplicability): Implement.
24324 * expression.cs (Invocation::DoResolve): Update to accordingly handle
24325 delegate invocations too.
24327 (Invocation::Emit): Ditto.
24329 * ../errors/cs1593.cs : Added.
24331 * ../errors/cs1594.cs : Added.
24333 * delegate.cs (InstanceExpression, TargetMethod): New properties.
24335 2001-10-16 Ravi Pratap <ravi@ximian.com>
24337 * typemanager.cs (intptr_type): Core type for System.IntPtr
24339 (InitCoreTypes): Update for the same.
24341 (iasyncresult_type, asynccallback_type): Ditto.
24343 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
24346 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
24349 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
24350 the builders for the 4 members of a delegate type :-)
24352 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
24355 * expression.cs (New::DoResolve): Implement guts for delegate creation.
24357 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
24359 2001-10-15 Miguel de Icaza <miguel@ximian.com>
24361 * statement.cs (Break::Emit): Implement.
24362 (Continue::Emit): Implement.
24364 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
24365 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
24366 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
24367 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
24370 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
24371 properties that track the label for the current loop (begin of the
24372 loop and end of the loop).
24374 2001-10-15 Ravi Pratap <ravi@ximian.com>
24376 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
24377 use of emitting anything at all.
24379 * class.cs, rootcontext.cs : Get rid of calls to the same.
24381 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
24383 (Populate): Define the constructor correctly and set the implementation
24386 * typemanager.cs (delegate_types): New hashtable to hold delegates that
24389 (AddDelegateType): Implement.
24391 (IsDelegateType): Implement helper method.
24393 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
24395 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
24396 and accordingly handle it.
24398 * delegate.cs (Populate): Take TypeContainer argument.
24399 Implement bits to define the Invoke method. However, I still haven't figured out
24400 how to take care of the native int bit :-(
24402 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
24403 Qualify the name of the delegate, not its return type !
24405 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
24408 (StandardConversionExists): Checking for array types turns out to be recursive.
24410 (ConvertReferenceExplicit): Implement array conversion.
24412 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
24414 2001-10-12 Ravi Pratap <ravi@ximian.com>
24416 * cs-parser.jay (delegate_declaration): Store the fully qualified
24417 name as it is a type declaration.
24419 * delegate.cs (ReturnType, Name): Rename members to these. Make them
24422 (DefineDelegate): Renamed from Define. Does the same thing essentially,
24423 as TypeContainer::DefineType.
24425 (Populate): Method in which all the definition of the various methods (Invoke)
24428 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
24431 (CloseDelegate): Finally creates the delegate.
24433 * class.cs (TypeContainer::DefineType): Update to define delegates.
24434 (Populate, Emit and CloseType): Do the same thing here too.
24436 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
24437 delegates in all these operations.
24439 2001-10-14 Miguel de Icaza <miguel@ximian.com>
24441 * expression.cs: LocalTemporary: a new expression used to
24442 reference a temporary that has been created.
24444 * assign.cs: Handle PropertyAccess back here, so that we can
24445 provide the proper semantic access to properties.
24447 * expression.cs (Expression::ConvertReferenceExplicit): Implement
24448 a few more explicit conversions.
24450 * modifiers.cs: `NEW' modifier maps to HideBySig.
24452 * expression.cs (PropertyExpr): Make this into an
24453 ExpressionStatement, and support the EmitStatement code path.
24455 Perform get/set error checking, clean up the interface.
24457 * assign.cs: recognize PropertyExprs as targets, and if so, turn
24458 them into toplevel access objects.
24460 2001-10-12 Miguel de Icaza <miguel@ximian.com>
24462 * expression.cs: PropertyExpr::PropertyExpr: use work around the
24465 * typemanager.cs: Keep track here of our PropertyBuilders again to
24466 work around lameness in SRE.
24468 2001-10-11 Miguel de Icaza <miguel@ximian.com>
24470 * expression.cs (LValue::LValueResolve): New method in the
24471 interface, used to perform a second resolution pass for LValues.
24473 (This::DoResolve): Catch the use of this in static methods.
24475 (This::LValueResolve): Implement.
24477 (This::Store): Remove warning, assigning to `this' in structures
24480 (Invocation::Emit): Deal with invocation of
24481 methods on value types. We need to pass the address to structure
24482 methods rather than the object itself. (The equivalent code to
24483 emit "this" for structures leaves the entire structure on the
24484 stack instead of a pointer to it).
24486 (ParameterReference::DoResolve): Compute the real index for the
24487 argument based on whether the method takes or not a `this' pointer
24488 (ie, the method is static).
24490 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
24491 value types returned from functions when we need to invoke a
24492 method on the sturcture.
24495 2001-10-11 Ravi Pratap <ravi@ximian.com>
24497 * class.cs (TypeContainer::DefineType): Method to actually do the business of
24498 defining the type in the Modulebuilder or Typebuilder. This is to take
24499 care of nested types which need to be defined on the TypeBuilder using
24500 DefineNestedMethod.
24502 (TypeContainer::GetClassBases): Implement. Essentially the code from the
24503 methods in RootContext, only ported to be part of TypeContainer.
24505 (TypeContainer::GetInterfaceOrClass): Ditto.
24507 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
24509 * interface.cs (Interface::DefineInterface): New method. Does exactly
24510 what RootContext.CreateInterface did earlier, only it takes care of nested types
24513 (Interface::GetInterfaces): Move from RootContext here and port.
24515 (Interface::GetInterfaceByName): Same here.
24517 * rootcontext.cs (ResolveTree): Re-write.
24519 (PopulateTypes): Re-write.
24521 * class.cs (TypeContainer::Populate): Populate nested types too.
24522 (TypeContainer::Emit): Emit nested members too.
24524 * typemanager.cs (AddUserType): Do not make use of the FullName property,
24525 instead just use the name argument passed in as it is already fully
24528 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
24529 to TypeContainer mapping to see if a type is user-defined.
24531 * class.cs (TypeContainer::CloseType): Implement.
24533 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
24534 the default constructor.
24536 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
24539 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
24541 * interface.cs (CloseType): Create the type here.
24543 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
24546 Remove all the methods which are now in TypeContainer.
24548 2001-10-10 Ravi Pratap <ravi@ximian.com>
24550 * delegate.cs (Define): Re-write bits to define the delegate
24553 2001-10-10 Miguel de Icaza <miguel@ximian.com>
24555 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
24557 * expression.cs (ImplicitReferenceConversion): handle null as well
24558 as a source to convert to any reference type.
24560 * statement.cs (Return): Perform any implicit conversions to
24561 expected return type.
24563 Validate use of return statement.
24565 * codegen.cs (EmitContext): Pass the expected return type here.
24567 * class.cs (Method, Constructor, Property): Pass expected return
24568 type to EmitContext.
24570 2001-10-09 Miguel de Icaza <miguel@ximian.com>
24572 * expression.cs: Make DoResolve take an EmitContext instead of a
24575 Replaced `l' and `location' for `loc', for consistency.
24577 (Error, Warning): Remove unneeded Tc argument.
24579 * assign.cs, literal.cs, constant.cs: Update to new calling
24582 * codegen.cs: EmitContext now contains a flag indicating whether
24583 code is being generated in a static method or not.
24585 * cs-parser.jay: DecomposeQI, new function that replaces the old
24586 QualifiedIdentifier. Now we always decompose the assembled
24587 strings from qualified_identifier productions into a group of
24590 2001-10-08 Miguel de Icaza <miguel@ximian.com>
24592 * rootcontext.cs: Deal with field-less struct types correctly now
24593 by passing the size option to Define Type.
24595 * class.cs: Removed hack that created one static field.
24597 2001-10-07 Miguel de Icaza <miguel@ximian.com>
24599 * statement.cs: Moved most of the code generation here.
24601 2001-10-09 Ravi Pratap <ravi@ximian.com>
24603 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
24606 (ElementAccess): Remove useless bits for now - keep checks as the spec
24609 2001-10-08 Ravi Pratap <ravi@ximian.com>
24611 * expression.cs (ElementAccess::DoResolve): Remove my crap code
24612 and start performing checks according to the spec.
24614 2001-10-07 Ravi Pratap <ravi@ximian.com>
24616 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
24617 rank_specifiers instead.
24619 (rank_specifiers): Change the order in which the rank specifiers are stored
24621 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
24623 * expression.cs (ElementAccess): Implement the LValue interface too.
24625 2001-10-06 Ravi Pratap <ravi@ximian.com>
24627 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
24628 except that user defined conversions are not included.
24630 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
24631 perform the conversion of the return type, if necessary.
24633 (New::DoResolve): Check whether we are creating an array or an object
24634 and accordingly do the needful.
24636 (New::Emit): Same here.
24638 (New::DoResolve): Implement guts of array creation.
24640 (New::FormLookupType): Helper function.
24642 2001-10-07 Miguel de Icaza <miguel@ximian.com>
24644 * codegen.cs: Removed most of the code generation here, and move the
24645 corresponding code generation bits to the statement classes.
24647 Added support for try/catch/finalize and throw.
24649 * cs-parser.jay: Added support for try/catch/finalize.
24651 * class.cs: Catch static methods having the flags override,
24652 virtual or abstract.
24654 * expression.cs (UserCast): This user cast was not really doing
24655 what it was supposed to do. Which is to be born in fully resolved
24656 state. Parts of the resolution were being performed at Emit time!
24660 2001-10-05 Miguel de Icaza <miguel@ximian.com>
24662 * expression.cs: Implicity convert the result from UserCast.
24664 2001-10-05 Ravi Pratap <ravi@ximian.com>
24666 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
24667 prevented it from working correctly.
24669 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
24670 merely ConvertImplicit.
24672 2001-10-05 Miguel de Icaza <miguel@ximian.com>
24674 * typemanager.cs: Make the LookupTypeContainer function static,
24675 and not per-instance.
24677 * class.cs: Make static FindMembers (the one that takes a Type
24680 * codegen.cs: Add EmitForeach here.
24682 * cs-parser.jay: Make foreach a toplevel object instead of the
24683 inline expansion, as we need to perform semantic analysis on it.
24685 2001-10-05 Ravi Pratap <ravi@ximian.com>
24687 * expression.cs (Expression::ImplicitUserConversion): Rename to
24688 UserDefinedConversion.
24690 (Expression::UserDefinedConversion): Take an extra argument specifying
24691 whether we look for explicit user conversions too.
24693 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
24695 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
24697 (ExplicitUserConversion): Make it a call to UserDefinedConversion
24698 with the appropriate arguments.
24700 * cs-parser.jay (cast_expression): Record location too.
24702 * expression.cs (Cast): Record location info.
24704 (Expression::ConvertExplicit): Take location argument.
24706 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
24707 to determine if we are doing explicit conversions.
24709 (UserCast::Emit): Update accordingly.
24711 (Expression::ConvertExplicit): Report an error if everything fails.
24713 * ../errors/cs0030.cs : Add.
24715 2001-10-04 Miguel de Icaza <miguel@ximian.com>
24717 * modifiers.cs: If the ABSTRACT keyword is present, also set the
24718 virtual and newslot bits.
24720 * class.cs (TypeContainer::RegisterRequiredImplementations):
24721 Record methods we need.
24723 (TypeContainer::MakeKey): Helper function to make keys for
24724 MethodBases, since the Methodbase key is useless.
24726 (TypeContainer::Populate): Call RegisterRequiredImplementations
24727 before defining the methods.
24729 Create a mapping for method_builders_to_methods ahead of time
24730 instead of inside a tight loop.
24732 (::RequireMethods): Accept an object as the data to set into the
24733 hashtable so we can report interface vs abstract method mismatch.
24735 2001-10-03 Miguel de Icaza <miguel@ximian.com>
24737 * report.cs: Make all of it static.
24739 * rootcontext.cs: Drop object_type and value_type computations, as
24740 we have those in the TypeManager anyways.
24742 Drop report instance variable too, now it is a global.
24744 * driver.cs: Use try/catch on command line handling.
24746 Add --probe option to debug the error reporting system with a test
24749 * report.cs: Add support for exiting program when a probe
24750 condition is reached.
24752 2001-10-03 Ravi Pratap <ravi@ximian.com>
24754 * expression.cs (Binary::DoNumericPromotions): Fix the case when
24755 we do a forcible conversion regardless of type, to check if
24756 ForceConversion returns a null.
24758 (Binary::error19): Use location to report error.
24760 (Unary::error23): Use location here too.
24762 * ../errors/cs0019.cs : Check in.
24764 * ../errors/cs0023.cs : Check in.
24766 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
24767 case of a non-null MethodInfo object with a length of 0 !
24769 (Binary::ResolveOperator): Flag error if overload resolution fails to find
24770 an applicable member - according to the spec :-)
24771 Also fix logic to find members in base types.
24773 (Unary::ResolveOperator): Same here.
24775 (Unary::report23): Change name to error23 and make first argument a TypeContainer
24776 as I was getting thoroughly confused between this and error19 :-)
24778 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
24779 (::FindMostEncompassedType): Implement.
24780 (::FindMostEncompassingType): Implement.
24781 (::StandardConversionExists): Implement.
24783 (UserImplicitCast): Re-vamp. We now need info about most specific
24784 source and target types so that we can do the necessary conversions.
24786 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
24787 mathematical union with no duplicates.
24789 2001-10-03 Miguel de Icaza <miguel@ximian.com>
24791 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
24792 in order from base classes to child classes, so that we can in
24793 child classes look up in our parent for method names and
24794 attributes (required for handling abstract, virtual, new, override
24795 constructs: we need to instrospect our base class, and if we dont
24796 populate the classes in order, the introspection might be
24797 incorrect. For example, a method could query its parent before
24798 the parent has any methods and would determine that the parent has
24799 no abstract methods (while it could have had them)).
24801 (RootContext::CreateType): Record the order in which we define the
24804 2001-10-02 Miguel de Icaza <miguel@ximian.com>
24806 * class.cs (TypeContainer::Populate): Also method definitions can
24807 fail now, keep track of this.
24809 (TypeContainer::FindMembers): Implement support for
24810 DeclaredOnly/noDeclaredOnly flag.
24812 (Constructor::Emit) Return the ConstructorBuilder.
24814 (Method::Emit) Return the MethodBuilder.
24815 Check for abstract or virtual methods to be public.
24817 * rootcontext.cs (RootContext::CreateType): Register all the
24818 abstract methods required for the class to be complete and the
24819 interface methods that must be implemented.
24821 * cs-parser.jay: Report error 501 (method requires body if it is
24822 not marked abstract or extern).
24824 * expression.cs (TypeOf::Emit): Implement.
24826 * typemanager.cs: runtime_handle_type, new global type.
24828 * class.cs (Property::Emit): Generate code for properties.
24830 2001-10-02 Ravi Pratap <ravi@ximian.com>
24832 * expression.cs (Unary::ResolveOperator): Find operators on base type
24833 too - we now conform exactly to the spec.
24835 (Binary::ResolveOperator): Same here.
24837 * class.cs (Operator::Define): Fix minor quirk in the tests.
24839 * ../errors/cs0215.cs : Added.
24841 * ../errors/cs0556.cs : Added.
24843 * ../errors/cs0555.cs : Added.
24845 2001-10-01 Miguel de Icaza <miguel@ximian.com>
24847 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
24848 single integer which is really efficient
24850 2001-10-01 Ravi Pratap <ravi@ximian.com>
24852 * expression.cs (Expression::ImplicitUserConversion): Use location
24853 even in the case when we are examining True operators.
24855 * class.cs (Operator::Define): Perform extensive checks to conform
24856 with the rules for operator overloading in the spec.
24858 * expression.cs (Expression::ImplicitReferenceConversion): Implement
24859 some of the other conversions mentioned in the spec.
24861 * typemanager.cs (array_type): New static member for the System.Array built-in
24864 (cloneable_interface): For System.ICloneable interface.
24866 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
24867 we start resolving the tree and populating types.
24869 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
24871 2001-10-01 Miguel de Icaza <miguel@ximian.com>
24873 * expression.cs (Expression::ExprClassFromMemberInfo,
24874 Expression::Literalize): Create literal expressions from
24875 FieldInfos which are literals.
24877 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
24878 type casts, because they were wrong. The test suite in tests
24881 (ImplicitNumericConversion): ushort to ulong requires a widening
24884 Int32 constant to long requires widening cast as well.
24886 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
24887 for integers because the type on the stack is not i4.
24889 2001-09-30 Miguel de Icaza <miguel@ximian.com>
24891 * expression.cs (report118): require location argument.
24893 * parameter.cs: Do not dereference potential null value.
24895 * class.cs: Catch methods that lack the `new' keyword when
24896 overriding a name. Report warnings when `new' is used without
24897 anything being there to override.
24899 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
24901 * class.cs: Only add constructor to hashtable if it is non-null
24902 (as now constructors can fail on define).
24904 (TypeManager, Class, Struct): Take location arguments.
24906 Catch field instance initialization in structs as errors.
24908 accepting_filter: a new filter for FindMembers that is static so
24909 that we dont create an instance per invocation.
24911 (Constructor::Define): Catch errors where a struct constructor is
24914 * cs-parser.jay: Pass location information for various new
24917 * delegate.cs (Delegate): take a location argument.
24919 * driver.cs: Do not call EmitCode if there were problesm in the
24920 Definition of the types, as many Builders wont be there.
24922 * decl.cs (Decl::Decl): Require a location argument.
24924 * cs-tokenizer.cs: Handle properly hex constants that can not fit
24925 into integers, and find the most appropiate integer for it.
24927 * literal.cs: Implement ULongLiteral.
24929 * rootcontext.cs: Provide better information about the location of
24930 failure when CreateType fails.
24932 2001-09-29 Miguel de Icaza <miguel@ximian.com>
24934 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
24937 * expression.cs (Binary::CheckShiftArguments): Add missing type
24939 (Binary::ResolveOperator): Add type to the logical and and logical
24940 or, Bitwise And/Or and Exclusive Or code paths, it was missing
24943 (Binary::DoNumericPromotions): In the case where either argument
24944 is ulong (and most signed types combined with ulong cause an
24945 error) perform implicit integer constant conversions as well.
24947 2001-09-28 Miguel de Icaza <miguel@ximian.com>
24949 * expression.cs (UserImplicitCast): Method should always be
24951 (Invocation::BetterConversion): Simplified test for IntLiteral.
24953 (Expression::ImplicitNumericConversion): Split this routine out.
24954 Put the code that performs implicit constant integer conversions
24957 (Expression::Resolve): Become a wrapper around DoResolve so we can
24958 check eclass and type being set after resolve.
24960 (Invocation::Badness): Remove this dead function
24962 (Binary::ResolveOperator): Do not compute the expensive argumnets
24963 unless we have a union for it.
24965 (Probe::Emit): Is needs to do an isinst and then
24966 compare against null.
24968 (::CanConvert): Added Location argument. If the Location argument
24969 is null (Location.Null), then we do not report errors. This is
24970 used by the `probe' mechanism of the Explicit conversion. We do
24971 not want to generate an error for something that the user
24972 explicitly requested to be casted. But the pipeline for an
24973 explicit cast first tests for potential implicit casts.
24975 So for now, if the Location is null, it means `Probe only' to
24976 avoid adding another argument. Might have to revise this
24979 (ClassCast): New class used to type cast objects into arbitrary
24980 classes (used in Explicit Reference Conversions).
24982 Implement `as' as well.
24984 Reverted all the patches from Ravi below: they were broken:
24986 * The use of `level' as a mechanism to stop recursive
24987 invocations is wrong. That was there just to catch the
24988 bug with a strack trace but not as a way of addressing
24991 To fix the problem we have to *understand* what is going
24992 on and the interactions and come up with a plan, not
24993 just get things going.
24995 * The use of the type conversion cache that I proposed
24996 last night had an open topic: How does this work across
24997 protection domains. A user defined conversion might not
24998 be public in the location where we are applying the
24999 conversion, a different conversion might be selected
25000 (ie, private A->B (better) but public B->A (worse),
25001 inside A, A->B applies, but outside it, B->A will
25004 * On top of that (ie, even if the above is solved),
25005 conversions in a cache need to be abstract. Ie, `To
25006 convert from an Int to a Short use an OpcodeCast', not
25007 `To convert from an Int to a Short use the OpcodeCast on
25008 the variable 5' (which is what this patch was doing).
25010 2001-09-28 Ravi Pratap <ravi@ximian.com>
25012 * expression.cs (Invocation::ConversionExists): Re-write to use
25013 the conversion cache
25015 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
25016 cache all conversions done, not just user-defined ones.
25018 (Invocation::BetterConversion): The real culprit. Use ConversionExists
25019 to determine if a conversion exists instead of acutually trying to
25020 perform the conversion. It's faster too.
25022 (Expression::ConvertExplicit): Modify to use ConversionExists to check
25023 and only then attempt the implicit conversion.
25025 2001-09-28 Ravi Pratap <ravi@ximian.com>
25027 * expression.cs (ConvertImplicit): Use a cache for conversions
25028 already found. Check level of recursion and bail out if necessary.
25030 2001-09-28 Miguel de Icaza <miguel@ximian.com>
25032 * typemanager.cs (string_concat_string_string, string_concat_object_object):
25033 Export standard methods that we expect for string operations.
25035 * statement.cs (Block::UsageWarning): Track usage of variables and
25036 report the errors for not used variables.
25038 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
25041 2001-09-27 Miguel de Icaza <miguel@ximian.com>
25043 * codegen.cs: remove unnneded code
25045 * expression.cs: Removed BuiltinTypeAccess class
25047 Fix the order in which implicit conversions are
25050 The previous fixed dropped support for boxed conversions (adding a
25051 test to the test suite now)
25053 (UserImplicitCast::CanConvert): Remove test for source being null,
25054 that code is broken. We should not feed a null to begin with, if
25055 we do, then we should track the bug where the problem originates
25056 and not try to cover it up here.
25058 Return a resolved expression of type UserImplicitCast on success
25059 rather than true/false. Ravi: this is what I was talking about,
25060 the pattern is to use a static method as a "constructor" for
25063 Also, do not create arguments until the very last minute,
25064 otherwise we always create the arguments even for lookups that
25065 will never be performed.
25067 (UserImplicitCast::Resolve): Eliminate, objects of type
25068 UserImplicitCast are born in a fully resolved state.
25070 * typemanager.cs (InitCoreTypes): Init also value_type
25071 (System.ValueType).
25073 * expression.cs (Cast::Resolve): First resolve the child expression.
25075 (LValue): Add new method AddressOf to be used by
25078 Change the argument of Store to take an EmitContext instead of an
25079 ILGenerator, because things like FieldExpr need to be able to call
25080 their children expression to generate the instance code.
25082 (Expression::Error, Expression::Warning): Sugar functions for
25085 (Expression::MemberLookup): Accept a TypeContainer instead of a
25086 Report as the first argument.
25088 (Expression::ResolvePrimary): Killed. I still want to improve
25089 this as currently the code is just not right.
25091 (Expression::ResolveMemberAccess): Simplify, but it is still
25094 (Unary::Resolve): Catch errors in AddressOf operators.
25096 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
25097 index to a byte for the short-version, or the compiler will choose
25098 the wrong Emit call, which generates the wrong data.
25100 (ParameterReference::Emit, ::Store): same.
25102 (FieldExpr::AddressOf): Implement.
25104 * typemanager.cs: TypeManager: made public variable instead of
25107 * driver.cs: document --fatal.
25109 * report.cs (ErrorMessage, WarningMessage): new names for the old
25110 Error and Warning classes.
25112 * cs-parser.jay (member_access): Turn built-in access to types
25113 into a normal simplename
25115 2001-09-27 Ravi Pratap <ravi@ximian.com>
25117 * expression.cs (Invocation::BetterConversion): Fix to cope
25118 with q being null, since this was introducing a bug.
25120 * expression.cs (ConvertImplicit): Do built-in conversions first.
25122 2001-09-27 Ravi Pratap <ravi@ximian.com>
25124 * expression.cs (UserImplicitCast::Resolve): Fix bug.
25126 2001-09-27 Ravi Pratap <ravi@ximian.com>
25128 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
25129 I had introduced long ago (what's new ?).
25131 * expression.cs (UserImplicitCast::CanConvert): Static method to do
25132 the work of all the checking.
25133 (ConvertImplicit): Call CanConvert and only then create object if necessary.
25134 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
25136 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
25137 that is the right way.
25139 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
25140 overloading resolution. Use everywhere instead of cutting and pasting code.
25142 (Binary::ResolveOperator): Use MakeUnionSet.
25144 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
25145 we have to convert to bool types. Not complete yet.
25147 2001-09-27 Miguel de Icaza <miguel@ximian.com>
25149 * typemanager.cs (TypeManager::CSharpName): support ushort.
25151 * expression.cs (Expression::TryImplicitIntConversion): Attempts
25152 to provide an expression that performsn an implicit constant int
25153 conversion (section 6.1.6).
25154 (Expression::ConvertImplicitRequired): Reworked to include
25155 implicit constant expression conversions.
25157 (Expression::ConvertNumericExplicit): Finished.
25159 (Invocation::Emit): If InstanceExpression is null, then it means
25160 that we perform a call on this.
25162 2001-09-26 Miguel de Icaza <miguel@ximian.com>
25164 * expression.cs (Unary::Emit): Remove some dead code.
25165 (Probe): Implement Resolve and Emit for `is'.
25166 (Expression::ConvertImplicitRequired): Attempt to do constant
25167 expression conversions here. Maybe should be moved to
25168 ConvertImplicit, but I am not sure.
25169 (Expression::ImplicitLongConstantConversionPossible,
25170 Expression::ImplicitIntConstantConversionPossible): New functions
25171 that tell whether is it possible to apply an implicit constant
25172 expression conversion.
25174 (ConvertNumericExplicit): Started work on explicit numeric
25177 * cs-parser.jay: Update operator constants.
25179 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
25180 (Parameters::GetSignature): Hook up VerifyArgs here.
25181 (Parameters::VerifyArgs): Verifies that no two arguments have the
25184 * class.cs (Operator): Update the operator names to reflect the
25185 ones that the spec expects (as we are just stringizing the
25188 * expression.cs (Unary::ResolveOperator): Fix bug: Use
25189 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
25190 previous usage did only work for our methods.
25191 (Expression::ConvertImplicit): Handle decimal implicit numeric
25192 conversions as well.
25193 (Expression::InternalTypeConstructor): Used to invoke constructors
25194 on internal types for default promotions.
25196 (Unary::Emit): Implement special handling for the pre/post
25197 increment/decrement for overloaded operators, as they need to have
25198 the same semantics as the other operators.
25200 (Binary::ResolveOperator): ditto.
25201 (Invocation::ConversionExists): ditto.
25202 (UserImplicitCast::Resolve): ditto.
25204 2001-09-26 Ravi Pratap <ravi@ximian.com>
25206 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
25207 operator, return after emitting body. Regression tests pass again !
25209 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
25210 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
25211 (Invocation::OverloadResolve): Ditto.
25212 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
25214 * everywhere : update calls to the above methods accordingly.
25216 2001-09-26 Miguel de Icaza <miguel@ximian.com>
25218 * assign.cs (Assign): Make it inherit from ExpressionStatement.
25220 * expression.cs (ExpressionStatement): New base class used for
25221 expressions that can appear in statements, so that we can provide
25222 an alternate path to generate expression that do not leave a value
25225 (Expression::Emit, and all the derivatives): We no longer return
25226 whether a value is left on the stack or not. Every expression
25227 after being emitted leaves a single value on the stack.
25229 * codegen.cs (EmitContext::EmitStatementExpression): Use the
25230 facilties of ExpressionStatement if possible.
25232 * cs-parser.jay: Update statement_expression.
25234 2001-09-25 Miguel de Icaza <miguel@ximian.com>
25236 * driver.cs: Change the wording of message
25238 2001-09-25 Ravi Pratap <ravi@ximian.com>
25240 * expression.cs (Binary::ResolveOperator): Had forgottten to set
25241 the type of the expression to the return type of the method if
25242 we have an overloaded operator match ! The regression tests pass again !
25243 (Unary::ResolveOperator): Ditto.
25245 * expression.cs (Invocation::ConversionExists): Correct the member lookup
25246 to find "op_Implicit", not "implicit" ;-)
25247 (UserImplicitCast): New class to take care of user-defined implicit conversions.
25248 (ConvertImplicit, ForceConversion): Take TypeContainer argument
25250 * everywhere : Correct calls to the above accordingly.
25252 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
25253 (ConvertImplicit): Do user-defined conversion if it exists.
25255 2001-09-24 Miguel de Icaza <miguel@ximian.com>
25257 * assign.cs: track location.
25258 (Resolve): Use implicit conversions on assignment.
25260 * literal.cs: Oops. Not good, Emit of short access values should
25261 pass (Bytes) or the wrong argument will be selected.
25263 * expression.cs (Unary::Emit): Emit code for -expr.
25265 (Unary::ResolveOperator): Handle `Substract' for non-constants
25266 (substract from zero from the non-constants).
25267 Deal with Doubles as well.
25269 (Expression::ConvertImplicitRequired): New routine that reports an
25270 error if no implicit conversion exists.
25272 (Invocation::OverloadResolve): Store the converted implicit
25273 expressions if we make them
25275 2001-09-24 Ravi Pratap <ravi@ximian.com>
25277 * class.cs (ConstructorInitializer): Take a Location argument.
25278 (ConstructorBaseInitializer): Same here.
25279 (ConstructorThisInitializer): Same here.
25281 * cs-parser.jay : Update all calls accordingly.
25283 * expression.cs (Unary, Binary, New): Take location argument.
25284 Update accordingly everywhere.
25286 * cs-parser.jay : Update all calls to the above to take a location
25289 * class.cs : Ditto.
25291 2001-09-24 Ravi Pratap <ravi@ximian.com>
25293 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
25294 (Invocation::BetterConversion): Same here
25295 (Invocation::ConversionExists): Ditto.
25297 (Invocation::ConversionExists): Implement.
25299 2001-09-22 Ravi Pratap <ravi@ximian.com>
25301 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
25302 Also take an additional TypeContainer argument.
25304 * All over : Pass in TypeContainer as argument to OverloadResolve.
25306 * typemanager.cs (CSharpName): Update to check for the string type and return
25309 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
25312 2001-09-21 Ravi Pratap <ravi@ximian.com>
25314 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
25315 (Invocation::BetterFunction): Implement.
25316 (Invocation::BetterConversion): Implement.
25317 (Invocation::ConversionExists): Skeleton, no implementation yet.
25319 Okay, things work fine !
25321 2001-09-21 Miguel de Icaza <miguel@ximian.com>
25323 * typemanager.cs: declare and load enum_type, delegate_type and
25326 * expression.cs (Expression::Emit): Now emit returns a value that
25327 tells whether a value is left on the stack or not. This strategy
25328 might be reveted tomorrow with a mechanism that would address
25329 multiple assignments.
25330 (Expression::report118): Utility routine to report mismatches on
25333 (Unary::Report23): Report impossible type/operator combination
25336 (Unary::IsIncrementableNumber): Whether the type can be
25337 incremented or decremented with add.
25338 (Unary::ResolveOperator): Also allow enumerations to be bitwise
25340 (Unary::ResolveOperator): Implement ++, !, ~,
25342 (Invocation::Emit): Deal with new Emit convetion.
25344 * All Expression derivatives: Updated their Emit method to return
25345 whether they leave values on the stack or not.
25347 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
25348 stack for expressions that are statements.
25350 2001-09-20 Miguel de Icaza <miguel@ximian.com>
25352 * expression.cs (LValue): New interface. Must be implemented by
25354 (LocalVariableReference, ParameterReference, FieldExpr): Implement
25357 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
25358 interface for generating code, simplifies the code.
25360 2001-09-20 Ravi Pratap <ravi@ximian.com>
25362 * expression.cs (everywhere): Comment out return statements in ::Resolve
25363 methods to avoid the warnings.
25365 2001-09-20 Miguel de Icaza <miguel@ximian.com>
25367 * driver.cs (parse): Report error 2001 if we can not open the
25370 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
25373 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
25376 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
25377 otherwise nested blocks end up with the same index.
25379 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
25381 * expression.cs: Instead of having FIXMEs in the Resolve
25382 functions, throw exceptions so it is obvious that we are facing a
25385 * cs-parser.jay (invocation_expression): Pass Location information.
25387 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
25388 Use a basename for those routines because .NET does not like paths
25391 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
25394 2001-09-19 Miguel de Icaza <miguel@ximian.com>
25396 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
25397 are loading the correct data types (throws an exception if not).
25398 (TypeManager::InitCoreTypes): Use CoreLookupType
25400 * expression.cs (Unary::ResolveOperator): return the child
25401 expression for expressions which are just +expr.
25402 (Unary::ResolveOperator): Return negative literals for -LITERAL
25403 expressions (otherwise they are Unary {Literal}).
25404 (Invocation::Badness): Take into account `Implicit constant
25405 expression conversions'.
25407 * literal.cs (LongLiteral): Implement long literal class.
25408 (IntLiteral): export the `Value' of the intliteral.
25410 2001-09-19 Ravi Pratap <ravi@ximian.com>
25412 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
25414 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
25415 instead of 'Operator'
25417 * expression.cs (Binary::ResolveOperator): Update accordingly.
25418 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
25421 * cs-parser.jay (unary_expression): Update to use the new names.
25423 * gen-treedump.cs (GetUnary): Same here.
25425 * expression.cs (Unary::Resolve): Implement.
25426 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
25427 operators are found instead of making noise ;-)
25428 (Unary::ResolveOperator): New method to do precisely the same thing which
25429 Binary::ResolveOperator does for Binary expressions.
25430 (Unary.method, .Arguments): Add.
25431 (Unary::OperName): Implement.
25432 (Unary::ForceConversion): Copy and Paste !
25434 * class.cs (Operator::Define): Fix a small bug for the case when we have
25437 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
25438 for the inbuilt operators. Only overloading works for now ;-)
25440 2001-09-18 Miguel de Icaza <miguel@ximian.com>
25442 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
25443 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
25445 * expression.cs (This::Emit): Implement.
25446 (This::Resolve): Implement.
25447 (TypeOf:Resolve): Implement.
25448 (Expression::ResolveSimpleName): Add an implicit this to instance
25450 (MemberAccess::Resolve): Deal with Parameters and Fields.
25451 Bind instance variable to Field expressions.
25452 (FieldExpr::Instance): New field used to track the expression that
25453 represents the object instance.
25454 (FieldExpr::Resolve): Track potential errors from MemberLookup not
25456 (FieldExpr::Emit): Implement.
25458 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
25459 the last instruction contains a return opcode to avoid generating
25460 the last `ret' instruction (this generates correct code, and it is
25461 nice to pass the peverify output).
25463 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
25464 initializer for static and instance variables.
25465 (Constructor::Emit): Allow initializer to be null in the case of
25466 static constructors. Only emit initializer for instance
25469 (TypeContainer::FindMembers): Return a null array if there are no
25472 Also fix the code for the MemberTypes.Method branch, as it was not
25473 scanning that for operators (or tried to access null variables before).
25475 * assign.cs (Assign::Emit): Handle instance and static fields.
25479 * driver.cs: Stop compilation if there are parse errors.
25481 * cs-parser.jay (constructor_declaration): Provide default base
25482 initializer for non-static constructors.
25483 (constructor_declarator): Do not provide a default base
25484 initializers if none was specified.
25485 Catch the fact that constructors should not have parameters.
25487 * class.cs: Do not emit parent class initializers for static
25488 constructors, that should be flagged as an error.
25490 2001-09-18 Ravi Pratap <ravi@ximian.com>
25492 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
25493 Move back code into TypeContainer::Populate.
25495 2001-09-18 Ravi Pratap <ravi@ximian.com>
25497 * class.cs (TypeContainer::AddConstructor): Fix the check to
25498 compare against Name, not Basename.
25499 (Operator::OpType): Change Plus and Minus to Add and Subtract.
25501 * cs-parser.jay : Update accordingly.
25503 * class.cs (TypeContainer::FindMembers): For the case where we are searching
25504 for methods, don't forget to look into the operators too.
25505 (RegisterMethodBuilder): Helper method to take care of this for
25506 methods, constructors and operators.
25507 (Operator::Define): Completely revamp.
25508 (Operator.OperatorMethod, MethodName): New fields.
25509 (TypeContainer::Populate): Move the registering of builders into
25510 RegisterMethodBuilder.
25511 (Operator::Emit): Re-write.
25513 * expression.cs (Binary::Emit): Comment out code path to emit method
25514 invocation stuff for the case when we have a user defined operator. I am
25515 just not able to get it right !
25517 2001-09-17 Miguel de Icaza <miguel@ximian.com>
25519 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
25522 (Expression::MemberLookup): Provide a version that allows to
25523 specify the MemberTypes and BindingFlags.
25525 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
25526 so it was not fetching variable information from outer blocks.
25528 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
25529 Beforefieldinit as it was buggy.
25531 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
25532 that Ravi put here.
25534 * class.cs (Constructor::Emit): Only emit if block is not null.
25535 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
25536 deal with this by semantically definining it as if the user had
25539 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
25540 constructors as we now "emit" them at a higher level.
25542 (TypeContainer::DefineDefaultConstructor): Used to define the
25543 default constructors if none was provided.
25545 (ConstructorInitializer): Add methods Resolve and Emit.
25547 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
25549 2001-09-17 Ravi Pratap <ravi@ximian.com>
25551 * class.cs (TypeContainer::EmitDefaultConstructor): Register
25552 the default constructor builder with our hashtable for methodbuilders
25555 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
25556 and argument_count is 0 in which case we have a match.
25557 (Binary::ResolveOperator): More null checking and miscellaneous coding
25560 2001-09-17 Ravi Pratap <ravi@ximian.com>
25562 * rootcontext.cs (IsNameSpace): Compare against null.
25564 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
25566 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
25567 and Unary::Operator.
25569 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
25572 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
25573 we have overloaded operators.
25574 (Binary::ResolveOperator): Implement the part which does the operator overload
25577 * class.cs (Operator::Emit): Implement.
25578 (TypeContainer::Emit): Emit the operators we have too.
25580 * expression.cs (Binary::Emit): Update to emit the appropriate code for
25581 the case when we have a user-defined operator.
25583 2001-09-17 Miguel de Icaza <miguel@ximian.com>
25585 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
25587 2001-09-16 Ravi Pratap <ravi@ximian.com>
25589 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
25590 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
25591 (Constructor::Emit): Implement.
25592 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
25593 if we have no work to do.
25594 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
25597 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
25598 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
25600 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
25603 2001-09-15 Ravi Pratap <ravi@ximian.com>
25605 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
25607 (Tree::RecordNamespace): Method to do what the name says ;-)
25608 (Tree::Namespaces): Property to get at the namespaces hashtable.
25610 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
25613 * rootcontext.cs (IsNamespace): Fixed it :-)
25615 2001-09-14 Miguel de Icaza <miguel@ximian.com>
25617 * class.cs (TypeContainer::FindMembers): Add support for
25619 (MethodCore): New class that encapsulates both the shared aspects
25620 of a Constructor and a Method.
25621 (Method, Constructor): Factored pieces into MethodCore.
25623 * driver.cs: Added --fatal which makes errors throw exceptions.
25624 Load System assembly as well as part of the standard library.
25626 * report.cs: Allow throwing exceptions on errors for debugging.
25628 * modifiers.cs: Do not use `parent', instead use the real type
25629 container to evaluate permission settings.
25631 * class.cs: Put Ravi's patch back in. He is right, and we will
25632 have to cope with the
25634 2001-09-14 Ravi Pratap <ravi@ximian.com>
25636 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
25637 FamORAssem, not FamANDAssem.
25639 2001-09-14 Miguel de Icaza <miguel@ximian.com>
25641 * driver.cs: Added --parse option that only parses its input files
25644 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
25645 incorrect. IsTopLevel is not used to tell whether an object is
25646 root_types or not (that can be achieved by testing this ==
25647 root_types). But to see if this is a top-level *class* (not
25648 necessarly our "toplevel" container).
25650 2001-09-14 Ravi Pratap <ravi@ximian.com>
25652 * enum.cs (Enum::Define): Modify to call the Lookup method on the
25653 parent instead of a direct call to GetType.
25655 2001-09-14 Ravi Pratap <ravi@ximian.com>
25657 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
25658 Modifiers.TypeAttr. This should just be a call to that method.
25660 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
25661 object so that we can determine if we are top-level or not.
25663 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
25666 * enum.cs (Enum::Define): Ditto.
25668 * modifiers.cs (FieldAttr): Re-write.
25670 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
25671 (TypeContainer::HaveStaticConstructor): New property to provide access
25672 to precisely that info.
25674 * modifiers.cs (MethodAttr): Re-write.
25675 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
25677 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
25678 of top-level types as claimed.
25680 2001-09-13 Miguel de Icaza <miguel@ximian.com>
25682 * expression.cs (MemberLookup): Fruitless attempt to lookup
25683 constructors. Maybe I need to emit default constructors? That
25684 might be it (currently .NET emits this for me automatically).
25685 (Invocation::OverloadResolve): Cope with Arguments == null.
25686 (Invocation::EmitArguments): new function, shared by the new
25687 constructor and us.
25688 (Invocation::Emit): Handle static and instance methods. Emit
25689 proper call instruction for virtual or non-virtual invocations.
25690 (New::Emit): Implement.
25691 (New::Resolve): Implement.
25692 (MemberAccess:Resolve): Implement.
25693 (MethodGroupExpr::InstanceExpression): used conforming to the spec
25694 to track instances.
25695 (FieldExpr::Resolve): Set type.
25697 * support.cs: Handle empty arguments.
25699 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
25700 SimpleLookup): Auxiliary routines to help parse a qualifier
25703 Update qualifier_identifier rule.
25705 * codegen.cs: Removed debugging messages.
25707 * class.cs: Make this a global thing, this acts just as a "key" to
25708 objects that we might have around.
25710 (Populate): Only initialize method_builders_to_methods once.
25712 * expression.cs (PropertyExpr): Initialize type from the
25715 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
25716 Resolve pattern. Attempt to implicitly convert value to boolean.
25719 * expression.cs: Set the type for the int32/int32 argument case.
25720 (Binary::ResolveOperator): Set the return type to boolean for
25721 comparission operators
25723 * typemanager.cs: Remove debugging print code.
25725 (Invocation::Resolve): resolve type.
25727 * class.cs: Allocate a MemberInfo of the correct size, as the code
25728 elsewhere depends on the test to reflect the correct contents.
25730 (Method::) Keep track of parameters, due to System.Reflection holes
25732 (TypeContainer::Populate): Keep track of MethodBuilders to Method
25735 (TypeContainer::FindMembers): Use ArrayList and then copy an array
25736 of the exact size and return that.
25738 (Class::LookupMethodByBuilder): New function that maps
25739 MethodBuilders to its methods. Required to locate the information
25740 on methods because System.Reflection bit us again.
25742 * support.cs: New file, contains an interface ParameterData and
25743 two implementations: ReflectionParameters and InternalParameters
25744 used to access Parameter information. We will need to grow this
25747 * expression.cs (Invocation::GetParameterData): implement a cache
25748 and a wrapper around the ParameterData creation for methods.
25749 (Invocation::OverloadResolve): Use new code.
25751 2001-09-13 Ravi Pratap <ravi@ximian.com>
25753 * class.cs (TypeContainer::EmitField): Remove and move into
25754 (Field::Define): here and modify accordingly.
25755 (Field.FieldBuilder): New member.
25756 (TypeContainer::Populate): Update accordingly.
25757 (TypeContainer::FindMembers): Implement.
25759 2001-09-13 Miguel de Icaza <miguel@ximian.com>
25761 * statement.cs: (VariableInfo::VariableType): New field to be
25762 initialized with the full type once it is resolved.
25764 2001-09-12 Miguel de Icaza <miguel@ximian.com>
25766 * parameter.cs (GetParameterInfo): Use a type cache to compute
25767 things only once, and to reuse this information
25769 * expression.cs (LocalVariableReference::Emit): Implement.
25770 (OpcodeCast::Emit): fix.
25772 (ParameterReference::Resolve): Implement.
25773 (ParameterReference::Emit): Implement.
25775 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
25776 that are expressions need to stay as Expressions.
25778 * typemanager.cs (CSharpName): Returns the C# name of a type if
25781 * expression.cs (Expression::ConvertImplicit): New function that
25782 implements implicit type conversions.
25784 (Expression::ImplicitReferenceConversion): Implements implicit
25785 reference conversions.
25787 (EmptyCast): New type for transparent casts.
25789 (OpcodeCast): New type for casts of types that are performed with
25790 a sequence of bytecodes.
25792 (BoxedCast): New type used for casting value types into reference
25793 types. Emits a box opcode.
25795 (Binary::DoNumericPromotions): Implements numeric promotions of
25796 and computation of the Binary::Type.
25798 (Binary::EmitBranchable): Optimization.
25800 (Binary::Emit): Implement code emission for expressions.
25802 * typemanager.cs (TypeManager): Added two new core types: sbyte
25805 2001-09-12 Ravi Pratap <ravi@ximian.com>
25807 * class.cs (TypeContainer::FindMembers): Method which does exactly
25808 what Type.FindMembers does, only we don't have to use reflection. No
25809 implementation yet.
25811 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
25812 typecontainer objects as we need to get at them.
25813 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
25815 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
25816 typecontainer object.
25818 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
25819 of just a Report object.
25821 2001-09-11 Ravi Pratap <ravi@ximian.com>
25823 * class.cs (Event::Define): Go back to using the prefixes "add_" and
25825 (TypeContainer::Populate): Now define the delegates of the type too.
25826 (TypeContainer.Delegates): Property to access the list of delegates defined
25829 * delegates.cs (Delegate::Define): Implement partially.
25831 * modifiers.cs (TypeAttr): Handle more flags.
25833 2001-09-11 Ravi Pratap <ravi@ximian.com>
25835 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
25837 (Operator::Define): Re-write logic to get types by using the LookupType method
25838 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
25839 (Indexer::Define): Ditto.
25840 (Event::Define): Ditto.
25841 (Property::Define): Ditto.
25843 2001-09-10 Ravi Pratap <ravi@ximian.com>
25845 * class.cs (TypeContainer::Populate): Now define operators too.
25846 (TypeContainer.Operators): New property to access the list of operators
25848 (Operator.OperatorMethodBuilder): New member to hold the method builder
25849 for the operator we are defining.
25850 (Operator::Define): Implement.
25852 2001-09-10 Ravi Pratap <ravi@ximian.com>
25854 * class.cs (Event::Define): Make the prefixes of the accessor methods
25855 addOn_ and removeOn_
25857 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
25858 of the location being passed in too. Ideally, this should go later since all
25859 error reporting should be done through the Report object.
25861 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
25862 (Populate): Iterate thru the indexers we have and define them too.
25863 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
25864 for the get and set accessors.
25865 (Indexer::Define): Implement.
25867 2001-09-09 Miguel de Icaza <miguel@ximian.com>
25869 * expression.cs (Binary::Resolve): Beginning of it. I scratched
25870 my previous implementation, did not work.
25872 * typemanager.cs: Add a couple of missing types (the longs).
25874 * literal.cs: Use TypeManager.bool_type instead of getting it.
25876 * expression.cs (EventExpr): New kind of expressions.
25877 (Expressio::ExprClassFromMemberInfo): finish
25879 2001-09-08 Miguel de Icaza <miguel@ximian.com>
25881 * assign.cs: Emit stores to static fields differently.
25883 2001-09-08 Ravi Pratap <ravi@ximian.com>
25885 * Merge in changes and adjust code to tackle conflicts. Backed out my
25886 code in Assign::Resolve ;-)
25888 2001-09-08 Ravi Pratap <ravi@ximian.com>
25890 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
25891 instead Report.Error and also pass in the location.
25892 (CSharpParser::Lexer): New readonly property to return the reference
25893 to the Tokenizer object.
25894 (declare_local_variables): Use Report.Error with location instead of plain
25898 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
25899 (Operator.CheckBinaryOperator): Ditto.
25901 * cs-parser.jay (operator_declarator): Update accordingly.
25903 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
25904 (CheckBinaryOperator): Same here.
25906 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
25907 on the name without any prefixes of namespace names etc. This is because we
25908 already might have something already fully qualified like
25909 'System.Console.WriteLine'
25911 * assign.cs (Resolve): Begin implementation. Stuck ;-)
25913 2001-09-07 Ravi Pratap <ravi@ximian.com>
25915 * cs-tokenizer.cs (location): Return a string which also contains
25918 * expression.cs (ElementAccess): New class for expressions of the
25919 type 'element access.'
25920 (BaseAccess): New class for expressions of the type 'base access.'
25921 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
25924 * cs-parser.jay (element_access): Implement action.
25925 (base_access): Implement actions.
25926 (checked_expression, unchecked_expression): Implement.
25928 * cs-parser.jay (local_variable_type): Correct and implement.
25929 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
25931 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
25933 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
25934 name and the specifiers.
25936 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
25938 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
25939 making them all public ;-)
25941 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
25944 2001-09-07 Miguel de Icaza <miguel@ximian.com>
25946 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
25948 (FieldExpr, PropertyExprs): New resolved expressions.
25949 (SimpleName::MemberStaticCheck): Perform static checks for access
25950 to non-static fields on static methods. Maybe this should be
25951 generalized for MemberAccesses.
25952 (SimpleName::ResolveSimpleName): More work on simple name
25955 * cs-parser.jay (primary_expression/qualified_identifier): track
25956 the parameter index.
25958 * codegen.cs (CodeGen::Save): Catch save exception, report error.
25959 (EmitContext::EmitBoolExpression): Chain to expression generation
25960 instead of temporary hack.
25961 (::EmitStatementExpression): Put generic expression code generation.
25963 * assign.cs (Assign::Emit): Implement variable assignments to
25964 local variables, parameters and fields.
25966 2001-09-06 Miguel de Icaza <miguel@ximian.com>
25968 * statement.cs (Block::GetVariableInfo): New method, returns the
25969 VariableInfo for a variable name in a block.
25970 (Block::GetVariableType): Implement in terms of GetVariableInfo
25972 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
25973 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
25975 2001-09-06 Ravi Pratap <ravi@ximian.com>
25977 * cs-parser.jay (operator_declaration): Continue on my quest : update
25978 to take attributes argument.
25979 (event_declaration): Ditto.
25980 (enum_declaration): Ditto.
25981 (indexer_declaration): Ditto.
25983 * class.cs (Operator::Operator): Update constructor accordingly.
25984 (Event::Event): Ditto.
25986 * delegate.cs (Delegate::Delegate): Same here.
25988 * enum.cs (Enum::Enum): Same here.
25990 2001-09-05 Ravi Pratap <ravi@ximian.com>
25992 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
25994 * ../tests/cs0658.cs : New file to demonstrate error 0658.
25996 * attribute.cs (Attributes): New class to encapsulate all attributes which were
25997 being passed around as an arraylist.
25998 (Attributes::AddAttribute): Method to add attribute sections.
26000 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
26001 (struct_declaration): Update accordingly.
26002 (constant_declaration): Update.
26003 (field_declaration): Update.
26004 (method_header): Update.
26005 (fixed_parameter): Update.
26006 (parameter_array): Ditto.
26007 (property_declaration): Ditto.
26008 (destructor_declaration): Ditto.
26010 * class.cs (Struct::Struct): Update constructors accordingly.
26011 (Class::Class): Ditto.
26012 (Field::Field): Ditto.
26013 (Method::Method): Ditto.
26014 (Property::Property): Ditto.
26015 (TypeContainer::OptAttribute): update property's return type.
26017 * interface.cs (Interface.opt_attributes): New member.
26018 (Interface::Interface): Update to take the extra Attributes argument.
26020 * parameter.cs (Parameter::Parameter): Ditto.
26022 * constant.cs (Constant::Constant): Ditto.
26024 * interface.cs (InterfaceMemberBase): New OptAttributes field.
26025 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
26026 the attributes as a parameter.
26027 (InterfaceProperty): Update constructor call.
26028 (InterfaceEvent): Ditto.
26029 (InterfaceMethod): Ditto.
26030 (InterfaceIndexer): Ditto.
26032 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
26033 pass the attributes too.
26034 (interface_event_declaration): Ditto.
26035 (interface_property_declaration): Ditto.
26036 (interface_method_declaration): Ditto.
26037 (interface_declaration): Ditto.
26039 2001-09-05 Miguel de Icaza <miguel@ximian.com>
26041 * class.cs (Method::Define): Track the "static Main" definition to
26042 create an entry point.
26044 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
26045 EntryPoint if we find it.
26047 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
26048 (EmitContext::ig): Make this variable public.
26050 * driver.cs: Make the default output file be the first file name
26051 with the .exe extension.
26053 Detect empty compilations
26055 Handle various kinds of output targets. Handle --target and
26056 rename -t to --dumper.
26058 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
26059 methods inherited from Expression return now an Expression. This
26060 will is used during the tree rewriting as we resolve them during
26063 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
26064 the spec. Missing entirely is the information about
26065 accessability of elements of it.
26067 (Expression::ExprClassFromMemberInfo): New constructor for
26068 Expressions that creates a fully initialized Expression based on
26069 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
26072 (Invocation::Resolve): Begin implementing resolution of invocations.
26074 * literal.cs (StringLiteral): Implement Emit.
26076 2001-09-05 Ravi Pratap <ravi@ximian.com>
26078 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
26081 2001-09-04 Ravi Pratap <ravi@ximian.com>
26083 * cs-parser.jay (attribute_arguments): Implement actions.
26084 (attribute): Fix bug in production. Implement action.
26085 (attribute_list): Implement.
26086 (attribute_target): Implement.
26087 (attribute_target_specifier, opt_target_specifier): Implement
26088 (CheckAttributeTarget): New method to check if the attribute target
26090 (attribute_section): Implement.
26091 (opt_attributes): Implement.
26093 * attribute.cs : New file to handle attributes.
26094 (Attribute): Class to hold attribute info.
26096 * cs-parser.jay (opt_attribute_target_specifier): Remove production
26097 (attribute_section): Modify production to use 2 different rules to
26098 achieve the same thing. 1 s/r conflict down !
26099 Clean out commented, useless, non-reducing dimension_separator rules.
26101 * class.cs (TypeContainer.attributes): New member to hold list
26102 of attributes for a type.
26103 (Struct::Struct): Modify to take one more argument, the attribute list.
26104 (Class::Class): Ditto.
26105 (Field::Field): Ditto.
26106 (Method::Method): Ditto.
26107 (Property::Property): Ditto.
26109 * cs-parser.jay (struct_declaration): Update constructor call to
26110 pass in the attributes too.
26111 (class_declaration): Ditto.
26112 (constant_declaration): Ditto.
26113 (field_declaration): Ditto.
26114 (method_header): Ditto.
26115 (fixed_parameter): Ditto.
26116 (parameter_array): Ditto.
26117 (property_declaration): Ditto.
26119 * constant.cs (Constant::Constant): Update constructor similarly.
26120 Use System.Collections.
26122 * parameter.cs (Parameter::Parameter): Update as above.
26124 2001-09-02 Ravi Pratap <ravi@ximian.com>
26126 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
26127 (TypeContainer.delegates): New member to hold list of delegates.
26129 * cs-parser.jay (delegate_declaration): Implement the action correctly
26130 this time as I seem to be on crack ;-)
26132 2001-09-02 Miguel de Icaza <miguel@ximian.com>
26134 * rootcontext.cs (RootContext::IsNamespace): new function, used to
26135 tell whether an identifier represents a namespace.
26137 * expression.cs (NamespaceExpr): A namespace expression, used only
26138 temporarly during expression resolution.
26139 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
26140 utility functions to resolve names on expressions.
26142 2001-09-01 Miguel de Icaza <miguel@ximian.com>
26144 * codegen.cs: Add hook for StatementExpressions.
26146 * class.cs: Fix inverted test for static flag in methods.
26148 2001-09-02 Ravi Pratap <ravi@ximian.com>
26150 * class.cs (Operator::CheckUnaryOperator): Correct error number used
26151 to make it coincide with MS' number.
26152 (Operator::CheckBinaryOperator): Ditto.
26154 * ../errors/errors.txt : Remove error numbers added earlier.
26156 * ../errors/cs1019.cs : Test case for error # 1019
26158 * ../errros/cs1020.cs : Test case for error # 1020
26160 * cs-parser.jay : Clean out commented cruft.
26161 (dimension_separators, dimension_separator): Comment out. Ostensibly not
26162 used anywhere - non-reducing rule.
26163 (namespace_declarations): Non-reducing rule - comment out.
26165 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
26166 with TypeContainer::AddEnum.
26168 * delegate.cs : New file for delegate handling classes.
26169 (Delegate): Class for declaring delegates.
26171 * makefile : Update.
26173 * cs-parser.jay (delegate_declaration): Implement.
26175 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
26177 * class.cs (Event::Define): Implement.
26178 (Event.EventBuilder): New member.
26180 * class.cs (TypeContainer::Populate): Update to define all enums and events
26182 (Events): New property for the events arraylist we hold. Shouldn't we move to using
26183 readonly fields for all these cases ?
26185 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
26187 * class.cs (Property): Revamp to use the convention of making fields readonly.
26188 Accordingly modify code elsewhere.
26190 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
26191 the Define method of the Property class.
26193 * class.cs : Clean up applied patch and update references to variables etc. Fix
26195 (TypeContainer::Populate): Update to define all the properties we have. Also
26196 define all enumerations.
26198 * enum.cs (Define): Implement.
26200 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
26202 * cs-parser.jay (overloadable_operator): The semantic value is an
26203 enum of the Operator class.
26204 (operator_declarator): Implement actions.
26205 (operator_declaration): Implement.
26207 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
26208 validity of definitions.
26209 (Operator::CheckBinaryOperator): Static method to check for binary operators
26210 (TypeContainer::AddOperator): New method to add an operator to a type.
26212 * cs-parser.jay (indexer_declaration): Added line to actually call the
26213 AddIndexer method so it gets added ;-)
26215 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
26216 already taken care of by the MS compiler ?
26218 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
26220 * class.cs (Operator): New class for operator declarations.
26221 (Operator::OpType): Enum for the various operators.
26223 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
26225 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
26226 ostensibly handle this in semantic analysis.
26228 * cs-parser.jay (general_catch_clause): Comment out
26229 (specific_catch_clauses, specific_catch_clause): Ditto.
26230 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
26231 (catch_args, opt_catch_args): New productions.
26232 (catch_clause): Rewrite to use the new productions above
26233 (catch_clauses): Modify accordingly.
26234 (opt_catch_clauses): New production to use in try_statement
26235 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
26236 and re-write the code in the actions to extract the specific and
26237 general catch clauses by being a little smart ;-)
26239 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
26240 Hooray, try and catch statements parse fine !
26242 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
26244 * statement.cs (Block::GetVariableType): Fix logic to extract the type
26245 string from the hashtable of variables.
26247 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
26248 I end up making that mistake ;-)
26249 (catch_clauses): Fixed gross error which made Key and Value of the
26250 DictionaryEntry the same : $1 !!
26252 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
26254 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
26256 * cs-parser.jay (event_declaration): Correct to remove the semicolon
26257 when the add and remove accessors are specified.
26259 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
26261 * cs-parser.jay (IndexerDeclaration): New helper class to hold
26262 information about indexer_declarator.
26263 (indexer_declarator): Implement actions.
26264 (parsing_indexer): New local boolean used to keep track of whether
26265 we are parsing indexers or properties. This is necessary because
26266 implicit_parameters come into picture even for the get accessor in the
26267 case of an indexer.
26268 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
26270 * class.cs (Indexer): New class for indexer declarations.
26271 (TypeContainer::AddIndexer): New method to add an indexer to a type.
26272 (TypeContainer::indexers): New member to hold list of indexers for the
26275 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
26277 * cs-parser.jay (add_accessor_declaration): Implement action.
26278 (remove_accessor_declaration): Implement action.
26279 (event_accessors_declaration): Implement
26280 (variable_declarators): swap statements for first rule - trivial.
26282 * class.cs (Event): New class to hold information about event
26284 (TypeContainer::AddEvent): New method to add an event to a type
26285 (TypeContainer::events): New member to hold list of events.
26287 * cs-parser.jay (event_declaration): Implement actions.
26289 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
26291 * cs-parser.jay (dim_separators): Implement. Make it a string
26292 concatenating all the commas together, just as they appear.
26293 (opt_dim_separators): Modify accordingly
26294 (rank_specifiers): Update accordingly. Basically do the same
26295 thing - instead, collect the brackets here.
26296 (opt_rank_sepcifiers): Modify accordingly.
26297 (array_type): Modify to actually return the complete type string
26298 instead of ignoring the rank_specifiers.
26299 (expression_list): Implement to collect the expressions
26300 (variable_initializer): Implement. We make it a list of expressions
26301 essentially so that we can handle the array_initializer case neatly too.
26302 (variable_initializer_list): Implement.
26303 (array_initializer): Make it a list of variable_initializers
26304 (opt_array_initializer): Modify accordingly.
26306 * expression.cs (New::NType): Add enumeration to help us
26307 keep track of whether we have an object/delegate creation
26308 or an array creation.
26309 (New:NewType, New::Rank, New::Indices, New::Initializers): New
26310 members to hold data about array creation.
26311 (New:New): Modify to update NewType
26312 (New:New): New Overloaded contructor for the array creation
26315 * cs-parser.jay (array_creation_expression): Implement to call
26316 the overloaded New constructor.
26318 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
26320 * class.cs (TypeContainer::Constructors): Return member
26321 constructors instead of returning null.
26323 2001-08-26 Miguel de Icaza <miguel@ximian.com>
26325 * typemanager.cs (InitCoreTypes): Initialize the various core
26326 types after we have populated the type manager with the user
26327 defined types (this distinction will be important later while
26328 compiling corlib.dll)
26330 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
26331 on Expression Classification. Now all expressions have a method
26332 `Resolve' and a method `Emit'.
26334 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
26335 generation from working. Also add some temporary debugging
26338 2001-08-24 Miguel de Icaza <miguel@ximian.com>
26340 * codegen.cs: Lots of code generation pieces. This is only the
26341 beginning, will continue tomorrow with more touches of polish. We
26342 handle the fundamentals of if, while, do, for, return. Others are
26343 trickier and I need to start working on invocations soon.
26345 * gen-treedump.cs: Bug fix, use s.Increment here instead of
26348 * codegen.cs (EmitContext): New struct, used during code
26349 emission to keep a context. Most of the code generation will be
26352 * cs-parser.jay: Add embedded blocks to the list of statements of
26353 this block. So code generation proceeds in a top down fashion.
26355 2001-08-23 Miguel de Icaza <miguel@ximian.com>
26357 * statement.cs: Add support for multiple child blocks.
26359 2001-08-22 Miguel de Icaza <miguel@ximian.com>
26361 * codegen.cs (EmitCode): New function, will emit the code for a
26362 Block of code given a TypeContainer and its ILGenerator.
26364 * statement.cs (Block): Standard public readonly optimization.
26365 (Block::Block constructors): Link children.
26366 (Block::Child): Child Linker.
26367 (Block::EmitVariables): Emits IL variable declarations.
26369 * class.cs: Drop support for MethodGroups here, delay until
26371 (Method::): Applied the same simplification that I did before, and
26372 move from Properties to public readonly fields.
26373 (Method::ParameterTypes): Returns the parameter types for the
26374 function, and implements a cache that will be useful later when I
26375 do error checking and the semantic analysis on the methods is
26377 (Constructor::GetCallingConvention): Renamed from CallingConvetion
26378 and made a method, optional argument tells whether this is a class
26379 or a structure to apply the `has-this' bit.
26380 (Method::GetCallingConvention): Implement, returns the calling
26382 (Method::Define): Defines the type, a second pass is performed
26383 later to populate the methods.
26385 (Constructor::ParameterTypes): implement a cache similar to the
26386 one on Method::ParameterTypes, useful later when we do semantic
26389 (TypeContainer::EmitMethod): New method. Emits methods.
26391 * expression.cs: Removed MethodGroup class from here.
26393 * parameter.cs (Parameters::GetCallingConvention): new method.
26395 2001-08-21 Miguel de Icaza <miguel@ximian.com>
26397 * class.cs (TypeContainer::Populate): Drop RootContext from the
26400 (Constructor::CallingConvention): Returns the calling convention.
26401 (Constructor::ParameterTypes): Returns the constructor parameter
26404 (TypeContainer::AddConstructor): Keep track of default constructor
26405 and the default static constructor.
26407 (Constructor::) Another class that starts using `public readonly'
26408 instead of properties.
26410 (Constructor::IsDefault): Whether this is a default constructor.
26412 (Field::) use readonly public fields instead of properties also.
26414 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
26415 track of static constructors; If none is used, turn on
26416 BeforeFieldInit in the TypeAttributes.
26418 * cs-parser.jay (opt_argument_list): now the return can be null
26419 for the cases where there are no arguments.
26421 (constructor_declarator): If there is no implicit `base' or
26422 `this', then invoke the default parent constructor.
26424 * modifiers.cs (MethodAttr): New static function maps a set of
26425 modifiers flags into a MethodAttributes enum
26426 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
26427 MethodAttr, TypeAttr to represent the various mappings where the
26428 modifiers are used.
26429 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
26431 2001-08-19 Miguel de Icaza <miguel@ximian.com>
26433 * parameter.cs (GetParameterInfo): Fix bug where there would be no
26436 * interface.cs (PopulateIndexer): Implemented the code generator
26437 for interface indexers.
26439 2001-08-17 Miguel de Icaza <miguel@ximian.com>
26441 * interface.cs (InterfaceMemberBase): Now we track the new status
26444 (PopulateProperty): Implement property population. Woohoo! Got
26445 Methods and Properties going today.
26447 Removed all the properties for interfaces, and replaced them with
26448 `public readonly' fields.
26450 2001-08-16 Miguel de Icaza <miguel@ximian.com>
26452 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
26453 initialize their hashtables/arraylists only when they are needed
26454 instead of doing this always.
26456 * parameter.cs: Handle refs and out parameters.
26458 * cs-parser.jay: Use an ArrayList to construct the arguments
26459 instead of the ParameterCollection, and then cast that to a
26462 * parameter.cs: Drop the use of ParameterCollection and use
26463 instead arrays of Parameters.
26465 (GetParameterInfo): Use the Type, not the Name when resolving
26468 2001-08-13 Miguel de Icaza <miguel@ximian.com>
26470 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
26471 and instead use public readonly fields.
26473 * class.cs: Put back walking code for type containers.
26475 2001-08-11 Miguel de Icaza <miguel@ximian.com>
26477 * class.cs (MakeConstant): Code to define constants.
26479 * rootcontext.cs (LookupType): New function. Used to locate types
26482 2001-08-08 Miguel de Icaza <miguel@ximian.com>
26484 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
26485 this System.Reflection code is. Kudos to Microsoft
26487 * typemanager.cs: Implement a type cache and avoid loading all
26488 types at boot time. Wrap in LookupType the internals. This made
26489 the compiler so much faster. Wow. I rule!
26491 * driver.cs: Make sure we always load mscorlib first (for
26492 debugging purposes, nothing really important).
26494 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
26495 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
26497 * rootcontext.cs: Lookup types on their namespace; Lookup types
26498 on namespaces that have been imported using the `using' keyword.
26500 * class.cs (TypeContainer::TypeAttr): Virtualize.
26501 (Class::TypeAttr): Return attributes suitable for this bad boy.
26502 (Struct::TypeAttr): ditto.
26503 Handle nested classes.
26504 (TypeContainer::) Remove all the type visiting code, it is now
26505 replaced with the rootcontext.cs code
26507 * rootcontext.cs (GetClassBases): Added support for structs.
26509 2001-08-06 Miguel de Icaza <miguel@ximian.com>
26511 * interface.cs, statement.cs, class.cs, parameter.cs,
26512 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
26513 Drop use of TypeRefs, and use strings instead.
26515 2001-08-04 Miguel de Icaza <miguel@ximian.com>
26519 * class.cs (Struct::Struct): set the SEALED flags after
26520 checking the modifiers.
26521 (TypeContainer::TypeAttr): new property, returns the
26522 TypeAttributes for a class.
26524 * cs-parser.jay (type_list): Oops, list production was creating a
26525 new list of base types.
26527 * rootcontext.cs (StdLib): New property.
26528 (GetInterfaceTypeByName): returns an interface by type name, and
26529 encapsulates error handling here.
26530 (GetInterfaces): simplified.
26531 (ResolveTree): Encapsulated all the tree resolution here.
26532 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
26535 * driver.cs: Add support for --nostdlib, to avoid loading the
26536 default assemblies.
26537 (Main): Do not put tree resolution here.
26539 * rootcontext.cs: Beginning of the class resolution.
26541 2001-08-03 Miguel de Icaza <miguel@ximian.com>
26543 * rootcontext.cs: Provide better error reporting.
26545 * cs-parser.jay (interface_base): set our $$ to be interfaces.
26547 * rootcontext.cs (CreateInterface): Handle the case where there
26548 are no parent interfaces.
26550 (CloseTypes): Routine to flush types at the end.
26551 (CreateInterface): Track types.
26552 (GetInterfaces): Returns an array of Types from the list of
26553 defined interfaces.
26555 * typemanager.c (AddUserType): Mechanism to track user types (puts
26556 the type on the global type hash, and allows us to close it at the
26559 2001-08-02 Miguel de Icaza <miguel@ximian.com>
26561 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
26562 RecordInterface instead.
26564 * cs-parser.jay: Updated to reflect changes above.
26566 * decl.cs (Definition): Keep track of the TypeBuilder type that
26567 represents this type here. Not sure we will use it in the long
26568 run, but wont hurt for now.
26570 * driver.cs: Smaller changes to accomodate the new code.
26572 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
26575 * rootcontext.cs (CreateInterface): New method, used to create
26576 the System.TypeBuilder type for interfaces.
26577 (ResolveInterfaces): new entry point to resolve the interface
26579 (CodeGen): Property, used to keep track of the code generator.
26581 2001-07-26 Miguel de Icaza <miguel@ximian.com>
26583 * cs-parser.jay: Add a second production for delegate_declaration
26586 (enum_body): Put an opt_comma here instead of putting it on
26587 enum_body or enum_member_declarations so we can handle trailing
26588 commas on enumeration members. Gets rid of a shift/reduce.
26590 (type_list): Need a COMMA in the middle.
26592 (indexer_declaration): Tell tokenizer to recognize get/set
26594 * Remove old targets.
26596 * Re-add the parser target.
26598 2001-07-13 Simon Cozens <simon@simon-cozens.org>
26600 * cs-parser.jay: Add precendence rules for a number of operators
26601 ot reduce the number of shift/reduce conflicts in the grammar.
26603 2001-07-17 Miguel de Icaza <miguel@ximian.com>
26605 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
26608 Get rid of old crufty code.
26610 * rootcontext.cs: Use this to keep track of the parsed
26611 representation and the defined types available to the program.
26613 * gen-treedump.cs: adjust for new convention.
26615 * type.cs: Split out the type manager, and the assembly builder
26618 * typemanager.cs: the type manager will live here now.
26620 * cil-codegen.cs: And the code generator here.
26622 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
26624 * makefile: Fixed up for easy making.
26626 2001-07-13 Simon Cozens <simon@simon-cozens.org>
26628 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
26631 (unary_expression): Expand pre_increment_expression and
26632 post_decrement_expression to reduce a shift/reduce.
26634 2001-07-11 Simon Cozens
26636 * cs-tokenizer.cs: Hex numbers should begin with a 0.
26638 Improve allow_keyword_as_indent name.
26640 2001-06-19 Miguel de Icaza <miguel@ximian.com>
26642 * Adjustments for Beta2.
26644 2001-06-13 Miguel de Icaza <miguel@ximian.com>
26646 * decl.cs: Added `Define' abstract method.
26647 (InTransit): new property, used to catch recursive definitions.
26649 * interface.cs: Implement `Define'.
26651 * modifiers.cs: Map Modifiers.constants to
26652 System.Reflection.TypeAttribute flags.
26654 * class.cs: Keep track of types and user-defined types.
26655 (BuilderInit): New method for creating an assembly
26656 (ResolveType): New function to launch the resolution process, only
26657 used by interfaces for now.
26659 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
26660 that are inserted into the name space.
26662 2001-06-08 Miguel de Icaza <miguel@ximian.com>
26664 * ARGH. I have screwed up my tree so many times due to the use of
26665 rsync rather than using CVS. Going to fix this at once.
26667 * driver.cs: Objetify driver. Load assemblies, use assemblies to
26670 2001-06-07 Miguel de Icaza <miguel@ximian.com>
26672 * Experiment successful: Use System.Type rather that our own
26675 2001-05-25 Miguel de Icaza <miguel@ximian.com>
26677 * cs-parser.jay: Removed nsAliases from here.
26679 Use new namespaces, handle `using XXX;'
26681 * namespace.cs: Reimplemented namespace handling, use a recursive
26682 definition of the class. Now we can keep track of using clauses
26683 and catch invalid using clauses.
26685 2001-05-24 Miguel de Icaza <miguel@ximian.com>
26687 * gen-treedump.cs: Adapted for all the renaming.
26689 * expression.cs (Expression): this class now has a Type property
26690 which returns an expression Type.
26692 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
26693 `Type', as this has a different meaning now in the base
26695 2001-05-22 Miguel de Icaza <miguel@ximian.com>
26697 * interface.cs, class.cs: Removed from all the sources the
26698 references to signature computation, as we can not do method
26699 signature computation during the parsing time, as we are not
26700 trying to solve at that point distinguishing:
26704 void a (NS.Blah x) {}
26707 Which depending on the context might be valid or not, as we do not
26708 know if Blah is the same thing as NS.Blah at that point.
26710 * Redid everything so the code uses TypeRefs now instead of
26711 Types. TypeRefs are just temporary type placeholders, that need
26712 to be resolved. They initially have a pointer to a string and the
26713 current scope in which they are used. This is used later by the
26714 compiler to resolve the reference to an actual Type.
26716 * DeclSpace is no longer a CIR.Type, and neither are
26717 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
26718 are all DeclSpaces, but no Types.
26720 * type.cs (TypeRefManager): This implements the TypeRef manager,
26721 which keeps track of all the types that need to be resolved after
26722 the parsing has finished.
26724 2001-05-13 Miguel de Icaza <miguel@ximian.com>
26726 * ARGH. We are going to have to store `foreach' as a class rather
26727 than resolving it, as we need to verify error 1579 after name
26728 resolution. *OR* we could keep a flag that says `This request to
26729 IEnumerator comes from a foreach statement' which we can then use
26730 to generate the error.
26732 2001-05-10 Miguel de Icaza <miguel@ximian.com>
26734 * class.cs (TypeContainer.AddMethod): we now add methods to the
26735 MethodGroup instead of the method hashtable.
26737 * expression.cs: Add MethodGroup abstraction, which gets us one
26738 step closer to the specification in the way we handle method
26741 * cs-parser.jay (primary_expression): qualified_identifier now
26742 tried to match up an identifier to a local variable reference or
26743 to a parameter reference.
26745 current_local_parameters is now a parser global variable that
26746 points to the current parameters for the block, used during name
26749 (property_declaration): Now creates an implicit `value' argument to
26752 2001-05-09 Miguel de Icaza <miguel@ximian.com>
26754 * parameter.cs: Do not use `param' arguments as part of the
26755 signature, per the spec.
26757 2001-05-08 Miguel de Icaza <miguel@ximian.com>
26759 * decl.cs: Base class for classes, structs and interfaces. This
26760 is the "Declaration Space"
26762 * cs-parser.jay: Use CheckDef for checking declaration errors
26763 instead of having one on each function.
26765 * class.cs: Factor out some code for handling error handling in
26766 accordance to the "Declarations" section in the "Basic Concepts"
26767 chapter in the ECMA C# spec.
26769 * interface.cs: Make all interface member classes derive from
26770 InterfaceMemberBase.
26772 2001-05-07 Miguel de Icaza <miguel@ximian.com>
26774 * Many things: all interfaces are parsed and generated in
26775 gen-treedump. Support for member variables, constructors,
26776 destructors, properties, constants is there.
26778 Beginning of the IL backend, but very little done, just there for
26781 2001-04-29 Miguel de Icaza <miguel@ximian.com>
26783 * cs-parser.jay: Fix labeled statement.
26785 * cs-tokenizer.cs (escape): Escape " and ' always.
26786 ref_line, ref_name: keep track of the line/filename as instructed
26787 by #line by the compiler.
26790 2001-04-27 Miguel de Icaza <miguel@ximian.com>
26792 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
26793 to match the values in System.CodeDOM.
26795 Divid renamed to Divide.
26797 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
26799 (Statements.set): remove.
26801 * System.CodeDOM/CodeCatchClause.cs: always have a valid
26804 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
26805 falseStatements always have valid values.
26807 * cs-parser.jay: Use System.CodeDOM now.