1 2008-07-07 Marek Safar <marek.safar@gmail.com>
4 * cs-parser.jay: Report nullable use in mcs for some cases.
6 2008-07-07 Marek Safar <marek.safar@gmail.com>
8 * ecore.cs: Improved argument mismatch error messages.
10 2008-07-07 Marek Safar <marek.safar@gmail.com>
12 * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
14 2008-07-07 Marek Safar <marek.safar@gmail.com>
16 * expression.cs (TypeOf): Mutate type argument.
18 2008-07-04 Marek Safar <marek.safar@gmail.com>
20 * class.cs: Report missing partial modifier for correct type.
22 2008-07-04 Marek Safar <marek.safar@gmail.com>
24 * ecore.cs, expression.cs (VariableReference): Variable property is
27 2008-07-04 Marek Safar <marek.safar@gmail.com>
29 * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
31 2008-07-04 Marek Safar <marek.safar@gmail.com>
33 * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
36 2008-07-04 Marek Safar <marek.safar@gmail.com>
38 * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
39 anonymous method storey to an instance method when only "this" is hoisted.
41 2008-07-03 Marek Safar <marek.safar@gmail.com>
44 * expression.cs: Pointer comparisons use unsigned operator.
46 2008-07-03 Marek Safar <marek.safar@gmail.com>
48 * expression.cs: Fixed native pointer conversions. Also fixes #321615.
50 2008-07-02 Marek Safar <marek.safar@gmail.com>
53 * class.cs: Always initialize local unsafe variables.
55 2008-06-30 Marek Safar <marek.safar@gmail.com>
58 * expression.cs (NewInitialize): Clear local temporary variable for next run
60 2008-06-27 Marek Safar <marek.safar@gmail.com>
63 * ecore.cs: Both types and modifiers have to match for ref and out arguments
65 2008-06-27 Marek Safar <marek.safar@gmail.com>
68 * cs-parser.jay: Implemented undocumented base access expression inside
71 2008-06-26 Marek Safar <marek.safar@gmail.com>
74 * cs-parser.jay: Parse namespace declaration using qualified identifier.
76 2008-06-26 Marek Safar <marek.safar@gmail.com>
79 * convert.cs: Fixed explicit array to interface cast.
81 2008-06-26 Marek Safar <marek.safar@gmail.com>
84 * delegate.cs: Mutate DelegateInvocation type.
86 2008-06-26 Marek Safar <marek.safar@gmail.com>
89 * delegate.cs: Box a load of generic parameters.
91 2008-06-26 Marek Safar <marek.safar@gmail.com>
93 * expression.cs: Add an array creation arguments mutate.
95 2008-06-26 Marek Safar <marek.safar@gmail.com>
98 * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
101 2008-06-25 Marek Safar <marek.safar@gmail.com>
103 * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
106 2008-06-25 Marek Safar <marek.safar@gmail.com>
108 A fix for bug #403518
109 * delegate.cs: Type correctly anonymous method new invocation.
111 2008-06-24 Marek Safar <marek.safar@gmail.com>
113 A fix for bug #394826
114 * anonymous.cs: Fully qualify members when resolving anonymous type internal
117 2008-06-24 Marek Safar <marek.safar@gmail.com>
119 A fix for bug #394826
120 * anonymous.cs, iterators.cs: Construct generic storey only when is really
123 2008-06-24 Marek Safar <marek.safar@gmail.com>
125 * class.cs: Clone indexer parameters for localized capturing.
127 2008-06-24 Marek Safar <marek.safar@gmail.com>
129 A fix for bug #402379
130 * expression.cs: Don't crash when an object initializer resolve fails.
132 2008-06-24 Marek Safar <marek.safar@gmail.com>
134 A fix for bug #402888
135 * expression.cs: Mutate conditional expression.
137 2008-06-24 Marek Safar <marek.safar@gmail.com>
139 A fix for bug #401012
140 * class.cs: Keep StructLayout in shared container.
142 2008-06-24 Marek Safar <marek.safar@gmail.com>
144 A fix for bug #400438
145 * decl.cs, class.cs: Only properties can be automatically implemented.
147 2008-06-24 Marek Safar <marek.safar@gmail.com>
149 * statement.cs (ChangeToIterator): Copy also labels.
151 2008-06-23 Marek Safar <marek.safar@gmail.com>
153 * ecore.cs: Pass type argument details to parent extension method.
155 2008-06-23 Marek Safar <marek.safar@gmail.com>
157 A fix for bug #375966
158 * delegate.cs: Fixed IsTypeCovariant generic type conversions.
160 2008-06-23 Raja R Harinath <harinath@hurrynot.org>
162 * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
164 2008-06-22 Marek Safar <marek.safar@gmail.com>
166 A fix for bug #394347
167 * anonymous.cs: Cache compatible delegates as compatibility check produces
168 a new method every time.
170 2008-06-20 Marek Safar <marek.safar@gmail.com>
172 * anonymous.cs: Propagate storey reference for single references.
174 2008-06-20 Marek Safar <marek.safar@gmail.com>
176 A fix for bug #387615
177 * assign.cs, expression.cs: Correctly clone compound assignment.
179 2008-06-19 Marek Safar <marek.safar@gmail.com>
181 A fix for bug #359611, #359604
182 * anonymous.cs: Mutate all types of hoisted parameters.
184 2008-06-19 Marek Safar <marek.safar@gmail.com>
186 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
187 delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
188 expression.cs, codegen.cs, statement.cs
190 Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
191 #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
193 ** Anonymous methods, lambda expressions rewrite **
195 Anonymous expressions are now resolved when an explicit block is resolved
196 and they don't require any registration procedure anymore. Further,
197 anonymous methods are defined when explicit block is emitted which allows
198 better control of whole process and opens possibilities for more
199 optimizations as well as alternative to reverse whole process.
201 A concept of `MutateHoistedGenericType' was introduced to keep the resolve
202 process consistent and to correctly emit hoisted generic methods when they
203 have at least 1 hoisted variable.
205 2008-06-17 Martin Baulig <martin@ximian.com>
207 * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
209 (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
210 virtual property; check it in Emit().
211 (PropertyMethod.IsDebuggerHidden): Override, check whether we're
213 (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
215 (Indexer.Define): Likewise.
217 2008-06-17 Marek Safar <marek.safar@gmail.com>
219 * convert.cs: Don't use IsInterface on type arguments.
221 * delegate.cs: DelegateInvocation uses MethodInfo.
223 * parameter.cs: Removed IsTypeParameter.
225 * generic-mcs.cs: More missing stuff.
227 2008-06-16 Martin Baulig <martin@ximian.com>
230 (Modifiers.DEBUGGER_HIDDEN): New public const.
233 (TypeManager.GetDebuggerHiddenAttribute): New public static method.
236 (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
237 (AbstractPropertyEventMethod): Likewise.
238 (Constructor.Emit): Likewise.
239 (SourceMethod.SetCompilerGenerated): Removed.
241 * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
245 (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
246 if we're an `IteratorHost'.
247 (AnonymousMethodMethod..ctor): Don't set
248 `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
251 2008-06-16 Marek Safar <marek.safar@gmail.com>
253 * statement.cs: Clean-up foreach statements.
255 2008-06-12 Marek Safar <marek.safar@gmail.com>
257 * class.cs: Stop using public method which should not exist.
259 2008-06-11 Martin Baulig <martin@ximian.com>
262 (Location.LookupFile): Add `CompilationUnit' argument; when given
263 a relative file name, make it relative to the directory the .cs
264 file is located in instead of using the current directory.
266 2008-06-11 Martin Baulig <martin@ximian.com>
269 (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
270 (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
271 (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
272 (SourceMethod.SetCompilerGenerated): Likewise.
274 2008-06-11 Marek Safar <marek.safar@gmail.com>
276 * codegen.cs, driver: Only write symbol file when it's asked for.
278 2008-06-11 Marek Safar <marek.safar@gmail.com>
280 * codegen.cs: Don't use assembly writer error handling for symbol writer.
282 2008-06-10 Martin Baulig <martin@ximian.com>
284 * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
286 2008-06-09 Marek Safar <marek.safar@gmail.com>
288 A fix for bug #316290
289 * expression.cs: Include decimal operators in predefined table.
291 * parameters.cs: More readonlyness.
293 2008-06-09 Marek Safar <marek.safar@gmail.com>
295 A fix for bug #397213
296 * cs-parser.jay: One more missing current_local_parameters reset.
298 2008-06-09 Marek Safar <marek.safar@gmail.com>
300 A fix for bug #396633
301 * class.cs: Host backing field in partial container.
303 2008-06-09 Marek Safar <marek.safar@gmail.com>
305 A fix for bug #397068
306 * expression.cs: Check both operand types when predefined operator is used.
308 2008-06-05 Martin Baulig <martin@ximian.com>
310 Merged the `debugger-kahalo' branch.
313 (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
314 we're an iterator method.
315 (SourceMethod): Reflect latest symbol writer changes;
316 SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
317 now `start_row' and `end_row'.
318 (Constructor.Emit): Fix the logic whether to emit symbol information.
320 * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
324 (CompilationUnit): New public class; derives from `SourceFile'.
325 (SourceFileEntry.DefineSymbolInfo): New public method.
326 (SourceFileEntry.SetChecksum): New public method.
327 (Location): Encode hidden line numbers by using `column == 255';
328 the .ctor now accepts `column == -1' to mark a hidden line number.
329 (Location.Hidden): New public property.
330 (Location.CheckPoint): Add `CompilationUnit'.
331 (Location.SourceFiles): Change return type to `CompilationUnit[]'.
332 (Location.Push): Add `CompilationUnit compile_unit' argument.
333 (Location.CompilationUnit): New public property.
336 (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
338 * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
340 * driver.cs: `SourceFile' -> `CompilationUnit'.
342 * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
344 * namespace.cs: `SourceFile' -> `CompilationUnit'.
346 * cs-tokenizer.cs: Add support for `#pragma checksum' and
350 (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
351 new symbol writer API to also pass the file.
353 2008-06-05 Marek Safar <marek.safar@gmail.com>
355 * statement.cs: Emit catch variable assignment using variable expression.
357 2008-06-05 Marek Safar <marek.safar@gmail.com>
359 * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
360 with other variable types.
362 2008-06-04 Marek Safar <marek.safar@gmail.com>
364 * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
365 GetLength method emit, it breaks resolve rules.
367 2008-06-02 Atsushi Enomoto <atsushi@ximian.com>
368 Marek Safar <marek.safar@gmail.com>
370 A fix for bug #395542
371 * cs-parser.jay: The trailing comma is allowed in anonymous type member
374 2008-06-02 Marek Safar <marek.safar@gmail.com>
376 A fix for bug #395287
377 * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
379 2008-05-31 Marek Safar <marek.safar@gmail.com>
381 A fix for bug #395845
382 * class.cs, nullable.cs: User unary operator is allowed to have nullable and
383 non-nullable parameter type.
385 2008-05-31 Marek Safar <marek.safar@gmail.com>
387 * class.cs: Handle contructor initializer as a statement in top-level block.
389 2008-05-30 Marek Safar <marek.safar@gmail.com>
391 * attribute.cs: Don't mix old and new corlib types when emitting corlib
394 2008-05-24 Marek Safar <marek.safar@gmail.com>
396 * ecore.cs, expression.cs: Small IVariable refactoring.
398 2008-05-22 Marek Safar <marek.safar@gmail.com>
400 * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
402 2008-05-21 Marek Safar <marek.safar@gmail.com>
404 * cs-parser.jay: Removed redundant catch type check.
406 2008-05-21 Marek Safar <marek.safar@gmail.com>
408 A fix for bug #390372
409 * nullable.cs: Set correct return type.
411 2008-05-21 Marek Safar <marek.safar@gmail.com>
413 A fix for bug #391062
414 * typemanager.cs: Fixed crash when comparing null types.
416 2008-05-21 Marek Safar <marek.safar@gmail.com>
418 A fix for bug #391871
419 * cs-parser.jay: Better error handling for invalid catch type.
421 2008-05-20 Marek Safar <marek.safar@gmail.com>
423 A fix for bug #392155
424 * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
426 2008-05-15 Marek Safar <marek.safar@gmail.com>
428 A fix for bug #390666
429 * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
432 2008-05-15 Marek Safar <marek.safar@gmail.com>
434 * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
437 2008-05-13 Marek Safar <marek.safar@gmail.com>
439 A fix for bug #389625
440 * delegate.cs, generic.cs: Some progress on method group return type
443 2008-05-13 Marek Safar <marek.safar@gmail.com>
445 A fix for bug #378419
446 * namespace.cs: Inspect also parent namespaces not only namespace entries.
448 2008-05-12 Marek Safar <marek.safar@gmail.com>
450 * class.cs (Constructor): Added IsCompilerGenerated.
452 2008-05-12 Marek Safar <marek.safar@gmail.com>
454 * expression.cs: Enum binary operators can accept non-enum operand only when
455 is implicitly convertible to underlying type.
457 2008-05-12 Marek Safar <marek.safar@gmail.com>
459 A fix for bug #389272
460 * support.cs: Workaround System.InvalidOperationException for enums.
462 2008-05-12 Marek Safar <marek.safar@gmail.com>
464 A fix for bug #389073
465 * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
467 2008-05-10 Marek Safar <marek.safar@gmail.com>
469 * driver.cs: Split Parse.
471 * location.cs (LookupFile): Uses string.Empty.
473 2008-05-07 Marek Safar <marek.safar@gmail.com>
475 * expression.cs, parameter.cs: Small ParameterReference clean up.
477 2008-05-07 Marek Safar <marek.safar@gmail.com>
479 * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
482 2008-05-06 Martin Baulig <martin@ximian.com>
484 * class.cs (Constructor.Emit): Fix the logic whether to emit
487 2008-05-06 Raja R Harinath <harinath@hurrynot.org>
490 * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
491 InvalidOperationException when the iterator is before the start or
494 2008-05-06 Marek Safar <marek.safar@gmail.com>
496 * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
497 when left is nullable type.
499 2008-05-06 Marek Safar <marek.safar@gmail.com>
501 A fix for bug #386628
502 * expression.cs (LocalVariableReference): Continue in resolving when
503 variable is not assigned.
505 2008-05-05 Marek Safar <marek.safar@gmail.com>
507 * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
510 2008-05-04 Marek Safar <marek.safar@gmail.com>
512 * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
513 it saves many redundant temporary variables for nullable operations.
515 2008-05-03 Marek Safar <marek.safar@gmail.com>
517 * assign.cs: EventAddOrRemove is a statement and cannot have a type.
519 * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
522 * nullable.cs: Constant coalescing operator optimizations.
524 2008-05-03 Marek Safar <marek.safar@gmail.com>
526 * constant.cs: Use unsigned conversion for values which are unsigned only.
528 2008-05-03 Marek Safar <marek.safar@gmail.com>
530 * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null
531 coalescing operator as it should be.
533 2008-05-02 Marek Safar <marek.safar@gmail.com>
535 A fix for bug #371016
536 * expression.cs: All predefined delegate operators require implicit method
539 2008-05-02 Marek Safar <marek.safar@gmail.com>
541 * constant.cs: Emit long constant as uint when fits the range.
543 * convert.cs, expression.cs: Fixed few unsafe conversions.
545 2008-05-02 Marek Safar <marek.safar@gmail.com>
547 * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
549 2008-05-02 Raja R Harinath <harinath@hurrynot.org>
552 * convert.cs (ImplicitNumericConversion): Don't modify the type of
554 * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
556 2008-05-01 Marek Safar <marek.safar@gmail.com>
558 * constant.cs, literal.cs: IsLiteral property for error reporting.
560 * ecore.cs, expression.cs: Implemented Property expression.
562 2008-05-01 Marek Safar <marek.safar@gmail.com>
564 * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
566 * nullable.cs: Implemented nullable coalescing null operator.
568 * ecore.cs, expression.cs: Expression trees work.
570 2008-05-01 Marek Safar <marek.safar@gmail.com>
572 * ecore.cs: CreateExpressionTree is finally abstract.
574 * expression.cs, linq.cs: Updated.
576 2008-05-01 Marek Safar <marek.safar@gmail.com>
578 * expression.cs, ecore.cs: Block base access expression inside expression
581 2008-05-01 Marek Safar <marek.safar@gmail.com>
583 A fix for bug #385058
584 * expression.cs: User-defined operator implementations always take
585 precedence over predefined operator implementations.
587 2008-04-30 Marek Safar <marek.safar@gmail.com>
589 * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
590 class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
591 expression tree conversions.
593 2008-04-30 Marek Safar <marek.safar@gmail.com>
595 * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
596 operators method details to Operator class.
598 2008-04-30 Marek Safar <marek.safar@gmail.com>
600 * anonymous.cs: Pass unsafe flags to anonymous container.
602 * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
603 inside expression tree.
605 2008-04-29 Martin Baulig <martin@ximian.com>
607 * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
608 (Tokenizer.PopPosition): Also restore the `line'.
610 2008-04-29 Marek Safar <marek.safar@gmail.com>
612 * delegate.cs: Implemented Invoke expression.
614 2008-04-29 Marek Safar <marek.safar@gmail.com>
616 * expression.cs: Fixed equality reference comparison regression.
618 2008-04-29 Marek Safar <marek.safar@gmail.com>
620 * ecore.cs: Clean up EmptyCast hack.
622 * expression.cs, nullable.cs: Implemented enum binary and unary operations
623 using correct conversion rules. Also fixes #383993.
625 2008-04-28 Martin Baulig <martin@ximian.com>
627 * class.cs (Constructor.Emit): Don't emit debugging information
628 for generated default .ctor's.
630 2008-04-28 Marek Safar <marek.safar@gmail.com>
632 * convert.cs: Empty-cast ushort to int conversion.
634 2008-04-28 Marek Safar <marek.safar@gmail.com>
636 A fix for bug #384191
637 * ecore.cs, expression.cs: Fixed expression cloning.
639 2008-04-28 Marek Safar <marek.safar@gmail.com>
641 * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
643 2008-04-28 Raja R Harinath <harinath@hurrynot.org>
645 Fix #381559, test-638.cs, test-639.cs
646 * assign.cs (CompoundAssign.Helper): New wrapper.
647 (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
649 * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
650 Pass unconverted expressions to the params array creation expression.
651 (FieldExpr.EmitAssign): Don't special-case StringConcat.
652 (PropertyExpr.EmitAssign): Likewise.
653 * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
654 element if it is of kind CompoundAssign.Helper.
655 (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
656 first before anything else.
657 (ArrayAccess.EmitAssign): Don't special-case StringConcat.
658 (ArrayAccess.LoadArrayAndArguments): Simplify.
660 2008-04-27 Marek Safar <marek.safar@gmail.com>
662 * expression.cs: Fixed cloning of typeof(void).
664 2008-04-27 Raja R Harinath <harinath@hurrynot.org>
666 * assign.cs (Assign.DoResolve): Remove support for EventExprs.
667 (Assign.Emit): Likewise. Move it to ...
668 (CompoundAssign.DoResolve): ... here and ...
669 (CompoundAssign.Emit): ... here.
670 (EventAddOrRemove): New helper to handle += and -= on events, and
671 avoid the use of BinaryDelegates.
672 * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
673 (EventExpr.EmitAddOrRemove): Improve.
674 * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
676 * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
677 create VarExprs for 'foo.bar.var'.
678 * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
679 is a highly inappropriate name for its functionality.
681 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
683 Simplify handling of multiple assignments
684 * assign.cs (Assign): Clear out all 'embedded assign' gunk. Make
686 (SimpleAssign): New. Class to be used for normal assignments.
687 * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
688 * expression.cs, parameter.cs, statement.cs: Likewise.
690 2008-04-25 Marek Safar <marek.safar@gmail.com>
692 * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
693 for incompatible underlying types, more to come, uff.
695 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
698 * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
701 2008-04-25 Marek Safar <marek.safar@gmail.com>
703 * expression.cs, nullable.cs: Implemented UnaryPlus expression.
705 2008-04-24 Raja R Harinath <harinath@hurrynot.org>
707 Fix test-636.cs. Sprinkle a few more 'EmitSideEffect's around
708 * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
709 * statement.cs (While, Do, For): Allow test to have side effects.
710 (For.DoEmit): Always emit InitStatement.
713 * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
714 Always create SideEffectConstant.
715 (Binary.EnumLiftUp): Don't assume that the enumeration constant is
716 of type EnumConstant.
718 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
719 Handle 'right' being SideEffectConstant of type 'bool'.
721 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
722 Use left.EmitBranchable instead of open coding it, so as to
723 improve optimization opportunities.
725 * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
727 * ecore.cs (Expression.EmitBranchable): Document some non-obvious
729 (Expression.EmitSideEffect): Document.
731 2008-04-23 Marek Safar <marek.safar@gmail.com>
733 * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
735 2008-04-23 Marek Safar <marek.safar@gmail.com>
737 * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
739 2008-04-23 Marek Safar <marek.safar@gmail.com>
741 * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
742 conversion to expression tree.
744 2008-04-23 Marek Safar <marek.safar@gmail.com>
746 * ecore.cs: Removed unused expression.
748 2008-04-22 Marek Safar <marek.safar@gmail.com>
750 * expression.cs: Implemented NegateChecked and New expressions.
752 2008-04-22 Marek Safar <marek.safar@gmail.com>
754 * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
756 2008-04-22 Raja R Harinath <harinath@hurrynot.org>
759 * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
760 needing final 'ret' instruction.
762 2008-04-22 Marek Safar <marek.safar@gmail.com>
764 * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
766 2008-04-21 Marek Safar <marek.safar@gmail.com>
768 * expression.cs: Emit ldnull and not null expression as an instance argument
769 of static method expression calls.
771 2008-04-21 Marek Safar <marek.safar@gmail.com>
773 A fix for bug #378200
774 * expression.cs: Fixed crash when creating parameterless expression tree
777 2008-04-21 Marek Safar <marek.safar@gmail.com>
779 A fix for bug #375297
780 * anonymous.cs: Fixed crash when inferring from null argument anonymous
783 2008-04-21 Marek Safar <marek.safar@gmail.com>
785 A fix for bug #377596
786 * decl.cs, class.cs: Emit delegate type argument attributes.
788 2008-04-21 Marek Safar <marek.safar@gmail.com>
790 A fix for bug #365314
791 * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
793 2008-04-21 Marek Safar <marek.safar@gmail.com>
795 * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
798 2008-04-21 Marek Safar <marek.safar@gmail.com>
800 * generic.cs (TypeParameter): Removed redundant location.
802 2008-04-19 Marek Safar <marek.safar@gmail.com>
804 * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
805 delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
806 FullNamedExpression in all declaration type expression, statements will come
809 2008-04-18 Marek Safar <marek.safar@gmail.com>
811 * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
812 nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
814 2008-04-18 Marek Safar <marek.safar@gmail.com>
816 * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
819 2008-04-17 Marek Safar <marek.safar@gmail.com>
821 * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
824 2008-04-17 Marek Safar <marek.safar@gmail.com>
826 * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
830 2008-04-17 Raja R Harinath <harinath@hurrynot.org>
832 Hook up 'EmitSideEffect'
833 * constant.cs (Constant.EmitSideEffect): New.
834 (SideEffectConstant.Emit): Simplify. Use EmitSideEffect.
835 (SideEffectConstant.EmitSideEffect): New.
836 * ecore.cs (BoxedCast.EmitBranchable): Remove. We can't use an
837 unconditional branch in EmitBranchable.
838 (FieldExpr.EmitBranchable): New.
839 * expression.cs (Unary.EmitSideEffect): New.
840 (Binary.EmitSideEffect): New.
841 (VariableReference.EmitSideEffect): New. Do nothing.
843 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
845 Introduce 'EmitSideEffect'
846 * ecore.cs (Expression.EmitSideEffect): New.
847 (TypeCast): Rename from EmptyCast.
849 (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
850 (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
851 * convert.cs, nullable.cs: Update to changes.
853 2008-04-16 Marek Safar <marek.safar@gmail.com>
855 * class.cs, cs-parser.jay: Early check for base types expression.
857 2008-04-16 Marek Safar <marek.safar@gmail.com>
859 * decl.cs (MemberName): Declare PrettyName as obsolete.
861 2008-04-16 Marek Safar <marek.safar@gmail.com>
863 * namespace.cs: Use MemberName comparison.
865 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
868 * decl.cs (MemberName.PrettyName): New. Replaces the misnamed
870 (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
871 (MemberName.FullyQualifiedName): New. Provides the functionality
872 that users assume FullName would have.
873 * ecore.cs, namespace.cs: Update to changes.
875 * statement.cs (Using.assign): Make into ExpressionStatement.
876 (Using.EmitPreTryBody): Simplify.
878 2008-04-16 Marek Safar <marek.safar@gmail.com>
880 * report.cs: ColorFormat is protected.
882 * rootcontext.cs: Unused fields clean-up.
884 * namespace.cs: Made UsingEntry name private.
886 2008-04-16 Marek Safar <marek.safar@gmail.com>
888 * cs-tokenizer.cs, location.cs: Removed unused field.
890 2008-04-16 Jan Oravec <jan.oravec@6com.sk>
891 Raja R Harinath <harinath@hurrynot.org>
894 * constant.cs (SideEffectConstant.value): Rename from 'left'.
895 (SideEffectConstant.side_effect): Rename from 'right'.
896 (SideEffectConstant..ctor): Normalize 'side_effect'.
897 (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
898 value of this constant.
899 * cfold.cs: Update to changes.
901 2008-04-15 Marek Safar <marek.safar@gmail.com>
903 * cs-paser.jay: Removed unused variable.
905 * driver.cs: Made Compile instance method.
907 2008-04-15 Raja R Harinath <harinath@hurrynot.org>
909 * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
911 2008-04-15 Marek Safar <marek.safar@gmail.com>
913 * cs-paser.jay, namespace.cs: Simplified handling of namespace imports.
915 2008-04-13 Jb Evain <jbevain@novell.com>
917 * namespace.cs: update the System.Core fullname for 2.1
918 * driver.cs: update the list of required assemblies for 2.1.
919 Merged from the Moonlight 2 branch.
921 2008-04-11 Marek Safar <marek.safar@gmail.com>
923 * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
924 types and user defined operators. User operators arguments has to be checked
925 for null value before invocation, which also means no operator is called
926 when any argument is not convertible to unwrapped nullable type.
928 2008-04-09 Marek Safar <marek.safar@gmail.com>
930 * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
931 of Unary expressions to follow operator overloading rules precisely.
932 Also fixes #321794, #323794
934 2008-04-08 Marek Safar <marek.safar@gmail.com>
936 * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
939 2008-04-08 Marek Safar <marek.safar@gmail.com>
941 * expression.cs, ecore.cs: Implemented MemberInit expression.
943 2008-04-08 Raja R Harinath <harinath@hurrynot.org>
945 Fix mono/tests/exception4.cs
946 * statement.cs (ExceptionStatement, TryCatch): Revert to using
947 ec.NeedReturnLabel () rather emitting a 'nop'.
949 * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
951 (TryCatch.SomeCodeFollows): Likewise.
952 * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
953 for 'break', 'continue' and 'return' statements inside a try.
954 We're fairly sure that the generated IL stream will have more
955 instructions textually following the try.
956 (FlowBranchingTryCatch): Likewise.
958 * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
959 * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
962 * statement.cs (CollectionForeach.DisposableWrapper): Make a true
963 wrapper -- forward everything to CollectionForeach.
964 (CollectionForeach.NonDisposableWrapper): New.
965 (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
966 instead of a pop + branch to end.
968 2008-04-07 Marek Safar <marek.safar@gmail.com>
970 A fix for bug #377485
971 * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs:
972 Propagate location for extension method groups. Report conversion failure at
975 2008-04-07 Marek Safar <marek.safar@gmail.com>
977 * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
978 ListInit and Field expressions.
980 2008-04-06 Raja R Harinath <harinath@hurrynot.org>
982 * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
983 Since $PC is always -1 inside the body of MoveNext, the fault
985 * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
986 * statement.cs (ExceptionStatement.emit_finally): Likewise.
987 (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
989 The denouement! Fix #324708
990 * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
991 (Iterator.EmitYieldBreak): We no longer need to reset $PC.
992 * statement.cs (ExceptionStatement.DoEmit): Actually emit the
993 'finally' inside the finally clause.
995 * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
996 inside an iterator. Don't emit the body of the 'finally' inside
997 the finally clause yet.
999 Use the ResumableStatement infrastructure for MoveNext ()
1000 * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
1001 (Iterator.EmitMoveNext): Use 'resume_points'. Get rid of
1002 'old_resume_points'. Move dispatcher upfront.
1003 (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
1004 * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
1005 in an enumerator. This encodes the main fix in this patch series
1006 -- we can only jump into the first instruction of a try from the
1007 outside, but we want to emit try/finally regions in iterators and
1008 resume in the middle of them.
1010 2008-04-05 Raja R Harinath <harinath@hurrynot.org>
1012 * statement.cs (ExceptionStatement.ResolveFinally): Move setting
1013 of NeedReturnLabel here.
1015 Introduce a common point for emitting try/finally to IL
1016 * statement.cs (ExceptionStatement.DoEmit): New. Combines all the
1017 features of the various subclasses, which are now driven by ...
1018 (ExceptionStatement.EmitPreTryBody): ... this and ...
1019 (ExceptionStatement.EmitTryBody): ... this and the original
1021 (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
1022 Remove DoEmit and update to follow above protocol.
1024 * statement.cs (ExceptionStatement.EmitForDispose): If all labels
1025 of the dispatcher are the same, skip emitting the 'switch'.
1026 * iterator.cs (Iterator.EmitDispose): Update to changes.
1028 Clean up handling of 'using' statement
1029 * statement.cs (UsingTemporary): New. Carved out of ...
1030 (Using): ... this. Simplify drastically. Handle exactly
1032 * cs-parser.jay (using_statement): Split. Create UsingTemporary
1033 or Using as appropriate. If there are multiple variable declared,
1034 create nested Using statements.
1035 (resource_acquisition): Kill.
1037 * statement.cs (ExceptionStatement.EmitForDispose): Use
1038 EmitFinallyBody, not EmitFinally.
1040 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
1041 * iterator.cs: Update to changes.
1043 Start using the ResumableStatement infrastructure
1044 * statement.cs (ResumeableStatement.PrepareForDispose): New.
1045 (ResumableStatement.EmitForDispose): New.
1046 (ExceptionStatement): Override them.
1047 * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
1048 EmitForDispose to create the body of the Dispose method. Don't
1051 * iterator.cs (Iterator.AddResumePoint): Move here from ...
1052 * statement.cs (Toplevel.AddResumePoint): ... here.
1053 (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
1054 * flowanalysis.cs (FlowBranchingIterator): New.
1055 * codegen.cs (EmitContext): Update to changes.
1057 * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
1058 (Iterator.old_resume_points): Rename from 'resume_points'.
1059 (Iterator.MoveNextStatement): Remove unused class.
1061 New infrastructure for try/finally in iterators (still unused)
1062 * flowanalysis.cs (FlowBranching.AddResumePoint): New.
1063 (FlowBranchingToplevel.AddResumePoint): Hook into
1064 ToplevelBlock.AddResumePoint.
1065 (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
1066 (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
1067 * statement.cs (ToplevelBlock.AddResumePoint): New. Collect
1068 resume points and assign program-counter values.
1069 (ExceptionBlock.AddResumePoint): Collect resume points for
1070 de-muxer at the top of try block.
1071 * iterators.cs (Yield.CheckContext): Simplify.
1072 (Yield.Resolve): Use FlowBranching.AddResumePoint.
1074 2008-04-04 Raja R Harinath <harinath@hurrynot.org>
1076 * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
1077 argument to an ExitStatement.
1078 (FlowBranchingException): Refactor saved origins code.
1079 * statement.cs (ExitStatement): Update to cahges.
1080 * iterator.cs (YieldBreak): Likewise.
1082 * statement.cs (ResumableStatement): New. Common base class for
1083 YieldReturn and ExceptionStatement.
1084 (ExitStatement): New. Common base class for Return and YieldBreak.
1085 (Return): Update to changes.
1086 * iterator.cs (YieldBreak): Likewise.
1087 * lambda.cs (ContextualReturn): Likewise.
1090 * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
1091 emit a meaningful error message.
1093 Fix #324765, #319508
1094 * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
1095 (VariableInfo.SetAssigned): Set it.
1096 * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
1097 determine if CS0219 or CS0168 is appropriate. Don't use
1098 flow-analysis information.
1099 (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
1100 * codegen.cs (EmitContext.DoEndFlowBranching): Kill. Inline into ...
1101 (EmitContext.EndFlowBranching): ... this.
1103 2008-04-03 Marek Safar <marek.safar@gmail.com>
1105 * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
1107 2008-04-03 Marek Safar <marek.safar@gmail.com>
1109 A fix for bug #376508
1110 * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
1111 ImplicitConversionExists.
1113 2008-04-03 Marek Safar <marek.safar@gmail.com>
1115 * expression.cs (Binary): Added remaining binary operators to expression
1118 * nullable.cs: Optimize shift with null argument.
1120 2008-04-03 Raja R Harinath <harinath@hurrynot.org>
1122 Fix minor IL regression
1123 * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
1124 (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
1125 * cs-parser.jay (try_statement): Update to changes.
1127 * statement.cs (TryFinally.need_exc_block): Delete.
1128 (TryFinally): Update to changes.
1130 Now all ExceptionStatements are unconditional
1131 * statement.cs (CollectionForeach.DisposableWrapper): New.
1132 Extract out the try/finally code into a new wrapper.
1133 (CollectionForeach.Resolve): Use it to simplify the code.
1135 2008-04-02 Raja R Harinath <harinath@hurrynot.org>
1137 Start at simplifying ExceptionStatement semantics a bit
1138 * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
1139 * cs-parser.jay (try_statement): Update to changes.
1140 (opt_catch_clauses): Remove.
1141 * flowanalysis.cs: Update to changes.
1142 (FlowBranching.BranchingType.TryCatch): New.
1143 (FlowBranchingTryCatch): New.
1145 * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
1146 (FlowBranching.CreateBranching): Update to changes.
1147 (FlowBranchingBlock.AddSibling): Add sanity check.
1148 * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
1151 * iterators.cs (Iterator.MarkFinally): Remove.
1152 * statement.cs (ExceptionStatement): Update to changes.
1154 Add support for skipping over finally blocks at runtime. First
1155 in a series to fix #324708
1156 * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
1157 (Iterator.EmitMoveNext): Initialize it.
1158 * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
1159 branch over the body of the 'finally' clause.
1161 2008-03-31 Raja R Harinath <harinath@hurrynot.org>
1163 Avoid lopsided use of Foo/DoFoo names
1164 * statement.cs (ExpressionStatement.EmitFinallyBody):
1165 Rename from EmitFinally.
1166 (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
1167 * iterator.cs: Update to changes.
1169 2008-04-02 Marek Safar <marek.safar@gmail.com>
1171 * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
1172 based on UserOperatorCall. More binary nullable operators clean up.
1174 2008-04-02 Martin Baulig <martin@ximian.com>
1176 * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
1178 2008-04-02 Marek Safar <marek.safar@gmail.com>
1180 * nullable.cs: Merge user and empty conversions when lifting expression
1183 * expression.cs (StringConcat): Implemented expression tree representation.
1185 2008-04-01 Marek Safar <marek.safar@gmail.com>
1187 * nullable.cs: When lifting null literal and a user operator exists, no call
1190 2008-04-01 Marek Safar <marek.safar@gmail.com>
1192 * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
1195 2008-04-01 Marek Safar <marek.safar@gmail.com>
1197 * nullable.cs, expression.cs: Use namespace instead heavily nested
1198 monster abstract class.
1200 2008-04-01 Marek Safar <marek.safar@gmail.com>
1202 * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
1203 lifting of null literal and user operators. Clean up of some temporary
1206 2008-03-30 Raja R Harinath <harinath@hurrynot.org>
1208 Fix #368224, test-629.cs
1209 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
1210 if it crossed an unwind-protect boundary.
1211 * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
1212 (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
1213 inside an unwind-protected region.
1214 (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
1215 (Iterator.MarkYield): Add 'unwind_protect' parameter. Emit a
1216 'leave' instead of a 'br' if unwind-protected.
1217 (Iterator.EmitYieldBreak): Likewise.
1219 2008-03-29 Gert Driesen <drieseng@users.sourceforge.net>
1221 * driver.cs: Only define versioninfo resources if no win32 resource
1224 2008-03-28 Marek Safar <marek.safar@gmail.com>
1226 A fix for bug #372375
1227 * convert.cs: Fixed boxing of nullable types.
1229 2008-03-28 Marek Safar <marek.safar@gmail.com>
1231 * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
1234 2008-03-28 Marek Safar <marek.safar@gmail.com>
1236 A fix for bug #374619
1237 * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
1239 2008-03-27 Marek Safar <marek.safar@gmail.com>
1241 * lambda.cs: Check return type only for invocation.
1243 2008-03-27 Marek Safar <marek.safar@gmail.com>
1245 A fix for bug #374214
1246 * ecore.cs: Correctly report argument type mismatch.
1248 2008-03-27 Marek Safar <marek.safar@gmail.com>
1250 * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
1251 and not rely on broken IsEnum.
1253 2008-03-27 Marek Safar <marek.safar@gmail.com>
1255 * nullable.cs: New file, extracted from generic.cs.
1257 * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
1259 2008-03-27 Marek Safar <marek.safar@gmail.com>
1261 * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
1262 predefined comparison operators and null literals.
1264 * report.cs: New warning ID.
1266 2008-03-25 Marek Safar <marek.safar@gmail.com>
1268 A fix for bug #370577
1269 * lambda.cs: Check return type too.
1271 2008-03-25 Marek Safar <marek.safar@gmail.com>
1273 A fix for bug #372846
1274 * class.cs: Automatic properties can be declared as unsafe.
1276 2008-03-20 Marek Safar <marek.safar@gmail.com>
1278 * location.cs: Use string based concatenation.
1280 * expression.cs: LiftedBinaryOperator is gmcs only.
1282 2008-03-20 Marek Safar <marek.safar@gmail.com>
1284 * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
1285 conversions rules and expression trees.
1287 2008-03-19 Marek Safar <marek.safar@gmail.com>
1289 * delegate.cs: Use extension method source as delegate target.
1291 2008-03-19 Marek Safar <marek.safar@gmail.com>
1293 * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
1294 binary operations to be purely based on binary operations and optimized
1295 emitted code (30% less in some cases). Introduced ReducedExpression for ETs
1296 and other ET refactoring.
1298 * typemanager.cs: Fixed warning.
1300 2008-03-17 Marek Safar <marek.safar@gmail.com>
1302 * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
1304 * symbolwriter.cs: Fixed.
1306 2008-03-17 Marek Safar <marek.safar@gmail.com>
1308 * anonymous.cs, driver.cs: Reset anonymous types counters.
1310 2008-03-17 Marek Safar <marek.safar@gmail.com>
1312 * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
1314 * class.cs: Use fullname for all type member definitions.
1316 2008-02-19 Martin Baulig <martin@ximian.com>
1319 (IMethodData.EmitExtraSymbolInfo): New interface method.
1320 (MethodData.Emit): Call method.EmitExtraSymbolInfo().
1321 (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
1322 interface method here as an empty public virtual method.
1325 (AnonymousMethodMethod.ctor): Added `string real_name' argument.
1326 (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
1327 CodeGen.SymbolWriter.SetRealMethodName().
1329 2008-02-18 Martin Baulig <martin@ximian.com>
1332 (ScopeInfo.EmitType): Override this and emit debugging
1333 information for captured variables.
1334 (RootScopeInfo.EmitType): Override this and emit symbol
1335 information for a captured `this'.
1337 2008-02-15 Martin Baulig <martin@ximian.com>
1339 * iterators.cs: Emit debugging info.
1342 (EmitContext.Flags): Add `OmitDebuggingInfo'.
1343 (EmitContext.OmitDebuggingInfo): New public property.
1346 (While): Override Emit() and don't emit symbol info there; do it
1347 inside DoEmit() instead.
1348 (Block.Emit): Omit symbol information while emitting the scope
1349 initializers; don't ec.Mark() the `EndLocation'. Fix the lexical
1351 (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
1352 (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
1353 .ctor to make `IsIterator' work.
1355 2008-03-14 Martin Baulig <martin@ximian.com>
1357 * symbolwriter.cs: Added the new symbol writer function from the
1358 debugger's `terrania' branch; temporarily enclose them inside
1359 `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
1362 2008-03-14 Martin Baulig <martin@ximian.com>
1365 (SymbolWriter): Make this a public static class.
1368 (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
1369 class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
1371 2008-03-14 Marek Safar <marek.safar@gmail.com>
1373 A fix for bug #370577
1374 * statement.cs, lambda.cs: Added extra limitations when dealing with void
1377 2008-03-14 Marek Safar <marek.safar@gmail.com>
1379 * typemanager.cs (CSharpName): Made 250 times faster.
1381 2008-03-13 Marek Safar <marek.safar@gmail.com>
1383 * ecore.cs, expression.cs: Emit conversion for ET shift argument.
1385 2008-03-12 Marek Safar <marek.safar@gmail.com>
1387 * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
1388 crash when predefined field does not exist.
1390 2008-03-12 Marek Safar <marek.safar@gmail.com>
1392 * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
1394 2008-03-12 Marek Safar <marek.safar@gmail.com>
1396 * class.cs (FixedField): Don't crash when contructors are missing.
1398 2008-03-11 Marek Safar <marek.safar@gmail.com>
1400 * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
1401 convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
1402 check internal types accessibility for internal and external types.
1403 Replaced EnumToUnderlying by GetEnumUnderlyingType.
1405 2008-03-11 Marek Safar <marek.safar@gmail.com>
1407 * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
1408 convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
1409 attribute.cs, statement: Use corect instance of predefined types (work
1410 related to #364674).
1412 2008-03-07 Marek Safar <marek.safar@gmail.com>
1414 * expression.cs (TypeOfVoid): Fixed predefined method initialization.
1416 2008-03-07 Marek Safar <marek.safar@gmail.com>
1418 * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs,
1419 class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
1420 expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
1421 predefined types clean up, delayed predefined types members initialization
1422 (work related to #364674).
1424 2008-03-05 Marek Safar <marek.safar@gmail.com>
1426 * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
1428 2008-03-05 Marek Safar <marek.safar@gmail.com>
1430 * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
1431 delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
1432 predefined types clean up (work related to #364674).
1434 2008-03-04 Marek Safar <marek.safar@gmail.com>
1436 * ecore.cs: Print an error message instead of throwing exception.
1438 2008-03-04 Marek Safar <marek.safar@gmail.com>
1440 * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
1441 expression.cs, statement.cs: Unififed null literal representation.
1443 2008-03-03 Marek Safar <marek.safar@gmail.com>
1445 * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
1446 expression.cs: Refactored binary operators resolve phase and improved speed.
1447 The nullable code is still missing and won't work correctly, more fixes
1450 It also fixes #323726, #324312, #324248, and many other unreported issues.
1452 2008-02-29 Zoltan Varga <vargaz@gmail.com>
1454 * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs'
1457 2008-02-27 Marek Safar <marek.safar@gmail.com>
1459 * ecore.cs: Clean-up and split BetterConversion.
1461 2008-02-25 Raja R Harinath <harinath@hurrynot.org>
1464 * enum.cs (EnumMember.Value): Only access 'value' if
1465 ResolveValue says it's ok.
1466 (EnumMember.DoResolveValue): Don't set prev_member.value.
1467 (Enum.GetDefinition): Reverse arguments of Equals --
1468 EnumMember.Value can return 'null'.
1470 * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
1472 2008-02-22 Marek Safar <marek.safar@gmail.com>
1474 * generic.cs, expression.cs: More ongoing work on expression trees.
1476 2008-02-21 Marek Safar <marek.safar@gmail.com>
1478 * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
1479 handle missing matches when mutiple operators exist.
1481 2008-02-20 Marek Safar <marek.safar@gmail.com>
1483 A fix for bug #363218
1484 * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
1487 2008-02-20 Marek Safar <marek.safar@gmail.com>
1489 * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
1490 update. This time to deal correctly with SideEffectConstant expression used
1491 as an argument for another constant folding.
1493 2008-02-20 Raja R Harinath <harinath@hurrynot.org>
1495 * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
1498 2008-02-19 Marek Safar <marek.safar@gmail.com>
1500 * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
1502 2008-02-19 Marek Safar <marek.safar@gmail.com>
1504 A fix for bug #328136
1505 * expression.cs: Do not fold immediately LogicalAnd operators when the left
1506 side is a false constant, because we still need to evaluate the right-hand
1509 * statement.cs (If): Emit two types of boolean constants (simple constant,
1510 side-effect constant).
1512 2008-02-19 Marek Safar <marek.safar@gmail.com>
1514 * constant.cs (SideEffectConstant): Don't emit boolean constant.
1516 * expression.cs: Fold immediately LogicalAnd operators when both sides are
1519 2008-02-18 Marek Safar <marek.safar@gmail.com>
1521 A fix for bug #361457
1522 * ecore.cs (IsApplicable): Params methods have lower priority.
1524 * support.cs: Return correct parameter modifier for params types.
1526 2008-02-18 Marek Safar <marek.safar@gmail.com>
1528 * generic.cs (TypeParameter): Cache attribute target name.
1530 * support.cs: Removed unused variable.
1532 * typemanager.cs: Removed debugging leftover.
1534 * ecore.cs: Use local type instead of a property;
1536 * class.cs (VerifyMembers): Consider also parent to test whether type member
1539 * expression.cs (FullMethodDesc): Removed.
1541 * attribute.cs (IsValidArgumentType): Made static.
1543 2008-02-17 Raja R Harinath <harinath@hurrynot.org>
1545 Cleanup to be more readable.
1546 * Makefile (GMCS_PROFILE): Remove.
1547 (COMPILER_NAME): New helper.
1549 2008-02-15 Miguel de Icaza <miguel@novell.com>
1551 * cs-tokenizer.cs: if a conditional expression happens inside a
1552 (...) this also means that we do not need to de-ambiguate between
1553 an parenthesized expression and a cast.
1557 * constant.cs (SideEffectConstant): a constant value that happens
1558 to have a side effect.
1560 Fixes the build regressions introduced by the fix for #359789
1562 2008-02-14 Rodrigo Kumpera <rkumpera@novell.com>
1564 * expression.cs (Conditional.Emit): when emitting the ternary
1565 operator, use local variables to generate code verifiable code.
1567 The verifier cannot infer that the type on stack before the
1568 stloc.0 is executed is of type ParentB. This happens because the
1569 stack merge algorithm uses only parent types when deciding which
1570 is the common type. This is described in Part III 1.8.1.3 of ECMA
1573 This code compiled with mcs is not verifiable under MS. The MS
1574 verifier picks the first common interface of Foo and Bar, which is
1575 wrong, but doesn't use a full join type of the 2 interfaces.
1577 CSC uses a clever hack to compile such code in a verifiable
1578 way. It stores the intermediate values in a local variable with
1583 2008-02-14 Miguel de Icaza <miguel@novell.com>
1585 * expression.cs: Do not fold BitwiseAnd operators when the left
1586 side is a false constant, because we still need to evaluate the
1591 * support.cs: Instead of throwing an InternalErrorException when
1592 the position of the stream is outside the boundary of our buffer,
1593 reset the state of the reader, and restart the reading from the
1594 beginning of the file.
1596 2008-02-14 Marek Safar <marek.safar@gmail.com>
1598 * generic.cs (TypeParameter.GetMembers): Is not supported operation.
1600 2008-02-14 Marek Safar <marek.safar@gmail.com>
1602 A fix for bug #361686
1603 * decl.cs: A protected types used inside a private class which parents
1604 derives from the protected class are accessible.
1606 2008-02-13 Marek Safar <marek.safar@gmail.com>
1608 * generic.cs (ConstraintChecker): Use cached member lookup when looking for
1609 the parameterless constructor.
1611 2008-02-13 Marek Safar <marek.safar@gmail.com>
1613 * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
1614 lookup methods to use standard member cache when doing member lookup.
1616 2008-02-12 Marek Safar <marek.safar@gmail.com>
1618 * driver.cs: Don't report full path for referenced module as assembly error.
1620 2008-02-12 Marek Safar <marek.safar@gmail.com>
1622 * Makefile: Fixed `qh' target to work on all machines.
1624 * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
1625 expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
1626 and HasElementType with TypeManager implementation.
1628 2008-02-08 Marek Safar <marek.safar@gmail.com>
1630 A fix for bugs #325134, #359749
1631 * expression.cs, ecore.cs: Try to resolve an extension method even if the
1632 first binds point to non-method member expression.
1634 2008-02-08 Marek Safar <marek.safar@gmail.com>
1636 * cs-parser.jay: Null coalescing operator is not part of ISO-1.
1638 2008-02-08 Marek Safar <marek.safar@gmail.com>
1640 A fix for bugs #321394, #323028
1641 * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
1642 Reworked naive IsAccessibleAs implementation to handle nested types.
1644 2008-02-05 Jb Evain <jbevain@novell.com>
1646 * class.cs: use generic type comparison for parameters
1649 2008-02-05 Marek Safar <marek.safar@gmail.com>
1651 A fix for bug #325372
1652 * class.cs: Use generic type comparison when testing method signatures.
1654 2008-02-05 Marek Safar <marek.safar@gmail.com>
1656 A fix for bug #357047
1657 * ecore.cs: Applied C# 3.0 changes to better conversion.
1659 2008-02-05 Marek Safar <marek.safar@gmail.com>
1661 A fix for bug #358374
1662 * cs-parser.jay: Correctly set modifiers for all constructor types.
1664 2008-02-04 Marek Safar <marek.safar@gmail.com>
1666 A fix for bug #355251
1667 * generic.cs: Added base class constraint based type inference.
1669 2008-02-01 Marek Safar <marek.safar@gmail.com>
1671 A fix for bug #357255
1672 * decl.cs: One more missing visibility check.
1674 2008-02-01 Marek Safar <marek.safar@gmail.com>
1676 * support.cs: Fixed broken return.
1678 2008-01-25 Marek Safar <marek.safar@gmail.com>
1680 * report.cs: Correctly reset warnings count after probing.
1682 2008-01-25 Martin Baulig <martin@ximian.com>
1685 (NamespaceEntry.SymbolFileID): Make this work again after
1686 MemberName.ToString() is gone.
1688 2008-01-25 Marek Safar <marek.safar@gmail.com>
1690 * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
1693 2008-01-25 Marek Safar <marek.safar@gmail.com>
1695 * generic.cs: Use full implicit conversion for type inference fixing.
1697 2008-01-24 Marek Safar <marek.safar@gmail.com>
1699 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
1700 Fixed user operator conversions.
1702 2008-01-24 Marek Safar <marek.safar@gmail.com>
1704 * generic.cs: Do nullable type to null comparison optimization during
1707 2008-01-24 Marek Safar <marek.safar@gmail.com>
1709 A fix for bug #355163
1710 * generic.cs: Enabled l-value resolve on nullable expressions.
1712 2008-01-24 Marek Safar <marek.safar@gmail.com>
1714 A fix for bug #353986
1715 * class.cs: Ingore static ctors with parameters for any further checks.
1717 2008-01-24 Marek Safar <marek.safar@gmail.com>
1719 A fix for bug #354310
1720 * namespace.cs: Removed redundant check.
1722 2008-01-24 Marek Safar <marek.safar@gmail.com>
1724 A fix for bug #354928
1725 * expression.cs: ElementInitializers can be resolved only once.
1727 2008-01-24 Marek Safar <marek.safar@gmail.com>
1729 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
1730 Condition expressions.
1732 2008-01-23 Marek Safar <marek.safar@gmail.com>
1734 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
1736 2008-01-22 Marek Safar <marek.safar@gmail.com>
1738 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
1741 * generic.cs: Implemented coalesce expression.
1743 2008-01-22 Marek Safar <marek.safar@gmail.com>
1745 A fix for bug #355145
1746 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
1747 expression tree type inference.
1749 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
1752 * expression.cs (Binary.IsUnsignedType): Fix typo.
1754 2008-01-22 Marek Safar <marek.safar@gmail.com>
1756 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
1758 2008-01-22 Marek Safar <marek.safar@gmail.com>
1760 A fix for bug #355161
1761 * ecore.cs, expression.cs: Wider range of extension method supported
1764 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
1766 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
1767 AssemblyBuilder to operate in compiler context. Fixes mcs part of
1770 2008-01-22 Marek Safar <marek.safar@gmail.com>
1772 A fix for bug #355148
1773 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
1775 2008-01-22 Miguel de Icaza <miguel@novell.com>
1777 * expression.cs (CreateExpressionTree): Add support for or and
1778 logical or, and indent following the coding conventions.
1780 * typemanager.cs (LinqExpression): renamed from
1781 ExpressionTreeManager, for a shorter name.
1783 Use TypeManager.CoreLookupType to lookup types from our core
1784 assemblies and turn those into "Type" variables.
1786 Consumers that previously used "Namespace" and "Type" from this
1787 class should instead use the TypeExpression which is a type that
1788 is fully resolved (without involving the regular C# resolution
1791 This typically looks like this:
1793 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
1794 new MemberAccess (texpr, name, type_arguments, loc)
1796 This avoids the problem in: #355178
1798 2008-01-21 Marek Safar <marek.safar@gmail.com>
1800 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
1801 feature in parser only as we do in other cases.
1803 2008-01-21 Marek Safar <marek.safar@gmail.com>
1805 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
1806 typemanager.cs: A refactoring of params arguments to reuse existing
1807 expressions (params -> array initializer) to emit params argument instead
1808 of specialized handling.
1809 It was required by expression tree implementation and it has other benefits
1810 as well, we now apply same optimization for params arguments as we do for
1813 2008-01-18 Marek Safar <marek.safar@gmail.com>
1815 A fix for bug #353526
1816 * generic.cs: A type inference of params arguments may not required any
1817 temporary array creation.
1819 2008-01-18 Marek Safar <marek.safar@gmail.com>
1821 A fix for bug #353534
1822 * generic.cs, ecore.cs, expression.cs: A method group type inference is
1823 supported for delegates only.
1825 2008-01-18 Marek Safar <marek.safar@gmail.com>
1827 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
1828 type for more than 1 candidates.
1830 2008-01-18 Marek Safar <marek.safar@gmail.com>
1832 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
1835 2008-01-16 Marek Safar <marek.safar@gmail.com>
1837 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
1838 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
1839 operator) expressions.
1841 2008-01-16 Zoltan Varga <vargaz@gmail.com>
1843 * statement.cs: Avoid declaring an IL variable for this_variable since it is
1844 not accessed from the generated IL.
1846 2008-01-14 Marek Safar <marek.safar@gmail.com>
1848 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
1849 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
1850 statement.cs: The first expression tree implementation drop, mostly
1851 infrastructure work.
1853 2008-01-14 Marek Safar <marek.safar@gmail.com>
1855 * ecore.cs (IsNestedChild): Refactored.
1857 2008-01-11 Marek Safar <marek.safar@gmail.com>
1859 * lambda.cs: Don't use a cast on unknown expression statement.
1861 2008-01-10 Geoff Norton <gnorton@novell.com>
1863 * cs-tokenizer.cs: One more token to distinguish between method and lambda
1866 2008-01-09 Marek Safar <marek.safar@gmail.com>
1868 * doc.cs: Report better /doc crash details.
1870 2008-01-09 Marek Safar <marek.safar@gmail.com>
1872 A fix for bug #352536
1873 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
1875 2008-01-08 Marek Safar <marek.safar@gmail.com>
1877 A fix for bug #352287
1878 * ecore.cs, expression.cs: Do `this' access checking in all member access
1881 2008-01-08 Marek Safar <marek.safar@gmail.com>
1883 * rootcontext.cs, driver.cs: Switch to linq mode by default.
1885 * report.cs: Reset message stacks.
1887 2008-01-08 Marek Safar <marek.safar@gmail.com>
1889 * generic.cs (InferInPhases): Correctly calculate params position.
1891 2008-01-08 Marek Safar <marek.safar@gmail.com>
1893 * cs-tokenizer.cs: No need to parse full string when parsing lambda
1896 2008-01-07 Marek Safar <marek.safar@gmail.com>
1898 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
1900 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
1902 * driver.cs: Updated --help option.
1904 2008-01-07 Marek Safar <marek.safar@gmail.com>
1906 * generic.cs (InferParamsTypeArguments): Removed.
1907 (InferInPhases): Add params type inference.
1908 (LowerBoundInference): Fixed scoring mechanism.
1910 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
1912 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
1914 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
1915 byte array for unsigned "baked" assemblies.
1917 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
1919 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
1920 array for assemblies that are not strongnamed.
1922 2008-01-04 Marek Safar <marek.safar@gmail.com>
1924 A fix for bug #351481
1925 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
1926 declaring type for nested generic types.
1928 2008-01-04 Marek Safar <marek.safar@gmail.com>
1930 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
1931 instead of ToString.
1933 2008-01-03 Marek Safar <marek.safar@gmail.com>
1935 A fix for bug #351047
1936 * expression.cs (Binary.ResolveOperator): Allow equality operators between
1937 null and structs only when equality and inequality operators are defined
1938 either as an user-operators or predefined operators.
1940 2008-01-03 Marek Safar <marek.safar@gmail.com>
1942 A fix for bug #351047
1943 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
1945 2008-01-03 Marek Safar <marek.safar@gmail.com>
1947 A fix for bug #351257
1948 * cs-tokenizer.cs: Advance line number for '\r' correctly.
1950 2008-01-03 Marek Safar <marek.safar@gmail.com>
1952 A fix for bug #351157
1953 * class.cs (Using): Fixed yet another broken cloning.
1955 (Block): Put back more sensible default value for statements.
1957 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
1959 * codegen.cs: Allow AssemblyVersion with only major version component.
1962 2007-12-29 Marek Safar <marek.safar@gmail.com>
1964 A fix for bug #324654
1965 * class.cs: Use FullName property as member name.
1967 2007-12-28 Marek Safar <marek.safar@gmail.com>
1969 A fix for bug #342117
1970 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
1971 constructor constraint.
1973 2007-12-28 Marek Safar <marek.safar@gmail.com>
1975 A fix for bug #338273
1976 * class.cs (ProbertyBase): Access modifier checks are required for overrides
1979 2007-12-28 Marek Safar <marek.safar@gmail.com>
1981 A fix for bug #350839
1982 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
1984 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
1986 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
1989 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
1991 * statement.cs: Changed some Hashtables to use HybridDictionaries
1992 instead. It was observed that some HashTables only contained a few
1993 items in the vast majority of cases. Since HybridDictionary is
1994 more efficient on small sets (<10 elements), "known_variables"
1995 from class ExplicitBlock as well as "labels" and "constants " from
1996 class Block were changed to HybridDictionaries.
1998 Atsai results: (56216kb->54987kb)
2000 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
2003 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
2005 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
2008 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
2010 * expression.cs: foreach loop to for loop, saved on allocation of
2011 enumerator (59333kb->59141kb)
2013 * statement.cs. Changed foreach loops to for loops, saved on
2014 allocation of enumerator (59141kb->59006kb)
2016 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
2017 when constructed with no specified capacity. This was causing a
2018 few ArrayLists to allocate more memory than they would potentially
2019 need in the Block class and MemberCache class. Setting the
2020 ArrayLists to construct with a capacity of 1 saves some
2021 memory. (56216kb->55585kb)
2023 2007-12-27 Marek Safar <marek.safar@gmail.com>
2025 A fix for bug #347189 (2nd issue)
2026 * expression.cs (MemberAccess): Nested type can be found in base non-generic
2029 2007-12-27 Miguel de Icaza <miguel@novell.com>
2031 * report.cs: Do not use colors if stdout and stderr are not a
2034 2007-12-27 Marek Safar <marek.safar@gmail.com>
2036 A fix for bug #346998
2037 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
2040 2007-12-27 Marek Safar <marek.safar@gmail.com>
2042 A fix for bug #343465
2043 * class.cs: Explicit method name for nested types uses dots only.
2045 2007-12-27 Marek Safar <marek.safar@gmail.com>
2047 A fix for bug #343707
2048 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
2050 2007-12-27 Marek Safar <marek.safar@gmail.com>
2052 * ecore.cs: Report type inference errors only when arguments count matches
2055 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
2057 * expression.cs, report.cs: New warning.
2059 * typemanager.cs: Catch anonymous method type too.
2061 2007-12-23 Marek Safar <marek.safar@gmail.com>
2063 A fix for bug #346379
2064 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
2066 2007-12-23 Marek Safar <marek.safar@gmail.com>
2068 A fix for bug #347359
2069 * expression.cs (Invocation): Don't resolve already resolved expression.
2071 2007-12-23 Marek Safar <marek.safar@gmail.com>
2073 A fix for bug #347189
2074 * class.cs (FixedField): Use non-dependent code only in the define phase.
2076 2007-12-23 Marek Safar <marek.safar@gmail.com>
2078 A fix for bug #348076
2079 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
2081 2007-12-22 Marek Safar <marek.safar@gmail.com>
2083 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
2084 discovered extension methods.
2086 2007-12-22 Marek Safar <marek.safar@gmail.com>
2088 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
2091 2007-12-21 Miguel de Icaza <miguel@novell.com>
2093 * report.cs (ErrorMessage): Add support for using colors on
2094 terminals that support it.
2096 2007-12-21 Marek Safar <marek.safar@gmail.com>
2098 * ecore.cs: Use information about expanded params for error reporting.
2100 2007-12-21 Marek Safar <marek.safar@gmail.com>
2102 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
2103 and logic for params overloads.
2105 2007-12-15 Miguel de Icaza <miguel@novell.com>
2107 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
2108 as this is also created from the parser. Fixes #349034
2110 2007-12-12 Miguel de Icaza <miguel@novell.com>
2112 * statement.cs (Throw.CloneTo): it is valid to have empty
2113 expressions for throw.
2115 2007-12-03 Marek Safar <marek.safar@gmail.com>
2117 * cs-parser.jay: Set delegate constraint parsing region correctly.
2119 2007-12-03 Marek Safar <marek.safar@gmail.com>
2121 A fix for bug #345467
2122 * typemanager.cs (IsEqual): Compare generic parameters position only.
2124 2007-11-28 Marek Safar <marek.safar@gmail.com>
2126 * expression.cs (BaseAccess): Type arguments can be null.
2128 2007-11-27 Raja R Harinath <harinath@gmail.com>
2130 * statement.cs (Block.Resolve): Ensure flow-branching tree is
2131 consistent even when an error has occured.
2132 (Switch.Resolve): Likewise.
2134 2007-11-22 Marek Safar <marek.safar@gmail.com>
2136 A fix for bug #334505
2137 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
2140 2007-11-22 Marek Safar <marek.safar@gmail.com>
2142 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
2143 refactorings required to resolve extension methods correctly when mixing
2144 generics and non-generics members.
2146 2007-11-20 Marek Safar <marek.safar@gmail.com>
2148 A fix for bug #342584
2149 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
2152 2007-11-19 Marek Safar <marek.safar@gmail.com>
2154 A fix for bug #342512
2155 * delegate.cs: Use delegate argument expression when is available. Don't
2156 emit virtual call when class is sealed.
2158 2007-11-16 Marek Safar <marek.safar@gmail.com>
2160 A fix for bug #325423
2161 * assign.cs (FieldInitializer): Use resolved expression for emit.
2163 * class.cs: Print less confusing error message.
2165 2007-11-16 Marek Safar <marek.safar@gmail.com>
2167 * cs-tokenizer.cs: Removed GMCS ifdefs.
2169 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
2172 * cs-parser.jay: Disabled nullable check.
2174 * generic-mcs: Copied more generic stuff.
2176 2007-11-16 Marek Safar <marek.safar@gmail.com>
2178 * gcs-parser.jay: Merged to cs-parser.jay.
2180 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
2181 * *.csproj, *.sources: Updated to use only jay parser file.
2183 2007-11-16 Marek Safar <marek.safar@gmail.com>
2185 * gcs-parser.jay: Added nullable and default expression feature checks.
2187 2007-11-16 Marek Safar <marek.safar@gmail.com>
2189 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
2190 it fixes many TODOs and hidden bugs.
2192 * expression: Removed duplicate error check.
2194 2007-11-15 Marek Safar <marek.safar@gmail.com>
2196 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
2197 implicitly type local variable only when it is used in a declaration.
2199 2007-11-15 Marek Safar <marek.safar@gmail.com>
2201 * attribute.cs: Use CS0612 for empty strings.
2203 2007-11-14 Marek Safar <marek.safar@gmail.com>
2205 * lambda.cs, statement.cs: Contextual return may act as a statement.
2207 2007-11-14 Marek Safar <marek.safar@gmail.com>
2209 A fix for a regression cause by #324222
2210 * class.cs: Don't report unused even when it implements an interface.
2212 2007-11-13 Marek Safar <marek.safar@gmail.com>
2214 A fix for bug #341205
2215 * ecore.cs, expression.cs: Method group expression cannot do static
2216 method access with an instance reference check before overloading takes
2219 2007-11-13 Marek Safar <marek.safar@gmail.com>
2221 A fix for bug #325359
2222 * class.cs: Use predictable name for automatically generated property.
2224 2007-11-12 Marek Safar <marek.safar@gmail.com>
2226 A fix for bug #324996
2227 * expression.cs (Is): Handle case where D is nullable and T is not
2230 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
2232 2007-11-12 Marek Safar <marek.safar@gmail.com>
2234 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
2235 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
2236 Flush small error reporting changes.
2238 2007-11-09 Marek Safar <marek.safar@gmail.com>
2240 A fix for bug #324996
2241 * expression.cs: Rewrote Is expression implementation to work with
2242 generics, nullable types, anonymous method. A const result expression
2243 uses existing infrastructure instead of custom not fully-featured one.
2245 2007-11-08 Marek Safar <marek.safar@gmail.com>
2247 A fix for bug #340202
2248 * class.cs: Consider generics for volatile field.
2250 2007-11-08 Marek Safar <marek.safar@gmail.com>
2252 A fix for bug #335594
2253 * expression.cs: Use conversion rules when handling string addition.
2255 2007-11-07 Marek Safar <marek.safar@gmail.com>
2257 A fix for bug #336651
2258 * expression.cs: Fixed a crash when probing is on.
2260 2007-11-07 Marek Safar <marek.safar@gmail.com>
2262 A fix for bug #324242
2263 * covert.cs: Added a conversion from any nullable-type with an
2264 underlying enum-type to the type System.Enum.
2266 2007-11-07 Marek Safar <marek.safar@gmail.com>
2268 A fix for bug #324222
2269 * class.cs: Report all non-used event fields.
2271 2007-11-07 Marek Safar <marek.safar@gmail.com>
2273 A fix for bug #325161
2274 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
2275 qualifier for generic types.
2277 2007-11-07 Marek Safar <marek.safar@gmail.com>
2279 A fix for bug #322971
2280 * expression.cs, ecore.cs: Added intermediate result value check for
2283 2007-11-07 Marek Safar <marek.safar@gmail.com>
2285 A fix for bug #324754
2286 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
2287 when it was requested.
2289 2007-11-07 Marek Safar <marek.safar@gmail.com>
2291 A fix for bug #325101
2292 * expression.cs: Do type not value comparison for `is' expression.
2294 2007-11-07 Marek Safar <marek.safar@gmail.com>
2296 A fix for bug #320236
2297 * convert.cs: Don't apply user conversion on underlying target type.
2299 2007-11-06 Marek Safar <marek.safar@gmail.com>
2301 * expression.cs: Don't use unresolved expression for error reporting.
2303 2007-11-06 Marek Safar <marek.safar@gmail.com>
2305 A fix for bugs #337712, #324490
2306 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
2307 overloading resolution too.
2309 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
2310 the process consistent and more robust.
2312 * expression.cs, linq.cs, report.cs: Update.
2314 2007-11-02 Marek Safar <marek.safar@gmail.com>
2316 A fix for bug #332909
2317 * attribute.cs: Resolve attributes in correct context using error
2320 * rootcontext.cs: Define Obsolete attribute members as core members.
2322 2007-11-02 Marek Safar <marek.safar@gmail.com>
2324 * statement.cs: Removed unused methods.
2326 2007-10-31 Wade Berrier <wberrier@novell.com>
2328 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
2329 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
2332 2007-10-31 Marek Safar <marek.safar@gmail.com>
2334 A fix for bug #338102
2335 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
2336 methods registered as non-generics.
2338 2007-10-31 Marek Safar <marek.safar@gmail.com>
2340 A fix for bugs #337712, #324490
2341 * delegate.cs: Delegate covariance and contravariance is not allowed for
2344 2007-10-31 Marek Safar <marek.safar@gmail.com>
2346 A fix for bug #337719
2347 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
2350 2007-10-30 Marek Safar <marek.safar@gmail.com>
2352 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
2354 2007-10-29 Marek Safar <marek.safar@gmail.com>
2356 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
2359 2007-10-29 Raja R Harinath <rharinath@novell.com>
2361 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
2363 2007-10-29 Marek Safar <marek.safar@gmail.com>
2365 A fix for bug #334652
2366 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
2367 extension methods when we have not found the best candidate in normal
2370 2007-10-27 Marek Safar <marek.safar@gmail.com>
2372 * AssemblyInfo.cs: Keep up-to-date.
2374 2007-10-27 Marek Safar <marek.safar@gmail.com>
2376 * Makefile: Fixed generics compiler name.
2378 2007-10-27 Marek Safar <marek.safar@gmail.com>
2380 * lambda.test: removed, lambda parsing is done differently.
2382 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
2384 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
2386 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
2388 2007-10-27 Marek Safar <marek.safar@gmail.com>
2390 * Makefile, *.sources : All C# compilers are in mcs folder.
2392 * *.cs: Use existing 2_1 define for smcs.
2394 2007-10-26 Marek Safar <marek.safar@gmail.com>
2396 A fix for bug #335847
2397 * assign.cs, expression.cs: Couple of changes to avoid creating a
2398 temporary variable for each object initializer assignment statement. It
2399 simplifies struct initialization too, otherwise two temporary variables
2401 Implemented optimization of redundant default element initializers.
2403 2007-10-25 Marek Safar <marek.safar@gmail.com>
2405 A fix for bug #336766
2406 * expression.cs (Class.CheckBase): Use generic name when method is
2409 2007-10-25 Marek Safar <marek.safar@gmail.com>
2411 A fix for bug #334737
2412 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
2413 variable and not variable argument for prepared copies.
2415 2007-10-24 Marek Safar <marek.safar@gmail.com>
2417 A fix for bug #325110
2418 * class.cs, expression.cs, attribute.cs: Use open generic method when
2419 checking conditional attribute.
2421 2007-10-24 Marek Safar <marek.safar@gmail.com>
2423 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
2424 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
2425 FeatureIsNotAvailable.
2427 2007-10-24 Marek Safar <marek.safar@gmail.com>
2429 ** C# 3.0 Partial methods
2431 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
2432 methods support. Because of member cache issue with generics only
2433 non-generics partial methods are fully supported.
2435 2007-10-23 Marek Safar <marek.safar@gmail.com>
2437 * class.cs, decl.cs: Rewrote member overloads check to cope with
2438 generics and to use member cache for member checking. It also improves
2439 performance and fixes remaining overloads issues.
2441 2007-10-20 Marek Safar <marek.safar@gmail.com>
2443 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
2444 roottypes.cs, typemanager.cs:
2446 A member cache creation logic changed to add members immediately and
2447 not rely on fallback. The member cache is now only prefered way
2448 how to access and find type declaration members. It saves 5 MB of memory
2449 during MWF compilation and makes code ready for more optimizations and
2450 clean-ups, it's also a pre-requirement for partial methods.
2452 2007-10-18 Raja R Harinath <harinath@gmail.com>
2454 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
2455 handling for generic parameters.
2457 2007-10-15 Marek Safar <marek.safar@gmail.com>
2459 * class.cs (FixedField): Removed redundant volatile check.
2461 2007-10-15 Marek Safar <marek.safar@gmail.com>
2463 * class.cs, decl.cs: Fixed overload members verification to do only one
2464 check per possible collision.
2466 2007-10-13 Marek Safar <marek.safar@gmail.com>
2468 A fix for bug #325478
2469 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
2470 and create only one disposable flags container.
2472 2007-10-12 Marek Safar <marek.safar@gmail.com>
2474 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
2475 * statement.cs (Fixed): Fixed variables cloning.
2477 2007-10-12 Marek Safar <marek.safar@gmail.com>
2479 A fix for bug #333342
2480 * class.cs (EventField): Don't mark value type event as synchronized.
2482 2007-10-12 Marek Safar <marek.safar@gmail.com>
2484 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
2485 inference to identify best candidate method correctly.
2486 (ProperyExpr): A range variable is read only and cannot be modified.
2488 2007-10-11 Marek Safar <marek.safar@gmail.com>
2490 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
2491 logic to identify best candidate method correctly.
2493 2007-10-11 Marek Safar <marek.safar@gmail.com>
2495 * location.cs (Equals, GetHashCode): Removed.
2497 2007-10-11 Marek Safar <marek.safar@gmail.com>
2499 * report.cs: Implemented message recorder. It is used mainly for lambda
2500 expressions to capture otherwise swallowed error messages.
2502 * anonymous.cs, lambda.cs.cs: Do full parameters check.
2504 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
2506 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
2508 * expression.cs (MemberAccess): Always report lookup failure.
2510 * location.cs: Implemented Equals, GetHashCode.
2512 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
2514 2007-10-10 Jb Evain <jbevain@novell.com>
2516 * codegen.cs: re-enable assembly version check.
2518 2007-10-09 Marek Safar <marek.safar@gmail.com>
2520 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
2523 * namespace.cs (UsingAlias): Do correct version check.
2525 2007-10-08 Marek Safar <marek.safar@gmail.com>
2527 * expresison.cs, ecore.cs: Issue extension method error message when
2530 * rootcontext.cs: Added ISO_2 compiler mode option.
2532 2007-10-08 Marek Safar <marek.safar@gmail.com>
2534 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
2537 2007-10-08 Marek Safar <marek.safar@gmail.com>
2539 * attribute.cs (GetString, GetBoolean): Work with both literal and
2542 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
2543 Moved method overload specific methods to MethodGroupExpr.
2545 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
2546 it should be less memory consuming.
2548 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
2550 * codegen.cs: remove the assembly version check until the buildbot is
2553 2007-10-07 Jb Evain <jbevain@novell.com>
2555 * attribute.cs (Attribute.GetString): if the value
2556 expression is a StringConstant, return its string value.
2558 2007-10-07 Jb Evain <jbevain@novell.com>
2560 * typemanager.cs: add `assembly_version_attribute_type`.
2561 * codegen.cs: on attribute emission, check that the
2562 AssemblyVersionAttribute doesn't overflow.
2564 2007-10-05 Marek Safar <marek.safar@gmail.com>
2566 A fix for bug #324677
2567 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
2568 parent container of a scope container with currently resolved one.
2570 2007-10-05 Marek Safar <marek.safar@gmail.com>
2572 A fix for bug #325534
2573 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
2576 2007-10-05 Marek Safar <marek.safar@gmail.com>
2578 A fix for bug #327504
2579 * class.cs (Operator.Define): Refactored implicit and explicit user
2580 operator conversion rules.
2582 2007-10-05 Marek Safar <marek.safar@gmail.com>
2584 A fix for bug #327520
2585 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
2587 2007-10-04 Marek Safar <marek.safar@gmail.com>
2589 A fix for bug #328022
2590 * class.cs (MethodData.Define): Use correct method to check whether
2591 a method implementents an accessor.
2593 2007-10-04 Marek Safar <marek.safar@gmail.com>
2595 A fix for bug #330069
2596 * statement.cs (Fixed.Resolve): Read the first array element only when
2597 an array is instantiated.
2599 2007-10-04 Marek Safar <marek.safar@gmail.com>
2601 * expression.cs, assign.cs, generics.cs: Print correct operator when
2602 compound assignment is used.
2604 2007-10-04 Marek Safar <marek.safar@gmail.com>
2606 A fix for bug #325841
2607 * expression.cs (ArrayAccess): Use full argument cloning only for
2608 string compound concatenation.
2610 2007-10-03 Marek Safar <marek.safar@gmail.com>
2612 A fix for bug #328774
2613 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
2615 (PropertyExpr.EmitAssign): Fixed string concatenation compound
2618 2007-10-03 Raja R Harinath <rharinath@novell.com>
2621 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
2622 Event accessibility checks here. Remove some bogus code that
2623 accidently made GenericMethods work.
2624 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
2626 2007-09-25 Marek Safar <marek.safar@gmail.com>
2628 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
2630 * statement.cs (Block): Refactored AddVariable to allow error handling
2633 * generic.cs: New stub.
2635 2007-09-23 Marek Safar <marek.safar@gmail.com>
2637 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
2640 2007-09-17 Marek Safar <marek.safar@gmail.com>
2642 * class.cs: Use partial container to record whether any partial part
2643 contains static field initializer and therefore default contructor has
2646 2007-09-14 Marek Safar <marek.safar@gmail.com>
2648 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
2649 mono-list when only one of two partial parts has defined accessibility
2652 2007-09-14 Marek Safar <marek.safar@gmail.com>
2654 A fix for bug #82845
2656 * class.cs (TypeContainer): Set correct resolve context for all field
2659 2007-09-13 Marek Safar <marek.safar@gmail.com>
2661 * assign.cs: Fixed a crash when field is resolved twice with an error.
2663 * codegen.cs: Changed InFieldInitializer to be flag.
2665 * anonymous.cs, ecore.cs, expression.cs: Update after
2666 IsInFieldInitializer rename.
2668 * const.cs: Removed unused parameter.
2670 * class.cs: Changed the way how we resolve and emit field initializers.
2671 The field initilizers have to have access to contructor block to emit
2672 compiler generated code.
2674 2007-09-13 Marek Safar <marek.safar@gmail.com>
2676 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
2677 generics use TypeContainer instead.
2679 2007-09-12 Marek Safar <marek.safar@gmail.com>
2681 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
2683 * lambda.cs (ResolveParameters): Use more powerful
2684 InflateGenericArgument.
2686 * parameters.cs: Better exception message.
2688 2007-09-10 Marek Safar <marek.safar@gmail.com>
2690 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
2691 correct expression block type.
2693 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
2695 * expression.cs (Invocation): Extracted method group resolve to
2698 2007-09-07 Marek Safar <marek.safar@gmail.com>
2700 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
2701 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
2703 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
2704 generic extension methods.
2706 2007-09-06 Marek Safar <marek.safar@gmail.com>
2708 A fix for bug #82676 (Do I get it right now?)
2709 * convert.cs (Binary.ResolveOperator): An interface is converted to the
2710 object before a standard conversion is applied.
2712 2007-09-06 Marek Safar <marek.safar@gmail.com>
2714 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
2717 2007-09-05 Marek Safar <marek.safar@gmail.com>
2719 A fix for bug #82676
2720 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
2721 non-generic interface types.
2723 2007-09-05 Marek Safar <marek.safar@gmail.com>
2725 A fix for bug #82690
2726 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
2728 2007-09-05 Marek Safar <marek.safar@gmail.com>
2730 A fix for bug #82571
2731 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
2732 modifier for container based methods.
2734 2007-09-05 Marek Safar <marek.safar@gmail.com>
2736 A fix for bug #82676
2737 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
2738 any interface-type T means to any of interface type T.
2740 2007-09-04 Marek Safar <marek.safar@gmail.com>
2742 * namespace.cs: We have 2 versions of System.Core assembly.
2744 2007-09-04 Marek Safar <marek.safar@gmail.com>
2746 A fix for bug #82652
2747 * class.cs (Class.GetClassBases): Compare types and not expressions.
2749 2007-09-04 Marek Safar <marek.safar@gmail.com>
2751 A fix for bug #82620
2752 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
2753 actually never worked before.
2754 (IndexerAccess): Emit prepared arguments before they are modified.
2756 2007-09-04 Marek Safar <marek.safar@gmail.com>
2758 A fix for bug #82563
2759 * assign.cs: Revert wrong fix.
2761 * expression.cs (VariableReference.EmitAssign): Handle ref reference
2763 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
2764 Instead of ldelema/stdind we have to use temporary variables to handle
2765 cases like String.Concat (params string[]).
2767 2007-08-31 Marek Safar <marek.safar@gmail.com>
2769 * class.cs: EmitAttributes to Emit rename.
2771 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
2773 (MemberCore.HasClsCompliantAttribute): Don't depend on
2774 GetClsCompliantAttributeValue execution.
2776 2007-08-31 Marek Safar <marek.safar@gmail.com>
2778 * anonymous.cs: Use shorter type prefix.
2780 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
2783 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
2784 variables when probing is on.
2786 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
2787 unresolved variables.
2788 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
2789 handle transparent identifiers.
2791 2007-08-26 Marek Safar <marek.safar@gmail.com>
2793 * attribute.cs (IsClsCompliant): Add nullable types test.
2795 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
2797 * doc.cs : catch other types of exception than XmlException to
2798 report CS1570. Fixed bug #82565.
2800 2007-08-23 Marek Safar <marek.safar@gmail.com>
2802 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
2803 The number of delegate parameters has to match.
2804 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
2807 2007-08-21 Marek Safar <marek.safar@gmail.com>
2809 * anonymous.cs (AnonymousMethod): Generate private anonymous method
2810 to fix problem with private arguments.
2812 2007-08-20 Marek Safar <marek.safar@gmail.com>
2814 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
2816 * decl.cs (MemberName): Ignore generic type with no generic arguments.
2818 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
2819 empty. Add cloning suport.
2821 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
2823 2007-08-20 Marek Safar <marek.safar@gmail.com>
2825 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
2826 to create EmptyCast. It handles EmptyConstantCast specialization for
2829 2007-08-18 Marek Safar <marek.safar@gmail.com>
2831 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
2832 (EmitArrayArgument): One routine for array arguments.
2833 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
2835 2007-08-17 Marek Safar <marek.safar@gmail.com>
2837 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
2839 2007-08-17 Marek Safar <marek.safar@gmail.com>
2841 * anonymous.cs: MemberLookupFinal update.
2843 * class.cs (ConstructorInitializer): Is expression based.
2845 * delegate.cs: MethodGroupExpr update.
2847 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
2849 (Error_MemberLookupFailed): Customizable error override.
2850 (MethodGroupExpr): Keep queried type for later usage.
2851 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
2854 * expression.cs: Error_MemberLookupFailed refactoring.
2855 (New.DoResolve): Resolve as much as possible.
2856 (ElementInitializer.Error_MemberLookupFailed): Object initializer
2857 customization for invalid member types.
2859 * statement.cs: MethodGroupExpr update.
2861 2007-08-16 Marek Safar <marek.safar@gmail.com>
2863 * modifier.cs (Check): Check all modifiers and not only accessibility
2866 2007-08-16 Marek Safar <marek.safar@gmail.com>
2868 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
2869 type and not an expression.
2871 2007-08-16 Marek Safar <marek.safar@gmail.com>
2873 * statement.cs (Catch.Clone): Type and variable can be null.
2875 2007-08-16 Marek Safar <marek.safar@gmail.com>
2877 A fix for bug #81979
2878 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
2879 I am really not sure whether this is the best fix.
2881 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
2884 2007-08-14 Marek Safar <marek.safar@gmail.com>
2886 ** C# 3.0 Object and collection initializers (major re-write)
2888 * assign.cs (DoResolve): Initializers are not assign related.
2890 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
2891 used during collection or object initialization.
2893 * expression.cs (Error_InvalidArguments): Add initializers specific
2894 messages. More will come later because it requires some general
2896 (New.DoResolve): Better error handling for unsafe types.
2897 (EmptyExpressionStatement): New class.
2898 (ElementInitializer): An object initializer expression.
2899 (CollectionElementInitializer): A collection initializer expression.
2900 (CollectionOrObjectInitializers): A block of object or collection
2902 (NewInitialize): New expression with element/object initializers.
2904 * statement.cs: Reverted object/collection initializer hacks.
2906 * typemanager.cs (CSharpName): Filter __arglist type.
2908 2007-08-09 Marek Safar <marek.safar@gmail.com>
2910 ** C# 3.0 Anonymous Types (update to the latest standard)
2912 * expression.cs (Binary.ResolveOperator): Threat all null based types
2914 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
2915 (AnonymousTypeParameter): Updated.
2917 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
2918 (AnonymousTypeClass): New anonymous type container.
2920 * class.cs (AddField): Return operation result.
2922 * generic.cs: Another empty TypeArguments overload.
2924 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
2925 are stored at top of normal hierarchy.
2927 * typemanager.cs (CSharpName): Filter anonymous types.
2929 2007-08-09 Marek Safar <marek.safar@gmail.com>
2931 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
2932 as single Concat call. How could we miss that :-(
2934 2007-08-08 Marek Safar <marek.safar@gmail.com>
2936 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
2938 2007-08-07 Miguel de Icaza <miguel@novell.com>
2940 * expression.cs: Fix the previous commit, the creation of the
2941 arguments array list needs also to be conditional on the arguments
2944 * class.cs: Add a little bit of help to help narrow down problems.
2946 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
2947 not try to copy in that case.
2949 * driver.cs: When building SMCS, include a new different set of
2950 default assemblies here. Do this here so we can control whether
2951 to include the default assemblies with /noconfig.
2953 2007-08-03 Marek Safar <marek.safar@gmail.com>
2955 A fix for bug #81979
2956 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
2959 2007-08-03 Marek Safar <marek.safar@gmail.com>
2961 A fix for bug #82300
2963 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
2964 we are in probing scope.
2966 2007-08-03 Marek Safar <marek.safar@gmail.com>
2968 A fix for bug #82301
2970 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
2971 (Statement.CloneTo): Clone and not map children blocks.
2973 2007-08-03 Marek Safar <marek.safar@gmail.com>
2975 A fix for bug #82299
2977 * expression.cs (LocalVariableReference.CloneTo): Remap local info
2980 * statement.cs (Statement.CloneTo): Clone variables before statements
2981 to allow remaping of local variables.
2983 2007-08-03 Marek Safar <marek.safar@gmail.com>
2985 A fix for bug #82296
2988 * report.cs: Log crash details for future clone problems.
2990 * statement.cs (Return.Clone): Don't clone non-existent expression.
2992 2007-08-03 Raja R Harinath <harinath@gmail.com>
2994 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
2995 (Class.AddBasesForPart): Move CS0537 check here from ...
2996 * cs-parser.jay (class_declaration): ... here. Move calling of
2997 'AddBasesForPart' to ...
2998 (class_bases): ... here.
2999 (struct_declaration, interface_declaration): Update to changes.
3001 2007-08-02 Marek Safar <marek.safar@gmail.com>
3003 A fix for bug #81923
3005 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
3006 conversion is allowed.
3008 2007-08-02 Marek Safar <marek.safar@gmail.com>
3010 A fix for bug #81564
3012 * ecore.cs (EventExpr): Add IsBase handling.
3014 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
3017 2007-08-02 Raja R Harinath <harinath@gmail.com>
3019 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
3020 * cs-parser.jay: Some whitespace cleanups.
3021 (current_delegate): New.
3023 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
3024 a dummy code block, and use 'type_name' instead of 'member_name'.
3025 (interface_declaration, class_declaration): Likewise.
3026 (delegate_declaration): Likewise. Rearrange slightly and use
3028 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
3029 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
3031 2007-08-02 Marek Safar <marek.safar@gmail.com>
3033 A fix for bug #82039
3035 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
3038 * typemanager.cs (CSharpName): Split to string overload.
3040 2007-08-02 Marek Safar <marek.safar@gmail.com>
3043 * report.cs: Updated warning CS0472.
3045 2007-08-01 Marek Safar <marek.safar@gmail.com>
3047 A fix for bug #82181
3049 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
3051 2007-08-01 Marek Safar <marek.safar@gmail.com>
3053 A fix for bug #82277
3054 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
3056 2007-08-01 Marek Safar <marek.safar@gmail.com>
3058 ** C# 3.0 Type Inference (major bits are working)
3060 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
3061 (.ImplicitStandardConversionExists): Uses compatible.
3062 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
3063 (.InferReturnType): New method.
3064 (.Compatible): Refactored.
3065 (.ResolveParameters): Uses factory to create resolved parameters.
3066 (.CompatibleMethod): Add probing mode support.
3067 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
3068 clearly distinguish between 2 different operations.
3069 (LambdaMethod): Moved to lambda.cs.
3070 (AnonymousMethod): Removed unused fields and methods.
3071 (AnonymousDelegate): Simplified.
3073 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
3075 * convert. cs (ImplicitConversionStandard): Compatible works differently.
3077 * delegate.cs (Delegate): New mehods to reduce code duplication.
3078 (.GetConstructor): New method.
3079 (.GetInvokeMethod): New method.
3080 (DelegateCreation): Updated.
3082 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
3084 (OverloadResolve): Made probing little bit faster.
3086 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
3089 * generic.cs (TypeInferenceContext): Dummy implementation.
3091 * iterators.cs: Updated after Resolve/Define rename.
3093 * lambda.cs (LambdaExpression)
3094 (.ResolveParameters): Handles both type of arguments and type inference too.
3096 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
3097 (InflateTypes): Updated.
3099 * support.cs (InflateTypes): Changed signature and updated.
3101 * typemanager.cs (LookupMemberCache): Better dynamic type check.
3102 (MemberLookup_FindMembers): More MS tricks.
3103 (GetParameterData): Ditto.
3104 (GetDelegateParameters): Uses quick path for dynamic types.
3106 2007-08-01 Marek Safar <marek.safar@gmail.com>
3108 * class.cs (MethodData.Define): EmitContext is required for generic stuff
3111 2007-07-31 Marek Safar <marek.safar@gmail.com>
3113 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
3116 2007-07-26 Jb Evain <jbevain@novell.com>
3118 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
3119 which takes a boolean 'report_errors', similar to the GetMethod.
3120 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
3121 in .net 2.1, do not report errors here.
3123 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
3124 System.Runtime.CompilerServices.RequiredAttributeAttribute and
3125 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
3128 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
3129 of the type InternalsVisibleToAttribute before the first call
3130 to CoreLookupType which is allowed to fail (third boolean parameter
3131 to true). Because, during the resolution for a type that is not
3132 immediately found, we try to check if the type is not defined in
3133 a friend assembly, and to do so, we need the
3134 InternalVisibleToAttribute.
3136 2007-07-23 Miguel de Icaza <miguel@novell.com>
3138 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
3139 feature that allows structs to be compared against null and inline
3140 the result as true or false.
3142 Notice that the same code is not permitted inside a generic block
3143 of code that would do:
3145 class Foo<T> where T : struct {
3152 It is only allowed if the type of T is not bound (no where
3153 clause). In my opinion, this CSC 2 behavior is broken but people
3154 seem to be using it (IronRuby does, a few bug reports on bugzilla
3155 have it and some people have complained about it).
3157 All of the users that depend on this behavior have code that is
3160 * report.cs (Warning, Error): make these take object arguments,
3161 not strings, as that allows us to take advantage of Format.
3163 2007-07-20 William Holmes <billholmes54@gmail.com>
3165 * decl.cs: Changed MemberName.CountTypeArguments to also check the
3166 Left member variable for the Count.
3167 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
3168 MemberName.CountTypeArguments to avoid a NRE.
3170 This code is contributed under the MIT X11 license
3172 2007-07-18 Marek Safar <marek.safar@gmail.com>
3174 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
3176 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
3178 * doc.cs : generic method arguments are written as ``x while generic
3179 type arguments are `x. Combined with the previous change, fixed bug
3182 2007-07-18 Raja R Harinath <rharinath@novell.com>
3185 * expression.cs (Binary.ResolveOperator): When converting
3186 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
3188 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
3190 * doc.cs : when T: or whatever x: is specified, it does not really
3191 check the doc comment's syntax correctness. Fixed bug #82006.
3193 2007-07-18 Marek Safar <marek.safar@gmail.com>
3195 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
3196 LambdaExpression better.
3198 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
3200 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
3202 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
3203 as it can be generated.
3205 * expression.cs (Invocation.Error_InvalidArguments): Show correct
3208 * lambda.cs (LambdaExpression): Refactored to share same code with
3209 AnonymousMethodExpression.
3211 2007-07-17 Marek Safar <marek.safar@gmail.com>
3213 * anonymous.cs (MakeName): Include host name for easier debugging.
3214 (LambdaMethod): New class for lambda spcecific stuff.
3216 * attribute.cs: Set EmitContext return type.
3218 * class.cs: Set EmitContext return type.
3220 * codegen.cs (EmitContext): Return type cannot be null to stop messing
3221 with null/void meaning.
3223 * iterators.cs (ContainerType): Implemented.
3225 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
3227 * statement.cs (Return): Updated to lambda expressions.
3228 (Block.CloneTo): Parent can be null.
3230 2007-07-13 Marek Safar <marek.safar@gmail.com>
3232 A fix for bug #81917
3233 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
3235 * class.cs (FixedField): Check whether field is in unsafe scope.
3237 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
3238 (FieldExpr.Emit): Fixed buffers cannot be volatile.
3240 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
3243 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
3245 2007-07-13 Marek Safar <marek.safar@gmail.com>
3247 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
3248 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
3251 2007-07-13 Marek Safar <marek.safar@gmail.com>
3253 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
3255 2007-07-13 Marek Safar <marek.safar@gmail.com>
3257 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
3258 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
3260 * codegen.cs(EmitContext): Add ProbingMode flag.
3262 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
3264 * driver.cs: For now set both warning values.
3266 * ecore.cs (SimpleName): Name is readonly.
3267 (MethodGroup.OverloadResolve): One quick path for probing.
3269 * expression.cs (Unary): Set Oper r/o.
3270 (Binary): Set Oper r/o.
3271 (ParameterReference): Set few instance variables as r/o.
3272 (ParameterReference.DoResolveBase): Don't capture aruments when
3274 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
3275 (Arglist): arguments are private.
3276 (SizeOf): type is private and r/o.
3277 (MemberAccess): arguments are private.
3279 * report.cs: Enhanced reporting on/off capabilities.
3281 * lambda.cs: Uses ec.IsInProbingMode.
3282 (ContextualReturn): Derives from return.
3284 * rootcontext.cs: For now set both warning values.
3286 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
3288 (Return.Resolve): Don't die immediately.
3289 (Block.Resolve): Speed-up probing.
3290 (Block.CloneTo): Clone only child blocks.
3292 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
3294 * iterators.cs: reverted Miguel's latest change (r81925) as it
3295 breaks the build in System.
3297 2007-07-13 Miguel de Icaza <miguel@novell.com>
3299 * iterators.cs (Yield.CheckContext): Check for the iterator type
3300 also here as we can call into Yield even in codepaths that are not
3302 (MethodOrOperator is the only path that was checked).
3304 In addition to the standard check, use a more specific check for
3305 constructors to report a more verbose error.
3307 2007-07-12 Miguel de Icaza <miguel@novell.com>
3309 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
3310 report the warning and continue
3312 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
3313 values on the stack on the call to Emit. Use EmitStatement if
3314 possible, or using Emit + Pop if not possible. Fixes #82064
3316 2007-07-12 Raja R Harinath <rharinath@novell.com>
3318 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
3319 avoid try...finally in some cases.
3321 2007-07-10 Marek Safar <marek.safar@gmail.com>
3323 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
3325 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
3326 instead of method. Re-use standard error handling.
3327 (ConstructorInitializer.Emit): Simplified.
3329 * delegate.cs: Updated after Invocation.EmitCall change.
3331 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
3332 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
3333 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
3334 method and don't permanently changing input arguments.
3335 (MethodGroupExpr): Introduced resolved best_candidate, when method group
3336 is resolved it has one of the candidates is the best one which is later
3337 used to emit. Removed a few unused method.
3338 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
3340 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
3341 (Binary.ResolveOperator): Ditto.
3342 (ConditionalLogicalOperator.DoResolve): Ditto.
3343 (Invocation): Uses method group.
3344 (Invocation.DoResolve): Simplified.
3345 (Invocation.EmitCall): Removed useless is_static.
3346 (Invocation.Emit): Delegate to method group.
3347 (Invocation.EmitStatement): Simplified.
3348 (New): Uses method group.
3349 (MemberAccess.DoResolve): Don't destroy original expression.
3351 * statement.cs (ForEach.Resolve): Use null for no method arguments.
3353 2007-07-04 Marek Safar <marek.safar@gmail.com>
3355 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
3358 * lambda.cs: Add custom error message type.
3360 2007-07-03 Marek Safar <marek.safar@gmail.com>
3362 * lambda.cs: Simplified little bit.
3364 * parameter.cs: Introduced ImplicitLambdaParameter.
3365 (Parameters.CreateFullyResolved): New factory instead of ctor.
3369 * delegate.cs: Updated parameter creation.
3371 2007-07-03 Marek Safar <marek.safar@gmail.com>
3373 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
3376 * generic.cs: Synchronized with gmcs.
3378 2007-07-03 Marek Safar <marek.safar@gmail.com>
3380 * class.cs (Indexer): Check return type as soon as possible.
3382 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
3385 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
3387 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
3389 * parameter.cs (Parameter): Use expression type when it is available.
3391 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
3392 method modifier for the first parameter only.
3394 2007-06-24 Marek Safar <marek.safar@gmail.com>
3396 A fix for bug #81938
3397 * typemanager.cs (ChangeType): Fixed couple of char conversions.
3399 * constant.cs: Tide up an exception message.
3401 2007-06-22 Marek Safar <marek.safar@gmail.com>
3403 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
3404 an uninitialized variable is used.
3406 * expression.cs (LocalVariableReference.DoResolve): Ditto.
3408 2007-06-22 Marek Safar <marek.safar@gmail.com>
3410 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
3411 not found error handling.
3413 * expression.cs (ArrayCreation): Removed redundant fields and little bit
3415 (ArrayCreation.ResolveArrayElement): To be ready to customization.
3416 (ArrayCreation.DoResolve): Simplified.
3417 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
3418 its own resolve process.
3419 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
3421 2007-06-20 Marek Safar <marek.safar@gmail.com>
3423 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
3426 2007-06-20 Marek Safar <marek.safar@gmail.com>
3428 * cs-tokenizer.cs: Removed var related stuff.
3430 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
3431 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
3432 a type and a keyword at same time.
3434 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
3437 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
3438 implicitly typed arrays, more changes will follow.
3440 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
3442 2007-06-19 Marek Safar <marek.safar@gmail.com>
3444 * ecore.cs (VarExpr): Removed Handled field.
3446 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
3447 build-in assign functionality.
3448 (ForEach.Resolve): Removed all implicitly typed local variable code and
3450 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
3451 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
3453 2007-06-18 Marek Safar <marek.safar@gmail.com>
3455 * assign.cs: Removed implicitly typed local variable check.
3457 * expression.cs (LocalVariableReference.DoResolve): Add check for self
3458 referencing implicitly typed local variable.
3459 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
3462 * statement.cs (Fixed): Removed unsupported implicitly typed local
3465 2007-06-15 Marek Safar <marek.safar@gmail.com>
3467 * decl.cs (MemberName): Moved all Unbound stuff to parser.
3469 2007-06-14 Marek Safar <marek.safar@gmail.com>
3471 A fix for bugs #81855 and #76274
3472 * attribute.cs (AttachTo): Always set owner for global attributes to
3475 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
3478 * cs-parser.jay: Assembly and module attributes must precede all other
3479 elements except using clauses and extern alias declarations.
3481 2007-06-13 Marek Safar <marek.safar@gmail.com>
3483 A fix for bug #81748
3485 * expression.cs: More checks for non ISO-1 features.
3487 2007-06-12 Marek Safar <marek.safar@gmail.com>
3489 A fix for bug #81807
3490 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
3491 present inside switch statement and it is required by nullable check.
3493 2007-06-12 Marek Safar <marek.safar@gmail.com>
3495 A fix for bug #81840
3496 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
3497 when type matching fails.
3499 * namespace.cs: Tiny error message change.
3501 2007-06-12 Marek Safar <marek.safar@gmail.com>
3503 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
3504 reporting. Added automatic property check.
3506 * class.cs: Updated after CheckAbstractAndExtern relocation.
3507 (AEventPropertyAccessor.GetSignatureForError): Customized.
3509 2007-06-11 Marek Safar <marek.safar@gmail.com>
3511 * class.cs (DefineBaseTypes): Base type can be undefined.
3513 * ecore.cs (TypeLookup): Minor refactoring.
3514 (DoResolveAsTypeStep): Removed redundant check.
3516 * namespace.cs (Lookup): Removed redundant check.
3518 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
3519 ResolveAsTypeTerminal step.
3520 (BootstrapCorlib_*): Simplified.
3521 (PopulateCoreType): Core types can be now external.
3523 2007-06-07 Marek Safar <marek.safar@gmail.com>
3525 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
3527 (InferTypeArguments): Infers anonymous expression type arguments.
3528 (Compatible): Split to Compatible and InferTypeArguments.
3530 * lambda.cs: Updated.
3532 2007-06-08 Marek Safar <marek.safar@gmail.com>
3534 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
3536 2007-06-07 Raja R Harinath <harinath@gmail.com>
3538 Fix #80477, cs0135-2.cs, cs0135-3.cs
3539 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
3540 names to the "known" variables list.
3541 (Block.CheckInvariantMeaningInBlock): Handle the fact the
3542 parameter names are also "known".
3543 (Block.CheckError136): Remove.
3544 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
3547 2007-06-07 Marek Safar <marek.safar@gmail.com>
3549 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
3551 2007-06-06 Marek Safar <marek.safar@gmail.com>
3553 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
3554 internal error not an user error.
3556 * expression.cs (IsApplicable): Refactored to make debugging easier.
3558 * support.cs: More tricks for non-mono runtimes.
3560 * typemanager.cs (CoreLookupType): Made public.
3561 (InitSystemCore): All linq specific stuff moved to linq.cs
3563 2007-06-05 Marek Safar <marek.safar@gmail.com>
3565 * typemanager.cs (CSharpSignature): One more missing build-in types
3567 More tricks for non-mono runtime.
3569 2007-06-05 Raja R Harinath <harinath@gmail.com>
3571 * statement.cs (Block.CheckError136_InParents): Remove.
3572 (Block.AddVariable): Use GetParameterInfo instead.
3573 (ToplevelBlock.ProcessArguments): Likewise.
3575 2007-06-04 Raja R Harinath <rharinath@novell.com>
3577 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
3579 (ToplevelBlock.GetParameterInfo): Split out of ...
3580 (ToplevelBlock.GetParameterRefernce): ... this.
3581 (ToplevelBlock.ParameterMap): Remove.
3582 * expression.cs (ParameterReference): Update to use
3583 ToplevelParameterInfo.
3585 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
3588 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
3589 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
3591 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
3592 (ToplevelBlock.ProcessParameters) ... here.
3593 (ToplevelBlock..ctor): Invoke it.
3595 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
3598 * statement.cs (IKnownVariable): New interface.
3599 (LocalInfo): Implement it.
3600 (ToplevelParameterInfo): New class.
3601 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
3602 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
3603 GetKnownVariableInfo.
3605 2007-06-03 Raja R Harinath <harinath@gmail.com>
3607 Partly speed up CS0136 error checks.
3608 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
3609 'recurse' parameter.
3610 (Block.DoCheckError136): Only check errors in parameters. Move
3611 local variable checks ...
3612 (Block.AddVariable): ... here, and ...
3613 (ToplevelBlock.ResolveMeta): ... here.
3615 2007-06-02 Raja R Harinath <harinath@gmail.com>
3617 * statement.cs (Block.IsChildOf): Remove.
3619 * statement.cs (Statement.Clone): Move special case code ...
3620 (Block.CloneTo): ... here.
3622 2007-05-29 Raja R Harinath <rharinath@novell.com>
3624 * statement.cs (ToplevelBlock.container): Remove field. It's
3625 redundant with 'Parent'.
3626 (ToplevelBlock.ContainerBlock): Remove accessor.
3627 (ToplevelBlock..ctor): Update to changes. Register anonymous
3628 child with parent here, ...
3629 * cs-parser.jay (end_anonymous): ... not here. Don't modify
3631 (start_anonymous): Don't save current_block.
3632 (top_current_block): Remove.
3634 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
3635 (Block.Resolve): Update to changes.
3636 (Block..ctor): Move setting of "correct" 'Toplevel'
3637 and 'Explicit' fields to ...
3638 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
3640 2007-05-27 Raja R Harinath <harinath@gmail.com>
3643 * statement.cs (Block.Implicit): Remove.
3644 (Block): Update to changes.
3645 * flowanalysis.cs: Likewise.
3647 Mildly speed up CheckInvariantMeaningInBlock
3648 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
3649 Recursively call AddKnownVariable to all enclosing blocks.
3650 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
3651 Remove recursive calls.
3652 (Block): Update to changes.
3654 New ExplicitBlock invariants
3655 * statement.cs (Block.Explicit): New field. It points to the
3656 immediately enclosing non-implicit block.
3657 (Block..ctor): Maintain the invariant.
3658 * cs-parser.jay: Take advantage of invariant.
3660 Introduce ExplicitBlock
3661 * statement.cs (ExplicitBlock): New.
3662 (ToplevelBlock): Derive from it.
3663 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
3665 (Block.Implicit): Update to changes.
3666 * cs-parser.jay: Update to changes.
3669 * codegen.cs (EmitContext.IsLastStatement): Remove.
3670 * statement.cs (Block.DoEmit): Update to changes.
3672 2007-05-25 Raja R Harinath <rharinath@novell.com>
3674 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
3675 modifying current_block directly.
3677 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
3679 * class.cs: Implemented automatic properties (C# 3.0)
3680 Thanks to Marek for the help.
3682 2007-05-23 Raja R Harinath <rharinath@novell.com>
3684 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
3685 variable as assigned, note also that all its components are
3687 (MyBitVector.SetRange): New. Function to set multiple bits to true.
3689 2007-05-19 Marek Safar <marek.safar@gmail.com>
3691 * anonymous.cs, class.cs: Emit Compiler generated attribute when
3692 member is marked as compiler generated.
3694 * decl.cs (MemberCore): Refactored ModFlags into property.
3696 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
3697 (Check): Check only accessibility modifiers.
3699 2007-05-18 Raja R Harinath <rharinath@novell.com>
3701 Track all assignable slots in one bit array
3702 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
3703 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
3704 logic from VariableMap constructor here. Use the same 'offset'
3705 variable that's later used for computing offsets of local
3707 * flowanalysis.cs (UsageVector.parameters): Remove.
3708 (UsageVector): Update to changes.
3709 (VariableMap): Remove.
3711 Avoid creating ParameterMap in every block
3712 * statement.cs (Block.ParameterMap): Move ...
3713 (ToplevelBlock.ParameterMap): ... here.
3714 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
3716 * flowanalysis.cs (FlowBranching.param_map): Remove.
3717 (FlowBranching.UsageVector): Update to changes.
3718 (FlowBranchingToplevel.CheckOutParameters): Likewise.
3720 * statement.cs (Block.CloneTo): Clone Toplevel field too.
3722 * expression.cs (ParameterReference): Distinguish between block
3723 where parameter was referenced and declared.
3725 2007-05-18 Marek Safar <marek.safar@gmail.com>
3727 * flowanalysis.cs, statement.cs: Put back improved error handling.
3729 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
3733 Imporved object and collection initialization (C# 3.0).
3735 2007-05-15 Marek Safar <marek.safar@gmail.com>
3737 A fix for bug #81380
3738 * expression.cs (Is.DoResolve): Only value types have constant `is'
3741 2007-05-15 Raja R Harinath <rharinath@novell.com>
3743 * statement.cs (ToplevelBlock.child): Remove.
3745 2007-05-15 Raja R Harinath <harinath@gmail.com>
3747 Rationalize ResolveMeta: refactoring
3748 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
3749 out constant handling code into ...
3750 (Block.DoResolveConstants): ... this.
3752 Rationalize ResolveMeta: kill local_map
3753 * statement.cs (Block.local_map, Block.LocalMap): Remove.
3754 (Block.AssignableSlots): New.
3755 (Block.ResolveMeta): Make protected. Don't create a VariableMap
3756 for locals -- move code from VariableMap here. Avoid unnecessary
3758 * flowanalysis.cs (FlowBranching.local_map): Remove.
3759 (FlowBranching..ctor): Use Block.AssignableSlots.
3760 (VariableMap): Remove unused constructors.
3762 2007-05-11 Raja R Harinath <rharinath@novell.com>
3764 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
3766 2007-05-11 Marek Safar <marek.safar@gmail.com>
3768 * typemanager.cs (IsFriendAssembly): Should not be called for building
3771 2007-05-09 Marek Safar <marek.safar@gmail.com>
3773 * literal.cs (NullConstant): Print null in all cases.
3775 * expression.cs (Binary.ResolveOperator): Implemented delegate
3776 comparison based on C# 2.0 changes.
3778 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
3780 This code is contributed under the MIT X11 license
3782 The following enables support for several C# 3.0 language features:
3784 * cs-tokenizer.cs: Added support for the "var" keyword.
3786 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
3787 Added VarExpr class to facilitate type inferencing.
3789 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
3790 to support anonymous types.
3792 * assign.cs: Added support for type inferencing and initialization.
3794 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
3796 * expression.cs: Added implicit array support to ArrayCreation.
3797 Added 5 types and 1 interface:
3799 IInitializable Implementing classes can inject initializing
3800 statements after object instantiation.
3802 Initializer Stores data for object initialization.
3804 AnonymousType An expression for anonymous types.
3806 AnonymousTypeParameter Stores data about an anonymous type's field.
3808 NewInitialize An expression for object initialization.
3810 CollectionInitialize An expression for collection initialization.
3812 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
3815 2007-05-06 Marek Safar <marek.safar@gmail.com>
3817 A fix for bug #81500
3818 * cs-tokenizer.cs: Add special handling for coalescing operator.
3820 2007-05-06 Marek Safar <marek.safar@gmail.com>
3822 A fix for bug #81529
3823 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
3824 its value from base class until it is redefined.
3826 2007-05-02 Raja R Harinath <rharinath@novell.com>
3828 Fix regression in cs0631-3.cs
3829 * cs-parser.jay (operator_declarator): Add opt_attributes to error
3830 fallback. Make error fallback catch more cases.
3832 2007-05-01 Miguel de Icaza <miguel@novell.com>
3834 * cs-parser.jay: Allow parameters in operator declarations to have
3837 2007-04-27 Miguel de Icaza <miguel@novell.com>
3839 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
3842 * lambda.cs (ContextualReturn.Resolve): An expression is valid
3843 inside the ContextualReturn, it does not have to be an
3844 ExpressionStatement.
3846 2007-04-24 Miguel de Icaza <miguel@novell.com>
3848 * lambda.cs (ContextualReturn.Resolve): if the return type is not
3851 2007-04-23 Miguel de Icaza <miguel@novell.com>
3853 * anonymous.cs (AnonymousContainer): split the virtual Resolve
3854 method in two methods: ResolveNoDefine and Resolve.
3856 ResolveNoDefine will stop just after ResolveTopBlock has been
3859 Resolve will then continue by creating a method and issuing the
3860 call to method.Define ().
3862 (AnonymousMethod): Split and implement the new Resolve and
3863 ResolveNoDefine as well.
3865 * lambda.cs (LambdaExpression): Split the anonymous method
3866 resolution code into a separate routine (CoreCompatibilityTest)
3867 from DoCompatibleTest.
3869 (LambdaExpression.TryBuild): New method, this method tries to
3870 build the LambdaExpression with the given set of types to be used
3871 as the types for the various parameters of the lambda expression.
3873 If the compilation succeed with the given types, the infered type
3874 of the Anonymous method is returned, otherwise null is returned.
3876 2007-04-23 Marek Safar <marek.safar@gmail.com>
3878 A fix for bug #81414
3879 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
3881 2007-04-22 Miguel de Icaza <miguel@novell.com>
3883 * cs-tokenizer.cs: Change various identifiers here from the
3884 camelCasing to the recommended Linux-like style for instance
3885 variables from the Coding Guidelines.
3887 2007-04-19 Martin Baulig <martin@ximian.com>
3890 (Convert.ImplicitReferenceConversionCore): Allow conversions from
3891 System.Enum to System.ValueType.
3893 2007-04-13 Martin Baulig <martin@ximian.com>
3895 Rewrote implicit reference conversions. We need to distinguish
3896 between implicit reference conversions (13.1.4) and implicit
3897 boxing conversions (13.1.5).
3899 According to the spec, there's an an implicit conversion
3900 "From a one-dimensional array-type S[] to IList<T> and base
3901 interfaces of this interface, provided there is an implicit
3902 reference conversion from S to T." Note that this does not
3903 include boxing conversions.
3906 (Convert.ImplicitTypeParameterBoxingConversion): New method.
3907 (Convert.ImplicitReferenceConversion): Split into
3908 ImplicitReferenceConversionCore() and
3909 ImplicitBoxingConversionExist().
3910 (Convert.ImplicitReferenceConversionExists): Use the new
3911 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
3913 2007-04-12 Martin Baulig <martin@ximian.com>
3915 * convert.cs (Convert.ImplicitReferenceConversion): Move the
3916 `TypeManager.null_type' checks up to the top of the method.
3918 2007-04-11 Marek Safar <marek.safar@gmail.com>
3920 A fix for bug #81350
3921 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
3924 2007-04-11 Martin Baulig <martin@ximian.com>
3926 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
3927 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
3928 to make this work for generic classes; fixes #79561.
3930 2007-04-11 Martin Baulig <martin@ximian.com>
3932 * expression.cs (As): Add support for nullable types; fixes #79371.
3934 2007-04-11 Martin Baulig <martin@ximian.com>
3936 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
3937 `type.FullName' is null; fixes #80243.
3939 2007-04-11 Martin Baulig <martin@ximian.com>
3941 * expression.cs (Invocation.IsApplicable): Don't modify the method
3942 if type inference succeeded, but the method was not applicable.
3945 2007-04-10 Marek Safar <marek.safar@gmail.com>
3947 A fix for bug #81324
3948 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
3949 internal and external namespaces containers.
3951 2007-04-10 Martin Baulig <martin@ximian.com>
3953 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
3954 TypeManager.DropGenericMethodArguments() so we also call
3955 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
3957 2007-04-10 Martin Baulig <martin@ximian.com>
3959 * iterators.cs (Iterator.CreateIterator): Don't crash if
3960 `method.ReturnType' is null. This happens if something went wrong
3961 while resolving that typ (we already reported an error in this case).
3963 2007-04-10 Martin Baulig <martin@ximian.com>
3965 * expression.cs (New.DoResolve): Don't call CheckComImport() on
3966 generic interfaces; report the CS0144 directly.
3968 2007-04-10 Martin Baulig <martin@ximian.com>
3970 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
3971 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
3973 2007-04-10 Martin Baulig <martin@ximian.com>
3975 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
3977 2007-04-09 Raja R Harinath <rharinath@novell.com>
3980 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
3981 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
3984 * statement.cs (For.Resolve): If resolution fails, use
3987 2007-04-08 Marek Safar <marek.safar@gmail.com>
3989 * anonymous.cs (MakeName): Make faster and zero-based.
3990 (VerifyExplicitParameterCompatibility): Back to mode where generic
3991 parameter is ignored.
3992 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
3994 * class.cs (EmitType): Method can emit another new method.
3996 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
3998 * driver.cs: Updated.
4000 * lambda.cs: Reuse predefined empty parameters.
4002 * parameter.cs: Updated
4004 * support.cs: Implemented InflateTypes.
4006 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
4007 (InitSystemCore): Introduced to isolate 3.0 dependencies.
4009 2007-04-03 Martin Baulig <martin@ximian.com>
4013 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
4014 version of TypeManager.IsOverride() which also works with generic
4017 2007-04-03 Martin Baulig <martin@ximian.com>
4022 (Convert.ExplicitReferenceConversion): We need to cast when
4023 converting from IList<T> to S[].
4025 2007-04-01 Marek Safar <marek.safar@gmail.com>
4027 * decl.cs (FindExtensionMethods): Consider all candidates with same name
4030 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
4032 2007-03-31 Marek Safar <marek.safar@gmail.com>
4034 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
4035 argument and return type inferring.
4037 * codegen.cs (InferReturnType): Flag whether return can be inferred.
4038 (ReturnType): Turned to property.
4040 * statement.cs (Return): Implemented return type inferring.
4042 * support.cs (ReflectionParameters): Use local types if possible.
4044 2007-03-30 Raja R Harinath <rharinath@novell.com>
4046 * flowanalysis.cs (FlowBranching.Reachability): Remove.
4047 (FlowBranching.UsageVector): Update to changes.
4049 Prepare to kill 'Reachability'
4050 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
4051 argument of constructor.
4053 2007-03-29 Raja R Harinath <rharinath@novell.com>
4055 Prepare to kill 'Reachability'
4056 * flowanalysis.cs (UsageVector.is_unreachable): New.
4057 (UsageVector): Update to maintain 'is_unreachable' in parallel to
4058 'reachability', and verify they're consistent.
4061 * expression.cs (New.EmitStatement): Handle type parameters here too.
4063 2007-03-29 Martin Baulig <martin@ximian.com>
4068 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
4069 CompilerGeneratedClass.
4070 (ScopeInfo.EmitScopeInstance): Make this protected.
4071 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
4072 `ec.CurrentAnonymousMethod.Scope == Scope'.
4074 * statement.cs (Block.ScopeInfo): Make this a property.
4076 2007-03-27 Raja R Harinath <harinath@gmail.com>
4078 Prepare to kill 'Reachability'
4079 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
4080 (FlowBranching.UsageVector.Reachability): Remove property.
4081 (FlowBranching.UsageVector.IsUnreachable): New property.
4082 (FlowBranching.UsageVector.ResetBarrier): New.
4083 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
4084 * codegen.cs, statement.cs: Update to changes.
4086 2007-03-27 Martin Baulig <martin@ximian.com>
4091 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
4094 2007-03-26 Raja R Harinath <rharinath@novell.com>
4096 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
4097 instead of TriState. Remove all mention of TriState.
4099 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
4100 replaced by a boolean. Add boolean 'is_unreachable' field, check
4101 and maintain invariants.
4103 2007-03-25 Marek Safar <marek.safar@gmail.com>
4105 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
4107 2007-03-25 Marek Safar <marek.safar@gmail.com>
4109 * expression.cs: Stop using obsolete 2.0 opcodes.
4111 2007-03-25 Marek Safar <marek.safar@gmail.com>
4113 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
4114 one of the latests Martin's fixes.
4116 2007-03-23 Miguel de Icaza <miguel@novell.com>
4118 * expression.cs: On BigEndian systems, swap the bytes, temporary
4119 solution until we get a new bitconverter class.
4121 2007-03-23 Martin Baulig <martin@ximian.com>
4125 * decl.cs (MemberCache.AddMembers): Add generic methods both as
4126 "Method" and "Method`1". Normally, a cache lookup is done on the
4127 "Method" form (ie. without the generic arity), but this one makes
4128 lookups on the full form work as well.
4130 2007-03-22 Raja R Harinath <rharinath@novell.com>
4132 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
4135 2007-03-20 Bill Holmes <billholmes54@gmail.com>
4137 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
4138 ordered_member_list, to TypeBuilder to store members to be defined
4139 in the order they were parsed in.
4140 - ordered_explicit_member_list contains all properties indexers
4141 and methods that are defined as explicit implementation of an
4142 interface or base class.
4143 - ordered_member_list contains all properties indexers and methods
4144 that are not defined as explicit implementation of an interface
4147 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
4148 functionality in these removed classes has been replaced with
4149 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
4150 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
4152 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
4153 to CheckForDuplications inside GetMethod and SetMethod Define Method
4154 to handle method property and indexer name conflicts.
4158 All code is contributed under the MIT/X11 license.
4160 2007-03-20 Martin Baulig <martin@ximian.com>
4162 * class.cs (TypeContainer.Interfaces): Removed; they're now
4163 included in `TypeContainer.Types'.
4165 2007-03-20 Martin Baulig <martin@ximian.com>
4167 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
4169 * class.cs (TypeContainer.CreateType): New public method. This is
4170 now called before DefineType() to create the TypeBuilders.
4171 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
4172 has already been created by CreateType().
4173 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
4174 don't resolve our base classes here; this has been moved into
4175 DefineBaseTypes(). We're now called from CreateType().
4176 (TypeContainer.DefineBaseTypes): New private method; resolve our
4177 base classes here. We're now called from DefineType().
4180 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
4181 our types first to create all the TypeBuilders. After that, call
4182 TypeContainer.DefineType() on all the types which'll resolve their
4183 base classes and setup the resolve order.
4185 2007-03-20 Martin Baulig <martin@ximian.com>
4187 * class.cs (TypeContainer.Enums): Removed; they're now included in
4188 `TypeContainer.Types'.
4190 2007-03-20 Martin Baulig <martin@ximian.com>
4193 (TypeContainer.DefineType): Don't call ResolveMembers() here.
4194 (TypeContainer.DoResolveMembers): Call DefineType() on our
4195 `compiler_generated' classes; moved here from DefineNestedTypes().
4198 (RootContext.ResolveTree): Call ResolveMembers() on all
4199 TypeContainer's in the `type_container_resolve_order'.
4201 2007-03-19 Marek Safar <marek.safar@gmail.com>
4203 * class.cs: Use corlib to handle InternalMethodImplAttribute.
4205 2007-03-17 Marek Safar <marek.safar@gmail.com>
4207 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
4208 implementation flags.
4210 2007-03-17 Marek Safar <marek.safar@gmail.com>
4212 * class.cs: More optimizations for type parameters.
4214 2007-03-15 Marek Safar <marek.safar@gmail.com>
4216 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
4218 * ecore.cs, parameter.cs: More common code for both corlibs.
4220 * typemanager.cs (IsGenericMethod): Simplified.
4222 2007-03-15 Raja R Harinath <rharinath@novell.com>
4224 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
4226 * statement.cs, iterators.cs, lambda.cs: Update to changes.
4228 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
4229 unconditionally. Simplify explanation.
4230 (Try.Resolve, Using.Resolve): Likewise.
4232 2007-03-15 Martin Baulig <martin@ximian.com>
4236 * decl.cs (DeclSpace): If we're a partial class, use our
4237 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
4239 2007-03-15 Raja R Harinath <rharinath@novell.com>
4241 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
4243 (FlowBranching.UsageVector): Update to changes.
4244 (FlowBranching.MergeSiblings): Likewise.
4245 * statement.cs: Likewise.
4247 2007-03-15 Martin Baulig <martin@ximian.com>
4252 (MemberCache): Added a special .ctor for type parameters.
4255 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
4258 2007-03-09 Martin Baulig <martin@ximian.com>
4260 * enum.cs (Enum): Make this a TypeContainer.
4261 (EnumMember): Derive from `Const'.
4264 (Const.DoResolveValue): New protected virtual method; move most of
4265 the functionality of ResolveValue() here so we can override it in
4267 (Const.CreateConstantReference): Make this virtual.
4269 * class.cs (Kind): Add `Kind.Enum'.
4270 (TypeContainer.Emit): Don't emit the enums here; they're already
4271 in the `RootContext.typecontainer_resolve_order'.
4273 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
4274 here; they're already in the `typecontainer_resolve_order'.
4276 * ecore.cs (EnumConstant.ConvertImplicitly): Add
4277 TypeManager.DropGenericTypeArguments().
4280 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
4281 (TypeManager.IsEnumType): Likewise.
4282 (TypeManager.EnumToUnderlying): Likewise.
4283 (TypeManager.IsEqual): Add support for enums.
4285 2007-03-12 Raja R Harinath <rharinath@novell.com>
4287 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
4288 DefaultParameterValueAttribute to be undefined, say if System.dll
4291 2007-03-11 Marek Safar <marek.safar@gmail.com>
4293 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
4296 2007-03-10 Marek Safar <marek.safar@gmail.com>
4298 * class.cs, parameter.cs: Unified parameters verification.
4300 2007-03-08 Martin Baulig <martin@ximian.com>
4302 * cs-parser.jay (constructor_header): Pass the location to the
4303 newly created TopLevelBlock.
4305 2007-03-07 Martin Baulig <martin@ximian.com>
4307 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
4309 2007-03-06 Miguel de Icaza <miguel@novell.com>
4311 * convert.cs (ExplicitReferenceConversionExists): Sync this method
4312 with the changes from David, fixes the build.
4314 2007-03-05 David Mitchell <dmitchell@logos.com>
4316 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
4317 and its base interfaces to a one-dimensional array type S[],
4318 provided there is an implicit or explicit reference conversion
4321 2007-03-03 Marek Safar <marek.safar@gmail.com>
4323 * cs-tokenizer.cs: Implemented basic linq grammar.
4325 * driver.cs: Set linq lang version on demand.
4327 2007-02-26 Marek Safar <marek.safar@gmail.com>
4329 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
4331 2007-02-25 Marek Safar <marek.safar@gmail.com>
4333 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
4336 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
4338 Check property and event extern attributes.
4340 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
4343 2007-02-24 Marek Safar <marek.safar@gmail.com>
4345 A fix for bug #80407
4346 * ecore.cs: Don't report ambiguity error when methods have same parent.
4348 2007-02-23 Marek Safar <marek.safar@gmail.com>
4350 A fix for bug #80878
4351 * class.cs, cs-parser.jay: Event property can host anonymous methods.
4353 2007-02-22 Marek Safar <marek.safar@gmail.com>
4355 * attribute.cs: Enable ExtensionAttribute presence test.
4357 2007-02-22 Marek Safar <marek.safar@gmail.com>
4359 * class.cs: Warn about missing GetHashCode only when Equals is override.
4361 * decl.cs: Check accessibility of type arguments.
4363 * typemanager.cs: Correctly report nullable array.
4365 2007-02-20 Marek Safar <marek.safar@gmail.com>
4367 * class.cs, report.cs: Capture more details when things go wrong.
4369 2007-02-20 Marek Safar <marek.safar@gmail.com>
4371 A fix for bug #80650
4372 * cs-parser.jay: Anonymous container starts at constructor declaration
4373 and not at block beginning because it has to be usable in constructor
4376 * statement.cs: Use context location and not block one for error reporting.
4378 2007-02-18 Marek Safar <marek.safar@gmail.com>
4380 A fix for bug #78712
4381 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
4384 2007-02-18 Marek Safar <marek.safar@gmail.com>
4386 A fix for bug #80493 by Atsushi Enomoto
4387 * cs-parser.jay: Ignore invalid attribute target.
4389 2007-02-18 Marek Safar <marek.safar@gmail.com>
4391 * cs-tokenizer.cs: Ignore '\0' as white space character.
4393 2007-02-17 Miguel de Icaza <miguel@novell.com>
4395 * cs-parser.jay: Add support for lambda expressions to the mcs
4398 * lambda.cs: Only clone when we are probing, not on the final call
4399 (Compatible is the final call).
4401 * statement.cs (CloneContext): Introduce class to provide block
4402 remapping during clone.
4404 All statements Clone themselves now.
4406 (Clone): special handling for blocks, when we clone a block, we
4407 register the block inside this routine, as children of the block
4408 might trigger a lookup.
4410 * expression.cs: Add support for CloneContext in all expressions.
4412 2007-02-17 Marek Safar <marek.safar@gmail.com>
4414 A fix for bug #80493
4415 * statement.cs: Report ambiguous warning when interfaces are not related.
4417 2007-02-15 Marek Safar <marek.safar@gmail.com>
4419 C# 3.0 extension methods.
4421 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
4422 cannot be used directly.
4424 * class.cs (Class.Emit): Emit extension attribute if any class method
4425 is extension method.
4426 (Method.Define): Add basic extension method validation conditions.
4427 (Method.Emit): Emit extension attribute for method.
4429 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
4430 extension method exists. Currently we follow same approach as Microsoft
4431 does, emit even if a method or a class are private but this can change
4434 * cs-parser.jay: Add handling of `this' keyword in method parameters
4437 * decl.cs (DeclSpace.IsStaticClass): New property.
4438 (MemberCache.FindExtensionMethods): Looks for extension methods with
4439 defined name and extension type.
4441 * doc.cs: Updated after OverloadResolve changes.
4443 * driver.cs: Add new soft reference to System.Core.dll.
4445 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
4446 (ExtensionMethodGroupExpr): Represents group of extension methods.
4448 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
4449 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
4450 to MethodGroupExpr and made non-static for easier customization.
4451 (Invocation.DoResolve): Add extension method lookup when no standard
4453 (MemberAccess.DoResolve): Try extension methods if no member exists.
4455 * modifiers.cs: Add METHOD_EXTENSION modifier.
4457 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
4458 as well as candidate extension type.
4459 (ComputeNamespaces): When assembly constains extension methods registers
4461 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
4462 extension method lookup.
4463 (Namespace.LookupExtensionMethod): Looks for extension method in this
4465 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
4466 find a method which matches name and extensionType.
4468 * parameter.cs (Parameter): Add This modifer.
4469 (HasExtensionMethodModifier): New property.
4470 (Resolve): Add extension parameter check.
4471 (ModFlags): turned to property to exclude this modifier as it is not real
4473 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
4475 * support.cs (ParameterData): Add ExtensionMethodType.
4476 (ReflectionParameters): Implemented ExtensionMethodType interface property.
4478 * typemanager.cs: Add type and ctor extension attribute type.
4480 2007-02-15 Miguel de Icaza <miguel@novell.com>
4482 * report.cs (DisableErrors, EnableErrors): used to prevent error
4483 output when we are "trying" to compile various methods with
4486 * ecore.cs (Expression): Add Clone method that calls the virtual
4487 CloneTo method. The current CloneTo method in Expression throws
4488 an exception so we can track down all the places where this must
4489 be implemented (not using abstract, because that would be a lot of
4490 up-front-work before we can start testing the implementation
4493 Important: we only need Clone capabilities for expressions created
4494 by the parser, as the expressions we will be cloning are
4495 expressions in the pre-resolved state. This vastly simplifies
4498 (SimpleName): Add CloneTo that does nothing.
4499 (EmptyCast): Add CloneTo.
4501 * expression.cs (Binary): Implement CloneTo.
4502 (Invocation.IsApplicable): Store the current ec in
4503 EmitContext.TempEc and restore it on return. This is used so we
4504 do not have to sprinkle hundres of methods with an extra
4505 EmitContext, we know that the only user is the lambda expression
4506 ImplicitConversionExists code.
4508 (Argument): Add Cloning capabilities.
4509 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
4510 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
4511 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
4512 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
4513 IndexerAccess): Add Clone capability.
4515 (LocalVariableReference, This): TODO: needs cloned Block mapping.
4517 (Argument): Add cloning capability.
4519 * assign.cs (Assign): Implement CloneTo.
4521 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
4523 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
4524 version by calling Convert with the EmitContext (that we are
4525 currently storing in ec, this is not great, but will do for now,
4526 to avoid passing EmitContext parameters to hundreds of functions
4527 that do not need them now).
4529 (SetExpression): Remove, it is not needed.
4531 (ContextualReturn): Implement CloneTo.
4533 * statement.cs (Statement): Implement cloning infrastructure,
4534 similar to expressions.
4536 (Block): Partial implementation of Clone for statements.
4538 (Return): Implement clone.
4540 * constant.cs (Constant.CloneTo): New method, does nothing.
4542 * codegen.cs (TempEc): Add a static EmitContext as a temporary
4543 solution, until we decide how to exactly do this.
4545 2007-02-14 Marek Safar <marek.safar@gmail.com>
4547 A fix for bug #80493
4548 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
4549 a property is override we need to use second accessor.
4551 2007-02-13 Marek Safar <marek.safar@gmail.com>
4553 A fix for bug #80418
4554 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
4557 2007-02-13 Marek Safar <marek.safar@gmail.com>
4559 Another fix for bug #80749
4560 * pending.cs: Abstract class has priority over interfaces.
4562 2007-02-13 Marek Safar <marek.safar@gmail.com>
4564 Another fix for bug #80749
4565 * pending.cs: Abstract class has priority over interfaces.
4567 2007-02-13 Marek Safar <marek.safar@gmail.com>
4569 Another fix for bug #80749
4570 * pending.cs: Abstract class has priority over interfaces.
4572 2007-02-13 Marek Safar <marek.safar@gmail.com>
4574 Another fix for bug #80749
4575 * pending.cs: Abstract class has priority over interfaces.
4577 2007-02-13 Marek Safar <marek.safar@gmail.com>
4579 * class.cs Better error message.
4581 * driver.cs: Add shorter versions of -optimize option.
4583 2007-02-13 Martin Baulig <martin@ximian.com>
4585 * class.cs (Constructor.Emit): Check the return value of
4586 ec.ResolveTopBlock() and return on error.
4588 2007-02-13 Raja R Harinath <rharinath@novell.com>
4590 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
4591 message to fix error message regression.
4593 2007-02-12 Marek Safar <marek.safar@gmail.com>
4595 * delegate.cs: Delegate creation expression cannot be of Nullable type.
4597 2007-02-12 Marek Safar <marek.safar@gmail.com>
4599 A fix for bug #80749
4600 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
4601 its parent container.
4603 * class.cs (DefineFieldInitializers): Each initializer can has different
4606 * const.cs: Updated.
4608 2007-02-11 Miguel de Icaza <miguel@novell.com>
4610 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
4611 now all the heavy lifting to check that embedded statements or
4612 expressions have the right form is done in the ContextualReturn.
4614 (ContextualReturn): New class.
4616 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
4617 method that can be invoked to report 201, so we do not replicate
4620 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
4622 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
4623 treating tabs as spaces.
4625 2007-02-09 Marek Safar <marek.safar@gmail.com>
4627 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
4628 * assign.cs: Use full implicit conversion for right side check.
4630 2007-02-09 Marek Safar <marek.safar@gmail.com>
4632 * statement.cs (Switch): Switch over boolean type is not standardized.
4634 2007-02-08 Marek Safar <marek.safar@gmail.com>
4636 A fix for bug #80755
4637 * decl.cs (FindBaseEvent): Don't use method cache for events.
4639 2007-02-07 Marek Safar <marek.safar@gmail.com>
4641 * cs-parser.jay: Better syntax error handling.
4643 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
4644 instead of underlying type value.
4646 2007-02-06 Marek Safar <marek.safar@gmail.com>
4648 * driver.cs: Check define identifier before is registered.
4650 * namespace.cs: Use existing error message.
4652 * report.cs: New warning.
4654 2007-02-06 Marek Safar <marek.safar@gmail.com>
4656 A fix for bug #80742
4657 * expression.cs: Delegate Invoke method can be called directly.
4659 2007-02-06 Marek Safar <marek.safar@gmail.com>
4661 A fix for bug #80676
4662 * class.cs (IsEntryPoint): The Main method can have params modifier.
4664 2007-02-04 Miguel de Icaza <miguel@novell.com>
4666 * parameter.cs (Parameter, Parameters): Add Clone method.
4668 * anonymous.cs (Compatible): Turn method into virtual method, so
4669 LambdaExpression can implement a different behavior.
4671 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
4672 out the basic checking here, so it can be used by
4675 * lambda.cs: Introduce "Compatible" function that will do the
4678 2007-02-02 Marek Safar <marek.safar@gmail.com>
4680 * attribute.cs: Unified one error message.
4682 * class.cs (Class): Use type attributes and not properties to test static
4684 (IsEntryPoint): Don's pass local variable.
4686 * convert.cs: Removed duplicate check.
4688 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
4690 * driver.cs: Don't crash when soft reference does not exist.
4692 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
4693 (UsingEntry): Removed redundant allocation.
4695 * parameter.cs: Add fast path for type parameters.
4697 * support.cs: Don't allocate attribute when it's not used.
4699 2007-01-30 Miguel de Icaza <miguel@novell.com>
4702 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
4703 this into a virtual method, so we can override it in LambdaExpression.
4705 * driver.cs: Improve diagnostics in case of failure.
4707 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
4708 write a function that is slightly more complex and that parses:
4710 type identifier [, type identifier]* )
4712 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
4715 (canEmpty ? i >= 0 : i > 0)
4717 2007-01-30 Raja R Harinath <rharinath@novell.com>
4719 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
4720 exception on possibly valid code.
4722 2007-01-29 Raja R Harinath <rharinath@novell.com>
4724 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
4726 (parse_opt_type_arguments): Remove. It's almost the same as
4728 (parse_namespace_or_typename): Use parse_less_than.
4730 2007-01-28 Miguel de Icaza <miguel@novell.com>
4732 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
4733 this bug took a few hours to find, because the state saved and
4734 restored by PushPosition and PopPosition was ignoring the state of
4735 parse_generic_less_than.
4737 I can also now remove the handling of OP_LT and OP_GT, this solves
4740 * cs-tokenizer.cs: store the location for the ARROW token, we use
4743 (PushPosition, PopPosition): save/restore also `current_token',
4744 restore `parse_generic_less_than' (was missing).
4746 (parse_opt_type_arguments): use parse_type, not
4747 parse_namespace_or_typename to parse types.
4749 * lambda.cs: Empty new file, will eventually have the lambda
4750 expression implementation.
4752 * lambda.test: used to test the internal tokenizer.
4754 * report.cs (FeatureIsNotISO1): Rename from
4755 FeatureIsNotStandardized, because it was about the language level
4756 (1 vs 2) it was not about standarization.
4758 (FeatureRequiresLINQ): New.
4760 * support.cs (SeekableStreamReader): Only require that the reader
4761 is a TextReader, not a StreamReader, so we can plug StringReader.
4763 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
4764 given position in the input stream the following tokens can be
4765 parsed as a type followed by an identifier.
4767 (is_punct): after a '(' if parse_type_and_parameter returns true,
4768 then return a special token OPEN_PARENS_LAMBDA which is used to
4769 avoid reduce/reduce errors in the grammar for the
4770 lambda_expression rules.
4772 (parse_type): implement a type parser inside the
4773 tokenizer, the parser only returns true or false depending on
4774 whether the input at a given position can be parsed as a type.
4776 (peek_token): new method used during type parsing.
4778 2007-01-28 Raja R Harinath <rharinath@novell.com>
4781 * anonymous.cs (ScopeInfo.InflateParameters): New.
4782 (AnonymousContainer.Resolve): Use it to redirect types of
4783 delegate parameters.
4785 2007-01-27 Raja R Harinath <rharinath@novell.com>
4788 * expression.cs (Error_InvalidArguments): Don't use two different
4789 messages for CS1503. Use ExtraInformation and
4790 SymbolRelatedToPreviousError instead.
4793 * decl.cs (DeclSpace.initialize_type_params): Don't access
4794 'type_params' of a partial class directly.
4796 2007-01-26 Miguel de Icaza <miguel@novell.com>
4798 * constant.cs: Removed a handful of out-of-range checks that were
4801 2007-01-25 Marek Safar <marek.safar@gmail.com>
4803 * expression.cs (CheckUselessComparison): Add additional check for char
4806 * namespace.cs: Fixed typo.
4808 2007-01-23 Miguel de Icaza <miguel@novell.com>
4810 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
4811 gone, instead we inline the test, preventing the needless casts to
4812 longs, ulongs and doubles for the parameters, avoiding calls to
4813 methods that overchecked stuff, and instead inlined things
4816 2007-01-20 Marek Safar <marek.safar@gmail.com>
4818 * cs-parser.jay: Better parameter error handling.
4820 2007-01-17 Marek Safar <marek.safar@gmail.com>
4822 A fix for bug #80368, #80522
4823 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
4824 whether array initializer contains constants only.
4825 (ArrayCreation.Emit): Use better formula to decide when
4826 are array initializers for static initialization.
4827 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
4828 have to emit even constants otherwise they are pre-initialized.
4830 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
4831 Raja R Harinath <rharinath@novell.com>
4833 Fix emit order of 'get' vs. 'set'.
4834 * support.cs (Accessors): New.
4835 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
4836 Note the order in which accessors are declared in the source.
4837 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
4838 Refactored from Property.Define and Indexer.Define.
4839 (PropertyBase.DefineAccessors): New helper that calls the above in
4840 appropriate order as noted by the parser.
4841 (Property.Define, Indexer.Define): Update to changes.
4842 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
4844 2007-01-17 Raja R Harinath <rharinath@novell.com>
4846 Fix cs0029-6.cs and gcs0029-2.cs (regression)
4847 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
4848 there's an implicit conversion from the current type to the target
4849 type before converting the underlying constant.
4851 2007-01-16 Marek Safar <marek.safar@gmail.com>
4853 * const.cs (ResolveValue): Updated after constant conversion was made more
4856 * constant.cs (GetAttributableValue): constant to object conversion is
4857 used for attributes only.
4858 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
4859 constant conversions.
4860 (LongConstant.ConvertImplicitly): Ditto.
4862 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
4863 (ImplicitConversionStandard): Handle constant conversion as extra step.
4864 It solves the issue when constant conversion was called indirectly like
4865 inside array initializer and constant folding was skipped.
4867 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
4870 * statement.cs(ImplicitConversionStandard): Updated after constant
4871 conversion was made more generic.
4873 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
4875 * expression.cs (As.DoResolve): Use GenericConstraints instead of
4876 Constraints, solves the problem where the compiler incorrectly
4877 reported that a type parameter was not constrained to a class (Bug
4880 2007-01-14 Marek Habersack <grendello@gmail.com>
4882 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
4884 2007-01-14 Marek Safar <marek.safar@gmail.com>
4886 A fix for bug #80368
4887 * assign.cs (FieldInitializer): New class implements field
4888 initializer statement.
4890 * attribute.cs: Update after FieldMember rename.
4892 * class.cs (PropertyBasedMember): New common class for property based
4894 (InterfaceMemberBase): New base class for all members which can be used as
4895 an interface members.
4896 (MethodCore): Moved really common code to InterfaceMemberBase.
4897 (Method.Define): Equal and GetHasCode detection is relevant for methods
4899 (MethodData.Define): Don't assume that public event implements an
4900 interface automatically.
4901 (MethodData.DefineMethodBuilder): Issue an error even if only extern
4903 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
4904 (FieldMember): Merged with FieldBase.
4905 (EventProperty.AEventPropertyAccessor): New specialization to check whether
4906 event extern modifier can be used.
4907 (EventField.EventFieldAccessor): Moved event field specific code here.
4908 (Event.AllowedModifiers): Even event can be extern.
4909 (Event.FindOutBaseMethod): New override specific to events.
4910 (Indexer.parameters): Reintroduce parameters because base class holds
4911 only properties common data.
4912 (Indexer.CheckForDuplications): Indexers are threated as methods so we
4913 need do extra parameters check.
4915 * const.cs: Update after FieldMember rename.
4917 * decl.cs (MemberCache.FindBaseEvent): New method.
4919 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
4920 to reflect that indexer is now derived from PropertyBased.
4922 * ecore.cs (GetMemberType): Made public.
4923 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
4926 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
4928 * typemanager.cs (CSharpSignature): Correctly print event accessors.
4929 (RegisterEvent): Removed.
4930 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
4931 (GetPrivateFieldOfEvent): Renamed to GetEventField.
4933 2007-01-11 Raja R Harinath <rharinath@novell.com>
4936 * statement.cs (CollectionForeach.TryType): Prefer generic
4937 GetEnumerator over non-generic variant. Fix code to follow comments.
4939 2007-01-09 Raja R Harinath <rharinath@novell.com>
4942 * support.cs (ReflectionParameter): Don't use an invalid index on
4943 the generic parameter data.
4945 2007-01-08 Miguel de Icaza <miguel@novell.com>
4947 * driver.cs: Just add a tiny bit of infrastructure.
4949 2007-01-02 Marek Safar <marek.safar@gmail.com>
4951 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
4952 where field type is struct from current assembly.
4954 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
4957 2007-01-02 Marek Safar <marek.safar@gmail.com>
4959 A fix for bug #80381
4960 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
4963 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
4965 (Namespace.LookupType): Always use core types from corlib when speficied.
4967 * report.cs: A new warning.
4969 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
4970 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
4971 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
4973 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
4974 (InitCoreTypes): Set expression type of object_type and value_type
4975 immediately after lookup.
4977 2007-01-01 Miguel de Icaza <miguel@novell.com>
4979 * cs-tokenizer.cs: Accept Pc class characters (Connector
4980 Punctuation) as valid identifiers. Fixes #78259
4982 * expression.cs (Invocation.DoResolve): Moved the check for the
4983 use of `this' for doing method calls to the Invocation resolution
4984 step, after overload resolution has taken place instead of doing
4985 the check at the low-level `This.DoResolve' level.
4987 The `This.DoResolve'(appens before overload resolution, so it has
4988 no way of knowing if the method that will be called will be
4989 instace or static, triggering an erroneous report for cs0188 (Bug
4992 We now do the check for instance method invocations after we know
4993 what method will be called.
4995 (This.CheckThisUsage): Move the actual use of this structure
4996 checking into its own method and expose it.
4998 * Everywhere that called Error_ValueCannotBeConverted: pass a new
5001 Exceptions: Null.ConvertImplicitly,
5002 Constant.ImplicitConversionRequired as there are too many call
5003 sites for passing the ec.
5005 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
5006 EmitContext, if the value is null, then we do not try to provide
5007 the extra information from the error (If a userdefined conversion
5008 exists, as UserDefinedConversion requires a non null-EmitContext).
5012 2006-12-30 Raja R Harinath <rharinath@novell.com>
5014 * flowanalysis.cs (MyBitVector): Document some invariants.
5015 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
5016 introduced below, and add a couple of others,
5018 2006-12-30 Marek Safar <marek.safar@gmail.com>
5020 * attribute.cs (GetMethodObsoleteAttribute): Uses new
5021 GetPropertyFromAccessor and GetEventFromAccessor.
5023 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
5024 overrides non-obsolete one.
5025 (Indexer.Define): Error message has been moved to the parser.
5027 * cs-parser.jay: Better syntax errors handling.
5029 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
5030 when an invocation has no arguments.
5032 * ecore.cs: Removed not used caching.
5034 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
5037 * report.cs: Add a new warning.
5039 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
5041 * typemanager.cs (enumeration_type): Removed.
5042 (CSharpSignature): Reuses IsSpecialMethod.
5043 (IsEqual): Hack for MS BCL.
5044 (GetPropertyFromAccessor): New method.
5045 (GetEventFromAccessor): New method.
5046 (IsSpecialMethod): Fixed to handle more cases.
5048 2006-12-30 Marek Safar <marek.safar@gmail.com>
5050 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
5051 Made white spaces array static.
5053 * ecore.cs (RemoveGenericArity): Optimized.
5055 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
5057 (MyBitVector.initialize_vector): Simplified.
5059 2006-12-22 Miguel de Icaza <miguel@novell.com>
5061 * ecore.cs: Am not entirely happy with this hack, but it seems to
5062 address the issue in 80257 (a small test case for
5065 I set the MethodGroupExpr.Type to an internal compiler type
5066 (itself in this case) to force the resolution to take place. Why
5067 it does not take place with a null is beyond me.
5069 2006-12-20 Marek Safar <marek.safar@gmail.com>
5071 A fix for bug #80288
5072 * expression.cs (ResolveOperator): Consider user defined conversion for
5073 logical and operator too.
5074 (EmitBranchable): Optimization for logical and when full constant folding
5075 could not be applied but one operand is constant.
5077 2006-12-19 Marek Safar <marek.safar@gmail.com>
5079 * class.cs (GetClassBases): Write 5 times every day, will never use
5080 FullName for error reporting.
5082 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
5084 2006-12-19 Martin Baulig <martin@ximian.com>
5086 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
5087 the symbol file info here.
5089 2006-12-18 Marek Safar <marek.safar@gmail.com>
5091 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
5092 of `elseif' is taking then following sections are not taking.
5093 Fixes an issue reported on mono mailing list.
5095 2006-12-18 Marek Safar <marek.safar@gmail.com>
5097 A fix for bug #80300
5098 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
5099 a caller is not taking.
5101 2006-12-18 Raja R Harinath <rharinath@novell.com>
5103 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
5104 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
5105 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
5106 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
5107 * class.cs: Update to changes.
5109 2006-12-17 Marek Safar <marek.safar@gmail.com>
5111 A fix for bug #79934
5112 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
5115 * class.cs (ResolveMembers): Register an iterator in current container and
5118 2006-12-16 Raja R Harinath <rharinath@novell.com>
5121 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
5122 satisfy a params annotated parameter.
5124 2006-12-16 Marek Safar <marek.safar@gmail.com>
5126 A fix for bug #77014
5127 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
5128 paramters correctly and not rely on hacks in Parameters class.
5129 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
5131 (Invocation.VerifyArgumentsCompat): Ditto.
5132 (Invocation.EmitArguments): Changed to correctly emit params arguments at
5135 * parameter.cs (HasParams): Don't assume that params is the last one.
5137 * support.cs (ReflectionParameters.ctor): Look for params attribute
5139 (ReflectionParameters.ParameterType): Removed hack when we returned last
5140 parameter for out of range parameters.
5141 (ParameterName, ParameterModifier): Ditto.
5143 2006-12-14 Marek Safar <marek.safar@gmail.com>
5145 A fix for bug #79987
5146 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
5147 when assembly is not CLS compliant but type is. I have no idea why is this
5150 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
5152 2006-12-13 Miguel de Icaza <miguel@novell.com>
5154 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
5155 in struct constructors, they are basically no-ops.
5157 2006-12-12 Marek Safar <marek.safar@gmail.com>
5159 * cs-tokenizer.cs (Position): Save preprocessor status too.
5161 2006-12-12 Marek Safar <marek.safar@gmail.com>
5163 A fix for bug #77794
5164 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
5166 2006-12-12 Marek Safar <marek.safar@gmail.com>
5168 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
5170 (pp_expr): Report error for an invalid expression.
5171 (handle_preprocessing_directive): Simplified; add more error checking.
5173 2006-12-11 Marek Safar <marek.safar@gmail.com>
5175 A fix for bug #74939
5176 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
5177 directives handling.
5179 2006-12-10 Marek Safar <marek.safar@gmail.com>
5181 A fix for bugs #80093, and #75984
5182 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
5183 logic, it seems to me as it worked before "by coincidence".
5184 (xtoken): Simplified to use reworked handle_preprocessing_directive.
5185 (cleanup): Enabled endif check.
5187 2006-12-09 Marek Safar <marek.safar@gmail.com>
5189 A fix for bug #80162
5190 * statement.cs (CollectionForeach.TryType): Generics and non-generics
5191 enumerators are never ambiguous.
5193 2006-12-08 Raja R Harinath <rharinath@novell.com>
5196 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
5198 2006-12-06 Marek Safar <marek.safar@gmail.com>
5200 A fix for bug #80144
5201 * class.cs (EventProperty.Define): Explicit implementation means
5202 that an even is used.
5204 2006-12-06 Marek Safar <marek.safar@gmail.com>
5206 Fixes the operators implementation (part II)
5208 * cfold.cs (DoConstantNumericPromotions): Renamed to
5209 DoBinaryNumericPromotions and simplified.
5210 (BinaryFold): Couple of conversion fixes; simplified.
5212 * constant.cs, ecore.cs, literal.cs
5213 (ToType): Renamed to ConvertImplicitly.
5214 (Reduce): Renamed to ConvertExplicitly.
5216 * class.cs, convert.cs: Updated.
5218 * expression.cs: TryReduce doesn't throw an exception.
5220 2006-12-01 Marek Safar <marek.safar@gmail.com>
5222 A fix for bug #80108
5223 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
5226 2006-11-30 Marek Safar <marek.safar@gmail.com>
5228 Fixes unary operators implementation (part I)
5231 * cfold.cs (Error_CompileTimeOverflow): Made internal
5233 * const.cs (IConstant): Changed to use reference to constant and
5234 not constant itself.
5235 Updated IConstant implementations.
5237 * constant.cs (CreateConstant): New factory method.
5238 Updated IConstant implementation.
5240 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
5242 * ecore.cs: Updated to use CreateConstantReference.
5244 * enum.cs: Reflects IConstant changes.
5246 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
5248 * literal.cs (NullConstant): Change to be independently usable.
5250 2006-11-29 Martin Baulig <martin@ximian.com>
5252 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
5253 we need to emit the scope initializer before calling the base .ctor.
5255 * anonymous.cs: Merged back from the new anonymous methods branch.
5256 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
5258 * expression.cs (ParameterReference.DoResolveBase): Create a
5259 "normal" ScopeInfo when capturing parameters rather than using the
5260 root scope; this makes things work with anonymous methods having
5264 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
5266 2006-11-22 Marek Safar <marek.safar@gmail.com>
5268 A fix for bug #79987
5269 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
5270 check to a base class.
5271 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
5272 only when assembly has missing attribute.
5273 * report.cs: Update.
5275 2006-11-21 Marek Safar <marek.safar@gmail.com>
5277 * cs-tokenizer.cs: Merged with gmcs version.
5279 2006-11-20 Marek Safar <marek.safar@gmail.com>
5282 * cs-parser.jay: Better error message when partial keyword is misplaced.
5284 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
5286 A fix for bug #79810
5287 report.cs: CS1058 only applies to 2.0 profile (gmcs).
5288 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
5289 a RuntimeWrappedException by default.
5291 2006-11-18 Marek Safar <marek.safar@gmail.com>
5293 A fix for bug #79843
5294 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
5296 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
5298 2006-11-18 Marek Safar <marek.safar@gmail.com>
5300 * driver.cs, namespace.cs: Uses faster IndexOf version.
5302 2006-11-17 Marek Safar <marek.safar@gmail.com>
5304 A fix for bug #79941
5305 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
5307 (Operator.Define): Implicit/Explicit operator of same type is duplicate
5308 even if internal name is different.
5309 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
5310 (UserDefinedConversion): Simplified as the operators cannot be internal.
5311 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
5313 (MethodLookup): Replaced EmitContext with parentType.
5314 * expression.cs: Updated.
5316 2006-11-09 Raja R Harinath <rharinath@novell.com>
5318 * driver.cs (BadAssembly): Handle all the ugliness of
5319 DefineDynamicAssembly.
5321 2006-11-08 Raja R Harinath <rharinath@novell.com>
5323 Address parts of #58244 -- most of what's left is in the runtime
5324 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
5325 CS1509 error checks, and handle them for all assembly loads, not
5326 just the first invocation.
5327 (LoadModule): Likewise. Move handling of 'adder_method' ...
5328 * codegen.cs (AssemblyClass.AddModule): ... here.
5330 2006-11-02 Marek Safar <marek.safar@gmail.com>
5332 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
5333 IEnumerable<T> is ambiguous.
5335 2006-10-31 Marek Safar <marek.safar@gmail.com>
5337 A fix for bug #67689
5338 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
5339 GetEnumerator is ambiguous.
5341 * report.cs: Add new warning.
5343 2006-10-29 Marek Safar <marek.safar@gmail.com>
5345 A fix for bug #78602
5346 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
5347 to protected member can be nested type.
5349 2006-10-28 Marek Safar <marek.safar@gmail.com>
5351 A fix for bug #78965
5352 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
5353 to protected member must derive from current type.
5355 2006-10-27 Marek Safar <marek.safar@gmail.com>
5357 assign.cs: Reuses error method.
5359 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
5360 instead of type for constants.
5361 (Expression.Error_ValueAssignment): Common error method.
5363 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
5366 2006-10-27 Marek Safar <marek.safar@gmail.com>
5368 A fix for bug #79081
5369 * expression.cs (MemberAccess.DoResolve): Check nested type
5372 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
5374 * doc.cs : nested delegates were not handled. Fixed bug #79754.
5376 2006-10-26 Marek Safar <marek.safar@gmail.com>
5378 A fix for bug #76591
5379 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
5381 2006-10-26 Marek Safar <marek.safar@gmail.com>
5383 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
5384 type forwarder of the same type multiple times.
5386 2006-10-26 Raja R Harinath <rharinath@novell.com>
5389 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
5390 instance as an rvalue, even when we later resolve as an lvalue.
5392 2006-10-25 Martin Baulig <martin@ximian.com>
5394 * anonymous.cs: Fix #79673.
5396 2006-10-24 Marek Safar <marek.safar@seznam.cz>
5398 A fix for bug #79666
5399 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
5400 ignored when is optimized (= default value) as its value is already set.
5402 2006-10-23 Marek Safar <marek.safar@seznam.cz>
5404 A fix for bug #79724
5405 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
5406 TypeContainer for type lookup.
5408 2006-10-23 Marek Safar <marek.safar@seznam.cz>
5410 A fix for bug #79231
5411 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
5412 * expression.cs (OverloadResolve): Always convert type name for
5414 (ResolveNamespaceOrType): Don't confuse a nested type with any
5417 2006-10-18 Martin Baulig <martin@ximian.com>
5419 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
5421 2006-10-17 Miguel de Icaza <miguel@novell.com>
5423 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
5424 an int32, but requesting an int64 from the conversion
5426 2006-10-12 Martin Baulig <martin@ximian.com>
5429 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
5431 2006-10-12 Martin Baulig <martin@ximian.com>
5434 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
5436 2006-10-11 Miguel de Icaza <miguel@novell.com>
5438 * convert.cs: Remove broken code: I was doing the "Existance"
5439 tests for Implicit conversions.
5441 2006-10-10 Miguel de Icaza <miguel@novell.com>
5443 * convert.cs: Added one missing case in
5444 ImplicitStandardConversionExists uint64 to intptr.
5448 * typemanager.cs (uintptr_type): another core known type.
5450 * ecore.cs (OperatorCast): routine used to do cast operations that
5451 depend on op_Explicit. We could change some of the Decimal
5452 conversions to use this.
5454 This one has a probe mechanism that checks both types for an op_
5455 which it coudl be used to eliminate two classes: CastToDecimal
5456 and CastFromDecimal.
5458 * convert.cs: Implement the conversions documented in #59800
5460 2006-10-10 Martin Baulig <martin@ximian.com>
5462 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
5463 before RootScope.ResolveMembers().
5465 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
5466 `CurrentType' if appropriate.
5468 2006-10-09 Marek Safar <marek.safar@seznam.cz>
5470 A fix for bug #78568
5471 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
5472 when contains binary operators.
5473 * cs-parser.jay: Updated.
5475 2006-10-09 Martin Baulig <martin@ximian.com>
5478 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
5479 moved that into Define() and also do the other type parameter
5480 checks there. Fixes #79094. Added gtest-292.cs.
5483 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
5484 since that doesn't include type parameters; don't use `Ldelema'
5485 for type parameters. Fixes #78980. Added gtest-293.cs.
5487 2006-10-08 Marek Safar <marek.safar@seznam.cz>
5490 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
5491 conversion is allowed.
5493 2006-10-06 Marek Safar <marek.safar@seznam.cz>
5495 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
5496 error reporting when no error occurs.
5498 2006-10-06 Marek Safar <marek.safar@seznam.cz>
5500 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
5503 2006-10-06 Raja R Harinath <rharinath@novell.com>
5506 * class.cs (DefineTypeBuilder): Check circular dependencies before
5507 setting the parent of the TypeBuilder.
5508 (CheckRecursiveDefinition): Don't use 'BaseType', since
5509 it may not be valid until after DefineTypeBuilder. Use
5510 'base_type' instead.
5512 2006-10-04 Martin Baulig <martin@ximian.com>
5514 Merged the Anonymous Methods patch.
5516 * anonymous.cs, iterators.cs: The new anonymous methods code.
5518 * statement.cs (Variable): New public abstract class.
5519 (LocalInfo.Variable): New public property.
5520 (LocalInfo.ResolveVariable): New public method.
5521 (Block.Flags): Add `IsIterator'.
5522 (Block.AddVariable): Improved the CS0136 check.
5523 (Block.AnonymousChildren): New public property.
5524 (Block.AddAnonymousChild): New public method.
5525 (ToplevelBlock): Update to use the new anonymous method framework.
5526 (ToplevelBlock.ctor): `container' is now a `Block' and not a
5527 `ToplevelBlock'; this is required to correctly implement the
5529 (Fixed, Using): Use `TemporaryVariable' instead of directly
5530 creating the `LocalBuilder'.
5532 * parameter.cs (Parameter.ResolveVariable): New public method.
5533 (Parameters.ResolveVariable): Likewise.
5535 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
5537 * class.cs (TypeContainer): Replaced the `iterators' list and
5538 corresponding methods with a list of `CompilerGeneratedClass'es.
5539 (TypeContainer.ResolveMembers): New public method.
5540 (Method): `IIteratorContainer' has been replaced by
5543 * expression.cs (VariableReference): New public abstract base
5544 class for `LocalVariableReference', `ParameterReference' and
5547 * codegen.cs (EmitContext): Removed `capture_context',
5548 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
5549 (EmitContext.EmitThis): Removed.
5551 * cs-parser.jay: Replace `iterator_container' with
5554 2006-10-04 Martin Baulig <martin@ximian.com>
5556 * generic.cs (GenericMethod): Don't make this abstract.
5557 (Constraints.Clone): Added dummy implementation.
5559 2006-10-04 Raja R Harinath <harinath@gmail.com>
5562 * namespace.cs (LookForAnyGenericType): Avoid nullref on
5563 'declspaces'. Avoid allocating arrays willy-nilly.
5566 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
5567 cases out of the switch.
5569 2006-09-28 Marek Safar <marek.safar@seznam.cz>
5571 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
5572 message when non-generic type is used with the type arguments.
5573 * expression.cs: Updated.
5575 2006-09-28 Raja R Harinath <rharinath@novell.com>
5578 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
5579 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
5580 Change semantics slightly. Don't insist on having only one
5581 temporary EmptyExpression -- just throttle the creation of new ones.
5584 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
5585 non-interfaces too. If no methods are found, don't try to create
5588 2006-09-28 Marek Safar <marek.safar@seznam.cz>
5590 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
5593 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
5594 us produce better error message.
5596 2006-09-27 Marek Safar <marek.safar@seznam.cz>
5598 * expression.cs (Binary.ResolveOperator): Warn about a side effect
5599 of the `|' operator.
5601 * report.cs: A new warning added.
5603 2006-09-27 Martin Baulig <martin@ximian.com>
5605 * generic.cs (GenericMethod): Don't make this abstract.
5607 2006-09-27 Martin Baulig <martin@ximian.com>
5610 (InternalErrorException): Added overloaded ctor taking a params array.
5612 2006-09-26 Marek Safar <marek.safar@seznam.cz>
5614 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
5615 Fixed the cases when same error was reported twice.
5617 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
5618 now report symbol information.
5620 2006-09-25 Martin Baulig <martin@ximian.com>
5622 * class.cs: Completely unified with the gmcs version.
5624 2006-09-25 Martin Baulig <martin@ximian.com>
5626 * typemanager.cs (TypeManager.IsNullableType): New public function.
5627 (TypeManager.IsNullableTypeOf): Likewise.
5628 (TypeManager.IsNullableValueType): Likewise.
5630 * class.cs (MethodCore): Added the `GenericMethod' argument from
5631 gmcs and also unified all classes derived from `MethodCore' with gmcs.
5633 2006-09-24 Raja R Harinath <harinath@gmail.com>
5635 * convert.cs: Unify with gmcs version.
5637 2006-09-24 Marek Safar <marek.safar@seznam.cz>
5639 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
5640 verify them as well.
5642 * report.cs: New warning.
5644 2006-09-24 Marek Safar <marek.safar@seznam.cz>
5646 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
5647 for anonymous block with out argument.
5649 2006-09-24 Marek Safar <marek.safar@seznam.cz>
5651 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
5652 not used private events only.
5654 2006-09-23 Marek Safar <marek.safar@seznam.cz>
5656 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
5658 * const.cs (Const.Define): Check for constant type.
5659 (Const.IsConstantTypeValid): Looks for valid constant types.
5661 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
5663 * ecore.cs (EmptyConstantCast): New common class for all constant based
5666 * expression.cs (Is.DoResolve): Handle null constant especially.
5667 (New.DoResolve): Check for new void().
5668 (MemberAccess.DoResolve): Cope with all kind of nulls.
5670 * literal.cs (NullConstant): Uses EmptyConstantCast.
5671 (NullDefault): Based on EmptyConstantCast.
5672 (NullLiteral): Uses EmptyConstantCast.
5674 * statement.cs (Block.ResolveMeta): Check for constant type.
5676 2006-09-22 Martin Baulig <martin@ximian.com>
5678 * delegate.cs, attribute.cs: Merged with the gmcs versions.
5680 2006-09-22 Raja R Harinath <rharinath@novell.com>
5682 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
5686 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
5687 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
5690 2006-09-22 Martin Baulig <martin@ximian.com>
5692 * ecore.cs: Merged with the gmcs version.
5694 * generic.cs (ConstructedType): New dummy class.
5695 (TypeArguments): Don't make this abstract.
5698 (TypeManager.IsGenericTypeDefinition): New method.
5699 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
5701 2006-09-22 Raja R Harinath <rharinath@novell.com>
5703 * expression.cs (ComposedCast): Check for arrays of TypedReference
5704 before creating the type, not after.
5706 2006-09-21 Marek Safar <marek.safar@seznam.cz>
5708 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
5709 after ToType change.
5711 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
5712 when constant must be implicitly convertible.
5714 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
5716 * ecore.cs (NullCast): Derives from NullConstant.
5718 * expression.cs (Is.DoResolve): Removed useless variables.
5719 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
5720 (New.Constantify): Add enum support.
5721 (MemberAccess.DoResolve): Add warning when accessing null constant or
5724 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
5727 * literal.cs (NullConstant): New abstract class with common
5728 functionality for all null specializations.
5729 (NullDefault): Represents default(X) when result can be
5731 (NullLiteral): Updated.
5733 * report.cs: Add new warning.
5735 2006-09-21 Martin Baulig <martin@ximian.com>
5737 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
5739 2006-09-21 Martin Baulig <martin@ximian.com>
5741 * generic.cs (GenericConstraints): New dummy class.
5742 (Constraints): Likewise.
5743 (TypeParameter): Likewise.
5744 (TypeParameterName): Likewise.
5745 (GenericMethod): Likewise.
5747 * typemanager.cs (TypeManager.GetGenericArguments): New method.
5749 * decl.cs: Merged with the gmcs version.
5751 2006-09-21 Raja R Harinath <rharinath@novell.com>
5753 * generic.cs (TypeParameter): Implement IMemberContainer.
5754 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
5756 * rootcontext.cs: Unify with gmcs version.
5758 * report.cs: Unify with gmcs version.
5759 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
5760 from gmcs/generics.cs.
5761 * generics.cs (TypeParameter): New dummy class.
5763 * support.cs: Unify with gmcs version.
5765 2006-09-20 Raja R Harinath <rharinath@novell.com>
5767 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
5768 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
5770 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
5771 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
5772 * mcs.exe.sources: Add generic.cs.
5774 * codegen.cs: Unify with gmcs version.
5776 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
5777 (EmitContext): Add GenericDeclContainer implementation.
5778 * decl.cs (MemberCore, DeclSpace): Likewise.
5779 * namespace.cs: Remove #ifdef GMCS_SOURCE.
5781 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
5782 MCS TypeManager has a corresponding dummy method.
5784 2006-09-19 Martin Baulig <martin@ximian.com>
5786 * expression.cs: Completely merged with the gmcs version.
5788 2006-09-19 Martin Baulig <martin@ximian.com>
5790 * expression.cs (Invocation): Merged with the gmcs version.
5791 (ArrayAccess.GetStoreOpcode): Likewise.
5793 2006-09-19 Martin Baulig <martin@ximian.com>
5796 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
5797 (TypeManager.IsGenericMethodDefinition): Likewise.
5799 2006-09-19 Martin Baulig <martin@ximian.com>
5802 (TypeManager.IsEqual): Moved the gmcs implementation here.
5803 (TypeManager.DropGenericTypeArguments): Likewise.
5804 (TypeManager.DropGenericMethodArguments): Likewise.
5805 (TypeManager.GetTypeArguments): Moved here from gmcs.
5806 (TypeManager.HasGenericArguments): Likewise.
5808 2006-09-19 Martin Baulig <martin@ximian.com>
5810 * expression.cs (Binary): Merged with the gmcs version.
5812 2006-09-19 Martin Baulig <martin@ximian.com>
5814 * expression.cs (Probe, As, Is): Merged with the gmcs version.
5816 2006-09-19 Martin Baulig <martin@ximian.com>
5818 * typemanager.cs: Merged with the gmcs version.
5820 2006-09-16 Raja R Harinath <rharinath@novell.com>
5822 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
5823 * driver.cs: Likewise.
5825 2006-09-16 Marek Safar <marek.safar@seznam.cz>
5828 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
5829 only if parent type is class.
5830 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
5833 2006-09-15 Marek Safar <marek.safar@seznam.cz>
5836 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
5838 * typemanager.cs(CSharpName): Converts NullType to null.
5840 2006-09-15 Martin Baulig <martin@ximian.com>
5843 (TypeManager.GetMethodName): Added mcs implementation.
5844 (TypeManager.IsEqual): Likewise.
5847 (SimpleName.RemoveGenericArity): Added dummy implementation.
5849 * pending.cs: Merged with the gmcs version.
5851 2006-09-15 Martin Baulig <martin@ximian.com>
5853 * statement.cs: Merge with the gmcs version.
5855 2006-09-15 Martin Baulig <martin@ximian.com>
5857 * statement.cs (Switch): Merge with the gmcs implementation
5858 (without nullables), which is newer.
5860 2006-09-15 Martin Baulig <martin@ximian.com>
5862 * statement.cs (Block.Variables): Make this public.
5863 (ToplevelBlock.Parameters): Make this a property.
5864 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
5866 2006-09-15 Martin Baulig <martin@ximian.com>
5868 * namespace.cs: Merge with the gmcs version.
5870 2006-09-15 Martin Baulig <martin@ximian.com>
5872 * decl.cs (MemberName): Minor code cleanups.
5874 2006-09-15 Martin Baulig <martin@ximian.com>
5876 * parameter.cs: Merge with the gmcs version.
5878 2006-09-15 Martin Baulig <martin@ximian.com>
5880 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
5881 and an error in mcs.
5883 2006-09-15 Martin Baulig <martin@ximian.com>
5885 * flowanalysis.cs: Merged from GMCS; added the generics code into
5886 a `GMCS_SOURCE' conditional so we can share this file.
5888 2006-09-08 Martin Baulig <martin@ximian.com>
5890 * typemanager.cs (TypeManager.interlocked_type): New public field.
5891 (TypeManager.int_interlocked_compare-exchange): New public field.
5892 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
5893 enumerator types here and call InitGenericCoreTypes().
5894 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
5895 after calling InitEnumUnderlyingTypes().
5898 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
5899 `classes_second_stage'.
5901 2006-09-14 Marek Safar <marek.safar@seznam.cz>
5903 * assign.cs, ecore.cs, expression.cs: Share error message text.
5904 * class.cs (FieldMember.Define): Check for varible of static type.
5905 * driver.cs (LoadAssembly): Uses error output for errors.
5906 * statement.cs: Updated.
5908 2006-09-08 Marek Safar <marek.safar@seznam.cz>
5910 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
5913 2006-09-07 Martin Baulig <martin@ximian.com>
5916 (MainDriver): Revert r62663 from Marek; see #70506 for details.
5918 2006-08-29 Miguel de Icaza <miguel@novell.com>
5920 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
5922 2006-08-17 Miguel de Icaza <miguel@novell.com>
5924 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
5925 #52019 and #79064, the use of the \uXXXX sequence in source code
5926 to represent unicode characters.
5928 2006-08-15 Marek Safar <marek.safar@seznam.cz>
5930 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
5932 * class.cs, ecore.cs, statement.cs: Merged to one error message.
5934 2006-08-13 Miguel de Icaza <miguel@novell.com>
5936 * assign.cs: Catch attempts to assign to a method groups in += and
5939 2006-08-13 Marek Safar <marek.safar@seznam.cz>
5942 * cs-parser.jay: Don't destroy current array type by typeof of array's.
5944 2006-08-12 Marek Safar <marek.safar@seznam.cz>
5946 * class.cs (Method.Define): Issue a warning when generic method looks like
5948 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
5951 2006-08-09 Marek Safar <marek.safar@seznam.cz>
5953 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
5955 * decl.cs (MemberCache.FindMembers): When container is interface we need to
5956 search all base interfaces as a member can be ambiguous.
5957 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
5958 Constructor member type filter.
5959 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
5960 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
5961 reporting for returned memberinfos.
5962 * report.cs: Updated.
5963 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
5964 version to work on all runtimes.
5965 (TypeManager.RealMemberLookup): Removed members filtering.
5967 2006-08-08 Raja R Harinath <rharinath@novell.com>
5969 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
5970 (PropertyExpr.EmitAssign): Likewise.
5971 * expression.cs (Indirection.EmitAssign): Likewise.
5972 (LocalVariableReference.EmitAssign): Likewise.
5973 (ParameterReference.EmitAssign): Likewise.
5974 (Invocation.EmitArguments): Likewise.
5975 (ArrayAccess.EmitAssign): Likewise.
5976 (IndexerAccess.EmitAssign): Likewise.
5977 (This.EmitAssign): Likewise.
5978 (ConditionalLogicalOperator.Emit): Likewise.
5981 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
5982 instead of ArrayList. If the hashtable has a LocalBuilder, don't
5983 leave it in after returning it.
5984 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
5986 2006-08-06 Marek Safar <marek.safar@seznam.cz>
5988 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
5991 2006-08-03 Raja R Harinath <rharinath@novell.com>
5993 Fix cs0146-3.cs and cs0146-4.cs.
5994 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
5995 enclosing types don't depend on the current type.
5997 2006-08-02 Raja R Harinath <rharinath@novell.com>
6000 * class.cs (TypeContainer.DoDefineMembers): Use
6001 FindBaseMemberWithSameName on Parent, since we're interested in
6002 whether we hide inherited members or not.
6003 (FindBaseMemberWithSameName): Make slightly more robust.
6005 Fix the non-generic testcase from #77396
6006 * decl.cs (DeclSpace.DeclContainer): Remove override.
6008 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
6009 declspaces for doppelgangers too.
6010 (UsingEntry): Implement IResolveContext.
6011 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
6012 'this' as the resolve context.
6013 (LocalAliasEntry): Likewise.
6015 Implement parts of #77403
6016 * roottypes.cs (RootDeclSpace): New. Used to represent the
6017 toplevel declaration space. Each namespace declaration introduces
6018 a "partial" root declaretion space.
6019 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
6020 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
6021 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
6022 from 'current_namespace.SlaveDeclSpace'.
6023 (namespace_declaration): Likewise.
6024 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
6025 check. It can't happen now.
6026 * decl.cs (DeclSpace.LookupType): Likewise.
6027 * driver.cs (MainDriver): Sanity check.
6029 2006-08-01 Raja R Harinath <rharinath@novell.com>
6031 * decl.cs (DeclSpace.FindNestedType): Remove.
6032 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
6033 LookupTypeContainer to get the container of the nested type.
6034 * class.cs (TypeContainer.FindNestedType): Make non-override.
6036 2006-07-31 Raja R Harinath <rharinath@novell.com>
6038 * decl.cs (DeclSpace.PartialContainer): Move field from ...
6039 * class.cs (TypeContainer.PartialContainer): ... here.
6040 (TypeContainer.AddBasesForPart): New helper.
6041 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
6043 * cs-parser.jay (current_class): Convert to DeclSpace.
6044 (struct_declaration, interface_declaration, class_declaration):
6045 Use AddBasesForPart instead of .Bases directly.
6046 * const.cs, iterators.cs: Update to changes.
6048 2006-07-28 Raja R Harinath <rharinath@novell.com>
6050 * class.cs (TypeContainer.AddMemberType): Rename from
6052 (TypeContainer.AddMember): Rename from AddToMemberContainer.
6053 (AddTypeContainer): New. Combine AddClassOrStruct and
6055 (AddPartial): Update. Add 'is_partial' argument.
6056 * roottypes.cs: Update to changes.
6057 * cs-parser.jay (push_current_class): New helper for handling
6058 current_container and current_class.
6059 (struct_declaration, interface_declaration, class_declaration):
6062 2006-07-26 Raja R Harinath <rharinath@novell.com>
6064 * roottypes.cs: Rename from tree.cs.
6066 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
6067 * tree.cs (Tree, ITreeDump): Remove types.
6068 * rootcontext.cs (tree, Tree): Remove fields.
6069 (root, ToplevelTypes): New.
6070 * *.cs: Update to rename.
6072 * tree.cs (Tree.RecordDecl): Remove.
6073 (RootTypes.AddToTypeContainer): Record the toplevel type in its
6075 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
6077 2006-07-23 Raja R Harinath <harinath@gmail.com>
6079 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
6080 DoFlowAnalysis and OmitStructFlowAnalysis here.
6081 (ec.With): Rename from WithUnsafe and generalize.
6082 (ec.WithCheckState): Remove. All users can be handled by 'With'.
6083 (ec.WithFlowAnalyis): New.
6084 * ecore.cs, expression.cs, statement.cs: Update.
6086 2006-07-22 Raja R Harinath <harinath@gmail.com>
6088 * statement.cs (Block.ResolveMeta): Simplify slightly.
6090 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
6091 multiple boolean fields. Convert InUnsafe, constant_check_state,
6092 check_state to flags.
6093 (CheckState, ConstantCheckState): Update.
6094 (InUnsafe): New read-only property.
6095 (FlagsHandle): Rename from CheckStateHandle and convert to handle
6097 (WithUnsafe): New helper similar to WithCheckState.
6098 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
6099 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
6101 2006-07-21 Raja R Harinath <rharinath@novell.com>
6103 Make comparisons use the same IL irrespective of whether they're
6104 in a 'checked' or 'unchecked' context: one of the issues in #78899
6105 * codegen.cs (EmitContext.CheckState): Make read-only property.
6106 (EmitContext.ConstantCheckState): Likewise.
6107 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
6108 helper that implement a save/restore stack for CheckState
6109 values. This is the only way to change check-state.
6110 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
6111 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
6112 (CheckedExpr.EmitBranchable): New forwarding method.
6113 (UnCheckedExpr): Likewise.
6114 * statement.cs (Block.ResolveMeta): Use WithCheckState.
6115 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
6116 (Checked.Resolve, checked.DoEmit): Likewise.
6118 2006-07-20 Miguel de Icaza <miguel@novell.com>
6120 * anonymous.cs: Cache the resolved anonymous delegate, and return
6121 this so that the ResolveTopBlock is only triggered once, not
6124 Currently we trigger ResolvetopBlock twice due to a first pass of
6125 argument check compatibility, and a second pass that does the
6128 2006-07-15 Marek Safar <marek.safar@seznam.cz>
6130 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
6132 * rootcontext.cs (Reset): Add helper_classes.
6134 2006-07-15 Marek Safar <marek.safar@seznam.cz>
6137 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
6140 2006-07-13 Miguel de Icaza <miguel@novell.com>
6142 * statement.cs (Lock): Handle expressions of type
6143 TypeManager.null_type specially. Fixes #78770
6145 2006-07-08 Marek Safar <marek.safar@seznam.cz>
6147 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
6150 2006-07-08 Marek Safar <marek.safar@seznam.cz>
6152 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
6153 for accessors as well.
6154 * ecore.cs (EventExpr): Add AccessorTable.
6156 2006-07-01 Marek Safar <marek.safar@seznam.cz>
6159 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
6160 for CS0122 where appropriate.
6161 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
6163 (Filter): Assembly can be null in the case of top level attributes.
6165 2006-06-25 Marek Safar <marek.safar@seznam.cz>
6169 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
6170 is done at global level.
6172 2006-06-24 Marek Safar <marek.safar@seznam.cz>
6174 A fix for #77002, Implemented TypeForwarder support.
6176 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
6177 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
6178 * typemanager.cs (): Add type_forwarder_attr_type.
6180 2006-06-24 Marek Safar <marek.safar@seznam.cz>
6182 * report.cs: Add CS0469 warning.
6184 2006-06-21 Martin Baulig <martin@ximian.com>
6186 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
6187 the `try'-block, so we also report CS0016 etc. there.
6189 2006-06-21 Martin Baulig <martin@ximian.com>
6192 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
6194 2006-06-21 Martin Baulig <martin@ximian.com>
6196 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
6197 also report CS1686 for parameters.
6199 2006-06-21 Martin Baulig <martin@ximian.com>
6201 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
6202 instead of an error if the value is not implicitly convertible to
6203 the switch types; fixes #77964.
6205 2006-06-21 Raja R Harinath <rharinath@novell.com>
6208 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
6209 FieldBuilder is null.
6212 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
6213 'left' and 'right' before error-checking.
6215 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
6217 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
6219 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
6220 (FieldExpr.DoResolve): likewise.
6221 (PropertyExpr.InstanceResolve): likewise.
6222 (EventExpr.InstanceResolve): likewise.
6224 2006-06-04 Marek Safar <marek.safar@seznam.cz>
6226 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
6227 attribute applicable tests for attribute argument.
6229 2006-06-02 Raja R Harinath <rharinath@novell.com>
6232 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
6233 (Binary.OverloadResolve_PredefinedIntegral): New.
6234 (Binary.OverloadResolve_PredefinedFloating): New.
6235 (Binary.OverloadResolve_PredefinedString): New.
6236 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
6237 Follow the standard more closely, and treat numeric promotions in
6238 terms of overload resolution.
6239 (Binary.CheckShiftArguments): Simplify.
6241 2006-06-01 Raja R Harinath <rharinath@novell.com>
6243 * flowanalysis.cs (MyBitVector): Simplify representation.
6244 (MyBitVector.Clone): Avoid allocating BitArray.
6245 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
6246 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
6247 (*): Update. Change all references to MyBitVector.And and
6248 MyBitVector.Or to &= and |=.
6250 2006-05-29 Raja R Harinath <rharinath@novell.com>
6253 * cs-parser.jay (formal_parameter_list): Extend the pattern below
6254 to param arguments too.
6256 2006-05-26 Miguel de Icaza <miguel@novell.com>
6258 * cs-parser.jay: Catch another parsing form for arglist being
6259 followed by other arguments. Fixes #78313.
6261 2006-05-24 Raja R Harinath <rharinath@novell.com>
6263 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
6264 checking of out parameters to ...
6265 (FlowBranchingToplevel.Merge): ... here.
6266 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
6267 set, propagate the origin upward, and only complain if there was
6269 (FlowBranchingException.AddContinueOrigin): Likewise.
6270 (FlowBranchingException.AddReturnOrigin): Likewise.
6271 (FlowBranchingException.AddGotoOrigin): Likewise.
6273 2006-05-23 Raja R Harinath <rharinath@novell.com>
6275 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
6276 unreachable, skip it.
6277 (FlowBranchingException.Merge): Always propagate jumps, even if
6278 the finally block renders subsequent code unreachable.
6280 2006-05-18 Raja R Harinath <rharinath@novell.com>
6283 * statement.cs (Goto.Resolve): Move responsibility for resolving
6284 'goto' to FlowBranching.AddGotoOrigin.
6285 (Goto.SetResolvedTarget): New. Callback to set the
6286 LabeledStatement that's the target of the goto.
6287 (Goto.DoEmit): Use Leave instead of Br when crossing an
6288 unwind-protect boundary.
6289 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
6290 LookupLabel and adjust to new semantics.
6291 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
6292 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
6293 Goto.SetResolvedTarget to update target.
6294 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
6295 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
6296 AddBreakOrigin & co. Delay propagation until ...
6297 (FlowBranchingException.Merge): ... this.
6299 * statement.cs (Block.Resolve): Always depend on flow-branching to
6300 determine unreachability. Kill workaround that originally emitted
6301 only one statement after an "unreachable" label (see infloop in
6304 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
6305 This is still "wrong", but anything better would probably need a
6306 multi-pass algorithm.
6307 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
6308 usage vector. Force current usage vector to be reachable, to
6309 optimistically signify backward jumps.
6310 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
6312 (FlowBranchingLabeled.Merge): New. If no backward jump was
6313 detected, return the original salted-away usage vector instead,
6314 updated with appropriate changes. Print unreachable warning if
6316 * statement.cs (Block.Resolve): Don't print unreachable warning on
6317 a labeled statement.
6319 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
6321 * driver.cs: Pass filename without path to AssemblyBuilder's
6322 AddResourceFile. Fixes bug #78407.
6324 2006-05-17 Raja R Harinath <rharinath@novell.com>
6326 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
6327 * flowanalysis.cs (FlowBranchingLabeled): ... here.
6328 (FlowBranching.MergeChild): Overwrite
6329 reachability information from Labeled branchings too.
6331 2006-05-16 Raja R Harinath <rharinath@novell.com>
6333 * statement.cs (Goto.Resolve): Merge jump origins here ...
6334 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
6336 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
6337 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
6338 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
6339 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
6341 * statement.cs (Goto.Resolve): ... not here.
6342 (Goto.Emit): Remove CS1632 check.
6344 2006-05-14 Marek Safar <marek.safar@seznam.cz>
6346 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
6349 2006-05-11 Raja R Harinath <rharinath@novell.com>
6351 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
6352 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
6353 (FlowBranchingException.Label): Likewise.
6355 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
6357 (MyBitVector.Or): Use it to avoid losing information (Count).
6358 (FlowBranching.MergeOrigins): Likewise.
6360 * flowanalysis.cs (UsageVector.IsDirty): Remove.
6361 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
6362 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
6363 (UsageVector.ToString): Simplify.
6364 (UsageVector.MergeSiblings): Move here from ...
6365 (FlowBranching.Merge): ... here.
6366 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
6369 2006-05-10 Raja R Harinath <rharinath@novell.com>
6371 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
6372 null bitvector is treated as all-true.
6374 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
6375 (MyBitVector): Rationalize invariants. 'vector != null' implies
6376 that we have our own copy of the bitvector. Otherwise,
6377 'InheritsFrom == null' implies all inherited bits are true.
6379 2006-05-09 Marek Safar <marek.safar@seznam.cz>
6381 * statement.cs (LocalInfo): Add IsConstant.
6382 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
6383 local variable for constants.
6385 2006-05-09 Raja R Harinath <rharinath@novell.com>
6387 * flowanalysis.cs (MyBitVector.Empty): New.
6388 (MyBitVector): Don't allow InheritedFrom to be null.
6389 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
6390 (UsageVector, FlowBranching): Update to changes.
6392 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
6393 recursion. The 'Parent == null' condition isn't sufficient for
6395 (FlowBranching.AddBreakOrigin): Likewise.
6396 (FlowBranching.AddContinueOrigin): Likewise.
6397 (FlowBranching.AddReturnOrigin): Likewise.
6398 (FlowBranching.StealFinallyClauses): Likewise.
6399 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
6400 (FlowBranching.CheckOutParameters): Likewise.
6401 (FlowBranchingToplevel): Terminate all the above recursions here.
6402 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
6403 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
6405 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
6407 (FlowBranchingToplevel): New. Empty for now.
6408 (FlowBranching.MergeTopBlock): Update.
6409 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
6410 branching for the anonymous delegate.
6411 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
6413 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
6414 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
6415 information at the start of the merge. Reorganize.
6417 2006-05-07 Marek Safar <marek.safar@seznam.cz>
6419 * class.cs (MethodData.Define): Method cannot implement interface accessor.
6421 2006-05-07 Marek Safar <marek.safar@seznam.cz>
6423 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
6424 to newly introduced ctor.
6426 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
6427 message to one place.
6428 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
6431 2006-05-07 Marek Safar <marek.safar@seznam.cz>
6433 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
6435 * ecore.cs (Expression.ResolveAsConstant): Updated.
6437 * statement.cs (ResolveMeta): Updated.
6439 2006-05-06 Marek Safar <marek.safar@seznam.cz>
6441 * cs-parser.jay: __arglist cannot be used in initializer.
6443 2006-05-06 Marek Safar <marek.safar@seznam.cz>
6446 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
6449 2006-05-05 Raja R Harinath <rharinath@novell.com>
6451 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
6452 (LabeledStatement): Add 'name' parameter.
6453 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
6454 (Block.AddLabel): Update to changes.
6455 * cs-parser.jay (labeled_statement): Likewise.
6457 * flowanalysis.cs (BranchingType.Labeled): New.
6458 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
6459 (FlowBranchingLabeled): New. Does nothing for now, but will
6460 eventually handle 'goto' flows.
6461 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
6462 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
6463 that's terminated ...
6464 (Block.Resolve): ... here.
6466 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
6467 (UsageVector.MergeFinallyOrigins): Likewise.
6468 (FlowBranching.InTryOrCatch): Likewise.
6469 (FlowBranching.AddFinallyVector): Likewise.
6470 (FlowBranchingException): Update to changes.
6473 * statement.cs (Return.Resolve): Move error checking to ...
6474 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
6475 (FlowBranchingException): Handle return origins like break and
6477 (FlowBranching.UsageVector.CheckOutParameters): Remove.
6479 2006-05-04 Marek Safar <marek.safar@seznam.cz>
6482 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
6485 2006-05-04 Marek Safar <marek.safar@seznam.cz>
6488 * class.cs (MethodData.Define): Do public accessor check only when method
6489 implements an interface.
6491 2006-05-04 Raja R Harinath <rharinath@novell.com>
6493 Remove special handling of 'break'
6494 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
6495 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
6496 (UsageVector.Break): Remove.
6497 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
6499 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
6501 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
6502 UsageVector.Breaks (). Don't set NeedsReturnLabel.
6504 2006-05-03 Marek Safar <marek.safar@seznam.cz>
6507 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
6508 be the interface member.
6510 2006-05-03 Marek Safar <marek.safar@seznam.cz>
6513 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
6514 for emitting small (int) values.
6516 2006-05-03 Raja R Harinath <rharinath@novell.com>
6519 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
6520 control-flow passes through the 'finally' after merging-in all the
6521 control-flows from 'try' and the 'catch' clauses.
6523 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
6524 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
6525 always true at the only non-recursive entry point.
6526 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
6527 FlowBranchingBreakable.
6528 (FlowBranchingLoop): Remove.
6529 * statement.cs (Return.DoResolve): Update to changes.
6532 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
6533 (FlowBranching.CreateBranching): Handle it: create a
6534 FlowBranchingContinuable.
6535 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
6536 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
6537 except that it handles the 'continue' command.
6538 (FlowBranching.UsageVector.MergeOrigins): Rename from
6540 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
6541 except that it overrides AddContinueOrigin.
6542 (FlowBranchingException): Override AddContinueOrigin, similar to
6544 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
6545 Create a new branching around the embedded statement.
6546 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
6547 control flow after the embedded statement.
6548 (Continue.Resolve): Move all error checking to AddContinueOrigin.
6550 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
6551 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
6552 FlowBranchingBreakable.
6553 (FlowBranchingSwitch): Remove.
6556 * statement.cs (Break.Resolve): Simplify. Move responsibility for
6557 error reporting to ...
6558 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
6559 Rename from 'AddBreakVector'. Add new location argument. Return
6560 a bool indicating whether the 'break' crosses an unwind-protect.
6561 (FlowBranchingException.AddBreakOrigin): Add.
6562 (FlowBranchingException.Merge): Propagate 'break's to surrounding
6563 flowbranching after updating with the effects of the 'finally'
6565 (FlowBranchingBreakable): New common base class for
6566 FlowBranchingLoop and FlowBranchingSwitch.
6568 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
6570 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
6572 2006-05-02 Raja R Harinath <rharinath@novell.com>
6574 * statement.cs (Do.Resolve): If the loop is infinite, set the
6576 (While.Resolve, For.Resolve): Set a barrier after the embedded
6577 statement. There's no direct control flow that goes from the end
6578 of the embedded statement to the end of the loop.
6579 * flowanalysis.cs (FlowBranching.Infinite): Remove.
6580 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
6581 above ensure that the reachability is correctly computed.
6583 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
6584 (UsageVector.MergeBreakOrigins): If the current path is
6585 unreachable, treat it as if all parameters/locals are initialized.
6586 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
6587 infinite loops before merging-in break origins.
6589 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
6590 (Reachability.Reachable): Split part into ...
6591 (Reachability.Unreachable): ... this. Simplify.
6592 (Reachability.IsUnreachable): Use 'Unreachable' instead.
6594 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
6595 (Reachability.SetThrowsSometimes): Likewise.
6596 (FlowBranchingBlock.MergeTopBlock): Don't compare against
6597 TriState.Always, use corresponding property.
6598 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
6599 (Block.Resolve): Likewise. Remove some redundant checks.
6601 2006-05-02 Raja R Harinath <harinath@gmail.com>
6603 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
6604 (Reachability.Meet): Don't bother checking AlwaysThrows --
6605 barrier is always set.
6606 (FlowBranchingBlock.Merge): Likewise.
6608 2006-05-01 Raja R Harinath <harinath@gmail.com>
6610 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
6611 checks for unreachable.
6613 2006-05-01 Marek Safar <marek.safar@seznam.cz>
6616 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
6618 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
6619 whether field is really assigned.
6621 2006-04-30 Raja R Harinath <harinath@gmail.com>
6623 * flowanalysis.cs (Reachability): Make 4-argument constructor
6625 (Reachability.Meet): Rename from 'And'. Remove static variant.
6626 (Reachability.Always): Rename from the highly misleading
6627 'Reachability.Never'.
6628 (FlowBranching.Merge): Update to changes. Mark an impossible
6629 situation with a 'throw'.
6630 (*): Update to changes.
6632 2006-04-29 Raja R Harinath <harinath@gmail.com>
6634 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
6636 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
6637 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
6638 (*): Update to changes.
6639 * statement.cs: Update to changes.
6641 2006-04-28 Marek Safar <marek.safar@seznam.cz>
6644 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
6646 2006-04-28 Raja R Harinath <harinath@gmail.com>
6648 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
6651 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
6652 argument to two arguments: an usage-vector and a bool. Move call
6653 to FlowBranching.Merge () ...
6654 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
6656 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
6657 handling of loop and switch reachability to ...
6658 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
6660 2006-04-27 Raja R Harinath <harinath@gmail.com>
6662 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
6663 handling to FlowBranchingLoop.InLoop.
6664 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
6666 2006-04-26 Marek Safar <marek.safar@seznam.cz>
6669 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
6670 anonymous method is allowed from AnonymousContainer here.
6672 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
6674 2006-04-24 Raja R Harinath <rharinath@novell.com>
6677 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
6679 2006-04-23 Marek Safar <marek.safar@seznam.cz>
6682 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
6683 (DoubleConstant.Reduce): Ditto.
6685 2006-04-23 Raja R Harinath <rharinath@novell.com>
6687 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
6688 Remove 'lvalue_right_side' argument. Move parts to ...
6689 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
6690 (LocalVariable.DoResolveLValue): ... these.
6692 2006-04-21 Raja R Harinath <rharinath@novell.com>
6695 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
6696 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
6697 (LocalVariableReference.DoResolveBase): Use it to implement new
6699 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
6700 (Argument.Resolve): Simplify. Move CS1510 check ...
6701 * ecore.cs (Expression.ResolveLValue): ... here.
6702 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
6703 (PropertyExpr.DoResolveLValue): Likewise.
6704 (FieldExpr.Report_AssignToReadonly): Likewise.
6705 (FieldExpr.DoResolve): Add 'out_access' argument. Use
6706 LValueMemberAccess or LValueMemberOutAccess on instance depending
6708 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
6709 DoResolve as appropriate.
6711 2006-04-20 Raja R Harinath <rharinath@novell.com>
6714 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
6715 implicit conversions on 'out' and 'ref' arguments.
6717 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
6718 improve clarity. Remove dead code.
6721 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
6722 (Catch.Resolve): Resolve VarBlock if it exists.
6724 2006-04-19 Miguel de Icaza <miguel@novell.com>
6726 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
6727 twice, this was some residual code, the enumerator was emitted
6728 properly in the two branche of if later.
6730 2006-04-19 Raja R Harinath <rharinath@novell.com>
6732 * expression.cs (Cast.ResolveLValue): Remove. The result of a
6733 cast is never an lvalue.
6734 (Cast.DoResolve, Cast.ResolveRest): Combine.
6735 (Argument.Emit): Simplify slightly. Move 'Expr is
6736 IMemoryLocation' check ...
6737 (Argument.Resolve): ... here.
6738 (Argument.Error_LValueRequired): Remove. Inline into only user.
6740 Simplifications. Fix cs0191-2.cs
6741 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
6742 CS1649 and CS1651 to ...
6743 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
6744 the actual selection of the error code and message to a lookup
6745 table. Add a dummy return value to simplify callsites.
6746 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
6747 readonly fields of other instances of the same type. Move CS0197
6749 * expression.cs (Argument.Resolve): ... here. Simplify code.
6750 Ensure that ec.InRefOutArgumentResolving is only set during LValue
6751 resolution of an out or ref argument. The code simplification
6752 above uses this invariant.
6754 2006-04-18 Raja R Harinath <rharinath@novell.com>
6756 Possibly fix #77752. Fix cs1690-[4-7].cs.
6757 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
6758 CheckMarshallByRefAccess. Drop parameter.
6759 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
6761 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
6763 * report.cs (AllWarnings): Add CS1690.
6764 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
6766 (LocalVariableReference.DoResolveBase): Update.
6768 2006-04-09 Marek Safar <marek.safar@seznam.cz>
6770 * class.cs (MethodOrOperator): Moved common parts from method class.
6771 detect obsolete attributes.
6772 (Method.Define): Simplified as it reuses code from base.
6773 (Constructor.ValidAttributeTargets): Fixed issue found during
6775 (Destructor.ValidAttributeTargets): Fixed issue found during
6777 (Operator): Finished refactoring set off by #78020. Operator class is now
6778 ordinary method class.
6780 * anonymous.cs: Updated.
6782 * decl.cs (DeclSpace): Add IsGeneric
6784 2006-04-09 Marek Safar <marek.safar@seznam.cz>
6786 * class.cs (Constructor.Emit): Don't emit the attributes twice.
6788 2006-04-09 Marek Safar <marek.safar@seznam.cz>
6790 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
6791 detect obsolete attributes.
6792 (Method.CreateEmitContext): Moved to MethodOrOperator.
6794 2006-04-09 Marek Safar <marek.safar@seznam.cz>
6797 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
6798 customized exception to make crash detection easier.
6799 (MethodOrOperator): Started to work on new base class for methods and
6801 (Method): Derives from MethodOrOperator.
6802 (Constructor.Emit): Emits its own attributes.
6803 (AbstractPropertyEventMethod.Emit): Ditto.
6804 (Operator): Derives from MethodOrOperator, will refactor fully in extra
6806 (Operator.Emit): It's temporary more tricky than should be.
6808 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
6810 * report.cs (InternalErrorException): Add ctor with inner exception.
6812 2006-04-08 Marek Safar <marek.safar@seznam.cz>
6815 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
6818 2006-04-07 Marek Safar <marek.safar@seznam.cz>
6821 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
6824 2006-04-06 Marek Safar <marek.safar@seznam.cz>
6826 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
6827 attribute is present and Guid not.
6828 (Interface.ApplyAttributeBuilder): Ditto.
6830 * attribute.cs: Add error message.
6832 2006-04-06 Marek Safar <marek.safar@seznam.cz>
6836 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
6837 sources (it's composite) so hold them in extra array as they are used in
6838 Emit phase only. It worked in the previous versions by mistake.
6839 (Attribute.Emit): Emit attribute for more owners when exist.
6841 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
6842 it has now different behaviour.
6844 2006-04-04 Marek Safar <marek.safar@seznam.cz>
6846 * constant.cs (Constant.IsDefaultInitializer): New method.
6848 * class.cs: Updated.
6850 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
6851 re-initialize default values. It saves KBs almost for every assembly.
6852 Thanks Zoltan for the idea.
6853 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
6854 (ArrayCreation.DoResolve): Resolve only once.
6855 (ArrayCreation.Emit): Emit static initializer only when it is faster.
6856 (ArrayCreation.GetAttributableValue): Cope with optimized values.
6858 2006-04-03 Zoltan Varga <vargaz@gmail.com>
6860 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
6863 2006-04-01 Marek Safar <marek.safar@seznam.cz>
6865 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
6866 in an embedded statement too.
6868 2006-04-01 Raja R Harinath <rharinath@novell.com>
6871 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
6873 2006-04-01 Marek Safar <marek.safar@seznam.cz>
6877 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
6880 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
6882 2006-03-31 Marek Safar <marek.safar@seznam.cz>
6884 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
6887 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
6888 LocalTemporary change.
6890 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
6892 (ClassOrStruct.DefineFieldInitializers): Implemented static field
6893 initializers optimization.
6894 (ClassOrStruct.TypeAttr): Moved from modifiers.
6895 (Constructor.CheckBase): Don't crash when static ctor has parameters.
6896 (FieldBase.ResolveInitializer): Resolves initializer.
6897 (FieldBase.HasDefaultInitializer): New property.
6899 * cs-parser.jay: Removed message.
6901 * expression.cs (CompilerGeneratedThis): New specialization.
6903 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
6905 2006-03-28 Marek Safar <marek.safar@seznam.cz>
6907 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
6909 2006-03-27 Marek Safar <marek.safar@seznam.cz>
6911 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
6912 be now EnumConstants only.
6914 2006-03-27 Marek Safar <marek.safar@seznam.cz>
6916 * attribute.cs, driver.cs: Reset more caches.
6918 2006-03-26 Marek Safar <marek.safar@seznam.cz>
6920 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
6922 2006-03-26 Marek Safar <marek.safar@seznam.cz>
6924 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
6925 for easier reuse. Updated all overrides.
6926 (IntegralConstant): New base class for all integral constants.
6927 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
6928 of the constant range, report custom error.
6929 (UIntConstant.Reduce): Fixed uint conversion.
6931 * ecore.cs, literal.cs: Reduce updates.
6933 2006-03-26 Marek Safar <marek.safar@seznam.cz>
6937 * class.cs (Constructor.Define): Removed extra if for default ctors.
6938 A patch from Atsushi Enomoto.
6940 2006-03-26 Marek Safar <marek.safar@seznam.cz>
6942 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
6943 GetAttributableValue.
6945 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
6948 * convert.cs (ImplicitConversionRequired): Error message moved to
6951 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
6952 automatic implicit conversion of an output value.
6953 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
6955 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
6957 (TypeOf.GetAttributableValue): Add extra handling for object type.
6959 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
6960 special error message.
6962 2006-03-25 Marek Safar <marek.safar@seznam.cz>
6964 * class.cs (Constructor.Emit): Don't crash when struct ctor is
6966 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
6967 compatible with MS runtime.
6969 2006-03-23 Marek Safar <marek.safar@seznam.cz>
6971 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
6972 attribute arguments here.
6974 * class.cs (Indexer.Define): The check was moved to attribute class.
6976 2006-03-22 Marek Safar <marek.safar@seznam.cz>
6978 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
6979 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
6982 2006-03-22 Raja R Harinath <rharinath@novell.com>
6984 Support ParameterDefaultValueAttribute in gmcs. Also applied to
6985 mcs to keep code differences small.
6986 * attribute.cs (Attribute.GetParameterDefaultValue): New.
6987 * typemanager.cs (parameter_default_value_attribute_type): New.
6988 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
6991 2006-03-21 Marek Safar <marek.safar@seznam.cz>
6993 * expression.cs (StringConcat.Append): Reverted back to no warning state.
6995 2006-03-21 Marek Safar <marek.safar@seznam.cz>
6997 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
6999 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
7002 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
7004 * doc-bootstrap.cs : fix build.
7006 2006-03-20 Marek Safar <marek.safar@seznam.cz>
7008 * expression.cs (StringConcat.Append): Issue a warning when empty string
7011 2006-03-20 Marek Safar <marek.safar@seznam.cz>
7013 * assign.cs (CompoundAssign.ResolveSource): Removed.
7015 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
7018 * class.cs (TypeContainer.FindMethods): Removed.
7019 (TypeContainer.CheckMemberUsage): Made static.
7021 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
7023 * constant.cs (CheckRange): Removed unused type argument.
7024 (CheckUnsigned): Removed unused type argument.
7026 * cs-parser.jay: Updated after MemberAccess clean up.
7027 Uses Length for empty string test.
7029 * cs-tokenizer.cs: Uses Length for empty string test.
7030 (IsCastToken): Made static.
7031 (is_hex): Made static.
7032 (real_type_suffix): Made static.
7034 * decl.cs (SetupCache): Made static.
7035 (OnGenerateDocComment): Removed unused ds argument.
7037 * delegate.cs (VerifyDelegate): Removed unused argument.
7039 * doc.cs: Uses Length for empty string test.
7041 * driver.cs: Uses Length for empty string test.
7043 * enum.cs (IsValidEnumType): Made static
7045 * expression.cs (EnumLiftUp): Removed unused argument.
7046 (ResolveMethodGroup): Ditto.
7047 (BetterConversion): Ditto.
7048 (GetVarargsTypes): Ditto.
7049 (UpdateIndices): Ditto.
7050 (ValidateInitializers): Ditto.
7051 (MemberAccess.ctor): Ditto.
7052 (GetIndexersForType): Ditto.
7054 * flowanalysis.cs: (MergeFinally): Removed unused argument.
7056 * iterators.cs: Updated after MemberAccess clean up.
7058 * location.cs: Uses Length for empty string test.
7060 * namespace.cs: Uses Length for empty string test.
7062 * report.cs (CheckWarningCode): Made static.
7064 * statement.cs (LabeledStatement): Removed unused argument.
7066 * typemanager.cs (FilterNone): Removed.
7068 2006-03-18 Marek Safar <marek.safar@seznam.cz>
7070 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
7073 * class.cs: Updated.
7075 2006-03-18 Marek Safar <marek.safar@seznam.cz>
7077 * cs-parser.jay.cs: __arglist is not allowed for delegates.
7079 2006-03-18 Marek Safar <marek.safar@seznam.cz>
7083 * expression.cs (VerifyArgumentsCompat): Reverted to double error
7084 reporting, it's more tricky than I thought.
7086 2006-03-18 Marek Safar <marek.safar@seznam.cz>
7090 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
7092 (AnonymousMethod.ImplicitStandardConversionExists): New method.
7093 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
7094 Add more error reporting; Fixed issue with params.
7096 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
7098 * cs-parser.jay: AnonymousMethod requires host container.
7100 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
7102 2006-03-18 Raja R Harinath <harinath@gmail.com>
7104 * class.cs: Change 'TypeContainer ds' constructor argument to
7105 'DeclSpace parent'. Some classes were missed below due to
7106 different naming convention.
7108 * class.cs (MemberCore.Parent): Delete. This makes the
7109 ParentContainer changes below enforceable by the compiler.
7111 Treat pointers to enclosing declaration space as 'DeclSpace', not
7113 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
7114 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
7116 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
7118 (Block.AddThisVariable): Likewise.
7119 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
7120 (AbstractPropertyEventMethod.Emit): Likewise.
7121 (AbstractPropertyEventMethod.EmitMethod): Likewise.
7122 (GetMethod.Define, SetMethod.Define): Likewise.
7123 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
7124 (DelegateMethod.EmitMethod): Likewise.
7126 Fix regression test-partial-13.cs.
7127 Rationalize use of PartialContainer. Ensure that the partial
7128 class semantics can be tied to type-correctness, i.e., any
7129 violation will cause a compile error.
7130 * class.cs, const.cs: Access all fields that belong to class
7131 TypeContainer via ParentContainer. Arguments of EmitContexts and
7132 Resolve()-like functions still use 'Parent'.
7134 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
7135 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
7136 (PropertyMethod.CheckModifiers): Remove unused argument.
7137 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
7140 2006-03-17 Raja R Harinath <harinath@gmail.com>
7142 Make semantics of PartialContainer simpler.
7143 * decl.cs (DeclSpace.IsPartial): Remove.
7144 * class.cs (TypeContainer.IsPartial): Likewise.
7145 (TypeContainer..ctor): Set PartialContainer to point to self.
7146 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
7147 (TypeContainer.FindNestedType): Likewise.
7148 (MemberCore.ParentContainer): Simplify. Remove deprecation.
7150 2006-03-17 Marek Safar <marek.safar@seznam.cz>
7152 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
7154 2006-03-15 Marek Safar <marek.safar@seznam.cz>
7156 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
7159 2006-03-15 Marek Safar <marek.safar@seznam.cz>
7161 * class.cs (Operator.Define): An error for base conversion was not
7164 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
7166 * iterator.cs : yield break is allowed in try statement which has
7167 catch clauses. Fixed bug #77767.
7169 2006-03-13 Marek Safar <marek.safar@seznam.cz>
7171 A fix for #77593, #77574.
7173 * class.cs (MethodCore.CheckBase): Another if for operator.
7175 2006-03-09 Marek Safar <marek.safar@seznam.cz>
7177 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
7180 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
7181 (DelegateCreation.ImplicitStandardConversionExists): New method for just
7184 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
7187 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
7188 Updated after another emitcontext usage was clean up. It should help us to
7189 synchronize with gmcs easier.
7191 2006-03-04 Marek Safar <marek.safar@seznam.cz>
7195 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
7196 (Event.Define): ditto
7197 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
7199 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
7200 Removed redundant code and set NewSlot for Invoke method too.
7202 * parameter.cs (Parameters.ctor): Add custom, type ctor.
7203 (Parameters.MergeGenerated): New method. Use this method when you merge
7204 compiler generated argument with user arguments.
7206 2006-03-03 Marek Safar <marek.safar@seznam.cz>
7208 * attribute.cs (ResolveAsTypeTerminal): Removed.
7210 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
7211 specialization for predefined types; 30% speed up.
7212 Finally placed obsolete check to right place.
7213 (Expression.ResolveType): Removed.
7215 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
7216 Updated after ResolveType was removed.
7218 * expression.cs (Cast.ctor): Check void cast.
7219 (Binary.ResolveAsTypeTerminal): Is never type.
7220 (Conditional.ResolveAsTypeTerminal): Is never type.
7222 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
7224 2006-03-01 Raja R Harinath <rharinath@novell.com>
7227 * expression.cs (ParameterReference.DoResolveBase): Change return
7229 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
7233 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
7236 * typemanager.cs (GetFullNameSignature): Don't nullref on
7237 protected accessors.
7239 2006-02-27 Marek Safar <marek.safar@seznam.cz>
7241 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
7242 these two separated members to simplify the code.
7243 (Attribute.Resolve): Refactored to use new fields and methods.
7244 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
7245 implemented obsolete attribute checking.
7246 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
7247 implemented obsolete checking again. It look line never ending quest ;-)
7248 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
7250 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
7252 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
7254 *class.cs (Property.Define): Add RegisterProperty call.
7256 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
7257 argument groups (only 2).
7259 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
7260 encoding expression to arguments.
7261 (Expression.ExprClassToResolveFlags): Just turned to property.
7263 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
7264 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
7265 optimized as well as implemented support for zero-length attributes.
7267 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
7268 Add caching of PropertyInfo's.
7270 2006-02-25 Marek Safar <marek.safar@seznam.cz>
7272 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
7273 error multiple times.
7275 2006-02-25 Marek Safar <marek.safar@seznam.cz>
7277 New partial class implementation.
7278 A fix for #77027, #77029, #77403
7280 * attribute.cs (Attributable): Made attributes protected.
7282 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
7283 the replacements of ClassPart and PartialContainer.
7284 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
7285 (TypeContainer.AddInterface): Ditto.
7286 (TypeContainer.AddPartial): The main method for partial classes. It checks
7287 for errors and merges ModFlags and attributes. At the end class is added to
7289 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
7291 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
7292 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
7293 from the rest of partial classes.
7294 (TypeContainer.GetClassBases): Simplified.
7295 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
7297 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
7298 (TypeContainer.HasExplicitLayout): Uses Flags now.
7299 (PartialContainer): Removed.
7300 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
7301 (StaticClass): Was merged with Class.
7302 (Class.GetClassBases): class and static class bases are verified here.
7303 (Class.TypeAttr): Added static attributes when class is static.
7304 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
7305 (MemberBase): In some cases we need to call parent container for partial
7306 class. It should be eliminated but it's not easy now.
7308 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
7310 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
7311 partial classed to accumulate class comments.
7312 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
7314 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
7316 * driver.cs (MainDriver): Tree.GetDecl was removed.
7318 * modifiers.cs (Modifiers): Add partial modifier.
7320 * tree.cs (Tree.decl): Removed.
7321 (RootTypes): Started to use this class more often for root types
7324 2006-02-22 Marek Safar <marek.safar@seznam.cz>
7328 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
7329 external interface does not have an attribute.
7331 2006-02-22 Marek Safar <marek.safar@seznam.cz>
7333 Another prerequisites for new partial classs implementation.
7335 * attribute.cs (Attribute.Equal): Implemented.
7336 (Attribute.Emit): Changed as attributes can be applied more than twice.
7337 (Attributes.Emit): Check for duplicate attributes here.
7339 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
7340 as a parameter, clean-up.
7342 2006-02-11 Marek Safar <marek.safar@seznam.cz>
7346 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
7347 contains obsolete attribute check which can in some cases look for base
7348 type of current class which is not initialized yet.
7349 (TypeContainer.BaseType): Replacement of ptype.
7351 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
7353 2006-02-11 Marek Safar <marek.safar@seznam.cz>
7355 First of prerequisites for new partial classs implemention.
7357 * attribute.cs (Attributable): Extended by ResolveContext;
7358 Attributes finally have correct context for resolving in all cases.
7359 (AttachTo): Attribute owner is assigned here.
7361 * codegen.cs (IResolveContext): Introduce new interface to hold
7362 all information needed in resolving phase.
7363 (EmitContext): Implements IResolveContext; more clean-up needed here.
7365 * decl.cs (MemberCore): Implemented IResolveContext.
7367 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
7368 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
7369 parameter.cs, statement.cs, tree.cs, typemanager.cs:
7370 Refactored to use new IResolveContext instead of EmitContext; cleanup
7372 2006-02-06 Miguel de Icaza <miguel@novell.com>
7374 * codegen.cs (EmitScopeInitFromBlock): check here the
7375 capture_context, there is no need to make two calls to the
7378 * anonymous.cs: Add some debugging messages that might help me
7379 track other instances of this problem in the future (the
7380 regression of test 467).
7382 * cs-parser.jay: track the variable block, as we need to initalize
7383 any captured variables declared in this block for the "catch"
7384 portion of the "Try" statement.
7386 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
7387 scope initialization for captured variables.
7389 Also, move the emit for the variables after the block location has
7392 2006-02-06 Marek Safar <marek.safar@seznam.cz>
7394 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
7396 2006-02-02 Miguel de Icaza <miguel@novell.com>
7398 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
7399 commit yesterday, the initialization for the roots is necessary.
7400 What is not necessary is the scope activation.
7402 2006-02-02 Raja R Harinath <rharinath@novell.com>
7404 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
7405 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
7407 (Argument.Resolve): Remove CS0206 checks.
7409 2006-02-01 Miguel de Icaza <miguel@novell.com>
7411 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
7412 scopes for all the roots, the scopes will now be emitted when the
7413 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
7415 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
7416 code. This reduces a lot of existing cruft.
7418 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
7419 that the ScopeInfo is generated as we enter the scope, not at the
7420 time of use, which is what we used to do before.
7422 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
7423 every time a Block is about to be emitted if we have a
7426 2006-02-01 Raja R Harinath <rharinath@novell.com>
7428 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
7430 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
7432 * typemanager.cs (cons_param_array_attribute): Make private.
7433 (Reset): Set it to null.
7434 (InitCoreHelpers): Don't initialize it.
7435 (ConsParamArrayAttribute): New. Initialize it as needed.
7436 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
7438 2006-01-31 Miguel de Icaza <miguel@novell.com>
7440 * expression.cs: There might be errors reported during the
7441 selection of applicable methods. If there are errors, do not
7442 continue execution as it will lead the compiler to crash.
7444 2006-01-30 Miguel de Icaza <miguel@novell.com>
7446 * expression.cs: Member access is not allowed on anonymous
7447 methods. Fixes #77402.
7449 2006-01-30 Raja R Harinath <rharinath@novell.com>
7452 * cs-parser.jay (VariableDeclaration): Don't set
7453 current_array_type to null.
7454 (field_declaration, event_declaration, declaration_statement):
7455 Set it to null here.
7457 2006-01-28 Raja R Harinath <harinath@gmail.com>
7459 * typemanager.cs (GenericParameterPosition): New.
7462 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
7464 * doc.cs : To process "include" elements, first we should create
7465 another list than XmlNodeList, because it could result in node
7466 removal, which could result in that the XmlNodeList gives up
7469 (Also made code identical to gmcs again.)
7471 2006-01-25 Miguel de Icaza <miguel@novell.com>
7473 * ecore.cs: Introduce an error report that we were not catching
7474 before, if not silent, we must report the error. Gonzalo ran into
7477 2006-01-23 Miguel de Icaza <miguel@novell.com>
7479 A fix for bug: #76957
7481 * iterators.cs (MoveNextMethod.CreateMethodHost): call
7482 ComputeMethodHost before creating the method, this is a new
7485 * anonymous.cs (AnonymousContainer): Now we track all the scopes
7486 that this method references (RegisterScope). The actual scope
7487 where the method is hosted is computed with the ComputeMethodHost
7488 before we create the method.
7490 Moved the Deepest routine here.
7492 (AnonymousContainer.ComputeMethodHost): New routine used to
7493 compute the proper ScopeInfo that will host the anonymous method.
7495 (ScopeInfo): Deal with multiple roots. The problem was that we
7496 did not have a unique root where all ScopeInfos could be hanged
7497 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
7500 Remove AdjustMethodScope which is now computed at the end. Remove
7501 LinkScope which did a partial link, instead link all ScopeInfos
7502 before code generation from the new "LinkScopes" routine.
7504 Simplify all the Add* routines as they no longer need to maintain
7505 the tree, they just need to record that they are using variables
7508 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
7509 routines to produce the forest of ScopeInfo trees.
7511 * class.cs (TypeContainer.AppendMethod): This is just like
7512 AddMethod, but ensures that an interface implementation method
7513 (IEnumerable.XXX) is not inserted at the beginning of the queue of
7514 methods, but at the end.
7516 We use this functionality to ensure that the generated MoveNext
7517 method in the iterator class is resolved/emitted before the
7518 enumerator methods created.
7520 This is required because the MoveNext method computes the right
7521 ScopeInfo for the method. And the other methods will eventually
7522 need to resolve and fetch information computed from the anonymous
7525 2006-01-21 Raja R Harinath <harinath@gmail.com>
7526 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7529 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
7531 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
7532 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
7534 2006-01-18 Raja R Harinath <rharinath@novell.com>
7536 Fix #76656, cs0231-2.cs.
7537 * cs-parser.jay (formal_parameter_list): Make error case catch
7539 (parenthesized_expression_0): Add CS1026 check.
7540 (invocation_expression): Remove unused { $$ = lexer.Location }.
7542 2006-01-17 Raja R Harinath <rharinath@novell.com>
7545 * cs-parser.jay (statement_expression): Don't list out the
7546 individual statement-expressions. Convert syntax error into
7549 2006-01-16 Raja R Harinath <rharinath@novell.com>
7552 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
7553 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
7554 CheckIntermediateModification.
7555 (FieldExpr.DoResolve): Add new two-argument version that
7556 allows us to resolve the InstanceExpression as an lvalue.
7557 The one-argument variant is now just a wrapper.
7558 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
7559 Resolve the lhs as an lvalue if the it has a value type.
7560 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
7561 from Assign.DoResolve.
7562 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
7563 resolved as an lvalue.
7564 (PropertyExpr.DoResolve): Update.
7565 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
7566 has a value type. Move CS1612 check here from
7567 CheckIntermediateModification.
7568 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
7569 * expression.cs (EmptyExpression.OutAccess): New. Used as the
7570 'right_side' of a ResolveLValue on an 'out' argument.
7571 (EmptyExpression.LValueMemberAccess): New. Used as the
7572 'right_side' of a propagated ResolveLValue on a value type.
7573 (LocalVariableReference.DoResolveBase): Recognize
7574 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
7576 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
7577 EmptyExpression.Null.
7579 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
7581 * typemanager.cs : added IsGenericParameter(). In mcs it always
7583 * doc.cs : for generic parameters, use GenericParameterPosition,
7586 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
7588 * expression.cs: Fix Console.WriteLine ((this = x).foo);
7590 2006-01-12 Miguel de Icaza <miguel@novell.com>
7592 This fixes the problem where we used ldfld instead of ldflda to
7593 load the "THIS" pointer on captured parameters, when THIS is a
7594 value type. See bug #77205.
7596 * iterators.cs (CapturedThisReference.Emit): Pass false to
7597 EmitThis (we do not need the address).
7599 * codegen.cs (EmitThis): it needs to know whether we need the
7600 address of `this' or not. This is used by value types.
7602 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
7603 every other call passes false.
7605 2006-01-12 Raja R Harinath <rharinath@novell.com>
7608 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
7610 * expression.cs (Invocation.OverloadResolve): Update.
7611 (Invocation.DoResolve): Avoid double resolution of invocation.
7613 2006-01-11 Raja R Harinath <rharinath@novell.com>
7616 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
7617 unary negation of floating point types as 0-expr; negation cannot
7618 overflow in floating point types.
7621 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
7622 on operands of 'void' type.
7625 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
7626 and ExclusiveOr for boolean constants too.
7628 2006-01-09 Raja R Harinath <rharinath@novell.com>
7631 * expression.cs (Invocation.OverloadResolve): Replace reflected
7632 override methods with their base virtual methods, rather than
7634 * typemanager.cs (TypeManager.GetOverride): New.
7636 2006-01-05 Jb Evain <jbevain@gmail.com>
7638 * class.cs (Property.Define, Indexer.Define): do not tag the
7639 properties as SpecialName | RTSpecialName.
7641 2006-01-04 Miguel de Icaza <miguel@novell.com>
7643 * class.cs (MethodCore.IsDuplicateImplementation): This method was
7644 doing a low-level comparission of parameter types. It was lacking
7645 a check for __argslist.
7647 2005-12-30 Miguel de Icaza <miguel@novell.com>
7649 * expression.cs (ParameterReference.DoResolveBase): Allow
7650 reference parameters if they are local to this block.
7652 This allows the ref and out parameters of a delegate to be used in
7653 an anonymous method, for example:
7655 delegate void set (out int x);
7657 set s = delegate (out int x){
7661 This is used by functionality introduced late in the C# language.
7663 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
7664 method that take ref and out parameters.
7666 Fixes #77119 which was a late change in the spec.
7668 2005-12-23 Miguel de Icaza <miguel@novell.com>
7670 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
7671 parent if its the same scope. Fixes #77060.
7673 2005-12-21 Miguel de Icaza <miguel@novell.com>
7675 * driver.cs: Report the case of no source files and no -out:
7678 2005-12-20 Raja R Harinath <rharinath@novell.com>
7681 * expression.cs (ComposedCast.GetSignatureForError): Define.
7683 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7687 * namespace.cs (NamespaceEntry): Add extern_aliases as a
7688 ListDictionary, to contain the ExternAliasEntry entries (in
7689 addition to the NamespaceEntry.aliases hashtable). This field is
7690 shared between the original entry and its doppelganger (bodyless
7692 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
7693 extern_aliases field.
7694 (NamespaceEntry.Lookup): Move the IsImplicit check after the
7695 lookup in extern_aliases.
7697 2005-12-16 Raja R Harinath <rharinath@novell.com>
7700 * class.cs (TypeContainer.Mark_HasEquals): New.
7701 (TypeContainer.Mark_HasGetHashCode): New.
7702 (ClassPart): Override them.
7703 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
7706 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
7707 'parent' argument to the base constructor.
7709 Remove all mention of TypeContainer from decl.cs.
7710 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
7711 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
7712 (DeclSpace.DeclSpace): Likewise.
7713 (DeclSpace.DefineMembers): Remove unused argument.
7714 * cs-parser.jay (pop_current_class): Update to changes. Simplify
7715 debugging check -- we don't care if the debug code throws an
7716 InvalidCastException instead of an InternalErrorException.
7717 * class.cs (TypeContainer.DefineMembers): Update to changes.
7718 (TypeContainer.DoDefineMembers): Likewise.
7719 (TypeContainer.GetMethods): Likewise.
7720 (PropertyMember.Define): Likewise.
7721 (MemberBase.Parent): New property that forwards to
7722 MemberCore.Parent, but ensures that we get a TypeContainer.
7723 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
7724 (RootContext.PopulateTypes): Likewise. Remove special case code
7725 for !RootContext.StdLib: DefineMembers is idempotent.
7727 2005-12-14 Miguel de Icaza <miguel@novell.com>
7729 * convert.cs (ExplicitConversionCore): Check the return value from
7730 ExplicitConversionCore which can return null on failure. Fixes #76914
7732 2005-12-13 Marek Safar <marek.safar@seznam.cz>
7734 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
7736 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
7738 * doc.cs : The search for referenced namespace was insufficient to
7739 get global one as it used to do. Fixed bug #76965.
7741 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
7743 * doc.cs : check name in cref in the last phase that whether it is
7746 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
7748 * cs-tokenizer.cs : reverted the latest change: it somehow broke
7751 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
7753 * doc.cs : so it turned out that we cannot skip override check for
7754 interface members. Fixed bug #76954.
7756 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
7758 * cs-tokenizer.cs : fixed bug #75984:
7759 - #warning and #error should not be handled when the source line
7761 - #line is not checked strictly when the source line is disabled.
7762 - #define and #undef is on the other hand checked strictly at any
7765 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
7767 * cs-tokenizer.cs : missing Location (actually, filename) in one of
7770 2005-12-05 Marek Safar <marek.safar@seznam.cz>
7772 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
7774 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
7776 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
7777 (FieldBase.Initializer): Initializer is now optional.
7778 (EventField.Define): Only event field can have initializer.
7780 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
7782 * const.cs (Const): Reuse initializer.
7784 * cs-parser.jay: Updated after FieldBase changes.
7785 Added current_array_type to simplify array initializers.
7787 * ecore.cs (NullCast.IsDefaultValue): Implemented.
7789 * expression.cs, iterators.cs: Updated.
7791 * namespace.cs (NamespaceEntry): Made UsingFound private.
7793 2005-12-05 Marek Safar <marek.safar@seznam.cz>
7795 * parameterCollection.cs: Obsolete, removed.
7796 * parser.cs: Obsolete, removed.
7798 2005-12-05 Marek Safar <marek.safar@seznam.cz>
7801 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
7803 * enum.cs (Enum.Define): Set obsolete context here.
7805 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
7808 - FindDocumentedMember() now expects 1) paramList as null
7809 when "we don't have to check the number of parameters" and
7810 2) Type.EmptyTypes when "there is no arguments".
7811 - Introduced FoundMember struct to hold the exact type which was
7812 used to find the documented member (the above change broke
7813 test-xml-044; it might be better just to use DeclaringType than
7814 what MS does, like this change does, but it depends on usage.)
7816 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
7818 * doc.cs : documented member might be from DeclaringType for nested
7819 types. Fixed bug #76782.
7821 2005-12-03 Ben Maurer <bmaurer@ximian.com>
7823 * anonymous.cs: Have the param code handle leaving copies on the
7824 stack etc. Allows anonymous params to take part in the assignment
7825 code (++, +=, etc). Fixes bug #76550
7827 * expression.cs: Handle the prepare_for_load/leave_copy by passing
7828 it down to the anon code.
7830 * iterators.cs: Use dummy var here
7832 * codegen.cs: Handle new vars
7834 2005-12-01 Marek Safar <marek.safar@seznam.cz>
7837 * class.cs (MethodData.Define): Set proper Obsolete context.
7839 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
7841 (FieldExpr.DoResolve): Ditto.
7843 2005-12-01 Marek Safar <marek.safar@seznam.cz>
7846 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
7847 parent is not obsolete.
7849 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
7851 * doc.cs : (FindDocumentedMember) find parameterless members first
7852 and get CS0419 in the early stage. Fixed first case of bug #76727.
7854 2005-11-30 Marek Safar <marek.safar@seznam.cz>
7857 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
7858 no error was reported.
7860 *expression.cs (Binary.DoResolve): left can be null.
7862 2005-11-22 Marek Safar <marek.safar@seznam.cz>
7865 * class.cs (MethodData.Emit): Parameters should be labeled first.
7867 2005-11-21 Marek Safar <marek.safar@seznam.cz>
7870 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
7872 2005-11-18 Marek Safar <marek.safar@seznam.cz>
7874 * attribute.cs (AreParametersCompliant): Moved to Parameter.
7876 * class.cs (MethodCore): Parameter clean up.
7877 (IMethodData): Added ParameterInfo.
7878 (MethodData): Parameter clean up.
7879 (Indexer.Define): Parameter clean up.
7891 * typemanager.cs: Parameter clean up.
7893 * delegate.cs (Define): Get rid of duplicated code.
7895 * expression.cs (ParameterReference): Removed useless parameters
7897 (Invocation): Ditto.
7899 * parameter.cs (ParamsParameter): New class, params specialization.
7900 (ArglistParameter): Attemp to separate arglist.
7901 (Parameter): Refactored to be reusable and faster.
7902 (Parameter.Modifier): Made understandable.
7903 (Parameters): Changed to be used as a class for `this' assembly
7904 parameters. Refactored to use new specialized classes.
7906 * support.cs (ParameterData): Added Types property.
7907 (InternalParameters): Deleted.
7909 2005-08-20 Martin Baulig <martin@ximian.com>
7911 Merging this patch from GMCS to fix #75867.
7913 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
7914 scope if we don't already have it.
7916 2005-11-17 Martin Baulig <martin@ximian.com>
7919 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
7920 inherit the scope from our parent. Fixes #76653.
7922 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
7924 * doc.cs : the previous patch does not actually fix the bug.
7925 PropertyInfo override check is now implemented and really fixed it.
7926 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
7928 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
7930 * doc.cs : apply "override filter" also to properties.
7933 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
7935 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
7936 no need to check overrides. For classes, omit those results from
7937 interfaces since they must exist in the class. Fixed bug #76726.
7939 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
7941 * typemanager.cs : (GetFullNameSignature) differentiate indexers
7942 with different parameters. Fixed the second problem in #76685.
7944 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
7946 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
7947 get expected 'protected' access in CheckValidFamilyAccess()).
7950 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
7952 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
7953 Fixed bug #76705. CS1569 was incorrectly commented out.
7955 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
7957 * doc.cs : use Invocation.IsOverride() to do real override check.
7958 * expression.cs : made Invocation.IsOverride() internal.
7960 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
7962 * doc.cs : use TypeManager.FindMembers() instead of (possible)
7963 TypeBuilder.FindMembers() and filter overriden base members out.
7966 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
7968 * doc.cs : ref/out parameters are represented as '@' (instead of
7969 '&' in type FullName). Fixed bug #76630 (additionally crefs).
7971 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
7973 * doc.cs : when there was no '.' in cref to methods in doc comment,
7974 then parameters were missing in the output. Fixed bug #76691.
7976 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
7978 * driver.cs : don't output docs when there is an error.
7981 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
7984 Now it should detect indexers. Fixed primary concern in bug #76685.
7985 Fixed CS0419 message to not show the identical member signature in
7988 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
7990 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
7991 instead of Type.FindMembers() since it does not handle events.
7994 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
7996 * codegen.cs: Fixed typo (speficied -> specified).
7998 2005-11-11 Marek Safar <marek.safar@seznam.cz>
8001 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
8003 2005-11-11 Marek Safar <marek.safar@seznam.cz>
8005 * attribute.cs: Changed error message.
8007 * cs-tokenizer.cs: One more check.
8009 2005-11-10 Marek Safar <marek.safar@seznam.cz>
8011 * statement.cs (Block.Resolve): Ignore empty statement.
8013 2005-11-10 Marek Safar <marek.safar@seznam.cz>
8015 * report.cs: Made error/warning methods more strict to avoid
8018 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
8019 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
8020 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
8021 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
8023 2005-11-08 Marek Safar <marek.safar@seznam.cz>
8025 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
8026 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
8028 * class.cs (TypeContainer.IsComImport): New property.
8029 (Constructor.Define): Create proper ctor for ComImport types.
8031 * expression.cs (New.CheckComImport): Fixed.
8033 2005-11-07 Miguel de Icaza <miguel@novell.com>
8035 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
8036 that a parameter has been captured does not mean that we do not
8037 have to do the rest of the processing. This fixes the second part
8038 of #76592. If there was another anonymous method capturing
8039 values in the past, the Scope would never be set for the second
8040 method that captured the same parameter.
8042 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
8043 properly manipulate the stack. Second part of fix for #76592.
8045 * expression.cs (New): Add support for invoking "new" on
8046 interfaces that have been flagged with the ComImport attribute and
8047 the CoClass. Fixes #76637
8049 * statement.cs (Try.DoEmit): When a variable is captured, do not
8050 try to emit the vi.LocalBuilder variable as it has been captured.
8051 Create a temporary variable and store the results on the
8052 FieldBuilder. Fixes #76642
8054 2005-11-07 Marek Safar <marek.safar@seznam.cz>
8056 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
8058 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
8060 * expression.cs (Binary.DoResolve): Added && optimalization.
8062 * typemanager.cs (AddUserType): Removed useless argument.
8064 2005-11-04 Marek Safar <marek.safar@seznam.cz>
8066 * statement.cs (Block.variables): Uses ListDictionary.
8068 2005-11-03 Marek Safar <marek.safar@seznam.cz>
8071 * class.cs (PartialContainer.EmitType): Customized to emit
8072 security attributes.
8073 (ClassPart.ApplyAttributeBuilder): Transform security attribute
8074 for partial classes.
8076 2005-11-03 Marek Safar <marek.safar@seznam.cz>
8079 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
8080 access has to be fixed.
8082 * typemanager.cs (IsUnmanagedType): Wrong common field type.
8084 2005-11-01 Marek Safar <marek.safar@seznam.cz>
8087 * ecore.cs (NullCast.Reduce): Implemented.
8089 * expression.cs (ArrayCreation.CheckIndices): Correcly check
8092 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
8094 (Foreach.Resolve): Catch null properly.
8096 2005-10-29 Marek Safar <marek.safar@seznam.cz>
8098 * cs-tokenizer.cs: Warning text fix.
8100 * driver.cs: AllWarningNumbers exposed on public interface.
8102 * report.cs (): Reviewed warning numbers.
8103 (IsValidWarning): Use binary search.
8105 2005-10-29 Marek Safar <marek.safar@seznam.cz>
8107 * driver.cs: Implemeted resource visibility.
8108 (Resources): New class for code sharing between /res: and
8111 2005-10-28 Marek Safar <marek.safar@seznam.cz>
8114 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
8117 * convert (Convert.ImplicitReferenceConversion): NullCast holds
8120 * ecore.cs (NullCast): Child is contant only.
8122 * literal.cs (NullLiteral.Reduce): null can be converted to any
8125 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
8127 * driver.cs: Use Encoding.Default as default code page instead
8130 2005-10-27 Raja R Harinath <rharinath@novell.com>
8133 * expression.cs (Invocation.Error_InvalidArguments): Handle
8134 __arglist parameters.
8135 (Invocation.VerifyArgumentsCompat): Likewise.
8136 * support.cs (ReflectionParameters.GetSignatureForError): Print
8137 __arglist parameters.
8138 (InternalParamters.GetSignatureForError): Likewise.
8139 * parameter.cs (Parameters.GetSignatureForError): Likewise.
8141 2005-10-26 Marek Safar <marek.safar@seznam.cz>
8143 * attribute.cs (GetPropertyValue): Made public.
8145 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
8147 Add new property WrapNonExceptionThrows to handle 2.0 assembly
8149 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
8152 * driver.cs: Reflect method name change.
8154 * statement.cs (Try.Resolve): Warn when try has both general
8157 * typemanager.cs: runtime_compatibility_attr_type new predefined
8160 2005-10-26 Raja R Harinath <harinath@gmail.com>
8163 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
8164 treat it as an empty parameter list.
8166 2005-10-26 Raja R Harinath <rharinath@novell.com>
8169 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
8170 ResolveAsTypeStep silent.
8171 * statement.cs (Block.AddConstant): Mark block as used.
8172 (Block.ResolveMeta): Avoid piling on error messages
8173 if a constant initializer resolution fails.
8175 2005-10-25 Raja R Harinath <rharinath@novell.com>
8177 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
8179 (NamespaceEntry.VerifyAllUsing): New.
8180 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
8181 behaviour. Delegates actual resolution of alias to ...
8182 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
8183 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
8185 * driver.cs (Driver.MainDriver): Update.
8187 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
8188 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
8190 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
8192 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
8193 RootNamespace.DefineNamespacesForAll.
8195 2005-10-24 Raja R Harinath <harinath@gmail.com>
8197 * typemanager.cs (assemblies, external_aliases, modules)
8198 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
8199 (ComputeNamespaces, GetRootNamespace): Remove extra staging
8200 overhead. Move resposibility ...
8201 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
8202 * driver.cs, attribute.cs, codegen.cs: Update to changes.
8204 2005-10-23 Raja R Harinath <harinath@gmail.com>
8206 * namespace.cs (RootNamespace.all_namespaces): Renamed from
8207 cached_namespaces. Improve usage.
8208 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
8209 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
8210 Move from GlobalRootNamespace and simplify.
8211 (RootNamespace.Global): Make instance variable.
8212 (RootNamespace.RootNamespace): Add "alias name" parameter.
8213 (GlobalRootNamespace): Simplify drastically.
8214 (Namespace.Lookup): Don't use GetNamespace.
8215 * typemanager.cs (GetRootNamespace): Rename from
8216 ComputeNamespaceForAlias.
8217 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
8219 2005-10-23 Marek Safar <marek.safar@seznam.cz>
8221 * anonymous.cs (AnonymousContainer): Don't crash when container
8224 2005-10-23 Marek Safar <marek.safar@seznam.cz>
8226 * expression.cs (Binary.DoResolve): Warn when comparing same
8229 2005-10-23 Marek Safar <marek.safar@seznam.cz>
8232 * expression.cs (Binary.DoResolve): It looks like there are no
8233 convetsion rules in enum context.
8235 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
8237 Add support for extern alias qualifiers.
8238 * typemanager.cs: Move some LookupTypeReflection code
8239 to namespace.cs, to have cleaner code. Added some methods
8240 to help us keep track of the extern aliased references.
8241 * driver.cs: Add suport for extern alias assemblies on command
8242 line and check for their warnings/errors. Also keep track of the
8243 extern aliased assemblies.
8244 * namespace.cs: Move the global functionality of Namespace
8245 to GlobalRootNamespace/RootNamespace. Now the global namespace
8246 is GlobalRootNamespace.Globa. Also the code moved from
8247 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
8248 Finally added LocalAliasEntry (AliasEntry before) and
8249 ExternAliasEntry, to handle alias statements.
8250 * cs-parser.jay: Add support in the grammar for extern alias
8252 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
8253 Update callings to Namespace (now in GlobalRootNamespace).
8255 2005-10-18 Raja R Harinath <rharinath@novell.com>
8258 * class.cs (TypeContainer.DefineType): Move updating of
8259 topological sort earlier in the code.
8260 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
8262 2005-10-18 Marek Safar <marek.safar@seznam.cz>
8265 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
8267 * constant.cs (Constant.TryReduce): Moved from Cast class.
8268 (Reduce): Made little bit more OO and fixed missing conversions.
8270 * ecore.cs (Reduce): Implemented.
8271 (Binary.EnumLiftUp): New method to upgrade values to enum values.
8273 * literal.cs (Reduce): Implemented.
8275 * class.cs: Reverted Miguel's wrong commit.
8277 2005-10-14 Miguel de Icaza <miguel@novell.com>
8279 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
8281 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
8283 * cs-parser.jay, expression.cs : CS0214 was missing error location
8284 for constants. Fixed bug #76404.
8286 2005-10-11 Marek Safar <marek.safar@seznam.cz>
8289 * convert.cs (ExplicitConversionCore): Fixed object->enum
8292 2005-10-10 Raja R Harinath <rharinath@novell.com>
8294 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
8296 (PropertyExpr.EmitCall): Likewise.
8297 * expression.cs (Invocation.EmitArguments): Handle case where
8299 (Invocation.EmitCall): Avoid allocating temporary variable if
8300 there are no arguments.
8302 2005-10-07 Raja R Harinath <rharinath@novell.com>
8305 * convert.cs (ImplicitConversionStandard): Move conversion of
8306 void* to arbitrary pointer types ...
8307 (ExplicitConversionStandard): .. here.
8308 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
8309 error to always print typenames.
8311 2005-10-07 Raja R Harinath <rharinath@novell.com>
8313 * convert.cs (GetConversionOperator): Rename from
8314 GetConversionOperators. Move operator selection code from ...
8315 (UserDefinedConversion): ... here.
8317 2005-10-06 Marek Safar <marek.safar@seznam.cz>
8319 * convert.cs (ExplicitConversionCore): Removed duplicate enum
8322 2005-10-05 Marek Safar <marek.safar@seznam.cz>
8324 * assign.cs (Assign.DoResolve): Error method changed.
8326 * cfold.cs (DoConstantNumericPromotions): Error method changed.
8328 * const.cs (ResolveValue): Reset in_transit immediately.
8330 * constant.cs: Error method changed.
8332 * convert.cs: Removed useless location parameter.
8333 (ExplicitNumericConversion): Don't do double enum check.
8334 (ExplicitConversionCore): Renamed from ExplicitConversion.
8335 (ExplicitUnsafe): Extracted from ExplicitConversion.
8336 (ExplicitConversion): Uses for error reporting.
8338 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
8340 (ResolveBoolean): Uses common error method.
8341 (CastToDecimal): Get rid of ec.
8342 (CastFromDecimal): Optimized.
8343 (ConvCast): Get rid of ec.
8345 * enum.cs (ResolveValue): Reset in_transit immediately.
8346 (Emit): Return after first error.
8348 * expression.cs: Convert changes.
8350 * literal.cs: Error method changed.
8352 * statement.cs: Error method changed.
8354 2005-10-03 Raja R Harinath <rharinath@novell.com>
8356 * support.cs (SeekableStreamReader.Position): Don't error out when
8357 the requested position is just beyond the end of the current
8360 2005-09-28 Raja R Harinath <rharinath@novell.com>
8362 * support.cs (SeekableStreamReader): Simplify drastically. Don't
8363 try to keep in sync with the byte count of the underlying Stream.
8364 However, this limits us to a window size of 2048 characters: i.e.,
8365 the maximum lookahead of our lexer/parser can be 2048 characters.
8367 2005-09-28 Marek Safar <marek.safar@seznam.cz>
8370 * driver.cs: Fix compilation files with full root path.
8372 2005-09-25 Miguel de Icaza <miguel@novell.com>
8374 * report.cs (SymbolRelatedToPreviousError): Format the output so
8375 it does not use an open parenthesis that is never closed.
8377 * driver.cs: Follow coding guidelines
8379 2005-09-27 Marek Safar <marek.safar@seznam.cz>
8382 * const.cs (Const.ResolveValue): Check for assigning non-null
8383 value to reference type.
8385 2005-09-27 Marek Safar <marek.safar@seznam.cz>
8387 * anonymous.cs: Implemented ExprClassName.
8389 * assign.cs (Assign.DoResolve): Don't chrash when type is not
8392 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
8395 * class.cs (StaticClass.DefineContainerMembers): Report protected
8398 * codegen.cs: if(ed) PRODUCTION.
8400 * convert.cs (Error_CannotImplicitConversion): Better error
8403 * cs-parser.jay: More error checks.
8405 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
8407 * driver.cs (CSCParseOption): Enabled wrong option check.
8409 * ecore.cs (Expression.ExprClassName): Turned to property.
8410 (MemberExpr.CheckIntermediateModification): For checking boxed
8411 value types modification.
8413 * statement.cs (Fixed.Resolve): Expression type must be
8414 convertible to fixed type.
8415 (CollectionForeach.GetEnumeratorFilter,TryType):
8416 Small refactoring for easier error checking.
8418 2005-09-26 Marek Safar <marek.safar@seznam.cz>
8420 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
8423 * class.cs (GeneratedBaseInitializer): New class for customization
8424 compiler generated initializers.
8425 (MemberBase.DoDefine): Check Obsolete attribute here.
8426 (FieldMember.DoDefine): Ditto.
8428 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
8431 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
8432 (MemberCore.GetObsoleteAttribute): Removed argument.
8433 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
8434 (MemberCore.CheckObsoleteType): New helper.
8438 * statement.cs: Updates after MemberCore changes.
8440 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
8441 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
8443 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
8444 obsolete attribute for compiler construct.
8445 (As.DoResolve): Cache result.
8447 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
8449 2005-09-26 Raja R Harinath <rharinath@novell.com>
8452 * expression.cs (This.VerifyFixed): In a value type T, the type of
8453 'this' is T&, iow, 'this' is either an out or ref parameter. In a
8454 value type R, 'this' is treated as a value parameter.
8456 2005-09-22 Miguel de Icaza <miguel@novell.com>
8458 * statement.cs (Lock): Use the TemporaryVariable class instead of
8459 manually using local variables as those do not work when variables
8462 * ecore.cs: Moved the TemporaryVariable class from being a nested
8463 class inside Foreach to be a public class that can be employed in
8466 2005-09-19 Marek Safar <marek.safar@seznam.cz>
8468 * cs-parser.jay: interface_accessors replaced by
8469 accessor_declarations.
8471 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
8474 * statement.cs (GotoCase.Resolve): Convert null constant to
8476 (SwitchLabel.ResolveAndReduce): Ditto.
8477 (SwitchLabel.NullStringCase): Custom null stamp.
8478 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
8480 typemanager.cs (CSharpSignature): Don't skip first argument
8483 2005-09-18 Miguel de Icaza <miguel@novell.com>
8485 * driver.cs: Set InEmacs based on the environment variable EMACS.
8487 * location.cs (InEmacs): in this mode, do not report column
8488 location as it confuses Emacs.
8490 2005-09-16 Marek Safar <marek.safar@seznam.cz>
8492 * cfold.cs, constant.cs, convert.cs, ecore.cs,
8493 expression.cs, iterators.cs, literal.cs: Store constants and
8496 * class.cs (MemberBase.ShortName): Pass location.
8498 * cs-parser.jay: Some location fixes.
8500 * ecore.cs (Expression.Location): Made virtual.
8502 2005-09-05 Miguel de Icaza <miguel@novell.com>
8504 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
8505 if the underlying types are the same, otherwise we need to produce
8506 code that will do the proper cast.
8508 This was exposed by Marek's constant rewrite which produced
8509 invalid code for the call site:
8512 void Method (X v) {}
8516 This fixes test-49.cs
8518 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
8520 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
8521 Type/Object should be allowed as well. Fixed bug #75968.
8523 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
8525 * expression.cs : (Binary.DoResolve): when one is enum constant and
8526 another is constant 0, then return enum one *as enum type*.
8529 2005-09-02 Raja R Harinath <rharinath@novell.com>
8531 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
8535 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
8536 flow-branching for LocalVariableReferences in case we were invoked
8537 from a MemberAccess.
8538 * expression.cs (LocalVariableReference.VerifyAssigned): New.
8540 (LocalVariableReference.DoResolveBase): ... this.
8541 (MemberAccess.Resolve): Do the check that was disabled during
8544 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
8547 (PartialContainer.Create): check abstract/sealed/static strictly
8548 but abstract/sealed can exist only at one side. Fixed bug #75883.
8550 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
8553 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
8554 specified, don't default to UnmanagedType.I4.
8556 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
8558 * expression.cs : conditional operator should check possibly
8559 incorrect assign expression. Fixed bug #75946.
8561 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
8563 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
8564 Reverting the change. gmcs is much complex than mcs on this matter.
8566 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
8568 * cs-tokenizer.cs : To read another token ahead of the actual
8569 consumption, use new SavedToken and cache token instead of moving
8570 back the stream with SeekableStreamReader (it seemed problematic).
8572 driver.cs : Thus use StreamReader directly.
8573 * support.cs : Thus removed SeekableStreamReader.
8575 2005-08-30 Raja R Harinath <rharinath@novell.com>
8578 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
8579 (ScopeInfo.EmitScopeType): Use it to construct field names from
8580 names of captured locals.
8583 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
8584 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
8585 Pass 'target_type' to BoxedCast. Don't default to 'object'.
8586 (ExplicitConversion): Remove enum cases already handled by
8587 implicit conversion. Move implicit conversion check to the beginning.
8588 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
8589 * expression.cs (ArrayCreation.EmitDynamicInitializers):
8590 Don't treat System.Enum as a struct.
8592 2005-08-30 Jb Evain <jbevain@gmail.com>
8594 * attribute.cs: handles as expression in parameters.
8596 2005-08-30 Raja R Harinath <rharinath@novell.com>
8599 * class.cs (TypeContainer.VerifyClsName): Don't use a
8600 PartialContainer when verifying CLS compliance.
8601 (AbstractPropertyEventMethod): Set Parent here, ...
8602 (PropertyMethod): ... not here.
8604 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
8606 * attribute.cs : escaped attribute name should not be allowed to be
8607 resolved (e.g. @class as classAttribute). Fixed bug #75930.
8609 2005-08-29 Raja R Harinath <rharinath@novell.com>
8612 * convert.cs (ImplicitStandardConversionExists): Allow zero also
8613 when converting a long constant to unsigned long.
8614 * expression.cs (Invocation.OverloadResolve): Add sanity check to
8615 detect where IsApplicable and VerifyArgumentsCompat disagree.
8617 2005-08-29 Raja R Harinath <rharinath@novell.com>
8618 and Carlos Alberto Cortez <carlos@unixmexico.org>
8621 * class.cs (TypeContainer.CanElideInitializer): New helper.
8622 (TypeContainer.EmitFieldInitializers): Use it to determine if we
8623 can safely emitting the initializer of a field.
8625 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
8627 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
8628 allowed inside a switch (without loop). Fixed bug #75433.
8630 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
8632 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
8633 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
8635 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
8637 * driver.cs : kinda reverting the default encoding changes (not exact
8638 revert since I noticed that "codepage:reset" might not work fine).
8640 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
8642 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
8643 Location. Now getter and setter store location correctly.
8644 (errors/cs0111-12.cs now reports the expected location.)
8646 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
8648 * driver.cs : Use default encoding on the environment.
8649 Removed (now that) extra parameter for SeekableStreamReader.
8650 * support.cs : (SeekableStreamReader) third .ctor() argument for
8651 StreamReader is not required (always true). preamble size could
8652 be acquired in simpler and safe way.
8654 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
8656 * cs-parser.jay: report CS0642 at warning level 3
8657 and report CS0642 for an if else statement also
8658 fixes bug #74745. Patch by John Luke (and a bit
8660 Removed extra CS0642 warning check for "while",
8662 * statement.cs: In Block.Resolve(), CS0642 check
8663 is reimplemented to check a sequence of an empty
8664 statement and a block.
8666 Both fix bug #66777.
8668 2005-08-24 Marek Safar <marek.safar@seznam.cz>
8670 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
8671 detection until I fix it.
8673 * cs-tokenizer.cs: Changed error message.
8675 * cs-parser.jay: Fixed 2 error locations.
8677 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
8678 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
8681 * enum.cs (GetSignatureForError): Fixed.
8683 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
8687 * typemanager.cs (RegisterProperty): Removed.
8689 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
8691 2005-08-24 Raja R Harinath <rharinath@novell.com>
8694 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
8695 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
8697 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
8699 * expression.cs : tiny fix is required for not warning positive ulong.
8702 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
8704 * expression.cs : add CS0652 check for constant and integral
8705 expression. Fixed bug #53974.
8707 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
8709 * expression.cs : in DoNumericPromotions(), check if there is implicit
8710 conversion overload for string (to check CS0034). Fixed bug #52492.
8712 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
8714 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
8716 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
8718 * ecore.cs : report location when it is *not* Null.
8720 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
8726 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
8727 correctly. Fixed bug #75721.
8729 2005-08-23 Raja R Harinath <rharinath@novell.com>
8731 * support.cs (SeekableStreamReader.Position): Avoid an expensive
8732 loop that performs 'min (pos, char_count)'.
8735 * expression.cs (Unary.ResolveOperator): Don't discard implicit
8736 converted value in Operator.OnesComplement.
8738 2005-08-22 Ben Maurer <bmaurer@ximian.com>
8740 * anonymous.cs: If the anon method is pulled into a helper class,
8741 it needs to be `internal' not `private'. Fixes runtime behavior on
8744 2005-08-20 Martin Baulig <martin@ximian.com>
8746 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
8747 scope if we don't already have it.
8749 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
8750 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
8753 2005-08-17 Marek Safar <marek.safar@seznam.cz>
8756 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
8759 2005-08-16 Marek Safar <marek.safar@seznam.cz>
8761 The big constants rewrite
8762 Fix #75746, #75685 and more
8763 As a side effect saved 1MB for MWF ;-)
8765 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
8766 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
8767 enum based for corlib compilation.
8769 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
8772 * class.cs (FixedField.Define): Use ResolveAsConstant.
8774 * const.cs (IConstant): Interface constants and enums.
8775 (Const.ResolveValue): New method for constant resolvning.
8776 (ExternalConstant): Constants from imported assemblies.
8778 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
8779 conversion; like enums.
8780 (Constant.ToType): Converts this constant to different type.
8781 (Constant.Increment): Adds 1.
8783 * convert.cs (ImplicitConversionRequired): Simplified.
8785 * cs-parser.jay: Create EnumMember directly.
8787 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
8789 * doc.cs (GenerateEnumDocComment): Removed.
8791 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
8792 (ConvertIntLiteral): Removed.
8793 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
8795 * enum.cs (EnumMember): Implement IConstant.
8796 (Enum.IsValidEnumConstant): Removed.
8797 (Enum.GetNextDefaultValue): Removed.
8798 (Enum.FindMembers): Updated.
8799 (Enum.GenerateDocComment): Iterate enum members.
8801 * expression.cs (Cast.TryReduce): Handle enums correctly.
8802 (New.Constantify): Made public.
8803 (MemberAccess.DoResolve): Removed contant specific if(s).
8805 * literal.cs (NullLiteral): Implement new abstract methods.
8807 * statement.cs (GotoCase.Resolve): Use new constant methods.
8808 (SwitchLabel.ResolveAndReduce): Use new constant methods.
8810 * typemanager.cs (LookupEnum): Removed.
8811 (IsEnumType): Fixed to work with corlib.
8812 (RegisterConstant): Removed.
8813 (LookupConstant): Removed.
8814 (GetConstant): Changed to work with IConstant.
8816 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
8818 * location.cs : Fixed overflown (>255) column number.
8820 2005-08-03 Raja R Harinath <rharinath@novell.com>
8822 First cut of the qualified-alias-member feature.
8823 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
8825 * cs-parser.jay (DOUBLE_COLON): New token.
8826 (namespace_or_type_name): Add rule for recognizing
8827 qualified-alias-members.
8828 (primary_expression): Likewise.
8829 (element_access): Allow QualifiedAliasMember as a possible
8830 type-bearing expression.
8831 (local_variable_type, local_variable_pointer_type): Likewise.
8832 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
8833 aliases in the current and enclosing namespace declarations.
8834 (NamespaceEntry.UsingAlias): Add CS0440 warning.
8835 * decl.cs (MemberName.is_double_colon): New.
8836 (MemberName.MemberName): Add new constructor for alias-member.
8837 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
8838 * expression.cs (QualifiedAliasMember): New expression type.
8840 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
8842 * location.cs : it borked when no argument was specified.
8844 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
8846 * location.cs : tiny ToString() format fix.
8848 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
8850 * statement.cs : oops, it was missing.
8852 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
8854 A set of fixes for precise line/column location.
8857 "token" field now holds a file/line "delta", a line number offset
8858 from the segment, and a column number. See also:
8859 http://lists.ximian.com/pipermail/mono-devel-list/2004-
8860 December/009508.html
8861 Removed static IsNull. Use instance IsNull property instead.
8863 For some tokens it stores Location. For Identifier it stores
8864 LocatedToken which is a pair of string name and location.
8865 Column numbers are adjusted only at getChar().
8867 Use Location.ToString() for reporting (it now contains column).
8869 Largely modified to use LocatedToken instead of
8870 string (IDENTIFIER), and to acquire Location from some tokens.
8871 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
8872 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
8874 Now MemberName holds Location. DeclSpace.ctor() receives Location
8875 as a parameter. Removed extra parameters to all derived classes.
8876 Replaced Location.IsNull() with instance property.
8877 * assign.cs, expression.cs :
8878 Added .ctor() overload that omits Location.
8880 Added "nameEscaped" flag that indicates the identifier was escaped
8881 in the source file. This fixes bug #57047.
8883 2005-08-02 Marek Safar <marek.safar@seznam.cz>
8885 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
8886 New method, looking for lo-case imported cls type.
8888 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
8891 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
8893 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
8895 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
8897 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
8899 Optimized to save 3.5 MB for SWF compilation.
8901 2005-08-01 Marek Safar <marek.safar@seznam.cz>
8903 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
8904 (PartialContainer.Create): Moved logic AddToContainer.
8905 (PartialContainer.MarkForDuplicationCheck): Shares name.
8907 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
8910 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
8912 (Namespace.GetSignatureForError): New method.
8914 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
8915 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
8917 2005-08-01 Raja R Harinath <rharinath@novell.com>
8920 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
8921 member lookup rather than qualifier_type, since qualifier_type can
8924 2005-08-01 Marek Safar <marek.safar@seznam.cz>
8926 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
8929 2005-07-31 Miguel de Icaza <miguel@novell.com>
8931 * statement.cs: Copy the local exception into the exception
8932 captured local. Fixes 75674
8934 2005-07-31 Raja R Harinath <harinath@gmail.com>
8937 * expression.cs (Invocation.OverloadResolve): Don't report error
8938 CS1501 if error CS1502 has been reported.
8939 (New.DoResolve): Delegate CS1501 reporting to
8940 Invocation.OverloadResolve.
8943 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
8944 invariant-meaning-in-block property in an enclosing block if
8947 2005-07-29 Marek Safar <marek.safar@seznam.cz>
8949 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
8950 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
8951 (Switch.CheckSwitch): Just save 50kb for SWF.
8953 2005-07-27 Martin Baulig <martin@ximian.com>
8955 * anonymous.cs (CaptureContext.AddField): Added
8956 `AnonymousContainer am' argument; compute its toplevel scope if
8957 it's not already computed. Fixes #75649.
8959 2005-07-26 Raja R Harinath <rharinath@novell.com>
8962 * class.cs (Constructor.Emit): Reset block to null if the block
8965 2005-07-25 Marek Safar <marek.safar@seznam.cz>
8967 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
8969 2005-07-25 Marek Safar <marek.safar@seznam.cz>
8971 * class.cs (MethodData.Define): Check whether accessor implementing
8972 interface is public.
8974 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
8976 2005-07-22 Marek Safar <marek.safar@seznam.cz>
8979 * namespace.cs (LookupType): Moved same type check to...
8981 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
8984 2005-07-21 Raja R Harinath <rharinath@novell.com>
8986 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
8987 already found a typebuilder.
8988 * class.cs (MethodCore.IsDuplicateImplementation): Compare
8989 MemberNames, not strings.
8991 * const.cs (Error_ExpressionMustBeConst):
8992 Rename from Error_EpressionMustBeConst.
8993 * const.cs, class.cs, statement.cd: Update.
8995 2005-07-21 Marek Safar <marek.safar@seznam.cz>
8999 * const.cs (Const.LookupConstantValue): Report missing contant expression
9001 (Error_EpressionMustBeConstant): Only one error method.
9003 * class.cs, statement.c: Updated.
9005 2005-07-20 Raja R Harinath <rharinath@novell.com>
9007 * statement.cs (Block.Flags): Add back HasVarargs.
9008 (Block.flags): Make protected.
9009 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
9011 * typemanager.cs (types, typecontainers, user_types): Remove.
9012 (UserTypes, TypeContainers): Likewise.
9013 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
9014 (CleanUp, Reset): Update.
9015 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
9016 (GetNestedType): Use Type.GetNestedType.
9017 (CoreLookupType): Take two arguments, the namespace and the
9018 basename of the type. Update to use the Namespace.Lookup
9020 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
9021 (RealMemberLookup): Use IsNestedChildOf instead of playing with
9022 string concatenation and substring matches.
9023 * class.cs, enum.cs, delegate.cs: Update to changes.
9025 2005-07-20 Marek Safar <marek.safar@seznam.cz>
9027 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
9028 Expression and made virtual.
9030 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
9031 (ImplicitStandardConversionExists): Fixed `byte' typo ?
9033 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
9035 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
9038 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
9041 2005-07-18 Marek Safar <marek.safar@seznam.cz>
9044 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
9045 AssemblyCultureAttribute is not used on executable.
9048 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
9050 2005-07-16 Raja R Harinath <rharinath@novell.com>
9053 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
9054 New. Reports CS0252/CS0253.
9055 Mostly taken from preliminary patch by Duncak Mak.
9056 (Binary.DoResolveOperator): Store results of operator lookup.
9057 Use them to detect if we need to warn about unintended reference
9060 2005-07-15 Raja R Harinath <rharinath@novell.com>
9063 * namespace.cs (Namespace.Lookup): Add back location parameter.
9064 (Namespace.LookupType): Add CS0436 report. Add location parameter.
9065 * delegate.cs, ecore.cs, expression.cs: Update to changes.
9067 * codegen.cs (EmitContext.DeclSpace): Make readonly.
9068 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
9069 (Namespace.LookupType): ... this.
9070 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
9072 * typemanager.cs (LookupTypeReflection): Remove buggy code that
9073 purported to handle pointers.
9074 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
9077 2005-07-15 Marek Safar <marek.safar@seznam.cz>
9079 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
9082 2005-07-15 Raja R Harinath <rharinath@novell.com>
9084 * namespace.cs (Namespace.Lookup): Drop location parameter.
9085 (NamespaceEntry.LookupAlias): Remove. Merge into ...
9086 (NamespaceEntry.Lookup): ... this.
9087 (NamespaceEntry.Error_AmbiguousTypeReference):
9088 Move here from DeclSpace.
9089 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
9091 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
9092 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
9093 Move to NamespaceEntry.
9094 * delegate.cs, expression.cs: Update to changes.
9096 2005-07-14 Marek Safar <marek.safar@seznam.cz>
9098 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
9099 CheckAttributeType and refactored.
9100 (Attribute.ResolvePossibleAttributeType): Changed to reuse
9101 ResolveAsTypeTerminal error handling.
9102 (ResolveAsTypeTerminal): Introduced because of global attributes extra
9104 (GetSignatureForError): Print errors in same way.
9107 * codegen.cs: Reflect attribute GetSignatureForError change.
9110 * expression.cs: Add silent parameter to ResolveAsTypeStep.
9112 * namespace.cs (UsingEntry): Refactored to make fields private.
9115 statement.cs: Error_UnexpectedKind has extra parameter.
9117 2005-07-14 Raja R Harinath <rharinath@novell.com>
9119 * ecore.cs (IAlias): Remove.
9120 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
9121 that implement the interface.
9122 * namespace.cs (Namespace): Likewise.
9123 (Namespace.declspaces): Renamed from 'defined_names'.
9124 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
9125 DeclSpace instead of an IAlias.
9126 * tree.cs (Tree.AddDecl): Update.
9128 2005-07-12 Raja R Harinath <rharinath@novell.com>
9130 * statement.cs (Block.Flags); Remove HasVarargs.
9131 (Block.HasVarargs): Move to ToplevelBlock.
9132 (Block.ThisVariable, Block.AddThisVariable): Likewise.
9133 (Block.Variables): Make protected. Initialize variable hashtable
9135 (Block.AddVariable): Update.
9136 (Block.Resolve): Update to changes.
9137 (ToplevelBlock.HasVarargs): New boolean.
9138 (ToplevelBlock.ThisVariable): Move here from Block.
9139 (ToplevelBlock.AddThisVariable): Likewise.
9140 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
9141 * expression.cs (This.ResolveBase): Update to changes.
9142 (ArglistAccess.DoResolve): Likewise.
9144 2005-07-11 Marek Safar <marek.safar@seznam.cz>
9147 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
9149 * class.cs (TypeContainer.VerifyMembers): Distinguish between
9150 not used and not used & assigned.
9151 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
9153 2005-07-11 Marek Safar <marek.safar@seznam.cz>
9156 * expression.cs (Is.DoResolve): null is never provided type.
9158 2005-07-08 Marek Safar <marek.safar@seznam.cz>
9161 * cs-parser.jay: Less strict event error rule to catch more errors.
9163 2005-07-08 Martin Baulig <martin@ximian.com>
9165 Fix test-iter-10.cs - distinguish whether we `yield' in a property
9166 gettter (allowed) or setter (not allowed).
9168 * class.cs (Accessor): Implement IIteratorContainer.
9169 (Accessor.Yields): New public field.
9170 (PropertyBase.PropertyMethod.Define): Handle iterators on a
9174 (get_accessor_declaration, set_accessor_declaration): Set the
9175 `yields' flag on the accessor, not the property.
9176 (property_declaration): Do the iterators check on a per-accessor
9177 basis and not for the whole property.
9179 2005-07-08 Martin Baulig <martin@ximian.com>
9181 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
9182 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
9184 2005-07-07 Marek Safar <marek.safar@seznam.cz>
9187 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
9188 (ExtractSecurityPermissionSet): Cope with self referencing security
9189 attributes properly.
9191 * driver.cs (SetOutputFile): Made public property OutputFile.
9193 2005-07-07 Raja R Harinath <rharinath@novell.com>
9196 * class.cs (TypeContainer.first_nonstatic_field): Rename from
9197 has_nonstatic_fields. Make into a FieldBase pointer.
9198 (TypeContainer.AddField): Add CS0282 check.
9199 (TypeContainer.EmitType): Update.
9201 2005-07-06 Miguel de Icaza <miguel@novell.com>
9203 * cs-tokenizer.cs (consume_identifier): Do not create strings to
9204 compare if they start with __.
9206 2005-07-06 Raja R Harinath <rharinath@novell.com>
9208 * statement.cs (Switch.SwitchGoverningType): Only look at
9209 UserCasts that don't need implicit standard conversions to one of
9210 the allowed switch types (Fixes test-322.cs).
9211 (LocalInfo.Resolve): Re-enable sanity-test.
9213 2005-07-06 Marek Safar <marek.safar@seznam.cz>
9215 * cs-tokenizer.cs (consume_identifier): Detect double undescores
9217 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
9219 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
9221 2005-07-06 Raja R Harinath <rharinath@novell.com>
9224 * ecore.cs (SimpleName.GetSignatureForError): Add.
9225 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
9226 (MemberAccess.GetSignatureForError): Add.
9228 2005-07-05 Marek Safar <marek.safar@seznam.cz>
9230 The big error and warning messages review.
9260 * typemanager.cs: Updated.
9262 * class.cs: (MethodCore.SetYields): Moved here to share.
9263 (PropertyMethod.Define): Moved iterator setup here.
9265 * iterators.cs: Add orig_method to have full access to parent
9268 2005-07-05 Raja R Harinath <rharinath@novell.com>
9270 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
9271 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
9272 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
9273 variable of struct type.
9274 * expression.cs (Unary.ResolveOperator): Update to change.
9275 (Indirection.VerifyFixed): Likewise.
9276 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
9277 (ParameterReference.VerifyFixed): Value parameters are fixed.
9278 (This.VerifyFixed): Treat 'this' as a value parameter.
9279 * statement.cs (LocalInfo.IsFixed): Remove.
9281 2005-07-01 Martin Baulig <martin@ximian.com>
9283 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
9284 `ec.EmitThis ()' to get the correct scope.
9286 2005-07-01 Martin Baulig <martin@ximian.com>
9288 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
9289 instance is a ParameterReference; fixes #75299.
9291 2005-07-01 Martin Baulig <martin@ximian.com>
9293 Reverted Marek's latest patch (r46725):
9294 - it contains structural changes which are neither mentioned in
9295 the ChangeLog nor explained anywhere; for example the additional
9296 argument of EmitContext's and Iterator's .ctor's and the
9297 TypeContainer.DefineMembers() change.
9298 - structural changes like this should go in in seperate patches
9299 and not be hidden in a huge patch which just seems to affect
9300 warnings and errors.
9301 a big and hard to understand patch.
9302 - it breaks iterators and causes regressions, for instance in
9305 2005-06-30 Raja R Harinath <rharinath@novell.com>
9308 * expression.cs (Indexers.map): Remove.
9309 (Indexers.Append): Filter out inaccessible setters and getters.
9310 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
9313 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
9315 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
9316 (FieldExpr.Emit, PropertyExpr.Emit): Update.
9317 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
9318 * expression.cs (Invocation.EmitCall): Add CS0120 check.
9320 2005-06-30 Marek Safar <marek.safar@seznam.cz>
9323 * class.cs (FieldBase.GetInitializerExpression): One more field
9326 2005-06-28 Miguel de Icaza <miguel@novell.com>
9328 * pending.cs: Do not define a proxy if the base method is virtual,
9329 it will be picked up by the runtime (bug 75270).
9331 2005-06-08 Martin Baulig <martin@ximian.com>
9333 The big Iterators rewrite :-)
9335 * iterators.cs: Rewrite this to use the anonymous methods framework.
9337 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
9338 before the TypeContainers; see 2test-21.cs.
9341 (TypeContainer.DefineType): Don't create a new EmitContext if we
9342 already have one (this only happens if we're an Iterator).
9343 (TypeContainer.Define): Also call Define() on all our iterators.
9344 (Method.CreateEmitContext): Added support for iterators.
9347 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
9348 (AnonymousContainer.CreateMethodHost): Moved here from
9349 AnonymousMethod and made abstract.
9350 (AnonymousContainer.CreateScopeType): New abstract method.
9351 (AnonymousContainer.IsIterator): New public property.
9352 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
9353 get the ScopeTypeBuilder rather than manually defining it here.
9354 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
9357 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
9358 before RootContext.DefineTypes().
9360 * codegen.cs (EmitContext.RemapToProxy): Removed.
9361 (EmitContext.CurrentAnonymousMethod): Changed type from
9362 AnonymousMethod -> AnonymousContainer.
9363 (EmitContext.ResolveTopBlock): Protect from being called twice.
9364 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
9365 (EmitContext.EmitThis): Removed the iterators hacks; use the
9366 anonymous methods framework for that.
9369 (ToplevelBlock.Container): Make this a property, not a field.
9370 (ToplevelBlock.ReParent): New public method; move the
9371 ToplevelBlock into a new container.
9372 (Foreach.TemporaryVariable): Simplify.
9374 2005-06-05 Martin Baulig <martin@ximian.com>
9376 * statement.cs (LocalInfo.CompilerGenerated): New flag.
9377 (Block.AddTemporaryVariable): New public method; creates a new
9378 `LocalInfo' for a temporary variable.
9379 (Block.EmitMeta): Create the LocalBuilders for all the temporary
9381 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
9382 non-iterator variables.
9384 2005-06-05 Martin Baulig <martin@ximian.com>
9386 * statement.cs (Foreach.TemporaryVariable): Create the
9387 LocalBuilder in the Emit phase and not in Resolve since in some
9388 situations, we don't have an ILGenerator during Resolve; see
9389 2test-19.cs for an example.
9391 2005-06-04 Martin Baulig <martin@ximian.com>
9393 **** Merged r45395 from GCS ****
9395 The big Foreach rewrite - Part II.
9397 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
9398 with `PropertyInfo ienumerator_getcurrent'.
9400 * codegen.cs (VariableStorage): Removed.
9403 (Foreach): Derive from Statement, not ExceptionStatement.
9404 (Foreach.CollectionForeach): New nested class. Moved all the code
9405 dealing with collection foreach here.
9406 (Foreach.ForeachHelperMethods): Removed.
9407 (Foreach.TemporaryVariable): Implement IMemoryLocation.
9409 2005-05-23 Martin Baulig <martin@ximian.com>
9411 * statement.cs (Try.DoResolve): Don't create a `finally' if we
9412 don't need to. Fix #75014.
9414 2005-05-20 Martin Baulig <martin@ximian.com>
9416 Merged r44808 from GMCS.
9418 * class.cs (TypeContainer.CircularDepException): Removed.
9419 (TypeContainer.DefineType): Removed the `InTransit' stuff.
9420 (TypeContainer.CheckRecursiveDefinition): Check for circular class
9421 (CS0146) and interface (CS0529) dependencies here.
9423 2005-06-21 Raja R Harinath <rharinath@novell.com>
9425 * expression.cs (Invocation.EmitCall): Fix initialization
9426 'this_call' to reflect current behaviour. Fix indentation.
9428 * convert.cs (FindMostEncompassedType): Add two trivial special
9429 cases (number_of_types == 0 || number_of_types == 1).
9430 (FindMostEncompasingType): Likewise.
9432 2005-06-17 Raja R Harinath <rharinath@novell.com>
9434 Some cleanups preparing for the fix of #75283.
9435 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
9437 (EventExpr.InstanceResolve): Likewise.
9438 (EventExpr.DoResolve): Remove redundant checks.
9440 2005-06-10 Duncan Mak <duncan@novell.com>
9442 * cs-tokenizer.cs (process_directives): New flag for controlling
9443 the processing of preprocessor directives.
9444 (x_token): After seeing a '#', return Token.NONE instead of going
9445 to handle_preprocessing_directive() when not processing
9446 directives. This avoids unnecessary processing during the token peek in
9451 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
9452 the existing error reporting methods instead of Report.Error.
9454 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
9455 after Raja's rewrite.
9457 2005-06-08 Miguel de Icaza <miguel@novell.com>
9459 * class.cs: Small fix.
9461 2005-06-08 Raja R Harinath <rharinath@novell.com>
9464 * class.cs (GetPartialBases): Fix return value check of
9467 2005-06-07 Raja R Harinath <rharinath@novell.com>
9469 Ensure that partial classes are registered in their enclosing
9470 namespace. Initial part of fix of #75160.
9471 * tree.cs (Tree.RecordDecl): Add new namespace argument.
9472 Register declspace with namespace here, not in
9473 DeclSpace.RecordDecl.
9474 * cs-parser.jay: Pass namespace to RecordDecl.
9475 * class.cs (PartialContainer.Create): Likewise.
9476 (ClassPart.DefineType): New sanity-check. Throws an exception if
9478 * decl.cs (Declspace.RecordDecl): Remove.
9479 * namespace.cs (NamespaceEntry.DefineName): Remove.
9481 2005-06-06 Marek Safar <marek.safar@seznam.cz>
9483 * rootcontext.cs: Reset TargetExt as well.
9485 2005-06-03 Raja R Harinath <rharinath@novell.com>
9487 * ecore.cs (Expression.Resolve): Emit CS0654 error when
9490 2005-06-02 Raja R Harinath <rharinath@novell.com>
9492 Fix #75080, cs0119.cs.
9493 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
9495 (Expression.Resolve): ... this. Use it. Remove bogus code
9496 allowing ExprClass.Type and ExprClass.Namespace for
9497 ResolveFlags.VariableOrValue.
9498 (Expression.Resolve) [1-argument variant]: Change default resolve
9499 flags based on language version.
9500 (Expression.Error_UnexpectedKind): Use a simple string array
9501 rather than an ArrayList.
9502 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
9504 (TypeOfVoid.DoResolve): Likewise.
9505 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
9506 flags argument -- it always has the same value.
9508 2005-05-31 Raja R Harinath <rharinath@novell.com>
9511 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
9512 Use it in the error message.
9513 * assign.cs, expression.cs, statement.cs: Update.
9515 2005-05-30 Raja R Harinath <rharinath@novell.com>
9518 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
9519 the "almostMatchedMember" case too.
9520 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
9521 that failed the accessibility checks to 'almost_match'.
9523 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
9525 * attribute.cs: Use internal MethodBuilder methods to set
9526 ExactSpelling and SetLastError on PInvoke methods, instead
9527 of passing them via charset. Fixes #75060.
9529 2005-05-27 Raja R Harinath <rharinath@novell.com>
9531 * parameter.cs (Parameter): Remove TODO comment.
9532 (Parameter.DefineParameter): Remove Location parameter.
9533 (Parameters.LabelParameters): Likewise.
9534 * class.cs (Constructor.Emit): Update to change.
9535 (MethodData.Emit): Likewise.
9536 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
9537 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
9539 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
9542 Removed Parameters.Location and added Parameter.Location instead.
9543 Removed Location parameter from Emit() and GetSignature().
9550 Modified all related calls.
9552 2005-05-26 Raja R Harinath <rharinath@novell.com>
9554 Improve user-defined conversion handling.
9555 * convert.cs (GetConversionOperators): Rewrite. Return only the
9556 applicable operators.
9557 (AddConversionOperators): New. Helper for GetConversionOperators.
9558 (FindMostEncompassedType, FindMostEncompassingType): Verify that
9559 there is only one most encompassed/encompassing type.
9560 (FindMostSpecificSource, FindMostSpecificTarget): Remove
9561 "applicable operator" handling.
9562 (UserConversion): Move cache here from GetConversionOperators.
9563 Directly cache the chosen operator, rather than the whole
9565 (ExplicitNumericConversion): Fix buggy implementation of Decimal
9566 case. Allow conversion of decimal to sbyte and byte too.
9567 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
9568 New static methods. Used to avoid allocating EmptyExpressions in
9571 2005-05-24 Duncan Mak <duncan@novell.com>
9573 * ecore.cs (CastFromDecimal): New class for casting a decimal to
9574 another class, used in Convert.ExplicitNumericConversion.
9575 (CastToDecimal): New class, similar to above, but casts to
9576 System.Decimal, used in Convert.ImplicitNumericConversion and also
9577 in explicit convesion from double/float to decimal.
9579 * convert.cs (ImplicitNumericConversion): Handle implicit
9580 conversions to System.Decimal.
9581 (ExplicitNumericConversion): handle explicit conversions to
9586 2005-05-20 Miguel de Icaza <miguel@novell.com>
9588 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
9589 know the type at this stage, just break through. Fixes #75008
9591 2005-05-19 Martin Baulig <martin@ximian.com>
9594 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
9595 to disable error reporting.
9597 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
9598 here since we don't want to report an error; see the new test-336.cs.
9600 2005-05-19 Raja R Harinath <rharinath@novell.com>
9602 * statement.cs (ToplevelBlock.GetParameterReference)
9603 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
9604 Move here from class Block.
9605 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
9606 * expression.cs (ParameterReference.DoResolveBase): Likewise.
9608 2005-05-18 Martin Baulig <martin@ximian.com>
9613 (FlowBranching.Reachability): Add non-static public And() and Or()
9615 (FlowBranchingSwitch): New class; do the `break_origins' thing
9616 like in FlowBranchingLoop.
9617 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
9618 reachability, not just locals and parameters.
9619 (FlowBranching.MergeChild): Remove some of the hacks for loop and
9620 switch; MergeBreakOrigins() now takes care of that.
9622 2005-05-18 Martin Baulig <martin@ximian.com>
9624 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9625 a loop and may leave it, reset the barrier; fixes #74974.
9627 2005-05-17 Marek Safar <marek.safar@seznam.cz>
9629 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
9632 * cs-parser.jay: Catch more lexical errors.
9634 * report.cs: Add one more Error method.
9637 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
9639 2005-05-17 Martin Baulig <martin@ximian.com>
9641 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
9644 2005-05-16 Raja R Harinath <rharinath@novell.com>
9646 Fix test-382.cs. Emit values of decimal constants.
9647 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
9649 (TypeContainer.AddField): ... this.
9650 (TypeContainer.EmitFieldInitializers): Allow the list of fields
9651 with initializers to include 'Const's.
9652 (ClassPart.RegisterFieldForInitialization): Forward to
9654 * const.cs (Const.Const): Pass initializer to base class.
9655 (Const.Define): In case of decimal constants, register them for
9656 initialization in a static constructor.
9658 2005-05-14 Martin Baulig <martin@ximian.com>
9660 * statement.cs (Block.Resolve): Correctly handle unreachable code;
9661 do not call ResolveUnreachable() on unreachable statements in
9662 here, see the comment in the source code.
9664 2005-05-13 Raja R Harinath <rharinath@novell.com>
9667 * expression.cs (BinaryResolveOperator): If one of the operands of
9668 an equality comparison is 'null' and the other is a pointer type,
9669 convert the null to a NullPointer.
9670 * convert.cs (ImplicitReferenceConversion): If the expression is a
9671 NullLiteral and the target type is a pointer type, return a
9672 NullPointer instead.
9673 (ImplicitConversionStandard): Likewise.
9675 2005-05-13 Marek Safar <marek.safar@seznam.cz>
9677 * cs-parser.jay: Set readonly context based on special constructs.
9679 * expression.cs (LocalVariableReference.DoResolveBase): Improved
9680 readonly variable error handling.
9682 * rootcontext.cs (EmitCode): Don't verify members when error
9685 * statement.cs (LocalInfo): Add reaodnly context information.
9686 (SetReadOnlyContext, GetReadOnlyContext): New methods.
9688 2005-05-13 Raja R Harinath <rharinath@novell.com>
9690 * statement.cs (Block.Resolve): Revert change below. Modify fix
9691 for #74041 to initialize 'resolved' to false only for explicit
9692 blocks. Fixes #74873.
9694 2005-05-12 Raja R Harinath <harinath@gmail.com>
9697 * typemanager.cs (unmanaged_enclosing_types): New.
9698 (IsUnmanagedType): Avoid infloops by using
9699 'unmanaged_enclosing_types' to talk with recursive invocations.
9701 2005-05-13 Martin Baulig <martin@ximian.com>
9703 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
9704 instance variable, not a local. Fix #74873.
9705 (Block.ResolveUnreachable): Set it to true here.
9707 2005-05-11 Duncan Mak <duncan@novell.com>
9709 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
9710 continuing to process for 'arg'.
9711 (handle_preprocessing_directive): Check the argument of the #endif
9712 directive and report error CS1025 if there are any trailing
9715 According to the C# spec, having even whitespace after the #endif
9716 directive is illegal; however, because we call arg.TrimEnd ()
9717 beforehand, we have the same behavior as csc, allowing whitespace
9718 after the directive.
9722 2005-05-11 Marek Safar <marek.safar@seznam.cz>
9726 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
9727 (Constructor.GetObsoleteAttribute): Implemented correctly.
9729 2005-05-10 Martin Baulig <martin@ximian.com>
9731 * support.cs (ReflectionParameters.ParameterModifier): Use
9732 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
9733 and `ParameterAttributes.In'. Fixes #74884.
9735 2005-05-10 Marek Safar <marek.safar@seznam.cz>
9737 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
9739 * expression.cs (Argument.GetParameterModifier): Turned to property.
9740 (Invocation.Error_InvalidArguments): Add more descriptive errors.
9742 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
9745 2005-05-09 Raja R Harinath <rharinath@novell.com>
9748 * decl.cs (MemberCache.AddMethods): Register override methods,
9749 rather than non-override methods.
9750 * typemanager.cs (RegisterOverride): New.
9751 (IsOverride): Update.
9753 2005-05-09 Marek Safar <marek.safar@seznam.cz>
9757 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
9758 recursive declaration.
9760 * statement.cs (Block.ResolveMeta): Report any error in resolving.
9762 2005-05-06 Marek Safar <marek.safar@seznam.cz>
9764 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
9766 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
9768 2005-05-05 Raja R Harinath <rharinath@novell.com>
9771 * decl.cs (DeclSpace.FamilyAccessible):
9772 Use TypeManager.IsNestedFamilyAccessible.
9774 Fix reopened #64812.
9775 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
9778 2005-05-04 Raja R Harinath <rharinath@novell.com>
9779 Abin Thomas <projectmonokochi@rediffmail.com>
9780 Anoob V E <projectmonokochi@rediffmail.com>
9781 Harilal P R <projectmonokochi@rediffmail.com>
9784 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
9785 allow access to all static members.
9787 2005-05-04 Martin Baulig <martin@ximian.com>
9789 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
9791 2005-05-04 Martin Baulig <martin@ximian.com>
9795 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
9796 section at the end; make things work if `default' is not the last
9799 2005-05-04 Martin Baulig <martin@ximian.com>
9803 * statement.cs (Switch): Replaced the `got_default' field with a
9804 `default_section' one.
9805 (Switch.CheckSwitch): Set `default_section' here.
9806 (Switch.Resolve): If we're a constant switch and the constant is
9807 not found, use the default section.
9809 2005-05-03 Martin Baulig <martin@ximian.com>
9811 * expression.cs (ArrayAccess.EmitGetLength): New public method.
9813 * statement.cs (Foreach.ArrayForeach): New nested class.
9814 (Foreach.TemporaryVariable): New nested class.
9815 (Foreach.EmitArrayForeach): Removed; this is now in the new
9818 2005-05-03 Raja R Harinath <rharinath@novell.com>
9820 * pending.cs (BaseImplements): Move the #74773 fix here. This is
9822 (VerifyPendingMethods): Revert change below.
9824 * typemanager.cs (IsOverride, RegisterNonOverride): New.
9825 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
9826 that used to trigger warning -28. Remove warning -28.
9827 * expression.cs (Invocation.OverloadResolve): Use
9828 TypeManager.IsOverride to distinguish override methods.
9831 * pending.cs (VerifyPendingMethods): If a base type implements the
9832 requested interface, don't bother checking individual methods of
9833 the base type. As a side-effect, this prevents the creation of
9834 unnecessary proxies.
9836 2005-05-02 Martin Baulig <martin@ximian.com>
9840 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9841 Also `And' the locals if the old vector is null.
9842 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
9843 null; in this case we basically reset all the variables.
9845 2005-05-02 Martin Baulig <martin@ximian.com>
9849 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
9850 Added `FlowBranching branching' argument; always `and' the
9851 variables instead of `or'ing them unless we're an infinite loop.
9853 * statement.cs (While.Resolve): Create a new sibling unless we're
9856 2005-05-02 Martin Baulig <martin@ximian.com>
9860 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
9861 arguments; use it instead of creating a new TopLevelBlock.
9862 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
9863 our ConstructorInitializer.
9866 (TopLevelBlock.TopLevelBranching): New public property.
9867 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
9868 and create our `TopLevelBranching'.
9870 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
9871 anonymous method host, use `block.TopLevelBranching' rather than
9872 creating a new branching.
9874 2005-04-20 Miguel de Icaza <miguel@novell.com>
9876 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
9877 a ScopeInfo, if any of the current children is a child of the new
9878 entry, move those children there.
9880 2005-04-30 Martin Baulig <martin@ximian.com>
9882 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
9883 at the beginning of a SwitchSection. Fix #73335.
9885 2005-04-27 Marek Safar <marek.safar@seznam.cz>
9888 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
9890 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
9891 (FieldExpr.DoResolve): Obsolete members are ignored for field
9894 2005-04-26 Marek Safar <marek.safar@seznam.cz>
9896 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
9897 of arrays detection.
9899 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
9901 (Field.VerifyClsCompliance): Volatile fields are not compliant.
9903 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
9906 2005-04-25 Ben Maurer <bmaurer@ximian.com>
9908 * cs-parser.jay: Use the prefered version of -unsafe in error
9911 2005-04-22 Marek Safar <marek.safar@seznam.cz>
9913 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
9916 2005-04-20 John Luke <john.luke@gmail.com>
9918 * driver.cs: fix typo in error message, --outout to --output
9920 2005-04-20 Marek Safar <marek.safar@seznam.cz>
9922 * codegen.cs (InRefOutArgumentResolving): New field.
9924 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
9925 fields outside contructor.
9927 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
9929 2005-04-19 Miguel de Icaza <miguel@novell.com>
9931 * anonymous.cs (CaptureContext.EmitParameterInstance): The
9932 parameter code was not completed ever, so it was not as up-to-date
9933 as local variables. Must finish it.
9935 The bug fix was to compare the Toplevel of the block, not the
9936 current block. Thanks for Ben for pointing this out.
9938 2005-04-19 Raja R Harinath <rharinath@novell.com>
9940 * decl.cs (AddMethods): Use the declaring type of the problem
9941 method to determine if we want to squash a warning.
9943 2005-04-19 Marek Safar <marek.safar@seznam.cz>
9945 * attribute.cs: Removed debug output.
9947 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
9949 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
9952 2005-04-18 Raja R Harinath <rharinath@novell.com>
9955 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
9956 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
9957 all null comparisons against reference types.
9959 2005-04-18 Marek Safar <marek.safar@seznam.cz>
9962 * class.cs (TypeContainer.CircularDepException) New nested
9964 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
9965 (TypeContainer.DefineType): Removed error, reset InTransit before
9967 (Class.DefineType): Throw exception when is in Transit.
9968 Catch exception and report error.
9969 (Struct.DefineType): Throw exception when is in Transit.
9970 Catch exception and report error.
9971 (Interface.DefineType): Throw exception when is in Transit.
9972 Catch exception and report error.
9974 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
9975 handle nested exception handlers.
9977 * flowanalysis.cs (InTryWithCatch): New method, search for try with
9980 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
9981 InFinally and InCatch storage.
9983 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
9984 (Catch.Resolve): Set and Restore ec.InCatch.
9985 (Try.Resolve): Set and Restore ec.InFinally.
9986 (Try.HasCatch): True when try has catch.
9988 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
9990 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
9991 for the same event member, so exclude such cases from warning 419.
9994 2005-04-16 Miguel de Icaza <miguel@novell.com>
9996 * expression.cs (Binary.ResolveOperator): Apply patch from John
9997 Luke to fix bug 59864: operators &, | and ^ on enumerations
9998 require that the same enum type on both sides.
10000 * driver.cs: Add warnings to old flag usage, this is to assist
10001 people who produce Makefiles and hope that the Makefiles will be
10004 * class.cs (TypeContainer.EmitType): Moved the definition of the
10005 special $PRIVATE$ field from the resolve phase to the Emit phase.
10006 During resolve we do not know if we are a struct with
10007 HasExplicitLayout, we know this only after the attributes for the
10010 Set the FieldOffset to zero on the dummy field that we create for
10011 the class. Fixes 74590.
10013 2005-04-16 Raja R Harinath <rharinath@novell.com>
10016 * ecore.cs (PropertyExpr.resolved): New.
10017 (DoResolve): Use it to handle a case of double resolution here.
10018 Handle a case of identical-name-and-type-name.
10019 * expression.cs (ArrayCreation.CheckIndices): Avoid double
10020 resolution by storing the results of expression resolution back
10021 into the "probes" array.
10023 2005-04-15 Raja R Harinath <rharinath@novell.com>
10025 Fix cs0208-7.cs and cs0208-8.cs.
10026 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
10027 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
10028 error reporting to point out the reason a struct is not unmanaged.
10030 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
10032 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
10033 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
10035 2005-04-13 Raja R Harinath <rharinath@novell.com>
10038 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
10039 IdenticalNameAndTypeName here.
10040 (EventExpr.InstanceResolve): Likewise.
10042 2005-04-13 Marek Safar <marek.safar@seznam.cz>
10044 C# 2.0 DefaultCharSetAttribute implementation
10046 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
10047 which allows us to set GlobalNamespace for every resolve.
10048 (Attribute.ResolveArguments): Cut from Resolve.
10049 (Attribute.GetCharSetValue): Returns CharSet named argument.
10050 (Attribute.DefinePInvokeMethod): Gets default charset from
10052 (GlobalAttribute.ResolveAsTypeStep): Override.
10053 (GlobalAttribute.ResolveArguments): Override.
10055 * class.cs (TypeAttr): Is protected.
10057 * codegen.cs (ModuleClass.DefaultCharSet): New member.
10058 (ModuleClass.DefaultCharSetType): New memeber.
10059 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
10061 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
10062 charset from module.
10064 * delegate.cs (TypeAttr): Override.
10065 (Delegate.DefineType): Use this TypeAttr.
10067 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
10068 at very early stage (before types are defined) to resolve model
10069 module attributes. It will probably not work with corlib but it
10072 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
10073 charset from module.
10075 * typemanager.cs (default_charset_type): New type.
10077 2005-04-13 Raja R Harinath <rharinath@novell.com>
10079 * decl.cs (MemberCache.AddMethods): Don't warn if
10080 System.Object.Finalize has buggy MethodAttributes.
10082 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
10085 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
10087 * doc.cs : detect ambiguous reference to overloaded members.
10088 Fixed bug #71603. MS 1.1 csc does not detect it.
10090 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
10092 * doc.cs : delegates must not be referenced with parameters.
10095 2005-04-12 Miguel de Icaza <miguel@novell.com>
10097 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
10099 2005-04-10 Miguel de Icaza <miguel@novell.com>
10101 * driver.cs (MainDriver): Stop processing if the CLS stage found
10104 (CompilerCallableEntryPoint.InvokeCompiler): Always
10105 reset after execution; Take a TextWriter argument for the
10108 * report.cs: Use the error stream instead of hardcoding stderr.
10110 2005-04-09 Miguel de Icaza <miguel@novell.com>
10112 * class.cs: Reduce code paths to test, too small of an
10113 optimization to make it worth the extra testing. Always perform
10116 2005-04-08 Raja R Harinath <rharinath@novell.com>
10119 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
10120 operators that had errors reported on them.
10122 2005-04-08 Marek Safar <marek.safar@seznam.cz>
10124 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
10126 (Attribute.Resolve): Add named argument type checking.
10128 * class.cs (FixedField.Define): Use IsPrimitiveType
10130 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
10132 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
10133 unsafe parameter types.
10135 * statement.cs (Using.ResolveExpression): Add better error description.
10137 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
10139 2005-04-08 Raja R Harinath <rharinath@novell.com>
10142 * attribute.cs (Attribute.GetAttributeUsage): Resolve
10143 AttributeUsageAttribute in the emitcontext of the attribute class,
10144 not in the emitcontext of the attributable entity it was attached to.
10145 * cs-parser.jay: Use 'current_class', not 'current_container',
10146 when creating a GlobalAttribute.
10148 2005-04-08 Alp Toker <alp@atoker.com>
10150 * pending.cs: The fix to #58413 failed to compile methods implementing
10151 interfaces with/without params modifiers and vice versa, even though
10152 params modifiers aren't part of the signature. Make the modifier check
10153 less strict as in csc.
10155 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
10156 Anoob V E <projectmonokochi@rediffmail.com>
10157 Harilal P R <projectmonokochi@rediffmail.com>
10160 * pending.cs (TypeAndMethods.mods): New. Store the parameter
10161 modifiers of pending methods.
10162 (PendingImplementation.PendingImplementation): Initialize it.
10163 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
10164 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
10165 with ParameterData. Add check for modifiers.
10166 * class.cs (MethodData.Define): Update to changes.
10168 2005-04-07 Raja R Harinath <rharinath@novell.com>
10170 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
10172 2005-04-07 Marek Safar <marek.safar@seznam.cz>
10174 * class.cs (PropertyMethod.Define): Check private accessor in abstract
10177 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
10180 * typemanager.cs: Registered RequiredAttributeAttribute.
10182 2005-04-06 Marek Safar <marek.safar@seznam.cz>
10184 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
10185 Warning CS0169 is back at level 3.
10186 (IMethodData.SetMemberIsUsed): New method.
10188 * decl.cs (IsUsed): New value; moved from FieldBase.Status
10189 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
10191 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
10193 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
10195 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
10198 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
10201 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
10202 to avoid the problems with nested types.
10204 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
10205 Anoob V.E <projectmonokochi@rediffmail.com>
10206 Harilal P.R <projectmonokochi@rediffmail.com>
10207 Raja R Harinath <rharinath@novell.com>
10210 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
10212 * typemanager (GetConstructor): Make public.
10214 2005-04-05 John Luke <john.luke@gmail.com>
10215 Raja R Harinath <rharinath@novell.com>
10218 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
10219 struct too. Return false quicker in a few cases.
10220 (VerifyUnManaged): Use it.
10222 2005-04-05 Raja R Harinath <rharinath@novell.com>
10225 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
10226 not 'unreachable_seen'.
10228 2005-04-04 Marek Safar <marek.safar@seznam.cz>
10230 * attribute.cs (Attribute.GetValue): Removed unused.
10232 * codegen.cs (CodeGen.TrimExt): Removed unused.
10234 * cs-parser.jay (output): Removed unused.
10236 * cs-tokenizer.cs (hex_digits): Removed unused.
10238 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
10240 * expression.cs (Indirection.LoadExprValue): Removed unused.
10241 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
10243 * iterators.cs (Iterator.param_types): Removed unused.
10245 * statement.cs (Goto.block): Removed unused.
10246 (ToplevelBlock.did): Removed unused.
10247 (Switch.ResolveConstantSwitch): Removed unused.
10249 2005-04-01 Ben Maurer <bmaurer@ximian.com>
10251 * rootcontext.cs: Allow mcs to bootstrap with the compilation
10254 2005-04-01 Raja R Harinath <rharinath@novell.com>
10256 Fix #74232 and cs0208-3.cs.
10257 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
10258 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
10259 unmanaged type. Don't use FieldBuilders when 't' is a
10260 TypeBuilder. Use ModFlags and MemberType fields.
10261 * class.cs (MemberBase.member_type): Rename from MemberType.
10262 (MemberBase.MemberType): New property. Determines member_type on
10264 (MemberBase.DoDefine): Don't initialize MemberType here.
10265 (FieldMember.Define): Likewise.
10267 2005-04-01 Marek Safar <marek.safar@seznam.cz>
10270 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
10271 Attributes are emitted there.
10273 2005-04-01 Raja R Harinath <rharinath@novell.com>
10275 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
10276 keyword in 'partial enum' too.
10277 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
10279 Report from Kamil Skalski <nazgul@omega.pl>.
10282 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
10283 have partial containers too.
10285 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
10286 in block' checks to Block.CheckInvariantMeaningInBlock.
10287 * statement.cs (Block.GetKnownVariableInfo): Make private.
10288 (Block.IsVariableUsedInChildBlock): Remove.
10289 (Block.IsVariableUsedInBlock): Likewise.
10290 (Block.CheckInvariantMeaningInBlock): New. Show location of
10291 conflicting declaration.
10292 (Block.AddVariable): Make error messages less long-winded and more
10293 specific. Show location of conflicting declaration.
10294 * parameter.cs (Parameters.Location): New readonly property.
10296 2005-03-31 Raja R Harinath <rharinath@novell.com>
10298 Clean up semantics of invoking ResolveMemberAccess.
10299 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
10300 can have an instance, ensure that we pass in a non-TypeExpression
10301 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
10302 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
10303 argument. Update to changes and simplify.
10304 (FieldExpr.Emitinstance): Remove CS0120 check.
10305 (PropertyExpr.EmitInstance): Likewise.
10306 * expression.cs (Argument.Resolve): Likewise.
10307 (Invocation.DoResolve): Update to changes in semantics of
10308 InstanceExpression.
10310 2005-03-31 Marek Safar <marek.safar@seznam.cz>
10313 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
10316 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
10318 2005-03-31 Raja R Harinath <rharinath@novell.com>
10320 Fix difference in behaviour with commandline invocation.
10321 * driver.cs (Driver.Reset): New.
10322 (CompilerCallableEntryPoint): Call it.
10324 * statement.cs (If.Resolve): Avoid spurious "uninitialized
10325 variable" warnings if the boolean expression failed to resolve.
10327 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
10329 * attribute.cs: Fix the union of several permissions when some of them
10330 are unrestricted (so the result isn't an unrestricted permission set).
10333 2005-03-30 Raja R Harinath <rharinath@novell.com>
10335 * ecore.cs (MemberExpr): New class. Convert from interface
10337 (MemberExpr.ResolveMemberAccess): Refactor and move here from
10338 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
10340 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
10341 (MethodGroupExpr.IsExplicitImpl): Remove.
10342 (Expression.GetFieldFromEvent): Remove.
10343 (SimpleName.MemberStaticCheck): Remove.
10344 (SimpleName.DoSimpleNameResolve): Update to changes.
10345 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
10346 (MemberAccess.IdenticalNameAndTypeName): Remove.
10347 (MemberAccess.error176): Move to MemberExpr.
10348 (MemberAccess.DoResolve): Update to changes.
10349 (BaseAccess.DoResolve): Likewise.
10351 2005-03-30 Marek Safar <marek.safar@seznam.cz>
10353 C# 2.0 Conditional attribute class implementation
10355 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
10356 Analyzes class whether it has attribute which has ConditionalAttribute
10357 and its condition is not defined.
10359 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
10360 (Class.IsExcluded): New method. Search for at least one defined
10361 condition in ConditionalAttribute of attribute class.
10363 2005-03-30 Raja R Harinath <rharinath@novell.com>
10365 * ecore.cs (PropertyExpr): Derive from Expression, not
10366 ExpressionStatement.
10367 (PropertyExpr.EmitStatement): Remove.
10369 2005-03-29 Raja R Harinath <rharinath@novell.com>
10372 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
10373 internal field "value__" of an enum be private. The examples for
10374 "value__" that I found on MSDN all used FieldAttributes.Private.
10376 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
10377 Don't mention IL method attribute names.
10379 Fix #47991. Remove a TODO.
10380 * statement.cs (Block.Toplevel): Make into a field.
10381 (Block.Parameters): Move into ToplevelBlock.
10382 (Block.known_variables): Rename from child_variable_names.
10383 (Block.Block): Remove variants that take Parameters. Initialize
10384 'Toplevel' with the immediately surrounding toplevel block.
10385 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
10386 LocalInfo parameter.
10387 (Block.GetKnownVariableInfo): New.
10388 (Block.IsVariableNameUsedInChildBlock): Update.
10389 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
10390 the block, even though it may not be in scope.
10391 (Block.AddVariable): Remove Parameters parameter. Use
10392 Toplevel.Parameters instead.
10393 (Block.AddConstant): Remove Parameters parameter.
10394 (Block.GetParameterReference): Update to use Toplevel.Parameters.
10395 (Block.IsParamaterReference): Likewise.
10396 (Block.IsLocalParameter): Likewise. Simplify a lot.
10397 (ToplevelBlock.Parameters): New. Moved from Block.
10398 (ToplevelBlock.ToplevelBlock): Update to changes. Always
10399 initialize Parameters to a non-null value.
10400 * cs-parser.jay: Update to changes.
10401 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
10402 simple names that mean different things in the same block. Use
10403 Block.IsVariableNameUsedInBlock.
10405 2005-03-28 Raja R Harinath <rharinath@novell.com>
10407 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
10408 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
10409 GetTypeHandle. It is possible for a reflected type to derive from
10410 a TypeBuilder (e.g., int[] derives from the TypeBuilder
10411 System.Array during mscorlib compilation).
10412 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
10413 contain a method_hash, don't create one either. Don't create a
10414 deep copy of the base cache's method_hash.
10415 (MemberCache.SetupCache): Rename back from DeepCopy.
10416 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
10417 already initialized. If we see an override function, add its
10418 underlying base virtual function to the member_hash too.
10420 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
10422 2005-03-26 Raja R Harinath <harinath@acm.org>
10425 * assign.cs (Assign.DoResolve): When the RHS of an assignment
10426 fails to resolve, ensure that the LHS is still resolved as an
10429 2005-03-25 Raja R Harinath <harinath@acm.org>
10431 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
10433 (Enum.current_ec): Remove.
10434 (Enum.LookupEnumValue): Remove EmitContext argument.
10435 Just uses the one created during DefineType.
10436 (Enum.FindMembers): Update.
10437 * expression.cs (MemberAccess.DoResolve): Update.
10439 2005-03-22 Marek Safar <marek.safar@seznam.cz>
10441 * assign.cs (Assign.DoResolve): Check for CS1717 when
10442 source and target are same (uses Equals).
10444 * expression.cs (LocalVariableReference, ParameterReference,
10445 This): Implemented Equals, GetHashCode.
10447 * statement.cs (Block.GetParameterReference): Removed useless
10450 2005-03-22 Raja R Harinath <rharinath@novell.com>
10453 * statement.cs (Block.AddVariable): Ensure that we skip implicit
10454 blocks before deciding whether the error is cs0136 or cs0128.
10456 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
10457 (using_alias_directive, using_namespace_directive): Pass
10458 MemberName, not an expression to Namespace.UsingAlias and
10460 (MakeName): Use the MemberName of the namespace.
10461 * namespace.cs (Namespace.MemberName): New.
10462 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
10463 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
10465 * decl.cs (MemberName.Name): Make readonly.
10466 (MemberName.FromDotted): New "constructor".
10467 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
10468 (MemberCore.Name): Compute from MemberName on demand.
10469 (MemberCore.SetMemberName): Provide a way to change the
10471 (MemberCore.AddToContainer): Don't take a fullname parameter.
10472 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
10473 fully qualified name of the container to the member name.
10474 (TypeContainer.AddToTypeContainer): Use a fully qualified name
10475 only if the type is a member of the root container.
10476 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
10477 MemberName.Left rather than searching for an embedded ".".
10478 (PartialContainer.CreatePart): Update to changes in RootContext.
10479 (MemberBase.ShortName): Turn into a property. Use
10480 MemberCore.SetMemberName.
10481 (MemberBase.ExplicitInterfaceName): Remove.
10482 (MemberBase.UpdateMemberName): Remove.
10483 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
10484 (PropertyBase.SetMemberName): New override.
10485 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
10486 (Tree.GetDecl): New.
10487 (Tree.AllDecls): Rename from Decls.
10488 * attribute.cs, enum.cs, report.cs: Update to changes.
10489 * driver.cs (MainDriver): Use MemberName.FromDotted on
10490 RootContext.MainClass.
10492 2005-03-21 Marek Safar <marek.safar@seznam.cz>
10494 * class.cs (FixedField.Define): Check for CS1664 and more sanity
10497 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
10499 2005-03-18 Marek Safar <marek.safar@seznam.cz>
10501 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
10502 property accessor modifiers.
10504 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
10505 fixed buffer attribute (CS1716).
10506 (PropertyMethod.HasCustomAccessModifier): When property accessor
10507 has custom modifier.
10509 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
10511 (PropertyExpr.DoResolveLValue): Add CS0272.
10513 2005-03-17 Miguel de Icaza <miguel@novell.com>
10515 * convert.cs: When converting to a pointer, use the proper Conv.U
10516 or Conv.I depending on the source data type.
10518 * cs-tokenizer.cs: Make the size for large decimal constants,
10521 2005-03-17 Martin Baulig <martin@ximian.com>
10523 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
10524 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
10526 2005-03-17 Martin Baulig <martin@ximian.com>
10528 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
10529 to bool so we can return an error condition.
10530 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
10533 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
10535 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
10538 2005-03-16 Raja R Harinath <rharinath@novell.com>
10540 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
10541 Refactor to avoid traversing the list of assemblies, and to avoid
10542 string concatenation.
10543 * typemanager.cs (guid_attr_type): Remove.
10544 (negative_hits, pointers, references): Remove hashes.
10546 (GetConstructedType): New. Uses type_hash to handle constructed
10547 types (arrays, references, pointers).
10548 (GetReferenceType, GetPointerType): Use it.
10549 (GetNestedType): New. Uses type_hash to handle nested types of
10551 (LookupType, LookupTypeDirect): Remove.
10552 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
10553 'types' hash and LookupTypeReflection directly.
10554 (params_string, params_object): Use GetConstructedType.
10555 * namespace.cs (Namespace.cached_types): New. Cache of reflected
10557 (Namespace.Lookup): Use cached_types.
10558 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
10559 provided by old TypeManager.LookupType.
10560 * rootcontext.cs (MakeFQN): Remove.
10561 * decl.cs (DeclSpace.MakeFQN): Likewise.
10562 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
10563 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
10564 TypeManager.GetConstructedType.
10565 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
10567 2005-03-15 Marek Safar <marek.safar@seznam.cz>
10569 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
10572 * cs-parser.jay: Reports CS1527 for any namespace element.
10574 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
10577 * expression.cs (ParameterReference.IsAssigned): Changed error to
10579 (Error_WrongNumArguments): Moved CS0245 detection here.
10581 * statement.cs (Return.Resolve): Add CS1622 report.
10583 2005-03-11 Marek Safar <marek.safar@seznam.cz>
10585 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
10587 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
10589 * attribute.cs expression.cs: Get rid of some allocations.
10591 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
10593 * doc.cs : just eliminate the latest change.
10595 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
10597 * doc.cs : commented out the latest change. It breaks xml-030.cs
10599 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
10601 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
10602 fail. So invoke CreateType() in FindDocumentedType().
10604 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
10606 * cs-tokenizer.cs : added IsKeyword().
10607 * doc.cs : Detect keyword incorrectly used as identifier.
10608 Allow identifiers prefixed by @.
10610 2005-03-10 Marek Safar <marek.safar@seznam.cz>
10612 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
10613 It caused exception in namespace resolving (again!).
10615 * class.cs (Class.ctor): Removed exit.
10616 (PropertyMethod.ctor): ditto.
10618 * codegen.cs (Codegen.Reset): Reset static data.
10619 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
10621 * cs-tokenizer.cs (Cleanup): Removed.
10623 * driver.cs (GetSystemDir): Rewrote to one line command.
10624 It caused problem with unloaded dynamic modules.
10625 (UnixParseOption): Removed Exit.
10626 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
10627 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
10628 Now can be mcs used as library.
10630 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
10633 * location.cs (Reset): Reset static data.
10635 * namespace.cs (Reset): Reset static data.
10637 * report.cs (Report.Reset): Reset static data.
10639 * rootcontext.cs (RootContext.Reset): Reset static data.
10641 * tree.cs (RootTypes.ctor): Use Location.Null
10643 * typemanager.cs (TypeManager.Reset): Reset static data.
10644 (CoreLookupType): Removed Exit.
10645 (TypeHandle.Reset): Reset static data.
10647 2005-03-10 Raja R Harinath <rharinath@novell.com>
10650 * typemanager.cs (ComputeNamespaces): Import namespaces from
10651 referenced modules too.
10653 2005-03-09 Raja R Harinath <rharinath@novell.com>
10655 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
10658 2005-03-09 Raja R Harinath <rharinath@novell.com>
10660 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
10661 enclosing DeclSpace. This ensures that a name-lookup populates
10662 more caches and there are fewer 'TypeExpression's. Carve out
10663 nested type lookup into ...
10664 (LookupNestedTypeInHierarchy): ... this.
10666 2005-03-09 Raja R Harinath <rharinath@novell.com>
10668 Clean up a few partial-class semantics.
10669 Fixes test-357.cs and cs1618-2.cs.
10670 * cs-parser.jay (struct_declaration): Use 'current_class' as
10671 parent of newly-created struct. Remove call to Register ().
10672 Use 'pop_current_class' to complete handing the current struct.
10673 (interface_declaration): Likewise.
10674 (class_declaration): Likewise.
10675 (enum_declaration): Use 'current_class' as parent of newly created
10677 (delegate_declaration): Likewise.
10678 (pop_current_class): New function. This is used to handle closing
10679 up the 'current_class' and 'current_container', and pointing them
10680 to the enclosing class/container.
10681 (CSharpParser): Initialize 'current_class' too.
10682 * decl.cs (MemberCore): Add check for invariant: a partial
10683 container is not a parsed entity, and thus does not enclose any
10685 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
10686 (DeclSpace.BaseTypeExpr): Use it.
10687 (DeclSpace.LookupType): Add check for invariant.
10688 * class.cs (TypeContainer): Add check for invariant: a nested
10689 class should have the same NamespaceEntry as its enclosing class.
10690 (TypeContainer.EmitFieldInitializers): Make virtual.
10691 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
10693 (TypeContainer.Register): Remove.
10694 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
10695 null. Use TypeResolveEmitContext for resolving base types and
10696 interfaces. Move initialization of Parts.TypeBuilder here from
10698 (TypeContainer.DefineNestedTypes): ... here.
10699 (PartialContainer): Take a Namespace not a NamespaceEntry.
10700 (PartialContainer.Create): Don't use Register. Call the
10701 appropriate Add... function directly.
10702 (ClassPart): Take both the PartialContainer and the enclosing
10703 class as constructor arguments.
10704 (ClassPart.EmitFieldInitializers): Override.
10705 (ClassPart.PartFindNestedTypes): Remove.
10706 (FieldBase.GetInitializerExpression): Resolve the initializer
10707 expression in the emit context of the enclosing class.
10708 * tree.cs (RootTypes): Remove Register ().
10710 2005-03-08 Marek Safar <marek.safar@seznam.cz>
10712 * cs-parser.jay: Removed CS0134.
10714 * driver.cs: Removed CS1901.
10716 * expression.cs (SizeOf.DoResolve): Don't report CS0233
10717 for predefined types.
10719 2005-03-07 Duncan Mak <duncan@novell.com>
10721 * codegen.cs (Save): Catch UnauthorizedAccessException as
10722 well. Fixes bug #73454.
10724 2005-03-07 Marek Safar <marek.safar@seznam.cz>
10726 * cs-tokenizer.cs (xtoken): Add CS1035.
10728 * class.cs (MethodData.Define): Add CS0683.
10729 (FieldMember.ctor): Add CS0681.
10731 2005-03-07 Raja R Harinath <rharinath@novell.com>
10733 * ecore.cs (SimpleName.DoResolve): Rename from
10734 SimpleName.DoResolveAllowStatic.
10735 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
10736 Pass 'intermediate' flag to MemberStaticCheck.
10737 (SimpleName.MemberStaticCheck): Skip "static check" only in case
10738 of "intermediate" lookups via MemberAccess.
10739 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
10740 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
10742 2005-03-07 Raja R Harinath <rharinath@novell.com>
10745 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
10746 slipped in because of variable names that are identical to a
10747 builtin type's BCL equivalent ('string String;', 'int Int32;').
10748 (PropertyExpr.EmitInstance): Likewise.
10750 2005-03-04 Marek Safar <marek.safar@seznam.cz>
10752 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
10754 * report.cs (warning_ignore_table): Made public.
10756 2005-03-04 Raja R Harinath <rharinath@novell.com>
10759 * class.cs (MethodData.Emit): Pass 'container' to
10760 container.GetObsoleteAttribute instead of 'container.Parent'.
10762 2005-03-03 Marek Safar <marek.safar@seznam.cz>
10764 * cs-parser.jay: Add 1534 error test.
10766 * iterators.cs (Yield.CheckContext): Add error 1629.
10767 (Iterator.ctor): Save unsafe modifier.
10768 (MoveNextMethod.DoEmit): Restore unsafe context.
10770 * namespace.cs (UsingAlias): Better error message.
10772 2005-03-03 Dan Winship <danw@novell.com>
10774 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
10775 the warning message [#73219]
10777 2005-03-03 Raja R Harinath <rharinath@novell.com>
10779 Fix compile with MCS 1.0.0.0.
10780 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
10781 w_restore to not depend on string constant folding.
10783 2005-03-03 Raja R Harinath <rharinath@novell.com>
10785 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
10786 CS0246 check to users who passed 'silent = false'.
10787 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
10789 (SimpleName.SimpleNameResolve): Update.
10790 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
10791 (MemberAccess.IdenticalNameAndTypeName): Update.
10792 * doc.cs (FindDocumentedTypeNonArray): Update.
10794 2005-03-03 Raja R Harinath <rharinath@novell.com>
10796 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
10797 * parameters.cs (ComputeAndDefineParameters): Remove.
10798 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
10799 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
10800 Use GetParameterInfo.
10802 2005-03-02 Marek Safar <marek.safar@seznam.cz>
10804 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
10806 2005-03-02 Raja R Harinath <rharinath@novell.com>
10808 Unify DeclSpace.LookupType and DeclSpace.FindType.
10809 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
10810 is in charge of defining nested types on demand.
10811 (DeclSpace.LookupType): Use it when the current_type is a
10812 TypeBuilder. Use LookupTypeDirect for reflected types.
10813 (DeclSpace.FindType): Remove.
10814 (DeclSpace.LookupInterfaceOrClass): Likewise.
10815 (DeclSpace.DefineTypeAndParents): Likewise.
10816 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
10817 DeclSpace.LookupType.
10818 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
10819 * typemanager.cs (LookupType): Simplify.
10820 (AddUserType): Remove type from negative_hits.
10821 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
10822 * class.cs (TypeContainer.FindMembers): Move handling of nested
10824 (TypeContainer.FindMembers_NestedTypes): ... here.
10825 (TypeContainer.FindNestedType): Implement override.
10826 (ClassPart.FindNestedType): Delegate to PartialContainer.
10827 (ClassPart.PartFindNestedType): Looks up the nested types of the
10830 2005-03-02 Martin Baulig <martin@ximian.com>
10832 * class.cs (TypeContainer.DoDefineMembers): We also need a default
10833 static constructor in static classes.
10835 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
10837 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
10838 sizeParamIndex is not specified.
10840 2005-03-01 Marek Safar <marek.safar@seznam.cz>
10843 * report.cs (WarningMessage.IsEnabled): Missing null check.
10845 2005-02-28 Marek Safar <marek.safar@seznam.cz>
10847 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
10848 in the fields and not in the properties.
10850 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
10852 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
10855 2005-02-28 Marek Safar <marek.safar@seznam.cz>
10857 * attribute.cs: Small refactoring (improved robustness).
10858 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
10859 (ValidateGuid): Removed.
10860 (Resolve): Removed referenced to above mentioned.
10861 (GetAttributeUsage): Made private and changed to work without
10863 (GetIndexerAttributeValue): Don't crash.
10864 (GetConditionalAttributeValue): Ditto.
10865 (GetClsCompliantAttributeValue): Ditto.
10866 (ExtractSecurityPermissionSet): All attributes exceptions are
10868 (GetPropertyValue): New helper.
10869 (GetMethodImplOptions): New method.
10870 (DefinePInvokeMethod): Reuse common code. Implemented handling of
10871 some missing properties.
10873 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
10874 (Method.ApplyAttributeBuilder): Updated.
10876 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
10879 2005-02-28 Raja R Harinath <rharinath@novell.com>
10882 * report.cs (Report.SymbolRelatedToPreviousError): Handle
10883 non-simple types (array, pointer, reference).
10885 2005-02-28 Marek Safar <marek.safar@seznam.cz>
10887 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
10889 * class.cs (MethodCore.IsDuplicateImplementation): Special error
10891 (Method.CheckBase): Catch wrong destructor here.
10892 (MethodData.Define): Add errors 550, 668.
10894 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
10896 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
10898 * pending.cs (VerifyPendingMethods): Add error 551.
10900 * typemanager.cs (CSharpName): Next error report helper.
10902 2005-02-25 Marek Safar <marek.safar@seznam.cz>
10904 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
10905 attributes. Removed useless attribute double check.
10906 It saves almost 2MBs for corlib.
10908 2005-02-25 Raja R Harinath <rharinath@novell.com>
10911 * statement.cs (ExpressionStatement.Resolve): Make robust to being
10912 called twice in case of error.
10914 2005-02-23 Chris Toshok <toshok@ximian.com>
10916 Fix compiler portions of #72827.
10917 * statement.cs (Block.Emit): call Begin/EndScope on the
10918 EmitContext instead of the ILGenerator.
10920 * codegen.cs (EmitContext.BeginScope): new method, call
10921 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
10923 (EmitContext.BeginScope): same, but EndScope and CloseScope
10925 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
10926 offset and call the superclass's OpenScope(int) with it.
10927 (SymbolWriter.CloseScope): get the current il
10928 offset and call superclass's CloseScope(int) with it.
10930 2005-02-23 Marek Safar <marek.safar@seznam.cz>
10932 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
10933 CS1677 for out and ref as well.
10935 * class.cs (Method.Define): Add error CS1599 detection.
10937 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
10939 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
10941 * delegate.cs (Delegate.Define): Add error CS1599 detection.
10943 * support.cs.cs (ModifierDesc): New helper method.
10945 2005-02-23 Raja R Harinath <rharinath@novell.com>
10946 Abin Thomas <projectmonokochi@rediffmail.com>
10947 Anoob V E <projectmonokochi@rediffmail.com>
10948 Harilal P R <projectmonokochi@rediffmail.com>
10950 Fix #57851, #72718.
10951 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
10952 MemberLookup (used for error reporting) actually returns a result.
10953 Fix error report number (122, not 112).
10955 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
10956 Anoob V E <projectmonokochi@rediffmail.com>
10957 Harilal P R <projectmonokochi@rediffmail.com>
10960 * pending.cs (PendingImplementation.GetAbstractMethods):
10961 Find NonPublic members too.
10963 2005-02-22 Marek Safar <marek.safar@seznam.cz>
10965 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
10968 * class.cs (MethodCore.CheckMethodAgainstBase):
10969 Add error 239 report.
10971 2005-02-21 Raja R Harinath <rharinath@novell.com>
10974 * expression.cs (Invocation.IsApplicable): Make public.
10975 (Invocation.IsParamsMethodApplicable): Likewise.
10976 * delegate.cs (Delegate.VerifyApplicability): Don't use
10977 Invocation.VerifyArgumentCompat for parameter applicability
10978 testing. Use Invocation.IsApplicable and
10979 Invocation.IsParamsMethodApplicable.
10981 2005-02-21 Marek Safar <marek.safar@seznam.cz>
10983 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
10985 * class.cs (Operator.Define): Add error 217 report.
10987 2005-02-21 Raja R Harinath <rharinath@novell.com>
10989 * namespace.cs (UsingEntry.Resolve): Undo change below.
10991 2005-02-21 Raja R Harinath <rharinath@novell.com>
10994 * ecore.cs (Expression.MemberLookupFailed): Add argument to
10995 disable the error message when the extended MemberLookup also
10997 (Expression.MemberLookupFinal): Update.
10998 (SimpleName.DoSimpleNameResolve): Update.
10999 * expression.cs (MemberAccess.ResolveNamespaceOrType):
11000 Don't use MemberLookupFinal.
11001 (New.DoResolve): Update.
11002 (BaseAccess.CommonResolve): Update.
11004 2005-02-21 Raja R Harinath <rharinath@novell.com>
11007 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
11008 occured previously, don't resolve again.
11010 2005-02-21 Marek Safar <marek.safar@seznam.cz>
11013 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
11014 argument. Call ResolveAttributeUsage for unresolved.
11015 when types doesn't match ctor arguments.
11017 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
11018 for nested attribute classes.
11019 (Class.attribute_usage): Removed.
11020 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
11021 for attribute class.
11023 * ecore.cs (IsAttribute): Removed.
11025 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
11027 * rootcontext.cs (RegisterAttribute): Removed, attributes are
11029 (attribute_types): Removed.
11030 (EmitCode): Global attributes are emited as the latest.
11032 2005-02-18 Marek Safar <marek.safar@seznam.cz>
11034 * class.cs (EmitFieldInitializers): Don't emit field initializer
11035 for default values when optimilization is on.
11037 * constant.cs (Constant.IsDefaultValue): New property.
11039 * driver.cs: Add /optimize handling.
11043 * literal.cs: Implement new IsDefaultValue property.
11045 * rootcontext.cs (Optimize): New field, holds /optimize option.
11047 2005-02-18 Raja R Harinath <rharinath@novell.com>
11049 Fix crasher in re-opened #72347.
11050 * namespace.cs (Namespace.Lookup): Return null if
11051 DeclSpace.DefineType returns null.
11054 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
11056 2005-02-18 Raja R Harinath <rharinath@novell.com>
11058 Fix remainder of #63202. Change semantics of DoResolveLValue: it
11059 now returns null if it cannot resolve to an lvalue.
11060 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
11061 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
11062 returned null. Remove check for SimpleName.
11063 (EventExpr.DoResolveLValue): New.
11064 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
11065 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
11067 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
11068 avoid CS0131 error.
11069 (Unary.ResolveOperator): Move CS0211 check ...
11070 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
11072 (Unary.DoResolveLValue): Simplify.
11073 (AddressOf.DoResolveLValue): New.
11074 (ArrayAccess.DoResolveLValue): New.
11076 2005-02-16 Marek Safar <marek.safar@seznam.cz>
11078 * attribute.cs (Attribute.Resolve): Add arguments casting for
11079 when types doesn't match ctor arguments.
11081 2005-02-16 Raja R Harinath <rharinath@novell.com>
11083 Fix parts of #63202.
11084 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
11085 lookup of operator in base type. Ensure that all checks happen
11086 when the operator resolves to an "op_..." method.
11088 2005-02-15 Raja R Harinath <rharinath@novell.com>
11091 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
11092 'ignore_cs0104' parameter. Pass it to ...
11093 (NamespaceEntry.Lookup): ... this.
11094 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
11095 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
11096 (TypeLookupExpression.DoResolveAsTypeStep): Update.
11097 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
11098 Update. Request that cs0104 errors be ignored.
11099 (ComposedCast.ResolveAsTypeStep): Update.
11101 2005-02-14 Raja R Harinath <rharinath@novell.com>
11104 * expression.cs (Invocation.BetterFunction): Remove support for
11105 comparing virtual functions and their overrides.
11106 (Invocation.IsOverride): New.
11107 (Invocation.OverloadResolve): Don't consider 'override' functions
11108 during candidate selection. Store them in a lookaside list.
11109 If the selected method is a 'virtual' function, use the list to
11110 find any overrides that are closer to the LHS type.
11112 2005-02-14 Marek Safar <marek.safar@seznam.cz>
11114 * expression.cs (New.DoResolve): Add complex core type reduction.
11115 (New.Constantify): Converts complex core type syntax like 'new int ()'
11116 to simple constant.
11118 2005-02-14 Raja R Harinath <rharinath@novell.com>
11120 * decl.cs (EntryType.EntryType): New constructor to create an
11121 updated copy of a cache entry.
11122 (MemberCache.AddMethods): Use it.
11123 (MemberCache.ClearDeclaredOnly): Remove.
11124 (MemberCache.MemberCache): Update.
11126 2005-02-11 Miguel de Icaza <miguel@novell.com>
11128 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
11129 variable. This one is represents the actual low-level declaration
11130 of the method, as opposed to the semantic level `IsStatic'.
11132 An anonymous method which is hosted into a static method might be
11133 actually an instance method. IsStatic would reflect the
11134 container, while MethodIsStatic represents the actual code
11137 * expression.cs (ParameterReference): Use the new MethodIsStatic
11138 instead of IsStatic.
11140 * anonymous.cs (AnonymousMethod.Compatible): Pass the
11141 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
11142 set on the current EmitContext.
11144 * expression.cs (Cast): Overload DoResolveLValue so we can pass
11145 resolve our casted expression as an LValue. This triggers the
11146 proper LValue processing that is later required by Assign.
11150 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
11152 2005-02-11 Marek Safar <marek.safar@seznam.cz>
11154 C# 2.0 Fixed buffer implementation
11156 * anonymous.cs: Update after RegisterHelperClass renaming.
11158 * attribute.cs (AttributeTester.fixed_buffer_cache):
11159 Cache of external fixed buffers.
11160 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
11161 implementation if field is fixed buffer else null.
11164 (TypeContainer.AddField): Accept FieldMember instead of Field.
11165 (FieldBase.IsFieldClsCompliant): Extracted code from
11166 VerifyClsCompliance descendant customization.
11167 (FixedField): New class handles fixed buffer fields.
11168 (FixedFieldExternal): Keeps information about imported fixed
11170 (IFixedField): Make access to internal or external fixed buffer
11173 * cs-parser.jay: Add fixed buffer parsing.
11175 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
11178 * expression.cs (Indirection): Extended implementation to accept
11179 fixed buffer field.
11180 (PointerArithmetic.Emit): Get element from fixed buffer as well.
11181 (ElementAccess.MakePointerAccess): Get type as parameter.
11182 (DoResolve): Add fixed buffer field expression conversion.
11183 (DoResolveLValue): Ditto.
11184 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
11185 (ArrayPtr): Derives from FixedBufferPtr.
11186 (ArrayPtr.Emit): Add extra emit for array elements.
11188 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
11190 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
11191 for compiler generated types.
11192 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
11194 * statement.cs (Fixed): Refactored to be easier add fixed buffer
11195 and consume less memory.
11196 (Fixed.Resolve): Add fixed buffer case.
11198 * typemanager.cs (compiler_generated_attr_ctor,
11199 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
11200 (HasElementType): Add our own implementation to work on every
11203 2005-02-11 Miguel de Icaza <miguel@novell.com>
11205 * anonymous.cs (CaptureContext): Track whether `this' has been
11208 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
11209 only captured `this' if it was implicitly done (instance
11210 methods/variables were used).
11212 * codegen.cs (EmitContext.CaptureThis): New method to flag that
11213 `this' must be captured.
11215 2005-01-30 Miguel de Icaza <miguel@novell.com>
11217 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
11218 is null it means that there has been no need to capture anything,
11219 so we just create a sibling.
11221 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
11223 Just a partial fix. The other half is fairly elusive.
11225 2005-02-10 Raja R Harinath <rharinath@novell.com>
11227 Fix #52586, cs0121-4.cs.
11228 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
11229 and return a hashtable.
11230 (MemberCache.ClearDeclaredOnly): New.
11231 (MemberCache.MemberCache): Update to change. Make a deep copy of
11232 the method_hash of a base type too.
11233 (MemberCache.AddMethods): Adapt to having a deep copy of the base
11234 type methods. Overwrite entries with the same MethodHandle so
11235 that the ReflectedType is correct. The process leaves in base
11236 virtual functions and their overrides as distinct entries.
11237 (CacheEntry): Now a class instead of a struct. It shouldn't alter
11238 matters since it was boxed in a ArrayList before.
11239 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
11241 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
11242 case of a virtual function and its override (choose the overload
11244 (Invocation.OverloadResolve): Avoid 'override' members during
11245 'applicable_type' calculation.
11247 2005-02-09 Raja R Harinath <rharinath@novell.com>
11249 Combine two near-redundant caches.
11250 * typemanager.cs (method_params): Rename from method_internal_params.
11251 (TypeManager.GetParameterData): New. Replace
11252 Invocation.GetParameterData.
11253 (TypeManager.LookupParametersByBuilder): Remove.
11254 * expression.cs (Invocation.method_parameter_cache): Remove.
11255 (Invocation.GetParameterData): Remove.
11257 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
11260 2005-02-08 Raja R Harinath <rharinath@novell.com>
11263 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
11264 TypeManager.multicast_delegate_type is null, resolve it by looking
11265 up "System.MulticastDelegate".
11266 * rootcontext.cs (RootContext.ResolveCore): Simplify.
11268 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
11269 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
11270 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
11273 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
11274 (LabeledStatement.AddReference): New. Set 'referenced'.
11275 (Goto.Resolve): Use it.
11277 2005-02-05 John Luke <john.luke@gmail.com>
11279 * driver.cs: remove duplicate -doc line in Usage ()
11281 2005-02-04 Raja R Harinath <rharinath@novell.com>
11283 * location.cs (Location.AddFile): Fix CS2002 error report.
11285 2005-02-02 Martin Baulig <martin@ximian.com>
11287 * delegate.cs (Delegate.DefineType): Report an internal error if
11288 TypeManager.multicast_delegate_type is null. See bug #72015 for
11291 2005-02-02 Raja R Harinath <rharinath@novell.com>
11293 Fix a crasher in a variant of #31984.
11294 * const.cs (Constant.CheckBase): New override that defers the
11295 new-or-override check in case the base type hasn't been populated
11297 (Constant.Define): Ensure the new-or-override check is performed.
11299 2005-02-01 Duncan Mak <duncan@ximian.com>
11301 * const.cs (LookupConstantValue): Check that `ce' is not null
11302 before calling GetValue ().
11304 2005-02-01 Raja R Harinath <rharinath@novell.com>
11306 Fix test-334.cs (#69519).
11307 * cs-parser.jay (using_alias_directive): Pass in an expression to
11308 NamespaceEntry.UsingAlias.
11309 (using_namespace_directive): Pass in an expression to
11310 NamespaceEntry.Using.
11311 (namespace_name): Don't flatten to a string.
11312 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
11313 (NamespaceEntry.AliasEntry.Resolve): Lookup using
11315 (NamespaceEntry.UsingEntry): Likewise.
11316 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
11318 (NamespaceEntry.LookupForUsing): Remove.
11319 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
11321 (NamespaceEntry.Lookup): Remove support for dotted names.
11323 2005-02-01 Raja R Harinath <rharinath@novell.com>
11325 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
11327 (NamespaceEntry.ImplicitParent): Compute on demand.
11328 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
11329 parallels the current.
11330 (NamespaceEntry.LookupForUsing): Use it.
11331 (NamespaceEntry.Lookup): If the current namespace-entry is
11332 implicit, don't search aliases and using tables.
11334 2005-02-01 Raja R Harinath <rharinath@novell.com>
11337 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
11339 (TypeContainer.BaseCache): Compute on demand.
11340 (TypeContainer.FindMembers): Define constants and types if they're
11341 not already created.
11342 (FieldMember.Define): Move resetting of ec.InUnsafe before error
11344 * const.cs (Constant.Define): Make idempotent.
11346 2005-01-29 Miguel de Icaza <miguel@novell.com>
11348 * pending.cs: Produce better code (no nops produced by using Ldarg
11351 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
11352 i - 1' it should be arg + 1.
11356 2005-01-28 Raja R Harinath <rharinath@novell.com>
11358 * attribute.cs (Attribute.CheckAttributeType): Make private
11360 (Attribute.ResolveType): Make virtual.
11361 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
11362 handling of RootContext.Tree.Types.
11364 2005-01-27 Raja R Harinath <rharinath@novell.com>
11366 Update attribute-handling to use the SimpleName/MemberAccess
11368 * cs-parser.jay (attribute): Pass in an expression to the
11369 constructors of Attribute and GlobalAttribute.
11370 * attribute.cs (Attribute): Take an expression for the name.
11371 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
11372 passed in attribute name expression.
11373 (Attribute.CheckAttributeType): Use it.
11374 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
11375 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
11376 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
11377 argument to prevent error messages if the lookup fails.
11379 2005-01-27 Marek Safar <marek.safar@seznam.cz>
11381 * expression.cs (Indirection): Implemented IVariable interface
11382 to support indirection in AddressOf operator.
11383 (PointerArithmetic.Emit): Add optimalization for case where
11384 result can be precomputed.
11386 2005-01-26 Martin Baulig <martin@ximian.com>
11388 * class.cs (TypeContainer.AttributeTargets): Return the correct
11389 AttributeTargets depending on our `Kind' instead of throwing an
11390 exception; fixes #71632.
11392 2005-01-26 Marek Safar <marek.safar@seznam.cz>
11395 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
11398 2005-01-25 Raja R Harinath <rharinath@novell.com>
11401 * expression.cs (MemberAccess.DoResolve): Don't complain with
11402 cs0572 when the LHS of a member access has identical name and type
11405 2005-01-25 Marek Safar <marek.safar@seznam.cz>
11408 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
11410 Create custom PermissionSet only for PermissionSetAttribute.
11412 2005-01-24 Marek Safar <marek.safar@seznam.cz>
11415 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
11416 delegates in static class.
11418 2005-01-24 Martin Baulig <martin@ximian.com>
11420 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11421 merging an implicit block, just use its reachability.
11423 * statement.cs (Block.Resolve): Make the unreachable code check
11424 work wrt. implicit blocks; see test-337 from #63842.
11426 2005-01-21 Alp Toker <alp@atoker.com>
11428 * cs-parser.jay: destructor_declaration's container is PartialContainer
11429 not Class when partial types are used, so use Kind prop instead of
11432 2005-01-22 Miguel de Icaza <miguel@ximian.com>
11434 * cs-parser.jay: Improve error reporting when an interface
11435 declares new types.
11437 2005-01-20 Dick Porter <dick@ximian.com>
11439 * support.cs: SeekableStreamReader fix from Sandor Dobos
11440 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
11441 chars are read. Fixes bug 70369.
11443 2005-01-20 Raja R Harinath <rharinath@novell.com>
11445 * cs-parser.jay (catch_clause): Simplify current_block handling
11448 2005-01-17 Miguel de Icaza <miguel@ximian.com>
11450 * convert.cs (ImplicitStandardConversionExists): Synchronize the
11451 code with ImplicitStandardConversion to handle the implicit
11452 conversion of method groups into valid delegate invocations.
11454 The problem is that in parameter handling we were using this code
11455 path. Fixes bug #64698
11457 2005-01-19 Raja R Harinath <rharinath@novell.com>
11459 * cs-parser.jay: Fix several infelicities.
11460 - Avoid assigning to the parser value stack. Code like
11461 '$3 = null' is unclean. Synthesize a value for the code block
11463 - Avoid using oob_stack for storing location information. Use ...
11464 (_mark_): ... this. New (empty) rule. Saves the current location
11466 (foreach_statement): Avoid using oob_stack for current_block
11467 handling. Use technique used in for_statement and
11468 using_statement. Synthesize a value for the code block to store
11469 additional intermediate information.
11471 2005-01-13 Miguel de Icaza <miguel@ximian.com>
11473 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
11474 of a different type is only allowed to private fields of a
11475 containing type, not on fields of a base class.
11477 See test-174.cs and error cs0122-9.cs
11479 2005-01-13 Raja R Harinath <rharinath@novell.com>
11481 Fix test-335.cs (bug #58126).
11482 * cs-parser.jay (argument): Split out non-expression parts of the
11483 rule into 'non_simple_argument'.
11484 (invocation_expression): Support parenthesized invocations with
11485 multiple arguments, and with single non-simple arguments.
11487 2005-01-13 Raja R Harinath <rharinath@novell.com>
11489 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
11492 2005-01-12 Raja R Harinath <rharinath@novell.com>
11494 Fix cs0038-1.cs, cs1640-6.cs.
11495 * ecore.cs (Expression.Resolve): Remove special-case for
11496 SimpleName in error-handling.
11497 (Expression.almostMatchedMembers): Relax access permission to
11499 (Expression.MemberLookupFailed): Handle duplicates in
11500 almostMatchedMembers list.
11501 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
11502 * expression.cs (New.DoResolve): Report CS1540 for more cases.
11503 * typemanager.cs (GetFullNameSignature): Use the MethodBase
11504 overload if the passed in MemberInfo is a MethodBase.
11506 2005-01-12 Marek Safar <marek.safar@seznam.cz>
11509 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
11510 for non-CAS & merge permission sets properly.
11512 2005-01-11 Raja R Harinath <rharinath@novell.com>
11514 Improve standard-compliance of simple name and member access
11515 resolution. Fixes bugs #52697, #57200, #67520, #69519.
11516 * ecore.cs (FullNamedExpression): New abstract base class
11517 for Namespaces and TypeExpressions.
11518 (ResolveFlags.SimpleName): Remove.
11519 (SimpleName): Remove support for dotted names.
11520 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
11521 DeclSpace.FindType and DeclSpace.LookupType.
11522 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
11523 (Expression.ExprClassName): Make member function.
11524 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
11525 a namespace. Remove creation of dotted "SimpleName"s.
11526 (MemberAccess.DoResolve): Likewise.
11527 * decl.cs (DeclSpace.Cache): Make private.
11528 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
11529 (DeclSpace.FindType): Update.
11530 (DeclSpace.LookupType): Move here from RootContext. Return a
11531 FullNamedExpression.
11532 * namespace.cs (Namespace): Derive from FullNamedExpression
11533 so that it can be part of expression resolution.
11534 (Namespace.Lookup): Return an FullNamedExpression.
11535 (NamespaceEntry.LookupAlias): Lookup aliases only in current
11537 * rootcontext.cs (NamespaceLookup): Remove.
11538 (LookupType): Move to DeclSpace.
11539 * attribute.cs (CheckAttributeType): Update.
11540 * doc.cs (FindDocumentedType): Remove allowAlias argument.
11541 (FindDocumentedTypeNonArray): Likewise.
11543 2005-01-11 Raja R Harinath <rharinath@novell.com>
11545 Fix cs0509.cs, cs1632.cs.
11546 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
11547 is the same as IsInterface.
11548 (TypeContainer.GetClassBases): Likewise.
11549 * statement.cs (LabeledStatement.ig): New field.
11550 (LabeledStatement.LabelTarget): Save ILGenerator which created the
11552 (LabeledStatement.DoEmit): Check that the label was created with
11553 the same ILGenerator.
11555 2005-01-10 Marek Safar <marek.safar@seznam.cz>
11558 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
11559 accessors to its properties.
11561 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
11562 from accessors to property.
11564 2005-01-10 Marek Safar <marek.safar@seznam.cz>
11567 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
11568 only for overrides.
11570 2005-01-08 Miguel de Icaza <miguel@ximian.com>
11572 * attribute.cs: Check for null and empty strings.
11574 I have lost another battle to Paolo.
11576 2005-01-07 Marek Safar <marek.safar@seznam.cz>
11579 * class.cs (PropertyMethod): Set Parent field in ctors.
11580 (SetMethod.InternalParameters): Add unsafe switch hack.
11581 Override MarkForDuplicationCheck where it is appropriate.
11583 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
11584 It says whether container allows members with the same name.
11585 Base default is no.
11586 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
11587 Removed is_method parameter.
11589 2005-01-06 Duncan Mak <duncan@ximian.com>
11591 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
11592 because the previous change led to incorrect reporting of CS1032
11593 ("Cannot define/undefine preprocessor symbols after first token in
11594 file"). Instead of using `tokens_seen' as the only flag that
11595 triggers CS1040, introduce `comments_seen'. This new flag is used
11596 to signify having seen comments on the current line, so it is
11597 unset after a newline.
11599 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
11601 * doc.cs : When searching for a type, find nested type too.
11602 This fixes bug #71040.
11604 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
11607 - Warn missing member comment on those classes which also does not
11608 have doc comments. Fixed bug #71041.
11609 - Don't warn missing doc comment on default constructor.
11612 2005-01-06 Duncan Mak <duncan@ximian.com>
11614 * cs-tokenizer.cs (xtoken): After handling traditional C-style
11615 comments, set `tokens_seen' to true. This allows us to detect
11616 misplaced preprocessor directives (i.e. not at the beginning of
11617 the a line, nor after whitespaces). In that case, report error
11618 CS1040. This fixes bug #56460.
11620 * cs-parser.jay (interface_member_declaration): Add checks for
11621 IsExplicitImpl, and report CS0541 error if an interface member is
11622 defined as an explicit interface declaration.
11624 2005-01-06 Marek Safar <marek.safar@seznam.cz>
11627 * class.cs (PropertyMethod): Set Parent field in ctors.
11628 (SetMethod.InternalParameters): Add unsafe switch hack.
11630 * decl.cs (MemberCore.Parent): Cannot be readonly.
11632 2005-01-06 Raja R Harinath <rharinath@novell.com>
11634 * decl.cs (DeclSpace.ResolveType): Remove.
11635 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
11636 Merge in code from ...
11637 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
11638 * class.cs, enum.cs: Update to changes.
11640 2005-01-06 Miguel de Icaza <miguel@ximian.com>
11642 * anonymous.cs: Ensure that we init the scope of our parent if it
11643 has not been initialized yet.
11645 2004-12-30 Duncan Mak <duncan@ximian.com>
11647 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
11648 if field.FieldBuilder is null. Fixes #70758.
11650 * convert.cs: Fixed some typos and updated some of the comments.
11651 (ImplicitStandardConversionExists):
11652 (TryImplicitIntConversion): If `target_type' is an interface and
11653 the type of `ic' implements this interface, return true or a new
11654 BoxedCast instead of null. This fixes #70468.
11656 2004-12-29 Duncan Mak <duncan@ximian.com>
11658 * expression.cs (Argument.Emit): Check that Expr is
11659 IMemoryLocation before casting to it, and report CS1510 otherwise.
11663 2004-12-21 Ben Maurer <bmaurer@ximian.com>
11665 * statement.cs (Block.ThisVariable): remove the recursion here, to
11666 make the --profile more sane.
11668 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
11670 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
11671 assembly, by JB Evain.
11673 2004-12-17 Raja R Harinath <rharinath@novell.com>
11675 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
11676 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
11677 "parent" refers to enclosing type/class. "base" refers to superclass.
11679 2004-12-17 Raja R Harinath <rharinath@novell.com>
11681 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11682 Ensure that we only have GlobalAttributes.
11683 * attribute.cs (Attribute.Emit): Make non-virtual.
11684 (GlobalAttribute.Emit): Remove.
11685 (Attribute.Resolve): Make virtual.
11686 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
11687 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
11688 the argument. Don't create one.
11689 (Attribute.GetObsoleteAttribute): Likewise.
11690 (Attribute.GetClsCompliantAttributeValue): Likewise.
11691 * class.cs, decl.cs: Update to changes.
11693 2004-12-17 Marek Safar <marek.safar@seznam.cz>
11695 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
11697 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
11699 * statement.cs (Foreach.Resolve): Add error 186 report.
11701 2004-12-16 Marek Safar <marek.safar@seznam.cz>
11703 * expression.cs (Conditional.DoResolve): Add warning 429.
11705 * statement.cs (If.Resolve): Add warning 665.
11707 2004-12-16 Raja R Harinath <rharinath@novell.com>
11709 New invariant: RootContext.Tree.Types.NamespaceEntry == null
11710 except when in the parser, and in GlobalAttribute.
11711 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
11712 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
11713 RootContext.Tree.Types.NamespaceEntry once work is done.
11714 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
11715 and resets RootContext.Tree.Types.NamespaceEntry.
11717 2004-12-15 Marek Safar <marek.safar@seznam.cz>
11719 * cs-parser.jay: Don't create a block for every variable.
11721 2004-12-14 Miguel de Icaza <miguel@ximian.com>
11723 * location.cs: Provide extra information.
11725 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
11726 variables from the captured environment, it is the ldarg_0.
11728 2004-12-14 Marek Safar <marek.safar@seznam.cz>
11730 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
11733 * class.cs: Changed warning level for 169 to avoid developer
11734 displeasure from warning flooding. It will be changed back when they
11735 fix most of current BCL warnings.
11737 * RootContext.cs: Pushed default WarningLevel to 3.
11739 * statement.cs: Removed unused variable.
11741 2004-12-14 Marek Safar <marek.safar@seznam.cz>
11743 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
11744 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
11745 Add error 502 report.
11746 (StaticClass.DefineType): Add error 441 report.
11747 (Class.AllowedModifiersProp): New virtual property as temporary
11748 extension to AllowedModifiers.
11749 (Class.DefineType): Add error 418 report. Moved ModFlags check here
11750 to share implementation with StaticClass and don't call virtual
11753 * driver.cs (MainDriver): Add error 1558 test.
11755 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
11756 report. Moved error 36 test here.
11758 * statement.cs (Throw.Resolve): Add error 724 report.
11760 * typemanager.cs: Add out_attribute_type core type.
11762 2004-12-13 Marek Safar <marek.safar@seznam.cz>
11764 * class.cs (TypeContainer.VerifyClsCompliance): Add error
11766 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
11768 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
11771 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
11773 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
11774 Add error 3023 report.
11775 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
11777 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
11780 2004-12-12 John Luke <john.luke@gmail.com>
11782 * driver.cs (AddArgs): take -- into account when
11783 adding arguments, fixes bug 65710
11785 2004-12-12 Martin Baulig <martin@ximian.com>
11787 * expression.cs (Unary.TryReduceNegative): Added support for
11788 SByteConstant and ByteConstant.
11789 (Unary.Reduce): Check error values from TryReduceNegative().
11791 2004-12-10 Marek Safar <marek.safar@seznam.cz>
11793 * attributes.cs (Attribute.Resolve): Avoid multiple error report
11794 and report exception as error 182.
11796 2004-12-10 Raja R Harinath <rharinath@novell.com>
11798 * driver.cs (Main): Fix message when there are warnings.
11800 2004-12-09 Miguel de Icaza <miguel@ximian.com>
11802 * delegate.cs: Fixed my fix from yesterday, sorry about that.
11804 2004-12-09 Marek Safar <marek.safar@seznam.cz>
11806 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
11807 Reduced number of warnings.
11809 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
11811 2004-12-08 Miguel de Icaza <miguel@ximian.com>
11813 * driver.cs: Removed message.
11815 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
11817 2004-12-08 <vargaz@freemail.hu>
11819 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
11821 2004-12-08 Martin Baulig <martin@ximian.com>
11823 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
11824 instead of a CS3002 for properties and indexer.
11826 2004-12-08 Martin Baulig <martin@ximian.com>
11828 * decl.cs (MemberName.ToString): Make this work again.
11830 2004-12-08 Marek Safar <marek.safar@seznam.cz>
11832 * attribute.cs (Resolve): Add error 591 detection.
11834 * class.cs (FieldMember.Define): Add error 1547 detection.
11835 (Indexer.Define): Add error 620 detection.
11836 (Operator.Define): Add error 590 detection.
11838 * ecore.cs: Missing argument for error 79.
11840 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
11843 2004-12-07 Marek Safar <marek.safar@seznam.cz>
11846 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
11849 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
11851 * cs-parser.jay : handle doc comments on implicit/explicit operators.
11852 Some operator comments were suppressed.
11853 * doc.cs : Implicit/explicit operator name in doc comments are like
11854 "op_Explicit(type)~returnType", so added suffix handling.
11856 2004-12-07 Martin Baulig <martin@ximian.com>
11859 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
11860 (MemberCore.GetClsCompliantAttributeValue): Likewise.
11861 (DeclSpace.ec): New protected field; store the EmitContext here.
11862 (DeclSpace.EmitContext): New public property; moved here from
11864 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
11867 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
11868 (Enum.Emit): Don't create a new EmitContext.
11870 * delegate.cs (Delegate.DefineType): Always create the
11873 * iterators.cs (Iterators.DefineIterator): Create a new
11874 EmitContext and store it in `ec'.
11876 2004-08-24 Martin Baulig <martin@ximian.com>
11879 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
11880 this for accessibility checks.
11881 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
11882 IsNestedFamilyAccessible.
11883 (TypeManager.IsSubclassOf): New method, do what the name actually
11886 2004-12-06 Raja R Harinath <rharinath@novell.com>
11888 Fix crash on cs0657-17.cs.
11889 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11890 Use RootContext.Tree.Types, not 'new RootTypes ()'.
11891 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
11892 the case where the NamespaceEntry gets overwritten.
11894 2004-12-06 Marek Safar <marek.safar@seznam.cz>
11896 Fixed #69195, #56821
11897 * ecore.cs (ResolveBoolean): Tiny refactoring.
11899 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
11900 of right expression resolving when left is false constant and
11901 operator is LogicalAnd OR true constant and operator is LogicalOr.
11903 * statement.cs (ResolveUnreachable): Always reports warning.
11905 2004-12-05 Miguel de Icaza <miguel@ximian.com>
11907 * class.cs: Distinguish between 1721 and 1722 (just a little help
11908 for the programmer).
11910 2004-12-03 Miguel de Icaza <miguel@ximian.com>
11912 * delegate.cs: Only allow this on new versions of the language.
11914 2004-12-02 Duncan Mak <duncan@ximian.com>
11916 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
11918 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
11919 here as a static method. Take an additional bool out parameter
11920 `must_do_cs1540_check' for signaling to InstanceResolve.
11921 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
11922 member field from PropertyExpr class and made it an argument of
11923 the method instead.
11924 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
11925 check for MarshalByRefObject, and report CS0122 instead of CS1540.
11926 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
11927 and `remove_accessor' as well as InstanceResolve: report CS0122
11932 2004-12-03 Raja R Harinath <rharinath@novell.com>
11934 Fix test-327.cs, test-328.cs, and put in early infrastructure
11935 for eventually fixing #52697.
11936 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
11937 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
11938 from other methods.
11939 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
11940 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
11941 (VerifyUsing, error246): Update.
11942 * rootcontext.cs (RootContext.NamespaceLookup): Just use
11943 'NamespaceEntry.LookupNamespaceOrType'.
11945 2004-12-03 Martin Baulig <martin@ximian.com>
11947 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
11948 method as our child, call AnonymousMethod.Compatible() on it.
11950 2004-12-03 Raja R Harinath <rharinath@novell.com>
11952 Disable XML documentation support in 'basic' profile.
11953 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
11954 Redirect XmlElement to System.Object.
11955 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
11956 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
11957 * mcs.exe.sources: Add doc-bootstrap.cs.
11958 * doc-bootstrap.cs: New file. Contains empty stub implementation
11961 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
11963 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
11964 comments are allowed.
11966 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
11968 * delegate.cs: Add checks for subtypes in paramaters and return values
11969 in VerifyMethod () to add support for Covariance/Contravariance
11972 2004-12-02 Miguel de Icaza <miguel@ximian.com>
11974 * report.cs: Remove extra closing parenthesis.
11976 * convert.cs (Error_CannotImplicitConversion): If the name of the
11977 types are the same, provide some extra information.
11979 * class.cs (FieldBase): Use an unused bit field from the field to
11980 encode the `has_offset' property from the FieldMember. This saves
11981 a couple of Ks on bootstrap compilation.
11983 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
11984 method as our child, return the AnonymousMethod resolved
11987 * expression.cs (New.DoResolve): Allow return values from
11988 NewDelegate to also include AnonymousMethods.
11992 2004-12-02 Marek Safar <marek.safar@seznam.cz>
11995 * attribute.cs (Resolve): Improved implementation of params
11996 attribute arguments.
11998 * support.cs (ParameterData): Add HasParams to be faster.
12000 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
12002 all things are for /doc support:
12004 * doc.cs: new file that supports XML documentation generation.
12005 * mcs.exe.sources: added doc.cs.
12007 Handle /doc command line option.
12008 Report error 2006 instead of 5 for missing file name for /doc.
12009 Generate XML documentation when required, after type resolution.
12011 Added support for picking up documentation (/// and /** ... */),
12012 including a new XmlCommentState enumeration.
12014 Added lines to fill Documentation element for field, constant,
12015 property, indexer, method, constructor, destructor, operator, event
12016 and class, struct, interface, delegate, enum.
12017 Added lines to warn incorrect comment.
12019 Added Documentation field (passed only when /doc was specified).
12021 Added DocComment, DocCommentHeader, GenerateDocComment() and
12022 OnGenerateDocComment() and some supporting private members for
12023 /doc feature to MemberCore.
12025 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
12027 Added overriden DocCommentHeader.
12029 Added overriden DocCommentHeader and GenerateDocComment().
12031 2004-12-01 Miguel de Icaza <miguel@ximian.com>
12033 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
12034 unwrapping the enumeration values, chain to
12035 DoConstantNumericPromotions again, so we can promote things to the
12036 fundamental types (takes care of enums that are bytes, sbytes).
12040 2004-12-01 Raja R Harinath <rharinath@novell.com>
12042 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
12043 Fix long-standing bug in type-lookup. Use FindType instead of
12044 LookupType when ec.ResolvingTypeTree.
12045 (Attribute.ResolveType, Attribute.Resolve)
12046 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
12048 (Attributes.Search): Remove internal version. Update.
12049 (Attributes.SearchMulti): Update.
12050 (Attributes.GetClsCompliantAttribute): Remove.
12051 (Attributes.GetIndexerNameAttribute): Remove.
12052 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
12053 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
12054 * class.cs (Indexer.Define): Likewise.
12056 2004-12-01 Marek Safar <marek.safar@seznam.cz>
12059 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
12060 MarshallByReference members access.
12062 * expression.cs: Use CheckMarshallByRefAccess;
12063 Better error CS0197 message.
12065 * report.cs: Print whole related error message.
12067 2004-11-30 Raja R Harinath <rharinath@novell.com>
12069 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
12070 the current directory to help debugging.
12072 2004-11-29 Marek Safar <marek.safar@seznam.cz>
12074 * class (GetClassBases): Better error 60 report.
12075 (EventProperty): Disabled warning 67 detection.
12077 2004-11-29 Marek Safar <marek.safar@seznam.cz>
12080 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
12082 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
12085 2004-11-29 Marek Safar <marek.safar@seznam.cz>
12088 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
12090 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
12092 2004-11-26 Miguel de Icaza <miguel@ximian.com>
12094 * attribute.cs (Attribute.Resolve): Refine error reporting and
12095 report a cs0117 if the identifier does not exist, to distinguish
12096 from 0617 which is a miss-use of the actual identifier.
12098 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
12099 between cs0070 and cs0079.
12101 * class.cs (MemberBase.DoDefine): When reporting a wrong
12102 accessibility level, we use MethodCore to compare instead of
12103 Method (this was a regression in some refactoring effort).
12105 So now we correctly report cs0056 again.
12107 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
12108 testing the target_type (which was known to be object_type) and
12109 not the source type (which is anonymous_method).
12111 Fixed reporting of error cs1660.
12113 * expression.cs (UserCast.Source): Expose the underlying cast.
12115 * statement.cs (Switch.SwitchGoverningType): Sort the list of
12116 allowed types to find a match to int32 first (most common).
12118 In addition, it ignores any ImplicitUserConversions that did an
12119 internal implicit conversion (as the switch statement allows only
12120 one integral conversion to exist).
12122 * class.cs (PartialContainer.Create): rename `name' to
12123 `member_name' for clarity. Then replace the string calls with a
12124 call to MemberName.GetPartialName, as now using
12125 MemberName.ToString is an error (this is due to the side effects
12126 it had, that were fixed in the past).
12128 This will restore the error reporting on a number of partial class
12129 errors that were missusing this (and getting an exception as a
12130 results, which is now just a plain textual warning, because
12131 yyparse debug output would crash otherwise).
12133 2004-11-26 Raja R Harinath <rharinath@novell.com>
12135 * Makefile (PROGRAM_INSTALL_DIR): Remove.
12137 2004-11-25 Ben Maurer <bmaurer@ximian.com>
12139 * rootcontext.cs (LookupType): Make sure to cache lookups that
12140 don't give us a negative result. This saves about 5% of corlib
12143 2004-11-25 Miguel de Icaza <miguel@ximian.com>
12145 * report.cs (AbstractMessage.Print): messages are sent to stderr
12147 * class.cs (TypeContainer.GetClassBases): It is an error to have a
12148 non-interface in the list of interfaces (at this point, either
12149 parent was properly set, or a base class is being listed in the
12150 interfaces section).
12152 This flags error 1722, and resolves the crash from bug 69259.
12154 2004-11-25 Ben Maurer <bmaurer@ximian.com>
12156 * statement.cs (Using.EmitExpressionFinally): make this work right
12157 for valuetypes. Fixes 69926.
12159 2004-11-25 Miguel de Icaza <miguel@ximian.com>
12161 * const.cs (Const.ChangeType): Cope with the "0 literal can be
12162 converted to an enum" here, before we try to change the underlying
12163 type. This code exists, but it is a different code path than the
12164 one used while encoding constants.
12166 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
12167 old bug: when converting from the null literal to a pointer,
12168 return an EmptyCast, not the NullLiteral.
12170 This fixes #69921, the recent null_type changes probably made this
12171 bug more prominent.
12173 (ImplicitReferenceConversionExists): In addition, resynchronized
12174 the code here, so it matches the same code in
12175 ImplicitReferenceConversionExists for the `from any class-type S
12176 to any interface-type T'.
12179 2004-11-25 Marek Safar <marek.safar@seznam.cz>
12181 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
12183 2004-11-24 Miguel de Icaza <miguel@ximian.com>
12185 * cs-parser.jay: Use verbosity accordingly.
12187 2004-11-24 Marek Safar <marek.safar@seznam.cz>
12189 * expression.cs (Unary.ResolveOperator): Do not report warning;
12190 AddressOf reads from variable.
12192 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
12194 2004-11-24 Marek Safar <marek.safar@seznam.cz>
12198 * attribute.cs (Attributable): Removed CheckTargets.
12199 (Attributes.Emit): Explicit attribute targets are tested here.
12201 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
12202 not enabled for interfaces.
12204 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
12205 (GetAssemblyName): Ouch next bug there.
12207 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
12209 * expression.cs: Error 275 added.
12211 2004-11-23 Marek Safar <marek.safar@seznam.cz>
12213 Fix bug #69177 (Implemented decimal constant support)
12215 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
12216 (BinaryFold): Add DecimalConstant.
12218 * const.cs (Define): Decimal constant
12220 (ChangeType): Add decimal type handling.
12221 (LookupConstantValue): Don't set value for decimal type but
12222 emit DecimalConstantAttribute. Needed for constant optimization.
12224 * constant.cs (ToDecimal): New method.
12225 (ConvertToDecimal): New method.
12226 (IntConstant): Implemented ConvertToDecimal.
12227 (DecimalConstant.Emit): Emit optimized version for decimals in
12230 * expression.cs (ResolveOperator): Changed order of constant
12231 reduction to work correctly with native types which have
12232 overloaded operators.
12233 (ResolveMemberAccess): Extract constant value from attribute
12236 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
12238 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
12239 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
12240 (ChangeType): Decimal is special.
12241 (TypeToCoreType): Add decimal type.
12243 2004-11-22 Marek Safar <marek.safar@seznam.cz>
12245 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
12248 2004-11-22 Marek Safar <marek.safar@seznam.cz>
12250 * class.cs (EventField.ApplyAttributeBuilder): Fix error
12253 2004-11-19 Marek Safar <marek.safar@seznam.cz>
12255 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
12257 * pending.cs (PendingImplementation): Grab only interfaces.
12259 2004-11-19 Marek Safar <marek.safar@seznam.cz>
12261 * statement.cs (ForeachHelperMethods): Add location member and
12262 error 202 detection.
12264 2004-11-19 Raja R Harinath <rharinath@novell.com>
12266 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
12267 automatically handled by executable.make.
12268 (PROGRAM): Make profile-specific.
12270 2004-11-18 Marek Safar <marek.safar@seznam.cz>
12272 * expression.cs (DoResolveBase): Fixed wrong warning for out
12275 2004-11-18 Martin Baulig <martin@ximian.com>
12277 Merged latest changes into gmcs. Please keep this comment in
12278 here, it makes it easier for me to see what changed in MCS since
12279 the last time I merged.
12281 2004-11-17 Raja R Harinath <rharinath@novell.com>
12283 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
12284 (TypeHandle.GetMemberCache): New.
12285 (TypeHandle.TypeHandle): Update.
12286 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
12287 (TypeManager.LookupParentInterfacesCache):
12288 Rename from LookupInterfaceCache. Optimize slightly.
12289 (TypeManager.MemberLookup_FindMembers): Update.
12290 * decl.cs (MemberCache.MemberCache): Set Container to null in the
12291 multi-type variant.
12292 (AddCacheContents): Rename from AddHashtable.
12293 * class.cs (TypeContainer.parent_container): Remove.
12294 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
12295 (TypeContainer.DoDefineMembers): Don't initialize it.
12296 Update to name changes.
12298 2004-11-17 Miguel de Icaza <miguel@ximian.com>
12300 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
12301 that factors the code to check access modifiers on override.
12303 (PropertyBase): Use the code here.
12305 Patch from Lluis S'anchez, fixes bug #69361.
12307 2004-11-15 Miguel de Icaza <miguel@ximian.com>
12309 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
12310 routine that is used to report the use of a captured variable
12311 whose address has been taken.
12313 There are two checks: one when variables are being captured and
12314 the other check is when the address of a variable is taken.
12316 (because an anonymous methods might be resolved before *or* after
12317 the address has been taken) and
12319 * expression.cs (Conditional.DoResolve): Remove the special
12320 casing that Martin added to trueExpr and falseExpr being both
12321 NullLiteral. We get the right behavior now just by introducing
12322 the null_type into the compiler.
12324 * convert.cs (ExplicitConversion): Change the code to use
12325 null_type instead of testing `expr is NullLiteral'.
12326 (ImplicitConversionStandard): use null_type too.
12327 (ImplicitReferenceConversionExists): use null_type too.
12328 (ImplicitReferenceConversion): use null_type too.
12330 * literal.cs: The type of `NullLiteral' is now null_type instead
12332 (Resolve): Set the type here.
12334 * typemanager.cs: Introduce null_type.
12336 2004-11-17 Martin Baulig <martin@ximian.com>
12338 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
12339 direction, like FindMembers() does. Fixes #69546, testcase is in
12342 2004-11-16 Martin Baulig <martin@ximian.com>
12344 This is based on a patch from Marek Safar, see bug #69082.
12345 Fixes bugs #63705 and #67130.
12347 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
12348 method; create a MemberCache for an interface type and cache the
12351 * decl.cs (IMemberContainer.ParentContainer): Removed.
12352 (IMemberContainer.ParentCache): New property.
12353 (MemberCache.SetupCacheForInterface): Removed.
12354 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
12355 to create a cache for an interface's "parent".
12357 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
12360 2004-11-16 Martin Baulig <martin@ximian.com>
12362 Merged back from gmcs; these changes already went into gmcs a
12363 couple of weeks ago.
12366 (TypeManager.AddUserType): Removed the `ifaces' argument.
12367 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
12369 (TypeManager.AddUserInterface): Removed.
12370 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
12372 (TypeManager.GetInterfaces): Likewise.
12373 (TypeManager.GetExplicitInterfaces): Likewise.
12375 * ecore.cs (TypeExpr.GetInterfaces): Removed.
12377 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
12378 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
12380 2004-11-14 Ben Maurer <bmaurer@ximian.com>
12382 * statement.cs: Avoid adding bools to a hashtable.
12384 2004-11-07 Miguel de Icaza <miguel@ximian.com>
12386 * expression.cs (Invocation.OverloadResolve): Flag error if we are
12387 calling an unsafe method from a safe location.
12389 2004-11-06 Marek Safar <marek.safar@seznam.cz>
12392 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
12394 2004-11-06 Miguel de Icaza <miguel@ximian.com>
12396 * namespace.cs (VerifyUsing): use GetPartialName instead of
12399 2004-11-05 Miguel de Icaza <miguel@ximian.com>
12401 * statement.cs (Return.Resolve): Fix regression in typo: if
12402 `in_exc', we have to request a NeedReturnLabel, this was a typo
12403 introduced in the anonymous method check-in. Fixes #69131.
12405 * Indexers were using the ShortName when defining themselves,
12406 causing a regression in the compiler bootstrap when applying the
12407 patch from 2004-11-02 (first part), now they use their full name
12408 and the bug is gone.
12410 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
12412 * driver.cs: Strip the path from the names of embedded resources. Fixes
12415 2004-11-04 Raja R Harinath <rharinath@novell.com>
12417 Fix error message regression: cs0104-2.cs.
12418 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
12419 (AliasEntry.Resolve): Update.
12420 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
12422 (RootContext.LookupType): Update.
12424 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
12426 * cs-parser.jay: Add support for handling accessor modifiers
12427 * class: Add support port accessor modifiers and error checking,
12428 define PropertyMethod.Define as virtual (not abstract anymore)
12429 * ecore.cs: Add checking for proeprties access with access modifiers
12430 * iterators.cs: Modify Accessor constructor call based in the modified
12432 2004-11-02 Ben Maurer <bmaurer@ximian.com>
12434 * expression.cs (StringConcat): Handle being called twice,
12435 as when we have a concat in a field init with more than two
12438 2004-11-02 Miguel de Icaza <miguel@ximian.com>
12440 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
12441 special case explicit implementations, we should always produce
12442 the .property or .event declaration.
12444 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
12445 since it will not return correct data if people use this
12446 unresolved in the presence of using statements (see test-313).
12448 * class.cs (MethodData.Define): If we are an explicit interface
12449 implementation, set the method name to the full name of the
12450 interface plus the name of the method.
12452 Notice that using the method.MethodName.GetFullName() does not
12453 work, as it will only contain the name as declared on the source
12454 file (it can be a shorthand in the presence of using statements)
12455 and not the fully qualifed type name, for example:
12459 class D : ICloneable {
12460 object ICloneable.Clone () {
12464 Would produce a method called `ICloneable.Clone' instead of
12465 `System.ICloneable.Clone'.
12467 * namespace.cs (Alias.Resolve): Use GetPartialName.
12469 2004-11-01 Marek Safar <marek.safar@seznam.cz>
12471 * cs-parser.jay: Add error 1055 report.
12473 2004-11-01 Miguel de Icaza <miguel@ximian.com>
12475 * assign.cs (Assign.DoResolve): Only do the transform of
12476 assignment into a New if the types are compatible, if not, fall
12477 through and let the implicit code deal with the errors and with
12478 the necessary conversions.
12480 2004-11-01 Marek Safar <marek.safar@seznam.cz>
12482 * cs-parser.jay: Add error 1031 report.
12484 * cs-tokenizer.cs: Add location for error 1038.
12486 2004-10-31 Marek Safar <marek.safar@seznam.cz>
12488 * cs-parser.jay: Add error 1016 report.
12490 2004-10-31 Marek Safar <marek.safar@seznam.cz>
12492 * cs-parser.jay: Add errors 1575,1611 report.
12494 2004-10-31 Marek Safar <marek.safar@seznam.cz>
12496 * cs-parser.jay: Add error 1001 report.
12498 2004-10-31 Marek Safar <marek.safar@seznam.cz>
12501 * attribute.cs (GetMarshal): Add method argument for
12502 caller identification.
12504 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
12505 agument for GetMarshal and RuntimeMissingSupport.
12507 2004-10-31 Marek Safar <marek.safar@seznam.cz>
12509 * attribute.cs (ExtractSecurityPermissionSet): Removed
12510 TypeManager.code_access_permission_type.
12512 * typemanager.cs: Removed TypeManager.code_access_permission_type.
12514 2004-10-27 Miguel de Icaza <miguel@ximian.com>
12516 * expression.cs (LocalVariableReference.DoResolveLValue): Check
12517 for obsolete use of a variable here. Fixes regression on errors
12518 cs0619-25 and cs0619-26.
12520 2004-10-27 Marek Safar <marek.safar@seznam.cz>
12522 Fix #62358, implemented security attribute encoding.
12524 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
12525 Tests permitted SecurityAction for assembly or other types.
12526 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
12527 data from SecurityPermissionAttribute to PermisionSet class.
12529 * class.cs (ApplyAttributeBuilder): Added special handling
12530 for System.Security.Permissions.SecurityAttribute based types.
12532 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
12533 special handling for System.Security.Permissions.SecurityAttribute
12536 * enum.cs (ApplyAttributeBuilder): Added special handling
12537 for System.Security.Permissions.SecurityAttribute based types.
12539 * parameter.cs (ApplyAttributeBuilder): Added special handling
12540 for System.Security.Permissions.SecurityAttribute based types.
12542 * rootcontext.cs: Next 2 core types.
12544 * typemanager.cs (TypeManager.security_permission_attr_type):
12545 Built in type for the SecurityPermission Attribute.
12546 (code_access_permission_type): Build in type.
12548 2004-10-17 Miguel de Icaza <miguel@ximian.com>
12550 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
12551 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
12552 all of this information into
12553 EmitContext.EmitCapturedVariableInstance.
12555 * codegen.cs (EmitCapturedVariableInstance): move here the
12556 funcionality of emitting an ldarg.0 in the presence of a
12557 remapping. This centralizes the instance emit code.
12559 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
12560 then emit a load of this: it means that we have reached the
12561 topmost ScopeInfo: the one that contains the pointer to the
12562 instance of the class hosting the anonymous method.
12564 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
12565 captures to the topmost CaptureContext.
12567 2004-10-12 Miguel de Icaza <miguel@ximian.com>
12569 * expression.cs (LocalVariableReference): Move the knowledge about
12570 the iterators into codegen's EmitCapturedVariableInstance.
12572 2004-10-11 Miguel de Icaza <miguel@ximian.com>
12574 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
12575 all code paths return a value from an anonymous method (it is the
12576 same as the 161 error, but for anonymous methods).
12578 2004-10-08 Miguel de Icaza <miguel@ximian.com>
12580 The introduction of anonymous methods in the compiler changed
12581 various ways of doing things in the compiler. The most
12582 significant one is the hard split between the resolution phase
12583 and the emission phases of the compiler.
12585 For instance, routines that referenced local variables no
12586 longer can safely create temporary variables during the
12587 resolution phase: they must do so from the emission phase,
12588 since the variable might have been "captured", hence access to
12589 it can not be done with the local-variable operations from the runtime.
12593 (Block.Flags): New flag `IsTopLevel' to indicate that this block
12594 is a toplevel block.
12596 (ToplevelBlock): A new kind of Block, these are the blocks that
12597 are created by the parser for all toplevel method bodies. These
12598 include methods, accessors and anonymous methods.
12600 These contain some extra information not found in regular blocks:
12601 A pointer to an optional CaptureContext (for tracking captured
12602 local variables and parameters). A pointer to the parent
12605 (Return.Resolve): Catch missmatches when returning a value from an
12606 anonymous method (error 1662).
12607 Invoke NeedReturnLabel from the Resolve phase instead of the emit
12610 (Break.Resolve): ditto.
12612 (SwitchLabel): instead of defining the labels during the
12613 resolution phase, we now turned the public ILLabel and ILLabelCode
12614 labels into methods called GetILLabelCode() and GetILLabel() that
12615 only define the label during the Emit phase.
12617 (GotoCase): Track the SwitchLabel instead of the computed label
12618 (its contained therein). Emit the code by using
12619 SwitchLabel.GetILLabelCode ().
12621 (LocalInfo.Flags.Captured): A new flag has been introduce to track
12622 whether the Local has been captured or not.
12624 (LocalInfo.IsCaptured): New property, used to tell whether the
12625 local has been captured.
12627 * anonymous.cs: Vastly updated to contain the anonymous method
12630 The main classes here are: CaptureContext which tracks any
12631 captured information for a toplevel block and ScopeInfo used to
12632 track the activation frames for various local variables.
12634 Each toplevel block has an optional capture context associated
12635 with it. When a method contains an anonymous method both the
12636 toplevel method and the anonymous method will create a capture
12637 context. When variables or parameters are captured, they are
12638 recorded on the CaptureContext that owns them, for example:
12642 MyDelegate d = delegate {
12647 Here `a' will be recorded as captured on the toplevel
12648 CapturedContext, the inner captured context will not have anything
12649 (it will only have data if local variables or parameters from it
12650 are captured in a nested anonymous method.
12652 The ScopeInfo is used to track the activation frames for local
12653 variables, for example:
12655 for (int i = 0; i < 10; i++)
12656 for (int j = 0; j < 10; j++){
12657 MyDelegate d = delegate {
12662 At runtime this captures a single captured variable `i', but it
12663 captures 10 different versions of the variable `j'. The variable
12664 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
12665 recorded on a child.
12667 The toplevel ScopeInfo will also track information like the `this'
12668 pointer if instance variables were referenced (this is necessary
12669 as the anonymous method lives inside a nested class in the host
12670 type of the method).
12672 (AnonymousMethod): Expanded to track the Toplevel, implement
12673 `AnonymousMethod.Compatible' to tell whether an anonymous method
12674 can be converted to a target delegate type.
12676 The routine now also produces the anonymous method content
12678 (AnonymousDelegate): A helper class that derives from
12679 DelegateCreation, this is used to generate the code necessary to
12680 produce the delegate for the anonymous method that was created.
12682 * assign.cs: API adjustments for new changes in
12683 Convert.ImplicitStandardConversionExists.
12685 * class.cs: Adjustments to cope with the fact that now toplevel
12686 blocks are of type `ToplevelBlock'.
12688 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
12689 insteda of standard blocks.
12691 Flag errors if params arguments are passed to anonymous methods.
12693 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
12694 `CurrentAnonymousMethod' which points to the current Anonymous
12695 Method. The variable points to the AnonymousMethod class that
12696 holds the code being compiled. It is set in the new EmitContext
12697 created for the anonymous method.
12699 (EmitContext.Phase): Introduce a variable and an enumeration to
12700 assist in enforcing some rules about when and where we are allowed
12701 to invoke certain methods (EmitContext.NeedsReturnLabel is the
12702 only one that enfonces this right now).
12704 (EmitContext.HaveCaptureInfo): new helper method that returns
12705 whether we have a CapturedContext initialized.
12707 (EmitContext.CaptureVariable): New method used to register that a
12708 LocalInfo must be flagged for capturing.
12710 (EmitContext.CapturedParameter): New method used to register that a
12711 parameters must be flagged for capturing.
12713 (EmitContext.CapturedField): New method used to register that a
12714 field must be flagged for capturing.
12716 (EmitContext.HaveCapturedVariables,
12717 EmitContext.HaveCapturedFields): Return whether there are captured
12718 variables or fields.
12720 (EmitContext.EmitMethodHostInstance): This is used to emit the
12721 instance for the anonymous method. The instance might be null
12722 (static methods), this (for anonymous methods that capture nothing
12723 and happen to live side-by-side with the current method body) or a
12724 more complicated expression if the method has a CaptureContext.
12726 (EmitContext.EmitTopBlock): Routine that drives the emission of
12727 code: it will first resolve the top block, then emit any metadata
12728 and then emit the code. The split is done so that we can extract
12729 any anonymous methods and flag any captured variables/parameters.
12731 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
12732 during this phase, the ILGenerator should not be used as labels
12733 and local variables declared here might not be accessible to any
12734 code that is part of an anonymous method.
12736 Exceptions to this include the temporary variables that are
12737 created by some statements internally for holding temporary
12740 (EmitContext.EmitMeta): New routine, in charge of emitting all the
12743 (EmitContext.TemporaryReturn): This method is typically called
12744 from the Emit phase, and its the only place where we allow the
12745 ReturnLabel to be defined other than the EmitMeta. The reason is
12746 that otherwise we would have to duplicate a lot of logic in the
12747 Resolve phases of various methods that today is on the Emit
12750 (EmitContext.NeedReturnLabel): This no longer creates the label,
12751 as the ILGenerator is not valid during the resolve phase.
12753 (EmitContext.EmitThis): Extended the knowledge in this class to
12754 work in anonymous methods in addition to iterators.
12756 (EmitContext.EmitCapturedVariableInstance): This emits whatever
12757 code is necessary on the stack to access the instance to a local
12758 variable (the variable will be accessed as a field).
12760 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
12761 EmitContext.EmitAddressOfParameter): Routines to support
12762 parameters (not completed at this point).
12764 Removals: Removed RemapLocal and RemapLocalLValue. We probably
12765 will also remove the parameters.
12767 * convert.cs (Convert): Define a `ConstantEC' which points to a
12768 null. This is just to prefity some code that uses
12769 ImplicitStandardConversion code and do not have an EmitContext
12772 The idea is to flag explicitly that at that point in time, it is
12773 known that the conversion will not trigger the delegate checking
12774 code in implicit conversions (which requires a valid
12777 Everywhere: pass new EmitContext parameter since
12778 ImplicitStandardConversionExists now requires it to check for
12779 anonymous method conversions.
12781 (Convert.ImplicitStandardConversionExists): If the type of an
12782 expression is the anonymous_method_type, and the type is a
12783 delegate, we invoke the AnonymousMethod.Compatible method to check
12784 whether an implicit conversion is possible.
12786 (Convert.ImplicitConversionStandard): Only do implicit method
12787 group conversions if the language level is not ISO_1.
12789 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
12790 MethodInfo for the Invoke method. used by Delegate and
12793 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
12794 method conversions if the target type is a delegate.
12796 Removed extra debugging nops.
12798 (LocalVariableReference): Turn the `local_info' into a public
12801 Add `prepared' field, the same hack used for FieldExprs to cope
12802 with composed assignments, as Local variables do not necessarily
12803 operate purely on the stack as they used to: they can be captured
12806 Add `temp' for a temporary result, like fields.
12808 Refactor DoResolve and DoResolveLValue into DoResolveBase.
12810 It now copes with Local variables that are captured and emits the
12811 proper instance variable to load it from a field in the captured
12814 (ParameterReference.DoResolveBase): During the resolve phase,
12815 capture parameters if we are in an anonymous method.
12817 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
12818 anonymous method, use the EmitContext helper routines to emit the
12819 parameter reference.
12821 * iterators.cs: Set RemapToProxy to true/false during the
12824 * parameters.cs (GetParameterByName): New helper method.
12826 * typemanager.cs (anonymous_method_type) a new type that
12827 represents an anonyous method. This is always an internal type,
12828 used as a fencepost to test against the anonymous-methodness of an
12831 2004-10-20 Marek Safar <marek.safar@seznam.cz>
12833 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
12835 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
12837 2004-10-18 Martin Baulig <martin@ximian.com>
12839 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
12840 `Type' directly, but call ResolveType() on it.
12841 (Catch.Resolve): Likewise.
12842 (Foreach.Resolve): Likewise.
12844 2004-10-18 Martin Baulig <martin@ximian.com>
12846 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
12847 `Type' directly, but call ResolveType() on it.
12848 (Probe.DoResolve): Likewise.
12849 (ArrayCreation.LookupType): Likewise.
12850 (TypeOf.DoResolve): Likewise.
12851 (SizeOf.DoResolve): Likewise.
12853 2004-10-18 Martin Baulig <martin@ximian.com>
12855 * expression.cs (Invocation.BetterFunction): Put back
12856 TypeManager.TypeToCoreType().
12858 2004-10-18 Raja R Harinath <rharinath@novell.com>
12860 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
12863 2004-10-18 Martin Baulig <martin@ximian.com>
12865 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
12866 `Type' directly, but call ResolveType() on it.
12868 2004-10-18 Martin Baulig <martin@ximian.com>
12870 * class.cs (FieldMember.Define): Don't access the TypeExpr's
12871 `Type' directly, but call ResolveType() on it.
12872 (MemberBase.DoDefine): Likewise.
12874 * expression.cs (New.DoResolve): Don't access the TypeExpr's
12875 `Type' directly, but call ResolveType() on it.
12876 (ComposedCast.DoResolveAsTypeStep): Likewise.
12878 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
12879 `Type' directly, but call ResolveType() on it.
12881 2004-10-17 John Luke <john.luke@gmail.com>
12883 * class.cs (Operator.GetSignatureForError): use CSharpName
12885 * parameter.cs (Parameter.GetSignatureForError): Returns
12886 correct name even if was not defined.
12888 2004-10-13 Raja R Harinath <rharinath@novell.com>
12891 * class.cs (TypeContainer.EmitContext): New property.
12892 (DefineNestedTypes): Create an emitcontext for each part.
12893 (MethodCore.DoDefineParameters): Use container's emitcontext.
12894 Pass type array to InternalParameters.
12895 (MemberBase.DoDefine): Use container's emitcontext.
12896 (FieldMember.Define): Likewise.
12897 (Event.Define): Likewise.
12898 (SetMethod.GetParameterInfo): Change argument to EmitContext.
12899 Pass type array to InternalParameters.
12900 (SetIndexerMethod.GetParameterInfo): Likewise.
12901 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
12902 * delegate.cs (Define): Pass emitcontext to
12903 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
12904 array to InternalParameters.
12905 * expression.cs (ParameterReference.DoResolveBase): Pass
12906 emitcontext to GetParameterInfo.
12907 (ComposedCast.DoResolveAsTypeStep): Remove check on
12908 ec.ResolvingTypeTree.
12909 * parameter.cs (Parameter.Resolve): Change argument to
12910 EmitContext. Use ResolveAsTypeTerminal.
12911 (Parameter.GetSignature): Change argument to EmitContext.
12912 (Parameters.ComputeSignature): Likewise.
12913 (Parameters.ComputeParameterTypes): Likewise.
12914 (Parameters.GetParameterInfo): Likewise.
12915 (Parameters.ComputeAndDefineParameterTypes): Likewise.
12916 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
12917 * support.cs (InternalParameters..ctor): Remove variant that takes
12919 * typemanager.cs (system_intptr_expr): New.
12920 (InitExpressionTypes): Initialize it.
12922 2004-10-12 Chris Toshok <toshok@ximian.com>
12924 * cs-parser.jay: fix location for try_statement and catch_clause.
12926 2004-10-11 Martin Baulig <martin@ximian.com>
12928 * report.cs: Don't make --fatal abort on warnings, we have
12929 -warnaserror for that.
12931 2004-10-07 Raja R Harinath <rharinath@novell.com>
12933 More DeclSpace.ResolveType avoidance.
12934 * decl.cs (MemberCore.InUnsafe): New property.
12935 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
12936 with newly created EmitContext.
12937 (FieldMember.Define): Likewise.
12938 * delegate.cs (Delegate.Define): Likewise.
12939 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
12940 only if normal name-lookup fails.
12941 (TypeExpr.DoResolve): Enable error-checking.
12942 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
12943 (SizeOf.DoResolve): Likewise.
12944 (ComposedCast.DoResolveAsTypeStep): Likewise.
12945 (StackAlloc.DoResolve): Likewise.
12946 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
12947 (Block.Unsafe): New property.
12948 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
12949 (Unsafe): Set 'unsafe' flag of contained block.
12950 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
12951 (Fixed.Resolve): Likewise.
12952 (Catch.Resolve): Likewise.
12953 (Using.ResolveLocalVariableDecls): Likewise.
12954 (Foreach.Resolve): Likewise.
12956 2004-10-05 John Luke <john.luke@gmail.com>
12958 * cs-parser.jay: add location to error CS0175
12960 2004-10-04 Miguel de Icaza <miguel@ximian.com>
12962 * ecore.cs (Expression.Constantity): Add support for turning null
12965 * const.cs (Const.Define): Allow constants to be reference types
12966 as long as the value is Null.
12968 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
12970 * namespace.cs (NamespaceEntry.Using): No matter which warning
12971 level is set, check if this namespace name has already been added.
12973 2004-10-03 Ben Maurer <bmaurer@ximian.com>
12975 * expression.cs: reftype [!=]= null should always use br[true,false].
12978 2004-10-03 Marek Safar <marek.safar@seznam.cz>
12981 * attribute.cs: Enum conversion moved to
12982 GetAttributeArgumentExpression to be applied to the all
12985 2004-10-01 Raja R Harinath <rharinath@novell.com>
12987 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
12988 * class.c (TypeContainer.DefineType): Flag error if
12989 base types aren't accessible due to access permissions.
12990 * decl.cs (DeclSpace.ResolveType): Move logic to
12991 Expression.ResolveAsTypeTerminal.
12992 (DeclSpace.ResolveTypeExpr): Thin layer over
12993 Expression.ResolveAsTypeTerminal.
12994 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
12995 Refactor code into NestedAccess. Use it.
12996 (DeclSpace.NestedAccess): New.
12997 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
12998 argument to silence errors. Check access permissions.
12999 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
13000 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
13001 (Cast.DoResolve): Likewise.
13002 (New.DoResolve): Likewise.
13003 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
13004 (TypeOf.DoResolve): Likewise.
13006 * expression.cs (Invocation.BetterConversion): Return the Type of
13007 the better conversion. Implement section 14.4.2.3 more faithfully.
13008 (Invocation.BetterFunction): Make boolean. Make correspondence to
13009 section 14.4.2.2 explicit.
13010 (Invocation.OverloadResolve): Update.
13011 (Invocation): Remove is_base field.
13012 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
13013 (Invocation.Emit): Likewise.
13015 2004-09-27 Raja R Harinath <rharinath@novell.com>
13017 * README: Update to changes.
13019 2004-09-24 Marek Safar <marek.safar@seznam.cz>
13021 * cs-parser.jay: Reverted 642 warning fix.
13023 2004-09-23 Marek Safar <marek.safar@seznam.cz>
13026 * decl.cs (FindMemberWithSameName): Indexer can have more than
13029 2004-09-23 Marek Safar <marek.safar@seznam.cz>
13031 * expression.cs (LocalVariableReference.DoResolveLValue):
13032 Do not report warning 219 for out values.
13033 (EmptyExpression.Null): New member to avoid extra allocations.
13035 2004-09-23 Marek Safar <marek.safar@seznam.cz>
13037 * cs-parser.jay: Fix wrong warning 642 report.
13039 * cs-tokenizer.cs (CheckNextToken): New helper;
13040 Inspect next character if is same as expected.
13042 2004-09-23 Martin Baulig <martin@ximian.com>
13044 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
13045 (Convert.ImplicitReferenceConversionExists): Likewise.
13047 2004-09-23 Marek Safar <marek.safar@seznam.cz>
13049 * class.cs (Operator.Define): Add error 448 and 559 report.
13051 2004-09-22 Marek Safar <marek.safar@seznam.cz>
13053 * class.cs (MemberBase.IsTypePermitted): New protected
13054 method for checking error CS0610.
13056 2004-09-22 Marek Safar <marek.safar@seznam.cz>
13058 * class.cs (TypeContainer.HasExplicitLayout): New property
13059 Returns whether container has StructLayout attribute set Explicit.
13060 (FieldMember): New abstract class for consts and fields.
13061 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
13062 (Field): Reuse FieldMember.
13064 * const.cs (Const): Reuse FieldMember.
13066 * rootcontext.cs: EmitConstants call moved to class.
13068 2004-09-22 Martin Baulig <martin@ximian.com>
13070 Thanks to Peter Sestoft for this bug report.
13072 * expression.cs (Conditional): If both the `trueExpr' and the
13073 `falseExpr' is a NullLiteral, return a NullLiteral.
13075 2004-09-22 Martin Baulig <martin@ximian.com>
13077 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
13078 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
13079 for the "get_Current" call.
13081 2004-09-22 Martin Baulig <martin@ximian.com>
13083 Marek and me just fixed one of our oldest bugs: #28562 :-)
13085 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
13087 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
13088 we're an EnumConstant, just return that.
13089 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
13090 an EnumConstant. In this case, we need to use GetValueAsEnumType()
13091 to get the value which'll actually be written into the attribute.
13092 However, we have to use GetValue() to access the attribute's value
13095 2004-09-22 Marek Safar <marek.safar@seznam.cz>
13097 * constant.cs (Constant.IsNegative): New abstract property
13100 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
13101 (StackAlloc.DoResolve): Reused IsNegative.
13103 2004-09-21 Martin Baulig <martin@ximian.com>
13105 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
13106 if we're used in an iterator, we may be called from different
13109 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
13110 we actually have an exception block.
13112 2004-09-20 John Luke <jluke@cfl.rr.com>
13114 * class.cs, cs-parser.jay: Improve the error report for 1520:
13115 report the actual line where the error happens, not where the
13116 class was declared.
13118 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
13119 Pass location information that was available elsewhere.
13121 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
13123 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
13124 runtime to delay sign assemblies.
13126 2004-09-19 Miguel de Icaza <miguel@ximian.com>
13128 * cs-parser.jay: Do not report the stack trace, this is barely
13131 2004-08-22 John Luke <john.luke@gmail.com>
13133 * driver.cs : check that a resource id is not already used
13134 before adding it, report CS1508 if it is, bug #63637
13136 2004-09-19 Miguel de Icaza <miguel@ximian.com>
13138 * ecore.cs: Removed dead code.
13140 2004-09-18 Marek Safar <marek.safar@seznam.cz>
13142 * class.cs: Do not report warning CS0067 on the interfaces.
13144 2004-09-16 Marek Safar <marek.safar@seznam.cz>
13146 * cs-parser.jay: Add error 504 report.
13148 2004-09-16 Marek Safar <marek.safar@seznam.cz>
13150 * rootcontext.cs: WarningLevel is 4 by default now.
13152 * statement.cs (Fixed.Resolve): Do not null
13155 2004-09-16 Marek Safar <marek.safar@seznam.cz>
13158 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
13159 deep search when property is not virtual.
13160 (PropertyExpr.ResolveAccessors): Make one call for both
13163 2004-09-15 Marek Safar <marek.safar@seznam.cz>
13166 * statement.cs: Error 152 report constains also location.
13168 2004-09-15 Marek Safar <marek.safar@seznam.cz>
13171 * const.cs: Explicitly set constant as static.
13173 2004-09-15 Marek Safar <marek.safar@seznam.cz>
13176 * cs-parser.jay: Add error 1017 report.
13178 2004-09-15 Marek Safar <marek.safar@seznam.cz>
13180 Fixed bug #59980, #64224
13181 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
13183 * typemanager.cs (IsSpecialMethod): Simplified
13185 2004-09-14 Marek Safar <marek.safar@seznam.cz>
13187 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
13188 condition with better params.
13190 2004-09-14 Marek Safar <marek.safar@seznam.cz>
13193 * attribute.cs (Resolve): Property has to have both
13196 2004-09-14 Martin Baulig <martin@ximian.com>
13198 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
13200 2004-09-14 Marek Safar <marek.safar@seznam.cz>
13203 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
13204 called and is obsolete then this member suppress message
13205 when call is inside next [Obsolete] method or type.
13207 * expression.cs: Use TestObsoleteMethodUsage member.
13209 2004-09-14 Martin Baulig <martin@ximian.com>
13211 * cs-parser.jay: Sync a bit with the GMCS version.
13213 2004-09-14 Martin Baulig <martin@ximian.com>
13215 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
13216 (CSharpParser.yacc_verbose_flag): New public field.
13218 * genericparser.cs: Removed.
13220 2004-09-14 Raja R Harinath <rharinath@novell.com>
13222 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
13224 2004-09-13 Marek Safar <marek.safar@seznam.cz>
13226 * class.cs (MethodCore.CheckBase): Fix bug #65757.
13228 2004-09-10 Martin Baulig <martin@ximian.com>
13230 Backported my MemberName changes from GMCS into MCS.
13232 - we are now using a special `MemberName' class instead of using
13233 strings; in GMCS, the `MemberName' also contains the type
13236 - changed the grammar rules a bit:
13237 * the old `member_name' is now a `namespace_or_type_name':
13238 The rule is that we use `namespace_or_type_name' everywhere
13239 where we expect either a "member name" (GetEnumerator) or a
13240 "member name" with an explicit interface name
13241 (IEnumerable.GetEnumerator).
13242 In GMCS, the explicit interface name may include type arguments
13243 (IEnumerable<T>.GetEnumerator).
13244 * we use `member_name' instead of just `IDENTIFIER' for
13246 The rule is that we use `member_name' wherever a member may
13247 have type parameters in GMCS.
13249 * decl.cs (MemberName): New public class.
13250 (MemberCore.MemberName): New public readonly field.
13251 (MemberCore.ctor): Take a `MemberName' argument, not a string.
13252 (DeclSpace): Likewise.
13254 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
13255 * enum.cs (Enum.ctor): Likewise.
13257 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
13259 (AliasEntry.ctor): Take a MemberName, not an Expression.
13260 (AliasEntry.UsingAlias): Likewise.
13262 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
13263 (IMethodData.MemberName): Changed type from string to MemberName.
13264 (MemberBase.ExplicitInterfaceName): Likewise.
13265 (AbstractPropertyEventMethod.SetupName): Make this private.
13266 (AbstractPropertyEventMethod.ctor): Added `string prefix'
13267 argument; compute the member name here.
13268 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
13269 on the `member.MemberName' and the `prefix'.
13271 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
13273 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
13274 thus, we get a `MemberName' instead of a `string'. These
13275 declarations may have type parameters in GMCS.
13276 (interface_method_declaration, delegate_declaration): Likewise.
13277 (class_declaration, interface_declaration): Likewise.
13278 (method_header): Use `namespace_or_type_name' instead of
13279 `member_name'. We may be an explicit interface implementation.
13280 (property_declaration, event_declaration): Likewise.
13281 (member_name): This is now just an `IDENTIFIER', not a
13282 `namespace_or_type_name'.
13283 (type_name, interface_type): Removed.
13284 (namespace_or_type_name): Return a MemberName, not an Expression.
13285 (primary_expression): Use `member_name' instead of `IDENTIFIER';
13286 call GetTypeExpression() on the MemberName to get an expression.
13287 (IndexerDeclaration.interface_type): Changed type from string to
13289 (MakeName): Operate on MemberName's instead of string's.
13291 2004-09-13 Raja R Harinath <rharinath@novell.com>
13294 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
13295 (NamespaceEntry.Lookup): Add new argument to flag if we want the
13296 lookup to avoid symbols introduced by 'using'.
13297 * rootcontext.cs (NamespaceLookup): Update.
13299 2004-09-12 Marek Safar <marek.safar@seznam.cz>
13301 * class.cs (TypeContainer.DoDefineMembers): Do not call
13302 DefineDefaultConstructor for static classes.
13304 2004-09-12 Marek Safar <marek.safar@seznam.cz>
13306 * attribute.cs (Attribute.Resolve): Add error 653 report.
13308 * class.cs (Class.ApplyAttributeBuilder): Add error 641
13310 (Method.ApplyAttributeBuilder): Add error 685 report.
13311 (Operator.Define): Add error 564 report.
13313 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
13315 * expression.cs (Invocation.DoResolve): Add error
13316 245 and 250 report.
13318 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
13321 2004-09-11 Marek Safar <marek.safar@seznam.cz>
13323 * class.cs (ConstructorInitializer.Resolve):
13324 Wrong error number (515->516).
13326 2004-09-11 Marek Safar <marek.safar@seznam.cz>
13328 * class.cs (Indexer.Define): Add error 631 report.
13330 2004-09-11 Marek Safar <marek.safar@seznam.cz>
13332 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
13334 2004-09-11 Marek Safar <marek.safar@seznam.cz>
13336 * expression.cs (Probe.DoResolve): Add error CS0241 report.
13338 2004-09-10 Marek Safar <marek.safar@seznam.cz>
13340 * cs-parser.jay: Added error CS0241 report.
13342 2004-09-10 Raja R Harinath <rharinath@novell.com>
13344 * cs-parser.jay (fixed_statement): Introduce a scope for the
13345 declaration in the 'fixed' statement.
13347 2004-09-09 Marek Safar <marek.safar@seznam.cz>
13349 * cs-parser.jay: Added CS0230 error report.
13351 2004-09-09 Marek Safar <marek.safar@seznam.cz>
13353 * cs-parser.jay: Added errors CS0231 and CS0257 report.
13355 2004-09-09 Marek Safar <marek.safar@seznam.cz>
13357 * expression.cs (Argument.Resolve): Added error CS0192 and
13360 2004-09-09 Marek Safar <marek.safar@seznam.cz>
13362 C# 2.0 #pragma warning feature
13364 * cs-tokenizer.cs (PreProcessPragma): New method;
13365 Handles #pragma directive.
13367 * report.cs (WarningRegions): New class; Support
13368 class for #pragma warning directive. It tests whether
13369 warning is enabled for a given line.
13371 2004-09-08 Miguel de Icaza <miguel@ximian.com>
13373 * const.cs: Add more descriptive error report, tahnks to
13376 2004-09-08 Marek Safar <marek.safar@seznam.cz>
13378 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
13380 2004-09-07 Miguel de Icaza <miguel@ximian.com>
13382 * expression.cs: Apply patch from Ben: Remove dead code from
13383 ArrayCreation, and remove the TurnintoConstant call in const.cs,
13384 as that code just threw an exception anwyays.
13386 * const.cs: Remove the call to the turnintoconstant, for details
13389 * literal.cs: The type of the null-literal is the null type; So
13390 we use a placeholder type (literal.cs:System.Null, defined here)
13393 * expression.cs (Conditional.DoResolve): Remove some old code that
13394 is no longer needed, conversions have been fixed.
13396 (ArrayCreationExpression.DoResolve): Return false if we fail to
13397 resolve the inner expression.
13399 2004-09-07 Raja R Harinath <rharinath@novell.com>
13402 * cs-parser.jay (delegate_declaration): Record a delegate
13403 declaration as a type declaration.
13404 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
13406 2004-09-06 Miguel de Icaza <miguel@ximian.com>
13408 * parameter.cs: Do not crash if the type can not be resolved.
13410 * expression.cs: Report errors with unsafe pointers, fixes #64896
13412 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
13414 * expression.cs: Pointer arith always needs to do a conv.i
13415 if the operand is a long. fix 65320
13417 2004-09-04 Marek Safar <marek.safar@seznam.cz>
13419 Fixed cs0619-37.cs, cs0619-38.cs
13421 * enum.cs (GetObsoleteAttribute): Removed.
13423 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
13424 on Enum member is double staged. The first is tested member
13427 2004-09-04 Marek Safar <marek.safar@seznam.cz>
13429 Fixed #56986, #63631, #65231
13431 * class.cs: (TypeContainer.AddToMemberContainer): New method,
13432 adds member to name container.
13433 (TypeContainer.AddToTypeContainer): New method, adds type to
13435 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
13436 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
13437 AddOperator): Simplified by reusing AddToMemberContainer.
13438 (TypeContainer.UserDefinedStaticConstructor): Changed to property
13440 (Method.CheckForDuplications): Fixed implementation to test all
13442 (MemberBase): Detection whether member is explicit interface
13443 implementation is now in constructor.
13444 (MemberBase.UpdateMemberName): Handles IndexerName.
13445 (Accessor): Changed to keep also location information.
13446 (AbstractPropertyEventMethod): Is derived from MemberCore.
13447 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
13448 will be emited or not.
13449 (PropertyBase.AreAccessorsDuplicateImplementation):
13450 Tests whether accessors are not in collision with some method.
13451 (Operator): Is derived from MethodCore to simplify common
13454 * decl.cs (Flags.TestMethodDuplication): Test for duplication
13456 (DeclSpace.AddToContainer): Adds the member to defined_names
13457 table. It tests for duplications and enclosing name conflicts.
13459 * enum.cs (EnumMember): Clean up to reuse the base structures
13461 2004-09-03 Martin Baulig <martin@ximian.com>
13463 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
13464 into TypeContainer, to make partial classes work again.
13466 2004-09-03 Martin Baulig <martin@ximian.com>
13468 * rootcontext.cs (RootContext.V2): Removed.
13470 2004-03-23 Martin Baulig <martin@ximian.com>
13472 * expression.cs (Invocation.OverloadResolve): Added `bool
13473 may_fail' argument and use it instead of the Location.IsNull() hack.
13475 2004-09-03 Martin Baulig <martin@ximian.com>
13477 Merged latest changes into gmcs. Please keep this comment in
13478 here, it makes it easier for me to see what changed in MCS since
13479 the last time I merged.
13481 2004-09-03 Raja R Harinath <rharinath@novell.com>
13484 * expression.cs (BetterConversion): Don't allow either conversion
13485 to be null. Remove redundant implicit conversion test when 'q ==
13486 null' -- when this function is invoked, we already know that the
13487 implicit conversion exists.
13488 (BetterFunction): Assume that 'best' is non-null. Remove
13489 redundant reimplementation of IsApplicable when 'best' is null.
13490 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
13491 number of arguments.
13492 (IsAncestralType): Extract from OverloadResolve.
13493 (OverloadResolve): Make robust to the MethodGroupExpr being
13494 unsorted. Implement all the logic of Section 14.5.5.1, and
13495 support overloading of methods from multiple applicable types.
13496 Clean up logic somewhat. Don't pass null methods to BetterFunction.
13498 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
13499 (RealError, Warning): Append type of report to related symbol.
13501 2004-09-03 Marek Safar <marek.safar@seznam.cz>
13503 * enum.cs: Fixed CLS-Compliance checks for enum members.
13504 Error tests cs3008-8.cs, cs3014-8.cs
13506 2004-09-02 Marek Safar <marek.safar@seznam.cz>
13508 Fixed bug #62342, #63102
13509 * class.cs: ImplementIndexer uses member.IsExplicitImpl
13510 like ImplementMethod.
13512 2004-09-02 Marek Safar <marek.safar@seznam.cz>
13514 * attribute.cs (Attribute.GetAttributeArgumentExpression):
13517 2004-09-02 Martin Baulig <martin@ximian.com>
13519 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
13520 TypeManager.GetArgumentTypes() rather than calling GetParameters()
13523 2004-09-01 Marek Safar <marek.safar@seznam.cz>
13525 C# 2.0 Static classes implemented
13527 * class.cs (TypeContainer): instance_constructors,
13528 initialized_fields, initialized_static_fields,
13529 default_constructor, base_inteface_types are protected to be
13530 accessible from StaticClass.
13531 (TypeContainer.DefineDefaultConstructor): New virtual method
13532 for custom default constructor generating
13533 (StaticClass): New class to handle "Static classes" feature.
13535 * cs-parser.jay: Handle static keyword on class like instance
13538 * driver.cs: Added "/langversion" command line switch with two
13539 options (iso-1, default).
13541 2004-08-31 Marek Safar <marek.safar@seznam.cz>
13543 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
13545 2004-08-31 Miguel de Icaza <miguel@ximian.com>
13547 * delegate.cs: Style.
13549 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
13551 * delegate.cs: Add seperate instance expr field for miguel.
13553 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
13555 * PointerArithmetic (Resolve): make sure we are not doing
13556 pointer arith on void*. Also, make sure we are resolved
13557 by not setting eclass until resolve.
13559 All callers: Make sure that PointerArithmetic gets resolved.
13561 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
13563 * ArrayCreation (LookupType): If the type does not resolve
13564 to an array, give an error.
13566 2004-08-27 Marek Safar <marek.safar@seznam.cz>
13568 * statement.cs (Try.Resolve): Fixed bug #64222
13570 2004-08-27 Martin Baulig <martin@ximian.com>
13573 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
13576 2004-08-26 Marek Safar <marek.safar@seznam.cz>
13578 * ecore.cs (Constantify): Get underlying type via
13579 System.Enum.GetUnderlyingType to avoid StackOverflow on the
13580 Windows in special cases.
13582 2004-08-26 Marek Safar <marek.safar@seznam.cz>
13584 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
13585 for obtaining also private methods.
13586 (GetRemoveMethod): Used GetRemoveMethod (true)
13587 for obtaining also private methods.
13589 2004-08-24 Martin Baulig <martin@ximian.com>
13591 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
13592 MethodAttributes.HideBySig for operators.
13594 2004-08-23 Martin Baulig <martin@ximian.com>
13596 Back to the old error reporting system :-)
13598 * report.cs (Message): Removed.
13599 (Report.MessageData, ErrorData, WarningData): Removed.
13600 (Report.Error, Warning): Back to the old system.
13602 2004-08-23 Martin Baulig <martin@ximian.com>
13604 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
13606 * class.cs (TypeContainer.ParentContainer): New public virtual
13607 method; replaces the explicit interface implementation.
13608 (ClassPart.ParentContainer): Override.
13610 2004-08-23 Martin Baulig <martin@ximian.com>
13612 * statement.cs (Switch): Added support for constant switches; see
13613 #59428 or test-285.cs.
13615 2004-08-22 Marek Safar <marek.safar@seznam.cz>
13618 * statement.cs (GetEnumeratorFilter): Removed useless
13619 logic because C# specs is strict. GetEnumerator must be
13622 2004-08-22 Martin Baulig <martin@ximian.com>
13624 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13625 a switch and may break, reset the barrier. Fixes #59867.
13627 2004-08-22 Marek Safar <marek.safar@seznam.cz>
13629 CLS-Compliance speed up (~5% for corlib)
13631 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
13632 New method. Tests container for CLS-Compliant names
13634 * class.cs (TypeContainer.VerifyClsName): New method.
13635 Checks whether container name is CLS Compliant.
13636 (Constructor): Implements IMethodData.
13638 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
13639 low-case table for CLS Compliance test.
13640 (MemberCache.VerifyClsParameterConflict): New method.
13641 Checks method parameters for CS3006 error.
13643 * enum.cs (EnumMember): Is derived from MemberCore.
13644 (Enum.VerifyClsName): Optimized for better performance.
13646 2004-08-06 Marek Safar <marek.safar@seznam.cz>
13648 * report.cs: Renamed Error_T to Error and changed all
13651 2004-08-06 Marek Safar <marek.safar@seznam.cz>
13653 * class.cs (TypeContainer.IndexerArrayList): New inner class
13654 container for indexers.
13655 (TypeContainer.DefaultIndexerName): New constant for default
13656 indexer name. Replaced all "Item" with this constant.
13657 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
13659 * typemanager.cs (TypeManager.default_member_ctor): Cache here
13660 DefaultMemberAttribute constructor.
13662 2004-08-05 Martin Baulig <martin@ximian.com>
13664 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
13667 2004-08-05 Marek Safar <marek.safar@seznam.cz>
13669 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
13670 multi platforms problem.
13672 * compiler.csproj: Included shared files.
13674 2004-08-04 Marek Safar <marek.safar@seznam.cz>
13676 Fix bug 60333, 55971 in the more general way
13677 * attribute.cs (Attribute.GetAttributeArgumentExpression):
13678 Added arg_type argument for constant conversion.
13679 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
13681 2004-08-04 Marek Safar <marek.safar@seznam.cz>
13684 * class.cs (TypeContainer ): New inner classes MethodArrayList,
13685 OperatorArrayList, MethodCoreArrayList for typecontainer
13686 containers. Changed class member types to these new types.
13687 (MethodArrayList.DefineMembers): Added test for CS0659.
13689 2004-08-04 Miguel de Icaza <miguel@ximian.com>
13691 * cfold.cs: Synchronize the folding with the code in expression.cs
13692 Binary.DoNumericPromotions for uint operands.
13694 * attribute.cs: Revert patch from Raja, it introduced a regression
13695 while building Blam-1.2.1 (hard to isolate a test case).
13697 2004-08-04 Marek Safar <marek.safar@seznam.cz>
13701 (TypeContainer.Define): Renamed to DefineContainerMembers because of
13703 (MethodCore.parent_method): New member. The method we're overriding
13704 if this is an override method.
13705 (MethodCore.CheckBase): Moved from Method class and made common.
13706 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
13708 (MethodCore.CheckForDuplications): New abstract method. For custom
13709 member duplication search in a container
13710 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
13711 method and its return type.
13712 (Event.conflict_symbol): New member. Symbol with same name in the
13716 (MemberCache.FindMemberWithSameName): New method. The method
13717 is looking for conflict with inherited symbols.
13719 2004-08-04 Martin Baulig <martin@ximian.com>
13721 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
13723 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
13725 2004-08-03 Marek Safar <marek.safar@seznam.cz>
13727 * report.cs (Message): New enum for better error, warning reference in
13729 (MessageData): New inner abstract class. It generally handles printing of
13730 error and warning messages.
13731 Removed unused Error, Warning, Message methods.
13733 2004-08-03 Marek Safar <marek.safar@seznam.cz>
13735 Fix for cs0592-8.cs test
13737 (Attributable.ValidAttributeTargets): Made public.
13738 (Attribute.ExplicitTarget): New member for explicit target value.
13739 (Attribute.CheckTargets): Now we translate explicit attribute
13740 target to Target here.
13742 2004-08-03 Ben Maurer <bmaurer@ximian.com>
13744 * ecore.cs (MethodGroupExpr): new IsBase property.
13746 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
13748 * delegate.cs (DelegateCreation): store a MethodGroupExpr
13749 rather than an instance expr.
13751 (DelegateCreation.Emit): Use the method group rather than
13752 the instance expression. Also, if you have base.Foo as the
13753 method for a delegate, make sure to emit ldftn, not ldftnvirt.
13755 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
13757 (NewDelegate.DoResolve): Only check for the existance of Invoke
13758 if the method is going to be needed. Use MethodGroupExpr.
13760 (NewDelegate.Emit): Remove, DelegateCreation implements this.
13762 * expression.cs: For pointer arith., make sure to use
13763 the size of the type, not the size of the pointer to
13766 2004-08-03 Marek Safar <marek.safar@seznam.cz>
13769 * class.cs (Class): Added error CS0502 test.
13771 2004-08-03 John Luke <jluke@cfl.rr.com>
13772 Raja R Harinath <rharinath@novell.com>
13775 * attribute.cs (Attribute.complained_before): New flag.
13776 (Attribute.ResolveType, Attribute.Resolve),
13777 (Attribute.DefinePInvokeMethod): Set it.
13778 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
13780 2004-08-03 Martin Baulig <martin@ximian.com>
13782 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
13783 use a user-defined operator; we still need to do numeric
13784 promotions in case one argument is a builtin type and the other
13785 one has an implicit conversion to that type. Fixes #62322.
13787 2004-08-02 Martin Baulig <martin@ximian.com>
13789 * statement.cs (LocalInfo.Flags): Added `IsThis'.
13790 (LocalInfo.IsThis): New public property.
13791 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
13793 2004-08-01 Martin Baulig <martin@ximian.com>
13795 * class.cs (TypeContainer.GetClassBases): Don't set the default
13796 here since we may get called from GetPartialBases().
13797 (TypeContainer.DefineType): If GetClassBases() didn't return a
13798 parent, use the default one.
13800 2004-07-30 Duncan Mak <duncan@ximian.com>
13802 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
13804 2004-07-30 Martin Baulig <martin@ximian.com>
13806 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
13808 * class.cs (SourceMethod): New public class, derive from the
13809 symbol writer's ISourceMethod.
13810 (Method): Use the new symbol writer API.
13812 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
13813 as argument and use the new symbol writer.
13816 (SourceFile): Implement the symbol writer's ISourceFile.
13817 (Location.SymbolDocument): Removed.
13818 (Location.SourceFile): New public property.
13820 * symbolwriter.cs: Use the new symbol writer API.
13822 2004-07-30 Raja R Harinath <rharinath@novell.com>
13824 * Makefile (install-local): Remove. Functionality moved to
13827 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
13829 * Makefile: Install mcs.exe.config file together with mcs.exe.
13830 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
13831 correct runtime version.
13833 2004-07-25 Martin Baulig <martin@ximian.com>
13836 (TypeContainer.RegisterOrder): Removed, this was unused.
13837 (TypeContainer, interface_order): Removed.
13838 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
13839 TypeContainer as argument since we can also be called with a
13840 `PartialContainer' for a partial class/struct/interface.
13841 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
13842 of checking whether we're an `Interface' - we could be a
13843 `PartialContainer'.
13844 (PartialContainer.Register): Override; call
13845 AddClass()/AddStruct()/AddInterface() on our parent.
13847 * cs-parser.jay (interface_member_declaration): Add things to the
13848 `current_container', not the `current_class'.
13850 * rootcontext.cs (RegisterOrder): The overloaded version which
13851 takes an `Interface' was unused, removed.
13853 * typemanager.cs (TypeManager.LookupInterface): Return a
13854 `TypeContainer', not an `Interface'.
13855 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
13856 contain a `PartialContainer' for an interface, so check it's
13857 `Kind' to figure out what it is.
13859 2004-07-25 Martin Baulig <martin@ximian.com>
13861 * class.cs (Class.DefaultTypeAttributes): New public constant.
13862 (Struct.DefaultTypeAttributes): Likewise.
13863 (Interface.DefaultTypeAttributes): Likewise.
13864 (PartialContainer.TypeAttr): Override this and add the
13865 DefaultTypeAttributes.
13867 2004-07-25 Martin Baulig <martin@ximian.com>
13869 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
13870 we can just use the `Parent' field instead.
13872 2004-07-25 Martin Baulig <martin@ximian.com>
13874 * class.cs (TypeContainer.Emit): Renamed to EmitType().
13876 2004-07-25 Martin Baulig <martin@ximian.com>
13878 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
13879 our parts before defining any methods.
13880 (TypeContainer.VerifyImplements): Make this virtual.
13881 (ClassPart.VerifyImplements): Override and call VerifyImplements()
13882 on our PartialContainer.
13884 2004-07-25 Martin Baulig <martin@ximian.com>
13886 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
13888 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
13889 argument, we can just use the `Parent' field instead.
13892 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
13893 (MemberBase.DoDefine): Likewise.
13895 2004-07-24 Martin Baulig <martin@ximian.com>
13897 * decl.cs (MemberCore.Parent): New public field.
13898 (DeclSpace.Parent): Moved to MemberCore.
13900 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
13901 (MemberBase.ctor): Added TypeContainer argument, pass it to our
13903 (FieldBase, Field, Operator): Likewise.
13904 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
13905 (EventField, Event): Likewise.
13907 2004-07-23 Martin Baulig <martin@ximian.com>
13909 * class.cs (PartialContainer): New public class.
13910 (ClassPart): New public class.
13911 (TypeContainer): Added support for partial classes.
13912 (TypeContainer.GetClassBases): Splitted some of the functionality
13913 out into GetNormalBases() and GetPartialBases().
13915 * cs-tokenizer.cs (Token.PARTIAL): New token.
13916 (Tokenizer.consume_identifier): Added some hacks to recognize
13917 `partial', but only if it's immediately followed by `class',
13918 `struct' or `interface'.
13920 * cs-parser.jay: Added support for partial clases.
13922 2004-07-23 Martin Baulig <martin@ximian.com>
13924 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
13925 a `DeclSpace' and also made it readonly.
13926 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
13927 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
13928 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
13930 * cs-parser.jay: Pass the `current_class', not the
13931 `current_container' (at the moment, this is still the same thing)
13932 to a new Method, Property, Event, Indexer or Constructor.
13934 2004-07-23 Martin Baulig <martin@ximian.com>
13936 * cs-parser.jay (CSharpParser): Added a new `current_class' field
13937 and removed the `current_interface' one.
13938 (struct_declaration, class_declaration, interface_declaration):
13939 Set `current_class' to the newly created class/struct/interface;
13940 set their `Bases' and call Register() before parsing their body.
13942 2004-07-23 Martin Baulig <martin@ximian.com>
13944 * class.cs (Kind): New public enum.
13945 (TypeContainer): Made this class abstract.
13946 (TypeContainer.Kind): New public readonly field.
13947 (TypeContainer.CheckDef): New public method; moved here from
13949 (TypeContainer.Register): New public abstract method.
13950 (TypeContainer.GetPendingImplementations): New public abstract
13952 (TypeContainer.GetClassBases): Removed the `is_class' and
13953 `is_iface' parameters.
13954 (TypeContainer.DefineNestedTypes): Formerly known as
13956 (ClassOrStruct): Made this class abstract.
13958 * tree.cs (RootTypes): New public type.
13960 2004-07-20 Martin Baulig <martin@ximian.com>
13962 * tree.cs (Tree.RecordNamespace): Removed.
13963 (Tree.Namespaces): Removed.
13965 * rootcontext.cs (RootContext.IsNamespace): Removed.
13967 * cs-parser.jay (namespace_declaration): Just create a new
13968 NamespaceEntry here.
13970 2004-07-20 Martin Baulig <martin@ximian.com>
13972 * statement.cs (ExceptionStatement): New abstract class. This is
13973 now used as a base class for everyone who's using `finally'.
13974 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
13975 our local variables before using them.
13977 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
13978 virtual method. This is used by Yield.Resolve() to "steal" an
13979 outer block's `finally' clauses.
13980 (FlowBranchingException): The .ctor now takes an ExceptionStatement
13983 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
13984 version which takes an ExceptionStatement. This version must be
13985 used to create exception branchings.
13988 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
13989 (Iterator.EmitMoveNext): Added exception support; protect the
13990 block with a `fault' clause, properly handle 'finally' clauses.
13991 (Iterator.EmitDispose): Run all the `finally' clauses here.
13993 2004-07-20 Martin Baulig <martin@ximian.com>
13995 * iterator.cs: This is the first of a set of changes in the
13996 iterator code. Match the spec more closely: if we're an
13997 IEnumerable, then GetEnumerator() must be called. The first time
13998 GetEnumerator() is called, it returns the current instance; all
13999 subsequent invocations (if any) must create a copy.
14001 2004-07-19 Miguel de Icaza <miguel@ximian.com>
14003 * expression.cs: Resolve the constant expression before returning
14006 2004-07-19 Martin Baulig <martin@ximian.com>
14008 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
14009 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
14010 the return type of the new EmitContext.
14012 2004-07-18 Martin Baulig <martin@ximian.com>
14014 * class.cs (Property.Define): Fix iterators.
14016 * iterators.cs (Iterator.Define): Moved the
14017 `container.AddInterator (this)' call here from the .ctor; only do
14018 it if we resolved successfully.
14020 2004-07-17 Miguel de Icaza <miguel@ximian.com>
14022 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
14023 `true' for preprocessing directives that we parse. The return
14024 value indicates whether we should return to regular tokenizing or
14025 not, not whether it was parsed successfully.
14027 In the past if we were in: #if false ... #line #endif, we would
14028 resume parsing after `#line'. See bug 61604.
14030 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
14031 building: IsEnumType should return true only for enums, not for
14032 enums or System.Enum itself. This fixes #61593.
14034 Likely what happened is that corlib was wrong: mcs depended on
14035 this bug in some places. The bug got fixed, we had to add the
14036 hack, which caused bug 61593.
14038 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
14039 that was a workaround for the older conditions.
14041 2004-07-16 Ben Maurer <bmaurer@ximian.com>
14043 * assign.cs: IAssignMethod has a new interface, as documented
14044 inline. All assignment code now uses this new api.
14046 * ecore.cs, expression.cs: All classes which implement
14047 IAssignMethod now use the new interface.
14049 * expression.cs (Invocation): add a hack to EmitCall so that
14050 IndexerAccess can be the target of a compound assignment without
14051 evaluating its arguments twice.
14053 * statement.cs: Handle changes in Invocation api.
14055 2004-07-16 Martin Baulig <martin@ximian.com>
14057 * iterators.cs: Rewrote this. We're now using one single Proxy
14058 class for both the IEnumerable and the IEnumerator interface and
14059 `Iterator' derives from Class so we can use the high-level API.
14061 * class.cs (TypeContainer.AddIterator): New method.
14062 (TypeContainer.DoDefineType): New protected virtual method, which
14063 is called from DefineType().
14064 (TypeContainer.DoDefineMembers): Call DefineType() and
14065 DefineMembers() on all our iterators.
14066 (TypeContainer.Emit): Call Emit() on all our iterators.
14067 (TypeContainer.CloseType): Call CloseType() on all our iterators.
14069 * codegen.cs (EmitContext.CurrentIterator): New public field.
14071 2004-07-15 Martin Baulig <martin@ximian.com>
14074 (TypeManager.not_supported_exception_type): New type.
14076 2004-07-14 Martin Baulig <martin@ximian.com>
14078 * iterators.cs: Use real error numbers.
14080 2004-07-14 Martin Baulig <martin@ximian.com>
14082 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
14083 requires this to be a System.Collection.IEnumerable and not a
14084 class implementing that interface.
14085 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
14087 2004-07-13 Marek Safar <marek.safar@seznam.cz>
14089 * class.cs: Fixed previous fix, it broke some error tests.
14091 2004-07-12 Martin Baulig <martin@ximian.com>
14093 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
14096 2004-07-09 Miguel de Icaza <miguel@ximian.com>
14098 * assign.cs (LocalTemporary): Add new argument: is_address,If
14099 `is_address' is true, then the value that we store is the address
14100 to the real value, and not the value itself.
14102 * ecore.cs (PropertyExpr): use the new local temporary
14103 stuff to allow us to handle X.Y += z (where X is a struct)
14105 2004-07-08 Martin Baulig <martin@ximian.com>
14107 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
14108 not always return, just like we're doing in Using.Resolve().
14110 2004-07-07 Miguel de Icaza <miguel@ximian.com>
14112 * cs-parser.jay (fixed_statement): flag this as Pinned.
14114 2004-07-06 Miguel de Icaza <miguel@ximian.com>
14116 * typemanager.cs (TypeManager): Removed MakePinned method, this
14117 mechanism is replaced with the .NET 2.x compatible mechanism of
14118 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
14120 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
14121 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
14122 `IsFixed' property which has a different meaning.
14124 2004-07-02 Raja R Harinath <rharinath@novell.com>
14126 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
14127 visible from inside a nested class, not just the names of the
14128 immediately enclosing class.
14129 Fix for bug #60730.
14131 2004-06-24 Raja R Harinath <rharinath@novell.com>
14133 * expression.cs (BetterConversion): Remove buggy special-case
14134 handling of "implicit constant expression conversions". At this
14135 point, we already know that the conversion is possible -- we're
14136 only checking to see which is better.
14138 2004-06-24 Marek Safar <marek.safar@seznam.cz>
14140 * cs-parser.jay: Added error CS0210 test.
14142 2004-06-24 Marek Safar <marek.safar@seznam.cz>
14144 * cs-parser.jay: Added error CS0134 test.
14146 2004-06-24 Marek Safar <marek.safar@seznam.cz>
14149 * cs-parser.jay: Added error CS0145 test.
14151 2004-06-24 Marek Safar <marek.safar@seznam.cz>
14153 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
14155 2004-06-23 Ben Maurer <bmaurer@ximian.com>
14157 * expression.cs (StackAlloc.Resolve): The argument may not
14158 be a constant; deal with this case.
14160 2004-06-23 Marek Safar <marek.safar@seznam.cz>
14162 * attribute.cs (IndexerName_GetIndexerName): Renamed to
14163 GetIndexerAttributeValue.
14164 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
14166 * class.cs (Indexer.Define): Added error tests for CS0415,
14169 2004-06-23 Miguel de Icaza <miguel@ximian.com>
14171 * attribute.cs (Attribute.Resolve): Keep field code in sync with
14174 2004-06-23 Martin Baulig <martin@ximian.com>
14176 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
14177 neither return nor throw, reset the barrier as well. Fixes #60457.
14179 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
14181 * class.cs : EventAttributes is now set to None by default.
14182 This fixes bug #60459.
14184 2004-06-18 Marek Safar <marek.safar@seznam.cz>
14187 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
14188 Don't throw exception but return null (it's sufficient now).
14190 2004-06-18 Marek Safar <marek.safar@seznam.cz>
14192 * typemanager.cs (GetArgumentTypes): Faster implementation.
14194 2004-06-18 Martin Baulig <martin@ximian.com>
14196 * attribute.cs (Attribute.Resolve): Check whether we're an
14197 EmptyCast which a Constant child. Fixes #60333.
14199 2004-06-17 Ben Maurer <bmaurer@ximian.com>
14201 * statement.cs (EmitCollectionForeach): Account for the fact that
14202 not all valuetypes are in areas which we can take the address of.
14203 For these variables, we store to a temporary variable. Also, make
14204 sure that we dont emit a `callvirt' on a valuetype method.
14206 2004-06-15 Marek Safar <marek.safar@seznam.cz>
14208 * expression.cs (StackAlloc.DoReSolve): Added test for
14209 negative parameter (CS0247).
14211 2004-06-15 Marek Safar <marek.safar@seznam.cz>
14214 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
14216 2004-06-15 Marek Safar <marek.safar@seznam.cz>
14219 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
14222 2004-06-14 Marek Safar <marek.safar@seznam.cz>
14224 Fix bug #58254 & cs1555.cs, cs1556.cs
14225 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
14227 2004-06-14 Marek Safar <marek.safar@seznam.cz>
14229 * cs-parser.jay: Added error CS1669 test for indexers.
14231 2004-06-11 Martin Baulig <martin@ximian.com>
14233 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
14234 call this twice: for params and varargs methods.
14236 2004-06-11 Marek Safar <marek.safar@seznam.cz>
14239 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
14241 2004-06-11 Marek Safar <marek.safar@seznam.cz>
14243 * attribute.cs (Attribute.GetValidTargets): Made public.
14246 (AbstractPropertyEventMethod): New class for better code sharing.
14247 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
14249 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
14251 2004-06-11 Raja R Harinath <rharinath@novell.com>
14254 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
14255 that the call to Resolve is part of a MemberAccess.
14256 (Expression.Resolve): Use it for SimpleName resolution.
14257 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
14258 Add 'intermediate' boolean argument.
14259 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
14260 error message when the SimpleName can be resolved ambiguously
14261 between an expression and a type.
14262 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
14264 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
14265 call on the left-side.
14267 2004-06-11 Marek Safar <marek.safar@seznam.cz>
14270 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
14272 2004-06-11 Marek Safar <marek.safar@seznam.cz>
14274 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
14276 2004-06-11 Martin Baulig <martin@ximian.com>
14278 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
14279 varargs methods if applicable.
14281 2004-06-11 Martin Baulig <martin@ximian.com>
14283 * expression.cs (Invocation.EmitCall): Don't use
14284 `method.CallingConvention == CallingConventions.VarArgs' since the
14285 method could also have `CallingConventions.HasThis'.
14287 2004-06-11 Marek Safar <marek.safar@seznam.cz>
14289 * class.cs (Event.GetSignatureForError): Implemented.
14290 Fixed crash in error test cs3010.cs
14292 2004-06-10 Miguel de Icaza <miguel@ximian.com>
14294 * cs-tokenizer.cs: Change the way we track __arglist to be
14295 consistent with the other keywords.
14297 2004-06-09 Miguel de Icaza <miguel@ximian.com>
14299 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
14302 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
14304 * codegen.cs: Check that all referenced assemblies have a strongname
14305 before strongnaming the compiled assembly. If not report error CS1577.
14306 Fix bug #56563. Patch by Jackson Harper.
14307 * typemanager.cs: Added a method to return all referenced assemblies.
14308 Fix bug #56563. Patch by Jackson Harper.
14310 2004-06-08 Marek Safar <marek.safar@seznam.cz>
14313 (Method.ApplyAttributeBuilder): Moved and added conditional
14314 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
14317 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
14319 2004-06-08 Marek Safar <marek.safar@seznam.cz>
14322 * class.cs: (EventField.attribute_targets): Changed default target.
14324 2004-06-08 Martin Baulig <martin@ximian.com>
14326 * expression.cs (Invocation.EmitCall): Enable varargs methods.
14328 2004-06-08 Martin Baulig <martin@ximian.com>
14330 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
14332 2004-06-07 Martin Baulig <martin@ximian.com>
14334 Added support for varargs methods.
14336 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
14339 * cs-parser.jay: Added support for `__arglist'.
14341 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
14343 * expression.cs (Argument.AType): Added `ArgList'.
14344 (Invocation): Added support for varargs methods.
14345 (ArglistAccess): New public class.
14346 (Arglist): New public class.
14348 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
14350 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
14351 a method's top-level block if the method has varargs.
14353 * support.cs (ReflectionParameters, InternalParameters): Added
14354 support for varargs methods.
14356 2004-06-07 Miguel de Icaza <miguel@ximian.com>
14358 * class.cs: Provide location in indexer error report.
14360 * driver.cs: Use standard names.
14362 * namespace.cs: Catch the use of using after a namespace has been
14363 declared also on using aliases.
14365 2004-06-03 Raja R Harinath <rharinath@novell.com>
14368 * typemanager.cs (closure_private_ok, closure_invocation_type)
14369 (closure_qualifier_type, closure_invocation_assembly)
14370 (FilterWithClosure): Move to ...
14371 (Closure): New internal nested class.
14372 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
14373 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
14374 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
14375 (MemberLookup, MemberLookupFailed): Use it.
14376 * expression.cs (New.DoResolve): Treat the lookup for the
14377 constructor as being qualified by the 'new'ed type.
14378 (Indexers.GetIndexersForTypeOrInterface): Update.
14380 2004-06-03 Marek Safar <marek.safar@seznam.cz>
14383 (GetConditionalAttributeValue): New method. Returns
14384 condition of ConditionalAttribute.
14385 (SearchMulti): New method. Returns all attributes of type 't'.
14386 Use it when attribute is AllowMultiple = true.
14387 (IsConditionalMethodExcluded): New method.
14390 (Method.IsExcluded): Implemented. Returns true if method has conditional
14391 attribute and the conditions is not defined (method is excluded).
14392 (IMethodData): Extended interface for ConditionalAttribute support.
14393 (PropertyMethod.IsExcluded): Implemented.
14396 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
14399 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
14402 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
14404 * expression.cs (ArrayCreationExpression): Make this just an
14405 `expression'. It can't be a statement, so the code here was
14408 2004-06-02 Marek Safar <marek.safar@seznam.cz>
14411 * typemanager.cs (GetFullNameSignature): New method for
14414 2004-06-02 Marek Safar <marek.safar@seznam.cz>
14417 * class.cs (MemberBase.GetSignatureForError): New virtual method.
14418 Use this method when MethodBuilder is null.
14419 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
14420 Added test for error CS0626 (MONO reports error for this situation).
14421 (IMethodData.GetSignatureForError): Extended interface.
14423 2004-06-01 Marek Safar <marek.safar@seznam.cz>
14426 (AttributeTester.GetObsoleteAttribute): Returns instance of
14427 ObsoleteAttribute when type is obsolete.
14430 (TypeContainer.VerifyObsoleteAttribute): Override.
14431 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
14432 (MethodCode.VerifyObsoleteAttribute): Override.
14433 (MemberBase.VerifyObsoleteAttribute): Override.
14436 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
14437 and report proper error.
14440 Delegate.VerifyObsoleteAttribute): Override.
14443 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
14444 and report proper error.
14445 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
14448 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
14452 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
14453 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
14454 Added test for ObsoleteAttribute.
14457 (Catch): Derived from Statement.
14459 2004-06-01 Marek Safar <marek.safar@seznam.cz>
14461 Fixed bug #59071 & cs0160.cs
14463 * statement.cs (Try.Resolve): Check here whether order of catch
14464 clauses matches their dependencies.
14466 2004-05-31 Miguel de Icaza <miguel@ximian.com>
14468 * Reverted patch to namespace.cs (Use lookuptypedirect). This
14469 caused a regression: #59343. Referencing nested classes from an
14470 assembly stopped working.
14472 2004-05-31 Martin Baulig <martin@ximian.com>
14474 MCS is now frozen for beta 2.
14476 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
14478 * convert.cs: add a trivial cache for overload operator resolution.
14480 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
14482 * decl.cs: If possible, use lookuptypedirect here. We can only do
14483 this if there is no `.' after the namespace. Avoids using
14484 LookupType, which does lots of slow processing.
14485 (FindNestedType) New method, does what it says :-).
14486 * namespace.cs: use LookupTypeDirect.
14487 * rootcontext.cs: use membercache, if possible.
14488 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
14490 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
14493 According to the spec,
14495 In a member access of the form E.I, if E is a single identifier,
14496 and if the meaning of E as a simple-name (§7.5.2) is a constant,
14497 field, property, localvariable, or parameter with the same type as
14498 the meaning of E as a type-name (§3.8), then both possible
14499 meanings of E are permitted.
14501 We did not check that E as a simple-name had the same type as E as
14504 This trivial check gives us 5-7% on bootstrap time.
14506 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
14508 * expression.cs (Invocation.OverloadResolve): Avoid the
14509 use of hashtables and boxing here by allocating on demand.
14511 2004-05-30 Martin Baulig <martin@ximian.com>
14513 * rootcontext.cs (RootContext.LookupType): Don't cache things if
14514 we're doing a silent lookup. Don't try to lookup nested types in
14515 TypeManager.object_type (thanks to Ben Maurer).
14517 2004-05-30 Martin Baulig <martin@ximian.com>
14519 Committing a patch from Ben Maurer.
14521 * rootcontext.cs (RootContext.LookupType): Cache negative results.
14523 2004-05-29 Martin Baulig <martin@ximian.com>
14525 * class.cs (IMethodData.ShouldIgnore): New method.
14527 * typemanager.cs (TypeManager.MethodFlags): Don't take a
14528 `Location' argument, we don't need it anywhere. Use
14529 `IMethodData.ShouldIgnore ()' instead of
14530 `MethodData.GetMethodFlags ()'.
14531 (TypeManager.AddMethod): Removed.
14532 (TypeManager.AddMethod2): Renamed to AddMethod.
14534 2004-05-29 Martin Baulig <martin@ximian.com>
14536 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
14538 * convert.cs (Convert.ImplicitReferenceConversion): If we're
14539 converting from a class type S to an interface type and we already
14540 have an object on the stack, don't box it again. Fixes #52578.
14542 2004-05-29 Martin Baulig <martin@ximian.com>
14544 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
14545 Added support for `params' parameters. Fixes #59267.
14547 2004-05-29 Martin Baulig <martin@ximian.com>
14549 * literal.cs (NullPointer): Provide a private .ctor which sets
14550 `type' to TypeManager.object_type. Fixes #59048.
14552 2004-05-29 Martin Baulig <martin@ximian.com>
14554 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
14555 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
14557 * ecore.cs (EventExpr.instance_expr): Make the field private.
14559 2004-05-26 Marek Safar <marek.safar@seznam.cz>
14561 Fixed bug #50080 & cs0214-2.cs
14562 * expression.cs (Cast.DoResolve): Check unsafe context here.
14564 * statement.cs (Resolve.DoResolve): Likewise.
14566 2004-05-26 Martin Baulig <martin@ximian.com>
14568 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
14570 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
14571 (RootContext.LookupType): Pass down the `silent' flag.
14573 2004-05-25 Martin Baulig <martin@ximian.com>
14576 (MethodGroupExpr.IdenticalTypeName): New public property.
14577 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
14578 expression actually refers to a type.
14580 2004-05-25 Martin Baulig <martin@ximian.com>
14582 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
14583 for #56176 and made it actually work.
14585 2004-05-25 Martin Baulig <martin@ximian.com>
14587 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
14588 (FieldExpr, PropertyExpr): Override and implement
14589 CacheTemporaries. Fixes #52279.
14591 2004-05-25 Miguel de Icaza <miguel@ximian.com>
14593 * location.cs: In the new compiler listing a file twice is a
14594 warning, not an error.
14596 2004-05-24 Martin Baulig <martin@ximian.com>
14598 * enum.cs (Enum.DefineType): For the `BaseType' to be a
14599 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
14601 2004-05-24 Martin Baulig <martin@ximian.com>
14603 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
14604 walking the `using' list. Fixes #53921.
14606 2004-05-24 Martin Baulig <martin@ximian.com>
14608 * const.cs (Const.LookupConstantValue): Added support for
14609 EmptyCast's; fixes #55251.
14611 2004-05-24 Martin Baulig <martin@ximian.com>
14613 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
14614 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
14615 which does the CS0135 check. The reason is that we first need to
14616 check whether the variable actually exists.
14618 2004-05-24 Martin Baulig <martin@ximian.com>
14620 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
14621 than RootContext.LookupType() to find the explicit interface
14622 type. Fixes #58584.
14624 2004-05-24 Raja R Harinath <rharinath@novell.com>
14626 * Makefile: Simplify. Use executable.make.
14627 * mcs.exe.sources: New file. List of sources of mcs.exe.
14629 2004-05-24 Anders Carlsson <andersca@gnome.org>
14633 Use the invariant culture when doing String.Compare for CLS case
14636 2004-05-23 Martin Baulig <martin@ximian.com>
14638 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
14639 don't have any dots. Fixes #52622, added cs0246-8.cs.
14641 * namespace.cs (NamespaceEntry.Lookup): Likewise.
14643 2004-05-23 Marek Safar <marek.safar@seznam.cz>
14645 * class.cs (MemberBase.Define): Reuse MemberType member for
14646 resolved type. Other methods can use it too.
14648 2004-05-23 Martin Baulig <martin@ximian.com>
14650 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
14651 the variable also exists in the current block (otherwise, we need
14652 to report a CS0103). Fixes #58670.
14654 2004-05-23 Martin Baulig <martin@ximian.com>
14656 * flowanalysis.cs (Reachability.Reachable): Compute this
14657 on-the-fly rather than storing it as a field.
14659 2004-05-23 Martin Baulig <martin@ximian.com>
14661 * flowanalysis.cs (Reachability.And): Manually compute the
14662 resulting `barrier' from the reachability.
14664 2004-05-23 Marek Safar <marek.safar@seznam.cz>
14667 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
14668 instance of ObsoleteAttribute when symbol is obsolete.
14671 (IMethodData): Extended interface for ObsoleteAttribute support.
14673 2004-05-22 Marek Safar <marek.safar@seznam.cz>
14675 * attribute.cs: Fix bug #55970
14677 2004-05-22 Marek Safar <marek.safar@seznam.cz>
14681 (GetObsoleteAttribute): New method. Creates the instance of
14683 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
14684 ObsoleteAttribute when member is obsolete.
14685 (AttributeTester.Report_ObsoleteMessage): Common method for
14686 Obsolete error/warning reporting.
14689 (TypeContainer.base_classs_type): New member for storing parent type.
14692 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
14693 for this MemberCore.
14695 2004-05-21 Marek Safar <marek.safar@seznam.cz>
14697 * attribute.cs, const.cs: Fix bug #58590
14699 2004-05-21 Martin Baulig <martin@ximian.com>
14701 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
14702 out parameters if the end of the method is unreachable. Fixes
14705 2004-05-21 Marek Safar <marek.safar@seznam.cz>
14707 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
14708 Hari was right, why extra method.
14710 2004-05-21 Marek Safar <marek.safar@seznam.cz>
14712 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
14714 2004-05-20 Martin Baulig <martin@ximian.com>
14716 Merged this back from gmcs to keep the differences to a minumum.
14718 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
14719 instead of a Declspace.
14720 (Attribute.ResolveType): Likewise.
14721 (Attributes.Search): Likewise.
14722 (Attributes.Contains): Likewise.
14723 (Attributes.GetClsCompliantAttribute): Likewise.
14725 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
14727 (MethodData.ApplyAttributes): Take an EmitContext instead of a
14730 2004-05-19 Marek Safar <marek.safar@seznam.cz>
14732 Fix bug #58688 (MCS does not report error when the same attribute
14735 * attribute.cs (Attribute.Emit): Distinction between null and default.
14737 2004-05-19 Raja R Harinath <rharinath@novell.com>
14739 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
14740 of a top-level attribute without an attribute target.
14741 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
14743 (Attribute.Conditional_GetConditionName),
14744 (Attribute.Obsolete_GetObsoleteMessage): Update.
14745 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
14746 part of ScanForIndexerName.
14747 (Attribute.CanIgnoreInvalidAttribute): New function.
14748 (Attribute.ScanForIndexerName): Move to ...
14749 (Attributes.ScanForIndexerName): ... here.
14750 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
14751 (Attributes.Search): New internal variant that can choose not to
14752 complain if types aren't resolved. The original signature now
14754 (Attributes.GetClsCompliantAttribute): Use internal variant, with
14755 complaints suppressed.
14756 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
14757 only if it not useful.
14758 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
14759 top-level for attributes that are shared between the assembly
14760 and a top-level class.
14761 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
14762 * class.cs: Update to reflect changes.
14763 (DefineIndexers): Fuse loops.
14764 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
14765 a couple more variants of attribute names.
14767 2004-05-18 Marek Safar <marek.safar@seznam.cz>
14769 Fix bug #52585 (Implemented explicit attribute declaration)
14772 (Attributable.ValidAttributeTargets): New abstract method. It gets
14773 list of valid attribute targets for explicit target declaration.
14774 (Attribute.Target): It holds target itself.
14775 (AttributeSection): Removed.
14776 (Attribute.CheckTargets): New method. It checks whether attribute
14777 target is valid for the current element.
14780 (EventProperty): New class. For events that are declared like
14781 property (with add and remove accessors).
14782 (EventField): New class. For events that are declared like field.
14785 * cs-parser.jay: Implemented explicit attribute target declaration.
14787 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
14788 Override ValidAttributeTargets.
14791 (ReturnParameter): Class for applying custom attributes on
14793 (ParameterAtribute): New class. Class for applying custom
14794 attributes on the parameter type.
14796 2004-05-17 Miguel de Icaza <miguel@ximian.com>
14798 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
14801 (Method): Allow UNSAFE here.
14803 * modifiers.cs: Support unsafe reporting.
14805 2004-05-17 Marek Safar <marek.safar@seznam.cz>
14807 * decl.cs: Fix bug #58478.
14809 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14811 * statement.cs: When checking for unreachable code on an EmptyStatement,
14812 set the location. Fixes bug #58488.
14814 2004-05-13 Miguel de Icaza <miguel@ximian.com>
14816 * driver.cs: Add -pkg handling.
14818 From Gonzalo: UseShelLExecute=false
14820 2004-05-12 Marek Safar <marek.safar@seznam.cz>
14823 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
14825 (Attribute.IsClsCompliaceRequired): Moved to base for better
14827 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
14828 when attribute is AttributeUsageAttribute.
14829 (Attribute.GetValidTargets): Simplified.
14830 (Attribute.GetAttributeUsage): New method returns AttributeUsage
14831 attribute for this type.
14832 (Attribute.ApplyAttributes): Method renamed to Emit and make
14834 (GlobalAttributeSection): New class for special handling of global
14835 attributes (assembly, module).
14836 (AttributeSection.Emit): New method.
14838 * class.cs: Implemented Attributable abstract methods.
14839 (MethodCore.LabelParameters): Moved to Parameter class.
14840 (Accessor): Is back simple class.
14841 (PropertyMethod): Implemented Attributable abstract class.
14842 (DelegateMethod): Implemented Attributable abstract class.
14843 (Event): New constructor for disctintion between normal Event
14844 and Event with accessors.
14846 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
14848 * codegen.cs, const.cs, decl.cs, delegate.cs:
14849 (CommonAssemblyModulClass): Implemented Attributable abstract class
14852 * enum.cs: Implement IAttributeSupport interface.
14853 (EnumMember): New class for emum members. Implemented Attributable
14857 (ParameterBase): Is abstract.
14858 (ReturnParameter): New class for easier [return:] attribute handling.
14860 * typemanager.cs: Removed builder_to_attr.
14862 2004-05-11 Raja R Harinath <rharinath@novell.com>
14865 * attribute.cs (Attribute.GetPositionalValue): New function.
14866 * class.cs (TypeContainer.VerifyMembers): New function.
14867 (TypeContainer.Emit): Use it.
14868 (ClassOrStruct): New base class for Class and Struct.
14869 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
14870 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
14872 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
14873 then each non-static field should have a FieldOffset attribute.
14874 Otherwise, none of the fields should have a FieldOffset attribute.
14875 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
14876 and FieldOffset attributes.
14877 * typemanager.cs (TypeManager.struct_layout_attribute_type)
14878 (TypeManager.field_offset_attribute_type): New core types.
14879 (TypeManager.InitCoreTypes): Initialize them.
14881 2004-05-11 Michal Moskal <malekith@pld-linux.org>
14883 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
14884 Return correct type.
14887 2004-05-09 Miguel de Icaza <miguel@ximian.com>
14889 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
14890 be implicitly converted to ulong.
14892 * expression.cs: The logic for allowing operator &, | and ^ worked
14893 was wrong, it worked before because we did not report an error in
14894 an else branch. Fixes 57895.
14896 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
14897 allow volatile fields to be reference types.
14899 2004-05-07 Miguel de Icaza <miguel@ximian.com>
14901 * driver.cs: Add support for /debug-
14903 2004-05-07 Raja R Harinath <rharinath@novell.com>
14905 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
14906 Add a 'complain' parameter to silence errors.
14907 (Attribute.Resolve): Update to changes. Put in sanity check to catch
14908 silently overlooked type-resolutions.
14909 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
14910 to reflect changes.
14911 (Attributes.Search): New function.
14912 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
14913 (Attributes.GetAttributeFullName): Remove hack.
14914 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
14915 Update to reflect changes.
14916 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
14917 Use Attributes.Search instead of nested loops.
14919 2004-05-07 Marek Safar <marek.safar@seznam.cz>
14922 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
14923 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
14924 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
14926 * report.cs: (Report.Warning): Renamed to Warning_T because of
14927 parameter collision.
14929 2004-05-05 Raja R Harinath <rharinath@novell.com>
14931 * expression.cs (MemberAccess.ResolveMemberAccess):
14932 Exit with non-zero status after Report.Error.
14933 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
14935 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
14937 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
14939 * support.cs: Don't hang when the file is empty.
14941 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
14943 * support.cs: In SeekableStreamReader, compute the preamble size of the
14944 underlying stream. Position changes should take into account that initial
14947 2004-05-03 Todd Berman <tberman@sevenl.net>
14949 * driver.cs: remove unused GetSysVersion function.
14951 2004-05-03 Todd Berman <tberman@sevenl.net>
14953 * driver.cs: Remove the hack from saturday, as well as the hack
14954 from jackson (LoadAssemblyFromGac), also adds the CWD to the
14955 link_paths to get that bit proper.
14957 2004-05-01 Todd Berman <tberman@sevenl.net>
14959 * driver.cs: Try a LoadFrom before a Load, this checks the current
14960 path. This is currently a bug in mono that is be fixed, however, this
14961 provides a workaround for now. This will be removed when the bug
14964 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
14966 * CryptoConvert.cs: Updated to latest version. Fix issue with
14967 incomplete key pairs (#57941).
14969 2004-05-01 Todd Berman <tberman@sevenl.net>
14971 * driver.cs: Remove '.' from path_chars, now System.* loads properly
14974 2004-04-30 Jackson Harper <jackson@ximian.com>
14976 * codegen.cs: Open keys readonly.
14978 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14980 * typemanager.cs: don't report cyclic struct layout when a struct
14981 contains 2 or more fields of the same type. Failed for Pango.AttrShape
14982 which has 2 Pango.Rectangle fields.
14984 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
14986 * expression.cs: Handle IntPtr comparisons with IL code
14987 rather than a method call.
14989 2004-04-29 Martin Baulig <martin@ximian.com>
14991 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
14992 the list of PropertyInfo's in class hierarchy and find the
14993 accessor. Fixes #56013.
14995 2004-04-29 Martin Baulig <martin@ximian.com>
14997 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
14999 2004-04-29 Martin Baulig <martin@ximian.com>
15001 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
15003 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
15005 2004-04-29 Martin Baulig <martin@ximian.com>
15007 * class.cs (ConstructorInitializer.Resolve): Check whether the
15008 parent .ctor is accessible. Fixes #52146.
15010 2004-04-29 Martin Baulig <martin@ximian.com>
15012 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
15014 * statement.cs (Using.EmitLocalVariableDecls): Use
15015 TypeManager.idisposable_type, not typeof (IDisposable).
15016 (Foreach.EmitCollectionForeach): Added support for valuetypes.
15018 2004-04-29 Martin Baulig <martin@ximian.com>
15020 * class.cs (Event.Define): Don't emit the field and don't set
15021 RTSpecialName and SpecialName for events on interfaces. Fixes
15024 2004-04-29 Raja R Harinath <rharinath@novell.com>
15026 Refactor Attribute.ApplyAttributes.
15027 * attribute.cs (Attributable): New base class for objects that can
15028 have Attributes applied on them.
15029 (Attribute): Make AttributeUsage fields public.
15030 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
15031 (Attribute.IsInternalCall): New property.
15032 (Attribute.UsageAttr): Convert to a public read-only property.
15033 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
15034 (Attribute.ResolveType, Attribute.Resolve)
15035 (Attribute.ScanForIndexerName): Update to reflect changes.
15036 (Attribute.CheckAttributeTarget): Re-format.
15037 (Attribute.ApplyAttributes): Refactor, to various
15038 Attributable.ApplyAttributeBuilder methods.
15039 * decl.cs (MemberCore): Make Attributable.
15040 * class.cs (Accessor): Make Attributable.
15041 (MethodData.ApplyAttributes): Use proper attribute types, not
15043 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
15044 (TypeContainer.ApplyAttributeBuilder)
15045 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
15046 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
15047 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
15048 (Operator.ApplyAttributeBuilder): New factored-out methods.
15049 * const.cs (Const.ApplyAttributeBuilder): Likewise.
15050 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
15051 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
15052 * parameter.cs (ParameterBase): New Attributable base class
15053 that can also represent Return types.
15054 (Parameter): Update to the changes.
15056 2004-04-29 Jackson Harper <jackson@ximian.com>
15058 * driver.cs: Prefer the corlib system version when looking for
15059 assemblies in the GAC. This is still a hack, but its a better hack
15062 2004-04-29 Marek Safar <marek.safar@seznam.cz>
15064 * decl.cs, enum.cs: Improved error 3005 reporting.
15066 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
15067 (related_symbols): New private member for list of symbols
15068 related to reported error/warning.
15070 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
15072 2004-04-29 Martin Baulig <martin@ximian.com>
15074 * ecore.cs (Expression.Constantify): If we're an enum and
15075 TypeManager.TypeToCoreType() doesn't give us another type, use
15076 t.UnderlyingSystemType. Fixes #56178.
15078 2004-04-29 Martin Baulig <martin@ximian.com>
15080 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
15081 interfaces and for each interface, only add members directly
15082 declared in that interface. Fixes #53255.
15084 2004-04-28 Martin Baulig <martin@ximian.com>
15086 * expression.cs (ConditionalLogicalOperator): Use a temporary
15087 variable for `left' to avoid that we evaluate it more than once;
15090 2004-04-28 Martin Baulig <martin@ximian.com>
15092 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
15095 2004-04-28 Martin Baulig <martin@ximian.com>
15097 * statement.cs (LocalInfo.Resolve): Check whether the type is not
15100 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
15101 whether the type is not void (CS1547).
15103 2004-04-28 Martin Baulig <martin@ximian.com>
15105 * expression.cs (Unary.DoResolveLValue): Override this and report
15106 CS0131 for anything but Operator.Indirection.
15108 2004-04-28 Martin Baulig <martin@ximian.com>
15110 Committing a patch from Ben Maurer; see bug #50820.
15112 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
15115 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
15118 2004-04-28 Martin Baulig <martin@ximian.com>
15120 Committing a patch from Ben Maurer; see bug #50820.
15122 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
15125 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
15128 2004-04-28 Martin Baulig <martin@ximian.com>
15130 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
15131 (Block.AddLabel): Call DoLookupLabel() to only search in the
15134 2004-04-28 Martin Baulig <martin@ximian.com>
15136 * cfold.cs (ConstantFold.BinaryFold): Added special support for
15137 comparing StringConstants and NullLiterals in Equality and Inequality.
15139 2004-04-28 Jackson Harper <jackson@ximian.com>
15141 * driver.cs: Attempt to load referenced assemblies from the
15142 GAC. This is the quick and dirty version of this method that
15143 doesnt take into account versions and just takes the first
15144 canidate found. Will be good enough for now as we will not have more
15145 then one version installed into the GAC until I update this method.
15147 2004-04-28 Martin Baulig <martin@ximian.com>
15149 * typemanager.cs (TypeManager.CheckStructCycles): New public
15150 static method to check for cycles in the struct layout.
15152 * rootcontext.cs (RootContext.PopulateTypes): Call
15153 TypeManager.CheckStructCycles() for each TypeContainer.
15154 [Note: We only need to visit each type once.]
15156 2004-04-28 Martin Baulig <martin@ximian.com>
15158 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
15160 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
15161 success and added `out object value'. Use a `bool resolved' field
15162 to check whether we've already been called rather than
15163 `ConstantValue != null' since this breaks for NullLiterals.
15165 2004-04-28 Raja R Harinath <rharinath@novell.com>
15167 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
15168 setting of this flag, since the 'set' method may be non-public.
15170 2004-04-28 Raja R Harinath <rharinath@novell.com>
15172 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
15173 check on current_vector.Block.
15175 2004-04-27 Martin Baulig <martin@ximian.com>
15177 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
15178 a field initializer. Fixes #56459.
15180 2004-04-27 Martin Baulig <martin@ximian.com>
15182 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
15183 we're not attempting to use an indexer. Fixes #52154.
15185 2004-04-27 Martin Baulig <martin@ximian.com>
15187 * statement.cs (Return): Don't create a return label if we don't
15188 need it; reverts my change from January 20th. Thanks to Ben
15191 2004-04-27 Martin Baulig <martin@ximian.com>
15193 According to the spec, `goto' can only leave a nested scope, but
15196 * statement.cs (Block.LookupLabel): Only lookup in the current
15197 block, don't recurse into parent or child blocks.
15198 (Block.AddLabel): Check in parent and child blocks, report
15199 CS0140/CS0158 if we find a duplicate.
15200 (Block): Removed this indexer for label lookups.
15201 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
15202 this already does the error reporting for us.
15205 (FlowBranching.UsageVector.Block): New public variable; may be null.
15206 (FlowBranching.CreateSibling): Added `Block' argument.
15207 (FlowBranching.LookupLabel): New public virtual method. Lookup a
15208 label for the target of a `goto' and check whether we're not
15209 leaving a `finally'.
15211 2004-04-27 Martin Baulig <martin@ximian.com>
15213 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
15214 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
15217 2004-04-27 Martin Baulig <martin@ximian.com>
15219 * statement.cs (Block.AddLabel): Also check for implicit blocks
15220 and added a CS0158 check.
15222 2004-04-27 Martin Baulig <martin@ximian.com>
15224 * flowanalysis.cs (FlowBranchingLoop): New class.
15225 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
15226 UsageVector's instead of an ArrayList.
15227 (FlowBranching.Label): Likewise.
15228 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
15229 (FlowBranching.AddBreakVector): New method.
15231 2004-04-27 Miguel de Icaza <miguel@ximian.com>
15233 * attribute.cs: Small regression fix: only convert the type if we
15234 the type is different, fixes System.Drawing build.
15236 2004-04-27 Martin Baulig <martin@ximian.com>
15238 * attribute.cs (Attribute.Resolve): If we have a constant value
15239 for a named field or property, implicity convert it to the correct
15242 2004-04-27 Raja R Harinath <rharinath@novell.com>
15244 * statement.cs (Block.Block): Implicit blocks share
15245 'child_variable_names' fields with parent blocks.
15246 (Block.AddChildVariableNames): Remove.
15247 (Block.AddVariable): Mark variable as "used by a child block" in
15248 every surrounding block.
15249 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
15250 been used in a child block, complain about violation of "Invariant
15251 meaning in blocks" rule.
15252 * cs-parser.jay (declare_local_variables): Don't use
15253 AddChildVariableNames.
15254 (foreach_statement): Don't create an implicit block: 'foreach'
15255 introduces a scope.
15257 2004-04-23 Miguel de Icaza <miguel@ximian.com>
15259 * convert.cs (ImplicitNumericConversion): 0 is also positive when
15260 converting from 0L to ulong. Fixes 57522.
15262 2004-04-22 Marek Safar <marek.safar@seznam.cz>
15264 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
15265 derived class hides via 'new' keyword field from base class (test-242.cs).
15266 TODO: Handle this in the more general way.
15268 * class.cs (CheckBase): Ditto.
15270 2004-04-22 Marek Safar <marek.safar@seznam.cz>
15272 * decl.cs (caching_flags): New member for storing cached values
15274 (MemberCore.Flags): New enum where bit flags for caching_flags
15276 (MemberCore.cls_compliance): Moved to caching_flags.
15277 (DeclSpace.Created): Moved to caching_flags.
15279 * class.cs: Use caching_flags instead of DeclSpace.Created
15281 2004-04-21 Miguel de Icaza <miguel@ximian.com>
15283 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
15284 if we are only a derived class, not a nested class.
15286 * typemanager.cs: Same as above, but do this at the MemberLookup
15287 level (used by field and methods, properties are handled in
15288 PropertyExpr). Allow for the qualified access if we are a nested
15291 2004-04-21 Marek Safar <marek.safar@seznam.cz>
15293 * class.cs: Refactoring.
15294 (IMethodData): New inteface; Holds links to parent members
15295 to avoid member duplication (reduced memory allocation).
15296 (Method): Implemented IMethodData interface.
15297 (PropertyBase): New inner classes for get/set methods.
15298 (PropertyBase.PropertyMethod): Implemented IMethodData interface
15299 (Event): New inner classes for add/remove methods.
15300 (Event.DelegateMethod): Implemented IMethodData interface.
15302 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
15303 EmitContext (related to class.cs refactoring).
15305 2004-04-21 Raja R Harinath <rharinath@novell.com>
15307 * delegate.cs (Delegate.VerifyApplicability): If the number of
15308 arguments are the same as the number of parameters, first try to
15309 verify applicability ignoring any 'params' modifier on the last
15313 2004-04-16 Raja R Harinath <rharinath@novell.com>
15315 * class.cs (TypeContainer.AddIndexer): Use
15316 'ExplicitInterfaceName' to determine if interface name was
15317 explicitly specified. 'InterfaceType' is not initialized at this time.
15318 (TypeContainer.DefineIndexers): Remove use of temporary list. The
15319 Indexers array is already in the required order. Initialize
15320 'IndexerName' only if there are normal indexers.
15321 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
15322 (TypeContainer.Emit): Emit DefaultMember attribute only if
15323 IndexerName is initialized.
15326 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
15328 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
15331 2004-04-15 Raja R Harinath <rharinath@novell.com>
15333 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
15337 * attribute.cs (Attribute.Resolve): Check for duplicate named
15341 2004-04-15 Miguel de Icaza <miguel@ximian.com>
15343 * iterators.cs (MarkYield): track whether we are in an exception,
15344 and generate code accordingly. Use a temporary value to store the
15345 result for our state.
15347 I had ignored a bit the interaction of try/catch with iterators
15348 since their behavior was not entirely obvious, but now it is
15349 possible to verify that our behavior is the same as MS .NET 2.0
15353 2004-04-14 Miguel de Icaza <miguel@ximian.com>
15355 * iterators.cs: Avoid creating temporaries if there is no work to
15358 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
15359 Enumerations, use TypeManager.EnumToUnderlying and call
15362 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
15365 (This.Emit): Use EmitContext.EmitThis to emit our
15368 (This.EmitAssign): Ditto.
15370 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
15371 codepaths, we will move all the functionality into
15374 (FieldExpr.EmitAssign): Ditto.
15376 This fixes several hidden bugs that I uncovered while doing a code
15377 review of this today.
15379 * codegen.cs (EmitThis): reworked so the semantics are more clear
15380 and also support value types "this" instances.
15382 * iterators.cs: Changed so that for iterators in value types, we
15383 do not pass the value type as a parameter.
15385 Initialization of the enumerator helpers is now done in the caller
15386 instead of passing the parameters to the constructors and having
15387 the constructor set the fields.
15389 The fields have now `assembly' visibility instead of private.
15391 2004-04-11 Miguel de Icaza <miguel@ximian.com>
15393 * expression.cs (Argument.Resolve): Check if fields passed as ref
15394 or out are contained in a MarshalByRefObject.
15396 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
15397 another compiler type.
15399 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
15401 * class.cs (Indexer.Define): use the new name checking method.
15402 Also, return false on an error.
15403 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
15404 (is_identifier_[start/part]_character): make static.
15406 2004-04-10 Miguel de Icaza <miguel@ximian.com>
15408 * expression.cs (Binary.ResolveOperator): Do no append strings
15409 twice: since we can be invoked more than once (array evaluation)
15410 on the same concatenation, take care of this here. Based on a fix
15411 from Ben (bug #56454)
15413 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
15415 * codegen.cs: Fix another case where CS1548 must be reported (when
15416 delay-sign isn't specified and no private is available #56564). Fix
15417 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
15418 error when MCS is used on the MS runtime and we need to delay-sign
15419 (which seems unsupported by AssemblyBuilder - see #56621).
15421 2004-04-08 Marek Safar <marek.safar@seznam.cz>
15423 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
15424 (TypeManager.ComputeNamespaces): Faster implementation for
15427 * compiler.csproj: Updated AssemblyName to mcs.
15429 2004-04-07 Miguel de Icaza <miguel@ximian.com>
15431 * rootcontext.cs: Add new types to the boot resolution.
15433 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
15434 MulticastDelegate is not allowed.
15436 * typemanager.cs: Add new types to lookup: System.TypedReference
15439 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
15440 check for TypedReference or ArgIterator, they are not allowed.
15442 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
15443 makes us properly catch 1510 in some conditions (see bug 56016 for
15446 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
15448 * CryptoConvert.cs: update from corlib version
15451 2004-04-05 Miguel de Icaza <miguel@ximian.com>
15453 * class.cs (Indexer.Define): Check indexername declaration
15455 2004-04-05 Marek Safar <marek.safar@seznam.cz>
15457 * attribute.cs (IsClsCompliant): Fixed problem with handling
15458 all three states (compliant, not-compliant, undetected).
15460 2004-03-30 Marek Safar <marek.safar@seznam.cz>
15462 * attribute.cs (Attribute): Location is now public.
15463 (Resolve): Store resolved arguments (pos_values) in attribute class.
15464 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
15465 (GetClsCompliantAttributeValue): New method that gets
15466 CLSCompliantAttribute value.
15467 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
15468 if exists else null.
15469 (AttributeTester): New class for CLS-Compliant verification routines.
15471 * class.cs (Emit): Add CLS-Compliant verification.
15472 (Method.GetSignatureForError): Implemented.
15473 (Constructor.GetSignatureForError): Implemented
15474 (Constructor.HasCompliantArgs): Returns if constructor has
15475 CLS-Compliant arguments.
15476 (Constructor.Emit): Override.
15477 (Construcor.IsIdentifierClsCompliant): New method; For constructors
15478 is needed to test only parameters.
15479 (FieldBase.GetSignatureForError): Implemented.
15480 (TypeContainer): New member for storing base interfaces.
15481 (TypeContainer.FindMembers): Search in base interfaces too.
15483 * codegen.cs (GetClsComplianceAttribute): New method that gets
15484 assembly or module CLSCompliantAttribute value.
15485 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
15487 (ModuleClass.Emit): Add error 3012 test.
15489 * const.cs (Emit): Override and call base for CLS-Compliant tests.
15491 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
15492 state for all decl types.
15493 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
15494 if CLS-Compliant tests are required.
15495 (IsClsCompliaceRequired): New method. Analyze whether code
15496 must be CLS-Compliant.
15497 (IsExposedFromAssembly): New method. Returns true when MemberCore
15498 is exposed from assembly.
15499 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
15500 value or gets cached value.
15501 (HasClsCompliantAttribute): New method. Returns true if MemberCore
15502 is explicitly marked with CLSCompliantAttribute.
15503 (IsIdentifierClsCompliant): New abstract method. This method is
15504 used to testing error 3005.
15505 (IsIdentifierAndParamClsCompliant): New method. Common helper method
15506 for identifier and parameters CLS-Compliant testing.
15507 (VerifyClsCompliance): New method. The main virtual method for
15508 CLS-Compliant verifications.
15509 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
15510 null. I don't know why is null (too many public members !).
15511 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
15512 and get value of first CLSCompliantAttribute that found.
15514 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
15515 (VerifyClsCompliance): Override and add extra tests.
15517 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
15518 clscheck- disable CLS-Compliant verification event if assembly is has
15519 CLSCompliantAttribute(true).
15521 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
15522 ApllyAttribute is now called in emit section as in the other cases.
15523 Possible future Emit integration.
15524 (IsIdentifierClsCompliant): New override.
15525 (VerifyClsCompliance): New override.
15526 (GetEnumeratorName): Returns full enum name.
15528 * parameter.cs (GetSignatureForError): Implemented.
15530 * report.cs (WarningData): New struct for Warning message information.
15531 (LocationOfPreviousError): New method.
15532 (Warning): New method. Reports warning based on the warning table.
15533 (Error_T): New method. Reports error based on the error table.
15535 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
15536 verifications are done here.
15538 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
15540 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
15541 CLSCompliantAttribute.
15542 (all_imported_types): New member holds all imported types from other
15544 (LoadAllImportedTypes): New method fills static table with exported types
15545 from all referenced assemblies.
15546 (Modules): New property returns all assembly modules.
15548 2004-03-30 Miguel de Icaza <miguel@ximian.com>
15550 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
15551 throwing a parser error.
15553 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
15554 which removes the hardcoded get_/set_ prefixes for properties, as
15555 IL allows for the properties to be named something else.
15559 * expression.cs: Do not override operand before we know if it is
15560 non-null. Fix 56207
15562 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
15564 * typemanager.cs: support for pinned variables.
15566 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
15568 * decl.cs, typemanager.cs: Avoid using an arraylist
15569 as a buffer if there is only one result set.
15571 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
15573 * expression.cs: Make sure you cant call a static method
15574 with an instance expression, bug #56174.
15576 2004-03-29 Miguel de Icaza <miguel@ximian.com>
15578 * class.cs (IsDuplicateImplementation): Improve error reporting to
15579 flag 663 (method only differs in parameter modifier).
15581 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
15582 in preprocessor directives.
15584 * location.cs (LookupFile): Allow for the empty path.
15586 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
15587 better approach for some of that patch, but its failing with the
15588 CharSet enumeration. For now try/catch will do.
15590 * typemanager.cs: Do not crash if a struct does not have fields.
15593 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
15595 * expression.cs: cs0213, cant fix a fixed expression.
15598 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
15600 * cs-parser.jay: detect invalid embeded statements gracefully.
15603 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
15605 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
15608 the invocation type may not be a subclass of the tye of the item/
15609 The type of the item must be a subclass of the invocation item.
15614 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
15616 * attribute.cs: Added methods to get a string and a bool from an
15617 attribute. Required to information from AssemblyKeyFileAttribute,
15618 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
15619 * codegen.cs: Modified AssemblyName creation to include support for
15620 strongnames. Catch additional exceptions to report them as CS1548.
15621 * compiler.csproj: Updated include CryptoConvert.cs.
15622 * compiler.csproj.user: Removed file - user specific configuration.
15623 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
15624 Mono.Security assembly. The original class is maintained and tested in
15625 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
15626 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
15627 like CSC 8.0 (C# v2) supports.
15628 * Makefile: Added CryptoConvert.cs to mcs sources.
15629 * rootcontext.cs: Added new options for strongnames.
15631 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
15633 * driver.cs: For --expect-error, report error code `2'
15634 if the program compiled with no errors, error code `1' if
15635 it compiled with an error other than the one expected.
15637 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
15639 * compiler.csproj: Updated for Visual Studio .NET 2003.
15640 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
15641 * compiler.sln: Updated for Visual Studio .NET 2003.
15643 2004-03-24 Ravi Pratap M <ravi@ximian.com>
15645 * expression.cs: Fix bug #47234. We basically need to apply the
15646 rule that we prefer the conversion of null to a reference type
15647 when faced with a conversion to 'object' (csc behaviour).
15649 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
15651 * statement.cs: Shorter form for foreach, eliminates
15652 a local variable. r=Martin.
15654 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
15656 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
15657 checks if we can use brtrue/brfalse to test for 0.
15658 * expression.cs: use the above in the test for using brtrue/brfalse.
15659 cleanup code a bit.
15661 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
15663 * expression.cs: Rewrite string concat stuff. Benefits:
15665 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
15666 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
15667 rather than a concat chain.
15669 * typemanager.cs: Add lookups for more concat overloads.
15671 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
15673 * expression.cs: Emit shorter il code for array init.
15690 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
15692 * statement.cs: Before, two switch blocks would be merged if the
15693 total size of the blocks (end_item - begin_item + 1) was less than
15694 two times the combined sizes of the blocks.
15696 Now, it will only merge if after the merge at least half of the
15701 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
15703 * class.cs : csc build fix for GetMethods(). See bug #52503.
15705 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
15707 * expression.cs: Make sure fp comparisons work with NaN.
15708 This fixes bug #54303. Mig approved this patch a long
15709 time ago, but we were not able to test b/c the runtime
15712 2004-03-19 Miguel de Icaza <miguel@ximian.com>
15714 * ecore.cs (TypExpr.GetHashCode): implement this overload.
15716 2004-03-19 Martin Baulig <martin@ximian.com>
15718 * class.cs (MemberCore.IsDuplicateImplementation): Report the
15719 error here and not in our caller.
15721 2004-03-19 Martin Baulig <martin@ximian.com>
15723 * interface.cs: Completely killed this file.
15724 (Interface): We're now a TypeContainer and live in class.cs.
15726 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
15727 argument; we're now also called for interfaces.
15728 (TypeContainer.DefineMembers): Allow this method being called
15730 (TypeContainer.GetMethods): New public method; formerly known as
15731 Interface.GetMethod(). This is used by PendingImplementation.
15732 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
15733 it's now private and non-static.
15734 (Interface): Moved this here; it's now implemented similar to
15736 (Method, Property, Event, Indexer): Added `bool is_interface'
15737 argument to their .ctor's.
15738 (MemberBase.IsInterface): New public field.
15740 * cs-parser.jay: Create normal Method, Property, Event, Indexer
15741 instances instead of InterfaceMethod, InterfaceProperty, etc.
15742 (opt_interface_base): Removed; we now use `opt_class_base' instead.
15743 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
15745 2004-03-19 Martin Baulig <martin@ximian.com>
15747 * class.cs (MethodCore.IsDuplicateImplementation): New private
15748 method which does the CS0111 checking.
15749 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
15750 Use IsDuplicateImplementation().
15752 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
15754 * decl.cs (FindMemberToOverride): New method to find the correct
15755 method or property to override in the base class.
15757 - Make Method/Property use the above method to find the
15758 version in the base class.
15759 - Remove the InheritableMemberSignatureCompare as it is now
15762 This patch makes large code bases much faster to compile, as it is
15763 O(n) rather than O(n^2) to do this validation.
15765 Also, it fixes bug 52458 which is that nested classes are not
15766 taken into account when finding the base class member.
15768 Reviewed/Approved by Martin.
15770 2004-03-17 Marek Safar <marek.safar@seznam.cz>
15772 * interface.cs: In all interface classes removed redundant
15773 member initialization.
15775 2004-03-16 Martin Baulig <martin@ximian.com>
15777 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
15779 2004-03-15 Miguel de Icaza <miguel@ximian.com>
15781 * decl.cs (DefineTypeAndParents): New helper method to define a
15782 type's containers before the type itself is defined; This is a
15783 bug exposed by the recent changes to Windows.Forms when an
15784 implemented interface was defined inside a class that had not been
15787 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
15789 (Check): Loop correctly to report errors modifiers
15790 (UNSAFE was not in the loop, since it was the same as TOP).
15792 * interface.cs: Every interface member now takes a ModFlags,
15793 instead of a "is_new" bool, which we set on the base MemberCore.
15795 Every place where we called "UnsafeOk" in the interface, now we
15796 call the proper member (InterfaceMethod.UnsafeOK) instead to get
15797 the unsafe settings from the member declaration instead of the
15798 container interface.
15800 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
15802 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
15803 `set_indexer_name' to the pending bits (one per type).
15805 We fixed a bug today that was picking the wrong method to
15806 override, since for properties the existing InterfaceMethod code
15807 basically ignored the method name. Now we make sure that the
15808 method name is one of the valid indexer names.
15810 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
15812 * support.cs (SeekableStreamReader): Keep track of stream byte
15813 positions and don't mix them with character offsets to the buffer.
15815 Patch from Gustavo Giráldez
15817 2004-03-15 Marek Safar <marek.safar@seznam.cz>
15819 * interface.cs (InterfaceSetGetBase): Removed double member
15820 initialization, base class does it as well.
15822 2004-03-13 Martin Baulig <martin@ximian.com>
15824 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
15825 when compiling corlib.
15827 2004-03-13 Miguel de Icaza <miguel@ximian.com>
15829 * convert.cs (ExplicitConversion): We were reporting an error on
15830 certain conversions (object_type source to a value type, when the
15831 expression was `null') before we had a chance to pass it through
15832 the user defined conversions.
15834 * driver.cs: Replace / and \ in resource specifications to dots.
15837 * class.cs: Add check for duplicate operators. Fixes 52477
15839 2004-03-11 Miguel de Icaza <miguel@ximian.com>
15841 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
15842 that are in the middle of the statements, not only at the end.
15845 * class.cs (TypeContainer.AddField): No longer set the
15846 `HaveStaticConstructor' flag, now we call it
15847 `UserDefineStaticConstructor' to diferentiate the slightly
15848 semantic difference.
15850 The situation is that we were not adding BeforeFieldInit (from
15851 Modifiers.TypeAttr) to classes that could have it.
15852 BeforeFieldInit should be set to classes that have no static
15857 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
15859 And most importantly Zoltan's comment:
15861 http://bugzilla.ximian.com/show_bug.cgi?id=44229
15863 "I think beforefieldinit means 'it's ok to initialize the type sometime
15864 before its static fields are used', i.e. initialization does not need
15865 to be triggered by the first access to the type. Setting this flag
15866 helps the JIT to compile better code, since it can run the static
15867 constructor at JIT time, and does not need to generate code to call it
15868 (possibly lots of times) at runtime. Unfortunately, mcs does not set
15869 this flag for lots of classes like String.
15871 csc sets this flag if the type does not have an explicit static
15872 constructor. The reasoning seems to be that if there are only static
15873 initalizers for a type, and no static constructor, then the programmer
15874 does not care when this initialization happens, so beforefieldinit
15877 This bug prevents the AOT compiler from being usable, since it
15878 generates so many calls to mono_runtime_class_init that the AOT code
15879 is much slower than the JITted code. The JITted code is faster,
15880 because it does not generate these calls if the vtable is type is
15881 already initialized, which is true in the majority of cases. But the
15882 AOT compiler can't do this."
15884 2004-03-10 Miguel de Icaza <miguel@ximian.com>
15886 * class.cs (MethodData.Emit): Refactor the code so symbolic
15887 information is generated for destructors; For some reasons we
15888 were taking a code path that did not generate symbolic information
15891 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
15893 * class.cs: Create a Constructor.CheckBase method that
15894 takes care of all validation type code. The method
15895 contains some code that was moved from Define.
15897 It also includes new code that checks for duplicate ctors.
15898 This fixes bug #55148.
15900 2004-03-09 Joshua Tauberer <tauberer@for.net>
15902 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
15903 a { ... }-style array creation invokes EmitStaticInitializers
15904 which is not good for reference-type arrays. String, decimal
15905 and now null constants (NullCast) are not counted toward
15906 static initializers.
15908 2004-03-05 Martin Baulig <martin@ximian.com>
15910 * location.cs (SourceFile.HasLineDirective): New public field;
15911 specifies whether the file contains or is referenced by a "#line"
15913 (Location.DefineSymbolDocuments): Ignore source files which
15914 either contain or are referenced by a "#line" directive.
15916 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
15918 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
15919 direct access to our parent, so check the method inline there.
15921 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
15923 * expression.cs (Invocation.EmitCall): Miguel's last commit
15924 caused a regression. If you had:
15929 In Foo the implict this would be null.
15931 2004-02-27 Miguel de Icaza <miguel@ximian.com>
15933 * expression.cs (Invocation.EmitCall): If the method is not
15934 virtual, do not emit a CallVirt to it, use Call.
15936 * typemanager.cs (GetFullNameSignature): Improve the method to
15937 cope with ".ctor" and replace it with the type name.
15939 * class.cs (ConstructorInitializer.Resolve): Now the method takes
15940 as an argument the ConstructorBuilder where it is being defined,
15941 to catch the recursive constructor invocations.
15943 2004-02-26 Miguel de Icaza <miguel@ximian.com>
15945 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
15946 routines to check if a type is an enumerable/enumerator allow
15947 classes that implement the IEnumerable or IEnumerator interfaces.
15949 * class.cs (Property, Operator): Implement IIteratorContainer, and
15950 implement SetYields.
15952 (Property.Define): Do the block swapping for get_methods in the
15953 context of iterators. We need to check if Properties also
15954 include indexers or not.
15956 (Operator): Assign the Block before invoking the
15957 OperatorMethod.Define, so we can trigger the Iterator code
15960 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
15961 Property and Operator classes are not created when we parse the
15962 declarator but until we have the block completed, so we use a
15963 singleton SimpleIteratorContainer.Simple to flag whether the
15964 SetYields has been invoked.
15966 We propagate this setting then to the Property or the Operator to
15967 allow the `yield' to function.
15969 2004-02-25 Marek Safar <marek.safar@seznam.cz>
15971 * codegen.cs: Implemented attribute support for modules.
15972 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
15973 Assembly/Module functionality.
15975 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
15976 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
15977 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
15979 2004-02-16 Marek Safar <marek.safar@seznam.cz>
15981 * interface.cs (FindMembers): The operation is performed on all base
15982 interfaces and not only on the first. It is required for future CLS Compliance patch.
15984 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
15986 * statement.cs, codegen.cs:
15987 This patch deals with patterns such as:
15989 public class List : IEnumerable {
15991 public MyEnumerator GetEnumerator () {
15992 return new MyEnumerator(this);
15995 IEnumerator IEnumerable.GetEnumerator () {
15999 public struct MyEnumerator : IEnumerator {
16004 Before, there were a few things we did wrong:
16005 1) we would emit callvirt on a struct, which is illegal
16006 2) we emited ldarg when we needed to emit ldarga
16007 3) we would mistakenly call the interface methods on an enumerator
16008 type that derived from IEnumerator and was in another assembly. For example:
16010 public class MyEnumerator : IEnumerator
16012 Would have the interface methods called, even if there were public impls of the
16013 method. In a struct, this lead to invalid IL code.
16015 2004-02-11 Marek Safar <marek.safar@seznam.cz>
16017 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
16020 * delegate.cs (Define): Fixed crash when delegate type is undefined.
16022 2004-02-11 Miguel de Icaza <miguel@ximian.com>
16024 * cs-parser.jay: Fix small regression: we were not testing V2
16025 compiler features correctly.
16027 * interface.cs: If the emit context is null, then create one
16029 2004-02-09 Marek Safar <marek.safar@seznam.cz>
16031 * decl.cs (GetSignatureForError): New virtual method to get full name
16032 for error messages.
16034 * attribute.cs (IAttributeSupport): New interface for attribute setting.
16035 Now it is possible to rewrite ApplyAttributes method to be less if/else.
16037 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
16038 Duplicated members and code in these classes has been removed.
16039 Better encapsulation in these classes.
16041 2004-02-07 Miguel de Icaza <miguel@ximian.com>
16043 * assign.cs (Assign.DoResolve): When dealing with compound
16044 assignments, there is a new rule in ECMA C# 2.4 (might have been
16045 there before, but it is documented here) that states that in:
16049 If b is of type int, and the `op' is a shift-operator, then the
16050 above is evaluated as:
16054 * expression.cs (Binary.ResolveOperator): Instead of testing for
16055 int/uint/long/ulong, try to implicitly convert to any of those
16056 types and use that in pointer arithmetic.
16058 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
16059 method to print information for from the type, not from the
16060 null-method we were given.
16062 2004-02-01 Duncan Mak <duncan@ximian.com>
16064 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
16065 parsing for cmd, fixes bug #53694.
16067 2004-02-04 Marek Safar <marek.safar@seznam.cz>
16069 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
16070 in the member name duplication tests. Property and operator name duplication
16071 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
16073 2004-02-03 Marek Safar <marek.safar@seznam.cz>
16075 * interface.cs (PopulateMethod): Fixed crash when interface method
16076 returns not existing type (error test cs0246-3.cs).
16078 2004-02-02 Ravi Pratap M <ravi@ximian.com>
16080 * cs-parser.jay (interface_accessors): Re-write actions to also
16081 store attributes attached to get and set methods. Fix spelling
16084 (inteface_property_declaration): Modify accordingly.
16086 (InterfaceAccessorInfo): New helper class to store information to pass
16087 around between rules that use interface_accessors.
16089 * interface.cs (Emit): Apply attributes on the get and set
16090 accessors of properties and indexers too.
16092 * attribute.cs (ApplyAttributes): Modify accordingly to use the
16093 right MethodBuilder when applying attributes to the get and set accessors.
16095 2004-01-31 Miguel de Icaza <miguel@ximian.com>
16097 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
16099 2004-01-26 Miguel de Icaza <miguel@ximian.com>
16101 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
16103 2004-01-25 Miguel de Icaza <miguel@ximian.com>
16105 * cs-parser.jay: Remove YIELD token, instead use the new grammar
16106 changes that treat `yield' specially when present before `break'
16107 or `return' tokens.
16109 * cs-tokenizer.cs: yield is no longer a keyword.
16111 2004-01-23 Marek Safar <marek.safar@seznam.cz>
16113 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
16114 setting for default constructors.
16115 For default constructors are almost every time set wrong Modifier. The
16116 generated IL code has been alright. But inside mcs this values was
16117 wrong and this was reason why several of my CLS Compliance tests
16120 2004-01-22 Martin Baulig <martin@ximian.com>
16122 * cs-parser.jay (namespace_or_type_name): Return an Expression,
16123 not a QualifiedIdentifier. This is what `type_name_expression'
16124 was previously doing.
16125 (type_name_expression): Removed; the code is now in
16126 `namespace_or_type_name'.
16127 (qualified_identifier): Removed, use `namespace_or_type_name'
16129 (QualifiedIdentifier): Removed this class.
16131 2004-01-22 Martin Baulig <martin@ximian.com>
16133 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
16134 not a string as alias name.
16136 2004-01-21 Miguel de Icaza <miguel@ximian.com>
16138 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
16139 #52730 bug, and instead compute correctly the need to use a
16140 temporary variable when requesting an address based on the
16141 static/instace modified of the field and the constructor.
16143 2004-01-21 Martin Baulig <martin@ximian.com>
16145 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
16146 class and namespace before looking up aliases. Fixes #52517.
16148 2004-01-21 Martin Baulig <martin@ximian.com>
16150 * flowanalysis.cs (UsageVector.Merge): Allow variables being
16151 assinged in a 'try'; fixes exception4.cs.
16153 2004-01-21 Marek Safar <marek.safar@seznam.cz>
16154 * class.cs : Implemented parameter-less constructor for TypeContainer
16156 * decl.cs: Attributes are now stored here. New property OptAttributes
16158 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
16160 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
16162 2004-01-21 Marek Safar <marek.safar@seznam.cz>
16164 * typemanager.cs (CSharpSignature): Now reports also inner class name.
16165 (CSharpSignature): New method for indexer and property signature.
16167 2004-01-21 Marek Safar <marek.safar@seznam.cz>
16169 * pending.cs (IsVirtualFilter): Faster implementation.
16171 2004-01-21 Marek Safar <marek.safar@seznam.cz>
16173 * typemanager.cs: Avoid inclusion of same assembly more than once.
16175 2004-01-21 Marek Safar <marek.safar@seznam.cz>
16177 * cs-parser.jay: Fixed problem where the last assembly attribute
16178 has been applied also to following declaration (class, struct, etc.)
16180 2004-01-21 Marek Safar <marek.safar@seznam.cz>
16182 * class.cs: Added error CS0538, CS0539 reporting.
16183 Fixed crash on Microsoft runtime when field type is void.
16185 * cs-parser.jay: Added error CS0537 reporting.
16187 * pending.cs: Added error CS0535 reporting.
16188 Improved error report for errors CS0536, CS0534.
16190 2004-01-20 Miguel de Icaza <miguel@ximian.com>
16192 Merge a few bits from the Anonymous Method MCS tree.
16194 * statement.cs (ToplevelBlock): New class for toplevel methods,
16195 will hold anonymous methods, lifted variables.
16197 * cs-parser.jay: Create toplevel blocks for delegates and for
16198 regular blocks of code.
16200 2004-01-20 Martin Baulig <martin@ximian.com>
16202 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
16203 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
16204 and `NeedExplicitReturn'; added `IsLastStatement'.
16205 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
16206 have a `ReturnLabel' or we're not unreachable.
16208 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
16209 child's reachability; don't just override ours with it. Fixes
16210 #58058 (lluis's example).
16211 (FlowBranching): Added public InTryOrCatch(), InCatch(),
16212 InFinally(), InLoop(), InSwitch() and
16213 BreakCrossesTryCatchBoundary() methods.
16215 * statement.cs (Return): Do all error checking in Resolve().
16216 Unless we are the last statement in a top-level block, always
16217 create a return label and jump to it.
16218 (Break, Continue): Do all error checking in Resolve(); also make
16219 sure we aren't leaving a `finally'.
16220 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
16221 statement in a top-level block.
16222 (Block.Flags): Added `IsDestructor'.
16223 (Block.IsDestructor): New public property.
16225 2004-01-20 Martin Baulig <martin@ximian.com>
16227 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
16229 2004-01-20 Martin Baulig <martin@ximian.com>
16231 * statement.cs (Statement.ResolveUnreachable): New public method.
16232 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
16233 (Block.Resolve): Resolve unreachable statements.
16235 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
16237 * expression.cs: We need to fix the case where we do
16238 not have a temp variable here.
16240 * assign.cs: Only expression compound assignments need
16241 temporary variables.
16243 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
16245 * flowanalysis.cs: Reduce memory allocation in a few ways:
16246 - A block with no variables should not allocate a bit
16248 - A method with no out parameters does not need any tracking
16249 for assignment of the parameters, so we need not allocate
16252 public readonly Type[] VariableTypes;
16253 public readonly string[] VariableNames;
16254 Are redundant. The data is already stored in the variable
16255 map, so we need not allocate another array for it.
16256 - We need to add alot of checks for if (params | locals) == null
16257 due to the first two changes.
16259 2004-01-18 Miguel de Icaza <miguel@ximian.com>
16261 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
16262 implement IMemoryLocation, we store a copy on a local variable and
16263 take the address of it. Patch from Benjamin Jemlich
16265 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
16266 to use a special "type_name_expression" rule which reduces the
16267 number of "QualifiedIdentifier" classes created, and instead
16268 directly creates MemberAccess expressions.
16270 2004-01-17 Miguel de Icaza <miguel@ximian.com>
16272 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
16273 that fixes #52853. Null literal assignment to ValueType
16275 * class.cs (MethodData.Emit): Instead of checking the name of the
16276 method to determine if its a destructor, create a new derived
16277 class from Method called Destructor, and test for that.
16279 * cs-parser.jay: Create a Destructor object instead of a Method.
16281 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
16285 2004-01-16 Miguel de Icaza <miguel@ximian.com>
16287 * expression.cs (Binary.ResolveOperator): Perform an implicit
16288 conversion from MethodGroups to their delegate types on the
16289 Addition operation.
16291 * delegate.cs: Introduce a new class DelegateCreation that is the
16292 base class for `NewDelegate' and `ImplicitDelegateCreation',
16293 factor some code in here.
16295 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
16296 conversion from MethodGroups to compatible delegate types.
16298 * ecore.cs (Expression.Resolve): Do not flag error 654
16299 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
16300 we allow conversions from MethodGroups to delegate types now.
16302 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
16303 assignments in v2 either.
16305 2004-01-10 Miguel de Icaza <miguel@ximian.com>
16307 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
16308 static read-only fields in ctors.
16310 Applied patch from Benjamin Jemlich
16312 * expression.cs (UnaryMutator): Avoid leaking local variables.
16314 2004-01-09 Miguel de Icaza <miguel@ximian.com>
16316 * cs-tokenizer.cs (IsCastToken): Allow the various native types
16317 here to return true, as they can be used like this:
16319 (XXX) int.MEMBER ()
16321 Fixed 49836 and all the other dups
16323 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
16325 * driver.cs: Implement /win32res and /win32icon.
16327 2004-01-08 Miguel de Icaza <miguel@ximian.com>
16329 * cs-parser.jay: Add a rule to improve error handling for the
16330 common mistake of placing modifiers after the type.
16332 2004-01-07 Miguel de Icaza <miguel@ximian.com>
16334 * cs-parser.jay (interface_event_declaration): Catch
16335 initialization of events on interfaces, and report cs0068
16337 * cs-parser.jay (interface_event_declaration): Catch
16338 initialization of events.
16340 * ecore.cs: Better report missing constructors.
16342 * expression.cs (Binary.ResolveOperator): My previous bug fix had
16343 the error reporting done in the wrong place. Fix.
16345 * expression.cs (Binary.ResolveOperator): Catch the
16346 operator + (E x, E y) error earlier, and later allow for implicit
16347 conversions in operator +/- (E e, U x) from U to the underlying
16350 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
16351 52596, if the container class is abstract, the default constructor
16352 is protected otherwise its public (before, we were always public).
16354 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
16357 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
16358 Jemlich that fixes bug #52597, MCS was generating invalid code for
16359 idisposable structs. Thanks to Ben for following up with this
16362 2004-01-06 Miguel de Icaza <miguel@ximian.com>
16364 * driver.cs: Allow assemblies without code to be generated, fixes
16367 2004-01-07 Nick Drochak <ndrochak@gol.com>
16369 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
16371 2004-01-05 Miguel de Icaza <miguel@ximian.com>
16373 * cs-parser.jay: Add rules to improve error reporting if fields or
16374 methods are declared at the namespace level (error 116)
16376 * Add rules to catch event add/remove
16378 2004-01-04 David Sheldon <dave-mono@earth.li>
16380 * expression.cs: Added matching ")" to error message for
16383 2004-01-03 Todd Berman <tberman@gentoo.org>
16385 * ecore.cs, attribute.cs:
16386 Applying fix from #52429.
16388 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
16390 * ecore.cs, expression.cs, statement.cs:
16391 Total rewrite of how we handle branching. We
16392 now handle complex boolean expressions with fewer
16393 jumps. As well if (x == 0) no longer emits a ceq.
16395 if (x is Foo) is much faster now, because we generate
16398 Overall, we get a pretty big improvement on our benchmark
16399 tests. The code we generate is smaller and more readable.
16401 I did a full two-stage bootstrap. The patch was reviewed
16402 by Martin and Miguel.
16404 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
16406 * cs-parser.jay: Make primary_expression not take a QI.
16407 we dont need this because the member_access rule covers
16408 us here. So we replace the rule with just IDENTIFIER.
16410 This has two good effects. First, we remove a s/r conflict.
16411 Second, we allocate many fewer QualifiedIdentifier objects.
16413 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
16415 * attribute.cs: Handle MarshalAs attributes as pseudo, and
16416 set the correct information via SRE. This prevents
16417 hanging on the MS runtime. Fixes #29374.
16419 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
16421 * convert.cs: correctly handle conversions to value types
16422 from Enum and ValueType as unboxing conversions.
16424 Fixes bug #52569. Patch by Benjamin Jemlich.
16426 2004-01-02 Ravi Pratap <ravi@ximian.com>
16428 * expression.cs (BetterConversion): Prefer int -> uint
16429 over int -> ulong (csc's behaviour). This fixed bug #52046.
16431 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
16433 * decl.cs (MemberCache.FindMembers): now returns a
16436 * typemanager.cs: In general, go with with ^^.
16437 (CopyNewMethods): take an IList.
16438 (RealMemberLookup): Only allocate an arraylist
16439 if we copy from two sets of methods.
16441 This change basically does two things:
16442 1) Fewer array lists allocated due to CopyNewMethods.
16443 2) the explicit cast in MemberList costed ALOT.
16445 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
16447 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
16448 a hashtable to avoid needless string allocations when an identifier is
16449 used more than once (the common case).
16451 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
16453 * pending.cs: MS's TypeBuilder.GetInterfaces ()
16454 is broken, it will not return anything. So, we
16455 have to use the information we have in mcs to
16458 * typemanager.cs: Add a cache for GetInterfaces,
16459 since this will now be used more often (due to ^^)
16461 (GetExplicitInterfaces) New method that gets the
16462 declared, not effective, interfaces on a type
16463 builder (eg, if you have interface IFoo, interface
16464 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
16467 This patch makes MCS able to bootstrap itself on
16470 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
16472 * expression.cs: Remove the Nop's that Miguel put
16475 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
16477 * report.cs, codegen.cs: Give the real stack trace to
16478 the error when an exception is thrown.
16480 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
16482 * decl.cs: only allocate hashtables for ifaces if
16485 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
16487 * expression.cs: fix the error from cs0121-2.cs
16488 (a parent interface has two child interfaces that
16489 have a function with the same name and 0 params
16490 and the function is called through the parent).
16492 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
16494 * class.cs, rootcontext.cs, typmanager.cs: do not
16497 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
16499 * codegen.cs: remove stack for the ec flow branching.
16500 It is already a linked list, so no need.
16502 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
16504 * Makefile: Allow custom profiler here.
16506 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
16508 * typemanager.cs (LookupType):
16509 - Use a static char [], because split takes
16510 a param array for args, so it was allocating
16512 - Do not store true in a hashtable, it boxes.
16514 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
16516 * flowanalysis.cs: bytify common enums.
16518 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
16520 * modifiers.cs: Add a new set of flags for the
16521 flags allowed on explicit interface impls.
16522 * cs-parser.jay: catch the use of modifiers in
16523 interfaces correctly.
16524 * class.cs: catch private void IFoo.Blah ().
16526 All related to bug #50572.
16528 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
16530 * decl.cs: Rewrite the consistant accessability checking.
16531 Accessability is not linear, it must be implemented in
16532 a tableish way. Fixes #49704.
16534 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
16536 * expression.cs: Handle negation in a checked context.
16537 We must use subtraction from zero. Fixes #38674.
16539 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
16541 * class.cs: Ignore static void main in DLLs.
16542 * rootcontext.cs: Handle the target type here,
16543 since we are have to access it from class.cs
16544 * driver.cs: account for the above.
16546 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
16548 * report.cs: Give line numbers and files if available.
16550 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
16552 * driver.cs: Implement /addmodule.
16554 * typemanager.cs: Change 'modules' field so it now contains Modules not
16557 2003-12-20 Martin Baulig <martin@ximian.com>
16559 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
16560 (FieldBase.IsAssigned): Removed this field.
16561 (FieldBase.SetAssigned): New public method.
16562 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
16564 2003-12-20 Martin Baulig <martin@ximian.com>
16566 * expression.cs (LocalVariableReference.DoResolve): Don't set
16567 `vi.Used' if we're called from DoResolveLValue().
16569 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
16570 returns the usage vector it just merged into the current one -
16571 pass this one to UsageWarning().
16572 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
16573 of the `EmitContext', don't call this recursively on our children.
16575 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
16577 * driver.cs: Implement /target:module.
16579 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
16581 * support.cs (CharArrayHashtable): New helper class.
16583 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
16584 char arrays, not strings, so we can avoid creating a string in
16585 consume_identifier if the identifier is a keyword.
16587 2003-12-16 Martin Baulig <martin@ximian.com>
16589 * statement.cs (LocalInfo.Assigned): Removed this property.
16590 (LocalInfo.Flags): Removed `Assigned'.
16591 (LocalInfo.IsAssigned): New public method; takes the EmitContext
16592 and uses flow analysis.
16593 (Block.UsageWarning): Made this method private.
16594 (Block.Resolve): Call UsageWarning() if appropriate.
16596 * expression.cs (LocalVariableReference.DoResolve): Always set
16597 LocalInfo.Used here.
16599 2003-12-13 Martin Baulig <martin@ximian.com>
16601 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
16602 any value here; we're now using flow analysis to figure out
16603 whether a statement/block returns a value.
16605 2003-12-13 Martin Baulig <martin@ximian.com>
16607 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
16609 (FlowBranching.MergeFinally): Don't call
16610 `branching.CheckOutParameters()' here, this is called in
16612 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
16613 when adding the `finally' vector.
16615 2003-12-13 Martin Baulig <martin@ximian.com>
16618 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
16619 actually work and also fix #48962.
16621 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
16623 * decl.cs: Do not check System.Object for nested types,
16624 since we know it does not have any. Big bang for buck:
16627 Run 1: 8.35 seconds
16628 Run 2: 8.32 seconds
16629 corlib: 17.99 seconds
16631 Run 1: 8.17 seconds
16632 Run 2: 8.17 seconds
16633 corlib: 17.39 seconds
16635 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
16637 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
16638 time we are returning 0 members, so we save alot here.
16640 2003-12-11 Martin Baulig <martin@ximian.com>
16642 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
16643 `MergeChild()', also just take the `FlowBranching' as argument;
16644 call Merge() on it and return the result.
16645 (FlowBranching.Merge): We don't need to do anything if we just
16648 2003-12-11 Martin Baulig <martin@ximian.com>
16650 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
16651 them in an `ArrayList' to reduce memory usage. Thanks to Ben
16652 Maurer for this idea.
16654 2003-12-11 Martin Baulig <martin@ximian.com>
16656 * flowanalysis.cs (MergeResult): This class is now gone; we now
16657 use the `UsageVector' for this. The reason for this is that if a
16658 branching just has one sibling, we don't need to "merge" them at
16659 all - that's the next step to do.
16660 (FlowBranching.Merge): We now return a `UsageVector' instead of a
16663 2003-12-11 Martin Baulig <martin@ximian.com>
16665 Reworked flow analyis and made it more precise and bug-free. The
16666 most important change is that we're now using a special `Reachability'
16667 class instead of having "magic" meanings of `FlowReturns'. I'll
16668 do some more cleanups and optimizations and also add some more
16669 documentation this week.
16671 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
16672 largely reworked this class.
16673 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
16674 the new `Reachability' class instead of having "magic" values here.
16675 (FlowBranching): We're now using an instance of `Reachability'
16676 instead of having separate `Returns', `Breaks' etc. fields.
16678 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
16679 based on flow analysis; ignore the return value of block.Emit ().
16681 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
16683 * driver.cs typemanager.cs: Find the mono extensions to corlib even
16684 if they are private.
16686 2003-12-09 Martin Baulig <martin@ximian.com>
16688 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
16689 call them directly on the UsageVector.
16691 2003-12-09 Martin Baulig <martin@ximian.com>
16693 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
16694 Changed return type from `FlowReturns' to `Reachability'.
16696 2003-12-09 Martin Baulig <martin@ximian.com>
16698 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
16699 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
16700 `Reachable' fields with a single `Reachability' one.
16702 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
16704 * class.cs (FindMembers): Remove foreach's.
16709 Run 1: 8.74 seconds
16710 Run 2: 8.71 seconds
16713 Run 1: 8.64 seconds
16714 Run 2: 8.58 seconds
16717 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
16722 This patch does a few things:
16723 1. EmptyStatement is now a singleton, so it is never reallocated.
16724 2. All blah is EmptyStatement constructs have been changed to
16725 blah == EmptyStatement.Value, which is much faster and valid
16726 now that EmptyStatement is a singleton.
16727 3. When resolving a block, rather than allocating a new array for
16728 the non-empty statements, empty statements are replaced with
16729 EmptyStatement.Value
16730 4. Some recursive functions have been made non-recursive.
16731 Mainly the performance impact is from (3), however (1) and (2) are needed for
16732 this to work. (4) does not make a big difference in normal situations, however
16733 it makes the profile look saner.
16738 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
16739 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
16740 Total memory allocated: 56397 KB
16743 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
16744 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
16745 Total memory allocated: 55666 KB
16747 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
16749 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
16750 than the hashtable in a hashtable version
16752 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
16753 we always end up concating a string. This results in a huge perf
16754 loss, because many strings have to be tracked by the GC. In this
16755 patch, we first use a hashtable that works with two keys, so that
16756 the strings do not need to be concat'ed.
16760 Run 1: 8.74 seconds
16761 Run 2: 8.71 seconds
16764 Run 1: 8.65 seconds
16765 Run 2: 8.56 seconds
16767 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
16769 * Makefile: Add a new target `do-time' that does a quick and simple
16770 profile, leaving easy to parse output.
16772 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
16774 * codegen.cs (Init): Create the dynamic assembly with
16775 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
16777 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
16779 * support.cs: Make the PtrHashtable use only one
16780 instance of its comparer.
16782 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
16784 * typemanager.cs: Fix lookup of GetNamespaces.
16786 2003-11-29 Miguel de Icaza <miguel@ximian.com>
16788 * expression.cs: Removed redundant line.
16790 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
16791 ArrayLists, use for loops with bounds.
16793 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
16796 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
16797 arraylists, use for loop with bounds.
16799 The above three changes give us a 0.071 second performance
16800 improvement out of 3.294 seconds down to 3.223. On my machine
16801 the above changes reduced the memory usage by 1,387 KB during
16802 compiler bootstrap.
16804 * cs-parser.jay (QualifiedIdentifier): New class used to represent
16805 QualifiedIdentifiers. Before we created a new string through
16806 concatenation, and mostly later on, the result would be
16807 manipulated by DecomposeQI through string manipulation.
16809 This reduced the compiler memory usage for bootstrapping from
16810 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
16811 compile times in 0.05 seconds.
16813 2003-11-28 Dick Porter <dick@ximian.com>
16815 * support.cs: Do string compares with the Invariant culture.
16823 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
16824 the comparison is done with the Invariant culture.
16826 2003-11-27 Miguel de Icaza <miguel@ximian.com>
16828 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
16829 GetEnumerator method.
16831 (ProbeCollectionType): Iterate starting at the most specific type
16832 upwards looking for a GetEnumerator
16834 * expression.cs: Shift count can be up to 31 for int/uint and 63
16837 2003-11-26 Miguel de Icaza <miguel@ximian.com>
16839 * statement.cs (Block.LookupLabel): Also look for the label on the
16840 children blocks. Use a hash table to keep track of visited
16843 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
16844 we actually did transform the other operand, otherwise fall back
16845 to the common codepath that casts to long.
16847 * cs-tokenizer.cs: Use the same code pattern as the int case.
16848 Maybe I should do the parsing myself, and avoid depending on the
16849 Parse routines to get this done.
16851 2003-11-25 Miguel de Icaza <miguel@ximian.com>
16853 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
16854 which fixes bug 51347. This time test it.
16856 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
16857 attributes for example can not tell the difference between these.
16858 The difference was only a syntax feature of the language.
16860 * attribute.cs: Apply attributes to delegates.
16862 * delegate.cs: Call the apply attributes method.
16864 2003-11-24 Miguel de Icaza <miguel@ximian.com>
16866 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
16867 comparing 0 vs Byte.MinValue, not the value
16869 (ImplicitConversionRequired): When reporting a conversion error,
16870 use error 31 to print out the constant error instead of the
16873 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
16874 which fixes bug 51347.
16876 2003-11-22 Miguel de Icaza <miguel@ximian.com>
16878 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
16879 which fixes the -warnaserror command line option.
16881 2003-11-21 Miguel de Icaza <miguel@ximian.com>
16883 * cfold.cs (DoNumericPromotions): During constant folding of
16884 additions on UIntConstant, special case intconstants with
16885 IntConstants like we do on the expression binary operator.
16887 2003-11-12 Miguel de Icaza <miguel@ximian.com>
16889 * convert.cs (ImplicitReferenceConversion): We were missing a case
16890 (System.Enum are not value types or class types, so we need to
16891 classify them separatedly).
16893 * driver.cs: We do not support error 2007.
16895 2003-11-12 Jackson Harper <jackson@ximian.com>
16897 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
16898 system directory. Also use the full file name so users can
16899 libraries names mscorlib-o-tron.dll in a non system dir.
16901 2003-11-10 Martin Baulig <martin@ximian.com>
16903 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
16904 (TypeManager.InitCoreTypes): Initialize them here, but instead of
16905 calling `ResolveType()' on them, directly assign their `Type'.
16907 2003-11-08 Martin Baulig <martin@ximian.com>
16909 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
16910 return value and the `out parent' parameter.
16911 (TypeContainer.DefineType): Moved the CS0644 check into
16912 GetClassBases(). Don't pass the interface types to the
16913 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
16914 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
16916 * ecore.cs (TypeExpr.IsAttribute): New property.
16917 (TypeExpr.GetInterfaces): New method.
16919 * interface.cs (Interface.GetInterfaceTypeByName): Return a
16920 TypeExpr instead of a Type.
16921 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
16922 (Interface.DefineType): Don't pass the interface types to the
16923 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
16924 them later and then call `TypeBulider.AddInterfaceImplementation()'.
16926 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
16927 instead of a `Type[]'.
16928 (TypeManager.RegisterBuilder): Likewise.
16929 (TypeManager.AddUserInterface): Likewise.
16930 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
16931 `Type[]' and also return a `TypeExpr[]'.
16932 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
16934 2003-11-08 Martin Baulig <martin@ximian.com>
16936 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
16939 2003-11-08 Martin Baulig <martin@ximian.com>
16941 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
16942 TypeManager.ResolveExpressionTypes().
16944 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
16945 instead of an Expression.
16946 (TypeExpr): This is now an abstract base class for `TypeExpression'.
16947 (TypeExpression): New public class; formerly known as `TypeExpr'.
16949 * expression.cs (ComposedCast): Derive from TypeExpr.
16951 * typemanager.cs (TypeManager.system_*_expr): These are now
16952 TypExpr's instead of Expression's.
16953 (TypeManager.ResolveExpressionTypes): New public static function;
16954 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
16957 2003-11-06 Miguel de Icaza <miguel@ximian.com>
16959 * expression.cs (New.DoResolve): Do not dereference value that
16960 might be a null return.
16962 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
16963 sure that the constant value has the right type. Fixes an
16964 unreported bug, similar to 50425.
16966 * const.cs (Const.LookupConstantValue): Call
16967 ImplicitStandardConversionExists before doing a conversion to
16968 avoid havng the TypeManager.ChangeType do conversions.
16970 Reduced the number of casts used
16972 (Const.ChangeType): New routine to enable reuse of the constant
16973 type changing code from statement.
16975 * typemanager.cs (ChangeType): Move common initialization to
16976 static global variables.
16980 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
16981 every value type to go through, even if it was void. Fix that.
16983 * cs-tokenizer.cs: Use is_identifier_start_character on the start
16984 character of the define, and the is_identifier_part_character for
16985 the rest of the string.
16987 2003-11-05 Miguel de Icaza <miguel@ximian.com>
16989 * expression.cs (UnaryMutator.EmitCode): When I updated
16990 LocalVariableReference.DoResolve, I overdid it, and dropped an
16991 optimization done on local variable references.
16993 2003-11-04 Miguel de Icaza <miguel@ximian.com>
16995 * ecore.cs: Convert the return from Ldlen into an int.
16997 2003-10-20 Miguel de Icaza <miguel@ximian.com>
16999 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
17000 the accessibility, this is a special case for toplevel non-public
17001 classes (internal for instance).
17003 2003-10-20 Nick Drochak <ndrochak@gol.com>
17005 * ecore.cs: Fix typo and build. Needed another right paren.
17007 2003-10-19 Miguel de Icaza <miguel@ximian.com>
17009 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
17010 `internal' case regular and protected, but not allowing protected
17011 to be evaluated later. Bug 49840
17013 2003-10-15 Miguel de Icaza <miguel@ximian.com>
17015 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
17016 to kb.Nlast, and not the kb.nFirst to isolate the switch
17019 Extract the underlying type, so enumerations of long/ulong are
17020 treated like long/ulong.
17022 2003-10-14 Miguel de Icaza <miguel@ximian.com>
17024 * expression.cs (New): Overload the meaning of RequestedType to
17025 track the possible creation of the NewDelegate type, since
17026 DoResolve is invoked more than once for new constructors on field
17029 See bugs: #48800 and #37014
17031 * cs-parser.jay (declare_local_constants): Take an arraylist
17032 instead of a single constant.
17034 (local_constant_declaration): It should take a
17035 constant_declarators, not a constant_declarator. Fixes 49487
17037 * convert.cs: Fix error report.
17039 2003-10-13 Jackson Harper <jackson@ximian.com>
17041 * typemanager.cs (TypeToCoreType): Add float and double this fixes
17044 2003-10-09 Martin Baulig <martin@ximian.com>
17046 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
17048 (MethodCore.DoDefineParameters): Removed the TypeContainer
17049 argument; use the DeclSpace which was passed to the .ctor instead.
17050 (MethodCore.CheckParameter): Take a DeclSpace instead of a
17051 TypeContainer; we only need a DeclSpace here.
17053 2003-10-09 Martin Baulig <martin@ximian.com>
17055 * class.cs (MethodData): Added additional `DeclSpace ds' argument
17057 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
17058 EmitContext's .ctor.
17060 2003-10-09 Martin Baulig <martin@ximian.com>
17062 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
17063 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
17064 AsAccessible(), moved them as well.
17066 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
17068 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
17070 * cs-parser.jay : Renamed yyName to yyNames related to jay.
17072 2003-10-07 Miguel de Icaza <miguel@ximian.com>
17074 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
17075 generation for >=, as spotted by Paolo, bug 48679.
17076 Patch from David Waite.
17078 * cs-tokenizer.cs: Add handling for #pragma.
17080 * cs-parser.jay: Allow for both yield and yield return in the
17081 syntax. The anti-cobolization of C# fight will go on!
17083 * class.cs (TypeBuilder.DefineType): Catch error condition here
17084 (Parent.DefineType erroring out and returning null).
17086 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
17087 coping with enumerations variables, we were mistakenly processing
17088 them as a regular value type instead of built-in types. Fixes the
17091 * typemanager.cs (IsBuiltinOrEnum): New method.
17093 2003-09-30 Miguel de Icaza <miguel@ximian.com>
17095 * cs-parser.jay: Upgrade: yield now needs the return clause.
17097 2003-09-19 Martin Baulig <martin@ximian.com>
17099 * decl.cs (MemberCache.SetupCacheForInterface): Take a
17100 `MemberCache parent' argument. Normally, an interface doesn't
17101 have a parent type except System.Object, but we use this in gmcs
17102 for generic type parameters.
17104 2003-09-18 Martin Baulig <martin@ximian.com>
17106 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
17107 on `type.IsInterface'; don't check whether the type has a parent
17108 to determine whether it's an interface.
17110 2003-09-15 Martin Baulig <martin@ximian.com>
17112 * class.cs (TypeContainer.DefineType): Added an error flag to
17113 avoid reporting duplicate CS0146's ("class definition is
17116 * driver.cs (Driver.MainDriver): Abort if
17117 RootContext.ResolveTree() reported any errors.
17119 2003-09-07 Martin Baulig <martin@ximian.com>
17121 * report.cs (Error, Warning): Added overloaded versions which take
17122 a `params object[] args' and call String.Format().
17124 2003-09-07 Martin Baulig <martin@ximian.com>
17126 * decl.cs (DeclSpace..ctor): Don't call
17127 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
17128 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
17129 (DeclSpace.RecordDecl): New method.
17131 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
17133 2003-09-02 Ravi Pratap <ravi@ximian.com>
17135 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
17136 value attributes to be applied to ParameterBuilders.
17138 * class.cs (MethodCore.LabelParameters): Make static and more
17139 generic so that it can be used from other places - like interface
17140 methods, for instance.
17142 * interface.cs (Interface.Emit): Call LabelParameters before
17143 emitting attributes on the InterfaceMethod.
17145 2003-08-26 Martin Baulig <martin@ximian.com>
17147 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
17148 resolving aliases; fixes #47927.
17150 2003-08-26 Martin Baulig <martin@ximian.com>
17152 * statement.cs (Using.DoResolve): This is internally emitting a
17153 try/finally clause, so we need to set ec.NeedExplicitReturn if we
17154 do not always return. Fixes #47681.
17156 2003-08-26 Martin Baulig <martin@ximian.com>
17158 * decl.cs (MemberCore): Moved WarningNotHiding(),
17159 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
17161 (AdditionResult): Make this nested in DeclSpace.
17162 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
17163 argument; call NamespaceEntry.Define() unless we're nested in a
17166 * namespace.cs (Namespace.DefineName): New public function. This
17167 is called from DeclSpace's .ctor to add
17168 (Namespace.Lookup): Include DeclSpaces in the lookup.
17170 * class.cs (Operator): Derive from MemberBase, not MemberCore.
17172 * const.cs (Const): Derive from MemberBase, not MemberCore.
17174 2003-08-25 Martin Baulig <martin@ximian.com>
17176 * convert.cs (Convert.ExplicitReferenceConversion): When
17177 converting from an interface type to a class, unbox if the target
17178 type is a struct type. Fixes #47822.
17180 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17182 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
17185 2003-08-22 Martin Baulig <martin@ximian.com>
17187 * class.cs (TypeManager.DefineType): When defining a nested type,
17188 call DefineType() on our parent; fixes #47801.
17190 2003-08-22 Martin Baulig <martin@ximian.com>
17192 * class.cs (MethodData.Define): While checking if a method is an
17193 interface implementation, improve the test a bit more to fix #47654.
17195 2003-08-22 Martin Baulig <martin@ximian.com>
17197 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
17198 correctly; fixes #47722.
17200 2003-08-22 Martin Baulig <martin@ximian.com>
17202 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
17203 LocalVariableReference, ensure it's not read-only. Fixes #47536.
17205 * statement.cs (Fixed.DoResolve): Make all variables read-only.
17207 2003-08-22 Martin Baulig <martin@ximian.com>
17209 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
17210 can only be assigned in static constructors. Fixes #47161.
17212 2003-08-22 Martin Baulig <martin@ximian.com>
17214 Rewrote and improved the flow analysis code.
17216 * flowbranching.cs (FlowBranching): Make this class abstract.
17217 (FlowBranching.CreateBranching): New static function to create a
17218 new flow branching.
17219 (FlowBranchingBlock, FlowBranchingException): New classes.
17220 (FlowBranching.UsageVector.Type): New public readonly field.
17221 (FlowBranching.UsageVector.Breaks): Removed the setter.
17222 (FlowBranching.UsageVector.Returns): Removed the setter.
17223 (FlowBranching.UsageVector): Added Break(), Return(),
17224 NeverReachable() and Throw() methods to modify the reachability.
17225 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
17226 done by FlowBranching.Merge().
17227 (FlowBranching.UsageVector.MergeChild): New method; merges the
17228 merge result into the current vector.
17229 (FlowBranching.Merge): New abstract method to merge a branching.
17231 2003-08-12 Martin Baulig <martin@ximian.com>
17233 * expression.cs (Indirection.CacheTemporaries): Create the
17234 LocalTemporary with the pointer type, not its element type.
17236 2003-08-10 Miguel de Icaza <miguel@ximian.com>
17238 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
17239 token was a keyword or not.
17241 Add `error' options where an IDENTIFIER was expected; Provide
17242 CheckToken and CheckIdentifierToken convenience error reporting
17245 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
17247 * decl.cs: Rename `NamespaceEntry Namespace' public field into
17248 NameSpaceEntry NameSpaceEntry.
17250 (LookupInterfaceOrClass): Avoid creating a full qualified name
17251 from namespace and name: avoid doing lookups when we know the
17252 namespace is non-existant. Use new Tree.LookupByNamespace which
17253 looks up DeclSpaces based on their namespace, name pair.
17255 * driver.cs: Provide a new `parser verbose' to display the
17256 exception thrown during parsing. This is turned off by default
17257 now, so the output of a failure from mcs is more graceful.
17259 * namespace.cs: Track all the namespaces defined in a hashtable
17262 (IsNamespace): New method
17264 2003-08-09 Miguel de Icaza <miguel@ximian.com>
17266 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
17267 we know that we need to concatenate (full typename can never be
17272 * statement.cs: Use a bitfield; Do not initialize to null things
17273 which are done by the constructor by default.
17275 * cs-parser.jay: bug fix, parameter was 4, not 3.
17277 * expression.cs: Just use the property;
17279 * statement.cs: No need for GetVariableInfo method.
17281 2003-08-08 Martin Baulig <martin@ximian.com>
17283 * flowanalysis.cs (FlowReturns): This is now nested in the
17284 `FlowBranching' class.
17285 (MyBitVector): Moved this here from statement.cs.
17286 (FlowBranching.SiblingType): New enum type.
17287 (FlowBranching.CreateSibling): Added `SiblingType' argument.
17289 2003-08-07 Martin Baulig <martin@ximian.com>
17291 * flowanalysis.cs (FlowBranchingType): This is now nested in the
17292 `FlowBranching' class and called `BranchingType'.
17294 2003-08-07 Martin Baulig <martin@ximian.com>
17296 * flowanalysis.cs: Moved all the control flow analysis code into
17299 2003-08-07 Martin Baulig <martin@ximian.com>
17301 * assign.cs (Assign.DoResolve): `target' must either be an
17302 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
17305 2003-08-07 Miguel de Icaza <miguel@ximian.com>
17307 * expression.cs (BinaryMethod): This kind of expression is created by the
17308 Binary class if it determines that the operator has to be handled
17311 (BinaryDelegate): This kind of expression is created if we are
17312 dealing with a + or - operator on delegates.
17314 (Binary): remove method, argumetns, and DelegateOperator: when
17315 dealing with methods,
17317 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
17319 * statement.cs (Block): use bitfields for the three extra booleans
17320 we had in use. Remove unused topblock parameter.
17322 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
17324 * assign.cs: Drop extra unneeded tests.
17326 2003-08-06 Miguel de Icaza <miguel@ximian.com>
17328 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
17330 * statement.cs (Foreach): Use VariableStorage instead of
17333 * codegen.cs (VariableStorage): New class used by clients that
17334 require a variable stored: locals or fields for variables that
17335 need to live across yield.
17337 Maybe provide a convenience api for EmitThis+EmitLoad?
17339 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
17342 2003-08-05 Miguel de Icaza <miguel@ximian.com>
17344 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
17345 RemapParameterLValue): New methods that are used to turn a
17346 precomputed FieldInfo into an expression like this:
17350 The idea is to use this instead of making LocalVariableReference
17351 have more than one meaning.
17353 * cs-parser.jay: Add error production to BASE.
17355 * ecore.cs: Deal with TypeManager.GetField returning null, which
17356 is now a valid return value.
17358 (FieldExprNoAddress): New expression for Fields whose address can
17361 * expression.cs (LocalVariableReference): During the resolve
17362 phases, create new expressions if we are in a remapping context.
17363 Remove code that dealt with remapping here.
17365 (ParameterReference): same.
17367 (ProxyInstance): New expression, like the `This' expression, but
17368 it is born fully resolved. We know what we are doing, so remove
17369 the errors that are targeted to user-provided uses of `this'.
17371 * statement.cs (Foreach): our variable is now stored as an
17372 Expression; During resolution, follow the protocol, dont just
17373 assume it will return this.
17375 2003-08-06 Martin Baulig <martin@ximian.com>
17377 * support.cs (SeekableStreamReader.cs): New public class.
17379 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
17380 SeekableStreamReader instead of the normal StreamReader.
17382 2003-08-04 Martin Baulig <martin@ximian.com>
17384 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
17385 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
17386 deambiguate casts and delegate invocations.
17387 (parenthesized_expression): Use the new tokens to ensure this is
17388 not a cast of method invocation.
17390 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
17391 when reading a `)' and Deambiguate_CloseParens () was previously
17394 * expression.cs (ParenthesizedExpression): New class. This is
17395 just used for the CS0075 test.
17396 (Binary.DoResolve): Check for CS0075.
17398 2003-07-29 Ravi Pratap <ravi@ximian.com>
17400 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
17401 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
17402 reference comparison.
17404 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
17405 examine the ReturnType for equality - this is necessary in the
17406 cases of implicit and explicit operators whose signature also
17407 includes the return type.
17409 2003-07-26 Miguel de Icaza <miguel@ximian.com>
17411 * namespace.cs: Cache the result of the namespace computation,
17412 instead of computing it every time.
17414 2003-07-24 Miguel de Icaza <miguel@ximian.com>
17416 * decl.cs: Use a global arraylist that we reuse over invocations
17417 to avoid excesive memory consumption. Reduces memory usage on an
17418 mcs compile by one meg (45 average).
17420 * typemanager.cs (LookupTypeReflection): In .NET pointers are
17421 private, work around that.
17423 2003-07-23 Miguel de Icaza <miguel@ximian.com>
17425 * literal.cs (IntLiteral): Define Zero and One static literals.
17427 * cs-parser.jay (integer_literal): use static literals to reduce
17428 memory usage for the most used literals (0, 1 and -1). 211kb
17429 reduced in memory usage.
17431 Replace all calls to `new ArrayList' with `new
17432 ArrayList(4)' which is a good average number for most allocations,
17433 and also requires only 16 bytes of memory for its buffer by
17436 This reduced MCS memory usage in seven megabytes for the RSS after
17439 2003-07-28 Ravi Pratap <ravi@ximian.com>
17441 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
17442 handle params methods the correct way by forming only one
17443 applicable set with params and normal methods in them. Earlier we
17444 were looking at params methods only if we found no normal methods
17445 which was not the correct thing to do.
17447 (Invocation.BetterFunction): Take separate arguments indicating
17448 when candidate and the best method are params methods in their
17451 This fixes bugs #43367 and #46199.
17453 * attribute.cs: Documentation updates.
17455 (CheckAttribute): Rename to CheckAttributeTarget.
17456 (GetValidPlaces): Rename to GetValidTargets.
17458 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
17459 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
17463 2003-07-28 Martin Baulig <martin@ximian.com>
17465 * class.cs (TypeContainer.DefineMembers): Use the base type's full
17466 name when looking up the base class of a nested class. Fixes #46977.
17468 2003-07-26 Martin Baulig <martin@ximian.com>
17470 * expression.cs (Indexers.Indexer): New nested struct; contains
17471 getter, setter and the indexer's type.
17472 (Indexers.Properties): This is now an ArrayList of
17473 Indexers.Indexer's.
17474 (IndexerAccess.DoResolveLValue): Correctly set the type if the
17475 indexer doesn't have any getters.
17477 * assign.cs (Assign.DoResolve): Also do the implicit conversions
17478 for embedded property and indexer assignments.
17480 2003-07-26 Martin Baulig <martin@ximian.com>
17482 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
17483 preprocessor directive is not the first non-whitespace character
17486 2003-07-26 Martin Baulig <martin@ximian.com>
17488 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
17489 namespace parsing, follow the spec more closely.
17491 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
17492 NamespaceEntry.Lookup().
17494 2003-07-25 Martin Baulig <martin@ximian.com>
17496 * MethodCore.cs (OverridesSomething): New public field; it's set
17497 from TypeContainer.DefineMembers if this method overrides
17498 something (which doesn't need to be a method). Fix #39462.
17500 2003-07-25 Ravi Pratap <ravi@ximian.com>
17502 * typemanager.cs (GetMembers): Ensure that the list of members is
17503 reversed. This keeps things in sync.
17505 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
17506 find an AttributeUsage attribute.
17508 * expression.cs (Invocation.OverloadResolve): Perform the check
17509 which disallows Invoke to be directly called on a Delegate.
17511 (Error_InvokeOnDelegate): Report error cs1533.
17513 2003-07-25 Martin Baulig <martin@ximian.com>
17515 * expression.cs (Indexers.GetIndexersForType): Only look in the
17516 interface hierarchy if the requested type is already an
17517 interface. Fixes #46788 while keeping #46502 fixed.
17519 2003-07-25 Martin Baulig <martin@ximian.com>
17521 * class.cs (TypeContainer.DefineMembers): Check whether all
17522 readonly fields have been assigned and report warning CS0649 if
17525 * statement.cs (LocalInfo.IsFixed): Always return true if this is
17528 2003-07-24 Ravi Pratap <ravi@ximian.com>
17530 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
17531 returned from GetMethods to make things consistent with the
17532 assumptions MCS makes about ordering of methods.
17534 This should comprehensively fix bug #45127 and it does :-)
17536 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
17537 ordering is actually reverse.
17539 * Clean up some debug messages I left lying around.
17541 * interface.cs (Populate*): Get rid of code which emits attributes
17542 since the stage in which we emit attributes is the 'Emit' stage,
17543 not the define stage.
17545 (Emit): Move attribute emission for interface members here.
17547 2003-07-22 Ravi Pratap <ravi@ximian.com>
17549 * expression.cs (Invocation.OverloadResolve): Follow the spec more
17550 closely: we eliminate methods in base types when we have an
17551 applicable method in a top-level type.
17553 Please see section 14.5.5.1 for an exact description of what goes
17556 This fixes bug #45127 and a host of other related to corlib compilation.
17558 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
17559 array is the method corresponding to the top-level type (this is
17560 because of the changes made to icall.c) so we change this
17563 (MethodGroupExpr.Name): This too.
17565 * typemanager.cs (GetElementType): New method which does the right
17566 thing when compiling corlib.
17568 * everywhere: Make use of the above in the relevant places.
17570 2003-07-22 Martin Baulig <martin@ximian.com>
17572 * cs-parser.jay (invocation_expression): Moved
17573 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
17574 `cast_expression', but create a InvocationOrCast which later
17575 resolves to either an Invocation or a Cast.
17577 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
17578 method; call this before EmitStatement() to make sure that this
17579 expression can be used as a statement.
17581 * expression.cs (InvocationOrCast): New class; resolves to either
17582 an Invocation or a Cast.
17584 * statement.cs (StatementExpression): Call ResolveStatement() on
17585 the ExpressionStatement before emitting it.
17587 2003-07-21 Martin Baulig <martin@ximian.com>
17589 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
17590 `ref' and `out' attributes match; fixes #46220.
17591 (MemberAccess.ResolveMemberAccess): You can't reference a type
17592 through an expression; fixes #33180.
17593 (Indexers.GetIndexersForType): Don't return the indexers from
17594 interfaces the class implements; fixes #46502.
17596 2003-07-21 Martin Baulig <martin@ximian.com>
17598 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
17599 CS0661 checks; fixes bug #30442.
17601 2003-07-21 Martin Baulig <martin@ximian.com>
17603 * decl.cs (AdditionResult): Added `Error'.
17605 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
17607 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
17608 makes cs0031.cs actually work.
17610 2003-07-20 Martin Baulig <martin@ximian.com>
17612 * namespace.cs: Fixed that bug which caused a crash when compiling
17613 the debugger's GUI.
17615 2003-07-20 Miguel de Icaza <miguel@ximian.com>
17617 * typemanager.cs (LookupTypeReflection): Never expose types which
17618 are NotPublic, NestedPrivate, NestedAssembly, or
17619 NestedFamANDAssem. We used to return these, and later do a check
17620 that would report a meaningful error, but the problem is that we
17621 would not get the real match, if there was a name override.
17623 2003-07-18 Miguel de Icaza <miguel@ximian.com>
17625 * namespace.cs (Namespace, Name): Do not compute the namespace
17626 name dynamically, compute it in the constructor. This reduced
17627 memory usage by 1697 KB.
17629 * driver.cs: Use --pause to pause at the end.
17631 2003-07-17 Peter Williams <peter@newton.cx>
17633 * Makefile: Change the name of the test target so that it doesn't
17634 conflict with the recursive test target.
17636 2003-07-17 Miguel de Icaza <miguel@ximian.com>
17638 * expression.cs (LocalVariableReference.Emit, EmitAssign,
17639 AddressOf): Do not use EmitThis, that was wrong, use the actual
17642 2003-07-15 Miguel de Icaza <miguel@ximian.com>
17644 * class.cs (MethodData.Define): While checking if a method is an
17645 interface implementation, improve the test: If we are not public
17646 (use new test here: use the computed MethodAttributes directly,
17647 instead of the parsed modifier flags) check if the `implementing'
17648 method comes from an interface or not.
17650 * pending.cs (VerifyPendingMethods): Slightly better error
17653 * makefile: add test target that does the mcs bootstrap.
17655 2003-07-16 Ravi Pratap <ravi@ximian.com>
17657 * interface.cs (Define): Do nothing here since there are no
17658 members to populate etc. Move the attribute emission out of here
17659 since this was just totally the wrong place to put it. Attribute
17660 application happens during the 'Emit' phase, not in the 'Define'
17663 (Emit): Add this method and move the attribute emission here
17665 * rootcontext.cs (EmitCode): Call the Emit method on interface
17668 2003-07-14 Ravi Pratap M <ravi@ximian.com>
17670 * expression.cs (OverloadResolve): Report error only if Location
17671 is not 'Null' which means that there was a probe going on.
17673 2003-07-14 Martin Baulig <martin@ximian.com>
17675 * expression.cs (ConditionalLogicalOperator): New public class to
17676 implement user defined conditional logical operators.
17677 This is section 14.11.2 in the spec and bug #40505.
17679 2003-07-14 Martin Baulig <martin@ximian.com>
17681 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
17683 2003-07-14 Martin Baulig <martin@ximian.com>
17685 * codegen.cs (EmitContext.InFixedInitializer): New public field.
17687 * ecore.cs (IVariable.VerifyFixed): New interface method.
17689 * expression.cs (Unary.ResolveOperator): When resolving the `&'
17690 operator, check whether the variable is actually fixed. Fixes bug
17691 #36055. Set a variable definitely assigned when taking its
17692 address as required by the spec.
17694 * statement.cs (LocalInfo.IsFixed): New field.
17695 (LocalInfo.MakePinned): Set `IsFixed' to true.
17697 2003-07-14 Ravi Pratap M <ravi@ximian.com>
17699 * attribute.cs (Attribute.Resolve): While doing a Member lookup
17700 for .ctors, ensure that we only ask for members declared in the
17701 attribute type (BindingFlags.DeclaredOnly).
17705 * expression.cs (Error_WrongNumArguments): Report error 1501
17706 correctly the way CSC does.
17708 2003-07-13 Martin Baulig <martin@ximian.com>
17710 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
17711 lookup on the fully qualified name, to make things like "X.X" work
17712 where "X.X" is a fully qualified type name, but we also have a
17713 namespace "X" in the using list. Fixes #41975.
17715 2003-07-13 Martin Baulig <martin@ximian.com>
17717 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
17718 function. If we're a CompoundAssign, we need to create an embedded
17719 CompoundAssign, not an embedded Assign.
17720 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
17723 2003-07-13 Martin Baulig <martin@ximian.com>
17725 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
17726 work to fix bug #46088.
17728 2003-07-13 Ravi Pratap <ravi@ximian.com>
17730 * class.cs (Operator.Emit): Do not emit attributes here - it is
17731 taken care of by the Method class that we delegate too. This takes
17732 care of bug #45876.
17734 2003-07-10 Martin Baulig <martin@ximian.com>
17736 * expression.cs (TypeOfVoid): New class.
17737 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
17739 2003-07-10 Martin Baulig <martin@ximian.com>
17741 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
17744 2003-07-10 Martin Baulig <martin@ximian.com>
17746 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
17747 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
17749 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
17751 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
17753 2003-07-10 Martin Baulig <martin@ximian.com>
17755 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
17756 of decimal. Fixes #42850.
17758 NOTE: I also fixed the created byte blob, but this doesn't work on
17759 the MS runtime and csc never produces any byte blobs for decimal
17762 2003-07-10 Martin Baulig <martin@ximian.com>
17764 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
17765 structs; fixes #32068.
17766 (Block.AddChildVariableNames): Fixed #44302.
17768 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17770 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
17772 2003-07-07 Miguel de Icaza <miguel@ximian.com>
17774 * attribute.cs: And this test is onger needed.
17776 2003-07-08 Martin Baulig <martin@ximian.com>
17778 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
17779 inaccessible types. Fixes #36313.
17781 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
17783 * namespace.cs (NamespaceEntry): Create implicit entries for all
17784 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
17785 implicit entries for N1.N2 and N1.
17787 2003-07-08 Martin Baulig <martin@ximian.com>
17789 Rewrote the handling of namespaces to fix a lot of the issues
17790 wrt. `using' aliases etc.
17792 * namespace.cs (Namespace): Splitted this class into a
17793 per-assembly `Namespace' and a per-file `NamespaceEntry'.
17795 * typemanager.cs (TypeManager.IsNamespace): Removed.
17796 (TypeManager.ComputeNamespaces): Only compute namespaces from
17797 loaded assemblies here, not the namespaces from the assembly we're
17798 currently compiling.
17800 2003-07-08 Martin Baulig <martin@ximian.com>
17802 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
17804 2003-07-07 Miguel de Icaza <miguel@ximian.com>
17806 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
17809 I thought about the memory savings here, but LookupTypeReflection
17810 is used under already very constrained scenarios. Compiling
17811 corlib or mcs only exposes one hit, so it would not really reduce
17812 any memory consumption.
17814 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17816 * typemanager.cs: fixes bug #45889 by only adding public types from
17817 other assemblies to the list of known types.
17819 2003-07-07 Miguel de Icaza <miguel@ximian.com>
17821 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
17822 on the type we resolved.
17824 2003-07-05 Martin Baulig <martin@ximian.com>
17826 * pending.cs (PendingImplementation.ParentImplements): Don't
17827 create the proxy if the parent is abstract.
17829 * class.cs (TypeContainer.DefineIndexers): Process explicit
17830 interface implementations first. Fixes #37714.
17832 2003-07-04 Miguel de Icaza <miguel@ximian.com>
17834 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
17835 defined recursively; but since we modify the input parameters
17836 (left is set to `this' temporarily), we reset this value if the
17837 left_is_explicit is false, which gives the original semantics to
17840 * literal.cs (NullPointer): new class used to represent a null
17841 literal in a pointer context.
17843 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
17844 type is a pointer, use a NullPointer object instead of a
17845 NullLiteral. Closes 43687
17847 (ExplicitConversion): Convert pointer values using
17848 the conv opcode to the proper type.
17850 * ecore.cs (New): change ValueTypeVariable property into a method,
17851 that returns whether the valuetype is suitable for being used.
17853 * expression.cs (Binary.DoNumericPromotions): Only return if we
17854 the int constant was a valid uint, and we can return both left and
17855 right as uints. If not, we continue processing, to trigger the
17856 type conversion. This fixes 39018.
17858 * statement.cs (Block.EmitMeta): During constant resolution, set
17859 the CurrentBlock property on the emitcontext, so that we resolve
17860 constants propertly.
17862 2003-07-02 Martin Baulig <martin@ximian.com>
17864 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
17865 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
17867 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
17868 than emitting it here.
17870 * statement.cs: Fixed some more flow analysis bugs.
17872 2003-07-02 Martin Baulig <martin@ximian.com>
17874 * class.cs (MethodData.Define): When implementing interface
17875 methods, set Final unless we're Virtual.
17877 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
17878 check work for interface methods.
17880 2003-07-01 Martin Baulig <martin@ximian.com>
17882 * ecore.cs (EmitContext.This): Replaced this property with a
17883 GetThis() method which takes a Location argument. This ensures
17884 that we get the correct error location for a CS0188.
17886 2003-07-01 Miguel de Icaza <miguel@ximian.com>
17888 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
17889 ImplicitStandardConversion.
17891 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
17893 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
17895 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
17898 2003-06-30 Miguel de Icaza <miguel@ximian.com>
17900 * class.cs (Constructor.Define): Turn off initlocals for unsafe
17903 (MethodData.Define): Turn off initlocals for unsafe methods.
17905 2003-06-29 Miguel de Icaza <miguel@ximian.com>
17907 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
17908 complete; Fixes #37521.
17910 * delegate.cs: Use Modifiers.TypeAttr to compute the
17911 TypeAttributes, instead of rolling our own. This makes the flags
17912 correct for the delegates.
17914 2003-06-28 Miguel de Icaza <miguel@ximian.com>
17916 * class.cs (Constructor.Define): Set the private flag for static
17917 constructors as well.
17919 * cs-parser.jay (statement_expression): Set the return value to
17920 null, to avoid a crash when we catch an error.
17922 2003-06-24 Miguel de Icaza <miguel@ximian.com>
17924 * cs-parser.jay: Applied patch from Jackson that adds support for
17925 extern and unsafe modifiers to destructor declarations.
17927 * expression.cs: Report error 21 if the user is trying to index a
17930 * driver.cs: Add an error message, suggested by the bug report.
17932 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
17933 if we do not have a ": this ()" constructor initializer. Fixes 45149
17935 2003-06-14 Miguel de Icaza <miguel@ximian.com>
17937 * namespace.cs: Add some information to reduce FAQs.
17939 2003-06-13 Miguel de Icaza <miguel@ximian.com>
17941 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
17942 underlying enumeration types. Fixes #43915.
17944 * expression.cs: Treat ushort/short as legal values to be used in
17945 bitwise operations.
17947 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
17949 * delegate.cs: transfer custom attributes for paramenters from
17950 the delegate declaration to Invoke and BeginInvoke.
17952 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
17954 * attribute.cs: handle custom marshalers and emit marshal info
17957 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
17959 * makefile.gnu: Added anonymous.cs to the compiler sources.
17961 2003-05-28 Miguel de Icaza <miguel@ximian.com>
17963 * iterators.cs: Change the name of the proxy class to include two
17966 * cs-parser.jay: Update grammar to include anonymous methods.
17968 * anonymous.cs: new file.
17970 2003-05-27 Miguel de Icaza <miguel@ximian.com>
17972 * class.cs (Field.Define): Add missing test for pointers and
17975 2003-05-27 Ravi Pratap <ravi@ximian.com>
17977 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
17978 we use the stobj opcode.
17980 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
17981 since it wasn't the correct fix.
17983 It still is puzzling that we are required to use stobj for IntPtr
17984 which seems to be a ValueType.
17986 2003-05-26 Miguel de Icaza <miguel@ximian.com>
17988 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
17989 during regular simple name resolution. Now, the trick is that
17990 instead of returning for processing the simplename, we do a
17991 TypeManager.LookupType (ie, a rooted lookup as opposed to a
17992 contextual lookup type). If a match is found, return that, if
17993 not, return for further composition.
17995 This fixes long-standing 30485.
17997 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
17998 using the address to initialize an object, do an Stobj instead of
17999 using the regular Stelem.
18001 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
18002 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
18003 Because if we are a BaseIndexerAccess that value will be true.
18006 * statement.cs (GotoCase.Resolve): Return after reporting an
18007 error, do not attempt to continue.
18009 * expression.cs (PointerArithmetic.Emit): If our operand is a
18010 long, convert our constants to match the operand before
18011 multiplying. Convert to I type before adding. Fixes 43670.
18013 2003-05-14 Ravi Pratap <ravi@ximian.com>
18015 * enum.cs (ImplicitConversionExists) : Rename to
18016 ImplicitEnumConversionExists to remove ambiguity.
18018 * ecore.cs (NullCast): New type of cast expression class which
18019 basically is very similar to EmptyCast with the difference being
18020 it still is a constant since it is used only to cast a null to
18022 (eg. (string) null)
18024 * convert.cs (ImplicitReferenceConversion): When casting a null
18025 literal, we return a NullCast.
18027 * literal.cs (NullLiteralTyped): Remove - I don't see why this
18028 should be around anymore.
18030 The renaming (reported was slightly wrong). Corrections:
18032 ConvertImplicitStandard -> ImplicitConversionStandard
18033 ConvertExplicitStandard -> ExplicitConversionStandard
18035 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
18036 before passing them in !
18038 * convert.cs (ImplicitConversionStandard): When comparing for
18039 equal expr and target types, ensure that expr is not a
18042 In general, we must not be checking (expr_type ==
18043 target_type) in the top level conversion methods
18044 (ImplicitConversion, ExplicitConversion etc). This checking is
18045 done in the methods that they delegate to.
18047 2003-05-20 Miguel de Icaza <miguel@ximian.com>
18049 * convert.cs: Move Error_CannotConvertType,
18050 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
18051 ImplicitNumericConversion, ImplicitConversionExists,
18052 ImplicitUserConversionExists, StandardConversionExists,
18053 FindMostEncompassedType, FindMostSpecificSource,
18054 FindMostSpecificTarget, ImplicitUserConversion,
18055 ExplicitUserConversion, GetConversionOperators,
18056 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
18057 TryImplicitIntConversion, Error_CannotConvertImplicit,
18058 ConvertImplicitRequired, ConvertNumericExplicit,
18059 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
18060 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
18063 Perform the following renames:
18065 StandardConversionExists -> ImplicitStandardConversionExists
18066 ConvertImplicit -> ImplicitConversion
18067 ConvertImplicitStandard -> ImplicitStandardConversion
18068 TryImplicitIntConversion -> ImplicitIntConversion
18069 ConvertImplicitRequired -> ImplicitConversionRequired
18070 ConvertNumericExplicit -> ExplicitNumericConversion
18071 ConvertReferenceExplicit -> ExplicitReferenceConversion
18072 ConvertExplicit -> ExplicitConversion
18073 ConvertExplicitStandard -> ExplicitStandardConversion
18075 2003-05-19 Martin Baulig <martin@ximian.com>
18077 * statement.cs (TypeInfo.StructInfo): Made this type protected.
18078 (TypeInfo): Added support for structs having structs as fields.
18080 * ecore.cs (FieldExpr): Implement IVariable.
18081 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
18082 VariableInfo for the field.
18084 2003-05-18 Martin Baulig <martin@ximian.com>
18086 * expression.cs (This.DoResolve): Report a CS0027 if we're
18087 emitting a field initializer.
18089 2003-05-18 Martin Baulig <martin@ximian.com>
18091 * expression.cs (This.ResolveBase): New public function.
18092 (This.DoResolve): Check for CS0188.
18094 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
18097 * ecore.cs (MethodGroupExpr.DoResolve): Set the
18098 `instance_expression' to null if we don't have any non-static
18101 2003-05-18 Martin Baulig <martin@ximian.com>
18103 Reworked the way how local variables and parameters are handled by
18104 the flow analysis code.
18106 * statement.cs (TypeInfo, VariableMap): New public classes.
18107 (VariableInfo): New public class. This is now responsible for
18108 checking whether a variable has been assigned. It is used for
18109 parameters and local variables.
18110 (Block.EmitMeta): Take the InternalParameters as argument; compute
18111 the layout of the flow vectors here.
18112 (Block.LocalMap, Block.ParameterMap): New public properties.
18113 (FlowBranching): The .ctor doesn't get the InternalParameters
18114 anymore since Block.EmitMeta() now computes the layout of the flow
18116 (MyStructInfo): This class is now known as `StructInfo' and nested
18117 in `TypeInfo'; we don't access this directly anymore.
18119 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
18120 property and removed IsAssigned(), IsFieldAssigned(),
18121 SetAssigned() and SetFieldAssigned(); we now call them on the
18122 VariableInfo so we don't need to duplicate this code everywhere.
18124 * expression.cs (ParameterReference): Added `Block block' argument
18126 (LocalVariableReference, ParameterReference, This): The new
18127 VariableInfo class is now responsible for all the definite
18130 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
18131 IsParameterAssigned, SetParameterAssigned): Removed.
18133 2003-05-18 Martin Baulig <martin@ximian.com>
18135 * typemanager.cs (InitCoreTypes): Try calling
18136 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
18137 the 3-args-version. Corlib now also needs our `void_type'.
18138 (GetMethod): Added overloaded version which takes an optional
18139 `bool report_errors' to allow lookups of optional methods.
18141 2003-05-12 Martin Baulig <martin@ximian.com>
18143 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
18144 only used for locals and not for parameters.
18146 2003-05-12 Miguel de Icaza <miguel@ximian.com>
18148 * support.cs (InternalParameters.ParameterType): Return the
18149 ExternalType of the parameter.
18151 * parameter.cs (Parameter.ExternalType): drop the two arguments,
18154 2003-05-11 Miguel de Icaza <miguel@ximian.com>
18156 * class.cs (MethodData.Define): Do not set the `newslot' on
18157 interface members, if they are also flagged as "override".
18159 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
18160 better code for ++i and i++. This only works for static fields
18161 and local variables.
18163 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
18164 want to pull the DeclSpace out of the builder_to_declspace instead
18165 of the TypeBuilder (like in TypeContainer.FindMembers).
18167 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
18168 instead of LookupTypeContainer. Fixes the crash on .NET for
18169 looking up interface members.
18171 * const.cs: Create our own emit context during the Definition
18172 stage, so that constants are evaluated in the proper context, when
18173 a recursive definition happens.
18175 2003-05-11 Martin Baulig <martin@ximian.com>
18177 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
18178 new block for a switch section.
18179 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
18180 the adding/lookup in the switch block. Fixes #39828.
18182 2003-05-09 Miguel de Icaza <miguel@ximian.com>
18184 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
18185 functionality: I needed to convert the data after I had performed
18186 the add/sub operation into the operands type size.
18188 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
18189 pass the type for the box operation, otherwise the resulting
18190 object would have been of type object.
18192 (BoxedCast): Add constructor to specify the type to box as.
18194 2003-05-07 Miguel de Icaza <miguel@ximian.com>
18196 * iterators.cs: I was reusing the `count' variable inadvertently,
18197 take steps to not allow this to happen.
18199 2003-05-06 Miguel de Icaza <miguel@ximian.com>
18201 * attribute.cs (Attribute.Resolve): Params attributes are encoded
18202 by creating an array at the point where the params starts and
18203 putting all those arguments there, then adjusting the size of the
18206 2003-05-05 Miguel de Icaza <miguel@ximian.com>
18208 * expression.cs (New.AddressOf): Implement interface
18209 IMemoryLocation. This is used when the `new' operator is used in
18210 the context of an invocation to a method on a value type.
18212 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
18215 * namespace.cs: Also check the using aliases here.
18217 * driver.cs: Move the test for using validity after the types have
18218 been entered, so we do a single pass that also includes the using
18221 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
18222 in the regular case. CreateSiblingForFinally is doing extra
18225 * attribute.cs (GetAttributeArgumentExpression): Store the result
18226 on an out value, and use the return value to indicate failure
18227 instead of using null (which is a valid return for Constant.GetValue).
18229 * statement.cs: Perform the analysis flow for the increment
18230 portion after the statement, because this will be the real flow of
18231 execution. Fixes #42385
18233 * codegen.cs (EmitContext.EmitArgument,
18234 EmitContext.EmitStoreArgument): New helper functions when the
18235 RemapToProxy flag is set.
18237 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
18240 Add support for remapping parameters.
18242 * iterators.cs: Propagate parameter values; Store parameter
18243 values in the proxy classes.
18245 2003-05-04 Miguel de Icaza <miguel@ximian.com>
18247 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
18248 need a proxy reference; I do not know what I was thinking
18250 * cs-parser.jay (constructor_initializer): catch another error,
18251 and display nice message.
18253 (field_declaration): catch void field declaration
18254 to flag a better error.
18256 * class.cs (MemberBase.CheckBase): Report an error instead of a
18257 warning if a new protected member is declared in a struct.
18258 (Field.Define): catch the error of readonly/volatile.
18260 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
18262 (FieldExpr.AddressOf): ditto. Catch error where the address of a
18263 volatile variable is taken
18265 2003-05-02 Miguel de Icaza <miguel@ximian.com>
18267 * statement.cs (Fixed.Resolve): Report an error if we are not in
18270 2003-05-01 Miguel de Icaza <miguel@ximian.com>
18272 * typemanager.cs: reuse the code that handles type clashes for
18273 delegates and enumerations.
18275 * class.cs (Report28): Always report.
18277 * expression.cs (EncodeAsAttribute): Allow nulls here.
18279 2003-04-28 Miguel de Icaza <miguel@ximian.com>
18281 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
18282 the functionality for testing whether an expression is valid for
18283 an attribute here. Also handle the case of arrays of elements
18286 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
18287 encoding a linear array into an array of objects that are suitable
18288 to be passed to an CustomAttributeBuilder.
18290 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
18292 * ecore.cs: (FieldExpr): Handle field remapping here.
18294 * iteratators.cs: Pass the instance variable (if the method is an
18295 instance method) to the constructors, so we can access the field
18296 variables on the class.
18298 TODO: Test this with structs. I think the THIS variable on
18299 structs might have to be a pointer, and not a refenrece
18301 2003-04-27 Miguel de Icaza <miguel@ximian.com>
18303 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
18304 local variables to fields in a proxy class.
18306 * iterators.cs (PopulateProxy): Rename our internal fields to
18308 Create a <THIS> field if we are an instance method, so we can
18309 reference our parent container variables.
18310 (MapVariable): Called back from the EmitContext code to enter a
18311 new variable to field mapping into the proxy class (we just create
18315 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
18316 for using the remapped locals to fields.
18318 I placed the code here, because that gives the same semantics to
18319 local variables, and only changes the Emit code.
18321 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
18322 statements inside iterators.
18323 (VariableInfo): Add a FieldBuilder for the cases when we are
18324 remapping local variables to fields in a proxy class
18326 * ecore.cs (SimpleNameResolve): Avoid testing two times for
18327 current_block != null.
18329 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
18330 not cope with strings, as it has been moved to the
18331 TableSwitchEmit. Fixed bug in switch generation.
18333 * expression.cs (New.DoResolve): Provide more context for the user
18334 when reporting an error.
18336 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
18339 * expression.cs (MemberAccess.DoResolve): When we get a type back,
18340 check the permissions for it. Note than in a type-resolution
18341 context the check was already present in DeclSpace.ResolveType,
18342 but was missing from the MemberAccess.
18344 (ArrayCreation.CheckIndices): warn if the user has
18345 more nested levels of expressions, but there are no more
18346 dimensions specified. Avoids crash on bug 41906.
18348 2003-04-26 Miguel de Icaza <miguel@ximian.com>
18350 * statement.cs (Block): replace Implicit bool, for a generic
18352 New flag: `Unchecked'. This is used during the EmitMeta phase
18353 (which is out-of-line with the regular Resolve/Emit process for a
18354 statement, as this is done ahead of time, but still gets a chance
18355 to call constant resolve).
18357 (Block.Flags): new enum for adding a new flag.
18359 (Block.EmitMeta): track the state of unchecked.
18361 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
18362 to enable constant resolution to work there as well.
18364 2003-04-22 Miguel de Icaza <miguel@ximian.com>
18366 * typemanager.cs (ienumerable_type): Also look up
18367 System.Collections.IEnumerable.
18369 2003-04-21 Miguel de Icaza <miguel@ximian.com>
18371 TODO: Test more than one conditional per method.
18373 * class.cs (Indexer.Define): Report the location where the user is
18374 referencing the unsupported feature.
18376 (MethodData): Overload the use of `conditionals' to
18377 minimize the creation of needless ArrayLists. This saves roughly
18378 212kb on my machine.
18380 (Method): Implement the new IIteratorContainer interface.
18381 (Method.SetYields): Implement the method by setting the ModFlags
18382 to contain METHOD_YIELDS.
18384 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
18385 which just got set to null.
18387 * iterators.cs: New file.
18389 (Yield, YieldBreak): New statements.
18391 * statement.cs (Return.Resolve): Flag an error if we are used in
18392 an iterator method.
18394 * codegen.cs (InIterator): New flag set if the code is being
18395 compiled in an iterator method.
18397 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
18398 internal modifier, and we just use it to avoid adding extra
18399 fields, as this is seldom used.
18401 * cs-parser.jay: Add yield_statement (yield and yield break).
18403 * driver.cs: New flag -v2 to turn on version 2 features.
18405 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
18406 hashtable when v2 is enabled.
18408 2003-04-20 Miguel de Icaza <miguel@ximian.com>
18410 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
18411 there is already a namespace defined with this name.
18413 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
18414 people upgraded their corlibs.
18416 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
18417 always use fully qualified types, no need to use the compiler
18420 (TypeManager.IsNamespace): Use binarysearch.
18422 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
18423 AddDelegate): I did not quite use the new IsValid API properly: I
18424 have to pass the short-name and the fullname. I was passing only
18425 the basename instead of the fullname sometimes.
18427 (TypeContainer.DefineType): call NamespaceClash.
18429 * interface.cs (Interface.DefineType): use NamespaceClash before
18432 * delegate.cs (Delegate.DefineType): use NamespaceClash before
18435 * enum.cs: (Enum.DefineType): use NamespaceClash before
18438 * typemanager.cs (: 3-line patch that gives us some tasty 11%
18439 speed increase. First, use the negative_hits cache when we get a
18440 negative. Second, add the type with its full original name
18441 instead of the new . and + encoded name (reflection uses + to
18442 separate type from a nested type). Use LookupTypeReflection
18443 directly which bypasses the type->name hashtable (that we already
18444 know does not contain the type.
18446 * decl.cs (DeclSpace.ResolveTypeExpr): track the
18447 location/container type.
18449 * driver.cs: When passing utf8, use directly the UTF8Encoding.
18451 2003-04-19 Miguel de Icaza <miguel@ximian.com>
18453 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
18455 * delegate.cs (NewDelegate.Resolve): Test whether an instance
18456 method is being referenced in the method group from a static
18457 context, and report error 120 if so.
18459 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
18462 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
18463 is created, we create the A namespace).
18465 * cs-parser.jay: A namespace also introduces a DeclarationFound.
18468 2003-04-18 Miguel de Icaza <miguel@ximian.com>
18470 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
18471 invocation to ModuleBuilder.GetType with the same values will
18472 return a new type instance, so we need to cache its return
18475 * expression.cs (Binary.ResolveOperator): Only allow the compare
18476 operators on enums if they are of the same type.
18478 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
18479 types of ValueType on their own case. Before we were giving them
18480 the same treatment as objects.
18482 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
18483 fullname. Short name is used to compare against container name.
18484 Fullname is used to check against defined namespace names.
18486 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
18487 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
18489 (Method.CheckBase): Call parent.
18490 (MemberBase.CheckBase): Check for protected members on sealed
18492 (PropertyBase.CheckBase): Call parent.
18493 (Field.Define): Call parent.
18495 * report.cs: Negative error codes are now mapped to 8000 - code,
18496 so that the display is render more nicely.
18498 * typemanager.cs: Do not use try/catch, instead report a regular
18501 (GetPointerType, GetReferenceType): These methods provide
18502 mechanisms to obtain the T* and T& from a T. We had the code
18503 previously scattered around the code base, and it also used
18504 TypeManager.LookupType that would go through plenty of caches.
18505 This one goes directly to the type source.
18507 In some places we did the Type.GetType followed by
18508 ModuleBuilder.GetType, but not in others, so this unifies the
18509 processing as well.
18511 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
18512 statements now that we have namespace information.
18514 * typemanager.cs (IsNamespace): New method, returns whether the
18515 string presented is a namespace or not.
18517 (ComputeNamespaces): New public entry point, computes the list of
18518 available namespaces, using the GetNamespaces API call in Mono, or
18519 the slower version in MS.NET.
18521 Now before we start the semantic analysis phase, we have a
18522 complete list of namespaces including everything that the user has
18525 Deleted old code to cache namespaces in .nsc files.
18527 2003-04-17 Miguel de Icaza <miguel@ximian.com>
18529 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
18530 class/struct location definition Location for the implicit
18531 constructor location.
18533 (Operator.Define): Use the location of the operator for the
18534 implicit Method definition.
18536 (Constructor.Emit): use the constructor location for the implicit
18537 base initializer constructor.
18539 * ecore.cs: Remove ITypeExpression. This interface is now gone,
18540 and the Expression class now contains two new methods:
18542 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
18543 isolate type lookup from the rest of the resolution process.
18545 Since we use Expressions to hold type definitions due to the way
18546 we parse the input we have historically overloaded Resolve to
18547 perform the Type lookups if a special flag is passed. Now this is
18548 eliminated and two methods take their place.
18550 The differences in the two methods between xStep and xTerminal is
18551 that xStep is involved in our current lookup system that uses
18552 SimpleNames to compose a name, while xTerminal is used just to
18553 catch the case where the simplename lookup failed.
18555 2003-04-16 Miguel de Icaza <miguel@ximian.com>
18557 * expression.cs (ResolveMemberAccess): Remove redundant code.
18558 TypeExpr expressions are always born fully resolved.
18560 * interface.cs (PopulateMethod): Do not lookup the types twice.
18561 We were doing it once during SemanticAnalysis and once during
18564 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
18565 in local variable type definitions, were being returned as a
18566 SimpleName (we decomposed everything into a string), that is
18567 because primary_expression was being used instead of a type in the
18568 grammar (reduce/reduce conflicts).
18570 The part that was wrong is that we converted the expression into a
18571 string (an oversimplification in one hand, compounded with primary
18572 expressions doing string concatenation).
18578 Would return "A.B.C[]" as a SimpleName. This stopped things like
18579 using clauses from working on this particular context. And a type
18580 was being matched directly against "A.B.C[]".
18582 We now use the correct approach, and allow for ComposedCast to be
18583 part of the unary expression. So the "A.B.C []" become a composed
18584 cast of "A.B.C" (as a nested group of MemberAccess with a
18585 SimpleName at the end) plus the rank composition "[]".
18589 2003-04-10 Miguel de Icaza <miguel@ximian.com>
18591 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
18592 for the access level checking.
18594 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
18595 `TypeContainer container', because I kept getting confused when I
18596 was debugging this code.
18598 * expression.cs (Indexers): Instead of tracking getters/setters,
18599 we now track them in parallel. We create one arraylist less, but
18600 most importantly it is possible now for the LValue code to find a
18601 matching get for a set.
18603 (IndexerAccess.DoResolveLValue): Update the code.
18604 GetIndexersForType has been modified already to extract all the
18605 indexers from a type. The code assumed it did not.
18607 Also make the code set the correct return type for the indexer.
18608 This was fixed a long time ago for properties, but was missing for
18609 indexers. It used to be void_type.
18611 (Binary.Emit): Test first for doubles instead of
18612 floats, as they are more common.
18614 (Binary.EmitBranchable): Use the .un version of the branch opcodes
18615 when dealing with floats and the <=, >= operators. This fixes bug
18618 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
18619 to load the array value by emitting a load on the foreach variable
18620 type. This was incorrect.
18622 We now emit the code to load an element using the the array
18623 variable type, and then we emit the conversion operator.
18627 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
18629 * attribute.cs: Avoid allocation of ArrayLists in the common case.
18631 2003-04-09 Miguel de Icaza <miguel@ximian.com>
18633 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
18634 test for protection before we test for signatures.
18636 (MethodSignature.ToString): implement.
18638 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
18639 to the case where we reduced into a LongConstant.
18641 * decl.cs (CheckAccessLevel): If the type is an array, we can not
18642 depend on whether the information is acurrate, because the
18643 Microsoft runtime will always claim that the array type is public,
18644 regardless of the real state.
18646 If the type is a pointer, another problem happens: the type is
18647 reported as non-public in Microsoft.
18649 In both cases we have to call CheckAccessLevel recursively with
18650 the underlying type as the argument to be tested.
18652 2003-04-08 Miguel de Icaza <miguel@ximian.com>
18654 * assign.cs (Assign.Emit): If we are dealing with a compound
18655 assignment expression, we should use the code path that stores the
18656 intermediate result in a temporary value. This fixes #40903.
18658 *expression.cs (Indirection.ToString): Provide ToString method for
18661 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
18663 * class.cs: Null out fields holding references to Block objects so
18664 they can be garbage collected.
18666 * expression.cs (OverloadResolve): Remove unused local.
18668 2003-04-07 Martin Baulig <martin@ximian.com>
18670 * codegen.cs (EmitContext.CurrentFile): New public field.
18671 (EmitContext.Mark): Use the CurrentFile to check whether the
18672 location is in the correct file.
18673 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
18675 2003-04-07 Martin Baulig <martin@ximian.com>
18677 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
18679 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
18680 location. [FIXME: The location argument which gets passed to this
18681 method is sometimes wrong!]
18683 2003-04-07 Nick Drochak <ndrochak@gol.com>
18685 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
18687 2003-04-07 Miguel de Icaza <miguel@ximian.com>
18689 * expression.cs (Indirection.EmitAssign): We were using the
18690 temporary, but returning immediately instead of continuing the
18693 2003-04-06 Martin Baulig <martin@ximian.com>
18695 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
18696 if it's a nested child, but also deriving from the outer class.
18699 * typemanager.cs (IsNestedChildOf): Make this work if it's a
18700 nested child, but also deriving from the outer class. See
18702 (FilterWithClosure): We may access private members of the outer
18703 class if we're a nested child and deriving from the outer class.
18704 (RealMemberLookup): Only set `closure_private_ok' if the
18705 `original_bf' contained BindingFlags.NonPublic.
18707 2003-04-05 Martin Baulig <martin@ximian.com>
18709 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
18711 2003-04-02 Miguel de Icaza <miguel@ximian.com>
18713 * class.cs (Event.Define): Do not allow abstract events to have
18716 2003-04-01 Miguel de Icaza <miguel@ximian.com>
18718 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
18719 block in event declarations.
18721 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
18722 value type, get its address.
18724 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
18725 leaving a class on the stack instead of a boolean value (int
18726 0/1). Change the code so we compare against null, and then the
18727 result against zero.
18729 * class.cs (TypeContainer.GetClassBases): We were checking for the
18730 parent class being sealed too late.
18732 * expression.cs (Binary.Emit): For <= and >= when dealing with
18733 floating point values, use cgt.un and clt.un instead of cgt and
18736 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
18738 * statement.cs: Apply the same optimization as MS: skip the
18739 GetEnumerator returning an IEnumerator, and use the one returning a
18740 CharEnumerator instead. This allows us to avoid the try-finally block
18743 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
18745 * cs-parser.jay: Attributes cannot be applied to
18746 namespaces. Fixes #40473
18748 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18751 (Add*): check if the name is valid using the full name for constants,
18752 fields, properties and events.
18754 2003-03-28 Miguel de Icaza <miguel@ximian.com>
18756 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
18757 char constants to be part of the enumeration.
18759 * expression.cs (Conditional.DoResolve): Add support for operator
18760 true. Implements the missing functionality from 14.12
18762 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
18763 operator true/false as required by the spec.
18765 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
18766 implicit conversion to boolean.
18768 * statement.cs (Statement.ResolveBoolean): A boolean expression is
18769 also one where the type implements `operator true'.
18771 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
18772 get an expression that will invoke operator true based on an
18775 (GetConversionOperators): Removed the hack that called op_True
18778 (Expression.ResolveBoolean): Move this from Statement.
18780 2003-03-17 Miguel de Icaza <miguel@ximian.com>
18782 * ecore.cs (FieldExpr): do not allow initialization of initonly
18783 fields on derived classes
18785 2003-03-13 Martin Baulig <martin@ximian.com>
18787 * statement.cs (Block.Emit): Call ig.BeginScope() and
18788 ig.EndScope() when compiling with debugging info; call
18789 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
18791 2003-03-08 Miguel de Icaza <miguel@ximian.com>
18793 * expression.cs (Indexers): Do not construct immediately, allow
18794 for new members to be appended as we go. Fixes 38143
18796 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18798 * expression.cs: save/restore context when resolving an unchecked
18801 2003-03-05 Miguel de Icaza <miguel@ximian.com>
18803 * cfold.cs: Catch division by zero in modulus operator during
18806 2003-03-03 Miguel de Icaza <miguel@ximian.com>
18808 * interface.cs (Interface.DefineMembers): Avoid defining members
18811 2003-02-27 Miguel de Icaza <miguel@ximian.com>
18813 * driver.cs: handle the +/- options for -noconfig
18815 * statement.cs (Unckeched.Resolve): Also track the state of
18816 unchecked in the Resolve phase.
18818 2003-02-27 Martin Baulig <martin@ximian.com>
18820 * ecore.cs (Expression.MemberLookup): Don't create a
18821 MethodGroupExpr for something which is not a method. Fixes #38291.
18823 2003-02-25 Miguel de Icaza <miguel@ximian.com>
18825 * class.cs (MemberBase.CheckParameters): Also check that the type
18826 is unmanaged if it is a pointer.
18828 * expression.cs (SizeOf.Resolve): Add location information.
18830 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
18831 a managed type is declared.
18833 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
18834 parameter modifiers as well. Fixes bug 38606
18836 * class.cs: Very sad. Am backing out the speed up changes
18837 introduced by the ArrayList -> Array in the TypeContainer, as they
18838 were not actually that much faster, and introduced a bug (no error
18839 reports on duplicated methods).
18841 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
18842 source first, this will guarantee that we have a valid expression
18843 before calling in lower levels functions that will require a
18844 resolved object. Then use this original_source in the
18845 target.ResolveLValue instead of the original source that was
18848 Another change. Use target.Resolve instead of LValueResolve.
18849 Although we are resolving for LValues, we will let the Assign code
18850 take care of that (it will be called again from Resolve). This
18851 basically allows code like this:
18853 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
18854 class Y { void A (X x) { x [0] += o; }
18856 The problem was that the indexer was trying to resolve for
18857 set_Item (idx, object o) and never finding one. The real set_Item
18858 was set_Item (idx, X). By delaying the process we get the right
18863 2003-02-23 Martin Baulig <martin@ximian.com>
18865 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
18866 while calling DoEmit ().
18868 * codegen.cs (EmitContext.Mark): Don't mark locations in other
18869 source files; if you use the #line directive inside a method, the
18870 compiler stops emitting line numbers for the debugger until it
18871 reaches the end of the method or another #line directive which
18872 restores the original file.
18874 2003-02-23 Martin Baulig <martin@ximian.com>
18876 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
18878 2003-02-23 Martin Baulig <martin@ximian.com>
18880 * statement.cs (Block.AddChildVariableNames): We need to call this
18881 recursively, not just for our immediate children.
18883 2003-02-23 Martin Baulig <martin@ximian.com>
18885 * class.cs (Event.Define): Always make the field private, like csc does.
18887 * typemanager.cs (TypeManager.RealMemberLookup): Make events
18888 actually work, fixes bug #37521.
18890 2003-02-23 Miguel de Icaza <miguel@ximian.com>
18892 * delegate.cs: When creating the various temporary "Parameters"
18893 classes, make sure that we call the ComputeAndDefineParameterTypes
18894 on those new parameters (just like we do with the formal ones), to
18895 allow them to be resolved in the context of the DeclSpace.
18897 This fixes the bug that Dick observed in Bugzilla #38530.
18899 2003-02-22 Miguel de Icaza <miguel@ximian.com>
18901 * expression.cs (ResolveMemberAccess): When resolving a constant,
18902 do not attempt to pull a constant if the value was not able to
18903 generate a valid constant.
18905 * const.cs (LookupConstantValue): Do not report more errors than required.
18907 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18909 * expression.cs: fixes bug #38328.
18911 2003-02-18 Miguel de Icaza <miguel@ximian.com>
18913 * class.cs: Changed all the various members that can be part of a
18914 class from being an ArrayList to be an Array of the right type.
18915 During the DefineType type_list, interface_list, delegate_list and
18916 enum_list are turned into types, interfaces, delegates and enums
18919 And during the member population, indexer_list, event_list,
18920 constant_list, field_list, instance_constructor_list, method_list,
18921 operator_list and property_list are turned into their real arrays.
18923 Although we could probably perform this operation earlier, for
18924 good error reporting we need to keep the lists and remove the
18925 lists for longer than required.
18927 This optimization was triggered by Paolo profiling the compiler
18928 speed on the output of `gen-sample-program.pl' perl script.
18930 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
18931 not crash in methods like MemberLookupFailed that use this field.
18933 This problem arises when the compiler fails to resolve a type
18934 during interface type definition for example.
18936 2003-02-18 Miguel de Icaza <miguel@ximian.com>
18938 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
18939 inherit from System.Object, so we have to stop at null, not only
18940 when reaching System.Object.
18942 2003-02-17 Miguel de Icaza <miguel@ximian.com>
18944 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
18945 DeclaredOnly because the parent indexer might have had a different
18946 name, but did not loop until the top of the hierarchy was reached.
18948 The problem this one fixes is 35492: when a class implemented an
18949 indexer from an interface, we were getting the interface method
18950 (which was abstract) and we were flagging an error (can not invoke
18953 This also keeps bug 33089 functioning, and test-148 functioning.
18955 * typemanager.cs (IsSpecialMethod): The correct way of figuring
18956 out if a method is special is to see if it is declared in a
18957 property or event, or whether it is one of the predefined operator
18958 names. This should fix correctly #36804.
18960 2003-02-15 Miguel de Icaza <miguel@ximian.com>
18962 The goal here is to remove the dependency on EmptyCast.Peel ().
18963 Killing it completely.
18965 The problem is that currently in a number of places where
18966 constants are expected, we have to "probe" for an EmptyCast, and
18967 Peel, which is not the correct thing to do, as this will be
18968 repetitive and will likely lead to errors.
18970 The idea is to remove any EmptyCasts that are used in casts that
18971 can be reduced to constants, so we only have to cope with
18974 This bug hunt was triggered by Bug 37363 and the desire to remove
18975 the duplicate pattern where we were "peeling" emptycasts to check
18976 whether they were constants. Now constants will always be
18979 * ecore.cs: Use an enumconstant here instead of wrapping with
18982 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
18983 throwing me off. By handling this we can get rid of a few hacks.
18985 * statement.cs (Switch): Removed Peel() code.
18987 2003-02-14 Miguel de Icaza <miguel@ximian.com>
18989 * class.cs: Location information for error 508
18991 * expression.cs (New.DoResolve): Add a guard against double
18992 resolution of an expression.
18994 The New DoResolve might be called twice when initializing field
18995 expressions (see EmitFieldInitializers, the call to
18996 GetInitializerExpression will perform a resolve on the expression,
18997 and later the assign will trigger another resolution
18999 This leads to bugs (#37014)
19001 * delegate.cs: The signature for EndInvoke should contain any ref
19002 or out parameters as well. We were not doing this in the past.
19004 * class.cs (Field.Define): Do not overwrite the type definition
19005 inside the `volatile' group. Turns out that volatile enumerations
19006 were changing the type here to perform a validity test, which
19009 2003-02-12 Miguel de Icaza <miguel@ximian.com>
19011 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
19012 and structs, we do not want to load the instance variable
19014 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
19015 enum_type has to be handled like an object reference (implicit
19016 conversions exists from this to object), but the regular IsClass
19017 and IsValueType tests will never return true for this one.
19019 Also we use TypeManager.IsValueType instead of type.IsValueType,
19020 just for consistency with the rest of the code (this is only
19021 needed if we ever use the construct exposed by test-180.cs inside
19022 corlib, which we dont today).
19024 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
19026 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
19029 2003-02-09 Martin Baulig <martin@ximian.com>
19031 * namespace.cs (Namespace..ctor): Added SourceFile argument.
19032 (Namespace.DefineNamespaces): New static public method; this is
19033 called when we're compiling with debugging to add all namespaces
19034 to the symbol file.
19036 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
19037 pass it to the Namespace's .ctor.
19039 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
19040 and MethodBase arguments; pass the namespace ID to the symwriter;
19041 pass the MethodBase instead of the token to the symwriter.
19042 (SymbolWriter.DefineNamespace): New method to add a namespace to
19045 2003-02-09 Martin Baulig <martin@ximian.com>
19047 * symbolwriter.cs: New file. This is a wrapper around
19048 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
19049 methods here in near future.
19051 2003-02-09 Martin Baulig <martin@ximian.com>
19053 * codegen.cs (EmitContext.Mark): Just pass the arguments to
19054 ILGenerator.MarkSequencePoint() which are actually used by the
19057 2003-02-09 Martin Baulig <martin@ximian.com>
19059 * location.cs (SourceFile): New public sealed class. This
19060 contains the name and an index which is used in the location's token.
19061 (Location): Reserve an appropriate number of bits in the token for
19062 the source file instead of walking over that list, this gives us a
19063 really huge performance improvement when compiling with debugging.
19065 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
19066 `SourceFile' argument instead of a string.
19067 (Driver.ProcessFile): Add all the files via Location.AddFile(),
19068 but don't parse/tokenize here, we need to generate the list of all
19069 source files before we do that.
19070 (Driver.ProcessFiles): New static function. Parses/tokenizes all
19073 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
19074 instead of a string.
19076 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
19079 2003-02-09 Martin Baulig <martin@ximian.com>
19081 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
19082 filename on `#line default'.
19084 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
19086 * statement.cs: don't clear the pinned var when the fixed statement
19087 returns from the method (fixes bug#37752).
19089 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
19091 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
19094 2003-02-07 Martin Baulig <martin@ximian.com>
19096 * driver.cs: Removed the `--debug-args' command line argument.
19098 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
19099 automatically by the AsssemblyBuilder.
19100 (CodeGen.InitializeSymbolWriter): We don't need to call any
19101 initialization function on the symbol writer anymore. This method
19102 doesn't take any arguments.
19104 2003-02-03 Miguel de Icaza <miguel@ximian.com>
19106 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
19107 from referenced assemblies as well.
19109 2003-02-02 Martin Baulig <martin@ximian.com>
19111 * class.cs (MethodData.Emit): Generate debugging info for external methods.
19113 2003-02-02 Martin Baulig <martin@ximian.com>
19115 * class.cs (Constructor.Emit): Open the symbol writer before
19116 emitting the constructor initializer.
19117 (ConstructorInitializer.Emit): Call ec.Mark() to allow
19118 single-stepping through constructor initializers.
19120 2003-01-30 Miguel de Icaza <miguel@ximian.com>
19122 * class.cs: Handle error 549: do not allow virtual methods in
19125 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
19127 * decl.cs: Check access levels when resolving types
19129 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
19131 * statement.cs: Add parameters and locals set in catch blocks that might
19132 return to set vector
19134 2003-01-29 Miguel de Icaza <miguel@ximian.com>
19136 * class.cs (Operator): Set the SpecialName flags for operators.
19138 * expression.cs (Invocation.DoResolve): Only block calls to
19139 accessors and operators on SpecialName methods.
19141 (Cast.TryReduce): Handle conversions from char constants.
19144 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
19146 * statement.cs: small memory and time optimization in FlowBranching.
19148 2003-01-28 Pedro Mart <yoros@wanadoo.es>
19150 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
19151 problem that the last fix but in the other sid (Set).
19153 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
19154 access when there is no indexer in the hierarchy.
19156 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
19158 * class.cs: Combine some if statements.
19160 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19162 * driver.cs: fixed bug #37187.
19164 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
19166 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
19167 any indexer, it's needed to build a list with all the indexers in the
19168 hierarchy (AllGetters), else we have problems. Fixes #35653.
19170 2003-01-23 Miguel de Icaza <miguel@ximian.com>
19172 * class.cs (MethodData.Define): It is wrong for an interface
19173 implementation to be static in both cases: explicit and implicit.
19174 We were only handling this in one case.
19176 Improve the if situation there to not have negations.
19178 * class.cs (Field.Define): Turns out that we do not need to check
19179 the unsafe bit on field definition, only on usage. Remove the test.
19181 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19183 * driver.cs: use assembly.Location instead of Codebase (the latest
19184 patch made mcs fail when using MS assemblies).
19186 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
19188 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
19189 get the path to *corlib.dll.
19191 2003-01-21 Nick Drochak <ndrochak@gol.com>
19195 * typemanager.cs: Remove compiler warnings
19197 2003-01-20 Duncan Mak <duncan@ximian.com>
19199 * AssemblyInfo.cs: Bump the version number to 0.19.
19201 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19203 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
19205 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
19207 * class.cs (Constructor::Emit): Emit debugging info for constructors.
19209 2003-01-17 Miguel de Icaza <miguel@ximian.com>
19211 * cs-parser.jay: Small fix: we were not comparing the constructor
19212 name correctly. Thanks to Zoltan for the initial pointer.
19214 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
19216 * cs-tokenizer.cs: Set file name when specified with #line
19218 2003-01-15 Miguel de Icaza <miguel@ximian.com>
19220 * cs-parser.jay: Only perform the constructor checks here if we
19221 are named like the class; This will help provider a better
19222 error. The constructor path is taken when a type definition is
19223 not found, but most likely the user forgot to add the type, so
19224 report that rather than the constructor error.
19226 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
19228 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
19231 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
19233 * cs-parser.jay: Add cleanup call.
19235 2003-01-13 Duncan Mak <duncan@ximian.com>
19237 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
19238 consistent with other methods.
19240 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
19242 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
19244 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
19246 * attribute.cs: only set GuidAttr to true when we have a
19249 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19253 * typemanager.cs: fixes to allow mcs compile corlib with the new
19254 Type.IsSubclassOf fix.
19256 2003-01-08 Miguel de Icaza <miguel@ximian.com>
19258 * expression.cs (LocalVariableReference.DoResolve): Classify a
19259 constant as a value, not as a variable. Also, set the type for
19262 * cs-parser.jay (fixed_statement): take a type instead of a
19263 pointer_type, so we can produce a better error message later.
19265 * statement.cs (Fixed.Resolve): Flag types that are not pointers
19268 (For.DoEmit): Make inifinite loops have a
19269 non-conditional branch back.
19271 (Fixed.DoEmit): First populate the pinned variables, then emit the
19272 statement, then clear the variables. Before I was emitting the
19273 code once for each fixed piece.
19276 2003-01-08 Martin Baulig <martin@ximian.com>
19278 * statement.cs (FlowBranching.MergeChild): A break in a
19279 SWITCH_SECTION does not leave a loop. Fixes #36155.
19281 2003-01-08 Martin Baulig <martin@ximian.com>
19283 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
19284 lives in the same number space than `param_map'. Fixes #36154.
19286 2003-01-07 Miguel de Icaza <miguel@ximian.com>
19288 * cs-parser.jay (constructor_declaration): Set the
19289 Constructor.ModFlags before probing for it. This makes the
19290 compiler report 514, 515 and 132 (the code was there, but got
19293 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
19294 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
19295 (GotoCase.Resolve): Set `Returns' to ALWAYS.
19297 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
19299 * enum.cs: create the enum static fields using the enum type.
19301 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
19303 * class.cs: don't try to create the ParamBuilder for the return
19304 type if it's not needed (and handle it breaking for the ms runtime
19307 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
19309 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
19311 2002-12-29 Miguel de Icaza <miguel@ximian.com>
19313 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
19314 the command. This showed up while compiling the JANET source
19315 code, which used \r as its only newline separator.
19317 2002-12-28 Miguel de Icaza <miguel@ximian.com>
19319 * class.cs (Method.Define): If we are an operator (because it
19320 reuses our code), then set the SpecialName and HideBySig. #36128
19322 2002-12-22 Miguel de Icaza <miguel@ximian.com>
19324 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
19325 exception, report error 120 `object reference required'.
19327 * driver.cs: Add --pause option, used during to measure the size
19328 of the process as it goes with --timestamp.
19330 * expression.cs (Invocation.DoResolve): Do not allow methods with
19331 SpecialName to be invoked.
19333 2002-12-21 Miguel de Icaza <miguel@ximian.com>
19335 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
19336 number before adding it.
19338 2002-12-21 Ravi Pratap <ravi@ximian.com>
19340 * ecore.cs (StandardImplicitConversion): When in an unsafe
19341 context, we allow conversion between void * to any other pointer
19342 type. This fixes bug #35973.
19344 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
19346 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
19347 is not thrown when extensionless outputs are used
19349 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19351 * rootcontext.cs: fixed compilation of corlib.
19353 2002-12-19 Miguel de Icaza <miguel@ximian.com>
19355 * attribute.cs (Attributes.Contains): Add new method.
19357 * class.cs (MethodCore.LabelParameters): if the parameter is an
19358 `out' parameter, check that no attribute `[In]' has been passed.
19360 * enum.cs: Handle the `value__' name in an enumeration.
19362 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
19364 * decl.cs: Added special case to allow overrides on "protected
19367 2002-12-18 Ravi Pratap <ravi@ximian.com>
19369 * attribute.cs (Attributes.AddAttributeSection): Rename to this
19370 since it makes much more sense.
19372 (Attributes.ctor): Don't require a Location parameter.
19374 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
19376 * attribute.cs (ApplyAttributes): Remove extra Location parameters
19377 since we already have that information per attribute.
19379 * everywhere : make appropriate changes.
19381 * class.cs (LabelParameters): Write the code which actually
19382 applies attributes to the return type. We can't do this on the MS
19383 .NET runtime so we flag a warning in the case an exception is
19386 2002-12-18 Miguel de Icaza <miguel@ximian.com>
19388 * const.cs: Handle implicit null conversions here too.
19390 2002-12-17 Ravi Pratap <ravi@ximian.com>
19392 * class.cs (MethodCore.LabelParameters): Remove the extra
19393 Type [] parameter since it is completely unnecessary. Instead
19394 pass in the method's attributes so that we can extract
19395 the "return" attribute.
19397 2002-12-17 Miguel de Icaza <miguel@ximian.com>
19399 * cs-parser.jay (parse): Use Report.Error to flag errors instead
19400 of ignoring it and letting the compile continue.
19402 * typemanager.cs (ChangeType): use an extra argument to return an
19403 error condition instead of throwing an exception.
19405 2002-12-15 Miguel de Icaza <miguel@ximian.com>
19407 * expression.cs (Unary.TryReduce): mimic the code for the regular
19408 code path. Perform an implicit cast in the cases where we can
19409 implicitly convert to one of the integral types, and then reduce
19410 based on that constant. This fixes bug #35483.
19412 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19414 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
19416 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19418 * namespace.cs: fixed bug #35489.
19420 2002-12-12 Miguel de Icaza <miguel@ximian.com>
19422 * class.cs: Remove some dead code.
19424 * cs-parser.jay: Estimate the number of methods needed
19425 (RootContext.MethodCount);
19427 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
19428 numbers instead of StringBuilders.
19430 * support.cs (PtrHashtable): Add constructor with initial size;
19431 We can now reduce reallocations of the method table.
19433 2002-12-10 Ravi Pratap <ravi@ximian.com>
19435 * attribute.cs (ApplyAttributes): Keep track of the emitted
19436 attributes on a per-target basis. This fixes bug #35413.
19438 2002-12-10 Miguel de Icaza <miguel@ximian.com>
19440 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
19441 default to the Windows 1252 encoding.
19443 (UnixParseOption): Support version, thanks to Alp for the missing
19446 * AssemblyInfo.cs: Add nice assembly information.
19448 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
19451 * cs-parser.jay: Allow a trailing comma before the close bracked
19452 in the attribute_section production.
19454 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
19455 address of the instance was being taken, I will take this out,
19456 because we take the address of the object immediately here.
19458 2002-12-09 Ravi Pratap <ravi@ximian.com>
19460 * typemanager.cs (AreMultipleAllowed): Take care of the most
19461 obvious case where attribute type is not in the current assembly -
19464 2002-12-08 Miguel de Icaza <miguel@ximian.com>
19466 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
19467 definitions, instead of doing that afterwards.
19469 Also we use a nice little hack, depending on the constructor, we
19470 know if we are a "composed" name or a simple name. Hence, we
19471 avoid the IndexOf test, and we avoid
19473 * codegen.cs: Add code to assist in a bug reporter to track down
19474 the source of a compiler crash.
19476 2002-12-07 Ravi Pratap <ravi@ximian.com>
19478 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
19479 types have been emitted for a given element and flag an error
19480 if something which does not have AllowMultiple set is used more
19483 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
19484 attribute types and their corresponding AllowMultiple properties
19486 (AreMultipleAllowed): Check the property for a given type.
19488 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
19489 property in the case we have a TypeContainer.
19491 (Attributes.AddAttribute): Detect duplicates and just skip on
19492 adding them. This trivial fix catches a pretty gross error in our
19493 attribute emission - global attributes were being emitted twice!
19495 Bugzilla bug #33187 is now fixed.
19497 2002-12-06 Miguel de Icaza <miguel@ximian.com>
19499 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
19500 instead of pp_and).
19502 * expression.cs (Binary.ResolveOperator): I can only use the
19503 Concat (string, string, string) and Concat (string, string,
19504 string, string) if the child is actually a concatenation of
19507 2002-12-04 Miguel de Icaza <miguel@ximian.com>
19509 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
19510 context where we need a 2-character lookahead.
19512 * pending.cs (PendingImplementation): Rework so we can keep track
19513 of interface types all the time, and flag those which were
19514 implemented by parents as optional.
19516 2002-12-03 Miguel de Icaza <miguel@ximian.com>
19518 * expression.cs (Binary.ResolveOperator): Use
19519 String.Concat(string,string,string) or
19520 String.Concat(string,string,string,string) when possible.
19522 * typemanager: More helper methods.
19525 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
19527 * pending.cs: remove the bogus return from GetMissingInterfaces()
19528 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
19530 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19532 * namespace.cs: avoid duplicated 'using xxx' being added to
19533 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
19534 when we get more than one 'using' statement for the same namespace.
19535 Report a CS0105 warning for it.
19537 2002-11-30 Miguel de Icaza <miguel@ximian.com>
19539 * cs-tokenizer.cs (consume_identifier): use read directly, instead
19540 of calling getChar/putback, uses internal knowledge of it.
19542 (xtoken): Reorder tokenizer so most common patterns are checked
19543 first. This reduces the compilation time in another 5% (from 8.11s
19544 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
19546 The parsing time is 22% of the compilation in mcs, and from that
19547 64% is spent on the tokenization process.
19549 I tried using a binary search for keywords, but this is slower
19550 than the hashtable. Another option would be to do a couple of
19553 * Not use a StringBuilder, instead use an array of chars,
19554 with a set value. Notice that this way we could catch
19555 the 645 error without having to do it *afterwards*.
19557 * We could write a hand-parser to avoid the hashtable
19558 compares altogether.
19560 The identifier consumption process takes 37% of the tokenization
19561 time. Another 15% is spent on is_number. 56% of the time spent
19562 on is_number is spent on Int64.Parse:
19564 * We could probably choose based on the string length to
19565 use Int32.Parse or Int64.Parse and avoid all the 64-bit
19568 Another 3% is spend on wrapping `xtoken' in the `token' function.
19570 Handle 0xa0 as whitespace (#34752)
19572 2002-11-26 Miguel de Icaza <miguel@ximian.com>
19574 * typemanager.cs (IsCLRType): New routine to tell whether a type
19575 is one of the builtin types.
19577 Maybe it needs to use TypeCodes to be faster. Maybe we could use
19578 typecode in more places instead of doing pointer comparissions.
19579 We could leverage some knowledge about the way the typecodes are
19582 New code to cache namespaces in assemblies, it is currently not
19583 invoked, to be used soon.
19585 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
19587 * expression.cs (Binary.ResolveOperator): specially handle
19588 strings, and do not perform user-defined operator overloading for
19591 2002-11-24 Miguel de Icaza <miguel@ximian.com>
19593 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
19594 internalcall as it is a pretty simple operation; Avoid whenever
19595 possible to call Char.IsLetter.
19597 (consume_identifier): Cut by half the number of
19598 hashtable calls by merging the is_keyword and GetKeyword behavior.
19600 Do not short-circuit, because if we do, we
19601 report errors (ie, #if false && true would produce an invalid
19605 2002-11-24 Martin Baulig <martin@ximian.com>
19607 * expression.cs (Cast.TryReduce): If we're in checked syntax,
19608 check constant ranges and report a CS0221. Fixes #33186.
19610 2002-11-24 Martin Baulig <martin@ximian.com>
19612 * cs-parser.jay: Make this work for uninitialized variable
19613 declarations in the `for' initializer. Fixes #32416.
19615 2002-11-24 Martin Baulig <martin@ximian.com>
19617 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
19618 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
19620 2002-11-24 Martin Baulig <martin@ximian.com>
19622 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
19623 argument; if true, we also check for user-defined conversions.
19624 This is only needed if both arguments are of a user-defined type.
19625 Fixes #30443, added test-175.cs.
19626 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
19628 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
19630 2002-11-24 Martin Baulig <martin@ximian.com>
19632 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
19633 function to get the store opcode.
19634 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
19635 only emit the Ldelema if the store opcode is Stobj. You must run
19636 both test-34 and test-167 to test this. Fixes #34529.
19638 2002-11-23 Martin Baulig <martin@ximian.com>
19640 * ecore.cs (Expression.MemberLookup): Added additional
19641 `qualifier_type' argument which is used when we're being called
19642 from MemberAccess.DoResolve() and null if we're called from a
19644 (Expression.MemberLookupFailed): New method to report errors; this
19645 does the CS1540 check and reports the correct error message.
19647 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
19648 argument for the CS1540 check and redone the way how we're dealing
19649 with private members. See the comment in the source code for details.
19650 (FilterWithClosure): Reverted this back to revision 1.197; renamed
19651 `closure_start_type' to `closure_qualifier_type' and check whether
19652 it's not null. It was not this filter being broken, it was just
19653 being called with the wrong arguments.
19655 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
19656 and pass it the correct `qualifier_type'; this also does the error
19659 2002-11-22 Miguel de Icaza <miguel@ximian.com>
19661 * expression.cs (Invocation.EmitParams): If the we are dealing
19662 with a non-built-in value type, load its address as well.
19664 (ArrayCreation): Use a a pretty constant instead
19665 of the hardcoded value 2. Use 6 instead of 2 for the number of
19666 static initializers.
19668 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
19669 because they are not really value types, just glorified integers.
19671 * driver.cs: Do not append .exe, the CSC compiler does not do it.
19673 * ecore.cs: Remove redundant code for enumerations, make them use
19674 the same code path as everything else, fixes the casting issue
19675 with enumerations in Windows.Forms.
19677 * attribute.cs: Do only cast to string if it is a string, the
19678 validation happens later.
19680 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
19681 people upgrade their corlibs.
19683 * ecore.cs: Oops, enumerations were not following the entire code path
19685 2002-11-21 Miguel de Icaza <miguel@ximian.com>
19687 * typemanager.cs (FilterWithClosure): Commented out the test for
19688 1540 in typemanager.cs, as it has problems when accessing
19689 protected methods from a parent class (see test-174.cs).
19691 * attribute.cs (Attribute.ValidateGuid): new method.
19692 (Attribute.Resolve): Use above.
19694 2002-11-19 Miguel de Icaza <miguel@ximian.com>
19696 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
19698 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
19699 handling for enumerations, as we only needed the TypeContainer
19700 functionality to begin with (this is required for the fix below to
19701 work for enums that reference constants in a container class for
19704 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
19706 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
19707 a valid TypeBuilder to perform lookups on.o
19709 * class.cs (InheritableMemberSignatureCompare): Use true in the
19710 call to GetGetMethod and GetSetMethod, because we are comparing
19711 the signature, and we need to get the methods *even* if they are
19714 (PropertyBase.CheckBase): ditto.
19716 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
19717 GotoCase.Resolve): Use Peel on EmpytCasts.
19719 * ecore.cs (EmptyCast): drop child, add Peel method.
19721 2002-11-17 Martin Baulig <martin@ximian.com>
19723 * ecore.cs (EmptyCast.Child): New public property.
19725 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
19726 label resolved to an EmptyCast. Fixes #34162.
19727 (GotoCase.Resolve): Likewise.
19728 (Block.EmitMeta): Likewise.
19730 2002-11-17 Martin Baulig <martin@ximian.com>
19732 * expression.cs (Invocation.BetterConversion): Prefer int over
19733 uint; short over ushort; long over ulong for integer literals.
19734 Use ImplicitConversionExists instead of StandardConversionExists
19735 since we also need to check for user-defined implicit conversions.
19736 Fixes #34165. Added test-173.cs.
19738 2002-11-16 Martin Baulig <martin@ximian.com>
19740 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
19741 with the `true' and `false' literals. Fixes #33151.
19743 2002-11-16 Martin Baulig <martin@ximian.com>
19745 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
19746 October 22nd; don't do the cs1540 check for static members.
19748 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
19749 now using our own filter here and doing the cs1540 check again.
19751 2002-11-16 Martin Baulig <martin@ximian.com>
19753 * support.cs (InternalParameters): Don't crash if we don't have
19754 any fixed parameters. Fixes #33532.
19756 2002-11-16 Martin Baulig <martin@ximian.com>
19758 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
19759 when looking up static methods to make this work on Windows.
19762 2002-11-16 Martin Baulig <martin@ximian.com>
19764 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
19765 a setter rather than using PropertyInfo.CanWrite.
19767 2002-11-15 Nick Drochak <ndrochak@gol.com>
19769 * class.cs: Allow acces to block member by subclasses. Fixes build
19772 2002-11-14 Martin Baulig <martin@ximian.com>
19774 * class.cs (Constructor.Emit): Added the extern/block check.
19777 2002-11-14 Martin Baulig <martin@ximian.com>
19779 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
19780 iteration while looking for indexers, this is needed because the
19781 indexer may have a different name in our base classes. Fixed the
19782 error reporting (no indexers at all, not get accessor, no
19783 overloaded match). Fixes bug #33089.
19784 (IndexerAccess.DoResolveLValue): Likewise.
19786 2002-11-14 Martin Baulig <martin@ximian.com>
19788 * class.cs (PropertyBase.CheckBase): Make this work for multiple
19789 indexers. Fixes the first part of bug #33089.
19790 (MethodSignature.InheritableMemberSignatureCompare): Added support
19793 2002-11-13 Ravi Pratap <ravi@ximian.com>
19795 * attribute.cs (Attribute.Resolve): Catch the
19796 NullReferenceException and report it since it isn't supposed to
19799 2002-11-12 Miguel de Icaza <miguel@ximian.com>
19801 * expression.cs (Binary.EmitBranchable): Also handle the cases for
19802 LogicalOr and LogicalAnd that can benefit from recursively
19803 handling EmitBranchable. The code now should be nice for Paolo.
19805 2002-11-08 Miguel de Icaza <miguel@ximian.com>
19807 * typemanager.cs (LookupType): Added a negative-hit hashtable for
19808 the Type lookups, as we perform quite a number of lookups on
19809 non-Types. This can be removed once we can deterministically tell
19810 whether we have a type or a namespace in advance.
19812 But this might require special hacks from our corlib.
19816 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
19817 and double which avoids a conversion from an integer to a double.
19819 * expression.cs: tiny optimization, avoid calling IsConstant,
19820 because it effectively performs the lookup twice.
19822 2002-11-06 Miguel de Icaza <miguel@ximian.com>
19824 But a bogus return here to keep the semantics of the old code
19825 until the Mono runtime is fixed.
19827 * pending.cs (GetMissingInterfaces): New method used to remove all
19828 the interfaces that are already implemented by our parent
19829 classes from the list of pending methods.
19831 * interface.cs: Add checks for calls after ResolveTypeExpr.
19833 2002-11-05 Miguel de Icaza <miguel@ximian.com>
19835 * class.cs (Class.Emit): Report warning 67: event not used if the
19836 warning level is beyond 3.
19838 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
19839 being a NullLiteral.
19841 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
19844 * class.cs (TypeContainer.GetClassBases): Cover a missing code
19845 path that might fail if a type can not be resolved.
19847 * expression.cs (Binary.Emit): Emit unsigned versions of the
19850 * driver.cs: use error 5.
19852 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
19854 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
19856 2002-11-01 Miguel de Icaza <miguel@ximian.com>
19858 * cs-parser.jay (switch_section): A beautiful patch from Martin
19859 Baulig that fixed 33094.
19861 2002-10-31 Miguel de Icaza <miguel@ximian.com>
19863 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
19864 Check whether the base is abstract and report an error if so.
19866 * expression.cs (IndexerAccess.DoResolveLValue,
19867 IndexerAccess.DoResolve): ditto.
19869 (Invocation.DoResolve): ditto.
19871 (Invocation.FullMethodDesc): Improve the report string.
19873 * statement.cs (Block): Eliminate IsVariableDefined as it is
19874 basically just a wrapper for GetVariableInfo.
19876 * ecore.cs (SimpleName): Use new
19878 * support.cs (ReflectionParamter.ParameterType): We unwrap the
19879 type, as we return the actual parameter ref/unref state on a
19882 2002-10-30 Miguel de Icaza <miguel@ximian.com>
19884 * support.cs: Return proper flags REF/OUT fixing the previous
19887 * expression.cs: Reverted last patch, that was wrong. Is_ref is
19888 not used to mean `ref' but `ref or out' in ParameterReference
19890 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
19891 full type signature instead of calling TypeManger.CSharpName
19894 * support.cs (InternalParameters.ParameterDesc): Do not compare
19895 directly to the modflags, because REF/OUT will actually be bitsets
19898 * delegate.cs (VerifyMethod): Check also the modifiers.
19900 * cs-tokenizer.cs: Fix bug where floating point values with an
19901 exponent where a sign was missing was ignored.
19903 * driver.cs: Allow multiple assemblies to be specified in a single
19906 2002-10-28 Miguel de Icaza <miguel@ximian.com>
19908 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
19909 because identifiers after a parenthesis would end up in this kind
19910 of production, and we needed to desamiguate it for having casts
19913 (UserDefinedType *) xxx
19915 2002-10-24 Miguel de Icaza <miguel@ximian.com>
19917 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
19918 we should set on the Bindingflags.NonPublic, but not turn on
19919 private_ok. private_ok controls whether a Private member is
19920 returned (this is chekced on the filter routine), while the
19921 BindingFlags.NonPublic just controls whether private/protected
19922 will be allowed. This fixes the problem part of the problem of
19923 private properties being allowed to be used in derived classes.
19925 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
19926 so we can call the children DoResolveLValue method (this will
19927 properly signal errors on lvalue assignments to base properties)
19929 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
19930 getter are null, and we have a property info, we know that this
19931 happened because the lookup failed, so we report an error 122 for
19932 protection level violation.
19934 We also silently return if setter and getter are null in the
19935 resolve functions, this condition only happens if we have flagged
19936 the error before. This is the other half of the problem.
19938 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
19939 not have accessibility information, that is why we were returning
19940 true in the filter function in typemanager.cs.
19942 To properly report 122 (property is inaccessible because of its
19943 protection level) correctly, we report this error in ResolveAccess
19944 by failing if both the setter and the getter are lacking (ie, the
19947 DoResolve and DoLResolve have been modified to check for both
19948 setter/getter being null and returning silently, the reason being
19949 that I did not want to put the knowledge about this error in upper
19952 int old = Report.Errors;
19953 x = new PropertyExpr (...);
19954 if (old != Report.Errors)
19959 So the property expr is returned, but it is invalid, so the error
19960 will be flagged during the resolve process.
19962 * class.cs: Remove InheritablePropertySignatureCompare from the
19963 class, as we no longer depend on the property signature to compute
19964 whether it is possible to implement a method or not.
19966 The reason is that calling PropertyInfo.GetGetMethod will return
19967 null (in .NET, in Mono it works, and we should change this), in
19968 cases where the Get Method does not exist in that particular
19973 class X { public virtual int A { get { return 1; } } }
19975 class Z : Y { public override int A { get { return 2; } } }
19977 Would fail in Z because the parent (Y) would not have the property
19978 defined. So we avoid this completely now (because the alternative
19979 fix was ugly and slow), and we now depend exclusively on the
19982 (PropertyBase.CheckBase): Use a method-base mechanism to find our
19983 reference method, instead of using the property.
19985 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
19986 routines are gone now.
19988 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
19989 names, they were incorrectly named.
19991 * cs-tokenizer.cs: Return are more gentle token on failure.
19993 * pending.cs (PendingImplementation.InterfaceMethod): This routine
19994 had an out-of-sync index variable, which caused it to remove from
19995 the list of pending methods the wrong method sometimes.
19997 2002-10-22 Miguel de Icaza <miguel@ximian.com>
19999 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
20000 CanWrite, because those refer to this particular instance of the
20001 property, and do not take into account the fact that we can
20002 override single members of a property.
20004 Constructor requires an EmitContext. The resolution process does
20005 not happen here, but we need to compute the accessors before,
20006 because the resolution does not always happen for properties.
20008 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
20009 subclass, before we did not update this flag, but we did update
20012 (GetAccessors): Drop this routine, as it did not work in the
20013 presence of partially overwritten set/get methods.
20015 Notice that this broke the cs1540 detection, but that will require
20018 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20022 * driver.cs: issue a warning instead of an error if we don't support
20023 debugging for the platform. Also ignore a couple of errors that may
20024 arise when trying to write the symbols. Undo my previous patch.
20026 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20028 * driver.cs: ignore /debug switch except for Unix platforms.
20030 2002-10-23 Nick Drochak <ndrochak@gol.com>
20032 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
20034 2002-10-21 Miguel de Icaza <miguel@ximian.com>
20036 * driver.cs: Do not make mcs-debug conditional, so we do not break
20037 builds that use it.
20039 * statement.cs (UsageVector.MergeChildren): I would like Martin to
20040 review this patch. But basically after all the children variables
20041 have been merged, the value of "Breaks" was not being set to
20042 new_breaks for Switch blocks. I think that it should be set after
20043 it has executed. Currently I set this to the value of new_breaks,
20044 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
20045 conservative, but I do not understand this code very well.
20047 I did not break anything in the build, so that is good ;-)
20049 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
20051 2002-10-20 Mark Crichton <crichton@gimp.org>
20053 * cfold.cs: Fixed compile blocker. Really fixed it this time.
20055 2002-10-20 Nick Drochak <ndrochak@gol.com>
20057 * cfold.cs: Fixed compile blocker.
20059 2002-10-20 Miguel de Icaza <miguel@ximian.com>
20061 * driver.cs: I was chekcing the key, not the file.
20063 2002-10-19 Ravi Pratap <ravi@ximian.com>
20065 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
20066 message that we were generating - we just need to silently return
20069 2002-10-19 Miguel de Icaza <miguel@ximian.com>
20071 * class.cs (Event.Define): Change my previous commit, as this
20072 breaks the debugger. This is a temporary hack, as it seems like
20073 the compiler is generating events incorrectly to begin with.
20075 * expression.cs (Binary.ResolveOperator): Added support for
20076 "U operator - (E x, E y)"
20078 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
20081 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
20082 init-only variables, but this path did not take into account that
20083 there might be also instance readonly variables. Correct this
20086 This fixes bug 32253
20088 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
20091 * driver.cs: Change the extension for modules to `netmodule'
20093 * cs-parser.jay: Improved slightly the location tracking for
20094 the debugger symbols.
20096 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
20097 modifiers that were specified instead of the hardcoded value
20098 (FamAndAssem). This was basically ignoring the static modifier,
20099 and others. Fixes 32429.
20101 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
20102 fixed a bug in the process (32476)
20104 * expression.cs (ArrayAccess.EmitAssign): Patch from
20105 hwang_rob@yahoo.ca that fixes bug 31834.3
20107 2002-10-18 Miguel de Icaza <miguel@ximian.com>
20109 * driver.cs: Make the module extension .netmodule.
20111 2002-10-16 Miguel de Icaza <miguel@ximian.com>
20113 * driver.cs: Report an error if the resource file is not found
20114 instead of crashing.
20116 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
20117 false, like Emit does.
20119 2002-10-16 Nick Drochak <ndrochak@gol.com>
20121 * typemanager.cs: Remove unused private member. Also reported mcs
20122 bug to report this as a warning like csc.
20124 2002-10-15 Martin Baulig <martin@gnome.org>
20126 * statement.cs (Statement.Emit): Made this a virtual method; emits
20127 the line number info and calls DoEmit().
20128 (Statement.DoEmit): New protected abstract method, formerly knows
20129 as Statement.Emit().
20131 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
20133 2002-10-11 Miguel de Icaza <miguel@ximian.com>
20135 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
20136 have fixed a remaining problem: not every AddXXXX was adding a
20137 fully qualified name.
20139 Now everyone registers a fully qualified name in the DeclSpace as
20140 being defined instead of the partial name.
20142 Downsides: we are slower than we need to be due to the excess
20143 copies and the names being registered this way.
20145 The reason for this is that we currently depend (on the corlib
20146 bootstrap for instance) that types are fully qualified, because
20147 we dump all the types in the namespace, and we should really have
20148 types inserted into the proper namespace, so we can only store the
20149 basenames in the defined_names array.
20151 2002-10-10 Martin Baulig <martin@gnome.org>
20153 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
20154 from bug #31834, see the bug report for a testcase which is
20157 2002-10-10 Martin Baulig <martin@gnome.org>
20159 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
20160 flow analysis code for this.
20162 * statement.cs (Do, While, For): Tell the flow analysis code about
20164 (FlowBranching.UsageVector): Added support for infinite loops.
20165 (Block.Resolve): Moved the dead code elimination here and use flow
20168 2002-10-09 Miguel de Icaza <miguel@ximian.com>
20170 * class.cs (Field.Define): Catch cycles on struct type
20173 * typemanager.cs (IsUnmanagedtype): Do not recursively check
20174 fields if the fields are static. We only need to check instance
20177 * expression.cs (As.DoResolve): Test for reference type.
20179 * statement.cs (Using.ResolveExpression): Use
20180 ConvertImplicitRequired, not ConvertImplicit which reports an
20182 (Using.ResolveLocalVariableDecls): ditto.
20184 * expression.cs (Binary.ResolveOperator): Report errors in a few
20185 places where we had to.
20187 * typemanager.cs (IsUnmanagedtype): Finish implementation.
20189 2002-10-08 Miguel de Icaza <miguel@ximian.com>
20191 * expression.cs: Use StoreFromPtr instead of extracting the type
20192 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
20194 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
20195 an enumeration value to a System.Enum, but System.Enum is not a
20196 value type, but an class type, so we need to box.
20198 (Expression.ConvertExplicit): One codepath could return
20199 errors but not flag them. Fix this. Fixes #31853
20201 * parameter.cs (Resolve): Do not allow void as a parameter type.
20203 2002-10-06 Martin Baulig <martin@gnome.org>
20205 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
20206 if it's a class type and not a struct. Fixes #31815.
20208 2002-10-06 Martin Baulig <martin@gnome.org>
20210 * statement.cs: Reworked the flow analysis code a bit to make it
20211 usable for dead code elimination.
20213 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20215 * cs-parser.jay: allow empty source files. Fixes bug #31781.
20217 2002-10-04 Miguel de Icaza <miguel@ximian.com>
20219 * expression.cs (ComposedCast.DoResolveType): A quick workaround
20220 to fix the test 165, will investigate deeper.
20222 2002-10-04 Martin Baulig <martin@gnome.org>
20224 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
20225 finally blocks actually work.
20226 (Try.Resolve): We don't need to create a sibling for `finally' if
20227 there is no finally block.
20229 2002-10-04 Martin Baulig <martin@gnome.org>
20231 * class.cs (Constructor.Define): The default accessibility for a
20232 non-default constructor is private, not public.
20234 2002-10-04 Miguel de Icaza <miguel@ximian.com>
20236 * class.cs (Constructor): Make AllowedModifiers public, add
20239 * cs-parser.jay: Perform the modifiers test here, as the
20240 constructor for the Constructor class usually receives a zero
20241 because of the way we create it (first we create, later we
20242 customize, and we were never checking the modifiers).
20244 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
20245 is a version of LookupTypeReflection that includes the type-name
20246 cache. This can be used as a fast path for functions that know
20247 the fully qualified name and are only calling into *.GetType() to
20248 obtain a composed type.
20250 This is also used by TypeManager.LookupType during its type
20253 (LookupType): We now also track the real type name, as sometimes
20254 we can get a quey for the real type name from things like
20255 ComposedCast. This fixes bug 31422.
20257 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
20258 complete type fullname, it does not have to go through the type
20259 resolution system to obtain the composed version of the type (for
20260 obtaining arrays or pointers).
20262 (Conditional.Emit): Use the EmitBoolExpression to
20263 generate nicer code, as requested by Paolo.
20265 (ArrayCreation.CheckIndices): Use the patch from
20266 hwang_rob@yahoo.ca to validate the array initializers.
20268 2002-10-03 Miguel de Icaza <miguel@ximian.com>
20270 * class.cs (ConstructorInitializer.Emit): simplify code by using
20271 Invocation.EmitCall, and at the same time, fix the bugs in calling
20272 parent constructors that took variable arguments.
20274 * ecore.cs (Expression.ConvertNumericExplicit,
20275 Expression.ImplicitNumericConversion): Remove the code that
20276 manually wrapped decimal (InternalTypeConstructor call is now gone
20279 * expression.cs (Cast.TryReduce): Also handle decimal types when
20280 trying to perform a constant fold on the type.
20282 * typemanager.cs (IsUnmanagedtype): Partially implemented.
20284 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
20285 that only turned off an error report, and did nothing else.
20287 2002-10-02 Miguel de Icaza <miguel@ximian.com>
20289 * driver.cs: Handle and ignore /fullpaths
20291 2002-10-01 Miguel de Icaza <miguel@ximian.com>
20293 * expression.cs (Binary.ResolveOperator): Catch the case where
20294 DoNumericPromotions returns true,
20296 (Binary.DoNumericPromotions): Simplify the code, and the tests.
20298 2002-09-27 Miguel de Icaza <miguel@ximian.com>
20300 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
20303 2002-09-26 Miguel de Icaza <miguel@ximian.com>
20305 * ecore.cs (ConvertNumericExplicit): It is not enough that the
20306 conversion exists, but it is also required that the conversion be
20307 performed. This manifested in "(Type64Enum) 2".
20309 * class.cs (TypeManager.AddMethod): The fix is not to change
20310 AddEnum, because that one was using a fully qualified name (every
20311 DeclSpace derivative does), but to change the AddMethod routine
20312 that was using an un-namespaced name. This now correctly reports
20313 the duplicated name.
20315 Revert patch until I can properly fix it. The issue
20316 is that we have a shared Type space across all namespaces
20317 currently, which is wrong.
20319 Options include making the Namespace a DeclSpace, and merge
20320 current_namespace/current_container in the parser.
20322 2002-09-25 Miguel de Icaza <miguel@ximian.com>
20324 * cs-parser.jay: Improve error reporting when we get a different
20325 kind of expression in local_variable_type and
20326 local_variable_pointer_type.
20328 Propagate this to avoid missleading errors being reported.
20330 * ecore.cs (ImplicitReferenceConversion): treat
20331 TypeManager.value_type as a target just like object_type. As
20336 Is valid, and needs to result in the int 1 being boxed before it
20337 is assigned to the value type v.
20339 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
20340 to validate the enumeration name.
20342 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
20343 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
20344 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
20346 * ecore.cs (TryImplicitIntConversion): When doing an
20347 implicit-enumeration-conversion, check if the type is 64-bits and
20348 perform a conversion before passing to EnumConstant.
20350 2002-09-23 Miguel de Icaza <miguel@ximian.com>
20352 * decl.cs (Error_AmbiguousTypeReference); New routine used to
20353 report ambiguous type references. Unlike the MS version, we
20354 report what the ambiguity is. Innovation at work ;-)
20356 (DeclSpace.FindType): Require a location argument to
20357 display when we display an ambiguous error.
20359 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
20361 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
20363 * expression.cs (EmitDynamicInitializers): Apply patch from
20364 hwang_rob@yahoo.ca that fixes the order in which we emit our
20367 2002-09-21 Martin Baulig <martin@gnome.org>
20369 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
20370 delegate takes no arguments.
20372 2002-09-20 Miguel de Icaza <miguel@ximian.com>
20374 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
20377 * expression.cs: Extract the underlying type.
20379 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
20381 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
20383 2002-09-19 Miguel de Icaza <miguel@ximian.com>
20385 * class.cs (TypeContainer.DefineType): We can not use the nice
20386 PackingSize with the size set to 1 DefineType method, because it
20387 will not allow us to define the interfaces that the struct
20390 This completes the fixing of bug 27287
20392 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
20393 means also structs. This fixes part of the problem.
20394 (Expresion.ImplicitReferenceConversionExists): ditto.
20396 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
20397 error if there were no errors reported during the type lookup
20398 process, to avoid duplicates or redundant errors. Without this
20399 you would get an ambiguous errors plus a type not found. We have
20400 beaten the user enough with the first error.
20402 (DeclSparce.FindType): Emit a warning if we have an ambiguous
20405 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
20406 during the resolution process, stop the lookup, this avoids
20407 repeated error reports (same error twice).
20409 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
20411 * typemanager.cs (LookupType): Redo the type lookup code to match
20412 the needs of System.Reflection.
20414 The issue is that System.Reflection requires references to nested
20415 types to begin with a "+" sign instead of a dot. So toplevel
20416 types look like: "NameSpace.TopLevelClass", and nested ones look
20417 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
20420 2002-09-19 Martin Baulig <martin@gnome.org>
20422 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
20423 says that a method always returns or always throws an exception,
20424 don't report the CS0161.
20426 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
20427 set `Returns = new_returns'.
20429 2002-09-19 Martin Baulig <martin@gnome.org>
20431 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
20432 to an enum constant, check for a CS0176.
20434 2002-09-18 Miguel de Icaza <miguel@ximian.com>
20436 * class.cs (TypeContainer.CheckPairedOperators): Now we check
20437 for operators that must be in pairs and report errors.
20439 * ecore.cs (SimpleName.DoResolveType): During the initial type
20440 resolution process, when we define types recursively, we must
20441 check first for types in our current scope before we perform
20442 lookups in the enclosing scopes.
20444 * expression.cs (MakeByteBlob): Handle Decimal blobs.
20446 (Invocation.VerifyArgumentsCompat): Call
20447 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
20448 I thought we were supposed to always call this, but there are a
20449 few places in the code where we dont do it.
20451 2002-09-17 Miguel de Icaza <miguel@ximian.com>
20453 * driver.cs: Add support in -linkres and -resource to specify the
20454 name of the identifier.
20456 2002-09-16 Miguel de Icaza <miguel@ximian.com>
20458 * ecore.cs (StandardConversionExists): Sync with the conversion
20459 code: allow anything-* to void* conversions.
20461 (FindMostSpecificSource): Use an Expression argument
20462 instead of a Type, because we might be handed over a Literal which
20463 gets a few more implicit conversions that plain types do not. So
20464 this information was being lost.
20466 Also, we drop the temporary type-holder expression when not
20469 2002-09-17 Martin Baulig <martin@gnome.org>
20471 * class.cs (PropertyBase.CheckBase): Don't check the base class if
20472 this is an explicit interface implementation.
20474 2002-09-17 Martin Baulig <martin@gnome.org>
20476 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
20477 different `IndexerName' attributes.
20479 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
20480 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
20481 virtual CommonResolve().
20483 2002-09-16 Miguel de Icaza <miguel@ximian.com>
20485 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
20486 and convert that to the UnderlyingType.
20488 * statement.cs (Foreach.Resolve): Indexers are just like variables
20489 or PropertyAccesses.
20491 * cs-tokenizer.cs (consume_string): Track line numbers and columns
20492 inside quoted strings, we were not doing this before.
20494 2002-09-16 Martin Baulig <martin@gnome.org>
20496 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
20497 resolve it. This is needed for the definite assignment check of the
20498 instance expression, fixes bug #29846.
20499 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
20501 2002-09-16 Nick Drochak <ndrochak@gol.com>
20503 * parameter.cs: Fix compile error. Cannot reference static member
20504 from an instance object. Is this an mcs bug?
20506 2002-09-14 Martin Baulig <martin@gnome.org>
20508 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
20509 multiple times. Fixes bug #30295, added test-166.cs.
20511 2002-09-14 Martin Baulig <martin@gnome.org>
20513 * statement.cs (Block.Emit): Don't emit unreachable code.
20514 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
20515 `break' statements.
20516 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
20518 2002-09-14 Martin Baulig <martin@gnome.org>
20520 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
20523 2002-09-14 Martin Baulig <martin@gnome.org>
20525 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
20526 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
20527 be false on the ms runtime.
20529 2002-09-13 Martin Baulig <martin@gnome.org>
20531 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
20532 the CS0038 error message.
20534 2002-09-12 Miguel de Icaza <miguel@ximian.com>
20536 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
20537 constant inside, return it.
20539 2002-09-12 Martin Baulig <martin@gnome.org>
20541 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
20542 implicit conversion can be done between enum types.
20544 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
20545 check whether an implicit conversion to the current enum's UnderlyingType
20546 exists and report an error if not.
20548 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
20549 without debugging support.
20551 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
20552 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
20554 2002-09-12 Martin Baulig <martin@gnome.org>
20556 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
20558 * ecore.cs (IMemberExpr.DeclaringType): New property.
20559 (SimpleName.SimpleNameResolve): Check whether we're accessing a
20560 nonstatic member of an outer type (CS0038).
20562 2002-09-11 Miguel de Icaza <miguel@ximian.com>
20564 * driver.cs: Activate the using-error detector at warning level
20565 4 (at least for MS-compatible APIs).
20567 * namespace.cs (VerifyUsing): Small buglett fix.
20569 * pending.cs (PendingImplementation): pass the container pointer.
20571 * interface.cs (GetMethods): Allow for recursive definition. Long
20572 term, I would like to move every type to support recursive
20573 definitions, not the current ordering mechanism that we have right
20576 The situation is this: Attributes are handled before interfaces,
20577 so we can apply attributes to interfaces. But some attributes
20578 implement interfaces, we will now handle the simple cases
20579 (recursive definitions will just get an error).
20581 * parameter.cs: Only invalidate types at the end if we fail to
20584 2002-09-09 Martin Baulig <martin@gnome.org>
20586 * ecore.cs (PropertyExpr.Emit): Also check for
20587 TypeManager.system_int_array_get_length so this'll also work when
20588 compiling corlib. Fixes #30003.
20590 2002-09-09 Martin Baulig <martin@gnome.org>
20592 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
20593 and throw an exception if we can't get the type's size. Fixed #30040,
20596 2002-09-09 Martin Baulig <martin@gnome.org>
20598 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
20600 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
20601 context. Fixes bug #30027.
20603 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
20604 virtual functions. Fixes bug #30043, added test-164.cs.
20606 2002-09-08 Ravi Pratap <ravi@ximian.com>
20608 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
20610 2002-09-08 Nick Drochak <ndrochak@gol.com>
20612 * driver.cs: Use an object to get the windows codepage since it's not a
20615 2002-09-08 Miguel de Icaza <miguel@ximian.com>
20617 * statement.cs (For.Emit): for infinite loops (test == null)
20618 return whether there is a break inside, not always "true".
20620 * namespace.cs (UsingEntry): New struct to hold the name of the
20621 using definition, the location where it is defined, and whether it
20622 has been used in a successful type lookup.
20624 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
20629 2002-09-06 Ravi Pratap <ravi@ximian.com>
20631 * attribute.cs : Fix incorrect code which relied on catching
20632 a NullReferenceException to detect a null being passed in
20633 where an object was expected.
20635 2002-09-06 Miguel de Icaza <miguel@ximian.com>
20637 * statement.cs (Try): flag the catch variable as assigned
20639 * expression.cs (Cast): Simplified by using ResolveType instead of
20640 manually resolving.
20642 * statement.cs (Catch): Fix bug by using ResolveType.
20644 2002-09-06 Ravi Pratap <ravi@ximian.com>
20646 * expression.cs (BetterConversion): Special case for when we have
20647 a NullLiteral as the argument and we have to choose between string
20648 and object types - we choose string the way csc does.
20650 * attribute.cs (Attribute.Resolve): Catch the
20651 NullReferenceException and report error #182 since the Mono
20652 runtime no more has the bug and having this exception raised means
20653 we tried to select a constructor which takes an object and is
20656 2002-09-05 Ravi Pratap <ravi@ximian.com>
20658 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
20659 message (1502, 1503) when we can't locate a method after overload
20660 resolution. This is much more informative and closes the bug
20663 * interface.cs (PopulateMethod): Return if there are no argument
20664 types. Fixes a NullReferenceException bug.
20666 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
20667 expressions too. Previously we were checking only in one place for
20668 positional arguments leaving out named arguments.
20670 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
20671 type to the enum type is not allowed. Remove code corresponding to
20674 (ConvertNumericExplicit): Allow explicit conversions from
20675 the underlying type to enum type. This precisely follows the spec
20676 and closes a bug filed by Gonzalo.
20678 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20681 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
20683 2002-09-03 Miguel de Icaza <miguel@ximian.com>
20685 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
20686 it was important that we stored the right value after the
20687 reduction in `converted'.
20689 2002-09-04 Martin Baulig <martin@gnome.org>
20691 * location.cs (Location.SymbolDocument): Use full pathnames for the
20694 2002-08-30 Miguel de Icaza <miguel@ximian.com>
20696 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
20697 of the expression resolve mechanism, because that will catch the
20698 SimpleName error failures.
20700 (Conditional): If we can not resolve the
20701 expression, return, do not crash.
20703 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20706 (location): display token name instead of its number.
20708 2002-08-28 Martin Baulig <martin@gnome.org>
20710 * expression.cs (Binary.ResolveOperator): Don't silently return
20711 but return an error if an operator cannot be applied between two
20714 2002-08-28 Martin Baulig <martin@gnome.org>
20716 * class.cs (Constructor.Define): Set the permission attributes
20717 correctly instead of making all constructors public.
20719 2002-08-28 Martin Baulig <martin@gnome.org>
20721 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
20722 for private members before reporting a CS0103; if we find anything,
20725 2002-08-28 Martin Baulig <martin@gnome.org>
20727 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
20728 to check whether `closure_start_type == closure_invocation_type',
20729 we also need to check whether `m.DeclaringType == closure_invocation_type'
20730 before bypassing the permission checks. We might be accessing
20731 protected/private members from the base class.
20732 (TypeManager.RealMemberLookup): Only set private_ok if private
20733 members were requested via BindingFlags.NonPublic.
20735 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
20737 * expression.cs (MemberAccess.ResolveMemberAccess): Set
20738 MethodGroupExpr.IsExplicitImpl if appropriate.
20739 (Invocation.DoResolve): Don't report the CS0120 for explicit
20740 interface implementations.
20742 2002-08-27 Martin Baulig <martin@gnome.org>
20744 * expression.cs (Invocation.DoResolve): If this is a static
20745 method and we don't have an InstanceExpression, we must report
20748 2002-08-25 Martin Baulig <martin@gnome.org>
20750 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
20751 `==' between a valuetype and an object.
20753 2002-08-25 Miguel de Icaza <miguel@ximian.com>
20755 * ecore.cs (TypeExpr): Provide a ToString method.
20757 2002-08-24 Martin Baulig <martin@gnome.org>
20759 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
20760 now called proggie.dbg and it's a binary file.
20762 2002-08-23 Martin Baulig <martin@gnome.org>
20764 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
20766 2002-08-23 Martin Baulig <martin@gnome.org>
20768 * struct.cs (MyStructInfo.ctor): Make this work with empty
20769 structs; it's not allowed to use foreach() on null.
20771 2002-08-23 Martin Baulig <martin@gnome.org>
20773 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
20774 writer the full pathname of the generated assembly.
20776 2002-08-23 Martin Baulig <martin@gnome.org>
20778 * statements.cs (FlowBranching.UsageVector.MergeChildren):
20779 A `finally' block never returns or breaks; improved handling of
20782 2002-08-23 Martin Baulig <martin@gnome.org>
20784 * statement.cs (Throw.Resolve): Allow `throw null'.
20786 2002-08-23 Martin Baulig <martin@gnome.org>
20788 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
20789 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
20790 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
20791 MemberLookup would return a wrong event if this is an explicit
20792 interface implementation and the class has an event with the same
20795 2002-08-23 Martin Baulig <martin@gnome.org>
20797 * statement.cs (Block.AddChildVariableNames): New public method.
20798 (Block.AddChildVariableName): Likewise.
20799 (Block.IsVariableNameUsedInChildBlock): Likewise.
20800 (Block.AddVariable): Check whether a variable name has already
20801 been used in a child block.
20803 * cs-parser.jay (declare_local_variables): Mark all variable names
20804 from the current block as being used in a child block in the
20807 2002-08-23 Martin Baulig <martin@gnome.org>
20809 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
20810 find the symbol writer.
20812 * driver.cs: csc also allows the arguments to /define being
20813 separated by commas, not only by semicolons.
20815 2002-08-23 Martin Baulig <martin@gnome.org>
20817 * interface.cs (Interface.GetMembers): Added static check for events.
20819 2002-08-15 Martin Baulig <martin@gnome.org>
20821 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
20822 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
20824 * ecore.cs (Expression.MemberLookup): Added documentation and explained
20825 why the MethodData.EmitDestructor() change was necessary.
20827 2002-08-20 Martin Baulig <martin@gnome.org>
20829 * class.cs (TypeContainer.FindMembers): Added static check for events.
20831 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
20833 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
20834 use Type.GetEvents(), not Type.FindMembers().
20836 2002-08-20 Martin Baulig <martin@gnome.org>
20838 * decl.cs (MemberCache): Added a special method cache which will
20839 be used for method-only searched. This ensures that a method
20840 search will return a MethodInfo with the correct ReflectedType for
20843 2002-08-20 Martin Baulig <martin@gnome.org>
20845 * decl.cs (DeclSpace.FindMembers): Made this public.
20847 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20849 * delegate.cs: fixed build on windows.
20850 [FIXME: Filed as bug #29150: MCS must report these errors.]
20852 2002-08-19 Ravi Pratap <ravi@ximian.com>
20854 * ecore.cs (StandardConversionExists): Return a false
20855 if we are trying to convert the void type to anything else
20856 since that is not allowed.
20858 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
20859 we flag error 70 in the event an event is trying to be accessed
20860 directly from outside the declaring type.
20862 2002-08-20 Martin Baulig <martin@gnome.org>
20864 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
20865 MemberCache from typemanager.cs to decl.cs.
20867 2002-08-19 Martin Baulig <martin@gnome.org>
20869 * class.cs (TypeContainer): Implement IMemberContainer.
20870 (TypeContainer.DefineMembers): Create the MemberCache.
20871 (TypeContainer.FindMembers): Do better BindingFlags checking; only
20872 return public members if BindingFlags.Public was given, check
20873 whether members are static.
20875 2002-08-16 Martin Baulig <martin@gnome.org>
20877 * decl.cs (DeclSpace.Define): Splitted this in Define and
20878 DefineMembers. DefineMembers is called first and initializes the
20881 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
20882 DefineMembers() on all our DeclSpaces.
20884 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
20885 but call DefineMembers() on all nested interfaces. We call their
20886 Define() in our new Define() function.
20888 * interface.cs (Interface): Implement IMemberContainer.
20889 (Interface.Define): Moved all code except the attribute stuf to
20891 (Interface.DefineMembers): Initialize the member cache.
20893 * typemanager.cs (IMemberFinder): Removed this interface, we don't
20894 need this anymore since we can use MemberCache.FindMembers directly.
20896 2002-08-19 Martin Baulig <martin@gnome.org>
20898 * typemanager.cs (MemberCache): When creating the cache for an
20899 interface type, add all inherited members.
20900 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
20901 to `out bool used_cache' and documented it.
20902 (TypeManager.MemberLookup): If we already used the cache in the first
20903 iteration, we don't need to do the interfaces check.
20905 2002-08-19 Martin Baulig <martin@gnome.org>
20907 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
20908 here from IMemberFinder and don't implement this interface anymore.
20909 (DeclSpace.MemberCache): Moved here from IMemberFinder.
20911 * typemanager.cs (IMemberFinder): This interface is now only used by
20912 classes which actually support the member cache.
20913 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
20914 since we only put DeclSpaces into this Hashtable.
20915 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
20916 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
20918 2002-08-16 Martin Baulig <martin@gnome.org>
20920 * typemanager.cs (ICachingMemberFinder): Removed.
20921 (IMemberFinder.MemberCache): New property.
20922 (TypeManager.FindMembers): Merged this with RealFindMembers().
20923 This function will never be called from TypeManager.MemberLookup()
20924 so we can't use the cache here, just the IMemberFinder.
20925 (TypeManager.MemberLookup_FindMembers): Check whether the
20926 IMemberFinder has a MemberCache and call the cache's FindMembers
20928 (MemberCache): Rewrote larger parts of this yet another time and
20929 cleaned it up a bit.
20931 2002-08-15 Miguel de Icaza <miguel@ximian.com>
20933 * driver.cs (LoadArgs): Support quoting.
20935 (Usage): Show the CSC-like command line arguments.
20937 Improved a few error messages.
20939 2002-08-15 Martin Baulig <martin@gnome.org>
20941 * typemanager.cs (IMemberContainer.Type): New property.
20942 (IMemberContainer.IsInterface): New property.
20944 The following changes are conditional to BROKEN_RUNTIME, which is
20945 defined at the top of the file.
20947 * typemanager.cs (MemberCache.MemberCache): Don't add the base
20948 class'es members, but add all members from TypeHandle.ObjectType
20949 if we're an interface.
20950 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
20951 is the current type.
20952 (MemberCache.CacheEntry.Container): Removed this field.
20953 (TypeHandle.GetMembers): Include inherited members.
20955 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20957 * typemanager.cs: fixed compilation and added a comment on a field that
20960 2002-08-15 Martin Baulig <martin@gnome.org>
20962 * class.cs (ConstructorInitializer.Resolve): In the
20963 Expression.MemberLookup call, use the queried_type as
20966 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
20967 declared' attribute, it's always true.
20968 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
20969 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
20970 temporary wrapper for FindMembers which tells MemberLookup whether
20971 members from the base classes are included in the return value.
20972 This will go away soon.
20973 (TypeManager.MemberLookup): Use this temporary hack here; once the
20974 new MemberCache is completed, we don't need to do the DeclaredOnly
20975 looping here anymore since the MemberCache will take care of this.
20976 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
20977 (MemberCache): When creating the MemberCache for a class, get
20978 members from the current class and all its base classes.
20979 (MemberCache.CacheEntry.Container): New field. This is a
20980 temporary hack until the Mono runtime is fixed to distinguish
20981 between ReflectedType and DeclaringType. It allows us to use MCS
20982 with both the MS runtime and the unfixed Mono runtime without
20983 problems and without accecting performance.
20984 (MemberCache.SearchMembers): The DeclaredOnly looping from
20985 TypeManager.MemberLookup is now done here.
20987 2002-08-14 Martin Baulig <martin@gnome.org>
20989 * statement.cs (MyStructInfo.MyStructInfo): Don't call
20990 Type.GetFields on dynamic types but get the fields from the
20991 corresponding TypeContainer.
20992 (MyStructInfo.GetStructInfo): Added check for enum types.
20994 * typemanager.cs (MemberList.IsSynchronized): Implemented.
20995 (MemberList.SyncRoot): Implemented.
20996 (TypeManager.FilterWithClosure): No need to check permissions if
20997 closure_start_type == closure_invocation_type, don't crash if
20998 closure_invocation_type is null.
21000 2002-08-13 Martin Baulig <martin@gnome.org>
21002 Rewrote TypeContainer.FindMembers to use a member cache. This
21003 gives us a speed increase of about 35% for the self-hosting MCS
21004 build and of about 15-20% for the class libs (both on GNU/Linux).
21006 * report.cs (Timer): New class to get enhanced profiling. This
21007 whole class is "TIMER" conditional since it remarkably slows down
21010 * class.cs (MemberList): New class. This is an IList wrapper
21011 which we're now using instead of passing MemberInfo[]'s around to
21012 avoid copying this array unnecessarily.
21013 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
21014 (ICachingMemberFinder, IMemberContainer): New interface.
21015 (TypeManager.FilterWithClosure): If `criteria' is null, the name
21016 has already been checked, otherwise use it for the name comparision.
21017 (TypeManager.FindMembers): Renamed to RealMemberFinder and
21018 provided wrapper which tries to use ICachingMemberFinder.FindMembers
21019 if possible. Returns a MemberList, not a MemberInfo [].
21020 (TypeHandle): New class, implements IMemberContainer. We create
21021 one instance of this class per type, it contains a MemberCache
21022 which is used to do the member lookups.
21023 (MemberCache): New class. Each instance of this class contains
21024 all members of a type and a name-based hash table.
21025 (MemberCache.FindMembers): This is our new member lookup
21026 function. First, it looks up all members of the requested name in
21027 the hash table. Then, it walks this list and sorts out all
21028 applicable members and returns them.
21030 2002-08-13 Martin Baulig <martin@gnome.org>
21032 In addition to a nice code cleanup, this gives us a performance
21033 increase of about 1.4% on GNU/Linux - not much, but it's already
21034 half a second for the self-hosting MCS compilation.
21036 * typemanager.cs (IMemberFinder): New interface. It is used by
21037 TypeManager.FindMembers to call FindMembers on a TypeContainer,
21038 Enum, Delegate or Interface.
21039 (TypeManager.finder_to_member_finder): New PtrHashtable.
21040 (TypeManager.finder_to_container): Removed.
21041 (TypeManager.finder_to_delegate): Removed.
21042 (TypeManager.finder_to_interface): Removed.
21043 (TypeManager.finder_to_enum): Removed.
21045 * interface.cs (Interface): Implement IMemberFinder.
21047 * delegate.cs (Delegate): Implement IMemberFinder.
21049 * enum.cs (Enum): Implement IMemberFinder.
21051 * class.cs (TypeContainer): Implement IMemberFinder.
21053 2002-08-12 Martin Baulig <martin@gnome.org>
21055 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
21057 2002-08-12 Martin Baulig <martin@gnome.org>
21059 * ecore.cs (ITypeExpression): New interface for expressions which
21061 (TypeExpression): Renamed to TypeLookupExpression.
21062 (Expression.DoResolve): If we're doing a types-only lookup, the
21063 expression must implement the ITypeExpression interface and we
21064 call DoResolveType() on it.
21065 (SimpleName): Implement the new ITypeExpression interface.
21066 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
21067 hack, the situation that we're only looking up types can't happen
21068 anymore when this method is called. Moved the type lookup code to
21069 DoResolveType() and call it.
21070 (SimpleName.DoResolveType): This ITypeExpression interface method
21071 is now doing the types-only lookup.
21072 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
21073 (ResolveFlags): Added MaskExprClass.
21075 * expression.cs (MemberAccess): Implement the ITypeExpression
21077 (MemberAccess.DoResolve): Added support for a types-only lookup
21078 when we're called via ITypeExpression.DoResolveType().
21079 (ComposedCast): Implement the ITypeExpression interface.
21081 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
21082 Expression.Resolve() with ResolveFlags.Type instead.
21084 2002-08-12 Martin Baulig <martin@gnome.org>
21086 * interface.cs (Interface.Define): Apply attributes.
21088 * attribute.cs (Attribute.ApplyAttributes): Added support for
21089 interface attributes.
21091 2002-08-11 Martin Baulig <martin@gnome.org>
21093 * statement.cs (Block.Emit): Only check the "this" variable if we
21094 do not always throw an exception.
21096 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
21097 whether the property has a set accessor.
21099 2002-08-11 Martin Baulig <martin@gnome.org>
21101 Added control flow analysis support for structs.
21103 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
21104 with control flow analysis turned off.
21105 (IVariable): New interface.
21106 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
21107 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
21108 (FieldExpr.DoResolve): Resolve the instance expression with flow
21109 analysis turned off and do the definite assignment check after the
21110 resolving when we know what the expression will resolve to.
21112 * expression.cs (LocalVariableReference, ParameterReference):
21113 Implement the new IVariable interface, only call the flow analysis
21114 code if ec.DoFlowAnalysis is true.
21115 (This): Added constructor which takes a Block argument. Implement
21116 the new IVariable interface.
21117 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
21118 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
21119 This does the definite assignment checks for struct members.
21121 * class.cs (Constructor.Emit): If this is a non-static `struct'
21122 constructor which doesn't have any initializer, call
21123 Block.AddThisVariable() to tell the flow analysis code that all
21124 struct elements must be initialized before control returns from
21127 * statement.cs (MyStructInfo): New public class.
21128 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
21129 argument to this indexer. If non-zero, check an individual struct
21130 member, not the whole struct.
21131 (FlowBranching.CheckOutParameters): Check struct members.
21132 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
21133 overloaded versions of these methods which take an additional
21134 `int field_idx' argument to check struct members.
21135 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
21136 overloaded versions of these methods which take an additional
21137 `string field_name' argument to check struct member.s
21138 (VariableInfo): Implement the IVariable interface.
21139 (VariableInfo.StructInfo): New public property. Returns the
21140 MyStructInfo instance of the variable if it's a struct or null.
21141 (Block.AddThisVariable): New public method. This is called from
21142 Constructor.Emit() for non-static `struct' constructor which do
21143 not have any initializer. It creates a special variable for the
21144 "this" instance variable which will be checked by the flow
21145 analysis code to ensure that all of the struct's fields are
21146 initialized before control returns from the constructor.
21147 (UsageVector): Added support for struct members. If a
21148 variable/parameter is a struct with N members, we reserve a slot
21149 in the usage vector for each member. A struct is considered fully
21150 initialized if either the struct itself (slot 0) or all its
21151 members are initialized.
21153 2002-08-08 Martin Baulig <martin@gnome.org>
21155 * driver.cs (Driver.MainDriver): Only report an error CS5001
21156 if there were no compilation errors.
21158 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
21159 `UnsafeContext' property to determine whether the parent is in
21160 unsafe context rather than checking the parent's ModFlags:
21161 classes nested in an unsafe class are unsafe as well.
21163 2002-08-08 Martin Baulig <martin@gnome.org>
21165 * statement.cs (UsageVector.MergeChildren): Distinguish between
21166 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
21167 we return. Added test17() and test18() to test-154.cs.
21169 2002-08-08 Martin Baulig <martin@gnome.org>
21171 * typemanager.cs (TypeManager.FilterWithClosure): If we have
21172 Family access, make sure the invoking type isn't a subclass of the
21173 queried type (that'd be a CS1540).
21175 * ecore.cs (Expression.MemberLookup): Added overloaded version of
21176 this method which takes an additional `Type invocation_type'.
21178 * expression.cs (BaseAccess.DoResolve): Use the base type as
21179 invocation and query type.
21180 (MemberAccess.DoResolve): If the lookup failed and we're about to
21181 report a CS0122, try a lookup with the ec.ContainerType - if this
21182 succeeds, we must report a CS1540.
21184 2002-08-08 Martin Baulig <martin@gnome.org>
21186 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
21187 (MethodGroupExpr): Implement the IMemberExpr interface.
21189 * expression (MemberAccess.ResolveMemberAccess): No need to have
21190 any special code for MethodGroupExprs anymore, they're now
21193 2002-08-08 Martin Baulig <martin@gnome.org>
21195 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
21196 Family, FamANDAssem and FamORAssem permissions.
21197 (TypeManager.IsSubclassOrNestedChildOf): New public method.
21199 2002-08-08 Martin Baulig <martin@gnome.org>
21201 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
21202 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
21205 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
21207 * driver.cs: implemented /resource option to embed managed resources.
21209 2002-08-07 Martin Baulig <martin@gnome.org>
21211 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
21212 (FieldBase.HasFieldInitializer): New public property.
21213 (FieldBase.GetInitializerExpression): New public method. Resolves and
21214 returns the field initializer and makes sure it is only resolved once.
21215 (TypeContainer.EmitFieldInitializers): Call
21216 FieldBase.GetInitializerExpression to get the initializer, this ensures
21217 that it isn't resolved multiple times.
21219 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
21220 the resolving process (SimpleName/MemberLookup) that we're currently
21221 emitting a field initializer (which must not access any instance members,
21222 this is an error CS0236).
21224 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
21225 argument, if the `IsFieldInitializer' flag is set, we must report and
21226 error CS0236 and not an error CS0120.
21228 2002-08-07 Martin Baulig <martin@gnome.org>
21230 * ecore.cs (IMemberExpr): New public interface.
21231 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
21232 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
21233 if the expression is an IMemberExpr.
21235 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
21236 to be null, implicitly default to `this' if we're non-static in
21237 this case. Simplified the code a lot by using the new IMemberExpr
21238 interface. Also fixed bug #28176 here.
21240 2002-08-06 Martin Baulig <martin@gnome.org>
21242 * cs-parser.jay (SimpleLookup): Removed. We need to create
21243 ParameterReferences during semantic analysis so that we can do a
21244 type-only search when resolving Cast, TypeOf and SizeOf.
21245 (block): Pass the `current_local_parameters' to the Block's
21248 * class.cs (ConstructorInitializer): Added `Parameters parameters'
21249 argument to the constructor.
21250 (ConstructorInitializer.Resolve): Create a temporary implicit
21251 block with the parameters.
21253 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
21254 references here if we aren't doing a type-only search.
21256 * statement.cs (Block): Added constructor which takes a
21257 `Parameters parameters' argument.
21258 (Block.Parameters): New public property.
21260 * support.cs (InternalParameters.Parameters): Renamed `parameters'
21261 to `Parameters' and made it public readonly.
21263 2002-08-06 Martin Baulig <martin@gnome.org>
21265 * ecore.cs (Expression.Warning): Made this public as well.
21267 * report.cs (Report.Debug): Print the contents of collections.
21269 2002-08-06 Martin Baulig <martin@gnome.org>
21271 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
21272 used to tell Resolve() which kinds of expressions it may return.
21273 (Expression.Resolve): Added overloaded version of this method which
21274 takes a `ResolveFlags flags' argument. This can be used to tell
21275 Resolve() which kinds of expressions it may return. Reports a
21277 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
21278 ResolveFlags.SimpleName.
21279 (Expression.Error118): Added overloaded version of this method which
21280 takes a `ResolveFlags flags' argument. It uses the flags to determine
21281 which kinds of expressions are allowed.
21283 * expression.cs (Argument.ResolveMethodGroup): New public method.
21284 Resolves an argument, but allows a MethodGroup to be returned.
21285 This is used when invoking a delegate.
21287 * TODO: Updated a bit.
21289 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21291 Fixed compilation with csc.
21293 * ecore.cs: Expression.Error made public. Is this correct? Should
21294 Warning be made public too?
21296 * expression.cs: use ea.Location instead of ea.loc.
21297 [FIXME: Filed as bug #28607: MCS must report these errors.]
21299 2002-08-06 Martin Baulig <martin@gnome.org>
21301 * ecore.cs (Expression.loc): Moved the location here instead of
21302 duplicating it in all derived classes.
21303 (Expression.Location): New public property.
21304 (Expression.Error, Expression.Warning): Made them non-static and
21305 removed the location argument.
21306 (Expression.Warning): Added overloaded version which takes an
21307 `int level' argument.
21308 (Expression.Error118): Make this non-static and removed the
21309 expression and location arguments.
21310 (TypeExpr): Added location argument to the constructor.
21312 * expression.cs (StaticCallExpr): Added location argument to
21314 (Indirection, PointerArithmetic): Likewise.
21315 (CheckedExpr, UnCheckedExpr): Likewise.
21316 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
21317 (StringPtr): Likewise.
21320 2002-08-05 Martin Baulig <martin@gnome.org>
21322 * expression.cs (BaseAccess.DoResolve): Actually report errors.
21324 * assign.cs (Assign.DoResolve): Check whether the source
21325 expression is a value or variable.
21327 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
21328 while resolving the corresponding blocks.
21330 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
21331 an error, don't silently return null.
21333 * statement.cs (Block.AddVariable): Do the error reporting here
21334 and distinguish between CS0128 and CS0136.
21335 (Block.DoResolve): Report all unused labels (warning CS0164).
21336 (LabeledStatement): Pass the location to the constructor.
21337 (LabeledStatement.HasBeenReferenced): New property.
21338 (LabeledStatement.Resolve): Set it to true here.
21340 * statement.cs (Return.Emit): Return success even after reporting
21341 a type mismatch error (CS0126 or CS0127), this is what csc does and
21342 it avoids confusing the users with any consecutive errors.
21344 2002-08-05 Martin Baulig <martin@gnome.org>
21346 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
21348 * const.cs (Const.LookupConstantValue): Catch circular definitions.
21350 * expression.cs (MemberAccess.DoResolve): Silently return if an
21351 error has already been reported.
21353 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
21354 error has already been reported.
21356 2002-08-05 Martin Baulig <martin@gnome.org>
21358 * statement.cs (UsageVector): Only initialize the `parameters'
21359 vector if we actually have any "out" parameters.
21361 2002-08-05 Martin Baulig <martin@gnome.org>
21363 * expression.cs (Binary.ResolveOperator): When combining delegates,
21364 they must have the same type.
21366 2002-08-05 Martin Baulig <martin@gnome.org>
21368 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
21369 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
21370 work with the ms runtime and we also don't need it: if we're a
21371 PropertyBuilder and not in the `indexer_arguments' hash, then we
21372 are a property and not an indexer.
21374 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
21375 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
21376 since the latter one doesn't work with the ms runtime.
21378 2002-08-03 Martin Baulig <martin@gnome.org>
21380 Fixed bugs #27998 and #22735.
21382 * class.cs (Method.IsOperator): New public field.
21383 (Method.CheckBase): Report CS0111 if there's already a method
21384 with the same parameters in the current class. Report CS0508 when
21385 attempting to change the return type of an inherited method.
21386 (MethodData.Emit): Report CS0179 if a method doesn't have a body
21387 and it's not marked abstract or extern.
21388 (PropertyBase): New abstract base class for Property and Indexer.
21389 (PropertyBase.CheckBase): Moved here from Property and made it work
21391 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
21392 the same so we can reuse it there.
21393 (Property, Indexer): Derive from PropertyBase.
21394 (MethodSignature.inheritable_property_signature_filter): New delegate
21395 to find properties and indexers.
21397 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
21398 argument and improved error reporting.
21400 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
21401 EmptyReadOnlyParameters and made it a property.
21403 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
21404 version of this method which takes a `PropertyInfo indexer'.
21405 (TypeManager.RegisterIndexer): New method.
21407 * class.cs: Added myself as author of this file :-)
21409 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21411 * class.cs: fixed compilation on windoze.
21413 2002-08-03 Martin Baulig <martin@gnome.org>
21415 * interface.cs (Interface.GetInterfaceBases): Check whether all
21416 base interfaces are at least as accessible than the current one.
21418 * class.cs (TypeContainer.GetClassBases): Check whether base types
21419 are at least as accessible than the current type.
21420 (TypeContainer.AsAccessible): Implemented and made non-static.
21421 (MemberBase.CheckParameters): Report errors if the accessibility
21424 * delegate.cs (Delegate.Delegate): The default visibility is
21425 internal for top-level types and private for nested types.
21426 (Delegate.Define): Report errors if the accessibility checks fail.
21428 * enum.cs (Enum.Enum): The default visibility is internal for
21429 top-level types and private for nested types.
21430 (Enum.DefineType): Compute the correct visibility.
21432 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
21433 function which takes a `bool is_toplevel' instead of a TypeContainer.
21435 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
21438 2002-08-02 Martin Baulig <martin@gnome.org>
21440 * expression.cs (LocalVariableReferenc): Added constructor which
21441 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
21442 (LocalVariableReference.IsReadOnly): New property.
21443 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
21444 variable is readonly, use our own readonly flag to do this; you can
21445 use the new constructor to get a writable reference to a read-only
21448 * cs-parser.jay (foreach_statement, using_statement): Get a writable
21449 reference to the local variable.
21451 2002-08-01 Miguel de Icaza <miguel@ximian.com>
21453 * rootcontext.cs (ResolveCore): Also include System.Exception
21455 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
21456 we reach an EmptyStatement.
21458 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
21461 * expression.cs (Binary.ResolveOperator): Check error result in
21464 use brtrue/brfalse directly and avoid compares to null.
21466 2002-08-02 Martin Baulig <martin@gnome.org>
21468 * class.cs (TypeContainer.Define): Define all nested interfaces here.
21469 Fixes bug #28407, added test-155.cs.
21471 2002-08-01 Martin Baulig <martin@gnome.org>
21473 * class.cs (Event.EmitDefaultMethod): Make this work with static
21474 events. Fixes #28311, added verify-3.cs.
21476 2002-08-01 Martin Baulig <martin@gnome.org>
21478 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
21479 `is_disposable' fields.
21480 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
21481 `hm.is_disposable' if we're using the collection pattern.
21482 (Foreach.EmitCollectionForeach): Use the correct type for the
21483 enumerator's local variable, only emit the try/finally block if
21484 necessary (fixes #27713).
21486 2002-08-01 Martin Baulig <martin@gnome.org>
21488 * ecore.cs (Expression.report118): Renamed to Error118 and made
21491 * statement.cs (Throw.Resolve): Check whether the expression is of
21492 the correct type (CS0118) and whether the type derives from
21493 System.Exception (CS0155).
21494 (Catch.Resolve): New method. Do the type lookup here and check
21495 whether it derives from System.Exception (CS0155).
21496 (Catch.CatchType, Catch.IsGeneral): New public properties.
21498 * typemanager.cs (TypeManager.exception_type): Added.
21500 2002-07-31 Miguel de Icaza <miguel@ximian.com>
21502 * driver.cs: Updated About function.
21504 2002-07-31 Martin Baulig <martin@gnome.org>
21506 Implemented Control Flow Analysis.
21508 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
21509 (EmitContext.CurrentBranching): Added.
21510 (EmitContext.StartFlowBranching): Added.
21511 (EmitContext.EndFlowBranching): Added.
21512 (EmitContext.KillFlowBranching): Added.
21513 (EmitContext.IsVariableAssigned): Added.
21514 (EmitContext.SetVariableAssigned): Added.
21515 (EmitContext.IsParameterAssigned): Added.
21516 (EmitContext.SetParameterAssigned): Added.
21517 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
21518 Added control flow analysis stuff here.
21520 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
21521 resolve the expression as lvalue.
21522 (LocalVariableReference.DoResolve): Check whether the variable has
21523 already been assigned.
21524 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
21525 the parameter as assigned here.
21526 (ParameterReference.DoResolve): Check whether the parameter has already
21528 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
21529 expression as lvalue.
21531 * statement.cs (FlowBranching): New class for the flow analysis code.
21532 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
21533 (LabeledStatement.IsDefined): New public property.
21534 (LabeledStatement.AddUsageVector): New public method to tell flow
21535 analyis that the label may be reached via a forward jump.
21536 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
21538 (VariableInfo.Number): New public field. This is used by flow analysis
21539 to number all locals of a block.
21540 (Block.CountVariables): New public property. This is the number of
21541 local variables in this block (including the locals from all parent
21543 (Block.EmitMeta): Number all the variables.
21545 * statement.cs: Added flow analysis support to all classes.
21547 2002-07-31 Martin Baulig <martin@gnome.org>
21549 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
21550 To get debugging messages, compile mcs with /define:MCS_DEBUG and
21551 then use this argument.
21553 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
21555 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
21556 use this to specify /define options.
21558 2002-07-29 Martin Baulig <martin@gnome.org>
21560 * statement.cs (Fixed): Moved all code that does variable lookups
21561 and resolvings from Emit to Resolve.
21563 * statement.cs (For): Moved all code that does variable lookups
21564 and resolvings from Emit to Resolve.
21566 * statement.cs (Using): Moved all code that does variable lookups
21567 and resolvings from Emit to Resolve.
21569 2002-07-29 Martin Baulig <martin@gnome.org>
21571 * attribute.cs (Attribute.Resolve): Explicitly catch a
21572 System.NullReferenceException when creating the
21573 CustromAttributeBuilder and report a different warning message.
21575 2002-07-29 Martin Baulig <martin@gnome.org>
21577 * support.cs (ParameterData.ParameterName): Added method to
21578 get the name of a parameter.
21580 * typemanager.cs (TypeManager.IsValueType): New public method.
21582 2002-07-29 Martin Baulig <martin@gnome.org>
21584 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
21585 is a flag which specifies that it's either ref or out.
21586 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
21587 the out parameter to `out Parameter.Modifier mod', also set the
21588 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
21590 * support.cs (InternalParameters.ParameterModifier): Distinguish
21591 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
21592 Parameter.Modifier.ISBYREF flag if it's either ref or out.
21594 * expression.cs (Argument.GetParameterModifier): Distinguish
21595 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
21596 Parameter.Modifier.ISBYREF flag if it's either ref or out.
21598 2002-07-29 Martin Baulig <martin@gnome.org>
21600 * expression.cs (ParameterReference.ParameterReference): Added
21601 `Location loc' argument to the constructor.
21603 * cs-parser.jay: Pass location to ParameterReference.
21605 2002-07-28 Miguel de Icaza <miguel@ximian.com>
21607 * statement.cs (Try): Initialize the location.
21609 * cs-parser.jay: pass location to Try.
21611 * expression.cs (Unary.Reduce): Change the prototype to return
21612 whether a constant fold could be performed or not. The result is
21613 returned in an out parameters. In the case of Indirection and
21614 AddressOf, we want to perform the full tests.
21616 2002-07-26 Miguel de Icaza <miguel@ximian.com>
21618 * statement.cs (Statement.Emit): Flag dead code.
21620 2002-07-27 Andrew Birkett <andy@nobugs.org>
21622 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
21624 2002-07-27 Martin Baulig <martin@gnome.org>
21626 * class.cs (MethodData.Define): Put back call to
21627 TypeManager.AddMethod(), accidentally commented this out.
21629 * report.cs (Debug): New public method to print debugging information,
21630 this is `[Conditional ("DEBUG")]'.
21632 2002-07-26 Martin Baulig <martin@gnome.org>
21634 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
21635 (switch_statement): Push the current_block to the switch_stack and
21636 pop it again when we're done with the switch.
21637 (switch_section): The new block is a child of the current_block.
21638 Fixes bug #24007, added test-152.cs.
21640 2002-07-27 Martin Baulig <martin@gnome.org>
21642 * expression.cs (Invocation.EmitArguments): When calling a varargs
21643 function with only its fixed arguments, we need to pass an empty
21646 2002-07-27 Martin Baulig <martin@gnome.org>
21648 Mono 0.13 has been released.
21650 2002-07-25 Miguel de Icaza <miguel@ximian.com>
21652 * driver.cs: Rename --resource to --linkres, because that is what
21653 we do currently, we dont support --resource yet.
21655 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
21657 2002-07-25 Martin Baulig <martin@gnome.org>
21659 * class.cs (MethodData): New public class. This is a `method builder'
21660 class for a method or one accessor of a Property/Indexer/Event.
21661 (MethodData.GetMethodFlags): Moved here from MemberBase.
21662 (MethodData.ApplyAttributes): Likewise.
21663 (MethodData.ApplyObsoleteAttribute): Likewise.
21664 (MethodData.ApplyConditionalAttribute): Likewise.
21665 (MethodData.ApplyDllImportAttribute): Likewise.
21666 (MethodData.CheckAbstractAndExternal): Likewise.
21667 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
21668 (MethodData.Emit): Formerly known as Method.Emit().
21669 (MemberBase): Moved everything which was specific to a single
21670 accessor/method to MethodData.
21671 (Method): Create a new MethodData and call Define() and Emit() on it.
21672 (Property, Indexer, Event): Create a new MethodData objects for each
21673 accessor and call Define() and Emit() on them.
21675 2002-07-25 Martin Baulig <martin@gnome.org>
21677 Made MethodCore derive from MemberBase to reuse the code from there.
21678 MemberBase now also checks for attributes.
21680 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
21681 (MemberBase.GetMethodFlags): Moved here from class Method and marked
21683 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
21684 `CallingConventions cc' and `Attributes opt_attrs' arguments.
21685 (MemberBase.ApplyAttributes): New virtual method; applies the
21686 attributes to a method or accessor.
21687 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
21688 (MemberBase.ApplyConditionalAttribute): Likewise.
21689 (MemberBase.ApplyDllImportAttribute): Likewise.
21690 (MemberBase.CheckAbstractAndExternal): Likewise.
21691 (MethodCore.ParameterTypes): This is now a property instead of a
21692 method, it's initialized from DoDefineParameters().
21693 (MethodCore.ParameterInfo): Removed the set accessor.
21694 (MethodCore.DoDefineParameters): New protected virtual method to
21695 initialize ParameterTypes and ParameterInfo.
21696 (Method.GetReturnType): We can now simply return the MemberType.
21697 (Method.GetMethodFlags): Override the MemberBase version and add
21698 the conditional flags.
21699 (Method.CheckBase): Moved some code from Define() here, call
21700 DoDefineParameters() here.
21701 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
21702 here to avoid some larger code duplication.
21703 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
21704 ensure that abstract and external accessors don't declare a body.
21706 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
21707 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
21708 lookup in the attribute's parent classes, so we need to abort as soon
21709 as we found the first match.
21710 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
21711 the attribute has no arguments.
21713 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
21716 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21718 * cs-parser.jay: reverted previous patch.
21720 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21722 * cs-parser.jay: fixed bug #22119.
21724 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21726 * attribute.cs: fixed compilation. The error was:
21727 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
21728 be assigned to before control leaves the current method."
21729 [FIXME: Filed as bug #28186: MCS must report this error.]
21731 2002-07-25 Martin Baulig <martin@gnome.org>
21733 * attribute.cs (Attribute.Conditional_GetConditionName): New static
21734 method to pull the condition name ouf of a Conditional attribute.
21735 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
21736 the obsolete message and error flag out of an Obsolete attribute.
21738 * class.cs (Method.GetMethodFlags): New public method to get the
21739 TypeManager.MethodFlags for this method.
21740 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
21742 (Method.Define): Get and apply the Obsolete and Conditional attributes;
21743 if we're overriding a virtual function, set the new private variable
21744 `parent_method'; call the new TypeManager.AddMethod().
21746 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
21747 the MethodBuilder and the Method in a PtrHashtable.
21748 (TypeManager.builder_to_method): Added for this purpose.
21749 (TypeManager.MethodFlags): Added IsObsoleteError.
21750 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
21751 Obsolete and Conditional arguments in MethodBuilders. If we discover
21752 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
21753 the message from the attribute.
21755 2002-07-24 Martin Baulig <martin@gnome.org>
21757 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
21758 preprocessor directives, ensure that the argument to #define/#undef is
21759 exactly one identifier and that it's actually an identifier.
21761 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
21764 2002-07-24 Martin Baulig <martin@gnome.org>
21766 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
21767 initialize it to TypeManager.object_type in the constructor.
21768 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
21769 of the `hm.get_current' method if we're using the collection pattern.
21770 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
21771 for the explicit conversion to make it work when we're using the collection
21772 pattern and the `Current' property has a different return type than `object'.
21775 2002-07-24 Martin Baulig <martin@gnome.org>
21777 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
21778 does not match, but don't report any errors. This method is called in
21779 order for all methods in a MethodGroupExpr until a matching method is
21780 found, so we don't want to bail out if the first method doesn't match.
21781 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
21782 matches, report the 123. Fixes #28070.
21784 2002-07-24 Martin Baulig <martin@gnome.org>
21786 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
21787 TypeManager.TypeToCoreType() to the top of the method so the
21788 following equality checks will work. Fixes #28107.
21790 2002-07-24 Martin Baulig <martin@gnome.org>
21792 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
21793 operand is of type uint, and the other operand is of type sbyte,
21794 short or int, the operands are converted to type long." -
21795 Actually do what this comment already told us. Fixes bug #28106,
21798 2002-07-24 Martin Baulig <martin@gnome.org>
21800 * class.cs (MethodBase): New abstract class. This is now a base
21801 class for Property, Indexer and Event to avoid some code duplication
21802 in their Define() and DefineMethods() methods.
21803 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
21804 generic methods for Define() and DefineMethods().
21805 (FieldBase): Derive from MemberBase, not MemberCore.
21806 (Property): Derive from MemberBase, not MemberCore.
21807 (Property.DefineMethod): Moved all the code from this method to the
21808 new MethodBase.DefineAccessor(), just call it with appropriate
21810 (Property.Define): Call the new Property.DoDefine(), this does some
21811 sanity checks and we don't need to duplicate the code everywhere.
21812 (Event): Derive from MemberBase, not MemberCore.
21813 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
21814 accessors, this will also make them work with interface events.
21815 (Indexer): Derive from MemberBase, not MemberCore.
21816 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
21817 (Indexer.Define): Use the new MethodBase functions.
21819 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
21820 argument to the constructor.
21821 (Interface.FindMembers): Added support for interface events.
21822 (Interface.PopluateEvent): Implemented.
21824 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
21826 2002-07-22 Miguel de Icaza <miguel@ximian.com>
21828 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
21829 but this is required to check for a method name being the same as
21830 the containing class.
21834 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21836 * interface.cs: initialize variable.
21838 2002-07-23 Martin Baulig <martin@gnome.org>
21840 Implemented the IndexerName attribute in interfaces.
21842 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
21843 name if this is an explicit interface implementation.
21844 (Indexer.InterfaceIndexerName): New public variable. If we're
21845 implementing an interface indexer, this is the IndexerName in that
21846 interface. Otherwise, it's the IndexerName.
21847 (Indexer.DefineMethod): If we're implementing interface indexer,
21848 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
21849 and Pending.ImplementIndexer methods.
21850 (Indexer.Define): Also define the PropertyBuilder if we're
21851 implementing an interface indexer and this is neither an explicit
21852 interface implementation nor do the IndexerName match the one in
21855 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
21856 If a method is defined here, then we always need to create a proxy
21857 for it. This is used when implementing interface indexers.
21858 (Pending.IsInterfaceIndexer): New public method.
21859 (Pending.ImplementIndexer): New public method.
21860 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
21861 This is used when implementing interface indexers to define a proxy
21863 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
21864 define a proxy if necessary.
21866 * interface.cs (Interface.IndexerName): New public variable.
21867 (Interface.PopulateIndexer): Set the IndexerName.
21868 (Interface.DefineIndexers): New private method. Populate all the
21869 indexers and make sure their IndexerNames match.
21871 * typemanager.cs (IndexerPropertyName): Added support for interface
21874 2002-07-22 Martin Baulig <martin@gnome.org>
21876 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
21877 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
21878 ret if HasReturnLabel.
21879 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
21882 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
21883 and set the ec.LoopBeginTryCatchLevel.
21884 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
21885 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
21886 the current ec.TryCatchLevel, the branch goes out of an exception
21887 block. In this case, we need to use Leave and not Br.
21889 2002-07-22 Martin Baulig <martin@gnome.org>
21891 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
21892 block unless the block does not always return or it is contained in
21893 another try { ... } catch { ... } block. Fixes bug #26506.
21894 Added verify-1.cs to the test suite.
21896 2002-07-22 Martin Baulig <martin@gnome.org>
21898 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
21899 then we do not always return. Fixes bug #24985.
21901 2002-07-22 Martin Baulig <martin@gnome.org>
21903 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
21904 lookup on a per-class level; ie. walk up the class hierarchy until we
21905 found at least one applicable method, then choose the best among them.
21906 Fixes bug #24463 and test-29.cs.
21908 2002-07-22 Martin Baulig <martin@gnome.org>
21910 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
21911 return types of the methods. The return type is not part of the
21912 signature and we must not check it to make the `new' modifier work.
21913 Fixes bug #27999, also added test-147.cs.
21914 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
21916 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
21917 on the method's return type.
21919 2002-07-21 Martin Baulig <martin@gnome.org>
21921 * assign.cs: Make this work if the rightmost source is a constant and
21922 we need to do an implicit type conversion. Also adding a few more tests
21923 to test-38.cs which should have caught this.
21925 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
21926 target in the makefile for this. The makefile.gnu is primarily intended
21927 for end-users who don't want to debug the compiler.
21929 2002-07-21 Martin Baulig <martin@gnome.org>
21931 * assign.cs: Improved the Assign class so it can now handle embedded
21932 assignments (X = Y = Z = something). As a side-effect this'll now also
21933 consume less local variables. test-38.cs now passes with MCS, added
21934 a few new test cases to that test.
21936 2002-07-20 Martin Baulig <martin@gnome.org>
21938 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
21939 instructions. Fixes bug #27977, also added test-146.cs.
21941 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21943 * cs-tokenizer.cs: fixed getHex ().
21945 2002-07-19 Martin Baulig <martin@gnome.org>
21947 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
21948 not Type.GetType() to lookup the array type. This is needed when
21949 we're constructing an array of a user-defined type.
21950 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
21951 single-dimensional arrays, but also for single-dimensial arrays of
21954 2002-07-19 Martin Baulig <martin@gnome.org>
21956 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
21957 this function is called, it's not allowed to share LocalBuilders
21958 among ILGenerators.
21960 2002-07-19 Martin Baulig <martin@gnome.org>
21962 * expression.cs (Argument.Resolve): Report an error 118 when trying
21963 to pass a type as argument.
21965 2002-07-18 Martin Baulig <martin@gnome.org>
21967 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
21968 Conv_R_Un for the signed `long' type.
21970 2002-07-15 Miguel de Icaza <miguel@ximian.com>
21972 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
21973 `expr' for the temporary result, as that will fail if we do
21974 multiple resolves on the same expression.
21976 2002-07-05 Miguel de Icaza <miguel@ximian.com>
21978 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
21979 ec.TypeContainer for looking up aliases.
21981 * class.cs (TypeContainer): Remove LookupAlias from here.
21983 * decl.cs (DeclSpace); Move here.
21985 2002-07-01 Miguel de Icaza <miguel@ximian.com>
21987 * class.cs (FindMembers): Only call filter if the constructor
21988 bulider is not null.
21990 Also handle delegates in `NestedTypes' now. Now we will perform
21991 type lookups using the standard resolution process. This also
21994 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
21995 This uses Expressions (the limited kind that can be parsed by the
21996 tree) instead of strings.
21998 * expression.cs (ComposedCast.ToString): Implement, used to flag
21999 errors since now we have to render expressions.
22001 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
22004 * ecore.cs (SimpleName.ToString): ditto.
22006 * cs-parser.jay: Instead of using strings to assemble types, use
22007 Expressions to assemble the type (using SimpleName, ComposedCast,
22008 MemberAccess). This should fix the type lookups in declarations,
22009 because we were using a different code path for this.
22011 * statement.cs (Block.Resolve): Continue processing statements
22012 even when there is an error.
22014 2002-07-17 Miguel de Icaza <miguel@ximian.com>
22016 * class.cs (Event.Define): Also remove the `remove' method from
22017 the list of pending items.
22019 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
22020 generate more compact code.
22022 2002-07-17 Martin Baulig <martin@gnome.org>
22024 * const.cs (Const.LookupConstantValue): Add support for constant
22025 `unchecked' and `checked' expressions.
22026 Also adding test case test-140.cs for this.
22028 2002-07-17 Martin Baulig <martin@gnome.org>
22030 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
22031 check whether mi.ReturnType implements the IEnumerator interface; the
22032 `==' and the IsAssignableFrom() will fail in this situation.
22034 2002-07-16 Ravi Pratap <ravi@ximian.com>
22036 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
22039 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22041 * expression.cs: fixed bug #27811.
22043 2002-07-14 Miguel de Icaza <miguel@ximian.com>
22045 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
22046 Molaro: when we are a ref, the value already contains a pointer
22047 value, do not take the address of it.
22049 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
22050 * removed mb-parser.jay and mb-tokenizer.cs
22052 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
22054 * expression.cs: check against the building corlib void type.
22056 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
22058 * ecore.cs: fix for valuetype static readonly fields: when
22059 initializing them, we need their address, not the address of a copy.
22061 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
22063 * typemanager.cs: register also enum_type in corlib.
22065 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
22067 * class.cs: allow calling this (but not base) initializers in structs.
22069 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
22071 * ecore.cs: make sure we compare against the building base types
22074 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
22076 * typemanager.cs: fix TypeToCoreType() to handle void and object
22077 (corlib gets no more typerefs after this change).
22079 2002-07-12 Miguel de Icaza <miguel@ximian.com>
22081 * expression.cs (ArrayCreation.EmitArrayArguments): use
22082 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
22084 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
22085 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
22086 array indexes, the runtime actually forbids them.
22088 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
22089 for array arguments here.
22091 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
22092 instead of the default for ValueTypes.
22094 (New.DoEmit): Use IsValueType instead of
22095 IsSubclassOf (value_type)
22096 (New.DoResolve): ditto.
22097 (Invocation.EmitCall): ditto.
22099 * assign.cs (Assign): ditto.
22101 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
22102 Statements *are* currently doing part of their resolution during
22105 Expressions do always resolve during resolve, but statements are
22106 only required to propagate resolution to their children.
22108 2002-07-11 Miguel de Icaza <miguel@ximian.com>
22110 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
22112 (LoadAssembly): Do not add the dll if it is already specified
22114 (MainDriver): Add the System directory to the link path at the end,
22115 after all the other -L arguments.
22117 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
22118 wrong opcode for loading bytes and bools (ldelem.i1 instead of
22119 ldelem.u1) and using the opposite for sbytes.
22121 This fixes Digger, and we can finally run it.
22123 * driver.cs (UnixParseOption): Move the option parsing here.
22124 (CSCParseOption): Implement CSC-like parsing of options.
22126 We now support both modes of operation, the old Unix way, and the
22127 new CSC-like way. This should help those who wanted to make cross
22128 platform makefiles.
22130 The only thing broken is that /r:, /reference: and /lib: are not
22131 implemented, because I want to make those have the same semantics
22132 as the CSC compiler has, and kill once and for all the confussion
22133 around this. Will be doing this tomorrow.
22135 * statement.cs (Unsafe.Resolve): The state is checked during
22136 resolve, not emit, so we have to set the flags for IsUnsfe here.
22138 2002-07-10 Miguel de Icaza <miguel@ximian.com>
22140 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
22141 not catch the Error_ObjectRefRequired in SimpleName (as it is
22142 possible to have a class/instance variable name that later gets
22143 deambiguated), we have to check this here.
22145 2002-07-10 Ravi Pratap <ravi@ximian.com>
22147 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
22148 make static and put into Expression.
22150 (Event.Define): Register the private field of the event with the
22151 TypeManager so that GetFieldFromEvent can get at it.
22153 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
22154 keep track of the private field associated with an event which
22157 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
22160 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
22162 2002-07-10 Miguel de Icaza <miguel@ximian.com>
22164 * expression.cs (Binary.EmitBranchable): this routine emits the
22165 Binary expression in a branchable context. This basically means:
22166 we need to branch somewhere, not just get the value on the stack.
22168 This works together with Statement.EmitBoolExpression.
22170 * statement.cs (Statement.EmitBoolExpression): Use
22173 2002-07-09 Miguel de Icaza <miguel@ximian.com>
22175 * statement.cs (For): Reduce the number of jumps in loops.
22177 (For): Implement loop inversion for the For statement.
22179 (Break): We can be breaking out of a Try/Catch controlled section
22180 (foreach might have an implicit try/catch clause), so we need to
22181 use Leave instead of Br.
22183 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
22184 now). If the instace expression supports IMemoryLocation, we use
22185 the AddressOf method from the IMemoryLocation to extract the
22186 address instead of emitting the instance.
22188 This showed up with `This', as we were emitting the instance
22189 always (Emit) instead of the Address of This. Particularly
22190 interesting when This is a value type, as we dont want the Emit
22191 effect (which was to load the object).
22193 2002-07-08 Miguel de Icaza <miguel@ximian.com>
22195 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
22197 * statement.cs (Checked): Set the CheckedState during the resolve
22198 process too, as the ConvCast operations track the checked state on
22199 the resolve process, and not emit.
22201 * cs-parser.jay (namespace_member_declaration): Flag that we have
22202 found a declaration when we do. This is used to flag error 1529
22204 * driver.cs: Report ok when we display the help only.
22206 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
22208 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
22210 2002-07-04 Miguel de Icaza <miguel@ximian.com>
22212 * cs-tokenizer.cs (define): We also have to track locally the
22213 defines. AllDefines is just used for the Conditional Attribute,
22214 but we also need the local defines for the current source code.
22216 2002-07-03 Miguel de Icaza <miguel@ximian.com>
22218 * statement.cs (While, For, Do): These loops can exit through a
22219 Break statement, use this information to tell whether the
22220 statement is the last piece of code.
22222 (Break): Flag that we break.
22224 * codegen.cs (EmitContexts): New `Breaks' state variable.
22226 2002-07-03 Martin Baulig <martin@gnome.org>
22228 * class.cs (TypeContainer.MethodModifiersValid): Allow override
22229 modifiers in method declarations in structs. Otherwise, you won't
22230 be able to override things like Object.Equals().
22232 2002-07-02 Miguel de Icaza <miguel@ximian.com>
22234 * class.cs (Method, Property, Indexer): Do not allow the public
22235 modifier to be used in explicit interface implementations.
22237 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
22238 override modifiers in method declarations in structs
22240 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
22242 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
22243 integer or real overflow, report an error
22245 2002-07-02 Martin Baulig <martin@gnome.org>
22247 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
22248 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
22249 to tell the runtime about our newly created System.Object and
22250 System.ValueType types.
22252 2002-07-02 Miguel de Icaza <miguel@ximian.com>
22254 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
22255 struct instead of Ldarg/Starg.
22257 2002-07-02 Martin Baulig <martin@gnome.org>
22259 * expression.cs (Indirection.Indirection): Call
22260 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
22262 2002-07-02 Martin Baulig <martin@gnome.org>
22264 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
22265 ValueType, call TypeManager.TypeToCoreType() on it.
22266 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
22267 the OpCodes.Newarr argument.
22269 2002-07-02 Martin Baulig <martin@gnome.org>
22271 * expression.cs (Invocation.EmitCall): When compiling corlib,
22272 replace all calls to the system's System.Array type to calls to
22273 the newly created one.
22275 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
22276 System.Array methods.
22277 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
22278 from the system's System.Array type which must be replaced.
22280 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
22282 * typemanager.cs: load unverifiable_code_ctor so we can build
22283 corlib using the correct type. Avoid using GetTypeCode() with
22285 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
22286 TypeManager.object_type to allow building corlib.
22288 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
22290 * ecore.cs: handle System.Enum separately in LoadFromPtr().
22292 2002-07-01 Martin Baulig <martin@gnome.org>
22294 * class.cs: Make the last change actually work, we need to check
22295 whether `ifaces != null' to avoid a crash.
22297 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
22299 * class.cs: when we build structs without fields that implement
22300 interfaces, we need to add the interfaces separately, since there is
22301 no API to both set the size and add the interfaces at type creation
22304 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
22306 * expression.cs: the dimension arguments to the array constructors
22307 need to be converted if they are a long.
22309 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
22311 * class.cs: don't emit ldarg.0 if there is no parent constructor
22312 (fixes showstopper for corlib).
22314 2002-06-29 Martin Baulig <martin@gnome.org>
22316 MCS now compiles corlib on GNU/Linux :-)
22318 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
22319 ie. check for MethodImplOptions.InternalCall.
22321 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
22322 and TypeManager.attribute_type are null, so we must explicitly check
22323 whether parent is not null to find out whether it's an attribute type.
22324 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
22325 and SetBuilder, not only if the property is neither abstract nor external.
22326 This is necessary to set the MethodImplOptions on the accessor methods.
22327 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
22328 SetBuilder, see Property.Emit().
22330 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
22331 populate "System.Object", "System.ValueType" and "System.Attribute" since
22332 they've already been populated from BootCorlib_PopulateCoreTypes().
22334 2002-06-29 Martin Baulig <martin@gnome.org>
22336 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
22337 is the NullLiteral, we also need to make sure that target_type is not
22340 2002-06-29 Martin Baulig <martin@gnome.org>
22342 * rootcontext.cs (RootContext.ResolveCore): We must initialize
22343 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
22344 before calling BootstrapCorlib_ResolveDelegate ().
22346 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22348 * statement.cs: fixed build-breaker. All tests passed ok.
22350 2002-06-27 Martin Baulig <martin@gnome.org>
22352 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
22353 for System.Decimal when compiling corlib.
22355 2002-06-27 Martin Baulig <martin@gnome.org>
22357 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
22358 switch blocks which contain nothing but a default clause.
22360 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
22362 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
22364 2002-06-27 Martin Baulig <martin@gnome.org>
22366 * ecore.cs (PropertyExpr.PropertyExpr): Call
22367 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
22369 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
22370 is already a TypeBuilder.
22372 2002-06-27 Martin Baulig <martin@gnome.org>
22374 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
22375 `target_type == TypeManager.array_type', not IsAssignableFrom() in
22376 the "from an array-type to System.Array" case. This makes it work
22377 when compiling corlib.
22379 2002-06-27 Martin Baulig <martin@gnome.org>
22381 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
22382 non-static PropertyExpr, set its InstanceExpression. This makes
22383 the `ICollection.Count' property work in System/Array.cs.
22385 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
22387 * driver.cs: Made error handling more consistent. Errors now
22388 tracked by Report class, so many methods which used to return int
22389 now return void. Main() now prints success/failure and
22390 errors/warnings message.
22392 Renamed '--probe' compiler argument to '--expect-error'. Removed
22393 the magic number return values (123 and 124). Now, if the
22394 expected error occurs, the compiler exits with success (exit value
22395 0). If the compilation completes without seeing that particular
22396 error, the compiler exits with failure (exit value 1). The
22397 makefile in mcs/errors has been changed to handle the new behaviour.
22399 * report.cs: Made 'expected error' number a property and renamed
22400 it from 'Probe' to 'ExpectedError'.
22402 * genericparser.cs: Removed error handling support, since it is
22403 now all done by Report class.
22405 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
22406 class, so parse() no longer returns an int.
22408 * namespace.cs: Use Report.Error instead of GenericParser.error
22410 2002-06-22 Miguel de Icaza <miguel@ximian.com>
22412 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
22413 TypeContainer.AddOperator): At the front of the list put the
22414 explicit implementations, so they get resolved/defined first.
22416 2002-06-21 Miguel de Icaza <miguel@ximian.com>
22418 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
22419 interface type is implemented by this TypeContainer. Used during
22420 explicit interface implementation.
22422 (Property.Define, Indexer.Define, Method.Define): Validate that
22423 the given interface in the explicit implementation is one of the
22424 base classes for the containing type.
22426 Also if we are explicitly implementing an interface, but there is
22427 no match in the pending implementation table, report an error.
22429 (Property.Define): Only define the property if we are
22430 not explicitly implementing a property from an interface. Use the
22431 correct name also for those properties (the same CSC uses,
22432 although that is really not needed).
22434 (Property.Emit): Do not emit attributes for explicitly implemented
22435 properties, as there is no TypeBuilder.
22437 (Indexer.Emit): ditto.
22439 Hiding then means that we do not really *implement* a pending
22440 implementation, which makes code fail.
22442 2002-06-22 Martin Baulig <martin@gnome.org>
22444 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
22445 the return value of Object.GetType(). [FIXME: we need to do this whenever
22446 we get a type back from the reflection library].
22448 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
22450 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
22452 2002-06-20 Miguel de Icaza <miguel@ximian.com>
22454 * attribute.cs: Return null if we can not look up the type.
22456 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
22457 the interface types found.
22459 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
22460 interface types found.
22462 * typemanager.cs (GetInterfaces): Make this routine returns alll
22463 the interfaces and work around the lame differences between
22464 System.Type and System.Reflection.Emit.TypeBuilder in the results
22465 result for GetInterfaces.
22467 (ExpandInterfaces): Given an array of interface types, expand and
22468 eliminate repeated ocurrences of an interface. This expands in
22469 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
22472 2002-06-21 Martin Baulig <martin@gnome.org>
22474 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
22477 2002-06-21 Martin Baulig <martin@gnome.org>
22479 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
22480 and called with one of the core types, return the corresponding typebuilder for
22483 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
22486 2002-06-21 Martin Baulig <martin@gnome.org>
22488 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
22489 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
22490 (Expression.ConvertReferenceExplicit): Likewise.
22492 * expression.cs (ElementAccess.DoResolve): Likewise.
22493 (ElementAccess.DoResolveLValue): Likewise.
22495 2002-06-10 Martin Baulig <martin@gnome.org>
22497 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
22498 add the "value" parameter to the parameter list.
22500 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
22503 2002-06-19 Miguel de Icaza <miguel@ximian.com>
22505 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
22506 the argument to an int, uint, long or ulong, per the spec. Also
22507 catch negative constants in array creation.
22509 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
22511 * class.cs: do not allow the same interface to appear twice in
22512 the definition list.
22514 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
22516 * ecore.cs: don't use ldlen with System.Array.
22518 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
22520 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
22522 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
22524 * modifiers.cs: produce correct field attributes for protected
22525 internal. Easy fix so miguel can work on ther harder stuff:-)
22527 2002-06-18 Miguel de Icaza <miguel@ximian.com>
22529 * pending.cs: New file. Move the code from class.cs here.
22530 Support clearning the pending flag for all methods (when not doing
22531 explicit interface implementation).
22533 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
22535 * rootcontext.cs: added a couple more types needed to bootstrap.
22537 2002-06-17 Miguel de Icaza <miguel@ximian.com>
22539 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
22540 constructor in the type, instead of any constructor in the type
22541 hierarchy. Thanks to Paolo for finding this bug (it showed up as
22542 a bug in the Mono runtime when applying the params attribute).
22544 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
22545 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
22547 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
22549 * expression.cs (Unary.ResolveOperator): Use TypeManager
22550 to resolve the type.
22552 2002-06-13 Ravi Pratap <ravi@ximian.com>
22554 * cs-parser.jay (enum_member_declaration): Pass in the attributes
22557 * enum.cs (AddEnumMember): Add support to store the attributes associated
22558 with each member too.
22560 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
22561 field builders too - this takes care of the enum member case.
22563 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
22565 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
22566 address-of operator on both value types and pointers.
22568 2002-06-10 Martin Baulig <martin@gnome.org>
22570 * interface.cs (Interface.PopulateIndexer): Add the indexer's
22571 PropertyBuilder to the `property_builders' list.
22573 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
22574 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
22575 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
22576 find any indexers which are inherited from an interface.
22578 2002-06-09 Martin Baulig <martin@gnome.org>
22580 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
22581 the same type as the constant if necessary. There's also a test-130.cs
22584 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
22586 * typemanager.cs (TypeManager.ChangeType): Previously known as
22587 Enum.ChangeEnumType().
22589 2002-06-09 Martin Baulig <martin@gnome.org>
22591 * expression.cs (Cast.TryReduce): Added support for consts.
22593 2002-06-08 Ravi Pratap <ravi@ximian.com>
22595 * class.cs (Accessor): Hold attributes information so we can pass
22598 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
22599 Modify to pass in attributes attached to the methods.
22601 (add_accessor_declaration, remove_accessor_declaration): Ditto.
22603 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
22604 to handle the Accessor kind :-)
22606 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
22608 2002-06-08 Martin Baulig <martin@gnome.org>
22610 * expression.cs (Unary.TryReduceNegative): Added support for
22613 2002-06-08 Martin Baulig <martin@gnome.org>
22615 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
22616 name can't be found in the `defined_names' - the caller will do a
22617 MemberLookup in this case and thus find methods in System.Enum
22618 such as Enum.IsDefined().
22620 2002-06-08 Martin Baulig <martin@gnome.org>
22622 * enum.cs (Enum.ChangeEnumType): This is a custom version of
22623 Convert.ChangeType() which works with TypeBuilder created types.
22624 (Enum.LookupEnumValue, Enum.Define): Use it here.
22626 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
22627 `TypeBuilder.BaseType != null' check.
22628 (TypeContainer.FindMembers): Only lookup parent members if we
22629 actually have a parent.
22630 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
22631 (ConstructorInitializer.Resolve): Likewise.
22633 * interface.cs (Interface.FindMembers): Added
22634 `TypeBuilder.BaseType != null' check.
22636 * rootcontext.cs (RootContext.ResolveCore): Added
22637 "System.Runtime.CompilerServices.IndexerNameAttribute" to
22638 classes_second_stage.
22640 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
22641 debug_type and trace_type when compiling with --nostdlib.
22643 2002-06-07 Martin Baulig <martin@gnome.org>
22645 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
22646 (AddField): Set it to true when adding a non-static field.
22647 (DefineType): Use `have_nonstatic_fields' to find out whether we
22648 have non-static fields, not `Fields != null'.
22650 2002-06-02 Miguel de Icaza <miguel@ximian.com>
22652 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
22653 dereferencing a null on the static-field code path)
22655 2002-05-30 Martin Baulig <martin@gnome.org>
22657 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
22658 to take command line arguments. Use reflection to call the new
22659 custom `Initialize' function on the symbol writer and pass it the
22660 command line arguments.
22662 * driver.cs (--debug-args): New command line argument to pass command
22663 line arguments to the symbol writer.
22665 2002-05-28 Miguel de Icaza <miguel@ximian.com>
22667 * assign.cs (DoResolve): Forgot to do the implicit conversion to
22668 the target type for indexers and properties. Thanks to Joe for
22671 2002-05-27 Miguel de Icaza <miguel@ximian.com>
22673 * typemanager.cs (MethodFlags): returns the method flags
22674 (Obsolete/ShouldIgnore) that control warning emission and whether
22675 the invocation should be made, or ignored.
22677 * expression.cs (Invocation.Emit): Remove previous hack, we should
22678 not do this on matching a base type, we should do this based on an attribute
22680 Only emit calls to System.Diagnostics.Debug and
22681 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
22682 on the command line.
22684 * rootcontext.cs: Global settings for tracing and debugging.
22686 * cs-tokenizer.cs (define): New utility function to track
22687 defines. Set the global settings for TRACE and DEBUG if found.
22689 2002-05-25 Ravi Pratap <ravi@ximian.com>
22691 * interface.cs (Populate*): Pass in the TypeContainer as well as
22692 the DeclSpace as parameters so that we can create EmitContexts and
22693 then use that to apply attributes etc.
22695 (PopulateMethod, PopulateEvent, PopulateProperty)
22696 (PopulateIndexer): Apply attributes everywhere.
22698 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
22701 (ApplyAttributes): Update accordingly.
22703 We now apply interface attributes for all members too.
22705 2002-05-26 Miguel de Icaza <miguel@ximian.com>
22707 * class.cs (Indexer.Define); Correctly check if we are explicit
22708 implementation (instead of checking the Name for a ".", we
22709 directly look up if the InterfaceType was specified).
22711 Delay the creation of the PropertyBuilder.
22713 Only create the PropertyBuilder if we are not an explicit
22714 interface implementation. This means that explicit interface
22715 implementation members do not participate in regular function
22716 lookups, and hence fixes another major ambiguity problem in
22717 overload resolution (that was the visible effect).
22719 (DefineMethod): Return whether we are doing an interface
22722 * typemanager.cs: Temporary hack until we get attributes in
22723 interfaces (Ravi is working on that) and we get IndexerName
22724 support in interfaces.
22726 * interface.cs: Register the indexers as properties.
22728 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
22729 warning, I have verified that this is a bug in the .NET runtime
22730 (JavaScript suffers of the same problem).
22732 * typemanager.cs (MemberLookup): When looking up members for
22733 interfaces, the parent of an interface is the implicit
22734 System.Object (so we succeed in searches of Object methods in an
22735 interface method invocation. Example: IEnumerable x; x.ToString
22738 2002-05-25 Miguel de Icaza <miguel@ximian.com>
22740 * class.cs (Event): Events should also register if they do
22741 implement the methods that an interface requires.
22743 * typemanager.cs (MemberLookup); use the new GetInterfaces
22746 (GetInterfaces): The code used to lookup interfaces for a type is
22747 used in more than one place, factor it here.
22749 * driver.cs: Track the errors at the bottom of the file, we kept
22752 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
22753 instance if the method we are calling is static!
22755 2002-05-24 Miguel de Icaza <miguel@ximian.com>
22757 * attribute.cs (ApplyAttributes): Make this function filter out
22758 the IndexerName attribute (as that attribute in reality is never
22759 applied) and return the string constant for the IndexerName
22762 * class.cs (TypeContainer.Emit): Validate that all the indexers
22763 have the same IndexerName attribute, and if so, set the
22764 DefaultName attribute on the class.
22766 * typemanager.cs: The return value might contain other stuff (not
22767 only methods). For instance, consider a method with an "Item"
22768 property and an Item method.
22770 * class.cs: If there is a problem with the parameter types,
22773 2002-05-24 Ravi Pratap <ravi@ximian.com>
22775 * ecore.cs (ImplicitConversionExists): Wrapper function which also
22776 looks at user defined conversion after making a call to
22777 StandardConversionExists - we need this for overload resolution.
22779 * expression.cs : Update accordingly the various method calls.
22781 This fixes 2 bugs filed against implicit user defined conversions
22783 2002-05-22 Miguel de Icaza <miguel@ximian.com>
22785 * statement.cs: Track the result of the assignment.
22787 2002-05-21 Miguel de Icaza <miguel@ximian.com>
22789 * expression.cs (MemberAccess): Improved error reporting for
22790 inaccessible members.
22792 2002-05-22 Martin Baulig <martin@gnome.org>
22794 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
22795 itself with debugging support.
22797 2002-05-22 Martin Baulig <martin@gnome.org>
22799 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
22800 Removed, this isn't needed anymore.
22802 2002-05-20 Martin Baulig <martin@gnome.org>
22804 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
22805 be underlying type for an enum.
22807 2002-05-20 Miguel de Icaza <miguel@ximian.com>
22809 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
22810 that splits out the loading of just the core types.
22812 * rootcontext.cs (ResolveCore): Split the struct resolution in
22813 two, so we can load the enumeration underlying types before any
22816 * expression.cs (Is): Bandaid until we fix properly Switch (see
22817 bug #24985 for details).
22819 * typemanager.cs (ImplementsInterface): The hashtable will contain
22820 a null if there are no interfaces implemented.
22822 2002-05-18 Miguel de Icaza <miguel@ximian.com>
22824 * cs-parser.jay (indexer_declarator): It is fine to have array
22827 2002-05-17 Miguel de Icaza <miguel@ximian.com>
22829 * typemanager.cs: (RegisterBuilder): New function used to register
22830 TypeBuilders that implement interfaces. Since
22831 TypeBuilder.GetInterfaces (as usual) does not work with lame
22833 (AddUserType): register interfaces.
22835 (ImplementsInterface): Use the builder_to_ifaces hash if we are
22836 dealing with TypeBuilder. Also, arrays are showing up as
22837 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
22838 methods can not be invoked on them!
22840 * ecore.cs (ExplicitReferenceConversionExists): Made public.
22841 (ImplicitReferenceConversionExists): Split out from
22842 StandardConversionExists.
22844 * expression.cs (As): We were only implementing one of the three
22845 cases for the as operator. We now implement them all.
22846 (Is): Implement the various other cases for Is as well.
22848 * typemanager.cs (CACHE): New define used to control if we want or
22849 not the FindMembers cache. Seems to have a negative impact on
22850 performance currently
22852 (MemberLookup): Nested types have full acess to
22853 enclosing type members
22855 Remove code that coped with instance/static returns for events, we
22856 now catch this in RealFindMembers.
22858 (RealFindMembers): only perform static lookup if the instance
22859 lookup did not return a type or an event.
22861 2002-05-17 Miguel de Icaza <miguel@ximian.com>
22863 * assign.cs (CompoundAssign): We pass more semantic information
22864 now to Compound Assignments than we did before: now we have all
22865 the information at hand, and now we resolve the target *before* we
22866 do the expression expansion, which allows the "CacheValue" method
22867 to have the effect we intended (before, a [x] += 1 would generate
22868 two differen ArrayAccess expressions from the ElementAccess,
22869 during the resolution process).
22871 (CompoundAssign.DoResolve): Resolve target and original_source here.
22873 2002-05-16 Miguel de Icaza <miguel@ximian.com>
22875 * expression.cs (ArrayAccess): dropped debugging information.
22877 * typemanager.cs: Small bug fix: I was always returning i_members,
22878 instead of one of i_members or s_members (depending on which had
22881 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
22882 method is invoked before any code generation takes place, and it
22883 is a mechanism to inform that the expression will be invoked more
22884 than once, and that the method should use temporary values to
22885 avoid having side effects
22887 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
22889 * ecore.cs (Expression.CacheTemporaries): Provide empty default
22892 * expression.cs (Indirection, ArrayAccess): Add support for
22893 CacheTemporaries in these two bad boys.
22895 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
22896 ldobj or ldind_ref.
22897 (StoreFromPtr): Handle stobj as well.
22899 * expression.cs (UnaryMutator): Share more code.
22901 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
22902 down: I was not tracking the Filter function as well, which
22903 was affecting the results of the cache.
22905 2002-05-15 Miguel de Icaza <miguel@ximian.com>
22907 * attribute.cs: Remove the hack to handle the CharSet property on
22910 2002-05-14 Miguel de Icaza <miguel@ximian.com>
22912 * attribute.cs (DoResolve): More uglyness, we now only try to
22913 resolve the attribute partially, to extract the CharSet
22914 information (only if we are a StructLayout attribute). Otherwise
22916 (GetExtraTypeInfo): Add some code to conditionally kill in the
22917 future this. I am more and more convinced that the .NET
22918 framework has special code to handle the attribute setting on
22921 * expression.cs (IsParamsMethodApplicable): Revert my previous
22922 foreach change here, it was wrong.
22924 2002-05-13 Miguel de Icaza <miguel@ximian.com>
22926 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
22927 (pp_expr): do not abort on unknown input, just return.
22928 (eval): abort if there are pending chars.
22930 * attribute.cs (Attribute.Resolve): Positional parameters are
22931 optional. Deal with that case.
22933 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
22934 the Ansi/Unicode/Auto information for the type.
22936 (TypeContainer.DefineType): instantiate the EmitContext here, as
22937 we will be using it during the type definition (to resolve
22938 attributes) and during the emit phase.
22940 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
22941 to pull type information out of the attributes
22943 (Attribute.Resolve): track the constructor builder, and allow for
22944 multiple invocations (structs and classes will use this).
22946 * ecore.cs (MemberLookupFinal): new version with all the
22947 parameters customizable.
22949 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
22950 constructors. Return if the result value is null (as the error
22951 would have been flagged already by MemberLookupFinal)
22953 Do not allow instances of abstract classes or interfaces to be
22956 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
22957 We have to compare the assembly property here when dealing with
22958 FamANDAssem and Assembly access modifiers, because we might be
22959 creating an assembly from *modules* (that means that we are not
22960 getting TypeBuilders for types defined in other modules that are
22961 part of this assembly).
22963 (Method.Emit): If the method is marked abstract and has a body,
22966 (TypeContainer.DefineMembers): If both the defined member and the
22967 parent name match are methods, then do not emit any warnings: let
22968 the Method.Define routine take care of flagging warnings. But if
22969 there is a mismatch (method overrides something else, or method is
22970 overriwritten by something, then emit warning).
22972 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
22973 set to null, this means `do not check for the return type on the
22976 (Method.Define): set the return type for the method signature to
22977 null, so that we get methods with the same name and parameters and
22978 different return types. This is used to flag warning 114 (you are
22979 hiding a method, and you probably want to use the new/override
22982 * typemanager.cs (MemberLookup): Implemented proper access
22983 control, closing a long standing set of bug reports. The problem
22984 was that the Framework only has two bits: Public and NonPublic,
22985 and NonPublic includes private and protected methods, but we need
22986 to enforce the FamANDAssem, FamOrAssem and Family.
22988 2002-05-11 Miguel de Icaza <miguel@ximian.com>
22990 * statement.cs (GotoCase): Return true: Ammounts to giving up
22991 knowledge on whether we return or not, and letting the other case
22992 be responsible for it.
22994 2002-05-10 Miguel de Icaza <miguel@ximian.com>
22996 * driver.cs: Do not load directories for each file processed, only
22997 do it if there is a pattern.
22999 * ecore.cs: Report readonly assigns here as well, as we might have
23000 been resolved only by MemberAccess.
23002 (SimpleName.SimpleNameResolve): Also be useful for LValue
23003 resolution. We need this to propagate assign to local readonly variables
23005 * typemanager.cs: Use a ptrhashtable for the criteria, because we
23006 do not want to reuse potential criteria memory.
23008 * class.cs (MyEventBuilder): Set reflected_type;
23010 * ecore.cs (Constantify): Added support for constifying bools.
23012 (RootContext.LookupType): Added a cache for values looked up in
23013 the declaration space.
23015 * typemanager.cs (FindMembers): Now is a front-end to
23016 RealFindMembers, and provides a two-level hashtable-based cache to
23019 15% performance improvement: from 22.5 to 19.2 seconds.
23021 * expression.cs (IsParamsMethodApplicable): use foreach.
23022 (Invocation.DoResolve): ditto.
23023 (New.DoResolve): ditto.
23024 (ArrayCreation.DoResolve): ditto.
23026 * ecore.cs (FindMostEncompassingType): use foreach.
23028 * delegate.cs (NewDelegate.DoResolve): Use foreach
23030 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
23031 (RemoveMethods): use foreach.
23033 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
23034 nested foreach statements instead of for, and also break out of
23035 the inner loop once a match is found.
23037 (Invocation.OverloadResolve): Use foreach, simplify the code.
23039 2002-05-08 Miguel de Icaza <miguel@ximian.com>
23041 * cfold.cs (BinaryFold): During an enumeration evaluation context,
23042 we actually unwrap the expression to allow for extra information
23045 * expression.cs: Use Shr_Un on unsigned operations.
23047 2002-05-08 Ravi Pratap <ravi@ximian.com>
23049 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
23050 applicable operators was not being considered correctly. This closes
23051 the bug Miguel reported.
23053 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
23055 * attribute.cs: check that the type derives from System.Attribute
23056 and report the correct error in that case (moved the duplicate code to
23057 its own method, too).
23059 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
23061 * attribute.cs: lookup attribute type name as the spec says: first the
23062 bare attribute name and then name + "Attribute" (nant compiles with
23063 mcs after this fix).
23065 2002-05-07 Miguel de Icaza <miguel@ximian.com>
23067 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
23068 Because of the way we parse things, we should try to see if a
23069 UIntConstant can fit in an integer.
23071 2002-05-07 Ravi Pratap <ravi@ximian.com>
23073 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
23074 when we are in an explicit context.
23076 (ConvertReferenceExplicit): When converting from Iface type S to Class
23077 T make sure the rules are implemented as an OR.
23079 * parameter.cs (ParameterType): Make it a property for now although the
23080 purpose really isn't anything immediate.
23082 * expression.cs (Is*Applicable): Do better checking on the parameter type
23083 of a ref/out parameter. The ones from the system assemblies are already
23084 marked with the correct type so we don't need to do any correction.
23086 * ecore.cs (StandardConversionExists): Conversion from Interface types to
23087 the object type is standard too so include that.
23089 2002-05-06 Miguel de Icaza <miguel@ximian.com>
23091 * ecore.cs (StandardConversionExists): Augment with missing code:
23092 deal with IntConstant, LongConstants and Enumerations.
23094 * assign.cs: Report the error, instead of failing silently
23096 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
23097 typecontainer that they are declared, because the
23098 typecontainer/namespace will have the list of using clauses that
23099 need to be applied.
23101 Assembly Attributes were escaping the normal registration
23104 (EmitCode): Apply attributes within an EmitContext that represents
23105 the container they were declared on.
23107 * cs-parser.jay: Track bases for structs. How did I get this wrong?
23109 2002-05-06 Ravi Pratap <ravi@ximian.com>
23111 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
23112 Revamp completely - make much cleaner as we now operate only
23115 (FindMostSpecificSource, FindMostSpecificTarget): New methods
23116 to implement the logic detailed in the spec more correctly.
23118 (UserDefinedConversion): Update accordingly.
23120 2002-05-06 Miguel de Icaza <miguel@ximian.com>
23122 * statement.cs: Return flow analysis information up.
23124 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
23127 (token): Do not consume an extra character before calling
23130 2002-05-06 Piers Haken <piersh@friskit.com>
23132 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
23134 2002-05-06 Miguel de Icaza <miguel@ximian.com>
23136 * class.cs (Constructor.Emit): Set the IsStatic flag in the
23137 EmitContext during the instance constructor initializer
23138 resolution, to stop access to instance variables.
23140 This is mandated by the spec, last paragraph of the `constructor
23141 initializers' section.
23143 2002-05-05 Miguel de Icaza <miguel@ximian.com>
23145 * cs-parser.jay, class.cs (Accessor): new class used to represent
23146 an accessor (get or set). In the past we used `null' to represent
23147 a missing accessor. But this is ambiguous because there was no
23148 way to tell in abstract indexers/properties if one of them was
23151 Now there is a way of addressing that.
23153 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
23154 instead of FindMembers.
23156 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
23157 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
23159 * attribute.cs: Treat indexers and properties as the same in terms
23160 of applying attributes
23162 * ecore.cs (FindMostEncompassedType): Use statically initialized
23163 EmptyExpressions()s like we do elsewhere to avoid creating useless
23164 objects (and we take this out of the tight loop).
23166 (GetConversionOperators): Move the code to extract the actual
23167 operators to a separate routine to clean things up.
23169 2002-05-04 Miguel de Icaza <miguel@ximian.com>
23171 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
23172 events are always registered FieldBuilders.
23174 * class.cs (FieldBase): New class shared by Fields
23176 * delegate.cs: If we are a toplevel delegate, use our full name.
23177 If we are a nested delegate, then only use our tail name.
23179 2002-05-02 Ravi Pratap <ravi@ximian.com>
23181 * expression.cs (IsApplicable): Ensure that we add the "&" to
23182 ref/out types before comparing it with the type of the argument.
23184 (IsParamsMethodApplicable): Ditto.
23186 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
23189 * delegate.cs : Handle the case when we have more than one applicable
23190 method. Flag an error only when we finish checking all.
23192 2002-05-02 Miguel de Icaza <miguel@ximian.com>
23194 * expression.cs: Add support for boolean static initializers.
23196 2002-05-01 Miguel de Icaza <miguel@ximian.com>
23198 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
23200 * parameter.cs (ComputeParameterTypes,
23201 ComputeAndDefineParameterTypes): Better error handling: now we
23202 clear the `types' cache if we fail during any of the type lookups.
23203 We also return the status code correctly to our caller
23205 * delegate.cs: If we fail to define a delegate, abort the extra
23208 * expression.cs (Binary.ResolveOperator): for
23209 operator==(object,object) and operator !=(object, object) we also
23210 have to verify that there is an implicit conversion from one to
23213 (ArrayAccess.DoResolve): Array Access can operate on
23216 2002-04-30 Miguel de Icaza <miguel@ximian.com>
23218 * assign.cs (CompoundAssign): A new class used as a "flag" that
23219 the assignment actually is happening as part of a compound
23220 assignment operator.
23222 During compound assignment, a few new rules exist to enable things
23229 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
23230 to the type of x) if y is implicitly convertible to the type of x,
23231 and the operator is a builtin operator and the return type of the
23232 operator is explicitly convertible to the type of x.
23234 * rootcontext.cs: Reset warning level to 2. 4 catches various
23235 "interesting" features in mcs, we must clean this up at some
23236 point, but currently am trying to kill other bugs ;-)
23238 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
23239 in container classes as well.
23241 * expression.cs (Binary.ResolveOperator): Handle string case
23242 before anything else (as operator overloading does emit an error
23243 before doing anything else).
23245 This code could go away when we move to a table driven model, but
23246 i could not come up with a good plan last night.
23248 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
23250 * typemanager.cs (CSharpName): reimplementation using regex.
23251 * class.cs: added null check for fields in Emit
23252 * rootcontext.cs: set warninglevel to 4
23254 2002-04-29 Miguel de Icaza <miguel@ximian.com>
23256 * typemanager.cs (CSharpName): reimplemented with Lupus
23259 2002-04-28 Miguel de Icaza <miguel@ximian.com>
23261 * statement.cs (If): correclty implement Resolve, because we were
23262 not catching sem errors in there. The same process is needed
23264 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
23267 (Statement.Warning_DeadCodeFound): Factorize code.
23268 (While): Report dead code here too.
23270 (Statement): Added Resolve virtual method to allow
23271 for resolution split from the emit code.
23273 2002-04-26 Miguel de Icaza <miguel@ximian.com>
23275 * statement.cs (EmitBoolExpression): No longer try to resolve the
23277 (MakeBoolean): New utility function that resolve, implicitly
23278 converts to boolean and tags the expression.
23281 (If, Do): Implement dead code elimination.
23282 (While): Implement loop inversion
23284 (Do, While, For, If): Resolve the expression prior to calling our
23287 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
23290 - added method Report28 (warning: program has more than one entry point)
23291 - added method IsEntryPoint, implements paragraph 10.1 of the spec
23292 - modified method Method.Define, the part at the end of the method
23294 * rootcontext.cs: added static public Location EntryPointLocation;
23296 * ../errors/cs0028.cs : Add test case for the above warning.
23299 - modified method CSharpName to allow arrays of primitive type to
23300 be printed nicely (e.g. instead of System.Int32[][] it now prints
23302 - added method CSharpSignature: returns the signature of a method
23303 in string format to be used in reporting errors, warnings, etc.
23305 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
23308 2002-04-26 Ravi Pratap <ravi@ximian.com>
23310 * delegate.cs (Define): Fix extremely silly bug where I was
23311 setting the type of the 'object' parameter of the BeginInvoke
23312 method to System.IAsyncResult instead of System.Object ;-)
23314 2002-04-26 Miguel de Icaza <miguel@ximian.com>
23316 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
23319 (Constructor.Emit): return if we fail to initialize the
23320 constructor. Another door closed!
23322 * expression.cs (New.DoResolve): Improve error message (from -6 to
23323 1501). Use DeclaredOnly lookup to find the exact constructor.
23325 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
23326 loop. This is useful.
23328 * cs-parser.jay: Adjust the default parameters so that destructors
23329 have the proper signature.
23331 2002-04-26 Martin Baulig <martin@gnome.org>
23333 * driver.cs (LoadAssembly): If `assembly' contains any characters
23334 which are only valid in path names and not in assembly names
23335 (currently slash, backslash and point), use Assembly.LoadFrom ()
23336 instead of Assembly.Load () on the `assembly' (before iteration
23337 over the link_paths).
23339 2002-04-26 Martin Baulig <martin@gnome.org>
23341 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
23343 2002-04-25 Miguel de Icaza <miguel@ximian.com>
23345 * class.cs (Property): use the new typemanager.MemberLookup
23347 (TypeContainer.MemberLookup): Implement using the
23348 TypeManager.MemberLookup now.
23350 * typemanager.cs: Make MemberLookup a function of the TypeManager,
23351 and return MemberInfos, so that these can be used without an
23352 EmitContext (what we had before).
23354 2002-04-24 Miguel de Icaza <miguel@ximian.com>
23356 * expression.cs: Fix the case where the argument to params if the
23357 type of the params. I omitted handling this before. Fixed
23359 2002-04-22 Miguel de Icaza <miguel@ximian.com>
23361 * driver.cs: Call BootCorlib_PopulateCoreType
23363 * class.cs (Property.CheckBase): Check for properties only, not
23366 * interface.cs: Temporary hack: try/catch around the
23367 CustomAttributeBuilder, because I am getting an exception that I
23370 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
23371 types whose definitions are required to be there (attributes are
23372 defined before standard types).
23374 Compute definitions as we boot the various types, as they are used
23375 immediately (value_type class will need object_type, but if we do
23376 not initialize object_type, we will pass a null, which will let
23377 the runtime pick the System.Object from the existing corlib, which
23378 is not what we want).
23380 2002-04-22 Patrik Torstensson <totte@labs2.com>
23382 * cs-tokenizer.cs: fixed a number of trim() issues.
23384 2002-04-22 Ravi Pratap <ravi@ximian.com>
23386 * expression.cs (Argument.Type): Ensure that we return the correct
23387 type when we have out or ref parameters [in which case we
23390 2002-04-22 Miguel de Icaza <miguel@ximian.com>
23392 * class.cs (Property, Indexer): Allow extern modifier in there.
23394 * typemanager.cs (InitBaseTypes): Initializes object_type and
23395 value_type, since those will be used early on during the bootstrap
23396 process to compile corlib.
23398 (InitCoreTypes): Move code from here to InitBaseTypes.
23400 2002-04-21 Miguel de Icaza <miguel@ximian.com>
23402 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
23403 single-dimension arrays as using the ldlen opcode.
23405 Daniel Lewis discovered this optimization.
23407 * typemanager.cs: Add signature for System.Array::get_Length
23409 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23411 * statement.cs: report the error when the foreach does not apply to an
23412 array nor a collection.
23414 2002-04-19 Miguel de Icaza <miguel@ximian.com>
23416 * expression.cs: Add implicit conversions to the operator ~.
23418 * constant.cs (DecimalConstant.Emit): Emit decimal value.
23420 * typemanager.cs: Locate the decimal constructor.
23422 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23424 * attribute.cs: use the new property of TypeOf.
23425 * expression.cs: added 'get' property around typearg.
23427 These changes fix a build breaker reported by NickD. Is this the
23428 correct way to fix? If not, please, revert my changes and make it
23431 2002-04-17 Miguel de Icaza <miguel@ximian.com>
23433 * attribute.cs: Add support for typeof in attribute invocations.
23434 I am not sure that this is right though.
23436 2002-04-14 Duncan Mak <duncan@ximian.com>
23438 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
23439 Binary.Operator.Division case.
23441 2002-04-13 Ravi Pratap <ravi@ximian.com>
23443 * class.cs (DefineType): Ensure that we do a proper check on
23444 attribute types and also register it with the TypeManager.
23446 (TypeContainer.Targets): The default for attribute types is
23447 AttributeTargets.All.
23449 * attribute.cs (ApplyAttributes): Registering the attribute type
23450 is done elsewhere, not when we discover we have a Usage attribute.
23452 2002-04-12 Ravi Pratap <ravi@ximian.com>
23454 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
23455 and get rid of is_delegate parameter.
23457 * everywhere : update.
23459 2002-04-12 Ravi Pratap <ravi@ximian.com>
23461 * cs-parser.jay (compilation_unit): Revamp completely to use
23462 some new ideas that I got from Rhys' grammar to solve the problems
23463 with assembly level attributes.
23465 (outer_declaration): New grammar production.
23467 (attribute_sections): Add.
23469 (opt_attributes): Base on attribute_sections
23471 (namespace_declaration): Allow opt_attributes to tackle the case
23472 when we have assembly level attributes - we are clever in this
23475 * attribute.cs (ApplyAttributes): Do not worry about assembly
23476 attributes in the non-global context.
23478 * rootcontext.cs (AddGlobalAttributes): Go back to using this
23479 instead of SetGlobalAttributes.
23481 * class.cs, rootcontext.cs : Ensure we define and generate
23482 attribute types before anything else.
23484 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
23485 and flag the new error -20 for the case when the attribute type
23486 does not have valid targets specified. csc does not catch this.
23488 * ../errors/errors.txt : update for error # -20
23490 2002-04-11 Ravi Pratap <ravi@ximian.com>
23492 * support.cs (InternalParameters.ParameterModifier): Do some null
23493 checking and return sane values.
23495 * class.cs (Method.Define): If we are a PInvoke method, ensure
23496 that we are static and extern. Report error # 601
23498 * ../errors/cs0601.cs : Add test case for the above error.
23500 2002-04-07 Ravi Pratap <ravi@ximian.com>
23502 * rootcontext.cs (attribute_types): We need to keep type of
23503 all attribute types separately and emit code for them first.
23505 (RegisterAttribute) : Implement.
23507 * class.cs (DefineType): Check if the current Type is a custom
23508 attribute type and register it accordingly.
23510 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
23511 adding the first attribute twice and rename to
23513 (SetGlobalAttributes): this.
23515 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
23518 * attribute.cs (ApplyAttributes): Take an additional argument telling us
23519 if we are processing global arguments. Hmm, I am unsure of this.
23521 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23523 * expression.cs: added static array of strings to avoid calling
23524 Enum.ToString () for Operator in Binary. Significant recover of
23527 2002-04-10 Miguel de Icaza <miguel@ximian.com>
23529 * class.cs (FindMembers): Allow the Builders of the various
23530 members to be null. If they are skip them. This only happens
23531 during the PInvoke declaration.
23533 2002-04-09 Miguel de Icaza <miguel@ximian.com>
23535 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
23536 failure, so we do not keep going afterwards.
23538 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
23539 wanted to pass `false' as the `is_delegate' argument. If this is
23540 the case, why not use delegate_type == null to mean `is_delegate =
23541 false' and anything else as is_delegate = true.
23543 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
23545 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
23546 code for the section, not the beginning of the tests.
23548 2002-04-08 Miguel de Icaza <miguel@ximian.com>
23550 * cfold.cs: Handle operator + (Enum x, Underlying x)
23552 * expression.cs (Binary): same. Warn about errors where we have
23553 Enum/Enum in operator + as well.
23555 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
23558 - added support for switch(bool)
23559 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
23560 - add TableSwitchEmit() to handle table-based switch statements
23562 2002-04-05 Ravi Pratap <ravi@ximian.com>
23564 * expression.cs (Invocation.OverloadResolve): Factor out code which
23565 does parameter compatibility checking with arguments so that we can
23566 re-use the code even from Delegate.VerifyApplicability
23568 (VerifyArgumentsCompat): Move above code here.
23570 * delegate.cs (VerifyApplicability): Get rid of duplicate code
23571 and instead make a call to the above method.
23573 2002-03-31 Ravi Pratap <ravi@ximian.com>
23575 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
23576 We use it to keep track of classes which are attribute types.
23578 2002-04-02 Miguel de Icaza <miguel@ximian.com>
23580 * delegate.cs (Delegate.Define): Correctly define the types in the
23581 presence of fixed and array parameters.
23583 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
23586 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
23587 include NonPublic after the first iteration.
23589 * class.cs (Indexer.CheckBase): Only check if both parents are
23592 * cs-parser.jay (accessor_body): If empty, set to null.
23594 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
23595 same code path here to resolve constants names that we did have in
23596 MemberAccess.DoResolve. There is too much code duplicated here.
23598 2002-04-01 Miguel de Icaza <miguel@ximian.com>
23600 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
23602 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
23605 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
23606 tokens, numbers and strings.
23608 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
23611 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
23612 asyncronous parameters and the regular parameters.
23614 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
23615 specify the target directory.
23617 * expression.cs: (This.DoResolve): Simplify
23618 (As.Emit): Optimize, do not generate IsInst if the expression is
23619 always of the given type.
23621 (Is.DoResolve): Bug fix, we were reporting both always/never for
23624 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
23625 creating too many unnecessary arrays.
23627 2002-03-31 Miguel de Icaza <miguel@ximian.com>
23629 * class.cs (EmitFieldInitializer): Use Assign expression to assign
23630 fields instead of rolling our own initializer. Takes care of all
23631 implicit conversions, and drops unnecessary static checks/argument.
23633 2002-03-31 Dick Porter <dick@ximian.com>
23635 * driver.cs: use the GetDirectories() return values properly, and
23636 use "/" as path separator.
23638 2002-03-30 Miguel de Icaza <miguel@ximian.com>
23640 * expression.cs (Unary): Optimize - - expr into expr.
23641 (Binary): Optimize a + (-b) into a -b.
23643 * codegen.cs (CodeGen): Made all methods static.
23645 2002-03-29 Miguel de Icaza <miguel@ximian.com>
23649 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
23650 TypeBuilder property.
23652 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
23655 * tree.cs: Removed the various RecordXXXX, and replaced with a
23656 single RecordDecl. Removed all the accessor methods, and just
23657 left a single access point Type
23659 * enum.cs: Rename DefineEnum to DefineType.
23661 * decl.cs: New abstract method `DefineType' used to unify the
23662 Defines for Enumerations, Interfaces, TypeContainers and
23665 (FindType): Moved LookupInterfaceOrClass here. Moved the
23666 LookupBaseClasses method that used to live in class.cs and
23667 interface.cs here, and renamed to FindType.
23669 * delegate.cs: Implement DefineType. Take advantage of the
23670 refactored pattern for locating the parent builder without taking
23671 the parent_builder argument (which we know does not work if we are
23672 nested, and triggering a toplevel definition).
23674 2002-03-28 Miguel de Icaza <miguel@ximian.com>
23676 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
23677 accessibility of a member has changed during override and report
23680 * class.cs (Method.Define, Property.Define): Only complain on
23681 overrides if the method is private, any other accessibility is
23682 fine (and since we just checked the permission is the same, we are
23685 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
23686 and elif are processed always. The other pre-processing
23687 directives are only processed if we are "taking" the path
23689 2002-03-29 Martin Baulig <martin@gnome.org>
23691 * class.cs (Method.Emit): Only emit symbolic debugging info if the
23692 current location is not Null.
23694 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
23695 a separate method so we can profile it.
23697 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
23698 `span.Seconds' are just seconds, but no minutes or hours.
23699 (MainDriver): Profile the CodeGen.SaveSymbols calls.
23701 2002-03-28 Miguel de Icaza <miguel@ximian.com>
23703 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
23704 Remove the gratuitous set of Final:
23706 // If an interface implementation, then we can set Final.
23707 if (((flags & MethodAttributes.Abstract) == 0) &&
23708 implementing.DeclaringType.IsInterface)
23709 flags |= MethodAttributes.Final;
23711 I do not know what I was smoking when I used that.
23714 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
23715 step into fixing the name resolution issues for delegates and
23716 unifying the toplevel name resolution.
23718 2002-03-28 Martin Baulig <martin@gnome.org>
23720 * class.cs (Method.Emit): If we have a symbol writer, call its
23721 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
23722 tell it about the current method.
23724 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
23725 writer that we're going to emit the first byte of IL code for a new
23726 statement (a new source line).
23727 (EmitContext.EmitTopBlock): If we have a symbol writer, call
23728 EmitContext.Mark() before emitting any code.
23730 * location.cs (SymbolDocument): Return null when we're Null.
23732 * statement.cs (Statement): Moved the `Location loc' variable here.
23733 (Statement.EmitBoolExpression): If we have a symbol writer, call
23734 ec.Mark() before emitting any code to tell it that we're at the
23735 beginning of a new statement.
23736 (StatementExpression): Added `Location' argument to the constructor.
23737 (Block): Added public readonly variable `StartLocation' and public
23738 variable `EndLocation'. The latter is to be set using SetEndLocation().
23739 (Block): Added constructor which takes a start and end location.
23740 (Block.SetEndLocation): New method. This sets the end location.
23741 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
23742 local variables we create.
23743 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
23744 each statement and do also mark the begin and end of the block.
23746 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
23747 tell it the current lexer.Location, use Location.Null for the end of the
23749 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
23750 current block, set its end location using SetEndLocation().
23751 (statement_expression): StatementExpression constructor now takes the
23752 lexer.Location as additional argument.
23753 (for_statement, declare_local_variables): Likewise.
23754 (declare_local_variables): When creating a new implicit block, use the
23755 new Block constructor and pass it the lexer.Location.
23757 2002-03-28 Miguel de Icaza <miguel@ximian.com>
23759 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
23760 members also on the parent interfaces recursively.
23762 2002-03-27 Miguel de Icaza <miguel@ximian.com>
23764 * report.cs: Use new formats, since Gonzalo finished the missing
23767 * expression.cs (Binary.ResolveOperator): added missing operator|
23768 operator& and operator^ for bool/bool.
23770 * cs-parser.jay: CheckDef now takes a Location argument that is
23771 used to report errors more precisly (instead of reporting the end
23772 of a definition, we try to track something which is a lot closer
23773 to the source of the problem).
23775 * cs-tokenizer.cs: Track global token use, so we can properly flag
23776 the use of #define/#undef after the first token has been seen.
23778 Also, rename the reportXXXX to Error_DescriptiveName
23780 * decl.cs (DeclSpace.IsTopLevel): Move property here from
23781 TypeContainer, so that Enum and Interface can use this too.
23783 * class.cs (TypeContainer.LookupInterfaceOrClass,
23784 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
23785 `builder' argument. Typically this was used to pass the parent
23786 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
23789 The problem is that a nested class could trigger the definition of
23790 a toplevel class, and the builder would be obviously wrong in that
23793 So we drop this argument, and we compute dynamically the
23794 TypeBuilder/ModuleBuilder (the correct information was available
23795 to us anyways from DeclSpace.Parent)
23797 * interface.cs (Interface.DefineInterface): Drop builder
23798 parameter cleanup like class.cs
23800 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
23803 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
23806 (Try.Emit): Propagate the returns value from the statement.
23808 (Return.Emit): Even if we are leavning
23810 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
23812 * modifiers.cs: Fix the computation of MethodAttributes flags.
23814 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
23816 * driver.cs: allow compilation of files that start with '/'.
23817 Add a default case when checking the argument of --target.
23819 2002-03-25 Miguel de Icaza <miguel@ximian.com>
23821 * interface.cs: Implement the same search algorithm for types in
23822 the interface code.
23824 * delegate.cs: Do not allow multiple definition.
23826 * Recovered ChangeLog that got accidentally amputated
23828 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
23830 * rootcontext.cs: Load manually enum to allow core classes to
23831 contain enumerations.
23833 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
23834 Update to new static methods in TypeManager.
23836 * typemanager.cs (GetMethod, GetConstructor): Use our
23837 implementation of FindMembers to find the members, since during
23838 corlib compilation, the types are TypeBuilders and GetMethod and
23839 GetConstructor do not work.
23841 Make all methods in TypeManager static.
23843 (InitCodeHelpers): Split the functionality from
23844 the InitCodeTypes function.
23846 * driver.cs: Call InitCodeHelpers after we have populated the
23849 * cs-parser.jay (delegate_declaration): we did not used to compute
23850 the delegate name correctly for void delegates.
23852 2002-03-24 Miguel de Icaza <miguel@ximian.com>
23854 * rootcontext.cs (RootContext): Init the interface_resolve_order
23855 and type_container_resolve_order always.
23857 (ResolveCore, BootstrapCorlib_ResolveClass,
23858 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
23859 compiler when compiling with --nostdlib
23861 * class.cs (TypeContainer.DefineType): Check that our parent is
23862 not null. This test is most important when we are bootstraping
23865 * codegen.cs: Split out the symbol writing code.
23867 2002-03-25 Martin Baulig <martin@gnome.org>
23869 * driver.cs (-g): Made -g an alias for --debug.
23871 2002-03-24 Martin Baulig <martin@gnome.org>
23873 * codegen.cs (SymbolWriter): New public variable. Returns the
23874 current symbol writer.
23875 (CodeGen): Added `bool want_debugging_support' argument to the
23876 constructor. If true, tell the ModuleBuild that we want debugging
23877 support and ask it for the ISymbolWriter.
23878 (Save): If we have a symbol writer, call it's Close() method after
23879 saving the assembly.
23881 * driver.c (--debug): New command line argument to create a
23882 debugger information file.
23884 * location.cs (SymbolDocument): New public property. Returns an
23885 ISymbolDocumentWriter object for the current source file or null
23886 if we don't have a symbol writer.
23888 2002-03-21 Miguel de Icaza <miguel@ximian.com>
23890 * driver.cs (LoadAssembly): Correctly return when all the paths
23891 have been tried and not before.
23893 * statement.cs (Switch.Emit): return the actual coverage for this
23894 statement (returns/not-returns)
23896 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
23897 switch of the statement if we are the last switch section. That
23898 kills two problems: try/catch problems (we used to emit an empty
23899 nop at the end) and switch statements where all branches would
23902 2002-03-19 Miguel de Icaza <miguel@ximian.com>
23904 * driver.cs: Add default assemblies (the equivalent to the
23905 Microsoft CSC.RSP file)
23907 * cs-tokenizer.cs: When updating `cols and setting it to zero,
23908 also update tokens_seen and set it to false.
23910 * driver.cs: Implement --recurse for Mike.
23912 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
23913 correctly splitting out the paths.
23915 2002-03-18 Miguel de Icaza <miguel@ximian.com>
23917 * interface.cs (Interface.PopulateProperty): Instead of using
23918 `parent' as the declaration space for the set parameters, use
23921 * support.cs (InternalParameters): InternalParameters constructor
23922 takes a DeclSpace instead of a TypeContainer.
23924 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
23925 types are being initialized, load the address of it before calling
23928 (New): Provide a mechanism to disable the generation of local
23929 value type temporaries when the caller will be providing us with
23930 an address to store it.
23932 (ArrayCreation.EmitDynamicInitializers): Use it.
23934 2002-03-17 Miguel de Icaza <miguel@ximian.com>
23936 * expression.cs (Invocation.EmitArguments): Only probe for array
23937 property if there is more than one argument. Sorry about that.
23939 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
23940 empty param arrays.
23942 * class.cs (Method.LabelParameters): Fix incorrect code path that
23943 prevented the `ParamArrayAttribute' from being applied to the
23946 2002-03-16 Miguel de Icaza <miguel@ximian.com>
23948 * support.cs (ReflectionParameters): Correctly compute whether the
23949 last argument is a params array. Fixes the problem with
23952 * typemanager.cs: Make the assemblies array always be non-null
23953 (empty, but non-null)
23955 * tree.cs (RecordDecl): New function that abstracts the recording
23956 of names. This reports error 101, and provides a pointer to the
23957 previous declaration. Fixes a crash in the compiler.
23959 * cs-parser.jay (constructor_declaration): Update to new grammar,
23960 and provide a constructor_body that can be empty.
23962 2002-03-15 Miguel de Icaza <miguel@ximian.com>
23964 * driver.cs: Add support for --resources.
23966 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
23967 Make all types for the various array helper methods be integer.
23969 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
23970 CheckState to ConvCast.
23972 (ConvCast): Now it takes a `checked' state argument, to avoid
23973 depending on the emit context for the conversion, and just using
23974 the resolve time setting.
23976 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
23977 instead of Invocation.EmitArguments. We do not emit the original
23978 arguments, instead we emit those which have been converted to
23979 unsigned int expressions.
23981 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
23983 * codegen.cs: ditto.
23985 * expression.cs (LocalVariableReference): Drop the use of the
23986 Store function that depended on the variable index.
23988 * statement.cs (VariableInfo): Drop the `Idx' property from this
23989 class, as this is not taking into account the indexes for
23990 temporaries tat we generate during the execution, getting the
23993 * class.cs: First emit class initializers, then call the parent
23996 * expression.cs (Binary): Fix opcode emision.
23997 (UnaryMutator.EmitCode): Support checked code generation
23999 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
24000 matches for events for both the Static and Instance scans,
24001 pointing to the same element. Fix that.
24003 2002-03-14 Miguel de Icaza <miguel@ximian.com>
24005 * rootcontext.cs (ResolveTree): Always set the
24006 interface_resolve_order, because nested interfaces will be calling
24009 * class.cs (GetInterfaceOrClass): Track the same resolution
24010 process used by TypeManager.LookupType. This fixes the nested
24011 type lookups in class declarations (separate path from
24014 (TypeContainer.DefineType): Also define nested interfaces.
24015 (TypeContainer.RegisterOrder): New public function used to
24016 register the order in which child interfaces need to be closed.
24018 Nested interfaces need to be closed after their parents have been
24021 * interface.cs (InterfaceAttr): Put all the logic for computing
24022 the interface attribute here.
24024 (DefineInterface): Register our interface order with the
24025 RootContext or with the TypeContainer depending on the case.
24027 2002-03-12 Miguel de Icaza <miguel@ximian.com>
24029 * cs-parser.jay: rework foreach statement to work with the new
24030 changes to the policy on SimpleNames.
24032 * report.cs: support Stacktrace on warnings as well.
24034 * makefile: drop --unsafe and /unsafe from the compile.
24036 2002-03-13 Ravi Pratap <ravi@ximian.com>
24038 * ecore.cs (StandardConversionExists): Modify to take an Expression
24039 as the first parameter. Ensure we do null -> reference type conversion
24042 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
24043 temporary Expression objects.
24045 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
24047 * interface.cs: workaround bug in method overloading resolution
24048 (there is already a bugzilla bug for it).
24050 2002-03-12 Miguel de Icaza <miguel@ximian.com>
24052 We could also solve this problem by having a separate path for
24053 performing type lookups, instead of DoResolve, we could have a
24054 ResolveType entry point, and only participating pieces of the
24055 production (simplename, deref, array) would implement this.
24057 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
24058 signal SimpleName to only resolve type names and not attempt to
24059 resolve anything else.
24061 * expression.cs (Cast): Set the flag.
24063 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
24065 * class.cs: Only report 108 if there is no `new' modifier.
24067 * cs-parser.jay: rework foreach statement to work with the new
24068 changes to the policy on SimpleNames.
24070 * report.cs: support Stacktrace on warnings as well.
24072 * makefile: drop --unsafe and /unsafe from the compile.
24074 2002-03-11 Miguel de Icaza <miguel@ximian.com>
24076 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
24077 lookups here, instead of doing that at parse time. This means
24078 that our grammar will not introduce `LocalVariableReferences' as
24079 expressions at this point. That solves the problem of code like
24083 static void Main ()
24087 This is only half the fix. The full fix requires parameters to
24088 also be handled in this way.
24090 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
24091 makes the use more obvious of the DeclSpace. The
24092 ec.TypeContainer.TypeBuilder is now only used to pull the
24093 TypeBuilder for it.
24095 My theory is that I can get rid of the TypeBuilder completely from
24096 the EmitContext, and have typecasts where it is used (from
24097 DeclSpace to where it matters).
24099 The only pending problem is that the code that implements Aliases
24100 is on TypeContainer, and probably should go in DeclSpace.
24102 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
24103 lookups here, instead of doing that at parse time. This means
24104 that our grammar will not introduce `LocalVariableReferences' as
24105 expressions at this point. That solves the problem of code like
24109 static void Main ()
24113 This is only half the fix. The full fix requires parameters to
24114 also be handled in this way.
24116 * class.cs (Property.DefineMethod): When implementing an interface
24117 method, set newslot, when implementing an abstract method, do not
24118 set the flag (before we tried never setting it, or always setting
24119 it, which is the difference).
24120 (Indexer.DefineMethod): same.
24121 (Method.DefineMethod): same.
24123 * ecore.cs: Only set the status used flag if we get back a Field.
24125 * attribute.cs: Temporary hack, so Paolo can keep working.
24127 2002-03-08 Ravi Pratap <ravi@ximian.com>
24129 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
24130 the unmanaged type in the case we have a MarshalAs attribute.
24132 (Resolve): Handle the case when we are parsing the special MarshalAs
24133 attribute [we need to store the unmanaged type to use later]
24135 * typemanager.cs (marshal_as_attr_type): Built in type for the
24136 MarshalAs Attribute.
24138 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
24139 on parameters and accordingly set the marshalling info.
24141 2002-03-09 Miguel de Icaza <miguel@ximian.com>
24143 * class.cs: Optimizing slightly by removing redundant code after
24144 we switched to the `NoTypes' return value.
24145 (Property.DefineMethod): use NoTypes here too.
24147 This fixes the bug I introduced in my last batch of changes.
24149 2002-03-05 Ravi Pratap <ravi@ximian.com>
24151 * tree.cs (RecordEnum): Add. We now keep track of enums too.
24153 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
24154 Enums since those are types too.
24156 * cs-parser.jay (enum_declaration): Record enums as we parse them.
24158 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
24159 thanks to a call during the lookup process.
24161 2002-03-07 Miguel de Icaza <miguel@ximian.com>
24163 * statement.cs (Foreach): Lots of work to accomodate a particular
24164 kind of foreach statement that I had not kept in mind. It is
24165 possible to have foreachs on classes that provide a GetEnumerator
24166 method that return objects that implement the "pattern" for using
24167 a foreach, there is no need to support GetEnumerator
24170 This is needed to compile nant.
24172 * decl.cs: Only report 114 if the member is not `Finalize' and if
24173 the warning level is at least 2.
24175 * class.cs: Moved the compare function from Method to
24178 (MethodSignature.InheritableMemberSignatureCompare): Add new
24179 filter function that is used to extract inheritable methods from a
24182 (Method.Define): Use the new `inheritable_method_signature_filter'
24185 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
24188 2002-03-06 Miguel de Icaza <miguel@ximian.com>
24190 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
24192 * cs-parser.jay: Add opt_semicolon to the interface declaration.
24194 * expression.cs: Pass location information to
24195 ConvertImplicitStandard.
24197 * class.cs: Added debugging code to track return values from
24200 2002-03-05 Miguel de Icaza <miguel@ximian.com>
24202 * expression.cs (Is.DoResolve): If either side of the `is' is an
24203 interface, do not flag the warning.
24205 * ecore.cs (ImplicitReferenceConversion): We need a separate test
24208 * report.cs: Allow for --fatal to be used with --probe.
24210 * typemanager.cs (NoTypes): Move the definition for the empty Type
24213 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
24215 (TypeContainer.DefineProxy): New function used to proxy to parent
24216 implementations when implementing interfaces.
24217 (TypeContainer.ParentImplements): used to lookup if our parent
24218 implements a public function that is required by an interface.
24219 (TypeContainer.VerifyPendingMethods): Hook this up.
24221 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
24222 `modules' and `assemblies' arraylists into arrays. We only grow
24223 these are the very early start up of the program, so this improves
24224 the speedof LookupType (nicely measured).
24226 * expression.cs (MakeByteBlob): Replaced unsafe code with
24227 BitConverter, as suggested by Paolo.
24229 * cfold.cs (ConstantFold.Binary): Special case: perform constant
24230 folding of string concatenation, but if either side is a string,
24231 and the other is not, then return null, and let the runtime use
24232 the concatenation on the string plus the object (using
24233 `Object.ToString').
24235 2002-03-04 Miguel de Icaza <miguel@ximian.com>
24237 Constant Folding has been implemented now.
24239 * expression.cs (Unary.Reduce): Do not throw an exception, catch
24240 the error instead on types that are not supported in one's
24243 * constant.cs (Constant and all children): New set of functions to
24244 perform implict and explicit conversions.
24246 * ecore.cs (EnumConstant): Implement the new functions to perform
24247 conversion by proxying to the child expression.
24249 * codegen.cs: (ConstantCheckState): Constant evaluation has its
24250 own separate setting that can not be turned off from the command
24251 line using --unchecked or --checked and is only controlled using
24252 the checked/unchecked statements and expressions. This setting is
24253 used by the constant folder to flag errors.
24255 * expression.cs (CheckedExpr, UncheckedExpr): Set the
24256 ConstantCheckState as well.
24258 During Resolve, they also have to flag the state, because the
24259 constant folder runs completely in the Resolve phase.
24261 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
24264 2002-03-01 Miguel de Icaza <miguel@ximian.com>
24266 * cfold.cs: New file, this file contains the constant folder.
24268 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
24269 argument to track whether we are using the resulting address to
24270 load or store a value and provide better error messages.
24272 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
24273 new AddressOf arguments.
24275 * statement.cs (Foreach.EmitCollectionForeach): Update
24277 * expression.cs (Argument.Emit): Call AddressOf with proper
24278 arguments to track usage.
24280 (New.DoEmit): Call AddressOf with new arguments.
24282 (Unary.Emit): Adjust AddressOf call.
24284 2002-03-01 Ravi Pratap <ravi@ximian.com>
24286 * cs-parser.jay (member_access): Change the case for pre-defined types
24287 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
24290 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
24293 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
24294 essentially like methods and apply attributes like MethodImplOptions to them too.
24296 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
24299 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
24300 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
24303 * Update code everywhere accordingly.
24305 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
24307 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
24309 2002-02-28 Ravi Pratap <ravi@ximian.com>
24311 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
24312 try performing lookups against those instead of jumping straight into using
24313 the 'using' clauses.
24315 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
24317 (LookupType): Perform lookups in implicit parents too.
24319 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
24320 sequence as RootContext.LookupType.
24322 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
24323 the various cases of namespace lookups into this method.
24325 2002-03-01 Miguel de Icaza <miguel@ximian.com>
24327 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
24328 in positional arguments)
24330 * class.cs (Operator): Update the AllowedModifiers to contain
24333 * cs-parser.jay: Update operator declaration to allow for the
24334 operator body to be empty.
24336 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
24339 2002-02-27 Miguel de Icaza <miguel@ximian.com>
24341 * class.cs (Method.Emit): Label parameters.
24343 * driver.cs: Return 1 or 0 as the program exit code.
24345 2002-02-26 Miguel de Icaza <miguel@ximian.com>
24347 * expression.cs: Special case the `null' object when trying to
24348 auto-compute the type, as anything can be explicitly converted to
24351 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
24352 spotting this Paolo.
24354 (Expression.ImplicitNumericConversion): Perform comparissions of
24355 the type using the underlying type in the case of an enumeration
24356 rather than using the enumeration type for the compare.
24358 Cope with the underlying == type case, which is not possible to
24361 (Expression.ConvertNumericExplicit): Perform comparissions of
24362 the type using the underlying type in the case of an enumeration
24363 rather than using the enumeration type for the compare.
24365 * driver.cs: If the user does not supply an extension, assume .exe
24367 * cs-parser.jay (if_statement): Rewrote so that we can track the
24368 location for the if statement.
24370 * expression.cs (Binary.ConstantFold): Only concat strings when
24371 the operation is "+", not everything ;-)
24373 * statement.cs (Statement.EmitBoolExpression): Take a location
24375 (If, While, Do): Track location.
24377 * expression.cs (Binary.ResolveOperator): In the object + string
24378 case, I was missing a call to ConvertImplicit
24380 2002-02-25 Ravi Pratap <ravi@ximian.com>
24382 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
24383 Location arguments. Ensure we use RootContext.LookupType to do our work
24384 and not try to do a direct Type.GetType and ModuleBuilder.GetType
24386 * interface.cs (PopulateMethod): Handle the type of the parameter being
24389 * expression.cs (Invocation.BetterFunction): Handle the case when we
24390 have a params method with no fixed arguments and a call is made with no
24393 2002-02-25 Miguel de Icaza <miguel@ximian.com>
24395 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
24396 the verbatim-string-literal
24398 * support.cs (InternalParameters.ParameterModifier): handle null
24400 (InternalParameters.ParameterType): ditto.
24402 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
24403 duplicating the name of the variable parameter.
24404 (GetParameterByName): Fix bug where we were not looking up array
24405 paramters if they were the only present (thanks Paolo!).
24406 (GetParameterInfo): We only have an empty set of types if both
24407 fixed and array are set to null.
24408 (GetParameterInfo-idx): Handle FixedParameter == null
24410 * cs-parser.jay: Handle the case where there is no catch
24411 statements (missing null test).
24413 2002-02-22 Miguel de Icaza <miguel@ximian.com>
24415 * driver.cs (MainDriver): Be conservative on our command line
24418 Catch DirectoryNotFoundException when calling GetFiles.
24420 (SplitPathAndPattern): Used to split the input specification into
24421 a path and a pattern that we can feed to Directory.GetFiles.
24423 2002-02-21 Miguel de Icaza <miguel@ximian.com>
24425 * statement.cs (Fixed): Implement the last case of the Fixed
24426 statement (string handling).
24428 * expression.cs (StringPtr): New class used to return a char * to
24429 a string; Used by the Fixed statement.
24431 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
24433 * expression.cs (Binary.ResolveOperator): Remove redundant
24434 MemberLookup pn parent type.
24435 Optimize union call, we do not need a union if the types are the same.
24436 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
24439 Specialize the use of MemberLookup everywhere, instead of using
24440 the default settings.
24442 (StackAlloc): Implement stackalloc keyword.
24444 * cs-parser.jay: Add rule to parse stackalloc.
24446 * driver.cs: Handle /h, /help, /?
24448 * expression.cs (MakeByteBlob): Removed the hacks we had in place
24449 before we supported unsafe code.
24451 * makefile: add --unsafe to the self compilation of mcs.
24453 2002-02-20 Miguel de Icaza <miguel@ximian.com>
24455 * expression.cs (PointerArithmetic): New class that is used to
24456 perform pointer arithmetic.
24457 (Binary.Resolve): Handle pointer arithmetic
24458 Handle pointer comparission.
24459 (ArrayPtr): Utility expression class that is used to take the
24460 address of an array.
24462 (ElementAccess): Implement array access for pointers
24464 * statement.cs (Fixed): Implement fixed statement for arrays, we
24465 are missing one more case before we are done.
24467 * expression.cs (Indirection): Implement EmitAssign and set the
24468 ExprClass to Variable. This allows pointer dereferences to be
24469 treated as variables, and to have values assigned to them.
24471 * ecore.cs (Expression.StoreFromPtr): New utility function to
24472 store values dereferencing.
24474 2002-02-20 Ravi Pratap <ravi@ximian.com>
24476 * expression.cs (Binary.ResolveOperator): Ensure that we are
24477 not trying to operate on a void type - this fixes the reported
24480 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
24481 the parent implementation is sealed.
24483 * ../errors/cs0239.cs : Add.
24485 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
24487 * typemanager.cs (unverifiable_code_type): Corresponds to
24488 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
24489 which have unsafe code in them.
24491 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
24494 2002-02-19 Miguel de Icaza <miguel@ximian.com>
24496 * cs-tokenizer.cs: Add support for @"litreal strings"
24498 Make tokenizer accept pre-processor directives
24499 on any column (remove the old C-like limitation).
24501 * rootcontext.cs (EmitCode): Emit any global attributes.
24502 (AddGlobalAttributes): Used to keep track of assembly attributes.
24504 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
24506 * cs-parser.jay: Add support for global attributes.
24508 2002-02-17 Miguel de Icaza <miguel@ximian.com>
24510 * expression.cs (Indirection): New helper class. Unary will
24511 create Indirection classes to be able to implement the
24512 IMemoryLocation interface on it.
24514 2002-02-16 Miguel de Icaza <miguel@ximian.com>
24516 * cs-parser.jay (fixed_statement): reference the right statement.
24518 * statement.cs (Fixed.Emit): Finish implementing the fixed
24519 statement for the &x case.
24521 2002-02-14 Miguel de Icaza <miguel@ximian.com>
24523 * class.cs (Property.Define, Method.Define): Remove newslot when
24526 * modifiers.cs: My use of NewSlot when `Abstract' was set was
24527 wrong. NewSlot should only be used if the `new' keyword is present.
24529 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
24530 locating our system dir. Sorry about this.
24532 2002-02-13 Miguel de Icaza <miguel@ximian.com>
24534 * driver.cs (GetSystemDir): Compute correctly the location of our
24535 system assemblies. I was using the compiler directory instead of
24536 the library directory.
24538 2002-02-13 Ravi Pratap <ravi@ximian.com>
24540 * expression.cs (BetterFunction): Put back in what Miguel commented out
24541 since it is the correct fix. The problem is elsewhere ;-)
24543 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
24544 parameters of the parms method are themselves compatible or not !
24546 (StandardConversionExists): Fix very dangerous bug where we were forgetting
24547 to check that a class implements an interface before saying that an implicit
24548 conversion was allowed. Use ImplementsInterface to do the checking.
24550 2002-02-13 Miguel de Icaza <miguel@ximian.com>
24552 * class.cs (Method.Define): Track whether we are an explicit
24553 implementation or not. And only call DefineMethodOverride if we
24554 are an explicit implementation.
24556 (Property.DefineMethod): Ditto.
24558 2002-02-11 Ravi Pratap <ravi@ximian.com>
24560 * expression.cs (BetterFunction): Catch hideous bug which was
24561 preventing us from detecting ambiguous calls due to implicit casts i.e
24564 2002-01-29 Miguel de Icaza <miguel@ximian.com>
24566 * support.cs (Pair): Remove un-needed method. I figured why I was
24567 getting the error in cs-parser.jay, the variable in a foreach loop
24568 is readonly, and the compiler does not really treat this as a variable.
24570 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
24571 instead of EQUALS in grammar.
24573 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
24575 * expression.cs (Unary.DoResolve): Check whether the argument is
24578 2002-01-28 Miguel de Icaza <miguel@ximian.com>
24580 * support.cs: Api for Pair to set a value. Despite the fact that
24581 the variables are public the MS C# compiler refuses to compile
24582 code that accesses the field if the variable is part of a foreach
24585 * statement.cs (Fixed): Begin implementation of the fixed
24588 (Block.AddVariable): Return the VariableInfo on success and null
24589 on failure instead of true/false.
24591 * cs-parser.jay (foreach): Catch errors on variables already
24592 defined (we were ignoring this value before) and properly unwind
24593 the block hierarchy
24595 (fixed_statement): grammar for the fixed statement.
24597 2002-01-25 Miguel de Icaza <miguel@ximian.com>
24599 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
24600 pointer types to be incretemented.
24602 (SizeOf): Implement.
24604 * cs-parser.jay (pointer_member_access): Implement
24605 expr->IDENTIFIER production.
24607 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
24608 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
24611 (Unary): Implement indirection.
24613 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
24614 use in non-unsafe context).
24616 (SimpleName.DoResolve): Check for pointers in field access on safe
24619 (Expression.LoadFromPtr): Factor the load-indirect code in this
24620 function. This was duplicated in UnboxCast and ParameterReference
24622 2002-01-24 Miguel de Icaza <miguel@ximian.com>
24624 * expression.cs (ComposedCast): report an error if a pointer cast
24625 is used in a safe region.
24627 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
24628 pointer type casts in unsafe context.
24630 * codegen.cs (EmitContext): Set up IsUnsafe.
24632 * cs-parser.jay (non_expression_type): Add productions for pointer
24635 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
24636 code. We should not use force into static mode if the method is
24637 not virtual. Fixes bug in MIS
24639 * statement.cs (Do.Emit, While.Emit, For.Emit,
24640 Statement.EmitBoolExpression): Add support to Do and While to
24641 propagate infinite loop as `I do return' semantics.
24643 Improve the For case to also test for boolean constants.
24645 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
24646 to the list of attributes we can add.
24648 Remove `EmitContext' argument.
24650 * class.cs (Method.Define): Apply parameter attributes.
24651 (Constructor.Define): Apply parameter attributes.
24652 (MethodCore.LabelParameters): Move here the core of labeling
24655 * support.cs (ReflectionParameters.ParameterModifier,
24656 InternalParameters.ParameterModifier): Use IsByRef on the type and
24657 only return the OUT bit for these parameters instead of in/out/ref
24660 This is because I miss-understood things. The ParameterInfo.IsIn
24661 and IsOut represent whether the parameter has the [In] and [Out]
24664 2002-01-22 Miguel de Icaza <miguel@ximian.com>
24666 * ecore.cs (FieldExpr.Emit): Release temporaries.
24668 * assign.cs (LocalTemporary.Release): new function.
24670 * codegen.cs (EmitContext.GetTemporaryStorage,
24671 EmitContext.FreeTemporaryStorage): Rework the way we deal with
24672 temporary storage. Now we can "put back" localbuilders when we
24675 2002-01-21 Miguel de Icaza <miguel@ximian.com>
24677 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
24678 need to make a copy of the variable to generate verifiable code.
24680 2002-01-19 Miguel de Icaza <miguel@ximian.com>
24682 * driver.cs: Compute dynamically the system directory.
24684 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
24685 Slower, but more generally useful. Used by the abstract
24686 registering implementation.
24688 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
24689 the rules for the special rule on Type/instances. First check if
24690 we have the same name, and if so, try that special static path
24691 rather than the instance path.
24693 2002-01-18 Miguel de Icaza <miguel@ximian.com>
24695 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
24698 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
24699 Enum, ValueType, Delegate or Array for non-corlib compiles.
24701 * cs-tokenizer.cs: Catch long identifiers (645)
24703 * typemanager.cs (IndexerPropetyName): Ravi never tested this
24706 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
24707 fix, we were returning too early, so we were not registering
24708 pending methods from abstract classes.
24710 Do not register pending methods if the class is abstract.
24712 * expression.cs (Conditional.DoResolve): Report circular implicit
24713 conversions when we neecd to compute it for conditional
24716 (Is.DoResolve): If the expression is always of the provided type,
24717 flag warning 183. If the expression can not ever be of the
24718 provided type flag warning 184.
24720 * class.cs: Catch 169 as well.
24722 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
24725 2002-01-18 Nick Drochak <ndrochak@gol.com>
24727 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
24729 2002-01-17 Miguel de Icaza <miguel@ximian.com>
24731 * interface.cs: (PopulateMethod): Check for pointers being defined
24732 only if the unsafe context is active.
24733 (PopulateProperty): ditto.
24734 (PopulateIndexer): ditto.
24736 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
24737 specified. If pointers are present, make sure that they are
24738 present in an unsafe context.
24739 (Constructor, Constructor.Define): ditto.
24740 (Field, Field.Define): ditto.
24741 (Property, Property.Define): ditto.
24742 (Event, Event.Define): ditto.
24744 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
24745 hashtable if there are classes or structs defined.
24747 * expression.cs (LocalVariableReference.DoResolve): Simplify this
24748 code, as the constant resolution moved.
24750 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
24751 the metadata, so we can flag error 133.
24753 * decl.cs (MemberCore.UnsafeOK): New function to test that a
24754 pointer is being declared in an unsafe context.
24756 2002-01-16 Miguel de Icaza <miguel@ximian.com>
24758 * modifiers.cs (Modifiers.Check): Require a Location argument.
24759 Report error 227 for Unsafe use.
24761 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
24763 * statement.cs (For.Emit): If the test is null, then report that
24764 we do `return', as we wont reach anything afterwards.
24766 (Switch.SwitchGoverningType): Track the expression that matched
24769 * driver.cs: Allow negative numbers as an error code to flag.
24771 * cs-parser.jay: Handle 1551.
24773 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
24775 2002-01-15 Miguel de Icaza <miguel@ximian.com>
24777 * cs-parser.jay: Report 1518 (type declaration can only contain
24778 class, struct, interface, enum or delegate)
24780 (switch_label): Report 1523 (keywords `case' or `default' must
24783 (opt_switch_sections): Report 1522 (empty switch)
24785 * driver.cs: Report 1515 (response file specified multiple times)
24786 Report 1516 (Source file specified multiple times).
24788 * expression.cs (Argument.Resolve): Signal 1510
24790 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
24791 access not allowed in static code)
24793 2002-01-11 Ravi Pratap <ravi@ximian.com>
24795 * typemanager.cs (IsPointerType): Utility method which we are going
24798 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
24799 the object type, so we take care of that.
24801 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
24803 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
24804 added to non-params parameters :-)
24806 * typemanager.cs (CSharpName): Include 'void' type too.
24808 (void_ptr_type): Include in the set of core types.
24810 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
24813 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
24816 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
24817 completely forgotten about it.
24819 2002-01-10 Ravi Pratap <ravi@ximian.com>
24821 * cs-parser.jay (pointer_type): Add. This begins our implementation
24822 of parsing rules for unsafe code.
24824 (unsafe_statement): Implement.
24826 (embedded_statement): Modify to include the above.
24828 * statement.cs (Unsafe): Implement new class for unsafe blocks.
24830 * codegen.cs (EmitContext.InUnsafe): Add. This determines
24831 if the current context is an unsafe one.
24833 * cs-parser.jay (local_variable_pointer_type): Since local variable types
24834 are handled differently, we need separate rules for them.
24836 (local_variable_declaration): Update to use local_variable_pointer_type
24837 to allow variable declarations of unmanaged pointer types.
24839 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
24840 in unsafe contexts.
24842 * ../errors/cs0214.cs : Add.
24844 2002-01-16 Nick Drochak <ndrochak@gol.com>
24846 * makefile: remove 'response' file when cleaning.
24848 2002-01-15 Miguel de Icaza <miguel@ximian.com>
24850 * cs-parser.jay: Report 1524.
24852 2002-01-14 Miguel de Icaza <miguel@ximian.com>
24854 * typemanager.cs (RegisterMethod): drop checking if we have
24855 registered this from here
24857 2002-01-12 Miguel de Icaza <miguel@ximian.com>
24859 * class.cs (Method.EmitDestructor): Implement calling our base
24862 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
24863 value of InFinally.
24865 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
24866 this routine and will wrap the call in a try/catch block. Deal
24869 2002-01-11 Miguel de Icaza <miguel@ximian.com>
24871 * ecore.cs (Expression.MemberLookup): instead of taking a
24872 parameter `same_type' that was used to tell whether we could
24873 access private members we compute our containing type from the
24876 (FieldExpr): Added partial support for volatile fields. This does
24877 not work for volatile fields exposed from assemblies, as I can not
24878 figure out how to extract the modreq from it.
24880 Updated all the source files to use this.
24882 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
24883 because it is referenced by MemberLookup very often.
24885 2002-01-09 Ravi Pratap <ravi@ximian.com>
24887 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
24888 TypeBuilder.GetCustomAttributes to retrieve what we need.
24890 Get rid of redundant default_member_attr_type as this is the same as
24891 default_member_type which already exists.
24893 * interface.cs, attribute.cs : Update accordingly.
24895 2002-01-08 Miguel de Icaza <miguel@ximian.com>
24897 * typemanager.cs: Enable IndexerPropertyName again. It does not
24898 work for TYpeBuilders though. Ravi, can you please fix this?
24900 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
24902 * expression.cs (Argument.Emit): Handle the case of ref objects
24903 being passed to ref functions;
24905 (ParameterReference.EmitLoad): Loads the content of the pointer
24906 without dereferencing.
24908 2002-01-07 Miguel de Icaza <miguel@ximian.com>
24910 * cs-tokenizer.cs: Implemented the pre-processing expressions.
24912 2002-01-08 Ravi Pratap <ravi@ximian.com>
24914 * class.cs (Indexer.DefineMethod): Incorporate the interface
24915 type in the name of the method if we are doing explicit interface
24918 * expression.cs (ConversionExists): Remove as it is completely obsolete.
24920 (BetterConversion): Fix extremely trivial bug where we were referring to
24921 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
24924 * ../errors/bug16.cs : Add although we have fixed it.
24926 2002-01-07 Miguel de Icaza <miguel@ximian.com>
24928 * expression.cs (BaseIndexer): Begin implementation.
24930 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
24932 * cs-parser.jay (indexer_declarator): Use qualified_identifier
24933 production directly to remove a shift/reduce, and implement
24934 explicit interface implementation.
24936 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
24937 after a floating point suffix.
24939 * expression.cs (DoNumericPromotions): Improved the conversion for
24940 uint/uint. If we have a constant, we avoid doing a typecast to a
24943 * class.cs (Indexer): Implement explicit interface implementation
24946 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
24948 * class.cs: make the default instance constructor public and hidebysig.
24950 2001-01-03 Ravi Pratap <ravi@ximian.com>
24952 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
24953 so we can call it from elsewhere.
24955 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
24956 we emit it internally if the class has a defined indexer; otherwise the user
24957 emits it by decorating the class definition with the DefaultMemberAttribute.
24959 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
24960 attribute is not used on a type which defines an indexer.
24962 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
24963 character when we skip whitespace.
24965 * ../errors/cs0646.cs : Add.
24967 2002-01-03 Miguel de Icaza <miguel@ximian.com>
24969 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
24972 * makefile: Add practical target `mcs3.exe' which builds the third
24973 generation compiler.
24975 * expression.cs (New): Fix structures constructor calling.
24977 * class.cs (Property, Method, Indexer): Emit Final flag on the
24978 method if we are an interface implementation and we are not
24981 * ecore.cs (PropertyExpr): New public field `IsBase', tells
24982 whether this property is referencing a `base' method.
24984 * expression.cs (Invocation.EmitCall): take an extra argument:
24985 is_base, this is used to determine whether the `call' or
24986 `callvirt' opcode should be used.
24989 * delegate.cs: update EmitCall.
24991 * class.cs (Method.Define): Set NewSlot for the cases where we are
24992 not implementing an interface method.
24994 (Property.Define): ditto.
24996 2002-01-02 Miguel de Icaza <miguel@ximian.com>
24998 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
24999 'r'. Allows mcs to parse itself fully.
25001 2002-01-02 Ravi Pratap <ravi@ximian.com>
25003 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
25004 of the number of initializers that require the InitializeArray method.
25006 (CheckIndices): Store the Expression in all cases - not the plain value. Also
25007 update the above field where necessary.
25009 (MakeByteBlob): Update accordingly.
25011 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
25014 (EmitDynamicInitializers): Update in accordance with the new optimization.
25016 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
25017 same OpCode applies.
25019 * cs-parser.jay : Fix some glaring errors I introduced.
25021 2002-01-01 Ravi Pratap <ravi@ximian.com>
25023 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
25024 so that we can check for name clashes there too.
25026 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
25027 for interface indexers.
25029 * interfaces.cs (Define): Emit the default member attribute.
25031 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
25032 variable was being referred to while setting the value ;-)
25034 2002-01-01 Miguel de Icaza <miguel@ximian.com>
25036 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
25037 byte-by-byte information when we know the data is zero.
25039 Make the block always a multiple of 4, because
25040 DefineInitializedData has a bug.
25042 * assign.cs: Fix, we should assign from the temporary, not from
25045 * expression.cs (MakeByteBlob): Fix my incorrect code.
25047 2001-12-31 Miguel de Icaza <miguel@ximian.com>
25049 * typemanager.cs (EnumToUnderlying): This function is used to get
25050 the underlying type from an enumeration, because it does not
25053 * constant.cs: Use the I4_S form for values between -128 and 127.
25055 * statement.cs (Block.LookupLabel): Looks up a label.
25056 (Block): Drop support for labeled blocks.
25058 (LabeledStatement): New kind of statement that represents a label
25061 (Goto): Finally implement this bad boy.
25063 * cs-parser.jay: Update to reflect new mechanism to implement
25066 2001-12-30 Miguel de Icaza <miguel@ximian.com>
25068 * codegen.cs (EmitContext.This): a codegen property that keeps the
25069 a single instance of this instead of creating many different this
25072 * delegate.cs (Delegate.DoResolve): Update to use the property;
25074 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
25076 * expression.cs (BaseAccess.DoResolve): Ditto.
25078 2001-12-29 Ravi Pratap <ravi@ximian.com>
25080 * typemanager.cs (methodimpl_attr_type): Add to hold the type
25081 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
25083 (InitCoreTypes): Update accordingly.
25085 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
25086 so we can quickly store the state.
25088 (ApplyAttributes): Set the correct implementation flags
25089 for InternalCall methods.
25091 2001-12-29 Miguel de Icaza <miguel@ximian.com>
25093 * expression.cs (EmitCall): if a method is not virtual, then do
25094 not use callvirt on it.
25096 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
25097 user defined stuff) requires the use of stobj, which takes an
25098 address on the stack instead of an array and an index. So emit
25099 the Ldelema operation for it.
25101 (EmitStoreOpcode): Use stobj for valuetypes.
25103 (UnaryMutator.EmitCode): Use the right 1 value depending on
25104 whether we are dealing with int64/uint64, float or doubles.
25106 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
25107 constructors that I implemented last night.
25109 (Constructor.IsDefault): Fix to work properly for static
25112 * cs-parser.jay (CheckDef): report method signature errors.
25113 Update error number 103 to be 132.
25115 * decl.cs: New AdditionResult enumeration value: MethodExists.
25116 Although we do this check for methods later on in the semantic
25117 analysis, catching repeated default constructors is so easy that
25118 we catch these here.
25120 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
25123 (ParameterReference.EmitAssign, Emit): handle
25126 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
25127 (ArrayAccess.EmitStoreOpcode): ditto.
25129 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
25131 * expression.cs (MakeByteBlob): Complete all the missing types
25132 (uint, short, ushort, byte, sbyte)
25134 * class.cs: Only init instance field initializers on instance
25137 Rename `constructors' to instance_constructors.
25139 (TypeContainer.AddConstructor): Only add constructors to the list
25140 if it is not static.
25142 Make sure that we handle default_static_constructor independently
25143 everywhere where we handle instance_constructors
25145 2001-12-28 Miguel de Icaza <miguel@ximian.com>
25147 * class.cs: Do not lookup or create a base initializer for a
25148 static constructor.
25150 (ConstructorInitializer.Resolve): use the proper type to lookup
25153 * cs-parser.jay: Report error 1585 (modifiers between type and name).
25155 * enum.cs, interface.cs: Remove CloseType, this is taken care by
25158 * decl.cs: CloseType is now an virtual method, the default
25159 implementation just closes this type.
25161 2001-12-28 Ravi Pratap <ravi@ximian.com>
25163 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
25164 to PreserveSig by default. Also emit HideBySig on such methods.
25166 Basically, set the defaults to standard values.
25168 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
25169 argument, if candidate is better, it can't be worse than the best !
25171 (Invocation): Re-write bits to differentiate between methods being
25172 applicable in their expanded form and their normal form - for params
25175 Get rid of use_standard everywhere as only standard conversions are allowed
25176 in overload resolution.
25178 More spec conformance.
25180 2001-12-27 Miguel de Icaza <miguel@ximian.com>
25182 * driver.cs: Add --timestamp, to see where the compiler spends
25185 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
25186 `this' in static code.
25188 (SimpleName.DoResolve): Implement in terms of a helper function
25189 that allows static-references to be passed upstream to
25192 (Expression.ResolveWithSimpleName): Resolve specially simple
25193 names when called by MemberAccess to implement the special
25196 (Expression.ImplicitReferenceConversion): Handle conversions from
25197 Null to reference types before others, as Null's type is
25200 * expression.cs (Invocation.EmitCall): Handle the special case of
25201 calling methods declared on a reference type from a ValueType
25202 (Base classes System.Object and System.Enum)
25204 (MemberAccess.Resolve): Only perform lookups on Enumerations if
25205 the left hand side is a TypeExpr, not on every enumeration.
25207 (Binary.Resolve): If types are reference types, then do a cast to
25208 object on operators != and == of both arguments.
25210 * typemanager.cs (FindMembers): Extract instance and static
25211 members if requested.
25213 * interface.cs (PopulateProperty): Use void_type instead of null
25214 as the return type for the setter method.
25216 (PopulateIndexer): ditto.
25218 2001-12-27 Ravi Pratap <ravi@ximian.com>
25220 * support.cs (ReflectionParameters): Fix minor bug where we
25221 were examining the wrong parameter for the ParamArray attribute.
25223 Cope with requests for the type of the parameter at position
25224 greater than the params parameter's. We now return the element
25225 type of the params array as that makes more sense.
25227 * expression.cs (Invocation.IsParamsMethodApplicable): Update
25228 accordingly as we no longer have to extract the element type
25231 (Invocation.OverloadResolve): Update.
25233 2001-12-27 Miguel de Icaza <miguel@ximian.com>
25235 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
25236 against IEnumerator, test whether the return value is a descendant
25237 of the IEnumerator interface.
25239 * class.cs (Indexer.Define): Use an auxiliary method to implement
25240 the other bits of the method definition. Begin support for
25241 explicit interface implementation.
25243 (Property.DefineMethod): Use TypeManager.void_type instead of null
25244 for an empty return value.
25246 2001-12-26 Miguel de Icaza <miguel@ximian.com>
25248 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
25249 dealing with a FieldExpr which is composed of a FieldBuilder, in
25250 the code path we did extract the constant, but we should have
25251 obtained the underlying value to be able to cast it (otherwise we
25252 end up in an infinite loop, this is what Ravi was running into).
25254 (ArrayCreation.UpdateIndices): Arrays might be empty.
25256 (MemberAccess.ResolveMemberAccess): Add support for section
25257 14.5.4.1 that deals with the special case of E.I when E is a type
25258 and something else, that I can be a reference to a static member.
25260 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
25261 handle a particular array type to create byte blobs, it is just
25262 something we dont generate byteblobs for.
25264 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
25267 * location.cs (Push): remove the key from the hashtable that we
25268 are about to add. This happens for empty files.
25270 * driver.cs: Dispose files after we have parsed them.
25272 (tokenize): new function that only runs the tokenizer on its
25273 input, for speed testing.
25275 2001-12-26 Ravi Pratap <ravi@ximian.com>
25277 * class.cs (Event.Define): Define the private field only if there
25278 are no accessors defined.
25280 * expression.cs (ResolveMemberAccess): If there is no associated
25281 field with the event, that means we have an event defined with its
25282 own accessors and we should flag error cs0070 since transforming
25283 ourselves into a field is not valid in that case.
25285 * ecore.cs (SimpleName.DoResolve): Same as above.
25287 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
25288 and charset to sane values.
25290 2001-12-25 Ravi Pratap <ravi@ximian.com>
25292 * assign.cs (DoResolve): Perform check on events only if they
25293 are being accessed outside the declaring type.
25295 * cs-parser.jay (event_declarations): Update rules to correctly
25296 set the type of the implicit parameter etc.
25298 (add_accessor, remove_accessor): Set current local parameters.
25300 * expression.cs (Binary): For delegate addition and subtraction,
25301 cast the return value from the method into the appropriate delegate
25304 2001-12-24 Ravi Pratap <ravi@ximian.com>
25306 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
25307 of these as the workaround is unnecessary.
25309 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
25310 delegate data - none of that is needed at all.
25312 Re-write bits to extract the instance expression and the delegate method
25315 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
25318 * attribute.cs (ApplyAttributes): New method to take care of common tasks
25319 of attaching attributes instead of duplicating code everywhere.
25321 * everywhere : Update code to do attribute emission using the above method.
25323 2001-12-23 Miguel de Icaza <miguel@ximian.com>
25325 * expression.cs (IsParamsMethodApplicable): if there are not
25326 parameters, return immediately.
25328 * ecore.cs: The 0 literal can be implicity converted to an enum
25331 (SimpleName.DoResolve): First lookup the type, then lookup the
25334 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
25335 want to get its address. If the InstanceExpression is not
25336 addressable, store the result in a temporary variable, then get
25339 * codegen.cs: Only display 219 errors on warning level or above.
25341 * expression.cs (ArrayAccess): Make it implement the
25342 IMemoryLocation interface.
25344 (Binary.DoResolve): handle the operator == (object a, object b)
25345 and operator != (object a, object b) without incurring into a
25346 BoxedCast (because 5 != o should never be performed).
25348 Handle binary enumerator operators.
25350 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
25351 value type, otherwise use Ldelem_ref.
25353 Use precomputed names;
25355 (AddressOf): Implement address of
25357 * cs-parser.jay (labeled_statement): Fix recursive block
25358 addition by reworking the production.
25360 * expression.cs (New.DoEmit): New has a special case:
25362 If we are dealing with a ValueType, we have a few
25363 situations to deal with:
25365 * The target of New is a ValueType variable, that is
25366 easy, we just pass this as the variable reference
25368 * The target of New is being passed as an argument,
25369 to a boxing operation or a function that takes a
25372 In this case, we need to create a temporary variable
25373 that is the argument of New.
25376 2001-12-23 Ravi Pratap <ravi@ximian.com>
25378 * rootcontext.cs (LookupType): Check that current_type is not null before
25379 going about looking at nested types.
25381 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
25382 not implement the IAssignMethod interface any more.
25384 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
25385 where we tranform them into FieldExprs if they are being resolved from within
25386 the declaring type.
25388 * ecore.cs (SimpleName.DoResolve): Do the same here.
25390 * assign.cs (DoResolve, Emit): Clean up code considerably.
25392 * ../errors/bug10.cs : Add.
25394 * ../errors/cs0070.cs : Add.
25396 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
25398 * assign.cs : Get rid of EventIsLocal everywhere.
25400 2001-12-23 Miguel de Icaza <miguel@ximian.com>
25402 * ecore.cs (ConvertIntLiteral): finished the implementation.
25404 * statement.cs (SwitchLabel): Convert the value we are using as a
25405 key before looking up the table.
25407 2001-12-22 Miguel de Icaza <miguel@ximian.com>
25409 * codegen.cs (EmitTopBlock): Require a Location argument now.
25411 * cs-parser.jay (constructor_declarator): We need to setup
25412 current_local_parameters before we parse the
25413 opt_constructor_initializer, to allow the variables to be bound
25414 to the constructor arguments.
25416 * rootcontext.cs (LookupType): First lookup nested classes in our
25417 class and our parents before we go looking outside our class.
25419 * expression.cs (ConstantFold): Extract/debox the values at the
25422 * rootcontext.cs (EmitCode): Resolve the constants first before we
25423 resolve the types. This is not really needed, but it helps debugging.
25425 * statement.cs: report location.
25427 * cs-parser.jay: pass location to throw statement.
25429 * driver.cs: Small bug fix.
25431 * report.cs: Updated format to be 4-zero filled digits.
25433 2001-12-22 Ravi Pratap <ravi@ximian.com>
25435 * expression.cs (CheckIndices): Fix minor bug where the wrong
25436 variable was being referred to ;-)
25438 (DoEmit): Do not call EmitStaticInitializers when the
25439 underlying type is System.Object.
25441 2001-12-21 Ravi Pratap <ravi@ximian.com>
25443 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
25444 and do the usual workaround for SRE.
25446 * class.cs (MyEventBuilder.EventType): New member to get at the type
25447 of the event, quickly.
25449 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
25451 * assign.cs (Assign.DoResolve): Handle the case when the target
25452 is an EventExpr and perform the necessary checks.
25454 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
25457 (SimpleName.MemberStaticCheck): Include check for EventExpr.
25459 (EventExpr): Set the type in the constructor itself since we
25460 are meant to be born fully resolved.
25462 (EventExpr.Define): Revert code I wrote earlier.
25464 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
25465 instance expression is null. The instance expression is a This in that case
25466 or a null, depending on whether it is a static method or not.
25468 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
25469 refers to more than one method.
25471 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
25472 and accordingly flag errors.
25474 2001-12-21 Miguel de Icaza <miguel@ximian.com>
25476 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
25478 2001-12-22 Miguel de Icaza <miguel@ximian.com>
25480 * location.cs (ToString): Provide useful rutine.
25482 2001-12-21 Miguel de Icaza <miguel@ximian.com>
25484 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
25485 objects, return the actual integral boxed.
25487 * statement.cs (SwitchLabel): define an ILLabel for each
25490 (Switch.CheckSwitch): If the value is a Literal, extract
25491 the underlying literal.
25493 Also in the unused hashtable we had, add the SwitchLabel so we can
25494 quickly look this value up.
25496 * constant.cs: Implement a bunch of new constants. Rewrite
25497 Literal based on this. Made changes everywhere to adapt to this.
25499 * expression.cs (Expression.MakeByteBlob): Optimize routine by
25500 dereferencing array only once, and also copes with enumrations.
25502 bytes are two bytes wide, not one.
25504 (Cast): Perform constant conversions.
25506 * ecore.cs (TryImplicitIntConversion): Return literals instead of
25507 wrappers to the literals here.
25509 * expression.cs (DoNumericPromotions): long literals can converted
25510 to ulong implicity (this is taken care of elsewhere, but I was
25511 missing this spot).
25513 * ecore.cs (Expression.Literalize): Make the return type Literal,
25514 to improve type checking.
25516 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
25518 2001-12-20 Miguel de Icaza <miguel@ximian.com>
25520 * literal.cs: Revert code from ravi that checked the bounds. The
25521 bounds are sane by the definition of the type itself.
25523 * typemanager.cs: Fix implementation of ImplementsInterface. We
25524 need to actually look up in our parent hierarchy for interfaces
25527 * const.cs: Use the underlying type for enumerations
25529 * delegate.cs: Compute the basename for the delegate creation,
25530 that should fix the delegate test case, and restore the correct
25531 Type Lookup semantics in rootcontext
25533 * rootcontext.cs: Revert Ravi's last patch. The correct way of
25534 referencing a nested type with the Reflection API is using the "+"
25537 * cs-parser.jay: Do not require EOF token at the end.
25539 2001-12-20 Ravi Pratap <ravi@ximian.com>
25541 * rootcontext.cs (LookupType): Concatenate type names with
25542 a '.' instead of a '+' The test suite passes again.
25544 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
25545 field of the enumeration.
25547 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
25548 the case when the member is an EventExpr.
25550 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
25551 static has an associated instance expression.
25553 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
25555 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
25557 * class.cs (Event.Define): Register event and perform appropriate checks
25560 We define the Add and Remove methods even if the use provides none because
25561 in that case, we provide default implementations ourselves.
25563 Define a private field of the type of the event. This is done by the CSC compiler
25564 and we should be doing it too ;-)
25566 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
25567 More methods we use in code we generate.
25569 (multicast_delegate_type, delegate_type): Two separate types since the distinction
25572 (InitCoreTypes): Update accordingly for the above.
25574 * class.cs (Event.Emit): Generate code for default accessors that we provide
25576 (EmitDefaultMethod): Do the job in the above.
25578 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
25581 2001-12-20 Miguel de Icaza <miguel@ximian.com>
25583 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
25584 builders even if we were missing one.
25586 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
25587 pass the Basename as our class name instead of the Name. The
25588 basename will be correctly composed for us.
25590 * parameter.cs (Paramters): Now takes a Location argument.
25592 * decl.cs (DeclSpace.LookupType): Removed convenience function and
25593 make all the code call directly LookupType in RootContext and take
25594 this chance to pass the Location information everywhere.
25596 * Everywhere: pass Location information.
25598 2001-12-19 Miguel de Icaza <miguel@ximian.com>
25600 * class.cs (Constructor.Define): Updated way of detecting the
25601 length of the parameters.
25603 (TypeContainer.DefineType): Use basename as the type name for
25606 (TypeContainer.Define): Do not recursively define types here, as
25607 definition is taken care in order by the RootContext.
25609 * tree.cs: Keep track of namespaces in a per-file basis.
25611 * parameter.cs (Parameter.ComputeSignature): Update to use
25614 (Parameters.GetSignature): ditto.
25616 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
25617 instead of a TypeContainer.
25619 (Interface.SemanticAnalysis): Use `this' instead of our parent to
25620 resolve names. Because we need to be resolve in our context, not
25623 * driver.cs: Implement response files.
25625 * class.cs (TypeContainer.DefineType): If we are defined, do not
25626 redefine ourselves.
25628 (Event.Emit): Emit the code for add/remove handlers.
25629 (Event.Define): Save the MethodBuilders for add/remove.
25631 * typemanager.cs: Use pair here too.
25633 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
25634 DictionaryEntry requires the first argument to be non-null.
25636 (enum_declaration): Compute full name for registering the
25639 (delegate_declaration): Instead of using
25640 formal_parameter_list, use opt_formal_parameter_list as the list
25643 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
25644 (EventParsing): New property that controls whether `add' and
25645 `remove' are returned as tokens or identifiers (for events);
25647 2001-12-19 Ravi Pratap <ravi@ximian.com>
25649 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
25650 use MyEventBuilder only and let it wrap the real builder for us.
25652 (MyEventBuilder): Revamp constructor etc.
25654 Implement all operations that we perform on EventBuilder in precisely the same
25657 (FindMembers): Update to use the EventBuilder member.
25659 (Event.Emit): Update accordingly.
25661 2001-12-18 Ravi Pratap <ravi@ximian.com>
25663 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
25664 by calling the appropriate methods.
25666 (GetCustomAttributes): Make stubs as they cannot possibly do anything
25669 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
25671 2001-12-17 Ravi Pratap <ravi@ximian.com>
25673 * delegate.cs (Delegate.Populate): Check that the return type
25674 and various parameters types are indeed accessible.
25676 * class.cs (Constructor.Define): Same here.
25678 (Field.Define): Ditto.
25680 (Event.Define): Ditto.
25682 (Operator.Define): Check that the underlying Method defined itself
25683 correctly - so it's MethodBuilder should not be null.
25685 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
25686 expression happens to be null.
25688 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
25689 members but as of now we don't seem to be able to do anything really useful with it.
25691 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
25692 not the EventBuilder.
25694 2001-12-18 Miguel de Icaza <miguel@ximian.com>
25696 * cs-tokenizer.cs: Add support for defines.
25697 Add support for #if, #elif, #else, #endif
25699 (eval_var): evaluates a variable.
25700 (eval): stubbed for evaluating functions.
25702 * cs-parser.jay: Pass the defines information
25704 * driver.cs: Add --define command line option.
25706 * decl.cs: Move MemberCore here.
25708 Make it the base class for DeclSpace. This allows us to catch and
25709 report 108 and 109 for everything now.
25711 * class.cs (TypeContainer.Define): Extract all the members
25712 before populating and emit the warning 108 (new keyword required
25713 to override) instead of having each member implement this.
25715 (MemberCore.Define): New abstract method, we will be using this in
25716 the warning reporting engine in Populate.
25718 (Operator.Define): Adjust to new MemberCore protocol.
25720 * const.cs (Const): This does not derive from Expression, it is a
25721 temporary object we use to create fields, it is a MemberCore.
25723 * class.cs (Method.Define): Allow the entry point to be in a
25726 * driver.cs: Rewrite the argument handler to clean it up a bit.
25728 * rootcontext.cs: Made it just an auxiliary namespace feature by
25729 making everything static.
25731 * driver.cs: Adapt code to use RootContext type name instead of
25734 * delegate.cs: Remove RootContext argument.
25736 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
25739 * class.cs (Event.Define): The lookup can fail.
25741 * cs-tokenizer.cs: Begin implementation of pre-procesor.
25743 * expression.cs: Resolve the this instance before invoking the code.
25745 2001-12-17 Miguel de Icaza <miguel@ximian.com>
25747 * cs-parser.jay: Add a production in element_access that allows
25748 the thing to become a "type" reference. This way we can parse
25749 things like "(string [])" as a type.
25751 Note that this still does not handle the more complex rules of
25755 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
25757 * ecore.cs: (CopyNewMethods): new utility function used to
25758 assemble the list of methods from running FindMembers.
25760 (MemberLookup): Rework FindMembers so that
25762 2001-12-16 Miguel de Icaza <miguel@ximian.com>
25764 * class.cs (TypeContainer): Remove Delegates who fail to be
25767 * delegate.cs (Populate): Verify that we dont get null return
25768 values. TODO: Check for AsAccessible.
25770 * cs-parser.jay: Use basename to emit error 574 (destructor should
25771 have the same name as container class), not the full name.
25773 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
25774 possible representation.
25776 Also implements integer type suffixes U and L.
25778 2001-12-15 Miguel de Icaza <miguel@ximian.com>
25780 * expression.cs (ArrayCreation.DoResolve): We need to do the
25781 argument resolution *always*.
25783 * decl.cs: Make this hold the namespace. Hold the root context as
25785 (LookupType): Move here.
25787 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
25789 * location.cs (Row, Name): Fixed the code, it was always returning
25790 references to the first file.
25792 * interface.cs: Register properties defined through interfaces.
25794 * driver.cs: Add support for globbing on the command line
25796 * class.cs (Field): Make it derive from MemberCore as well.
25799 2001-12-15 Ravi Pratap <ravi@ximian.com>
25801 * class.cs (Event::Define): Check that the type of the event is a delegate
25802 type else flag error #66.
25804 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
25807 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
25808 values of EntryPoint, CharSet etc etc.
25810 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
25812 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
25813 be null and we should ignore this. I am not sure if this is really clean. Apparently,
25814 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
25815 which needs this to do its work.
25817 * ../errors/cs0066.cs : Add.
25819 2001-12-14 Miguel de Icaza <miguel@ximian.com>
25821 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
25824 * class.cs: (MethodSignature.MethodSignature): Removed hack that
25825 clears out the parameters field.
25826 (MemberSignatureCompare): Cleanup
25828 (MemberCore): New base class used to share code between MethodCore
25831 (RegisterRequiredImplementations) BindingFlags.Public requires
25832 either BindingFlags.Instace or Static. Use instance here.
25834 (Property): Refactored code to cope better with the full spec.
25836 * parameter.cs (GetParameterInfo): Return an empty array instead
25839 * class.cs (Property): Abstract or extern properties have no bodies.
25841 * parameter.cs (GetParameterInfo): return a zero-sized array.
25843 * class.cs (TypeContainer.MethodModifiersValid): Move all the
25844 method modifier validation to the typecontainer so we can reuse
25845 this on properties.
25847 (MethodCore.ParameterTypes): return an empty sized array of types.
25849 (Property.Define): Test property modifier validity.
25851 Add tests for sealed/override too.
25853 (Method.Emit): abstract or extern methods have no bodies.
25855 2001-12-14 Ravi Pratap <ravi@ximian.com>
25857 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
25860 (Method::Define, ::Emit): Modify accordingly.
25862 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
25864 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
25866 * makefile: Pass in /unsafe.
25868 2001-12-13 Miguel de Icaza <miguel@ximian.com>
25870 * class.cs (MakeKey): Kill routine.
25872 * class.cs (TypeContainer.Define): Correctly define explicit
25873 method implementations (they require the full interface name plus
25876 * typemanager.cs: Deply the PtrHashtable here and stop using the
25877 lame keys. Things work so much better.
25879 This of course broke everyone who depended on `RegisterMethod' to
25880 do the `test for existance' test. This has to be done elsewhere.
25882 * support.cs (PtrHashtable): A hashtable that avoid comparing with
25883 the object stupid Equals method (because, that like fails all over
25884 the place). We still do not use it.
25886 * class.cs (TypeContainer.SetRequiredInterface,
25887 TypeContainer.RequireMethods): Killed these two routines and moved
25888 all the functionality to RegisterRequiredImplementations.
25890 (TypeContainer.RegisterRequiredImplementations): This routine now
25891 registers all the implementations required in an array for the
25892 interfaces and abstract methods. We use an array of structures
25893 which can be computed ahead of time to reduce memory usage and we
25894 also assume that lookups are cheap as most classes will not
25895 implement too many interfaces.
25897 We also avoid creating too many MethodSignatures.
25899 (TypeContainer.IsInterfaceMethod): Update and optionally does not
25900 clear the "pending" bit if we find that there are problems with
25903 (TypeContainer.VerifyPendingMethods): Update to report errors of
25904 methods that look like implementations but are not.
25906 (TypeContainer.Define): Add support for explicit interface method
25909 2001-12-12 Miguel de Icaza <miguel@ximian.com>
25911 * typemanager.cs: Keep track of the parameters here instead of
25912 being a feature of the TypeContainer.
25914 * class.cs: Drop the registration of parameters here, as
25915 InterfaceMethods are also interface declarations.
25917 * delegate.cs: Register methods with the TypeManager not only with
25918 the TypeContainer. This code was buggy.
25920 * interface.cs: Full registation here.
25922 2001-12-11 Miguel de Icaza <miguel@ximian.com>
25924 * expression.cs: Remove reducer for binary expressions, it can not
25927 * const.cs: Put here the code that used to go into constant.cs
25929 * constant.cs: Put here the code for constants, this is a new base
25930 class for Literals.
25932 * literal.cs: Make Literal derive from Constant.
25934 2001-12-09 Miguel de Icaza <miguel@ximian.com>
25936 * statement.cs (Return.Emit): Report error 157 if the user
25937 attempts to return from a finally block.
25939 (Return.Emit): Instead of emitting a return, jump to the end of
25942 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
25943 LocalBuilder to store the result of the function. ReturnLabel is
25944 the target where we jump.
25947 2001-12-09 Radek Doulik <rodo@ximian.com>
25949 * cs-parser.jay: remember alias in current namespace
25951 * ecore.cs (SimpleName::DoResolve): use aliases for types or
25954 * class.cs (LookupAlias): lookup alias in my_namespace
25956 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
25958 (LookupAlias): lookup alias in this and if needed in parent
25961 2001-12-08 Miguel de Icaza <miguel@ximian.com>
25965 * rootcontext.cs: (ModuleBuilder) Made static, first step into
25966 making things static. I need this to avoid passing the
25967 TypeContainer when calling ParameterType.
25969 * support.cs (InternalParameters.ParameterType): Remove ugly hack
25970 that did string manipulation to compute the type and then call
25971 GetType. Use Parameter.ParameterType instead.
25973 * cs-tokenizer.cs: Consume the suffix for floating values.
25975 * expression.cs (ParameterReference): figure out whether this is a
25976 reference parameter or not. Kill an extra variable by computing
25977 the arg_idx during emission.
25979 * parameter.cs (Parameters.GetParameterInfo): New overloaded
25980 function that returns whether a parameter is an out/ref value or not.
25982 (Parameter.ParameterType): The type of the parameter (base,
25983 without ref/out applied).
25985 (Parameter.Resolve): Perform resolution here.
25986 (Parameter.ExternalType): The full type (with ref/out applied).
25988 * statement.cs (Using.Emit, Using.EmitExpression): Implement
25989 support for expressions on the using statement.
25991 2001-12-07 Miguel de Icaza <miguel@ximian.com>
25993 * statement.cs (Using.EmitLocalVariableDecls): Split the
25994 localvariable handling of the using statement.
25996 (Block.EmitMeta): Keep track of variable count across blocks. We
25997 were reusing slots on separate branches of blocks.
25999 (Try.Emit): Emit the general code block, we were not emitting it.
26001 Check the type of the declaration to be an IDisposable or
26002 something that can be implicity converted to it.
26004 Emit conversions if required.
26006 * ecore.cs (EmptyExpression): New utility class.
26007 (Expression.ImplicitConversionExists): New utility function.
26009 2001-12-06 Miguel de Icaza <miguel@ximian.com>
26011 * statement.cs (Using): Implement.
26013 * expression.cs (LocalVariableReference): Support read only variables.
26015 * statement.cs: Remove the explicit emit for the Leave opcode.
26016 (VariableInfo): Add a readonly field.
26018 2001-12-05 Miguel de Icaza <miguel@ximian.com>
26020 * ecore.cs (ConvCast): new class used to encapsulate the various
26021 explicit integer conversions that works in both checked and
26022 unchecked contexts.
26024 (Expression.ConvertNumericExplicit): Use new ConvCast class to
26025 properly generate the overflow opcodes.
26027 2001-12-04 Miguel de Icaza <miguel@ximian.com>
26029 * statement.cs: The correct type for the EmptyExpression is the
26030 element_type, not the variable type. Ravi pointed this out.
26032 2001-12-04 Ravi Pratap <ravi@ximian.com>
26034 * class.cs (Method::Define): Handle PInvoke methods specially
26035 by using DefinePInvokeMethod instead of the usual one.
26037 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
26038 above to do the task of extracting information and defining the method.
26040 2001-12-04 Ravi Pratap <ravi@ximian.com>
26042 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
26043 of the condition for string type.
26045 (Emit): Move that here.
26047 (ArrayCreation::CheckIndices): Keep string literals in their expression
26050 (EmitDynamicInitializers): Handle strings appropriately.
26052 2001-12-04 Miguel de Icaza <miguel@ximian.com>
26054 * codegen.cs (EmitContext): Replace multiple variables with a
26055 single pointer to the current Switch statement.
26057 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
26060 2001-12-03 Miguel de Icaza <miguel@ximian.com>
26064 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
26067 (Foreach.Emit): Foreach on arrays was not setting
26068 up the loop variables (for break/continue).
26070 (GotoCase): Semi-implented.
26072 2001-12-03 Ravi Pratap <ravi@ximian.com>
26074 * attribute.cs (CheckAttribute): Handle system attributes by using
26075 Attribute.GetAttributes to examine information we need.
26077 (GetValidPlaces): Same here.
26079 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
26081 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
26083 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
26085 (Method::Define): Set appropriate flags if we have a DllImport attribute.
26087 (Method::Emit): Handle the case when we are a PInvoke method.
26089 2001-12-03 Miguel de Icaza <miguel@ximian.com>
26091 * expression.cs: Use ResolveWithSimpleName on compound names.
26093 2001-12-02 Ravi Pratap <ravi@ximian.com>
26095 * constant.cs (EmitConstant): Make sure we resolve the associated expression
26096 before trying to reduce it.
26098 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
26100 * constant.cs (LookupConstantValue): Implement.
26102 (EmitConstant): Use the above in emitting the constant.
26104 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
26105 that are user-defined by doing a LookupConstantValue on them.
26107 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
26110 2001-11-29 Miguel de Icaza <miguel@ximian.com>
26112 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
26114 (BaseAccess.DoResolve): Implement.
26116 (MemberAccess.DoResolve): Split this routine into a
26117 ResolveMemberAccess routine that can be used independently
26119 2001-11-28 Miguel de Icaza <miguel@ximian.com>
26121 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
26122 As that share bits of the implementation. Is returns a boolean,
26123 while As returns the Type that is being probed.
26125 2001-12-01 Ravi Pratap <ravi@ximian.com>
26127 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
26128 instead of a Literal - much easier.
26130 (EnumInTransit): Remove - utterly useless :-)
26132 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
26134 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
26136 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
26137 chain when we have no associated expression.
26139 2001-11-30 Ravi Pratap <ravi@ximian.com>
26141 * constant.cs (Define): Use Location while reporting the errror.
26143 Also emit a warning when 'new' is used and there is no inherited
26146 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
26149 (LookupEnumValue): Implement to lookup an enum member's value and define it
26152 (Populate): Re-write accordingly to use the above routine.
26154 2001-11-27 Miguel de Icaza <miguel@ximian.com>
26156 * expression.cs (This): Fix prototype for DoResolveLValue to
26157 override the base class DoResolveLValue.
26159 * cs-parser.cs: Report errors cs574 and cs575 (destructor
26162 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
26163 (we need to load the address of the field here). This fixes
26166 (FieldExpr.DoResolveLValue): Call the DoResolve
26167 function to initialize the Instance expression.
26169 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
26170 correctly the GetEnumerator operation on a value type.
26172 * cs-parser.jay: Add more simple parsing error catches.
26174 * statement.cs (Switch): Add support for string switches.
26175 Handle null specially.
26177 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
26179 2001-11-28 Ravi Pratap <ravi@ximian.com>
26181 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
26183 (declare_local_constant): New helper function.
26185 * statement.cs (AddConstant): Keep a separate record of constants
26187 (IsConstant): Implement to determine if a variable is a constant.
26189 (GetConstantExpression): Implement.
26191 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
26193 * statement.cs (IsVariableDefined): Re-write.
26195 2001-11-27 Ravi Pratap <ravi@ximian.com>
26197 * class.cs (TypeContainer::FindMembers): Look for constants
26198 in the case when we are looking for MemberTypes.Field
26200 * expression.cs (MemberAccess::DoResolve): Check that in the
26201 case we are a FieldExpr and a Literal, we are not being accessed
26202 by an instance reference.
26204 * cs-parser.jay (local_constant_declaration): Implement.
26206 (declaration_statement): Implement for constant declarations.
26208 2001-11-26 Miguel de Icaza <miguel@ximian.com>
26210 * statement.cs (Switch): Catch double defaults.
26212 (Switch): More work on the switch() statement
26213 implementation. It works for integral values now, need to finish
26217 2001-11-24 Miguel de Icaza <miguel@ximian.com>
26219 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
26220 integer literals into other integer literals. To be used by
26223 2001-11-24 Ravi Pratap <ravi@ximian.com>
26225 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
26228 (EmitDynamicInitializers): Cope with the above since we extract data
26229 directly from ArrayData now.
26231 (ExpectInitializers): Keep track of whether initializers are mandatory
26234 (Bounds): Make it a hashtable to prevent the same dimension being
26235 recorded for every element in that dimension.
26237 (EmitDynamicInitializers): Fix bug which prevented the Set array method
26240 Also fix bug which was causing the indices to be emitted in the reverse
26243 2001-11-24 Miguel de Icaza <miguel@ximian.com>
26245 * expression.cs (ArrayCreation): Implement the bits that Ravi left
26246 unfinished. They do not work, because the underlying code is
26249 2001-11-22 Miguel de Icaza <miguel@ximian.com>
26251 * cs-parser.jay: Remove bogus fixme.
26253 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
26254 on Switch statement.
26256 2001-11-23 Ravi Pratap <ravi@ximian.com>
26258 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
26261 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
26262 parameter. Apparently, any expression is allowed.
26264 (ValidateInitializers): Update accordingly.
26266 (CheckIndices): Fix some tricky bugs thanks to recursion.
26268 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
26269 I was being completely brain-dead.
26271 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
26272 and re-write acordingly.
26274 (DelegateInvocation): Re-write accordingly.
26276 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
26278 (MakeByteBlob): Handle types more correctly.
26280 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
26281 initialization from expressions but it is incomplete because I am a complete
26284 2001-11-22 Miguel de Icaza <miguel@ximian.com>
26286 * statement.cs (If.Emit): Fix a bug that generated incorrect code
26287 on If. Basically, we have to return `true' (ie, we do return to
26288 our caller) only if both branches of the if return.
26290 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
26291 short-circuit operators, handle them as short circuit operators.
26293 (Cast.DoResolve): Resolve type.
26294 (Cast.Cast): Take an expression as the target type.
26296 * cs-parser.jay (cast_expression): Remove old hack that only
26297 allowed a limited set of types to be handled. Now we take a
26298 unary_expression and we resolve to a type during semantic
26301 Use the grammar productions from Rhys to handle casts (this is
26302 not complete like Rhys syntax yet, we fail to handle that corner
26303 case that C# has regarding (-x), but we will get there.
26305 2001-11-22 Ravi Pratap <ravi@ximian.com>
26307 * class.cs (EmitFieldInitializer): Take care of the case when we have a
26308 field which is an array type.
26310 * cs-parser.jay (declare_local_variables): Support array initialization too.
26312 * typemanager.cs (MakeKey): Implement.
26314 (everywhere): Use the above appropriately.
26316 * cs-parser.jay (for_statement): Update for array initialization while
26317 declaring variables.
26319 * ecore.cs : The error message was correct, it's the variable's names that
26320 were misleading ;-) Make the code more readable.
26322 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
26323 the correct type etc.
26325 (ConvertExplicit): Handle Enum types by examining the underlying type.
26327 2001-11-21 Ravi Pratap <ravi@ximian.com>
26329 * parameter.cs (GetCallingConvention): Always return
26330 CallingConventions.Standard for now.
26332 2001-11-22 Miguel de Icaza <miguel@ximian.com>
26334 * expression.cs (Binary.ResolveOperator): Update the values of `l'
26335 and `r' after calling DoNumericPromotions.
26337 * ecore.cs: Fix error message (the types were in the wrong order).
26339 * statement.cs (Foreach.ProbeCollectionType): Need to pass
26340 BindingFlags.Instance as well
26342 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
26343 implicit int literal conversion in an empty cast so that we
26344 propagate the right type upstream.
26346 (UnboxCast): new class used to unbox value types.
26347 (Expression.ConvertExplicit): Add explicit type conversions done
26350 (Expression.ImplicitNumericConversion): Oops, forgot to test for
26351 the target type before applying the implicit LongLiterals to ULong
26354 2001-11-21 Miguel de Icaza <miguel@ximian.com>
26356 * cs-parser.jay (for_statement): Reworked the way For works: now
26357 we declare manually any variables that are introduced in
26358 for_initializer to solve the problem of having out-of-band code
26359 emition (that is what got for broken).
26361 (declaration_statement): Perform the actual variable declaration
26362 that used to be done in local_variable_declaration here.
26364 (local_variable_declaration): Do not declare anything, just pass
26365 the information on a DictionaryEntry
26367 2001-11-20 Ravi Pratap <ravi@ximian.com>
26369 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
26370 re-write of the logic to now make it recursive.
26372 (UpdateIndices): Re-write accordingly.
26374 Store element data in a separate ArrayData list in the above methods.
26376 (MakeByteBlob): Implement to dump the array data into a byte array.
26378 2001-11-19 Ravi Pratap <ravi@ximian.com>
26380 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
26383 * constant.cs (Define): Implement.
26385 (EmitConstant): Re-write fully.
26387 Pass in location info.
26389 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
26392 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
26393 DictionaryEntry since we need location info too.
26395 (constant_declaration): Update accordingly.
26397 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
26398 code into another method : UpdateIndices.
26400 2001-11-18 Ravi Pratap <ravi@ximian.com>
26402 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
26403 some type checking etc.
26405 2001-11-17 Ravi Pratap <ravi@ximian.com>
26407 * expression.cs (ArrayCreation::ValidateInitializers): Implement
26408 bits to provide dimension info if the user skips doing that.
26410 Update second constructor to store the rank correctly.
26412 2001-11-16 Ravi Pratap <ravi@ximian.com>
26414 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
26415 and try to implement.
26417 * ../errors/cs0150.cs : Add.
26419 * ../errors/cs0178.cs : Add.
26421 2001-11-16 Miguel de Icaza <miguel@ximian.com>
26423 * statement.cs: Implement foreach on multi-dimensional arrays.
26425 * parameter.cs (Parameters.GetParameterByName): Also lookup the
26426 name of the params argument.
26428 * expression.cs: Use EmitStoreOpcode to get the right opcode while
26429 initializing the array.
26431 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
26432 we can use this elsewhere.
26434 * statement.cs: Finish implementation of foreach for single
26437 * cs-parser.jay: Use an out-of-band stack to pass information
26438 around, I wonder why I need this.
26440 foreach_block: Make the new foreach_block the current_block.
26442 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
26443 function used to return a static Parameters structure. Used for
26444 empty parameters, as those are created very frequently.
26446 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
26448 2001-11-15 Ravi Pratap <ravi@ximian.com>
26450 * interface.cs : Default modifier is private, not public. The
26451 make verify test passes again.
26453 2001-11-15 Ravi Pratap <ravi@ximian.com>
26455 * support.cs (ReflectionParameters): Fix logic to determine
26456 whether the last parameter is a params one. Test 9 passes again.
26458 * delegate.cs (Populate): Register the builders we define with
26459 RegisterParameterForBuilder. Test 19 passes again.
26461 * cs-parser.jay (property_declaration): Reference $6 instead
26462 of $$ to get at the location.
26464 (indexer_declaration): Similar stuff.
26466 (attribute): Ditto.
26468 * class.cs (Property): Register parameters for the Get and Set methods
26469 if they exist. Test 23 passes again.
26471 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
26472 call to EmitArguments as we are sure there aren't any params arguments.
26473 Test 32 passes again.
26475 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
26476 IndexOutOfRangeException.
26478 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
26479 Test 33 now passes again.
26481 2001-11-15 Miguel de Icaza <miguel@ximian.com>
26483 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
26484 broke a bunch of things. Will have to come up with a better way
26485 of tracking locations.
26487 * statement.cs: Implemented foreach for single dimension arrays.
26489 2001-11-09 Miguel de Icaza <miguel@ximian.com>
26491 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
26492 an error. This removes the lookup from the critical path.
26494 * cs-parser.jay: Removed use of temporary_loc, which is completely
26497 2001-11-14 Miguel de Icaza <miguel@ximian.com>
26499 * support.cs (ReflectionParameters.ParameterModifier): Report
26500 whether the argument is a PARAMS argument or not.
26502 * class.cs: Set the attribute `ParamArrayAttribute' on the
26503 parameter argument.
26505 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
26506 and cons_param_array_attribute (ConstructorInfo for
26507 ParamArrayAttribute).,
26509 * codegen.cs: Emit the return using the `Return' statement, that
26510 way we can report the error correctly for missing return values.
26512 * class.cs (Method.Emit): Clean up.
26514 * expression.cs (Argument.Resolve): Take another argument: the
26515 location where this argument is used. Notice that this is not
26516 part of the "Argument" class as to reduce the size of the
26517 structure (we know the approximate location anyways).
26519 Test if the argument is a variable-reference, if not, then
26520 complain with a 206.
26522 (Argument.Emit): Emit addresses of variables.
26524 (Argument.FullDesc): Simplify.
26526 (Invocation.DoResolve): Update for Argument.Resolve.
26528 (ElementAccess.DoResolve): ditto.
26530 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
26531 method should be virtual, as this method is always virtual.
26533 (NewDelegate.DoResolve): Update for Argument.Resolve.
26535 * class.cs (ConstructorInitializer.DoResolve): ditto.
26537 * attribute.cs (Attribute.Resolve): ditto.
26539 2001-11-13 Miguel de Icaza <miguel@ximian.com>
26541 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
26543 * expression.cs (ParameterReference): Drop IStackStorage and implement
26544 IAssignMethod instead.
26546 (LocalVariableReference): ditto.
26548 * ecore.cs (FieldExpr): Drop IStackStorage and implement
26549 IAssignMethod instead.
26551 2001-11-13 Miguel de Icaza <miguel@ximian.com>
26553 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
26554 enumerations that are used in heavily used structures derive from
26555 byte in a laughable and pathetic attempt to reduce memory usage.
26556 This is the kind of pre-optimzations that you should not do at
26557 home without adult supervision.
26559 * expression.cs (UnaryMutator): New class, used to handle ++ and
26560 -- separatedly from the other unary operators. Cleans up the
26561 code, and kills the ExpressionStatement dependency in Unary.
26563 (Unary): Removed `method' and `Arguments' from this class, making
26564 it smaller, and moving it all to SimpleCall, so I can reuse this
26565 code in other locations and avoid creating a lot of transient data
26566 strucutres when not required.
26568 * cs-parser.jay: Adjust for new changes.
26570 2001-11-11 Miguel de Icaza <miguel@ximian.com>
26572 * enum.cs (Enum.Populate): If there is a failure during
26575 * cs-parser.jay (opt_enum_base): we used to catch type errors
26576 here, but this is really incorrect. The type error should be
26577 catched during semantic analysis.
26579 2001-12-11 Ravi Pratap <ravi@ximian.com>
26581 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
26582 current_local_parameters as expected since I, in my stupidity, had forgotten
26585 * attribute.cs (GetValidPlaces): Fix stupid bug.
26587 * class.cs (Method::Emit): Perform check on applicability of attributes.
26589 (Constructor::Emit): Ditto.
26591 (Field::Emit): Ditto.
26593 (Field.Location): Store location information.
26595 (Property, Event, Indexer, Operator): Ditto.
26597 * cs-parser.jay (field_declaration): Pass in location for each field.
26599 * ../errors/cs0592.cs : Add.
26601 2001-11-12 Ravi Pratap <ravi@ximian.com>
26603 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
26605 (InitCoreTypes): Update accordingly.
26607 (RegisterAttrType, LookupAttr): Implement.
26609 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
26610 info about the same.
26612 (Resolve): Update to populate the above as necessary.
26614 (Error592): Helper.
26616 (GetValidPlaces): Helper to the above.
26618 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
26620 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
26622 2001-11-12 Ravi Pratap <ravi@ximian.com>
26624 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
26626 * ../errors/cs0617.cs : Add.
26628 2001-11-11 Ravi Pratap <ravi@ximian.com>
26630 * enum.cs (Emit): Rename to Populate to be more consistent with what
26631 we expect it to do and when exactly it is called.
26633 * class.cs, rootcontext.cs : Update accordingly.
26635 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
26636 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
26638 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
26640 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
26641 of a fieldinfo using the above, when dealing with a FieldBuilder.
26643 2001-11-10 Ravi Pratap <ravi@ximian.com>
26645 * ../errors/cs0031.cs : Add.
26647 * ../errors/cs1008.cs : Add.
26649 * ../errrors/cs0543.cs : Add.
26651 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
26654 (FindMembers): Implement.
26656 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
26657 enums and delegates too.
26659 (enum_types): Rename to builder_to_enum.
26661 (delegate_types): Rename to builder_to_delegate.
26663 * delegate.cs (FindMembers): Implement.
26665 2001-11-09 Ravi Pratap <ravi@ximian.com>
26667 * typemanager.cs (IsEnumType): Implement.
26669 * enum.cs (Emit): Re-write parts to account for the underlying type
26670 better and perform checking etc.
26672 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
26673 of the underlying type.
26675 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
26678 * enum.cs (error31): Helper to report error #31.
26680 * cs-parser.jay (enum_declaration): Store location of each member too.
26682 * enum.cs (member_to_location): New hashtable.
26684 (AddEnumMember): Update location hashtable.
26686 (Emit): Use the location of each member while reporting errors.
26688 2001-11-09 Miguel de Icaza <miguel@ximian.com>
26690 * cs-parser.jay: A for_initializer if is a
26691 local_variable_declaration really ammount to have an implicit
26692 block with the variable declaration and no initializer for for.
26694 * statement.cs (For.Emit): Cope with null initializers.
26696 This fixes the infinite loop on for initializers.
26698 2001-11-08 Miguel de Icaza <miguel@ximian.com>
26700 * enum.cs: More cleanup.
26702 * ecore.cs: Remove dead code.
26704 * class.cs (Property.Emit): More simplification.
26705 (Event.Emit): ditto.
26707 Reworked to have less levels of indentation.
26709 2001-11-08 Ravi Pratap <ravi@ximian.com>
26711 * class.cs (Property): Emit attributes.
26721 * enum.cs (Emit): Ditto.
26723 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
26726 * class.cs (Field, Event, etc.): Move attribute generation into the
26727 Emit method everywhere.
26729 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
26730 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
26731 as we had no way of defining nested enums !
26733 * rootcontext.cs : Adjust code accordingly.
26735 * typemanager.cs (AddEnumType): To keep track of enum types separately.
26737 2001-11-07 Ravi Pratap <ravi@ximian.com>
26739 * expression.cs (EvalConstantExpression): Move into ecore.cs
26741 * enum.cs (Enum): Rename some members and make them public and readonly
26742 according to our convention.
26744 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
26747 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
26749 (Enum::Emit): Write a simple version for now which doesn't try to compute
26750 expressions. I shall modify this to be more robust in just a while.
26752 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
26754 (TypeContainer::CloseType): Create the Enum types too.
26756 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
26758 * expression.cs (EvalConstantExpression): Get rid of completely.
26760 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
26761 user-defined values and other cases.
26763 (IsValidEnumLiteral): Helper function.
26765 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
26766 out there in the case we had a literal FieldExpr.
26768 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
26770 (Literalize): Revamp a bit to take two arguments.
26772 (EnumLiteral): New class which derives from Literal to wrap enum literals.
26774 2001-11-06 Ravi Pratap <ravi@ximian.com>
26776 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
26778 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
26780 (Resolve): Use the above to ensure we have proper initializers.
26782 2001-11-05 Ravi Pratap <ravi@ximian.com>
26784 * expression.cs (Expression::EvalConstantExpression): New method to
26785 evaluate constant expressions.
26787 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
26789 2001-11-07 Miguel de Icaza <miguel@ximian.com>
26791 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
26794 (Binary.ResolveOperator): Handle operator != (object a, object b)
26795 and operator == (object a, object b);
26797 (Binary.DoNumericPromotions): Indicate whether the numeric
26798 promotion was possible.
26800 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
26803 Made the ArrayAccess implement interface IAssignMethod instead of
26804 IStackStore as the order in which arguments are passed reflects
26807 * assign.cs: Instead of using expr.ExprClass to select the way of
26808 assinging, probe for the IStackStore/IAssignMethod interfaces.
26810 * typemanager.cs: Load InitializeArray definition.
26812 * rootcontext.cs (RootContext.MakeStaticData): Used to define
26813 static data that can be used to initialize arrays.
26815 2001-11-05 Miguel de Icaza <miguel@ximian.com>
26817 * expression.cs: Handle operator== and operator!= for booleans.
26819 (Conditioal.Reduce): Implement reducer for the ?: operator.
26821 (Conditional.Resolve): Implement dead code elimination.
26823 (Binary.Resolve): Catch string literals and return a new
26824 concatenated string.
26826 (Unary.Reduce): Implement reduction of unary expressions.
26828 * ecore.cs: Split out the expression core handling here.
26830 (Expression.Reduce): New method used to perform constant folding
26831 and CSE. This is needed to support constant-expressions.
26833 * statement.cs (Statement.EmitBoolExpression): Pass true and false
26834 targets, and optimize for !x.
26836 2001-11-04 Ravi Pratap <ravi@ximian.com>
26838 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
26839 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
26840 set custom atttributes.
26842 * literal.cs (Literal::GetValue): New abstract method to return the actual
26843 value of the literal, cast as an object.
26845 (*Literal): Implement GetValue method.
26847 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
26848 expressions to the arraylist but objects of type Argument.
26850 * class.cs (TypeContainer::Emit): Emit our attributes too.
26852 (Method::Emit, Constructor::Emit): Ditto.
26854 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
26855 to be ignoring earlier.
26857 2001-11-03 Ravi Pratap <ravi@ximian.com>
26859 * attribute.cs (AttributeSection::Define): Implement to do the business
26860 of constructing a CustomAttributeBuilder.
26862 (Attribute): New trivial class. Increases readability of code.
26864 * cs-parser.jay : Update accordingly.
26866 (positional_argument_list, named_argument_list, named_argument): New rules
26868 (attribute_arguments): Use the above so that we are more correct.
26870 2001-11-02 Ravi Pratap <ravi@ximian.com>
26872 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
26873 to perform all checks for a method with a params parameter.
26875 (Invocation::OverloadResolve): Update to use the above method and therefore
26876 cope correctly with params method invocations.
26878 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
26881 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
26882 constructors in our parent too because we can't afford to miss out on
26885 * attribute.cs (AttributeSection): New name for the class Attribute
26887 Other trivial changes to improve readability.
26889 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
26890 use the new class names.
26892 2001-11-01 Ravi Pratap <ravi@ximian.com>
26894 * class.cs (Method::Define): Complete definition for params types too
26896 (Indexer::Define): Ditto.
26898 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
26899 Cope everywhere with a request for info about the array parameter.
26901 2001-11-01 Ravi Pratap <ravi@ximian.com>
26903 * tree.cs (RecordNamespace): Fix up to check for the correct key.
26905 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
26906 local_variable_type to extract the string corresponding to the type.
26908 (local_variable_type): Fixup the action to use the new helper method.
26910 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
26913 * expression.cs : Clean out code which uses the above.
26915 2001-10-31 Ravi Pratap <ravi@ximian.com>
26917 * typemanager.cs (RegisterMethod): Check if we already have an existing key
26918 and bale out if necessary by returning a false.
26920 (RegisterProperty): Ditto.
26922 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
26923 and print out appropriate error messages.
26925 * interface.cs (everywhere): Ditto.
26927 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
26928 location to constructor.
26930 * class.cs (Property, Event, Indexer): Update accordingly.
26932 * ../errors/cs111.cs : Added.
26934 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
26935 of a method, as laid down by the spec.
26937 (Invocation::OverloadResolve): Use the above method.
26939 2001-10-31 Ravi Pratap <ravi@ximian.com>
26941 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
26942 now take a TypeContainer and a Parameters object.
26944 (ParameterData): Modify return type of ParameterModifier method to be
26945 Parameter.Modifier and not a string.
26947 (ReflectionParameters, InternalParameters): Update accordingly.
26949 * expression.cs (Argument::GetParameterModifier): Same here.
26951 * support.cs (InternalParameters::ParameterType): Find a better way of determining
26952 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
26953 symbol in it at all so maybe this is only for now.
26955 2001-10-30 Ravi Pratap <ravi@ximian.com>
26957 * support.cs (InternalParameters): Constructor now takes an extra argument
26958 which is the actual Parameters class.
26960 (ParameterDesc): Update to provide info on ref/out modifiers.
26962 * class.cs (everywhere): Update call to InternalParameters to pass in
26963 the second argument too.
26965 * support.cs (ParameterData): Add ParameterModifier, which is a method
26966 to return the modifier info [ref/out etc]
26968 (InternalParameters, ReflectionParameters): Implement the above.
26970 * expression.cs (Argument::ParameterModifier): Similar function to return
26971 info about the argument's modifiers.
26973 (Invocation::OverloadResolve): Update to take into account matching modifiers
26976 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
26977 a new SetFormalParameters object which we pass to InternalParameters.
26979 2001-10-30 Ravi Pratap <ravi@ximian.com>
26981 * expression.cs (NewArray): Merge into the ArrayCreation class.
26983 2001-10-29 Ravi Pratap <ravi@ximian.com>
26985 * expression.cs (NewArray): Merge classes NewBuiltinArray and
26986 NewUserdefinedArray into one as there wasn't much of a use in having
26989 * expression.cs (Argument): Change field's name to ArgType from Type.
26991 (Type): New readonly property which returns the proper type, taking into
26992 account ref/out modifiers.
26994 (everywhere): Adjust code accordingly for the above.
26996 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
26997 whether we are emitting for a ref or out parameter.
26999 * expression.cs (Argument::Emit): Use the above field to set the state.
27001 (LocalVariableReference::Emit): Update to honour the flag and emit the
27004 * parameter.cs (Attributes): Set the correct flags for ref parameters.
27006 * expression.cs (Argument::FullDesc): New function to provide a full desc.
27008 * support.cs (ParameterData): Add method ParameterDesc to the interface.
27010 (ReflectionParameters, InternalParameters): Implement the above method.
27012 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
27015 (Invocation::FullMethodDesc): Ditto.
27017 2001-10-29 Miguel de Icaza <miguel@ximian.com>
27019 * cs-parser.jay: Add extra production for the second form of array
27022 * expression.cs (ArrayCreation): Update to reflect the above
27025 * Small changes to prepare for Array initialization.
27027 2001-10-28 Miguel de Icaza <miguel@ximian.com>
27029 * typemanager.cs (ImplementsInterface): interface might be null;
27030 Deal with this problem;
27032 Also, we do store negative hits on the cache (null values), so use
27033 this instead of calling t.GetInterfaces on the type everytime.
27035 2001-10-28 Ravi Pratap <ravi@ximian.com>
27037 * typemanager.cs (IsBuiltinType): New method to help determine the same.
27039 * expression.cs (New::DoResolve): Get rid of array creation code and instead
27040 split functionality out into different classes.
27042 (New::FormArrayType): Move into NewBuiltinArray.
27044 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
27047 (NewBuiltinArray): New class to handle creation of built-in arrays.
27049 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
27050 account creation of one-dimensional arrays.
27052 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
27054 (NewUserdefinedArray::DoResolve): Implement.
27056 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
27058 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
27059 we maintain inside the TypeManager. This is necessary to perform lookups on the
27062 (LookupType): Update to perform GetType on the module builders too.
27064 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
27066 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
27068 2001-10-23 Ravi Pratap <ravi@ximian.com>
27070 * expression.cs (New::DoResolve): Implement guts of array creation.
27072 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
27074 2001-10-27 Miguel de Icaza <miguel@ximian.com>
27076 * expression.cs: Fix bug I introduced lsat night that broke
27079 (Expression.Resolve): Report a 246 error (can not resolve name)
27080 if we find a SimpleName in the stream.
27082 (Expression.ResolveLValue): Ditto.
27084 (Expression.ResolveWithSimpleName): This function is a variant of
27085 ResolveName, this one allows SimpleNames to be returned without a
27086 warning. The only consumer of SimpleNames is MemberAccess
27088 2001-10-26 Miguel de Icaza <miguel@ximian.com>
27090 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
27091 might arrive here. I have my doubts that this is correct.
27093 * statement.cs (Lock): Implement lock statement.
27095 * cs-parser.jay: Small fixes to support `lock' and `using'
27097 * cs-tokenizer.cs: Remove extra space
27099 * driver.cs: New flag --checked, allows to turn on integer math
27102 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
27103 Threading.Monitor.Exit
27105 2001-10-23 Miguel de Icaza <miguel@ximian.com>
27107 * expression.cs (IndexerAccess::DoResolveLValue): Set the
27108 Expression Class to be IndexerAccess.
27110 Notice that Indexer::DoResolve sets the eclass to Value.
27112 2001-10-22 Miguel de Icaza <miguel@ximian.com>
27114 * class.cs (TypeContainer::Emit): Emit code for indexers.
27116 * assign.cs (IAssignMethod): New interface implemented by Indexers
27117 and Properties for handling assignment.
27119 (Assign::Emit): Simplify and reuse code.
27121 * expression.cs (IndexerAccess, PropertyExpr): Implement
27122 IAssignMethod, clean up old code.
27124 2001-10-22 Ravi Pratap <ravi@ximian.com>
27126 * typemanager.cs (ImplementsInterface): New method to determine if a type
27127 implements a given interface. Provides a nice cache too.
27129 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
27132 (ConvertReferenceExplicit): Ditto.
27134 * delegate.cs (Delegate::Populate): Update to define the parameters on the
27135 various methods, with correct names etc.
27137 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
27138 Operator.UnaryNegation.
27140 * cs-parser.jay (operator_declarator): Be a little clever in the case where
27141 we have a unary plus or minus operator.
27143 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
27146 * everywhere : update accordingly.
27148 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
27151 * class.cs (Method::Define): For the case where we are implementing a method
27152 inherited from an interface, we need to set the MethodAttributes.Final flag too.
27153 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
27155 2001-10-21 Ravi Pratap <ravi@ximian.com>
27157 * interface.cs (FindMembers): Implement to work around S.R.E
27160 * typemanager.cs (IsInterfaceType): Implement.
27162 (FindMembers): Update to handle interface types too.
27164 * expression.cs (ImplicitReferenceConversion): Re-write bits which
27165 use IsAssignableFrom as that is not correct - it doesn't work.
27167 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
27168 and accordingly override EmitStatement.
27170 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
27171 using the correct logic :-)
27173 2001-10-19 Ravi Pratap <ravi@ximian.com>
27175 * ../errors/cs-11.cs : Add to demonstrate error -11
27177 2001-10-17 Miguel de Icaza <miguel@ximian.com>
27179 * assign.cs (Assign::Resolve): Resolve right hand side first, and
27180 then pass this as a hint to ResolveLValue.
27182 * expression.cs (FieldExpr): Add Location information
27184 (FieldExpr::LValueResolve): Report assignment to readonly
27187 (Expression::ExprClassFromMemberInfo): Pass location information.
27189 (Expression::ResolveLValue): Add new method that resolves an
27192 (Expression::DoResolveLValue): Default invocation calls
27195 (Indexers): New class used to keep track of indexers in a given
27198 (IStackStore): Renamed from LValue, as it did not really describe
27199 what this did. Also ResolveLValue is gone from this interface and
27200 now is part of Expression.
27202 (ElementAccess): Depending on the element access type
27204 * typemanager.cs: Add `indexer_name_type' as a Core type
27205 (System.Runtime.CompilerServices.IndexerNameAttribute)
27207 * statement.cs (Goto): Take a location.
27209 2001-10-18 Ravi Pratap <ravi@ximian.com>
27211 * delegate.cs (Delegate::VerifyDelegate): New method to verify
27212 if two delegates are compatible.
27214 (NewDelegate::DoResolve): Update to take care of the case when
27215 we instantiate a delegate from another delegate.
27217 * typemanager.cs (FindMembers): Don't even try to look up members
27218 of Delegate types for now.
27220 2001-10-18 Ravi Pratap <ravi@ximian.com>
27222 * delegate.cs (NewDelegate): New class to take care of delegate
27225 * expression.cs (New): Split the delegate related code out into
27226 the NewDelegate class.
27228 * delegate.cs (DelegateInvocation): New class to handle delegate
27231 * expression.cs (Invocation): Split out delegate related code into
27232 the DelegateInvocation class.
27234 2001-10-17 Ravi Pratap <ravi@ximian.com>
27236 * expression.cs (New::DoResolve): Implement delegate creation fully
27237 and according to the spec.
27239 (New::DoEmit): Update to handle delegates differently.
27241 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
27242 because of which we were printing out arguments in reverse order !
27244 * delegate.cs (VerifyMethod): Implement to check if the given method
27245 matches the delegate.
27247 (FullDelegateDesc): Implement.
27249 (VerifyApplicability): Implement.
27251 * expression.cs (Invocation::DoResolve): Update to accordingly handle
27252 delegate invocations too.
27254 (Invocation::Emit): Ditto.
27256 * ../errors/cs1593.cs : Added.
27258 * ../errors/cs1594.cs : Added.
27260 * delegate.cs (InstanceExpression, TargetMethod): New properties.
27262 2001-10-16 Ravi Pratap <ravi@ximian.com>
27264 * typemanager.cs (intptr_type): Core type for System.IntPtr
27266 (InitCoreTypes): Update for the same.
27268 (iasyncresult_type, asynccallback_type): Ditto.
27270 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
27273 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
27276 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
27277 the builders for the 4 members of a delegate type :-)
27279 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
27282 * expression.cs (New::DoResolve): Implement guts for delegate creation.
27284 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
27286 2001-10-15 Miguel de Icaza <miguel@ximian.com>
27288 * statement.cs (Break::Emit): Implement.
27289 (Continue::Emit): Implement.
27291 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
27292 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
27293 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
27294 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
27297 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
27298 properties that track the label for the current loop (begin of the
27299 loop and end of the loop).
27301 2001-10-15 Ravi Pratap <ravi@ximian.com>
27303 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
27304 use of emitting anything at all.
27306 * class.cs, rootcontext.cs : Get rid of calls to the same.
27308 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
27310 (Populate): Define the constructor correctly and set the implementation
27313 * typemanager.cs (delegate_types): New hashtable to hold delegates that
27316 (AddDelegateType): Implement.
27318 (IsDelegateType): Implement helper method.
27320 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
27322 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
27323 and accordingly handle it.
27325 * delegate.cs (Populate): Take TypeContainer argument.
27326 Implement bits to define the Invoke method. However, I still haven't figured out
27327 how to take care of the native int bit :-(
27329 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
27330 Qualify the name of the delegate, not its return type !
27332 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
27335 (StandardConversionExists): Checking for array types turns out to be recursive.
27337 (ConvertReferenceExplicit): Implement array conversion.
27339 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
27341 2001-10-12 Ravi Pratap <ravi@ximian.com>
27343 * cs-parser.jay (delegate_declaration): Store the fully qualified
27344 name as it is a type declaration.
27346 * delegate.cs (ReturnType, Name): Rename members to these. Make them
27349 (DefineDelegate): Renamed from Define. Does the same thing essentially,
27350 as TypeContainer::DefineType.
27352 (Populate): Method in which all the definition of the various methods (Invoke)
27355 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
27358 (CloseDelegate): Finally creates the delegate.
27360 * class.cs (TypeContainer::DefineType): Update to define delegates.
27361 (Populate, Emit and CloseType): Do the same thing here too.
27363 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
27364 delegates in all these operations.
27366 2001-10-14 Miguel de Icaza <miguel@ximian.com>
27368 * expression.cs: LocalTemporary: a new expression used to
27369 reference a temporary that has been created.
27371 * assign.cs: Handle PropertyAccess back here, so that we can
27372 provide the proper semantic access to properties.
27374 * expression.cs (Expression::ConvertReferenceExplicit): Implement
27375 a few more explicit conversions.
27377 * modifiers.cs: `NEW' modifier maps to HideBySig.
27379 * expression.cs (PropertyExpr): Make this into an
27380 ExpressionStatement, and support the EmitStatement code path.
27382 Perform get/set error checking, clean up the interface.
27384 * assign.cs: recognize PropertyExprs as targets, and if so, turn
27385 them into toplevel access objects.
27387 2001-10-12 Miguel de Icaza <miguel@ximian.com>
27389 * expression.cs: PropertyExpr::PropertyExpr: use work around the
27392 * typemanager.cs: Keep track here of our PropertyBuilders again to
27393 work around lameness in SRE.
27395 2001-10-11 Miguel de Icaza <miguel@ximian.com>
27397 * expression.cs (LValue::LValueResolve): New method in the
27398 interface, used to perform a second resolution pass for LValues.
27400 (This::DoResolve): Catch the use of this in static methods.
27402 (This::LValueResolve): Implement.
27404 (This::Store): Remove warning, assigning to `this' in structures
27407 (Invocation::Emit): Deal with invocation of
27408 methods on value types. We need to pass the address to structure
27409 methods rather than the object itself. (The equivalent code to
27410 emit "this" for structures leaves the entire structure on the
27411 stack instead of a pointer to it).
27413 (ParameterReference::DoResolve): Compute the real index for the
27414 argument based on whether the method takes or not a `this' pointer
27415 (ie, the method is static).
27417 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
27418 value types returned from functions when we need to invoke a
27419 method on the sturcture.
27422 2001-10-11 Ravi Pratap <ravi@ximian.com>
27424 * class.cs (TypeContainer::DefineType): Method to actually do the business of
27425 defining the type in the Modulebuilder or Typebuilder. This is to take
27426 care of nested types which need to be defined on the TypeBuilder using
27427 DefineNestedMethod.
27429 (TypeContainer::GetClassBases): Implement. Essentially the code from the
27430 methods in RootContext, only ported to be part of TypeContainer.
27432 (TypeContainer::GetInterfaceOrClass): Ditto.
27434 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
27436 * interface.cs (Interface::DefineInterface): New method. Does exactly
27437 what RootContext.CreateInterface did earlier, only it takes care of nested types
27440 (Interface::GetInterfaces): Move from RootContext here and port.
27442 (Interface::GetInterfaceByName): Same here.
27444 * rootcontext.cs (ResolveTree): Re-write.
27446 (PopulateTypes): Re-write.
27448 * class.cs (TypeContainer::Populate): Populate nested types too.
27449 (TypeContainer::Emit): Emit nested members too.
27451 * typemanager.cs (AddUserType): Do not make use of the FullName property,
27452 instead just use the name argument passed in as it is already fully
27455 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
27456 to TypeContainer mapping to see if a type is user-defined.
27458 * class.cs (TypeContainer::CloseType): Implement.
27460 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
27461 the default constructor.
27463 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
27466 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
27468 * interface.cs (CloseType): Create the type here.
27470 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
27473 Remove all the methods which are now in TypeContainer.
27475 2001-10-10 Ravi Pratap <ravi@ximian.com>
27477 * delegate.cs (Define): Re-write bits to define the delegate
27480 2001-10-10 Miguel de Icaza <miguel@ximian.com>
27482 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
27484 * expression.cs (ImplicitReferenceConversion): handle null as well
27485 as a source to convert to any reference type.
27487 * statement.cs (Return): Perform any implicit conversions to
27488 expected return type.
27490 Validate use of return statement.
27492 * codegen.cs (EmitContext): Pass the expected return type here.
27494 * class.cs (Method, Constructor, Property): Pass expected return
27495 type to EmitContext.
27497 2001-10-09 Miguel de Icaza <miguel@ximian.com>
27499 * expression.cs: Make DoResolve take an EmitContext instead of a
27502 Replaced `l' and `location' for `loc', for consistency.
27504 (Error, Warning): Remove unneeded Tc argument.
27506 * assign.cs, literal.cs, constant.cs: Update to new calling
27509 * codegen.cs: EmitContext now contains a flag indicating whether
27510 code is being generated in a static method or not.
27512 * cs-parser.jay: DecomposeQI, new function that replaces the old
27513 QualifiedIdentifier. Now we always decompose the assembled
27514 strings from qualified_identifier productions into a group of
27517 2001-10-08 Miguel de Icaza <miguel@ximian.com>
27519 * rootcontext.cs: Deal with field-less struct types correctly now
27520 by passing the size option to Define Type.
27522 * class.cs: Removed hack that created one static field.
27524 2001-10-07 Miguel de Icaza <miguel@ximian.com>
27526 * statement.cs: Moved most of the code generation here.
27528 2001-10-09 Ravi Pratap <ravi@ximian.com>
27530 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
27533 (ElementAccess): Remove useless bits for now - keep checks as the spec
27536 2001-10-08 Ravi Pratap <ravi@ximian.com>
27538 * expression.cs (ElementAccess::DoResolve): Remove my crap code
27539 and start performing checks according to the spec.
27541 2001-10-07 Ravi Pratap <ravi@ximian.com>
27543 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
27544 rank_specifiers instead.
27546 (rank_specifiers): Change the order in which the rank specifiers are stored
27548 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
27550 * expression.cs (ElementAccess): Implement the LValue interface too.
27552 2001-10-06 Ravi Pratap <ravi@ximian.com>
27554 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
27555 except that user defined conversions are not included.
27557 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
27558 perform the conversion of the return type, if necessary.
27560 (New::DoResolve): Check whether we are creating an array or an object
27561 and accordingly do the needful.
27563 (New::Emit): Same here.
27565 (New::DoResolve): Implement guts of array creation.
27567 (New::FormLookupType): Helper function.
27569 2001-10-07 Miguel de Icaza <miguel@ximian.com>
27571 * codegen.cs: Removed most of the code generation here, and move the
27572 corresponding code generation bits to the statement classes.
27574 Added support for try/catch/finalize and throw.
27576 * cs-parser.jay: Added support for try/catch/finalize.
27578 * class.cs: Catch static methods having the flags override,
27579 virtual or abstract.
27581 * expression.cs (UserCast): This user cast was not really doing
27582 what it was supposed to do. Which is to be born in fully resolved
27583 state. Parts of the resolution were being performed at Emit time!
27587 2001-10-05 Miguel de Icaza <miguel@ximian.com>
27589 * expression.cs: Implicity convert the result from UserCast.
27591 2001-10-05 Ravi Pratap <ravi@ximian.com>
27593 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
27594 prevented it from working correctly.
27596 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
27597 merely ConvertImplicit.
27599 2001-10-05 Miguel de Icaza <miguel@ximian.com>
27601 * typemanager.cs: Make the LookupTypeContainer function static,
27602 and not per-instance.
27604 * class.cs: Make static FindMembers (the one that takes a Type
27607 * codegen.cs: Add EmitForeach here.
27609 * cs-parser.jay: Make foreach a toplevel object instead of the
27610 inline expansion, as we need to perform semantic analysis on it.
27612 2001-10-05 Ravi Pratap <ravi@ximian.com>
27614 * expression.cs (Expression::ImplicitUserConversion): Rename to
27615 UserDefinedConversion.
27617 (Expression::UserDefinedConversion): Take an extra argument specifying
27618 whether we look for explicit user conversions too.
27620 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
27622 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
27624 (ExplicitUserConversion): Make it a call to UserDefinedConversion
27625 with the appropriate arguments.
27627 * cs-parser.jay (cast_expression): Record location too.
27629 * expression.cs (Cast): Record location info.
27631 (Expression::ConvertExplicit): Take location argument.
27633 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
27634 to determine if we are doing explicit conversions.
27636 (UserCast::Emit): Update accordingly.
27638 (Expression::ConvertExplicit): Report an error if everything fails.
27640 * ../errors/cs0030.cs : Add.
27642 2001-10-04 Miguel de Icaza <miguel@ximian.com>
27644 * modifiers.cs: If the ABSTRACT keyword is present, also set the
27645 virtual and newslot bits.
27647 * class.cs (TypeContainer::RegisterRequiredImplementations):
27648 Record methods we need.
27650 (TypeContainer::MakeKey): Helper function to make keys for
27651 MethodBases, since the Methodbase key is useless.
27653 (TypeContainer::Populate): Call RegisterRequiredImplementations
27654 before defining the methods.
27656 Create a mapping for method_builders_to_methods ahead of time
27657 instead of inside a tight loop.
27659 (::RequireMethods): Accept an object as the data to set into the
27660 hashtable so we can report interface vs abstract method mismatch.
27662 2001-10-03 Miguel de Icaza <miguel@ximian.com>
27664 * report.cs: Make all of it static.
27666 * rootcontext.cs: Drop object_type and value_type computations, as
27667 we have those in the TypeManager anyways.
27669 Drop report instance variable too, now it is a global.
27671 * driver.cs: Use try/catch on command line handling.
27673 Add --probe option to debug the error reporting system with a test
27676 * report.cs: Add support for exiting program when a probe
27677 condition is reached.
27679 2001-10-03 Ravi Pratap <ravi@ximian.com>
27681 * expression.cs (Binary::DoNumericPromotions): Fix the case when
27682 we do a forcible conversion regardless of type, to check if
27683 ForceConversion returns a null.
27685 (Binary::error19): Use location to report error.
27687 (Unary::error23): Use location here too.
27689 * ../errors/cs0019.cs : Check in.
27691 * ../errors/cs0023.cs : Check in.
27693 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
27694 case of a non-null MethodInfo object with a length of 0 !
27696 (Binary::ResolveOperator): Flag error if overload resolution fails to find
27697 an applicable member - according to the spec :-)
27698 Also fix logic to find members in base types.
27700 (Unary::ResolveOperator): Same here.
27702 (Unary::report23): Change name to error23 and make first argument a TypeContainer
27703 as I was getting thoroughly confused between this and error19 :-)
27705 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
27706 (::FindMostEncompassedType): Implement.
27707 (::FindMostEncompassingType): Implement.
27708 (::StandardConversionExists): Implement.
27710 (UserImplicitCast): Re-vamp. We now need info about most specific
27711 source and target types so that we can do the necessary conversions.
27713 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
27714 mathematical union with no duplicates.
27716 2001-10-03 Miguel de Icaza <miguel@ximian.com>
27718 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
27719 in order from base classes to child classes, so that we can in
27720 child classes look up in our parent for method names and
27721 attributes (required for handling abstract, virtual, new, override
27722 constructs: we need to instrospect our base class, and if we dont
27723 populate the classes in order, the introspection might be
27724 incorrect. For example, a method could query its parent before
27725 the parent has any methods and would determine that the parent has
27726 no abstract methods (while it could have had them)).
27728 (RootContext::CreateType): Record the order in which we define the
27731 2001-10-02 Miguel de Icaza <miguel@ximian.com>
27733 * class.cs (TypeContainer::Populate): Also method definitions can
27734 fail now, keep track of this.
27736 (TypeContainer::FindMembers): Implement support for
27737 DeclaredOnly/noDeclaredOnly flag.
27739 (Constructor::Emit) Return the ConstructorBuilder.
27741 (Method::Emit) Return the MethodBuilder.
27742 Check for abstract or virtual methods to be public.
27744 * rootcontext.cs (RootContext::CreateType): Register all the
27745 abstract methods required for the class to be complete and the
27746 interface methods that must be implemented.
27748 * cs-parser.jay: Report error 501 (method requires body if it is
27749 not marked abstract or extern).
27751 * expression.cs (TypeOf::Emit): Implement.
27753 * typemanager.cs: runtime_handle_type, new global type.
27755 * class.cs (Property::Emit): Generate code for properties.
27757 2001-10-02 Ravi Pratap <ravi@ximian.com>
27759 * expression.cs (Unary::ResolveOperator): Find operators on base type
27760 too - we now conform exactly to the spec.
27762 (Binary::ResolveOperator): Same here.
27764 * class.cs (Operator::Define): Fix minor quirk in the tests.
27766 * ../errors/cs0215.cs : Added.
27768 * ../errors/cs0556.cs : Added.
27770 * ../errors/cs0555.cs : Added.
27772 2001-10-01 Miguel de Icaza <miguel@ximian.com>
27774 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
27775 single integer which is really efficient
27777 2001-10-01 Ravi Pratap <ravi@ximian.com>
27779 * expression.cs (Expression::ImplicitUserConversion): Use location
27780 even in the case when we are examining True operators.
27782 * class.cs (Operator::Define): Perform extensive checks to conform
27783 with the rules for operator overloading in the spec.
27785 * expression.cs (Expression::ImplicitReferenceConversion): Implement
27786 some of the other conversions mentioned in the spec.
27788 * typemanager.cs (array_type): New static member for the System.Array built-in
27791 (cloneable_interface): For System.ICloneable interface.
27793 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
27794 we start resolving the tree and populating types.
27796 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
27798 2001-10-01 Miguel de Icaza <miguel@ximian.com>
27800 * expression.cs (Expression::ExprClassFromMemberInfo,
27801 Expression::Literalize): Create literal expressions from
27802 FieldInfos which are literals.
27804 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
27805 type casts, because they were wrong. The test suite in tests
27808 (ImplicitNumericConversion): ushort to ulong requires a widening
27811 Int32 constant to long requires widening cast as well.
27813 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
27814 for integers because the type on the stack is not i4.
27816 2001-09-30 Miguel de Icaza <miguel@ximian.com>
27818 * expression.cs (report118): require location argument.
27820 * parameter.cs: Do not dereference potential null value.
27822 * class.cs: Catch methods that lack the `new' keyword when
27823 overriding a name. Report warnings when `new' is used without
27824 anything being there to override.
27826 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
27828 * class.cs: Only add constructor to hashtable if it is non-null
27829 (as now constructors can fail on define).
27831 (TypeManager, Class, Struct): Take location arguments.
27833 Catch field instance initialization in structs as errors.
27835 accepting_filter: a new filter for FindMembers that is static so
27836 that we dont create an instance per invocation.
27838 (Constructor::Define): Catch errors where a struct constructor is
27841 * cs-parser.jay: Pass location information for various new
27844 * delegate.cs (Delegate): take a location argument.
27846 * driver.cs: Do not call EmitCode if there were problesm in the
27847 Definition of the types, as many Builders wont be there.
27849 * decl.cs (Decl::Decl): Require a location argument.
27851 * cs-tokenizer.cs: Handle properly hex constants that can not fit
27852 into integers, and find the most appropiate integer for it.
27854 * literal.cs: Implement ULongLiteral.
27856 * rootcontext.cs: Provide better information about the location of
27857 failure when CreateType fails.
27859 2001-09-29 Miguel de Icaza <miguel@ximian.com>
27861 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
27864 * expression.cs (Binary::CheckShiftArguments): Add missing type
27866 (Binary::ResolveOperator): Add type to the logical and and logical
27867 or, Bitwise And/Or and Exclusive Or code paths, it was missing
27870 (Binary::DoNumericPromotions): In the case where either argument
27871 is ulong (and most signed types combined with ulong cause an
27872 error) perform implicit integer constant conversions as well.
27874 2001-09-28 Miguel de Icaza <miguel@ximian.com>
27876 * expression.cs (UserImplicitCast): Method should always be
27878 (Invocation::BetterConversion): Simplified test for IntLiteral.
27880 (Expression::ImplicitNumericConversion): Split this routine out.
27881 Put the code that performs implicit constant integer conversions
27884 (Expression::Resolve): Become a wrapper around DoResolve so we can
27885 check eclass and type being set after resolve.
27887 (Invocation::Badness): Remove this dead function
27889 (Binary::ResolveOperator): Do not compute the expensive argumnets
27890 unless we have a union for it.
27892 (Probe::Emit): Is needs to do an isinst and then
27893 compare against null.
27895 (::CanConvert): Added Location argument. If the Location argument
27896 is null (Location.Null), then we do not report errors. This is
27897 used by the `probe' mechanism of the Explicit conversion. We do
27898 not want to generate an error for something that the user
27899 explicitly requested to be casted. But the pipeline for an
27900 explicit cast first tests for potential implicit casts.
27902 So for now, if the Location is null, it means `Probe only' to
27903 avoid adding another argument. Might have to revise this
27906 (ClassCast): New class used to type cast objects into arbitrary
27907 classes (used in Explicit Reference Conversions).
27909 Implement `as' as well.
27911 Reverted all the patches from Ravi below: they were broken:
27913 * The use of `level' as a mechanism to stop recursive
27914 invocations is wrong. That was there just to catch the
27915 bug with a strack trace but not as a way of addressing
27918 To fix the problem we have to *understand* what is going
27919 on and the interactions and come up with a plan, not
27920 just get things going.
27922 * The use of the type conversion cache that I proposed
27923 last night had an open topic: How does this work across
27924 protection domains. A user defined conversion might not
27925 be public in the location where we are applying the
27926 conversion, a different conversion might be selected
27927 (ie, private A->B (better) but public B->A (worse),
27928 inside A, A->B applies, but outside it, B->A will
27931 * On top of that (ie, even if the above is solved),
27932 conversions in a cache need to be abstract. Ie, `To
27933 convert from an Int to a Short use an OpcodeCast', not
27934 `To convert from an Int to a Short use the OpcodeCast on
27935 the variable 5' (which is what this patch was doing).
27937 2001-09-28 Ravi Pratap <ravi@ximian.com>
27939 * expression.cs (Invocation::ConversionExists): Re-write to use
27940 the conversion cache
27942 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
27943 cache all conversions done, not just user-defined ones.
27945 (Invocation::BetterConversion): The real culprit. Use ConversionExists
27946 to determine if a conversion exists instead of acutually trying to
27947 perform the conversion. It's faster too.
27949 (Expression::ConvertExplicit): Modify to use ConversionExists to check
27950 and only then attempt the implicit conversion.
27952 2001-09-28 Ravi Pratap <ravi@ximian.com>
27954 * expression.cs (ConvertImplicit): Use a cache for conversions
27955 already found. Check level of recursion and bail out if necessary.
27957 2001-09-28 Miguel de Icaza <miguel@ximian.com>
27959 * typemanager.cs (string_concat_string_string, string_concat_object_object):
27960 Export standard methods that we expect for string operations.
27962 * statement.cs (Block::UsageWarning): Track usage of variables and
27963 report the errors for not used variables.
27965 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
27968 2001-09-27 Miguel de Icaza <miguel@ximian.com>
27970 * codegen.cs: remove unnneded code
27972 * expression.cs: Removed BuiltinTypeAccess class
27974 Fix the order in which implicit conversions are
27977 The previous fixed dropped support for boxed conversions (adding a
27978 test to the test suite now)
27980 (UserImplicitCast::CanConvert): Remove test for source being null,
27981 that code is broken. We should not feed a null to begin with, if
27982 we do, then we should track the bug where the problem originates
27983 and not try to cover it up here.
27985 Return a resolved expression of type UserImplicitCast on success
27986 rather than true/false. Ravi: this is what I was talking about,
27987 the pattern is to use a static method as a "constructor" for
27990 Also, do not create arguments until the very last minute,
27991 otherwise we always create the arguments even for lookups that
27992 will never be performed.
27994 (UserImplicitCast::Resolve): Eliminate, objects of type
27995 UserImplicitCast are born in a fully resolved state.
27997 * typemanager.cs (InitCoreTypes): Init also value_type
27998 (System.ValueType).
28000 * expression.cs (Cast::Resolve): First resolve the child expression.
28002 (LValue): Add new method AddressOf to be used by
28005 Change the argument of Store to take an EmitContext instead of an
28006 ILGenerator, because things like FieldExpr need to be able to call
28007 their children expression to generate the instance code.
28009 (Expression::Error, Expression::Warning): Sugar functions for
28012 (Expression::MemberLookup): Accept a TypeContainer instead of a
28013 Report as the first argument.
28015 (Expression::ResolvePrimary): Killed. I still want to improve
28016 this as currently the code is just not right.
28018 (Expression::ResolveMemberAccess): Simplify, but it is still
28021 (Unary::Resolve): Catch errors in AddressOf operators.
28023 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
28024 index to a byte for the short-version, or the compiler will choose
28025 the wrong Emit call, which generates the wrong data.
28027 (ParameterReference::Emit, ::Store): same.
28029 (FieldExpr::AddressOf): Implement.
28031 * typemanager.cs: TypeManager: made public variable instead of
28034 * driver.cs: document --fatal.
28036 * report.cs (ErrorMessage, WarningMessage): new names for the old
28037 Error and Warning classes.
28039 * cs-parser.jay (member_access): Turn built-in access to types
28040 into a normal simplename
28042 2001-09-27 Ravi Pratap <ravi@ximian.com>
28044 * expression.cs (Invocation::BetterConversion): Fix to cope
28045 with q being null, since this was introducing a bug.
28047 * expression.cs (ConvertImplicit): Do built-in conversions first.
28049 2001-09-27 Ravi Pratap <ravi@ximian.com>
28051 * expression.cs (UserImplicitCast::Resolve): Fix bug.
28053 2001-09-27 Ravi Pratap <ravi@ximian.com>
28055 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
28056 I had introduced long ago (what's new ?).
28058 * expression.cs (UserImplicitCast::CanConvert): Static method to do
28059 the work of all the checking.
28060 (ConvertImplicit): Call CanConvert and only then create object if necessary.
28061 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
28063 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
28064 that is the right way.
28066 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
28067 overloading resolution. Use everywhere instead of cutting and pasting code.
28069 (Binary::ResolveOperator): Use MakeUnionSet.
28071 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
28072 we have to convert to bool types. Not complete yet.
28074 2001-09-27 Miguel de Icaza <miguel@ximian.com>
28076 * typemanager.cs (TypeManager::CSharpName): support ushort.
28078 * expression.cs (Expression::TryImplicitIntConversion): Attempts
28079 to provide an expression that performsn an implicit constant int
28080 conversion (section 6.1.6).
28081 (Expression::ConvertImplicitRequired): Reworked to include
28082 implicit constant expression conversions.
28084 (Expression::ConvertNumericExplicit): Finished.
28086 (Invocation::Emit): If InstanceExpression is null, then it means
28087 that we perform a call on this.
28089 2001-09-26 Miguel de Icaza <miguel@ximian.com>
28091 * expression.cs (Unary::Emit): Remove some dead code.
28092 (Probe): Implement Resolve and Emit for `is'.
28093 (Expression::ConvertImplicitRequired): Attempt to do constant
28094 expression conversions here. Maybe should be moved to
28095 ConvertImplicit, but I am not sure.
28096 (Expression::ImplicitLongConstantConversionPossible,
28097 Expression::ImplicitIntConstantConversionPossible): New functions
28098 that tell whether is it possible to apply an implicit constant
28099 expression conversion.
28101 (ConvertNumericExplicit): Started work on explicit numeric
28104 * cs-parser.jay: Update operator constants.
28106 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
28107 (Parameters::GetSignature): Hook up VerifyArgs here.
28108 (Parameters::VerifyArgs): Verifies that no two arguments have the
28111 * class.cs (Operator): Update the operator names to reflect the
28112 ones that the spec expects (as we are just stringizing the
28115 * expression.cs (Unary::ResolveOperator): Fix bug: Use
28116 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
28117 previous usage did only work for our methods.
28118 (Expression::ConvertImplicit): Handle decimal implicit numeric
28119 conversions as well.
28120 (Expression::InternalTypeConstructor): Used to invoke constructors
28121 on internal types for default promotions.
28123 (Unary::Emit): Implement special handling for the pre/post
28124 increment/decrement for overloaded operators, as they need to have
28125 the same semantics as the other operators.
28127 (Binary::ResolveOperator): ditto.
28128 (Invocation::ConversionExists): ditto.
28129 (UserImplicitCast::Resolve): ditto.
28131 2001-09-26 Ravi Pratap <ravi@ximian.com>
28133 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
28134 operator, return after emitting body. Regression tests pass again !
28136 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
28137 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
28138 (Invocation::OverloadResolve): Ditto.
28139 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
28141 * everywhere : update calls to the above methods accordingly.
28143 2001-09-26 Miguel de Icaza <miguel@ximian.com>
28145 * assign.cs (Assign): Make it inherit from ExpressionStatement.
28147 * expression.cs (ExpressionStatement): New base class used for
28148 expressions that can appear in statements, so that we can provide
28149 an alternate path to generate expression that do not leave a value
28152 (Expression::Emit, and all the derivatives): We no longer return
28153 whether a value is left on the stack or not. Every expression
28154 after being emitted leaves a single value on the stack.
28156 * codegen.cs (EmitContext::EmitStatementExpression): Use the
28157 facilties of ExpressionStatement if possible.
28159 * cs-parser.jay: Update statement_expression.
28161 2001-09-25 Miguel de Icaza <miguel@ximian.com>
28163 * driver.cs: Change the wording of message
28165 2001-09-25 Ravi Pratap <ravi@ximian.com>
28167 * expression.cs (Binary::ResolveOperator): Had forgottten to set
28168 the type of the expression to the return type of the method if
28169 we have an overloaded operator match ! The regression tests pass again !
28170 (Unary::ResolveOperator): Ditto.
28172 * expression.cs (Invocation::ConversionExists): Correct the member lookup
28173 to find "op_Implicit", not "implicit" ;-)
28174 (UserImplicitCast): New class to take care of user-defined implicit conversions.
28175 (ConvertImplicit, ForceConversion): Take TypeContainer argument
28177 * everywhere : Correct calls to the above accordingly.
28179 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
28180 (ConvertImplicit): Do user-defined conversion if it exists.
28182 2001-09-24 Miguel de Icaza <miguel@ximian.com>
28184 * assign.cs: track location.
28185 (Resolve): Use implicit conversions on assignment.
28187 * literal.cs: Oops. Not good, Emit of short access values should
28188 pass (Bytes) or the wrong argument will be selected.
28190 * expression.cs (Unary::Emit): Emit code for -expr.
28192 (Unary::ResolveOperator): Handle `Substract' for non-constants
28193 (substract from zero from the non-constants).
28194 Deal with Doubles as well.
28196 (Expression::ConvertImplicitRequired): New routine that reports an
28197 error if no implicit conversion exists.
28199 (Invocation::OverloadResolve): Store the converted implicit
28200 expressions if we make them
28202 2001-09-24 Ravi Pratap <ravi@ximian.com>
28204 * class.cs (ConstructorInitializer): Take a Location argument.
28205 (ConstructorBaseInitializer): Same here.
28206 (ConstructorThisInitializer): Same here.
28208 * cs-parser.jay : Update all calls accordingly.
28210 * expression.cs (Unary, Binary, New): Take location argument.
28211 Update accordingly everywhere.
28213 * cs-parser.jay : Update all calls to the above to take a location
28216 * class.cs : Ditto.
28218 2001-09-24 Ravi Pratap <ravi@ximian.com>
28220 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
28221 (Invocation::BetterConversion): Same here
28222 (Invocation::ConversionExists): Ditto.
28224 (Invocation::ConversionExists): Implement.
28226 2001-09-22 Ravi Pratap <ravi@ximian.com>
28228 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
28229 Also take an additional TypeContainer argument.
28231 * All over : Pass in TypeContainer as argument to OverloadResolve.
28233 * typemanager.cs (CSharpName): Update to check for the string type and return
28236 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
28239 2001-09-21 Ravi Pratap <ravi@ximian.com>
28241 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
28242 (Invocation::BetterFunction): Implement.
28243 (Invocation::BetterConversion): Implement.
28244 (Invocation::ConversionExists): Skeleton, no implementation yet.
28246 Okay, things work fine !
28248 2001-09-21 Miguel de Icaza <miguel@ximian.com>
28250 * typemanager.cs: declare and load enum_type, delegate_type and
28253 * expression.cs (Expression::Emit): Now emit returns a value that
28254 tells whether a value is left on the stack or not. This strategy
28255 might be reveted tomorrow with a mechanism that would address
28256 multiple assignments.
28257 (Expression::report118): Utility routine to report mismatches on
28260 (Unary::Report23): Report impossible type/operator combination
28263 (Unary::IsIncrementableNumber): Whether the type can be
28264 incremented or decremented with add.
28265 (Unary::ResolveOperator): Also allow enumerations to be bitwise
28267 (Unary::ResolveOperator): Implement ++, !, ~,
28269 (Invocation::Emit): Deal with new Emit convetion.
28271 * All Expression derivatives: Updated their Emit method to return
28272 whether they leave values on the stack or not.
28274 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
28275 stack for expressions that are statements.
28277 2001-09-20 Miguel de Icaza <miguel@ximian.com>
28279 * expression.cs (LValue): New interface. Must be implemented by
28281 (LocalVariableReference, ParameterReference, FieldExpr): Implement
28284 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
28285 interface for generating code, simplifies the code.
28287 2001-09-20 Ravi Pratap <ravi@ximian.com>
28289 * expression.cs (everywhere): Comment out return statements in ::Resolve
28290 methods to avoid the warnings.
28292 2001-09-20 Miguel de Icaza <miguel@ximian.com>
28294 * driver.cs (parse): Report error 2001 if we can not open the
28297 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
28300 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
28303 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
28304 otherwise nested blocks end up with the same index.
28306 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
28308 * expression.cs: Instead of having FIXMEs in the Resolve
28309 functions, throw exceptions so it is obvious that we are facing a
28312 * cs-parser.jay (invocation_expression): Pass Location information.
28314 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
28315 Use a basename for those routines because .NET does not like paths
28318 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
28321 2001-09-19 Miguel de Icaza <miguel@ximian.com>
28323 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
28324 are loading the correct data types (throws an exception if not).
28325 (TypeManager::InitCoreTypes): Use CoreLookupType
28327 * expression.cs (Unary::ResolveOperator): return the child
28328 expression for expressions which are just +expr.
28329 (Unary::ResolveOperator): Return negative literals for -LITERAL
28330 expressions (otherwise they are Unary {Literal}).
28331 (Invocation::Badness): Take into account `Implicit constant
28332 expression conversions'.
28334 * literal.cs (LongLiteral): Implement long literal class.
28335 (IntLiteral): export the `Value' of the intliteral.
28337 2001-09-19 Ravi Pratap <ravi@ximian.com>
28339 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
28341 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
28342 instead of 'Operator'
28344 * expression.cs (Binary::ResolveOperator): Update accordingly.
28345 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
28348 * cs-parser.jay (unary_expression): Update to use the new names.
28350 * gen-treedump.cs (GetUnary): Same here.
28352 * expression.cs (Unary::Resolve): Implement.
28353 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
28354 operators are found instead of making noise ;-)
28355 (Unary::ResolveOperator): New method to do precisely the same thing which
28356 Binary::ResolveOperator does for Binary expressions.
28357 (Unary.method, .Arguments): Add.
28358 (Unary::OperName): Implement.
28359 (Unary::ForceConversion): Copy and Paste !
28361 * class.cs (Operator::Define): Fix a small bug for the case when we have
28364 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
28365 for the inbuilt operators. Only overloading works for now ;-)
28367 2001-09-18 Miguel de Icaza <miguel@ximian.com>
28369 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
28370 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
28372 * expression.cs (This::Emit): Implement.
28373 (This::Resolve): Implement.
28374 (TypeOf:Resolve): Implement.
28375 (Expression::ResolveSimpleName): Add an implicit this to instance
28377 (MemberAccess::Resolve): Deal with Parameters and Fields.
28378 Bind instance variable to Field expressions.
28379 (FieldExpr::Instance): New field used to track the expression that
28380 represents the object instance.
28381 (FieldExpr::Resolve): Track potential errors from MemberLookup not
28383 (FieldExpr::Emit): Implement.
28385 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
28386 the last instruction contains a return opcode to avoid generating
28387 the last `ret' instruction (this generates correct code, and it is
28388 nice to pass the peverify output).
28390 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
28391 initializer for static and instance variables.
28392 (Constructor::Emit): Allow initializer to be null in the case of
28393 static constructors. Only emit initializer for instance
28396 (TypeContainer::FindMembers): Return a null array if there are no
28399 Also fix the code for the MemberTypes.Method branch, as it was not
28400 scanning that for operators (or tried to access null variables before).
28402 * assign.cs (Assign::Emit): Handle instance and static fields.
28406 * driver.cs: Stop compilation if there are parse errors.
28408 * cs-parser.jay (constructor_declaration): Provide default base
28409 initializer for non-static constructors.
28410 (constructor_declarator): Do not provide a default base
28411 initializers if none was specified.
28412 Catch the fact that constructors should not have parameters.
28414 * class.cs: Do not emit parent class initializers for static
28415 constructors, that should be flagged as an error.
28417 2001-09-18 Ravi Pratap <ravi@ximian.com>
28419 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
28420 Move back code into TypeContainer::Populate.
28422 2001-09-18 Ravi Pratap <ravi@ximian.com>
28424 * class.cs (TypeContainer::AddConstructor): Fix the check to
28425 compare against Name, not Basename.
28426 (Operator::OpType): Change Plus and Minus to Add and Subtract.
28428 * cs-parser.jay : Update accordingly.
28430 * class.cs (TypeContainer::FindMembers): For the case where we are searching
28431 for methods, don't forget to look into the operators too.
28432 (RegisterMethodBuilder): Helper method to take care of this for
28433 methods, constructors and operators.
28434 (Operator::Define): Completely revamp.
28435 (Operator.OperatorMethod, MethodName): New fields.
28436 (TypeContainer::Populate): Move the registering of builders into
28437 RegisterMethodBuilder.
28438 (Operator::Emit): Re-write.
28440 * expression.cs (Binary::Emit): Comment out code path to emit method
28441 invocation stuff for the case when we have a user defined operator. I am
28442 just not able to get it right !
28444 2001-09-17 Miguel de Icaza <miguel@ximian.com>
28446 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
28449 (Expression::MemberLookup): Provide a version that allows to
28450 specify the MemberTypes and BindingFlags.
28452 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
28453 so it was not fetching variable information from outer blocks.
28455 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
28456 Beforefieldinit as it was buggy.
28458 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
28459 that Ravi put here.
28461 * class.cs (Constructor::Emit): Only emit if block is not null.
28462 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
28463 deal with this by semantically definining it as if the user had
28466 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
28467 constructors as we now "emit" them at a higher level.
28469 (TypeContainer::DefineDefaultConstructor): Used to define the
28470 default constructors if none was provided.
28472 (ConstructorInitializer): Add methods Resolve and Emit.
28474 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
28476 2001-09-17 Ravi Pratap <ravi@ximian.com>
28478 * class.cs (TypeContainer::EmitDefaultConstructor): Register
28479 the default constructor builder with our hashtable for methodbuilders
28482 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
28483 and argument_count is 0 in which case we have a match.
28484 (Binary::ResolveOperator): More null checking and miscellaneous coding
28487 2001-09-17 Ravi Pratap <ravi@ximian.com>
28489 * rootcontext.cs (IsNameSpace): Compare against null.
28491 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
28493 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
28494 and Unary::Operator.
28496 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
28499 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
28500 we have overloaded operators.
28501 (Binary::ResolveOperator): Implement the part which does the operator overload
28504 * class.cs (Operator::Emit): Implement.
28505 (TypeContainer::Emit): Emit the operators we have too.
28507 * expression.cs (Binary::Emit): Update to emit the appropriate code for
28508 the case when we have a user-defined operator.
28510 2001-09-17 Miguel de Icaza <miguel@ximian.com>
28512 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
28514 2001-09-16 Ravi Pratap <ravi@ximian.com>
28516 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
28517 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
28518 (Constructor::Emit): Implement.
28519 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
28520 if we have no work to do.
28521 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
28524 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
28525 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
28527 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
28530 2001-09-15 Ravi Pratap <ravi@ximian.com>
28532 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
28534 (Tree::RecordNamespace): Method to do what the name says ;-)
28535 (Tree::Namespaces): Property to get at the namespaces hashtable.
28537 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
28540 * rootcontext.cs (IsNamespace): Fixed it :-)
28542 2001-09-14 Miguel de Icaza <miguel@ximian.com>
28544 * class.cs (TypeContainer::FindMembers): Add support for
28546 (MethodCore): New class that encapsulates both the shared aspects
28547 of a Constructor and a Method.
28548 (Method, Constructor): Factored pieces into MethodCore.
28550 * driver.cs: Added --fatal which makes errors throw exceptions.
28551 Load System assembly as well as part of the standard library.
28553 * report.cs: Allow throwing exceptions on errors for debugging.
28555 * modifiers.cs: Do not use `parent', instead use the real type
28556 container to evaluate permission settings.
28558 * class.cs: Put Ravi's patch back in. He is right, and we will
28559 have to cope with the
28561 2001-09-14 Ravi Pratap <ravi@ximian.com>
28563 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
28564 FamORAssem, not FamANDAssem.
28566 2001-09-14 Miguel de Icaza <miguel@ximian.com>
28568 * driver.cs: Added --parse option that only parses its input files
28571 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
28572 incorrect. IsTopLevel is not used to tell whether an object is
28573 root_types or not (that can be achieved by testing this ==
28574 root_types). But to see if this is a top-level *class* (not
28575 necessarly our "toplevel" container).
28577 2001-09-14 Ravi Pratap <ravi@ximian.com>
28579 * enum.cs (Enum::Define): Modify to call the Lookup method on the
28580 parent instead of a direct call to GetType.
28582 2001-09-14 Ravi Pratap <ravi@ximian.com>
28584 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
28585 Modifiers.TypeAttr. This should just be a call to that method.
28587 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
28588 object so that we can determine if we are top-level or not.
28590 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
28593 * enum.cs (Enum::Define): Ditto.
28595 * modifiers.cs (FieldAttr): Re-write.
28597 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
28598 (TypeContainer::HaveStaticConstructor): New property to provide access
28599 to precisely that info.
28601 * modifiers.cs (MethodAttr): Re-write.
28602 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
28604 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
28605 of top-level types as claimed.
28607 2001-09-13 Miguel de Icaza <miguel@ximian.com>
28609 * expression.cs (MemberLookup): Fruitless attempt to lookup
28610 constructors. Maybe I need to emit default constructors? That
28611 might be it (currently .NET emits this for me automatically).
28612 (Invocation::OverloadResolve): Cope with Arguments == null.
28613 (Invocation::EmitArguments): new function, shared by the new
28614 constructor and us.
28615 (Invocation::Emit): Handle static and instance methods. Emit
28616 proper call instruction for virtual or non-virtual invocations.
28617 (New::Emit): Implement.
28618 (New::Resolve): Implement.
28619 (MemberAccess:Resolve): Implement.
28620 (MethodGroupExpr::InstanceExpression): used conforming to the spec
28621 to track instances.
28622 (FieldExpr::Resolve): Set type.
28624 * support.cs: Handle empty arguments.
28626 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
28627 SimpleLookup): Auxiliary routines to help parse a qualifier
28630 Update qualifier_identifier rule.
28632 * codegen.cs: Removed debugging messages.
28634 * class.cs: Make this a global thing, this acts just as a "key" to
28635 objects that we might have around.
28637 (Populate): Only initialize method_builders_to_methods once.
28639 * expression.cs (PropertyExpr): Initialize type from the
28642 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
28643 Resolve pattern. Attempt to implicitly convert value to boolean.
28646 * expression.cs: Set the type for the int32/int32 argument case.
28647 (Binary::ResolveOperator): Set the return type to boolean for
28648 comparission operators
28650 * typemanager.cs: Remove debugging print code.
28652 (Invocation::Resolve): resolve type.
28654 * class.cs: Allocate a MemberInfo of the correct size, as the code
28655 elsewhere depends on the test to reflect the correct contents.
28657 (Method::) Keep track of parameters, due to System.Reflection holes
28659 (TypeContainer::Populate): Keep track of MethodBuilders to Method
28662 (TypeContainer::FindMembers): Use ArrayList and then copy an array
28663 of the exact size and return that.
28665 (Class::LookupMethodByBuilder): New function that maps
28666 MethodBuilders to its methods. Required to locate the information
28667 on methods because System.Reflection bit us again.
28669 * support.cs: New file, contains an interface ParameterData and
28670 two implementations: ReflectionParameters and InternalParameters
28671 used to access Parameter information. We will need to grow this
28674 * expression.cs (Invocation::GetParameterData): implement a cache
28675 and a wrapper around the ParameterData creation for methods.
28676 (Invocation::OverloadResolve): Use new code.
28678 2001-09-13 Ravi Pratap <ravi@ximian.com>
28680 * class.cs (TypeContainer::EmitField): Remove and move into
28681 (Field::Define): here and modify accordingly.
28682 (Field.FieldBuilder): New member.
28683 (TypeContainer::Populate): Update accordingly.
28684 (TypeContainer::FindMembers): Implement.
28686 2001-09-13 Miguel de Icaza <miguel@ximian.com>
28688 * statement.cs: (VariableInfo::VariableType): New field to be
28689 initialized with the full type once it is resolved.
28691 2001-09-12 Miguel de Icaza <miguel@ximian.com>
28693 * parameter.cs (GetParameterInfo): Use a type cache to compute
28694 things only once, and to reuse this information
28696 * expression.cs (LocalVariableReference::Emit): Implement.
28697 (OpcodeCast::Emit): fix.
28699 (ParameterReference::Resolve): Implement.
28700 (ParameterReference::Emit): Implement.
28702 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
28703 that are expressions need to stay as Expressions.
28705 * typemanager.cs (CSharpName): Returns the C# name of a type if
28708 * expression.cs (Expression::ConvertImplicit): New function that
28709 implements implicit type conversions.
28711 (Expression::ImplicitReferenceConversion): Implements implicit
28712 reference conversions.
28714 (EmptyCast): New type for transparent casts.
28716 (OpcodeCast): New type for casts of types that are performed with
28717 a sequence of bytecodes.
28719 (BoxedCast): New type used for casting value types into reference
28720 types. Emits a box opcode.
28722 (Binary::DoNumericPromotions): Implements numeric promotions of
28723 and computation of the Binary::Type.
28725 (Binary::EmitBranchable): Optimization.
28727 (Binary::Emit): Implement code emission for expressions.
28729 * typemanager.cs (TypeManager): Added two new core types: sbyte
28732 2001-09-12 Ravi Pratap <ravi@ximian.com>
28734 * class.cs (TypeContainer::FindMembers): Method which does exactly
28735 what Type.FindMembers does, only we don't have to use reflection. No
28736 implementation yet.
28738 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
28739 typecontainer objects as we need to get at them.
28740 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
28742 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
28743 typecontainer object.
28745 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
28746 of just a Report object.
28748 2001-09-11 Ravi Pratap <ravi@ximian.com>
28750 * class.cs (Event::Define): Go back to using the prefixes "add_" and
28752 (TypeContainer::Populate): Now define the delegates of the type too.
28753 (TypeContainer.Delegates): Property to access the list of delegates defined
28756 * delegates.cs (Delegate::Define): Implement partially.
28758 * modifiers.cs (TypeAttr): Handle more flags.
28760 2001-09-11 Ravi Pratap <ravi@ximian.com>
28762 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
28764 (Operator::Define): Re-write logic to get types by using the LookupType method
28765 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
28766 (Indexer::Define): Ditto.
28767 (Event::Define): Ditto.
28768 (Property::Define): Ditto.
28770 2001-09-10 Ravi Pratap <ravi@ximian.com>
28772 * class.cs (TypeContainer::Populate): Now define operators too.
28773 (TypeContainer.Operators): New property to access the list of operators
28775 (Operator.OperatorMethodBuilder): New member to hold the method builder
28776 for the operator we are defining.
28777 (Operator::Define): Implement.
28779 2001-09-10 Ravi Pratap <ravi@ximian.com>
28781 * class.cs (Event::Define): Make the prefixes of the accessor methods
28782 addOn_ and removeOn_
28784 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
28785 of the location being passed in too. Ideally, this should go later since all
28786 error reporting should be done through the Report object.
28788 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
28789 (Populate): Iterate thru the indexers we have and define them too.
28790 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
28791 for the get and set accessors.
28792 (Indexer::Define): Implement.
28794 2001-09-09 Miguel de Icaza <miguel@ximian.com>
28796 * expression.cs (Binary::Resolve): Beginning of it. I scratched
28797 my previous implementation, did not work.
28799 * typemanager.cs: Add a couple of missing types (the longs).
28801 * literal.cs: Use TypeManager.bool_type instead of getting it.
28803 * expression.cs (EventExpr): New kind of expressions.
28804 (Expressio::ExprClassFromMemberInfo): finish
28806 2001-09-08 Miguel de Icaza <miguel@ximian.com>
28808 * assign.cs: Emit stores to static fields differently.
28810 2001-09-08 Ravi Pratap <ravi@ximian.com>
28812 * Merge in changes and adjust code to tackle conflicts. Backed out my
28813 code in Assign::Resolve ;-)
28815 2001-09-08 Ravi Pratap <ravi@ximian.com>
28817 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
28818 instead Report.Error and also pass in the location.
28819 (CSharpParser::Lexer): New readonly property to return the reference
28820 to the Tokenizer object.
28821 (declare_local_variables): Use Report.Error with location instead of plain
28825 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
28826 (Operator.CheckBinaryOperator): Ditto.
28828 * cs-parser.jay (operator_declarator): Update accordingly.
28830 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
28831 (CheckBinaryOperator): Same here.
28833 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
28834 on the name without any prefixes of namespace names etc. This is because we
28835 already might have something already fully qualified like
28836 'System.Console.WriteLine'
28838 * assign.cs (Resolve): Begin implementation. Stuck ;-)
28840 2001-09-07 Ravi Pratap <ravi@ximian.com>
28842 * cs-tokenizer.cs (location): Return a string which also contains
28845 * expression.cs (ElementAccess): New class for expressions of the
28846 type 'element access.'
28847 (BaseAccess): New class for expressions of the type 'base access.'
28848 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
28851 * cs-parser.jay (element_access): Implement action.
28852 (base_access): Implement actions.
28853 (checked_expression, unchecked_expression): Implement.
28855 * cs-parser.jay (local_variable_type): Correct and implement.
28856 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
28858 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
28860 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
28861 name and the specifiers.
28863 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
28865 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
28866 making them all public ;-)
28868 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
28871 2001-09-07 Miguel de Icaza <miguel@ximian.com>
28873 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
28875 (FieldExpr, PropertyExprs): New resolved expressions.
28876 (SimpleName::MemberStaticCheck): Perform static checks for access
28877 to non-static fields on static methods. Maybe this should be
28878 generalized for MemberAccesses.
28879 (SimpleName::ResolveSimpleName): More work on simple name
28882 * cs-parser.jay (primary_expression/qualified_identifier): track
28883 the parameter index.
28885 * codegen.cs (CodeGen::Save): Catch save exception, report error.
28886 (EmitContext::EmitBoolExpression): Chain to expression generation
28887 instead of temporary hack.
28888 (::EmitStatementExpression): Put generic expression code generation.
28890 * assign.cs (Assign::Emit): Implement variable assignments to
28891 local variables, parameters and fields.
28893 2001-09-06 Miguel de Icaza <miguel@ximian.com>
28895 * statement.cs (Block::GetVariableInfo): New method, returns the
28896 VariableInfo for a variable name in a block.
28897 (Block::GetVariableType): Implement in terms of GetVariableInfo
28899 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
28900 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
28902 2001-09-06 Ravi Pratap <ravi@ximian.com>
28904 * cs-parser.jay (operator_declaration): Continue on my quest : update
28905 to take attributes argument.
28906 (event_declaration): Ditto.
28907 (enum_declaration): Ditto.
28908 (indexer_declaration): Ditto.
28910 * class.cs (Operator::Operator): Update constructor accordingly.
28911 (Event::Event): Ditto.
28913 * delegate.cs (Delegate::Delegate): Same here.
28915 * enum.cs (Enum::Enum): Same here.
28917 2001-09-05 Ravi Pratap <ravi@ximian.com>
28919 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
28921 * ../tests/cs0658.cs : New file to demonstrate error 0658.
28923 * attribute.cs (Attributes): New class to encapsulate all attributes which were
28924 being passed around as an arraylist.
28925 (Attributes::AddAttribute): Method to add attribute sections.
28927 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
28928 (struct_declaration): Update accordingly.
28929 (constant_declaration): Update.
28930 (field_declaration): Update.
28931 (method_header): Update.
28932 (fixed_parameter): Update.
28933 (parameter_array): Ditto.
28934 (property_declaration): Ditto.
28935 (destructor_declaration): Ditto.
28937 * class.cs (Struct::Struct): Update constructors accordingly.
28938 (Class::Class): Ditto.
28939 (Field::Field): Ditto.
28940 (Method::Method): Ditto.
28941 (Property::Property): Ditto.
28942 (TypeContainer::OptAttribute): update property's return type.
28944 * interface.cs (Interface.opt_attributes): New member.
28945 (Interface::Interface): Update to take the extra Attributes argument.
28947 * parameter.cs (Parameter::Parameter): Ditto.
28949 * constant.cs (Constant::Constant): Ditto.
28951 * interface.cs (InterfaceMemberBase): New OptAttributes field.
28952 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
28953 the attributes as a parameter.
28954 (InterfaceProperty): Update constructor call.
28955 (InterfaceEvent): Ditto.
28956 (InterfaceMethod): Ditto.
28957 (InterfaceIndexer): Ditto.
28959 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
28960 pass the attributes too.
28961 (interface_event_declaration): Ditto.
28962 (interface_property_declaration): Ditto.
28963 (interface_method_declaration): Ditto.
28964 (interface_declaration): Ditto.
28966 2001-09-05 Miguel de Icaza <miguel@ximian.com>
28968 * class.cs (Method::Define): Track the "static Main" definition to
28969 create an entry point.
28971 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
28972 EntryPoint if we find it.
28974 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
28975 (EmitContext::ig): Make this variable public.
28977 * driver.cs: Make the default output file be the first file name
28978 with the .exe extension.
28980 Detect empty compilations
28982 Handle various kinds of output targets. Handle --target and
28983 rename -t to --dumper.
28985 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
28986 methods inherited from Expression return now an Expression. This
28987 will is used during the tree rewriting as we resolve them during
28990 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
28991 the spec. Missing entirely is the information about
28992 accessability of elements of it.
28994 (Expression::ExprClassFromMemberInfo): New constructor for
28995 Expressions that creates a fully initialized Expression based on
28996 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
28999 (Invocation::Resolve): Begin implementing resolution of invocations.
29001 * literal.cs (StringLiteral): Implement Emit.
29003 2001-09-05 Ravi Pratap <ravi@ximian.com>
29005 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
29008 2001-09-04 Ravi Pratap <ravi@ximian.com>
29010 * cs-parser.jay (attribute_arguments): Implement actions.
29011 (attribute): Fix bug in production. Implement action.
29012 (attribute_list): Implement.
29013 (attribute_target): Implement.
29014 (attribute_target_specifier, opt_target_specifier): Implement
29015 (CheckAttributeTarget): New method to check if the attribute target
29017 (attribute_section): Implement.
29018 (opt_attributes): Implement.
29020 * attribute.cs : New file to handle attributes.
29021 (Attribute): Class to hold attribute info.
29023 * cs-parser.jay (opt_attribute_target_specifier): Remove production
29024 (attribute_section): Modify production to use 2 different rules to
29025 achieve the same thing. 1 s/r conflict down !
29026 Clean out commented, useless, non-reducing dimension_separator rules.
29028 * class.cs (TypeContainer.attributes): New member to hold list
29029 of attributes for a type.
29030 (Struct::Struct): Modify to take one more argument, the attribute list.
29031 (Class::Class): Ditto.
29032 (Field::Field): Ditto.
29033 (Method::Method): Ditto.
29034 (Property::Property): Ditto.
29036 * cs-parser.jay (struct_declaration): Update constructor call to
29037 pass in the attributes too.
29038 (class_declaration): Ditto.
29039 (constant_declaration): Ditto.
29040 (field_declaration): Ditto.
29041 (method_header): Ditto.
29042 (fixed_parameter): Ditto.
29043 (parameter_array): Ditto.
29044 (property_declaration): Ditto.
29046 * constant.cs (Constant::Constant): Update constructor similarly.
29047 Use System.Collections.
29049 * parameter.cs (Parameter::Parameter): Update as above.
29051 2001-09-02 Ravi Pratap <ravi@ximian.com>
29053 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
29054 (TypeContainer.delegates): New member to hold list of delegates.
29056 * cs-parser.jay (delegate_declaration): Implement the action correctly
29057 this time as I seem to be on crack ;-)
29059 2001-09-02 Miguel de Icaza <miguel@ximian.com>
29061 * rootcontext.cs (RootContext::IsNamespace): new function, used to
29062 tell whether an identifier represents a namespace.
29064 * expression.cs (NamespaceExpr): A namespace expression, used only
29065 temporarly during expression resolution.
29066 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
29067 utility functions to resolve names on expressions.
29069 2001-09-01 Miguel de Icaza <miguel@ximian.com>
29071 * codegen.cs: Add hook for StatementExpressions.
29073 * class.cs: Fix inverted test for static flag in methods.
29075 2001-09-02 Ravi Pratap <ravi@ximian.com>
29077 * class.cs (Operator::CheckUnaryOperator): Correct error number used
29078 to make it coincide with MS' number.
29079 (Operator::CheckBinaryOperator): Ditto.
29081 * ../errors/errors.txt : Remove error numbers added earlier.
29083 * ../errors/cs1019.cs : Test case for error # 1019
29085 * ../errros/cs1020.cs : Test case for error # 1020
29087 * cs-parser.jay : Clean out commented cruft.
29088 (dimension_separators, dimension_separator): Comment out. Ostensibly not
29089 used anywhere - non-reducing rule.
29090 (namespace_declarations): Non-reducing rule - comment out.
29092 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
29093 with TypeContainer::AddEnum.
29095 * delegate.cs : New file for delegate handling classes.
29096 (Delegate): Class for declaring delegates.
29098 * makefile : Update.
29100 * cs-parser.jay (delegate_declaration): Implement.
29102 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
29104 * class.cs (Event::Define): Implement.
29105 (Event.EventBuilder): New member.
29107 * class.cs (TypeContainer::Populate): Update to define all enums and events
29109 (Events): New property for the events arraylist we hold. Shouldn't we move to using
29110 readonly fields for all these cases ?
29112 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
29114 * class.cs (Property): Revamp to use the convention of making fields readonly.
29115 Accordingly modify code elsewhere.
29117 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
29118 the Define method of the Property class.
29120 * class.cs : Clean up applied patch and update references to variables etc. Fix
29122 (TypeContainer::Populate): Update to define all the properties we have. Also
29123 define all enumerations.
29125 * enum.cs (Define): Implement.
29127 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
29129 * cs-parser.jay (overloadable_operator): The semantic value is an
29130 enum of the Operator class.
29131 (operator_declarator): Implement actions.
29132 (operator_declaration): Implement.
29134 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
29135 validity of definitions.
29136 (Operator::CheckBinaryOperator): Static method to check for binary operators
29137 (TypeContainer::AddOperator): New method to add an operator to a type.
29139 * cs-parser.jay (indexer_declaration): Added line to actually call the
29140 AddIndexer method so it gets added ;-)
29142 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
29143 already taken care of by the MS compiler ?
29145 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
29147 * class.cs (Operator): New class for operator declarations.
29148 (Operator::OpType): Enum for the various operators.
29150 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
29152 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
29153 ostensibly handle this in semantic analysis.
29155 * cs-parser.jay (general_catch_clause): Comment out
29156 (specific_catch_clauses, specific_catch_clause): Ditto.
29157 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
29158 (catch_args, opt_catch_args): New productions.
29159 (catch_clause): Rewrite to use the new productions above
29160 (catch_clauses): Modify accordingly.
29161 (opt_catch_clauses): New production to use in try_statement
29162 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
29163 and re-write the code in the actions to extract the specific and
29164 general catch clauses by being a little smart ;-)
29166 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
29167 Hooray, try and catch statements parse fine !
29169 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
29171 * statement.cs (Block::GetVariableType): Fix logic to extract the type
29172 string from the hashtable of variables.
29174 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
29175 I end up making that mistake ;-)
29176 (catch_clauses): Fixed gross error which made Key and Value of the
29177 DictionaryEntry the same : $1 !!
29179 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
29181 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
29183 * cs-parser.jay (event_declaration): Correct to remove the semicolon
29184 when the add and remove accessors are specified.
29186 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
29188 * cs-parser.jay (IndexerDeclaration): New helper class to hold
29189 information about indexer_declarator.
29190 (indexer_declarator): Implement actions.
29191 (parsing_indexer): New local boolean used to keep track of whether
29192 we are parsing indexers or properties. This is necessary because
29193 implicit_parameters come into picture even for the get accessor in the
29194 case of an indexer.
29195 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
29197 * class.cs (Indexer): New class for indexer declarations.
29198 (TypeContainer::AddIndexer): New method to add an indexer to a type.
29199 (TypeContainer::indexers): New member to hold list of indexers for the
29202 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
29204 * cs-parser.jay (add_accessor_declaration): Implement action.
29205 (remove_accessor_declaration): Implement action.
29206 (event_accessors_declaration): Implement
29207 (variable_declarators): swap statements for first rule - trivial.
29209 * class.cs (Event): New class to hold information about event
29211 (TypeContainer::AddEvent): New method to add an event to a type
29212 (TypeContainer::events): New member to hold list of events.
29214 * cs-parser.jay (event_declaration): Implement actions.
29216 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
29218 * cs-parser.jay (dim_separators): Implement. Make it a string
29219 concatenating all the commas together, just as they appear.
29220 (opt_dim_separators): Modify accordingly
29221 (rank_specifiers): Update accordingly. Basically do the same
29222 thing - instead, collect the brackets here.
29223 (opt_rank_sepcifiers): Modify accordingly.
29224 (array_type): Modify to actually return the complete type string
29225 instead of ignoring the rank_specifiers.
29226 (expression_list): Implement to collect the expressions
29227 (variable_initializer): Implement. We make it a list of expressions
29228 essentially so that we can handle the array_initializer case neatly too.
29229 (variable_initializer_list): Implement.
29230 (array_initializer): Make it a list of variable_initializers
29231 (opt_array_initializer): Modify accordingly.
29233 * expression.cs (New::NType): Add enumeration to help us
29234 keep track of whether we have an object/delegate creation
29235 or an array creation.
29236 (New:NewType, New::Rank, New::Indices, New::Initializers): New
29237 members to hold data about array creation.
29238 (New:New): Modify to update NewType
29239 (New:New): New Overloaded contructor for the array creation
29242 * cs-parser.jay (array_creation_expression): Implement to call
29243 the overloaded New constructor.
29245 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
29247 * class.cs (TypeContainer::Constructors): Return member
29248 constructors instead of returning null.
29250 2001-08-26 Miguel de Icaza <miguel@ximian.com>
29252 * typemanager.cs (InitCoreTypes): Initialize the various core
29253 types after we have populated the type manager with the user
29254 defined types (this distinction will be important later while
29255 compiling corlib.dll)
29257 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
29258 on Expression Classification. Now all expressions have a method
29259 `Resolve' and a method `Emit'.
29261 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
29262 generation from working. Also add some temporary debugging
29265 2001-08-24 Miguel de Icaza <miguel@ximian.com>
29267 * codegen.cs: Lots of code generation pieces. This is only the
29268 beginning, will continue tomorrow with more touches of polish. We
29269 handle the fundamentals of if, while, do, for, return. Others are
29270 trickier and I need to start working on invocations soon.
29272 * gen-treedump.cs: Bug fix, use s.Increment here instead of
29275 * codegen.cs (EmitContext): New struct, used during code
29276 emission to keep a context. Most of the code generation will be
29279 * cs-parser.jay: Add embedded blocks to the list of statements of
29280 this block. So code generation proceeds in a top down fashion.
29282 2001-08-23 Miguel de Icaza <miguel@ximian.com>
29284 * statement.cs: Add support for multiple child blocks.
29286 2001-08-22 Miguel de Icaza <miguel@ximian.com>
29288 * codegen.cs (EmitCode): New function, will emit the code for a
29289 Block of code given a TypeContainer and its ILGenerator.
29291 * statement.cs (Block): Standard public readonly optimization.
29292 (Block::Block constructors): Link children.
29293 (Block::Child): Child Linker.
29294 (Block::EmitVariables): Emits IL variable declarations.
29296 * class.cs: Drop support for MethodGroups here, delay until
29298 (Method::): Applied the same simplification that I did before, and
29299 move from Properties to public readonly fields.
29300 (Method::ParameterTypes): Returns the parameter types for the
29301 function, and implements a cache that will be useful later when I
29302 do error checking and the semantic analysis on the methods is
29304 (Constructor::GetCallingConvention): Renamed from CallingConvetion
29305 and made a method, optional argument tells whether this is a class
29306 or a structure to apply the `has-this' bit.
29307 (Method::GetCallingConvention): Implement, returns the calling
29309 (Method::Define): Defines the type, a second pass is performed
29310 later to populate the methods.
29312 (Constructor::ParameterTypes): implement a cache similar to the
29313 one on Method::ParameterTypes, useful later when we do semantic
29316 (TypeContainer::EmitMethod): New method. Emits methods.
29318 * expression.cs: Removed MethodGroup class from here.
29320 * parameter.cs (Parameters::GetCallingConvention): new method.
29322 2001-08-21 Miguel de Icaza <miguel@ximian.com>
29324 * class.cs (TypeContainer::Populate): Drop RootContext from the
29327 (Constructor::CallingConvention): Returns the calling convention.
29328 (Constructor::ParameterTypes): Returns the constructor parameter
29331 (TypeContainer::AddConstructor): Keep track of default constructor
29332 and the default static constructor.
29334 (Constructor::) Another class that starts using `public readonly'
29335 instead of properties.
29337 (Constructor::IsDefault): Whether this is a default constructor.
29339 (Field::) use readonly public fields instead of properties also.
29341 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
29342 track of static constructors; If none is used, turn on
29343 BeforeFieldInit in the TypeAttributes.
29345 * cs-parser.jay (opt_argument_list): now the return can be null
29346 for the cases where there are no arguments.
29348 (constructor_declarator): If there is no implicit `base' or
29349 `this', then invoke the default parent constructor.
29351 * modifiers.cs (MethodAttr): New static function maps a set of
29352 modifiers flags into a MethodAttributes enum
29353 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
29354 MethodAttr, TypeAttr to represent the various mappings where the
29355 modifiers are used.
29356 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
29358 2001-08-19 Miguel de Icaza <miguel@ximian.com>
29360 * parameter.cs (GetParameterInfo): Fix bug where there would be no
29363 * interface.cs (PopulateIndexer): Implemented the code generator
29364 for interface indexers.
29366 2001-08-17 Miguel de Icaza <miguel@ximian.com>
29368 * interface.cs (InterfaceMemberBase): Now we track the new status
29371 (PopulateProperty): Implement property population. Woohoo! Got
29372 Methods and Properties going today.
29374 Removed all the properties for interfaces, and replaced them with
29375 `public readonly' fields.
29377 2001-08-16 Miguel de Icaza <miguel@ximian.com>
29379 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
29380 initialize their hashtables/arraylists only when they are needed
29381 instead of doing this always.
29383 * parameter.cs: Handle refs and out parameters.
29385 * cs-parser.jay: Use an ArrayList to construct the arguments
29386 instead of the ParameterCollection, and then cast that to a
29389 * parameter.cs: Drop the use of ParameterCollection and use
29390 instead arrays of Parameters.
29392 (GetParameterInfo): Use the Type, not the Name when resolving
29395 2001-08-13 Miguel de Icaza <miguel@ximian.com>
29397 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
29398 and instead use public readonly fields.
29400 * class.cs: Put back walking code for type containers.
29402 2001-08-11 Miguel de Icaza <miguel@ximian.com>
29404 * class.cs (MakeConstant): Code to define constants.
29406 * rootcontext.cs (LookupType): New function. Used to locate types
29409 2001-08-08 Miguel de Icaza <miguel@ximian.com>
29411 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
29412 this System.Reflection code is. Kudos to Microsoft
29414 * typemanager.cs: Implement a type cache and avoid loading all
29415 types at boot time. Wrap in LookupType the internals. This made
29416 the compiler so much faster. Wow. I rule!
29418 * driver.cs: Make sure we always load mscorlib first (for
29419 debugging purposes, nothing really important).
29421 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
29422 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
29424 * rootcontext.cs: Lookup types on their namespace; Lookup types
29425 on namespaces that have been imported using the `using' keyword.
29427 * class.cs (TypeContainer::TypeAttr): Virtualize.
29428 (Class::TypeAttr): Return attributes suitable for this bad boy.
29429 (Struct::TypeAttr): ditto.
29430 Handle nested classes.
29431 (TypeContainer::) Remove all the type visiting code, it is now
29432 replaced with the rootcontext.cs code
29434 * rootcontext.cs (GetClassBases): Added support for structs.
29436 2001-08-06 Miguel de Icaza <miguel@ximian.com>
29438 * interface.cs, statement.cs, class.cs, parameter.cs,
29439 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
29440 Drop use of TypeRefs, and use strings instead.
29442 2001-08-04 Miguel de Icaza <miguel@ximian.com>
29446 * class.cs (Struct::Struct): set the SEALED flags after
29447 checking the modifiers.
29448 (TypeContainer::TypeAttr): new property, returns the
29449 TypeAttributes for a class.
29451 * cs-parser.jay (type_list): Oops, list production was creating a
29452 new list of base types.
29454 * rootcontext.cs (StdLib): New property.
29455 (GetInterfaceTypeByName): returns an interface by type name, and
29456 encapsulates error handling here.
29457 (GetInterfaces): simplified.
29458 (ResolveTree): Encapsulated all the tree resolution here.
29459 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
29462 * driver.cs: Add support for --nostdlib, to avoid loading the
29463 default assemblies.
29464 (Main): Do not put tree resolution here.
29466 * rootcontext.cs: Beginning of the class resolution.
29468 2001-08-03 Miguel de Icaza <miguel@ximian.com>
29470 * rootcontext.cs: Provide better error reporting.
29472 * cs-parser.jay (interface_base): set our $$ to be interfaces.
29474 * rootcontext.cs (CreateInterface): Handle the case where there
29475 are no parent interfaces.
29477 (CloseTypes): Routine to flush types at the end.
29478 (CreateInterface): Track types.
29479 (GetInterfaces): Returns an array of Types from the list of
29480 defined interfaces.
29482 * typemanager.c (AddUserType): Mechanism to track user types (puts
29483 the type on the global type hash, and allows us to close it at the
29486 2001-08-02 Miguel de Icaza <miguel@ximian.com>
29488 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
29489 RecordInterface instead.
29491 * cs-parser.jay: Updated to reflect changes above.
29493 * decl.cs (Definition): Keep track of the TypeBuilder type that
29494 represents this type here. Not sure we will use it in the long
29495 run, but wont hurt for now.
29497 * driver.cs: Smaller changes to accomodate the new code.
29499 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
29502 * rootcontext.cs (CreateInterface): New method, used to create
29503 the System.TypeBuilder type for interfaces.
29504 (ResolveInterfaces): new entry point to resolve the interface
29506 (CodeGen): Property, used to keep track of the code generator.
29508 2001-07-26 Miguel de Icaza <miguel@ximian.com>
29510 * cs-parser.jay: Add a second production for delegate_declaration
29513 (enum_body): Put an opt_comma here instead of putting it on
29514 enum_body or enum_member_declarations so we can handle trailing
29515 commas on enumeration members. Gets rid of a shift/reduce.
29517 (type_list): Need a COMMA in the middle.
29519 (indexer_declaration): Tell tokenizer to recognize get/set
29521 * Remove old targets.
29523 * Re-add the parser target.
29525 2001-07-13 Simon Cozens <simon@simon-cozens.org>
29527 * cs-parser.jay: Add precendence rules for a number of operators
29528 ot reduce the number of shift/reduce conflicts in the grammar.
29530 2001-07-17 Miguel de Icaza <miguel@ximian.com>
29532 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
29535 Get rid of old crufty code.
29537 * rootcontext.cs: Use this to keep track of the parsed
29538 representation and the defined types available to the program.
29540 * gen-treedump.cs: adjust for new convention.
29542 * type.cs: Split out the type manager, and the assembly builder
29545 * typemanager.cs: the type manager will live here now.
29547 * cil-codegen.cs: And the code generator here.
29549 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
29551 * makefile: Fixed up for easy making.
29553 2001-07-13 Simon Cozens <simon@simon-cozens.org>
29555 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
29558 (unary_expression): Expand pre_increment_expression and
29559 post_decrement_expression to reduce a shift/reduce.
29561 2001-07-11 Simon Cozens
29563 * cs-tokenizer.cs: Hex numbers should begin with a 0.
29565 Improve allow_keyword_as_indent name.
29567 2001-06-19 Miguel de Icaza <miguel@ximian.com>
29569 * Adjustments for Beta2.
29571 2001-06-13 Miguel de Icaza <miguel@ximian.com>
29573 * decl.cs: Added `Define' abstract method.
29574 (InTransit): new property, used to catch recursive definitions.
29576 * interface.cs: Implement `Define'.
29578 * modifiers.cs: Map Modifiers.constants to
29579 System.Reflection.TypeAttribute flags.
29581 * class.cs: Keep track of types and user-defined types.
29582 (BuilderInit): New method for creating an assembly
29583 (ResolveType): New function to launch the resolution process, only
29584 used by interfaces for now.
29586 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
29587 that are inserted into the name space.
29589 2001-06-08 Miguel de Icaza <miguel@ximian.com>
29591 * ARGH. I have screwed up my tree so many times due to the use of
29592 rsync rather than using CVS. Going to fix this at once.
29594 * driver.cs: Objetify driver. Load assemblies, use assemblies to
29597 2001-06-07 Miguel de Icaza <miguel@ximian.com>
29599 * Experiment successful: Use System.Type rather that our own
29602 2001-05-25 Miguel de Icaza <miguel@ximian.com>
29604 * cs-parser.jay: Removed nsAliases from here.
29606 Use new namespaces, handle `using XXX;'
29608 * namespace.cs: Reimplemented namespace handling, use a recursive
29609 definition of the class. Now we can keep track of using clauses
29610 and catch invalid using clauses.
29612 2001-05-24 Miguel de Icaza <miguel@ximian.com>
29614 * gen-treedump.cs: Adapted for all the renaming.
29616 * expression.cs (Expression): this class now has a Type property
29617 which returns an expression Type.
29619 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
29620 `Type', as this has a different meaning now in the base
29622 2001-05-22 Miguel de Icaza <miguel@ximian.com>
29624 * interface.cs, class.cs: Removed from all the sources the
29625 references to signature computation, as we can not do method
29626 signature computation during the parsing time, as we are not
29627 trying to solve at that point distinguishing:
29631 void a (NS.Blah x) {}
29634 Which depending on the context might be valid or not, as we do not
29635 know if Blah is the same thing as NS.Blah at that point.
29637 * Redid everything so the code uses TypeRefs now instead of
29638 Types. TypeRefs are just temporary type placeholders, that need
29639 to be resolved. They initially have a pointer to a string and the
29640 current scope in which they are used. This is used later by the
29641 compiler to resolve the reference to an actual Type.
29643 * DeclSpace is no longer a CIR.Type, and neither are
29644 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
29645 are all DeclSpaces, but no Types.
29647 * type.cs (TypeRefManager): This implements the TypeRef manager,
29648 which keeps track of all the types that need to be resolved after
29649 the parsing has finished.
29651 2001-05-13 Miguel de Icaza <miguel@ximian.com>
29653 * ARGH. We are going to have to store `foreach' as a class rather
29654 than resolving it, as we need to verify error 1579 after name
29655 resolution. *OR* we could keep a flag that says `This request to
29656 IEnumerator comes from a foreach statement' which we can then use
29657 to generate the error.
29659 2001-05-10 Miguel de Icaza <miguel@ximian.com>
29661 * class.cs (TypeContainer.AddMethod): we now add methods to the
29662 MethodGroup instead of the method hashtable.
29664 * expression.cs: Add MethodGroup abstraction, which gets us one
29665 step closer to the specification in the way we handle method
29668 * cs-parser.jay (primary_expression): qualified_identifier now
29669 tried to match up an identifier to a local variable reference or
29670 to a parameter reference.
29672 current_local_parameters is now a parser global variable that
29673 points to the current parameters for the block, used during name
29676 (property_declaration): Now creates an implicit `value' argument to
29679 2001-05-09 Miguel de Icaza <miguel@ximian.com>
29681 * parameter.cs: Do not use `param' arguments as part of the
29682 signature, per the spec.
29684 2001-05-08 Miguel de Icaza <miguel@ximian.com>
29686 * decl.cs: Base class for classes, structs and interfaces. This
29687 is the "Declaration Space"
29689 * cs-parser.jay: Use CheckDef for checking declaration errors
29690 instead of having one on each function.
29692 * class.cs: Factor out some code for handling error handling in
29693 accordance to the "Declarations" section in the "Basic Concepts"
29694 chapter in the ECMA C# spec.
29696 * interface.cs: Make all interface member classes derive from
29697 InterfaceMemberBase.
29699 2001-05-07 Miguel de Icaza <miguel@ximian.com>
29701 * Many things: all interfaces are parsed and generated in
29702 gen-treedump. Support for member variables, constructors,
29703 destructors, properties, constants is there.
29705 Beginning of the IL backend, but very little done, just there for
29708 2001-04-29 Miguel de Icaza <miguel@ximian.com>
29710 * cs-parser.jay: Fix labeled statement.
29712 * cs-tokenizer.cs (escape): Escape " and ' always.
29713 ref_line, ref_name: keep track of the line/filename as instructed
29714 by #line by the compiler.
29717 2001-04-27 Miguel de Icaza <miguel@ximian.com>
29719 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
29720 to match the values in System.CodeDOM.
29722 Divid renamed to Divide.
29724 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
29726 (Statements.set): remove.
29728 * System.CodeDOM/CodeCatchClause.cs: always have a valid
29731 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
29732 falseStatements always have valid values.
29734 * cs-parser.jay: Use System.CodeDOM now.