1 2008-07-11 Marek Safar <marek.safar@gmail.com>
3 * linq.cs: Reset tranparent parameter counter in probing mode.
5 2008-07-11 Marek Safar <marek.safar@gmail.com>
7 * anonymous.cs: Mutate anonymous method type.
9 2008-07-11 Marek Safar <marek.safar@gmail.com>
11 * ecore.cs, anonymous.cs: Mutate field expressions.
13 2008-07-10 Marek Safar <marek.safar@gmail.com>
16 * linq.cs, statement.cs: Use explicit block for query expressions variables.
18 2008-07-10 Marek Safar <marek.safar@gmail.com>
20 * report.cs, ecore.cs: Flush recorder only when silent mode is off.
22 2008-07-10 Raja R Harinath <harinath@hurrynot.org>
25 * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
26 only one '>', and finds a '>>', abort the generic lookahead.
28 2008-07-10 Marek Safar <marek.safar@gmail.com>
31 * cs-tokenizer.cs: Always look-ahed for `>=' when tokenizing `>'.
33 2008-07-10 Marek Safar <marek.safar@gmail.com>
36 * statement.cs: Moved EmitSymbolInfo to Block.
38 2008-07-09 Marek Safar <marek.safar@gmail.com>
40 * ecore.cs: Report better error for extension method overload failures.
42 2008-07-09 Marek Safar <marek.safar@gmail.com>
44 * expression.cs (Is): No need to box reference values.
46 2008-07-09 Marek Safar <marek.safar@gmail.com>
48 * class.cs: Use event resolve context when initializing CreateEmitContext.
50 2008-07-09 Marek Safar <marek.safar@gmail.com>
53 * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
54 method used inside expression trees. Added more LINQ to expression tree
57 2008-07-08 Marek Safar <marek.safar@gmail.com>
59 A fix for bug #378189, #370577
60 * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
63 2008-07-08 Marek Safar <marek.safar@gmail.com>
65 * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
68 2008-07-08 Marek Safar <marek.safar@gmail.com>
71 * anonymous.cs: Always park anonymous method in the nearest parent storey.
73 2008-07-07 Marek Safar <marek.safar@gmail.com>
76 * cs-parser.jay: Report nullable use in mcs for some cases.
78 2008-07-07 Marek Safar <marek.safar@gmail.com>
80 * ecore.cs: Improved argument mismatch error messages.
82 2008-07-07 Marek Safar <marek.safar@gmail.com>
84 * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
86 2008-07-07 Marek Safar <marek.safar@gmail.com>
88 * expression.cs (TypeOf): Mutate type argument.
90 2008-07-04 Marek Safar <marek.safar@gmail.com>
92 * class.cs: Report missing partial modifier for correct type.
94 2008-07-04 Marek Safar <marek.safar@gmail.com>
96 * ecore.cs, expression.cs (VariableReference): Variable property is
99 2008-07-04 Marek Safar <marek.safar@gmail.com>
101 * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
103 2008-07-04 Marek Safar <marek.safar@gmail.com>
105 * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
108 2008-07-04 Marek Safar <marek.safar@gmail.com>
110 * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
111 anonymous method storey to an instance method when only "this" is hoisted.
113 2008-07-03 Marek Safar <marek.safar@gmail.com>
115 A fix for bug #321615
116 * expression.cs: Pointer comparisons use unsigned operator.
118 2008-07-03 Marek Safar <marek.safar@gmail.com>
120 * expression.cs: Fixed native pointer conversions. Also fixes #321615.
122 2008-07-02 Marek Safar <marek.safar@gmail.com>
124 A fix for bug #404905
125 * class.cs: Always initialize local unsafe variables.
127 2008-06-30 Marek Safar <marek.safar@gmail.com>
129 A fix for bug #396987
130 * expression.cs (NewInitialize): Clear local temporary variable for next run
132 2008-06-27 Marek Safar <marek.safar@gmail.com>
134 A fix for bug #401020
135 * ecore.cs: Both types and modifiers have to match for ref and out arguments
137 2008-06-27 Marek Safar <marek.safar@gmail.com>
139 A fix for bug #398319
140 * cs-parser.jay: Implemented undocumented base access expression inside
143 2008-06-26 Marek Safar <marek.safar@gmail.com>
145 A fix for bug #404227
146 * cs-parser.jay: Parse namespace declaration using qualified identifier.
148 2008-06-26 Marek Safar <marek.safar@gmail.com>
150 A fix for bug #404227
151 * convert.cs: Fixed explicit array to interface cast.
153 2008-06-26 Marek Safar <marek.safar@gmail.com>
155 A fix for bug #403894
156 * delegate.cs: Mutate DelegateInvocation type.
158 2008-06-26 Marek Safar <marek.safar@gmail.com>
160 A fix for bug #379348
161 * delegate.cs: Box a load of generic parameters.
163 2008-06-26 Marek Safar <marek.safar@gmail.com>
165 * expression.cs: Add an array creation arguments mutate.
167 2008-06-26 Marek Safar <marek.safar@gmail.com>
169 A fix for bug #386068
170 * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
173 2008-06-25 Marek Safar <marek.safar@gmail.com>
175 * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
178 2008-06-25 Marek Safar <marek.safar@gmail.com>
180 A fix for bug #403518
181 * delegate.cs: Type correctly anonymous method new invocation.
183 2008-06-24 Marek Safar <marek.safar@gmail.com>
185 A fix for bug #394826
186 * anonymous.cs: Fully qualify members when resolving anonymous type internal
189 2008-06-24 Marek Safar <marek.safar@gmail.com>
191 A fix for bug #394826
192 * anonymous.cs, iterators.cs: Construct generic storey only when is really
195 2008-06-24 Marek Safar <marek.safar@gmail.com>
197 * class.cs: Clone indexer parameters for localized capturing.
199 2008-06-24 Marek Safar <marek.safar@gmail.com>
201 A fix for bug #402379
202 * expression.cs: Don't crash when an object initializer resolve fails.
204 2008-06-24 Marek Safar <marek.safar@gmail.com>
206 A fix for bug #402888
207 * expression.cs: Mutate conditional expression.
209 2008-06-24 Marek Safar <marek.safar@gmail.com>
211 A fix for bug #401012
212 * class.cs: Keep StructLayout in shared container.
214 2008-06-24 Marek Safar <marek.safar@gmail.com>
216 A fix for bug #400438
217 * decl.cs, class.cs: Only properties can be automatically implemented.
219 2008-06-24 Marek Safar <marek.safar@gmail.com>
221 * statement.cs (ChangeToIterator): Copy also labels.
223 2008-06-23 Marek Safar <marek.safar@gmail.com>
225 * ecore.cs: Pass type argument details to parent extension method.
227 2008-06-23 Marek Safar <marek.safar@gmail.com>
229 A fix for bug #375966
230 * delegate.cs: Fixed IsTypeCovariant generic type conversions.
232 2008-06-23 Raja R Harinath <harinath@hurrynot.org>
234 * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
236 2008-06-22 Marek Safar <marek.safar@gmail.com>
238 A fix for bug #394347
239 * anonymous.cs: Cache compatible delegates as compatibility check produces
240 a new method every time.
242 2008-06-20 Marek Safar <marek.safar@gmail.com>
244 * anonymous.cs: Propagate storey reference for single references.
246 2008-06-20 Marek Safar <marek.safar@gmail.com>
248 A fix for bug #387615
249 * assign.cs, expression.cs: Correctly clone compound assignment.
251 2008-06-19 Marek Safar <marek.safar@gmail.com>
253 A fix for bug #359611, #359604
254 * anonymous.cs: Mutate all types of hoisted parameters.
256 2008-06-19 Marek Safar <marek.safar@gmail.com>
258 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
259 delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
260 expression.cs, codegen.cs, statement.cs
262 Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
263 #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
265 ** Anonymous methods, lambda expressions rewrite **
267 Anonymous expressions are now resolved when an explicit block is resolved
268 and they don't require any registration procedure anymore. Further,
269 anonymous methods are defined when explicit block is emitted which allows
270 better control of whole process and opens possibilities for more
271 optimizations as well as alternative to reverse whole process.
273 A concept of `MutateHoistedGenericType' was introduced to keep the resolve
274 process consistent and to correctly emit hoisted generic methods when they
275 have at least 1 hoisted variable.
277 2008-06-17 Martin Baulig <martin@ximian.com>
279 * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
281 (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
282 virtual property; check it in Emit().
283 (PropertyMethod.IsDebuggerHidden): Override, check whether we're
285 (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
287 (Indexer.Define): Likewise.
289 2008-06-17 Marek Safar <marek.safar@gmail.com>
291 * convert.cs: Don't use IsInterface on type arguments.
293 * delegate.cs: DelegateInvocation uses MethodInfo.
295 * parameter.cs: Removed IsTypeParameter.
297 * generic-mcs.cs: More missing stuff.
299 2008-06-16 Martin Baulig <martin@ximian.com>
302 (Modifiers.DEBUGGER_HIDDEN): New public const.
305 (TypeManager.GetDebuggerHiddenAttribute): New public static method.
308 (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
309 (AbstractPropertyEventMethod): Likewise.
310 (Constructor.Emit): Likewise.
311 (SourceMethod.SetCompilerGenerated): Removed.
313 * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
317 (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
318 if we're an `IteratorHost'.
319 (AnonymousMethodMethod..ctor): Don't set
320 `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
323 2008-06-16 Marek Safar <marek.safar@gmail.com>
325 * statement.cs: Clean-up foreach statements.
327 2008-06-12 Marek Safar <marek.safar@gmail.com>
329 * class.cs: Stop using public method which should not exist.
331 2008-06-11 Martin Baulig <martin@ximian.com>
334 (Location.LookupFile): Add `CompilationUnit' argument; when given
335 a relative file name, make it relative to the directory the .cs
336 file is located in instead of using the current directory.
338 2008-06-11 Martin Baulig <martin@ximian.com>
341 (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
342 (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
343 (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
344 (SourceMethod.SetCompilerGenerated): Likewise.
346 2008-06-11 Marek Safar <marek.safar@gmail.com>
348 * codegen.cs, driver: Only write symbol file when it's asked for.
350 2008-06-11 Marek Safar <marek.safar@gmail.com>
352 * codegen.cs: Don't use assembly writer error handling for symbol writer.
354 2008-06-10 Martin Baulig <martin@ximian.com>
356 * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
358 2008-06-09 Marek Safar <marek.safar@gmail.com>
360 A fix for bug #316290
361 * expression.cs: Include decimal operators in predefined table.
363 * parameters.cs: More readonlyness.
365 2008-06-09 Marek Safar <marek.safar@gmail.com>
367 A fix for bug #397213
368 * cs-parser.jay: One more missing current_local_parameters reset.
370 2008-06-09 Marek Safar <marek.safar@gmail.com>
372 A fix for bug #396633
373 * class.cs: Host backing field in partial container.
375 2008-06-09 Marek Safar <marek.safar@gmail.com>
377 A fix for bug #397068
378 * expression.cs: Check both operand types when predefined operator is used.
380 2008-06-05 Martin Baulig <martin@ximian.com>
382 Merged the `debugger-kahalo' branch.
385 (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
386 we're an iterator method.
387 (SourceMethod): Reflect latest symbol writer changes;
388 SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
389 now `start_row' and `end_row'.
390 (Constructor.Emit): Fix the logic whether to emit symbol information.
392 * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
396 (CompilationUnit): New public class; derives from `SourceFile'.
397 (SourceFileEntry.DefineSymbolInfo): New public method.
398 (SourceFileEntry.SetChecksum): New public method.
399 (Location): Encode hidden line numbers by using `column == 255';
400 the .ctor now accepts `column == -1' to mark a hidden line number.
401 (Location.Hidden): New public property.
402 (Location.CheckPoint): Add `CompilationUnit'.
403 (Location.SourceFiles): Change return type to `CompilationUnit[]'.
404 (Location.Push): Add `CompilationUnit compile_unit' argument.
405 (Location.CompilationUnit): New public property.
408 (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
410 * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
412 * driver.cs: `SourceFile' -> `CompilationUnit'.
414 * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
416 * namespace.cs: `SourceFile' -> `CompilationUnit'.
418 * cs-tokenizer.cs: Add support for `#pragma checksum' and
422 (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
423 new symbol writer API to also pass the file.
425 2008-06-05 Marek Safar <marek.safar@gmail.com>
427 * statement.cs: Emit catch variable assignment using variable expression.
429 2008-06-05 Marek Safar <marek.safar@gmail.com>
431 * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
432 with other variable types.
434 2008-06-04 Marek Safar <marek.safar@gmail.com>
436 * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
437 GetLength method emit, it breaks resolve rules.
439 2008-06-02 Atsushi Enomoto <atsushi@ximian.com>
440 Marek Safar <marek.safar@gmail.com>
442 A fix for bug #395542
443 * cs-parser.jay: The trailing comma is allowed in anonymous type member
446 2008-06-02 Marek Safar <marek.safar@gmail.com>
448 A fix for bug #395287
449 * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
451 2008-05-31 Marek Safar <marek.safar@gmail.com>
453 A fix for bug #395845
454 * class.cs, nullable.cs: User unary operator is allowed to have nullable and
455 non-nullable parameter type.
457 2008-05-31 Marek Safar <marek.safar@gmail.com>
459 * class.cs: Handle contructor initializer as a statement in top-level block.
461 2008-05-30 Marek Safar <marek.safar@gmail.com>
463 * attribute.cs: Don't mix old and new corlib types when emitting corlib
466 2008-05-24 Marek Safar <marek.safar@gmail.com>
468 * ecore.cs, expression.cs: Small IVariable refactoring.
470 2008-05-22 Marek Safar <marek.safar@gmail.com>
472 * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
474 2008-05-21 Marek Safar <marek.safar@gmail.com>
476 * cs-parser.jay: Removed redundant catch type check.
478 2008-05-21 Marek Safar <marek.safar@gmail.com>
480 A fix for bug #390372
481 * nullable.cs: Set correct return type.
483 2008-05-21 Marek Safar <marek.safar@gmail.com>
485 A fix for bug #391062
486 * typemanager.cs: Fixed crash when comparing null types.
488 2008-05-21 Marek Safar <marek.safar@gmail.com>
490 A fix for bug #391871
491 * cs-parser.jay: Better error handling for invalid catch type.
493 2008-05-20 Marek Safar <marek.safar@gmail.com>
495 A fix for bug #392155
496 * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
498 2008-05-15 Marek Safar <marek.safar@gmail.com>
500 A fix for bug #390666
501 * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
504 2008-05-15 Marek Safar <marek.safar@gmail.com>
506 * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
509 2008-05-13 Marek Safar <marek.safar@gmail.com>
511 A fix for bug #389625
512 * delegate.cs, generic.cs: Some progress on method group return type
515 2008-05-13 Marek Safar <marek.safar@gmail.com>
517 A fix for bug #378419
518 * namespace.cs: Inspect also parent namespaces not only namespace entries.
520 2008-05-12 Marek Safar <marek.safar@gmail.com>
522 * class.cs (Constructor): Added IsCompilerGenerated.
524 2008-05-12 Marek Safar <marek.safar@gmail.com>
526 * expression.cs: Enum binary operators can accept non-enum operand only when
527 is implicitly convertible to underlying type.
529 2008-05-12 Marek Safar <marek.safar@gmail.com>
531 A fix for bug #389272
532 * support.cs: Workaround System.InvalidOperationException for enums.
534 2008-05-12 Marek Safar <marek.safar@gmail.com>
536 A fix for bug #389073
537 * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
539 2008-05-10 Marek Safar <marek.safar@gmail.com>
541 * driver.cs: Split Parse.
543 * location.cs (LookupFile): Uses string.Empty.
545 2008-05-07 Marek Safar <marek.safar@gmail.com>
547 * expression.cs, parameter.cs: Small ParameterReference clean up.
549 2008-05-07 Marek Safar <marek.safar@gmail.com>
551 * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
554 2008-05-06 Martin Baulig <martin@ximian.com>
556 * class.cs (Constructor.Emit): Fix the logic whether to emit
559 2008-05-06 Raja R Harinath <harinath@hurrynot.org>
562 * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
563 InvalidOperationException when the iterator is before the start or
566 2008-05-06 Marek Safar <marek.safar@gmail.com>
568 * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
569 when left is nullable type.
571 2008-05-06 Marek Safar <marek.safar@gmail.com>
573 A fix for bug #386628
574 * expression.cs (LocalVariableReference): Continue in resolving when
575 variable is not assigned.
577 2008-05-05 Marek Safar <marek.safar@gmail.com>
579 * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
582 2008-05-04 Marek Safar <marek.safar@gmail.com>
584 * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
585 it saves many redundant temporary variables for nullable operations.
587 2008-05-03 Marek Safar <marek.safar@gmail.com>
589 * assign.cs: EventAddOrRemove is a statement and cannot have a type.
591 * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
594 * nullable.cs: Constant coalescing operator optimizations.
596 2008-05-03 Marek Safar <marek.safar@gmail.com>
598 * constant.cs: Use unsigned conversion for values which are unsigned only.
600 2008-05-03 Marek Safar <marek.safar@gmail.com>
602 * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null
603 coalescing operator as it should be.
605 2008-05-02 Marek Safar <marek.safar@gmail.com>
607 A fix for bug #371016
608 * expression.cs: All predefined delegate operators require implicit method
611 2008-05-02 Marek Safar <marek.safar@gmail.com>
613 * constant.cs: Emit long constant as uint when fits the range.
615 * convert.cs, expression.cs: Fixed few unsafe conversions.
617 2008-05-02 Marek Safar <marek.safar@gmail.com>
619 * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
621 2008-05-02 Raja R Harinath <harinath@hurrynot.org>
624 * convert.cs (ImplicitNumericConversion): Don't modify the type of
626 * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
628 2008-05-01 Marek Safar <marek.safar@gmail.com>
630 * constant.cs, literal.cs: IsLiteral property for error reporting.
632 * ecore.cs, expression.cs: Implemented Property expression.
634 2008-05-01 Marek Safar <marek.safar@gmail.com>
636 * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
638 * nullable.cs: Implemented nullable coalescing null operator.
640 * ecore.cs, expression.cs: Expression trees work.
642 2008-05-01 Marek Safar <marek.safar@gmail.com>
644 * ecore.cs: CreateExpressionTree is finally abstract.
646 * expression.cs, linq.cs: Updated.
648 2008-05-01 Marek Safar <marek.safar@gmail.com>
650 * expression.cs, ecore.cs: Block base access expression inside expression
653 2008-05-01 Marek Safar <marek.safar@gmail.com>
655 A fix for bug #385058
656 * expression.cs: User-defined operator implementations always take
657 precedence over predefined operator implementations.
659 2008-04-30 Marek Safar <marek.safar@gmail.com>
661 * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
662 class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
663 expression tree conversions.
665 2008-04-30 Marek Safar <marek.safar@gmail.com>
667 * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
668 operators method details to Operator class.
670 2008-04-30 Marek Safar <marek.safar@gmail.com>
672 * anonymous.cs: Pass unsafe flags to anonymous container.
674 * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
675 inside expression tree.
677 2008-04-29 Martin Baulig <martin@ximian.com>
679 * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
680 (Tokenizer.PopPosition): Also restore the `line'.
682 2008-04-29 Marek Safar <marek.safar@gmail.com>
684 * delegate.cs: Implemented Invoke expression.
686 2008-04-29 Marek Safar <marek.safar@gmail.com>
688 * expression.cs: Fixed equality reference comparison regression.
690 2008-04-29 Marek Safar <marek.safar@gmail.com>
692 * ecore.cs: Clean up EmptyCast hack.
694 * expression.cs, nullable.cs: Implemented enum binary and unary operations
695 using correct conversion rules. Also fixes #383993.
697 2008-04-28 Martin Baulig <martin@ximian.com>
699 * class.cs (Constructor.Emit): Don't emit debugging information
700 for generated default .ctor's.
702 2008-04-28 Marek Safar <marek.safar@gmail.com>
704 * convert.cs: Empty-cast ushort to int conversion.
706 2008-04-28 Marek Safar <marek.safar@gmail.com>
708 A fix for bug #384191
709 * ecore.cs, expression.cs: Fixed expression cloning.
711 2008-04-28 Marek Safar <marek.safar@gmail.com>
713 * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
715 2008-04-28 Raja R Harinath <harinath@hurrynot.org>
717 Fix #381559, test-638.cs, test-639.cs
718 * assign.cs (CompoundAssign.Helper): New wrapper.
719 (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
721 * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
722 Pass unconverted expressions to the params array creation expression.
723 (FieldExpr.EmitAssign): Don't special-case StringConcat.
724 (PropertyExpr.EmitAssign): Likewise.
725 * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
726 element if it is of kind CompoundAssign.Helper.
727 (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
728 first before anything else.
729 (ArrayAccess.EmitAssign): Don't special-case StringConcat.
730 (ArrayAccess.LoadArrayAndArguments): Simplify.
732 2008-04-27 Marek Safar <marek.safar@gmail.com>
734 * expression.cs: Fixed cloning of typeof(void).
736 2008-04-27 Raja R Harinath <harinath@hurrynot.org>
738 * assign.cs (Assign.DoResolve): Remove support for EventExprs.
739 (Assign.Emit): Likewise. Move it to ...
740 (CompoundAssign.DoResolve): ... here and ...
741 (CompoundAssign.Emit): ... here.
742 (EventAddOrRemove): New helper to handle += and -= on events, and
743 avoid the use of BinaryDelegates.
744 * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
745 (EventExpr.EmitAddOrRemove): Improve.
746 * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
748 * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
749 create VarExprs for 'foo.bar.var'.
750 * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
751 is a highly inappropriate name for its functionality.
753 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
755 Simplify handling of multiple assignments
756 * assign.cs (Assign): Clear out all 'embedded assign' gunk. Make
758 (SimpleAssign): New. Class to be used for normal assignments.
759 * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
760 * expression.cs, parameter.cs, statement.cs: Likewise.
762 2008-04-25 Marek Safar <marek.safar@gmail.com>
764 * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
765 for incompatible underlying types, more to come, uff.
767 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
770 * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
773 2008-04-25 Marek Safar <marek.safar@gmail.com>
775 * expression.cs, nullable.cs: Implemented UnaryPlus expression.
777 2008-04-24 Raja R Harinath <harinath@hurrynot.org>
779 Fix test-636.cs. Sprinkle a few more 'EmitSideEffect's around
780 * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
781 * statement.cs (While, Do, For): Allow test to have side effects.
782 (For.DoEmit): Always emit InitStatement.
785 * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
786 Always create SideEffectConstant.
787 (Binary.EnumLiftUp): Don't assume that the enumeration constant is
788 of type EnumConstant.
790 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
791 Handle 'right' being SideEffectConstant of type 'bool'.
793 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
794 Use left.EmitBranchable instead of open coding it, so as to
795 improve optimization opportunities.
797 * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
799 * ecore.cs (Expression.EmitBranchable): Document some non-obvious
801 (Expression.EmitSideEffect): Document.
803 2008-04-23 Marek Safar <marek.safar@gmail.com>
805 * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
807 2008-04-23 Marek Safar <marek.safar@gmail.com>
809 * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
811 2008-04-23 Marek Safar <marek.safar@gmail.com>
813 * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
814 conversion to expression tree.
816 2008-04-23 Marek Safar <marek.safar@gmail.com>
818 * ecore.cs: Removed unused expression.
820 2008-04-22 Marek Safar <marek.safar@gmail.com>
822 * expression.cs: Implemented NegateChecked and New expressions.
824 2008-04-22 Marek Safar <marek.safar@gmail.com>
826 * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
828 2008-04-22 Raja R Harinath <harinath@hurrynot.org>
831 * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
832 needing final 'ret' instruction.
834 2008-04-22 Marek Safar <marek.safar@gmail.com>
836 * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
838 2008-04-21 Marek Safar <marek.safar@gmail.com>
840 * expression.cs: Emit ldnull and not null expression as an instance argument
841 of static method expression calls.
843 2008-04-21 Marek Safar <marek.safar@gmail.com>
845 A fix for bug #378200
846 * expression.cs: Fixed crash when creating parameterless expression tree
849 2008-04-21 Marek Safar <marek.safar@gmail.com>
851 A fix for bug #375297
852 * anonymous.cs: Fixed crash when inferring from null argument anonymous
855 2008-04-21 Marek Safar <marek.safar@gmail.com>
857 A fix for bug #377596
858 * decl.cs, class.cs: Emit delegate type argument attributes.
860 2008-04-21 Marek Safar <marek.safar@gmail.com>
862 A fix for bug #365314
863 * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
865 2008-04-21 Marek Safar <marek.safar@gmail.com>
867 * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
870 2008-04-21 Marek Safar <marek.safar@gmail.com>
872 * generic.cs (TypeParameter): Removed redundant location.
874 2008-04-19 Marek Safar <marek.safar@gmail.com>
876 * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
877 delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
878 FullNamedExpression in all declaration type expression, statements will come
881 2008-04-18 Marek Safar <marek.safar@gmail.com>
883 * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
884 nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
886 2008-04-18 Marek Safar <marek.safar@gmail.com>
888 * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
891 2008-04-17 Marek Safar <marek.safar@gmail.com>
893 * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
896 2008-04-17 Marek Safar <marek.safar@gmail.com>
898 * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
902 2008-04-17 Raja R Harinath <harinath@hurrynot.org>
904 Hook up 'EmitSideEffect'
905 * constant.cs (Constant.EmitSideEffect): New.
906 (SideEffectConstant.Emit): Simplify. Use EmitSideEffect.
907 (SideEffectConstant.EmitSideEffect): New.
908 * ecore.cs (BoxedCast.EmitBranchable): Remove. We can't use an
909 unconditional branch in EmitBranchable.
910 (FieldExpr.EmitBranchable): New.
911 * expression.cs (Unary.EmitSideEffect): New.
912 (Binary.EmitSideEffect): New.
913 (VariableReference.EmitSideEffect): New. Do nothing.
915 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
917 Introduce 'EmitSideEffect'
918 * ecore.cs (Expression.EmitSideEffect): New.
919 (TypeCast): Rename from EmptyCast.
921 (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
922 (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
923 * convert.cs, nullable.cs: Update to changes.
925 2008-04-16 Marek Safar <marek.safar@gmail.com>
927 * class.cs, cs-parser.jay: Early check for base types expression.
929 2008-04-16 Marek Safar <marek.safar@gmail.com>
931 * decl.cs (MemberName): Declare PrettyName as obsolete.
933 2008-04-16 Marek Safar <marek.safar@gmail.com>
935 * namespace.cs: Use MemberName comparison.
937 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
940 * decl.cs (MemberName.PrettyName): New. Replaces the misnamed
942 (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
943 (MemberName.FullyQualifiedName): New. Provides the functionality
944 that users assume FullName would have.
945 * ecore.cs, namespace.cs: Update to changes.
947 * statement.cs (Using.assign): Make into ExpressionStatement.
948 (Using.EmitPreTryBody): Simplify.
950 2008-04-16 Marek Safar <marek.safar@gmail.com>
952 * report.cs: ColorFormat is protected.
954 * rootcontext.cs: Unused fields clean-up.
956 * namespace.cs: Made UsingEntry name private.
958 2008-04-16 Marek Safar <marek.safar@gmail.com>
960 * cs-tokenizer.cs, location.cs: Removed unused field.
962 2008-04-16 Jan Oravec <jan.oravec@6com.sk>
963 Raja R Harinath <harinath@hurrynot.org>
966 * constant.cs (SideEffectConstant.value): Rename from 'left'.
967 (SideEffectConstant.side_effect): Rename from 'right'.
968 (SideEffectConstant..ctor): Normalize 'side_effect'.
969 (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
970 value of this constant.
971 * cfold.cs: Update to changes.
973 2008-04-15 Marek Safar <marek.safar@gmail.com>
975 * cs-paser.jay: Removed unused variable.
977 * driver.cs: Made Compile instance method.
979 2008-04-15 Raja R Harinath <harinath@hurrynot.org>
981 * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
983 2008-04-15 Marek Safar <marek.safar@gmail.com>
985 * cs-paser.jay, namespace.cs: Simplified handling of namespace imports.
987 2008-04-13 Jb Evain <jbevain@novell.com>
989 * namespace.cs: update the System.Core fullname for 2.1
990 * driver.cs: update the list of required assemblies for 2.1.
991 Merged from the Moonlight 2 branch.
993 2008-04-11 Marek Safar <marek.safar@gmail.com>
995 * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
996 types and user defined operators. User operators arguments has to be checked
997 for null value before invocation, which also means no operator is called
998 when any argument is not convertible to unwrapped nullable type.
1000 2008-04-09 Marek Safar <marek.safar@gmail.com>
1002 * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
1003 of Unary expressions to follow operator overloading rules precisely.
1004 Also fixes #321794, #323794
1006 2008-04-08 Marek Safar <marek.safar@gmail.com>
1008 * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
1011 2008-04-08 Marek Safar <marek.safar@gmail.com>
1013 * expression.cs, ecore.cs: Implemented MemberInit expression.
1015 2008-04-08 Raja R Harinath <harinath@hurrynot.org>
1017 Fix mono/tests/exception4.cs
1018 * statement.cs (ExceptionStatement, TryCatch): Revert to using
1019 ec.NeedReturnLabel () rather emitting a 'nop'.
1021 * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
1023 (TryCatch.SomeCodeFollows): Likewise.
1024 * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
1025 for 'break', 'continue' and 'return' statements inside a try.
1026 We're fairly sure that the generated IL stream will have more
1027 instructions textually following the try.
1028 (FlowBranchingTryCatch): Likewise.
1030 * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
1031 * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
1034 * statement.cs (CollectionForeach.DisposableWrapper): Make a true
1035 wrapper -- forward everything to CollectionForeach.
1036 (CollectionForeach.NonDisposableWrapper): New.
1037 (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
1038 instead of a pop + branch to end.
1040 2008-04-07 Marek Safar <marek.safar@gmail.com>
1042 A fix for bug #377485
1043 * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs:
1044 Propagate location for extension method groups. Report conversion failure at
1047 2008-04-07 Marek Safar <marek.safar@gmail.com>
1049 * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
1050 ListInit and Field expressions.
1052 2008-04-06 Raja R Harinath <harinath@hurrynot.org>
1054 * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
1055 Since $PC is always -1 inside the body of MoveNext, the fault
1057 * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
1058 * statement.cs (ExceptionStatement.emit_finally): Likewise.
1059 (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
1061 The denouement! Fix #324708
1062 * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
1063 (Iterator.EmitYieldBreak): We no longer need to reset $PC.
1064 * statement.cs (ExceptionStatement.DoEmit): Actually emit the
1065 'finally' inside the finally clause.
1067 * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
1068 inside an iterator. Don't emit the body of the 'finally' inside
1069 the finally clause yet.
1071 Use the ResumableStatement infrastructure for MoveNext ()
1072 * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
1073 (Iterator.EmitMoveNext): Use 'resume_points'. Get rid of
1074 'old_resume_points'. Move dispatcher upfront.
1075 (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
1076 * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
1077 in an enumerator. This encodes the main fix in this patch series
1078 -- we can only jump into the first instruction of a try from the
1079 outside, but we want to emit try/finally regions in iterators and
1080 resume in the middle of them.
1082 2008-04-05 Raja R Harinath <harinath@hurrynot.org>
1084 * statement.cs (ExceptionStatement.ResolveFinally): Move setting
1085 of NeedReturnLabel here.
1087 Introduce a common point for emitting try/finally to IL
1088 * statement.cs (ExceptionStatement.DoEmit): New. Combines all the
1089 features of the various subclasses, which are now driven by ...
1090 (ExceptionStatement.EmitPreTryBody): ... this and ...
1091 (ExceptionStatement.EmitTryBody): ... this and the original
1093 (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
1094 Remove DoEmit and update to follow above protocol.
1096 * statement.cs (ExceptionStatement.EmitForDispose): If all labels
1097 of the dispatcher are the same, skip emitting the 'switch'.
1098 * iterator.cs (Iterator.EmitDispose): Update to changes.
1100 Clean up handling of 'using' statement
1101 * statement.cs (UsingTemporary): New. Carved out of ...
1102 (Using): ... this. Simplify drastically. Handle exactly
1104 * cs-parser.jay (using_statement): Split. Create UsingTemporary
1105 or Using as appropriate. If there are multiple variable declared,
1106 create nested Using statements.
1107 (resource_acquisition): Kill.
1109 * statement.cs (ExceptionStatement.EmitForDispose): Use
1110 EmitFinallyBody, not EmitFinally.
1112 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
1113 * iterator.cs: Update to changes.
1115 Start using the ResumableStatement infrastructure
1116 * statement.cs (ResumeableStatement.PrepareForDispose): New.
1117 (ResumableStatement.EmitForDispose): New.
1118 (ExceptionStatement): Override them.
1119 * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
1120 EmitForDispose to create the body of the Dispose method. Don't
1123 * iterator.cs (Iterator.AddResumePoint): Move here from ...
1124 * statement.cs (Toplevel.AddResumePoint): ... here.
1125 (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
1126 * flowanalysis.cs (FlowBranchingIterator): New.
1127 * codegen.cs (EmitContext): Update to changes.
1129 * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
1130 (Iterator.old_resume_points): Rename from 'resume_points'.
1131 (Iterator.MoveNextStatement): Remove unused class.
1133 New infrastructure for try/finally in iterators (still unused)
1134 * flowanalysis.cs (FlowBranching.AddResumePoint): New.
1135 (FlowBranchingToplevel.AddResumePoint): Hook into
1136 ToplevelBlock.AddResumePoint.
1137 (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
1138 (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
1139 * statement.cs (ToplevelBlock.AddResumePoint): New. Collect
1140 resume points and assign program-counter values.
1141 (ExceptionBlock.AddResumePoint): Collect resume points for
1142 de-muxer at the top of try block.
1143 * iterators.cs (Yield.CheckContext): Simplify.
1144 (Yield.Resolve): Use FlowBranching.AddResumePoint.
1146 2008-04-04 Raja R Harinath <harinath@hurrynot.org>
1148 * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
1149 argument to an ExitStatement.
1150 (FlowBranchingException): Refactor saved origins code.
1151 * statement.cs (ExitStatement): Update to cahges.
1152 * iterator.cs (YieldBreak): Likewise.
1154 * statement.cs (ResumableStatement): New. Common base class for
1155 YieldReturn and ExceptionStatement.
1156 (ExitStatement): New. Common base class for Return and YieldBreak.
1157 (Return): Update to changes.
1158 * iterator.cs (YieldBreak): Likewise.
1159 * lambda.cs (ContextualReturn): Likewise.
1162 * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
1163 emit a meaningful error message.
1165 Fix #324765, #319508
1166 * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
1167 (VariableInfo.SetAssigned): Set it.
1168 * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
1169 determine if CS0219 or CS0168 is appropriate. Don't use
1170 flow-analysis information.
1171 (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
1172 * codegen.cs (EmitContext.DoEndFlowBranching): Kill. Inline into ...
1173 (EmitContext.EndFlowBranching): ... this.
1175 2008-04-03 Marek Safar <marek.safar@gmail.com>
1177 * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
1179 2008-04-03 Marek Safar <marek.safar@gmail.com>
1181 A fix for bug #376508
1182 * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
1183 ImplicitConversionExists.
1185 2008-04-03 Marek Safar <marek.safar@gmail.com>
1187 * expression.cs (Binary): Added remaining binary operators to expression
1190 * nullable.cs: Optimize shift with null argument.
1192 2008-04-03 Raja R Harinath <harinath@hurrynot.org>
1194 Fix minor IL regression
1195 * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
1196 (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
1197 * cs-parser.jay (try_statement): Update to changes.
1199 * statement.cs (TryFinally.need_exc_block): Delete.
1200 (TryFinally): Update to changes.
1202 Now all ExceptionStatements are unconditional
1203 * statement.cs (CollectionForeach.DisposableWrapper): New.
1204 Extract out the try/finally code into a new wrapper.
1205 (CollectionForeach.Resolve): Use it to simplify the code.
1207 2008-04-02 Raja R Harinath <harinath@hurrynot.org>
1209 Start at simplifying ExceptionStatement semantics a bit
1210 * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
1211 * cs-parser.jay (try_statement): Update to changes.
1212 (opt_catch_clauses): Remove.
1213 * flowanalysis.cs: Update to changes.
1214 (FlowBranching.BranchingType.TryCatch): New.
1215 (FlowBranchingTryCatch): New.
1217 * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
1218 (FlowBranching.CreateBranching): Update to changes.
1219 (FlowBranchingBlock.AddSibling): Add sanity check.
1220 * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
1223 * iterators.cs (Iterator.MarkFinally): Remove.
1224 * statement.cs (ExceptionStatement): Update to changes.
1226 Add support for skipping over finally blocks at runtime. First
1227 in a series to fix #324708
1228 * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
1229 (Iterator.EmitMoveNext): Initialize it.
1230 * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
1231 branch over the body of the 'finally' clause.
1233 2008-03-31 Raja R Harinath <harinath@hurrynot.org>
1235 Avoid lopsided use of Foo/DoFoo names
1236 * statement.cs (ExpressionStatement.EmitFinallyBody):
1237 Rename from EmitFinally.
1238 (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
1239 * iterator.cs: Update to changes.
1241 2008-04-02 Marek Safar <marek.safar@gmail.com>
1243 * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
1244 based on UserOperatorCall. More binary nullable operators clean up.
1246 2008-04-02 Martin Baulig <martin@ximian.com>
1248 * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
1250 2008-04-02 Marek Safar <marek.safar@gmail.com>
1252 * nullable.cs: Merge user and empty conversions when lifting expression
1255 * expression.cs (StringConcat): Implemented expression tree representation.
1257 2008-04-01 Marek Safar <marek.safar@gmail.com>
1259 * nullable.cs: When lifting null literal and a user operator exists, no call
1262 2008-04-01 Marek Safar <marek.safar@gmail.com>
1264 * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
1267 2008-04-01 Marek Safar <marek.safar@gmail.com>
1269 * nullable.cs, expression.cs: Use namespace instead heavily nested
1270 monster abstract class.
1272 2008-04-01 Marek Safar <marek.safar@gmail.com>
1274 * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
1275 lifting of null literal and user operators. Clean up of some temporary
1278 2008-03-30 Raja R Harinath <harinath@hurrynot.org>
1280 Fix #368224, test-629.cs
1281 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
1282 if it crossed an unwind-protect boundary.
1283 * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
1284 (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
1285 inside an unwind-protected region.
1286 (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
1287 (Iterator.MarkYield): Add 'unwind_protect' parameter. Emit a
1288 'leave' instead of a 'br' if unwind-protected.
1289 (Iterator.EmitYieldBreak): Likewise.
1291 2008-03-29 Gert Driesen <drieseng@users.sourceforge.net>
1293 * driver.cs: Only define versioninfo resources if no win32 resource
1296 2008-03-28 Marek Safar <marek.safar@gmail.com>
1298 A fix for bug #372375
1299 * convert.cs: Fixed boxing of nullable types.
1301 2008-03-28 Marek Safar <marek.safar@gmail.com>
1303 * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
1306 2008-03-28 Marek Safar <marek.safar@gmail.com>
1308 A fix for bug #374619
1309 * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
1311 2008-03-27 Marek Safar <marek.safar@gmail.com>
1313 * lambda.cs: Check return type only for invocation.
1315 2008-03-27 Marek Safar <marek.safar@gmail.com>
1317 A fix for bug #374214
1318 * ecore.cs: Correctly report argument type mismatch.
1320 2008-03-27 Marek Safar <marek.safar@gmail.com>
1322 * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
1323 and not rely on broken IsEnum.
1325 2008-03-27 Marek Safar <marek.safar@gmail.com>
1327 * nullable.cs: New file, extracted from generic.cs.
1329 * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
1331 2008-03-27 Marek Safar <marek.safar@gmail.com>
1333 * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
1334 predefined comparison operators and null literals.
1336 * report.cs: New warning ID.
1338 2008-03-25 Marek Safar <marek.safar@gmail.com>
1340 A fix for bug #370577
1341 * lambda.cs: Check return type too.
1343 2008-03-25 Marek Safar <marek.safar@gmail.com>
1345 A fix for bug #372846
1346 * class.cs: Automatic properties can be declared as unsafe.
1348 2008-03-20 Marek Safar <marek.safar@gmail.com>
1350 * location.cs: Use string based concatenation.
1352 * expression.cs: LiftedBinaryOperator is gmcs only.
1354 2008-03-20 Marek Safar <marek.safar@gmail.com>
1356 * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
1357 conversions rules and expression trees.
1359 2008-03-19 Marek Safar <marek.safar@gmail.com>
1361 * delegate.cs: Use extension method source as delegate target.
1363 2008-03-19 Marek Safar <marek.safar@gmail.com>
1365 * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
1366 binary operations to be purely based on binary operations and optimized
1367 emitted code (30% less in some cases). Introduced ReducedExpression for ETs
1368 and other ET refactoring.
1370 * typemanager.cs: Fixed warning.
1372 2008-03-17 Marek Safar <marek.safar@gmail.com>
1374 * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
1376 * symbolwriter.cs: Fixed.
1378 2008-03-17 Marek Safar <marek.safar@gmail.com>
1380 * anonymous.cs, driver.cs: Reset anonymous types counters.
1382 2008-03-17 Marek Safar <marek.safar@gmail.com>
1384 * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
1386 * class.cs: Use fullname for all type member definitions.
1388 2008-02-19 Martin Baulig <martin@ximian.com>
1391 (IMethodData.EmitExtraSymbolInfo): New interface method.
1392 (MethodData.Emit): Call method.EmitExtraSymbolInfo().
1393 (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
1394 interface method here as an empty public virtual method.
1397 (AnonymousMethodMethod.ctor): Added `string real_name' argument.
1398 (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
1399 CodeGen.SymbolWriter.SetRealMethodName().
1401 2008-02-18 Martin Baulig <martin@ximian.com>
1404 (ScopeInfo.EmitType): Override this and emit debugging
1405 information for captured variables.
1406 (RootScopeInfo.EmitType): Override this and emit symbol
1407 information for a captured `this'.
1409 2008-02-15 Martin Baulig <martin@ximian.com>
1411 * iterators.cs: Emit debugging info.
1414 (EmitContext.Flags): Add `OmitDebuggingInfo'.
1415 (EmitContext.OmitDebuggingInfo): New public property.
1418 (While): Override Emit() and don't emit symbol info there; do it
1419 inside DoEmit() instead.
1420 (Block.Emit): Omit symbol information while emitting the scope
1421 initializers; don't ec.Mark() the `EndLocation'. Fix the lexical
1423 (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
1424 (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
1425 .ctor to make `IsIterator' work.
1427 2008-03-14 Martin Baulig <martin@ximian.com>
1429 * symbolwriter.cs: Added the new symbol writer function from the
1430 debugger's `terrania' branch; temporarily enclose them inside
1431 `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
1434 2008-03-14 Martin Baulig <martin@ximian.com>
1437 (SymbolWriter): Make this a public static class.
1440 (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
1441 class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
1443 2008-03-14 Marek Safar <marek.safar@gmail.com>
1445 A fix for bug #370577
1446 * statement.cs, lambda.cs: Added extra limitations when dealing with void
1449 2008-03-14 Marek Safar <marek.safar@gmail.com>
1451 * typemanager.cs (CSharpName): Made 250 times faster.
1453 2008-03-13 Marek Safar <marek.safar@gmail.com>
1455 * ecore.cs, expression.cs: Emit conversion for ET shift argument.
1457 2008-03-12 Marek Safar <marek.safar@gmail.com>
1459 * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
1460 crash when predefined field does not exist.
1462 2008-03-12 Marek Safar <marek.safar@gmail.com>
1464 * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
1466 2008-03-12 Marek Safar <marek.safar@gmail.com>
1468 * class.cs (FixedField): Don't crash when contructors are missing.
1470 2008-03-11 Marek Safar <marek.safar@gmail.com>
1472 * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
1473 convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
1474 check internal types accessibility for internal and external types.
1475 Replaced EnumToUnderlying by GetEnumUnderlyingType.
1477 2008-03-11 Marek Safar <marek.safar@gmail.com>
1479 * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
1480 convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
1481 attribute.cs, statement: Use corect instance of predefined types (work
1482 related to #364674).
1484 2008-03-07 Marek Safar <marek.safar@gmail.com>
1486 * expression.cs (TypeOfVoid): Fixed predefined method initialization.
1488 2008-03-07 Marek Safar <marek.safar@gmail.com>
1490 * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs,
1491 class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
1492 expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
1493 predefined types clean up, delayed predefined types members initialization
1494 (work related to #364674).
1496 2008-03-05 Marek Safar <marek.safar@gmail.com>
1498 * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
1500 2008-03-05 Marek Safar <marek.safar@gmail.com>
1502 * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
1503 delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
1504 predefined types clean up (work related to #364674).
1506 2008-03-04 Marek Safar <marek.safar@gmail.com>
1508 * ecore.cs: Print an error message instead of throwing exception.
1510 2008-03-04 Marek Safar <marek.safar@gmail.com>
1512 * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
1513 expression.cs, statement.cs: Unififed null literal representation.
1515 2008-03-03 Marek Safar <marek.safar@gmail.com>
1517 * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
1518 expression.cs: Refactored binary operators resolve phase and improved speed.
1519 The nullable code is still missing and won't work correctly, more fixes
1522 It also fixes #323726, #324312, #324248, and many other unreported issues.
1524 2008-02-29 Zoltan Varga <vargaz@gmail.com>
1526 * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs'
1529 2008-02-27 Marek Safar <marek.safar@gmail.com>
1531 * ecore.cs: Clean-up and split BetterConversion.
1533 2008-02-25 Raja R Harinath <harinath@hurrynot.org>
1536 * enum.cs (EnumMember.Value): Only access 'value' if
1537 ResolveValue says it's ok.
1538 (EnumMember.DoResolveValue): Don't set prev_member.value.
1539 (Enum.GetDefinition): Reverse arguments of Equals --
1540 EnumMember.Value can return 'null'.
1542 * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
1544 2008-02-22 Marek Safar <marek.safar@gmail.com>
1546 * generic.cs, expression.cs: More ongoing work on expression trees.
1548 2008-02-21 Marek Safar <marek.safar@gmail.com>
1550 * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
1551 handle missing matches when mutiple operators exist.
1553 2008-02-20 Marek Safar <marek.safar@gmail.com>
1555 A fix for bug #363218
1556 * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
1559 2008-02-20 Marek Safar <marek.safar@gmail.com>
1561 * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
1562 update. This time to deal correctly with SideEffectConstant expression used
1563 as an argument for another constant folding.
1565 2008-02-20 Raja R Harinath <harinath@hurrynot.org>
1567 * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
1570 2008-02-19 Marek Safar <marek.safar@gmail.com>
1572 * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
1574 2008-02-19 Marek Safar <marek.safar@gmail.com>
1576 A fix for bug #328136
1577 * expression.cs: Do not fold immediately LogicalAnd operators when the left
1578 side is a false constant, because we still need to evaluate the right-hand
1581 * statement.cs (If): Emit two types of boolean constants (simple constant,
1582 side-effect constant).
1584 2008-02-19 Marek Safar <marek.safar@gmail.com>
1586 * constant.cs (SideEffectConstant): Don't emit boolean constant.
1588 * expression.cs: Fold immediately LogicalAnd operators when both sides are
1591 2008-02-18 Marek Safar <marek.safar@gmail.com>
1593 A fix for bug #361457
1594 * ecore.cs (IsApplicable): Params methods have lower priority.
1596 * support.cs: Return correct parameter modifier for params types.
1598 2008-02-18 Marek Safar <marek.safar@gmail.com>
1600 * generic.cs (TypeParameter): Cache attribute target name.
1602 * support.cs: Removed unused variable.
1604 * typemanager.cs: Removed debugging leftover.
1606 * ecore.cs: Use local type instead of a property;
1608 * class.cs (VerifyMembers): Consider also parent to test whether type member
1611 * expression.cs (FullMethodDesc): Removed.
1613 * attribute.cs (IsValidArgumentType): Made static.
1615 2008-02-17 Raja R Harinath <harinath@hurrynot.org>
1617 Cleanup to be more readable.
1618 * Makefile (GMCS_PROFILE): Remove.
1619 (COMPILER_NAME): New helper.
1621 2008-02-15 Miguel de Icaza <miguel@novell.com>
1623 * cs-tokenizer.cs: if a conditional expression happens inside a
1624 (...) this also means that we do not need to de-ambiguate between
1625 an parenthesized expression and a cast.
1629 * constant.cs (SideEffectConstant): a constant value that happens
1630 to have a side effect.
1632 Fixes the build regressions introduced by the fix for #359789
1634 2008-02-14 Rodrigo Kumpera <rkumpera@novell.com>
1636 * expression.cs (Conditional.Emit): when emitting the ternary
1637 operator, use local variables to generate code verifiable code.
1639 The verifier cannot infer that the type on stack before the
1640 stloc.0 is executed is of type ParentB. This happens because the
1641 stack merge algorithm uses only parent types when deciding which
1642 is the common type. This is described in Part III 1.8.1.3 of ECMA
1645 This code compiled with mcs is not verifiable under MS. The MS
1646 verifier picks the first common interface of Foo and Bar, which is
1647 wrong, but doesn't use a full join type of the 2 interfaces.
1649 CSC uses a clever hack to compile such code in a verifiable
1650 way. It stores the intermediate values in a local variable with
1655 2008-02-14 Miguel de Icaza <miguel@novell.com>
1657 * expression.cs: Do not fold BitwiseAnd operators when the left
1658 side is a false constant, because we still need to evaluate the
1663 * support.cs: Instead of throwing an InternalErrorException when
1664 the position of the stream is outside the boundary of our buffer,
1665 reset the state of the reader, and restart the reading from the
1666 beginning of the file.
1668 2008-02-14 Marek Safar <marek.safar@gmail.com>
1670 * generic.cs (TypeParameter.GetMembers): Is not supported operation.
1672 2008-02-14 Marek Safar <marek.safar@gmail.com>
1674 A fix for bug #361686
1675 * decl.cs: A protected types used inside a private class which parents
1676 derives from the protected class are accessible.
1678 2008-02-13 Marek Safar <marek.safar@gmail.com>
1680 * generic.cs (ConstraintChecker): Use cached member lookup when looking for
1681 the parameterless constructor.
1683 2008-02-13 Marek Safar <marek.safar@gmail.com>
1685 * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
1686 lookup methods to use standard member cache when doing member lookup.
1688 2008-02-12 Marek Safar <marek.safar@gmail.com>
1690 * driver.cs: Don't report full path for referenced module as assembly error.
1692 2008-02-12 Marek Safar <marek.safar@gmail.com>
1694 * Makefile: Fixed `qh' target to work on all machines.
1696 * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
1697 expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
1698 and HasElementType with TypeManager implementation.
1700 2008-02-08 Marek Safar <marek.safar@gmail.com>
1702 A fix for bugs #325134, #359749
1703 * expression.cs, ecore.cs: Try to resolve an extension method even if the
1704 first binds point to non-method member expression.
1706 2008-02-08 Marek Safar <marek.safar@gmail.com>
1708 * cs-parser.jay: Null coalescing operator is not part of ISO-1.
1710 2008-02-08 Marek Safar <marek.safar@gmail.com>
1712 A fix for bugs #321394, #323028
1713 * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
1714 Reworked naive IsAccessibleAs implementation to handle nested types.
1716 2008-02-05 Jb Evain <jbevain@novell.com>
1718 * class.cs: use generic type comparison for parameters
1721 2008-02-05 Marek Safar <marek.safar@gmail.com>
1723 A fix for bug #325372
1724 * class.cs: Use generic type comparison when testing method signatures.
1726 2008-02-05 Marek Safar <marek.safar@gmail.com>
1728 A fix for bug #357047
1729 * ecore.cs: Applied C# 3.0 changes to better conversion.
1731 2008-02-05 Marek Safar <marek.safar@gmail.com>
1733 A fix for bug #358374
1734 * cs-parser.jay: Correctly set modifiers for all constructor types.
1736 2008-02-04 Marek Safar <marek.safar@gmail.com>
1738 A fix for bug #355251
1739 * generic.cs: Added base class constraint based type inference.
1741 2008-02-01 Marek Safar <marek.safar@gmail.com>
1743 A fix for bug #357255
1744 * decl.cs: One more missing visibility check.
1746 2008-02-01 Marek Safar <marek.safar@gmail.com>
1748 * support.cs: Fixed broken return.
1750 2008-01-25 Marek Safar <marek.safar@gmail.com>
1752 * report.cs: Correctly reset warnings count after probing.
1754 2008-01-25 Martin Baulig <martin@ximian.com>
1757 (NamespaceEntry.SymbolFileID): Make this work again after
1758 MemberName.ToString() is gone.
1760 2008-01-25 Marek Safar <marek.safar@gmail.com>
1762 * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
1765 2008-01-25 Marek Safar <marek.safar@gmail.com>
1767 * generic.cs: Use full implicit conversion for type inference fixing.
1769 2008-01-24 Marek Safar <marek.safar@gmail.com>
1771 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
1772 Fixed user operator conversions.
1774 2008-01-24 Marek Safar <marek.safar@gmail.com>
1776 * generic.cs: Do nullable type to null comparison optimization during
1779 2008-01-24 Marek Safar <marek.safar@gmail.com>
1781 A fix for bug #355163
1782 * generic.cs: Enabled l-value resolve on nullable expressions.
1784 2008-01-24 Marek Safar <marek.safar@gmail.com>
1786 A fix for bug #353986
1787 * class.cs: Ingore static ctors with parameters for any further checks.
1789 2008-01-24 Marek Safar <marek.safar@gmail.com>
1791 A fix for bug #354310
1792 * namespace.cs: Removed redundant check.
1794 2008-01-24 Marek Safar <marek.safar@gmail.com>
1796 A fix for bug #354928
1797 * expression.cs: ElementInitializers can be resolved only once.
1799 2008-01-24 Marek Safar <marek.safar@gmail.com>
1801 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
1802 Condition expressions.
1804 2008-01-23 Marek Safar <marek.safar@gmail.com>
1806 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
1808 2008-01-22 Marek Safar <marek.safar@gmail.com>
1810 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
1813 * generic.cs: Implemented coalesce expression.
1815 2008-01-22 Marek Safar <marek.safar@gmail.com>
1817 A fix for bug #355145
1818 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
1819 expression tree type inference.
1821 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
1824 * expression.cs (Binary.IsUnsignedType): Fix typo.
1826 2008-01-22 Marek Safar <marek.safar@gmail.com>
1828 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
1830 2008-01-22 Marek Safar <marek.safar@gmail.com>
1832 A fix for bug #355161
1833 * ecore.cs, expression.cs: Wider range of extension method supported
1836 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
1838 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
1839 AssemblyBuilder to operate in compiler context. Fixes mcs part of
1842 2008-01-22 Marek Safar <marek.safar@gmail.com>
1844 A fix for bug #355148
1845 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
1847 2008-01-22 Miguel de Icaza <miguel@novell.com>
1849 * expression.cs (CreateExpressionTree): Add support for or and
1850 logical or, and indent following the coding conventions.
1852 * typemanager.cs (LinqExpression): renamed from
1853 ExpressionTreeManager, for a shorter name.
1855 Use TypeManager.CoreLookupType to lookup types from our core
1856 assemblies and turn those into "Type" variables.
1858 Consumers that previously used "Namespace" and "Type" from this
1859 class should instead use the TypeExpression which is a type that
1860 is fully resolved (without involving the regular C# resolution
1863 This typically looks like this:
1865 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
1866 new MemberAccess (texpr, name, type_arguments, loc)
1868 This avoids the problem in: #355178
1870 2008-01-21 Marek Safar <marek.safar@gmail.com>
1872 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
1873 feature in parser only as we do in other cases.
1875 2008-01-21 Marek Safar <marek.safar@gmail.com>
1877 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
1878 typemanager.cs: A refactoring of params arguments to reuse existing
1879 expressions (params -> array initializer) to emit params argument instead
1880 of specialized handling.
1881 It was required by expression tree implementation and it has other benefits
1882 as well, we now apply same optimization for params arguments as we do for
1885 2008-01-18 Marek Safar <marek.safar@gmail.com>
1887 A fix for bug #353526
1888 * generic.cs: A type inference of params arguments may not required any
1889 temporary array creation.
1891 2008-01-18 Marek Safar <marek.safar@gmail.com>
1893 A fix for bug #353534
1894 * generic.cs, ecore.cs, expression.cs: A method group type inference is
1895 supported for delegates only.
1897 2008-01-18 Marek Safar <marek.safar@gmail.com>
1899 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
1900 type for more than 1 candidates.
1902 2008-01-18 Marek Safar <marek.safar@gmail.com>
1904 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
1907 2008-01-16 Marek Safar <marek.safar@gmail.com>
1909 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
1910 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
1911 operator) expressions.
1913 2008-01-16 Zoltan Varga <vargaz@gmail.com>
1915 * statement.cs: Avoid declaring an IL variable for this_variable since it is
1916 not accessed from the generated IL.
1918 2008-01-14 Marek Safar <marek.safar@gmail.com>
1920 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
1921 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
1922 statement.cs: The first expression tree implementation drop, mostly
1923 infrastructure work.
1925 2008-01-14 Marek Safar <marek.safar@gmail.com>
1927 * ecore.cs (IsNestedChild): Refactored.
1929 2008-01-11 Marek Safar <marek.safar@gmail.com>
1931 * lambda.cs: Don't use a cast on unknown expression statement.
1933 2008-01-10 Geoff Norton <gnorton@novell.com>
1935 * cs-tokenizer.cs: One more token to distinguish between method and lambda
1938 2008-01-09 Marek Safar <marek.safar@gmail.com>
1940 * doc.cs: Report better /doc crash details.
1942 2008-01-09 Marek Safar <marek.safar@gmail.com>
1944 A fix for bug #352536
1945 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
1947 2008-01-08 Marek Safar <marek.safar@gmail.com>
1949 A fix for bug #352287
1950 * ecore.cs, expression.cs: Do `this' access checking in all member access
1953 2008-01-08 Marek Safar <marek.safar@gmail.com>
1955 * rootcontext.cs, driver.cs: Switch to linq mode by default.
1957 * report.cs: Reset message stacks.
1959 2008-01-08 Marek Safar <marek.safar@gmail.com>
1961 * generic.cs (InferInPhases): Correctly calculate params position.
1963 2008-01-08 Marek Safar <marek.safar@gmail.com>
1965 * cs-tokenizer.cs: No need to parse full string when parsing lambda
1968 2008-01-07 Marek Safar <marek.safar@gmail.com>
1970 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
1972 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
1974 * driver.cs: Updated --help option.
1976 2008-01-07 Marek Safar <marek.safar@gmail.com>
1978 * generic.cs (InferParamsTypeArguments): Removed.
1979 (InferInPhases): Add params type inference.
1980 (LowerBoundInference): Fixed scoring mechanism.
1982 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
1984 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
1986 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
1987 byte array for unsigned "baked" assemblies.
1989 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
1991 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
1992 array for assemblies that are not strongnamed.
1994 2008-01-04 Marek Safar <marek.safar@gmail.com>
1996 A fix for bug #351481
1997 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
1998 declaring type for nested generic types.
2000 2008-01-04 Marek Safar <marek.safar@gmail.com>
2002 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
2003 instead of ToString.
2005 2008-01-03 Marek Safar <marek.safar@gmail.com>
2007 A fix for bug #351047
2008 * expression.cs (Binary.ResolveOperator): Allow equality operators between
2009 null and structs only when equality and inequality operators are defined
2010 either as an user-operators or predefined operators.
2012 2008-01-03 Marek Safar <marek.safar@gmail.com>
2014 A fix for bug #351047
2015 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
2017 2008-01-03 Marek Safar <marek.safar@gmail.com>
2019 A fix for bug #351257
2020 * cs-tokenizer.cs: Advance line number for '\r' correctly.
2022 2008-01-03 Marek Safar <marek.safar@gmail.com>
2024 A fix for bug #351157
2025 * class.cs (Using): Fixed yet another broken cloning.
2027 (Block): Put back more sensible default value for statements.
2029 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
2031 * codegen.cs: Allow AssemblyVersion with only major version component.
2034 2007-12-29 Marek Safar <marek.safar@gmail.com>
2036 A fix for bug #324654
2037 * class.cs: Use FullName property as member name.
2039 2007-12-28 Marek Safar <marek.safar@gmail.com>
2041 A fix for bug #342117
2042 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
2043 constructor constraint.
2045 2007-12-28 Marek Safar <marek.safar@gmail.com>
2047 A fix for bug #338273
2048 * class.cs (ProbertyBase): Access modifier checks are required for overrides
2051 2007-12-28 Marek Safar <marek.safar@gmail.com>
2053 A fix for bug #350839
2054 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
2056 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
2058 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
2061 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
2063 * statement.cs: Changed some Hashtables to use HybridDictionaries
2064 instead. It was observed that some HashTables only contained a few
2065 items in the vast majority of cases. Since HybridDictionary is
2066 more efficient on small sets (<10 elements), "known_variables"
2067 from class ExplicitBlock as well as "labels" and "constants " from
2068 class Block were changed to HybridDictionaries.
2070 Atsai results: (56216kb->54987kb)
2072 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
2075 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
2077 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
2080 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
2082 * expression.cs: foreach loop to for loop, saved on allocation of
2083 enumerator (59333kb->59141kb)
2085 * statement.cs. Changed foreach loops to for loops, saved on
2086 allocation of enumerator (59141kb->59006kb)
2088 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
2089 when constructed with no specified capacity. This was causing a
2090 few ArrayLists to allocate more memory than they would potentially
2091 need in the Block class and MemberCache class. Setting the
2092 ArrayLists to construct with a capacity of 1 saves some
2093 memory. (56216kb->55585kb)
2095 2007-12-27 Marek Safar <marek.safar@gmail.com>
2097 A fix for bug #347189 (2nd issue)
2098 * expression.cs (MemberAccess): Nested type can be found in base non-generic
2101 2007-12-27 Miguel de Icaza <miguel@novell.com>
2103 * report.cs: Do not use colors if stdout and stderr are not a
2106 2007-12-27 Marek Safar <marek.safar@gmail.com>
2108 A fix for bug #346998
2109 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
2112 2007-12-27 Marek Safar <marek.safar@gmail.com>
2114 A fix for bug #343465
2115 * class.cs: Explicit method name for nested types uses dots only.
2117 2007-12-27 Marek Safar <marek.safar@gmail.com>
2119 A fix for bug #343707
2120 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
2122 2007-12-27 Marek Safar <marek.safar@gmail.com>
2124 * ecore.cs: Report type inference errors only when arguments count matches
2127 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
2129 * expression.cs, report.cs: New warning.
2131 * typemanager.cs: Catch anonymous method type too.
2133 2007-12-23 Marek Safar <marek.safar@gmail.com>
2135 A fix for bug #346379
2136 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
2138 2007-12-23 Marek Safar <marek.safar@gmail.com>
2140 A fix for bug #347359
2141 * expression.cs (Invocation): Don't resolve already resolved expression.
2143 2007-12-23 Marek Safar <marek.safar@gmail.com>
2145 A fix for bug #347189
2146 * class.cs (FixedField): Use non-dependent code only in the define phase.
2148 2007-12-23 Marek Safar <marek.safar@gmail.com>
2150 A fix for bug #348076
2151 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
2153 2007-12-22 Marek Safar <marek.safar@gmail.com>
2155 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
2156 discovered extension methods.
2158 2007-12-22 Marek Safar <marek.safar@gmail.com>
2160 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
2163 2007-12-21 Miguel de Icaza <miguel@novell.com>
2165 * report.cs (ErrorMessage): Add support for using colors on
2166 terminals that support it.
2168 2007-12-21 Marek Safar <marek.safar@gmail.com>
2170 * ecore.cs: Use information about expanded params for error reporting.
2172 2007-12-21 Marek Safar <marek.safar@gmail.com>
2174 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
2175 and logic for params overloads.
2177 2007-12-15 Miguel de Icaza <miguel@novell.com>
2179 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
2180 as this is also created from the parser. Fixes #349034
2182 2007-12-12 Miguel de Icaza <miguel@novell.com>
2184 * statement.cs (Throw.CloneTo): it is valid to have empty
2185 expressions for throw.
2187 2007-12-03 Marek Safar <marek.safar@gmail.com>
2189 * cs-parser.jay: Set delegate constraint parsing region correctly.
2191 2007-12-03 Marek Safar <marek.safar@gmail.com>
2193 A fix for bug #345467
2194 * typemanager.cs (IsEqual): Compare generic parameters position only.
2196 2007-11-28 Marek Safar <marek.safar@gmail.com>
2198 * expression.cs (BaseAccess): Type arguments can be null.
2200 2007-11-27 Raja R Harinath <harinath@gmail.com>
2202 * statement.cs (Block.Resolve): Ensure flow-branching tree is
2203 consistent even when an error has occured.
2204 (Switch.Resolve): Likewise.
2206 2007-11-22 Marek Safar <marek.safar@gmail.com>
2208 A fix for bug #334505
2209 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
2212 2007-11-22 Marek Safar <marek.safar@gmail.com>
2214 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
2215 refactorings required to resolve extension methods correctly when mixing
2216 generics and non-generics members.
2218 2007-11-20 Marek Safar <marek.safar@gmail.com>
2220 A fix for bug #342584
2221 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
2224 2007-11-19 Marek Safar <marek.safar@gmail.com>
2226 A fix for bug #342512
2227 * delegate.cs: Use delegate argument expression when is available. Don't
2228 emit virtual call when class is sealed.
2230 2007-11-16 Marek Safar <marek.safar@gmail.com>
2232 A fix for bug #325423
2233 * assign.cs (FieldInitializer): Use resolved expression for emit.
2235 * class.cs: Print less confusing error message.
2237 2007-11-16 Marek Safar <marek.safar@gmail.com>
2239 * cs-tokenizer.cs: Removed GMCS ifdefs.
2241 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
2244 * cs-parser.jay: Disabled nullable check.
2246 * generic-mcs: Copied more generic stuff.
2248 2007-11-16 Marek Safar <marek.safar@gmail.com>
2250 * gcs-parser.jay: Merged to cs-parser.jay.
2252 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
2253 * *.csproj, *.sources: Updated to use only jay parser file.
2255 2007-11-16 Marek Safar <marek.safar@gmail.com>
2257 * gcs-parser.jay: Added nullable and default expression feature checks.
2259 2007-11-16 Marek Safar <marek.safar@gmail.com>
2261 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
2262 it fixes many TODOs and hidden bugs.
2264 * expression: Removed duplicate error check.
2266 2007-11-15 Marek Safar <marek.safar@gmail.com>
2268 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
2269 implicitly type local variable only when it is used in a declaration.
2271 2007-11-15 Marek Safar <marek.safar@gmail.com>
2273 * attribute.cs: Use CS0612 for empty strings.
2275 2007-11-14 Marek Safar <marek.safar@gmail.com>
2277 * lambda.cs, statement.cs: Contextual return may act as a statement.
2279 2007-11-14 Marek Safar <marek.safar@gmail.com>
2281 A fix for a regression cause by #324222
2282 * class.cs: Don't report unused even when it implements an interface.
2284 2007-11-13 Marek Safar <marek.safar@gmail.com>
2286 A fix for bug #341205
2287 * ecore.cs, expression.cs: Method group expression cannot do static
2288 method access with an instance reference check before overloading takes
2291 2007-11-13 Marek Safar <marek.safar@gmail.com>
2293 A fix for bug #325359
2294 * class.cs: Use predictable name for automatically generated property.
2296 2007-11-12 Marek Safar <marek.safar@gmail.com>
2298 A fix for bug #324996
2299 * expression.cs (Is): Handle case where D is nullable and T is not
2302 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
2304 2007-11-12 Marek Safar <marek.safar@gmail.com>
2306 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
2307 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
2308 Flush small error reporting changes.
2310 2007-11-09 Marek Safar <marek.safar@gmail.com>
2312 A fix for bug #324996
2313 * expression.cs: Rewrote Is expression implementation to work with
2314 generics, nullable types, anonymous method. A const result expression
2315 uses existing infrastructure instead of custom not fully-featured one.
2317 2007-11-08 Marek Safar <marek.safar@gmail.com>
2319 A fix for bug #340202
2320 * class.cs: Consider generics for volatile field.
2322 2007-11-08 Marek Safar <marek.safar@gmail.com>
2324 A fix for bug #335594
2325 * expression.cs: Use conversion rules when handling string addition.
2327 2007-11-07 Marek Safar <marek.safar@gmail.com>
2329 A fix for bug #336651
2330 * expression.cs: Fixed a crash when probing is on.
2332 2007-11-07 Marek Safar <marek.safar@gmail.com>
2334 A fix for bug #324242
2335 * covert.cs: Added a conversion from any nullable-type with an
2336 underlying enum-type to the type System.Enum.
2338 2007-11-07 Marek Safar <marek.safar@gmail.com>
2340 A fix for bug #324222
2341 * class.cs: Report all non-used event fields.
2343 2007-11-07 Marek Safar <marek.safar@gmail.com>
2345 A fix for bug #325161
2346 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
2347 qualifier for generic types.
2349 2007-11-07 Marek Safar <marek.safar@gmail.com>
2351 A fix for bug #322971
2352 * expression.cs, ecore.cs: Added intermediate result value check for
2355 2007-11-07 Marek Safar <marek.safar@gmail.com>
2357 A fix for bug #324754
2358 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
2359 when it was requested.
2361 2007-11-07 Marek Safar <marek.safar@gmail.com>
2363 A fix for bug #325101
2364 * expression.cs: Do type not value comparison for `is' expression.
2366 2007-11-07 Marek Safar <marek.safar@gmail.com>
2368 A fix for bug #320236
2369 * convert.cs: Don't apply user conversion on underlying target type.
2371 2007-11-06 Marek Safar <marek.safar@gmail.com>
2373 * expression.cs: Don't use unresolved expression for error reporting.
2375 2007-11-06 Marek Safar <marek.safar@gmail.com>
2377 A fix for bugs #337712, #324490
2378 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
2379 overloading resolution too.
2381 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
2382 the process consistent and more robust.
2384 * expression.cs, linq.cs, report.cs: Update.
2386 2007-11-02 Marek Safar <marek.safar@gmail.com>
2388 A fix for bug #332909
2389 * attribute.cs: Resolve attributes in correct context using error
2392 * rootcontext.cs: Define Obsolete attribute members as core members.
2394 2007-11-02 Marek Safar <marek.safar@gmail.com>
2396 * statement.cs: Removed unused methods.
2398 2007-10-31 Wade Berrier <wberrier@novell.com>
2400 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
2401 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
2404 2007-10-31 Marek Safar <marek.safar@gmail.com>
2406 A fix for bug #338102
2407 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
2408 methods registered as non-generics.
2410 2007-10-31 Marek Safar <marek.safar@gmail.com>
2412 A fix for bugs #337712, #324490
2413 * delegate.cs: Delegate covariance and contravariance is not allowed for
2416 2007-10-31 Marek Safar <marek.safar@gmail.com>
2418 A fix for bug #337719
2419 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
2422 2007-10-30 Marek Safar <marek.safar@gmail.com>
2424 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
2426 2007-10-29 Marek Safar <marek.safar@gmail.com>
2428 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
2431 2007-10-29 Raja R Harinath <rharinath@novell.com>
2433 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
2435 2007-10-29 Marek Safar <marek.safar@gmail.com>
2437 A fix for bug #334652
2438 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
2439 extension methods when we have not found the best candidate in normal
2442 2007-10-27 Marek Safar <marek.safar@gmail.com>
2444 * AssemblyInfo.cs: Keep up-to-date.
2446 2007-10-27 Marek Safar <marek.safar@gmail.com>
2448 * Makefile: Fixed generics compiler name.
2450 2007-10-27 Marek Safar <marek.safar@gmail.com>
2452 * lambda.test: removed, lambda parsing is done differently.
2454 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
2456 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
2458 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
2460 2007-10-27 Marek Safar <marek.safar@gmail.com>
2462 * Makefile, *.sources : All C# compilers are in mcs folder.
2464 * *.cs: Use existing 2_1 define for smcs.
2466 2007-10-26 Marek Safar <marek.safar@gmail.com>
2468 A fix for bug #335847
2469 * assign.cs, expression.cs: Couple of changes to avoid creating a
2470 temporary variable for each object initializer assignment statement. It
2471 simplifies struct initialization too, otherwise two temporary variables
2473 Implemented optimization of redundant default element initializers.
2475 2007-10-25 Marek Safar <marek.safar@gmail.com>
2477 A fix for bug #336766
2478 * expression.cs (Class.CheckBase): Use generic name when method is
2481 2007-10-25 Marek Safar <marek.safar@gmail.com>
2483 A fix for bug #334737
2484 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
2485 variable and not variable argument for prepared copies.
2487 2007-10-24 Marek Safar <marek.safar@gmail.com>
2489 A fix for bug #325110
2490 * class.cs, expression.cs, attribute.cs: Use open generic method when
2491 checking conditional attribute.
2493 2007-10-24 Marek Safar <marek.safar@gmail.com>
2495 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
2496 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
2497 FeatureIsNotAvailable.
2499 2007-10-24 Marek Safar <marek.safar@gmail.com>
2501 ** C# 3.0 Partial methods
2503 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
2504 methods support. Because of member cache issue with generics only
2505 non-generics partial methods are fully supported.
2507 2007-10-23 Marek Safar <marek.safar@gmail.com>
2509 * class.cs, decl.cs: Rewrote member overloads check to cope with
2510 generics and to use member cache for member checking. It also improves
2511 performance and fixes remaining overloads issues.
2513 2007-10-20 Marek Safar <marek.safar@gmail.com>
2515 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
2516 roottypes.cs, typemanager.cs:
2518 A member cache creation logic changed to add members immediately and
2519 not rely on fallback. The member cache is now only prefered way
2520 how to access and find type declaration members. It saves 5 MB of memory
2521 during MWF compilation and makes code ready for more optimizations and
2522 clean-ups, it's also a pre-requirement for partial methods.
2524 2007-10-18 Raja R Harinath <harinath@gmail.com>
2526 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
2527 handling for generic parameters.
2529 2007-10-15 Marek Safar <marek.safar@gmail.com>
2531 * class.cs (FixedField): Removed redundant volatile check.
2533 2007-10-15 Marek Safar <marek.safar@gmail.com>
2535 * class.cs, decl.cs: Fixed overload members verification to do only one
2536 check per possible collision.
2538 2007-10-13 Marek Safar <marek.safar@gmail.com>
2540 A fix for bug #325478
2541 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
2542 and create only one disposable flags container.
2544 2007-10-12 Marek Safar <marek.safar@gmail.com>
2546 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
2547 * statement.cs (Fixed): Fixed variables cloning.
2549 2007-10-12 Marek Safar <marek.safar@gmail.com>
2551 A fix for bug #333342
2552 * class.cs (EventField): Don't mark value type event as synchronized.
2554 2007-10-12 Marek Safar <marek.safar@gmail.com>
2556 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
2557 inference to identify best candidate method correctly.
2558 (ProperyExpr): A range variable is read only and cannot be modified.
2560 2007-10-11 Marek Safar <marek.safar@gmail.com>
2562 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
2563 logic to identify best candidate method correctly.
2565 2007-10-11 Marek Safar <marek.safar@gmail.com>
2567 * location.cs (Equals, GetHashCode): Removed.
2569 2007-10-11 Marek Safar <marek.safar@gmail.com>
2571 * report.cs: Implemented message recorder. It is used mainly for lambda
2572 expressions to capture otherwise swallowed error messages.
2574 * anonymous.cs, lambda.cs.cs: Do full parameters check.
2576 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
2578 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
2580 * expression.cs (MemberAccess): Always report lookup failure.
2582 * location.cs: Implemented Equals, GetHashCode.
2584 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
2586 2007-10-10 Jb Evain <jbevain@novell.com>
2588 * codegen.cs: re-enable assembly version check.
2590 2007-10-09 Marek Safar <marek.safar@gmail.com>
2592 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
2595 * namespace.cs (UsingAlias): Do correct version check.
2597 2007-10-08 Marek Safar <marek.safar@gmail.com>
2599 * expresison.cs, ecore.cs: Issue extension method error message when
2602 * rootcontext.cs: Added ISO_2 compiler mode option.
2604 2007-10-08 Marek Safar <marek.safar@gmail.com>
2606 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
2609 2007-10-08 Marek Safar <marek.safar@gmail.com>
2611 * attribute.cs (GetString, GetBoolean): Work with both literal and
2614 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
2615 Moved method overload specific methods to MethodGroupExpr.
2617 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
2618 it should be less memory consuming.
2620 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
2622 * codegen.cs: remove the assembly version check until the buildbot is
2625 2007-10-07 Jb Evain <jbevain@novell.com>
2627 * attribute.cs (Attribute.GetString): if the value
2628 expression is a StringConstant, return its string value.
2630 2007-10-07 Jb Evain <jbevain@novell.com>
2632 * typemanager.cs: add `assembly_version_attribute_type`.
2633 * codegen.cs: on attribute emission, check that the
2634 AssemblyVersionAttribute doesn't overflow.
2636 2007-10-05 Marek Safar <marek.safar@gmail.com>
2638 A fix for bug #324677
2639 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
2640 parent container of a scope container with currently resolved one.
2642 2007-10-05 Marek Safar <marek.safar@gmail.com>
2644 A fix for bug #325534
2645 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
2648 2007-10-05 Marek Safar <marek.safar@gmail.com>
2650 A fix for bug #327504
2651 * class.cs (Operator.Define): Refactored implicit and explicit user
2652 operator conversion rules.
2654 2007-10-05 Marek Safar <marek.safar@gmail.com>
2656 A fix for bug #327520
2657 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
2659 2007-10-04 Marek Safar <marek.safar@gmail.com>
2661 A fix for bug #328022
2662 * class.cs (MethodData.Define): Use correct method to check whether
2663 a method implementents an accessor.
2665 2007-10-04 Marek Safar <marek.safar@gmail.com>
2667 A fix for bug #330069
2668 * statement.cs (Fixed.Resolve): Read the first array element only when
2669 an array is instantiated.
2671 2007-10-04 Marek Safar <marek.safar@gmail.com>
2673 * expression.cs, assign.cs, generics.cs: Print correct operator when
2674 compound assignment is used.
2676 2007-10-04 Marek Safar <marek.safar@gmail.com>
2678 A fix for bug #325841
2679 * expression.cs (ArrayAccess): Use full argument cloning only for
2680 string compound concatenation.
2682 2007-10-03 Marek Safar <marek.safar@gmail.com>
2684 A fix for bug #328774
2685 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
2687 (PropertyExpr.EmitAssign): Fixed string concatenation compound
2690 2007-10-03 Raja R Harinath <rharinath@novell.com>
2693 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
2694 Event accessibility checks here. Remove some bogus code that
2695 accidently made GenericMethods work.
2696 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
2698 2007-09-25 Marek Safar <marek.safar@gmail.com>
2700 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
2702 * statement.cs (Block): Refactored AddVariable to allow error handling
2705 * generic.cs: New stub.
2707 2007-09-23 Marek Safar <marek.safar@gmail.com>
2709 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
2712 2007-09-17 Marek Safar <marek.safar@gmail.com>
2714 * class.cs: Use partial container to record whether any partial part
2715 contains static field initializer and therefore default contructor has
2718 2007-09-14 Marek Safar <marek.safar@gmail.com>
2720 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
2721 mono-list when only one of two partial parts has defined accessibility
2724 2007-09-14 Marek Safar <marek.safar@gmail.com>
2726 A fix for bug #82845
2728 * class.cs (TypeContainer): Set correct resolve context for all field
2731 2007-09-13 Marek Safar <marek.safar@gmail.com>
2733 * assign.cs: Fixed a crash when field is resolved twice with an error.
2735 * codegen.cs: Changed InFieldInitializer to be flag.
2737 * anonymous.cs, ecore.cs, expression.cs: Update after
2738 IsInFieldInitializer rename.
2740 * const.cs: Removed unused parameter.
2742 * class.cs: Changed the way how we resolve and emit field initializers.
2743 The field initilizers have to have access to contructor block to emit
2744 compiler generated code.
2746 2007-09-13 Marek Safar <marek.safar@gmail.com>
2748 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
2749 generics use TypeContainer instead.
2751 2007-09-12 Marek Safar <marek.safar@gmail.com>
2753 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
2755 * lambda.cs (ResolveParameters): Use more powerful
2756 InflateGenericArgument.
2758 * parameters.cs: Better exception message.
2760 2007-09-10 Marek Safar <marek.safar@gmail.com>
2762 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
2763 correct expression block type.
2765 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
2767 * expression.cs (Invocation): Extracted method group resolve to
2770 2007-09-07 Marek Safar <marek.safar@gmail.com>
2772 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
2773 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
2775 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
2776 generic extension methods.
2778 2007-09-06 Marek Safar <marek.safar@gmail.com>
2780 A fix for bug #82676 (Do I get it right now?)
2781 * convert.cs (Binary.ResolveOperator): An interface is converted to the
2782 object before a standard conversion is applied.
2784 2007-09-06 Marek Safar <marek.safar@gmail.com>
2786 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
2789 2007-09-05 Marek Safar <marek.safar@gmail.com>
2791 A fix for bug #82676
2792 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
2793 non-generic interface types.
2795 2007-09-05 Marek Safar <marek.safar@gmail.com>
2797 A fix for bug #82690
2798 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
2800 2007-09-05 Marek Safar <marek.safar@gmail.com>
2802 A fix for bug #82571
2803 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
2804 modifier for container based methods.
2806 2007-09-05 Marek Safar <marek.safar@gmail.com>
2808 A fix for bug #82676
2809 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
2810 any interface-type T means to any of interface type T.
2812 2007-09-04 Marek Safar <marek.safar@gmail.com>
2814 * namespace.cs: We have 2 versions of System.Core assembly.
2816 2007-09-04 Marek Safar <marek.safar@gmail.com>
2818 A fix for bug #82652
2819 * class.cs (Class.GetClassBases): Compare types and not expressions.
2821 2007-09-04 Marek Safar <marek.safar@gmail.com>
2823 A fix for bug #82620
2824 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
2825 actually never worked before.
2826 (IndexerAccess): Emit prepared arguments before they are modified.
2828 2007-09-04 Marek Safar <marek.safar@gmail.com>
2830 A fix for bug #82563
2831 * assign.cs: Revert wrong fix.
2833 * expression.cs (VariableReference.EmitAssign): Handle ref reference
2835 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
2836 Instead of ldelema/stdind we have to use temporary variables to handle
2837 cases like String.Concat (params string[]).
2839 2007-08-31 Marek Safar <marek.safar@gmail.com>
2841 * class.cs: EmitAttributes to Emit rename.
2843 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
2845 (MemberCore.HasClsCompliantAttribute): Don't depend on
2846 GetClsCompliantAttributeValue execution.
2848 2007-08-31 Marek Safar <marek.safar@gmail.com>
2850 * anonymous.cs: Use shorter type prefix.
2852 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
2855 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
2856 variables when probing is on.
2858 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
2859 unresolved variables.
2860 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
2861 handle transparent identifiers.
2863 2007-08-26 Marek Safar <marek.safar@gmail.com>
2865 * attribute.cs (IsClsCompliant): Add nullable types test.
2867 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
2869 * doc.cs : catch other types of exception than XmlException to
2870 report CS1570. Fixed bug #82565.
2872 2007-08-23 Marek Safar <marek.safar@gmail.com>
2874 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
2875 The number of delegate parameters has to match.
2876 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
2879 2007-08-21 Marek Safar <marek.safar@gmail.com>
2881 * anonymous.cs (AnonymousMethod): Generate private anonymous method
2882 to fix problem with private arguments.
2884 2007-08-20 Marek Safar <marek.safar@gmail.com>
2886 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
2888 * decl.cs (MemberName): Ignore generic type with no generic arguments.
2890 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
2891 empty. Add cloning suport.
2893 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
2895 2007-08-20 Marek Safar <marek.safar@gmail.com>
2897 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
2898 to create EmptyCast. It handles EmptyConstantCast specialization for
2901 2007-08-18 Marek Safar <marek.safar@gmail.com>
2903 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
2904 (EmitArrayArgument): One routine for array arguments.
2905 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
2907 2007-08-17 Marek Safar <marek.safar@gmail.com>
2909 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
2911 2007-08-17 Marek Safar <marek.safar@gmail.com>
2913 * anonymous.cs: MemberLookupFinal update.
2915 * class.cs (ConstructorInitializer): Is expression based.
2917 * delegate.cs: MethodGroupExpr update.
2919 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
2921 (Error_MemberLookupFailed): Customizable error override.
2922 (MethodGroupExpr): Keep queried type for later usage.
2923 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
2926 * expression.cs: Error_MemberLookupFailed refactoring.
2927 (New.DoResolve): Resolve as much as possible.
2928 (ElementInitializer.Error_MemberLookupFailed): Object initializer
2929 customization for invalid member types.
2931 * statement.cs: MethodGroupExpr update.
2933 2007-08-16 Marek Safar <marek.safar@gmail.com>
2935 * modifier.cs (Check): Check all modifiers and not only accessibility
2938 2007-08-16 Marek Safar <marek.safar@gmail.com>
2940 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
2941 type and not an expression.
2943 2007-08-16 Marek Safar <marek.safar@gmail.com>
2945 * statement.cs (Catch.Clone): Type and variable can be null.
2947 2007-08-16 Marek Safar <marek.safar@gmail.com>
2949 A fix for bug #81979
2950 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
2951 I am really not sure whether this is the best fix.
2953 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
2956 2007-08-14 Marek Safar <marek.safar@gmail.com>
2958 ** C# 3.0 Object and collection initializers (major re-write)
2960 * assign.cs (DoResolve): Initializers are not assign related.
2962 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
2963 used during collection or object initialization.
2965 * expression.cs (Error_InvalidArguments): Add initializers specific
2966 messages. More will come later because it requires some general
2968 (New.DoResolve): Better error handling for unsafe types.
2969 (EmptyExpressionStatement): New class.
2970 (ElementInitializer): An object initializer expression.
2971 (CollectionElementInitializer): A collection initializer expression.
2972 (CollectionOrObjectInitializers): A block of object or collection
2974 (NewInitialize): New expression with element/object initializers.
2976 * statement.cs: Reverted object/collection initializer hacks.
2978 * typemanager.cs (CSharpName): Filter __arglist type.
2980 2007-08-09 Marek Safar <marek.safar@gmail.com>
2982 ** C# 3.0 Anonymous Types (update to the latest standard)
2984 * expression.cs (Binary.ResolveOperator): Threat all null based types
2986 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
2987 (AnonymousTypeParameter): Updated.
2989 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
2990 (AnonymousTypeClass): New anonymous type container.
2992 * class.cs (AddField): Return operation result.
2994 * generic.cs: Another empty TypeArguments overload.
2996 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
2997 are stored at top of normal hierarchy.
2999 * typemanager.cs (CSharpName): Filter anonymous types.
3001 2007-08-09 Marek Safar <marek.safar@gmail.com>
3003 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
3004 as single Concat call. How could we miss that :-(
3006 2007-08-08 Marek Safar <marek.safar@gmail.com>
3008 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
3010 2007-08-07 Miguel de Icaza <miguel@novell.com>
3012 * expression.cs: Fix the previous commit, the creation of the
3013 arguments array list needs also to be conditional on the arguments
3016 * class.cs: Add a little bit of help to help narrow down problems.
3018 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
3019 not try to copy in that case.
3021 * driver.cs: When building SMCS, include a new different set of
3022 default assemblies here. Do this here so we can control whether
3023 to include the default assemblies with /noconfig.
3025 2007-08-03 Marek Safar <marek.safar@gmail.com>
3027 A fix for bug #81979
3028 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
3031 2007-08-03 Marek Safar <marek.safar@gmail.com>
3033 A fix for bug #82300
3035 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
3036 we are in probing scope.
3038 2007-08-03 Marek Safar <marek.safar@gmail.com>
3040 A fix for bug #82301
3042 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
3043 (Statement.CloneTo): Clone and not map children blocks.
3045 2007-08-03 Marek Safar <marek.safar@gmail.com>
3047 A fix for bug #82299
3049 * expression.cs (LocalVariableReference.CloneTo): Remap local info
3052 * statement.cs (Statement.CloneTo): Clone variables before statements
3053 to allow remaping of local variables.
3055 2007-08-03 Marek Safar <marek.safar@gmail.com>
3057 A fix for bug #82296
3060 * report.cs: Log crash details for future clone problems.
3062 * statement.cs (Return.Clone): Don't clone non-existent expression.
3064 2007-08-03 Raja R Harinath <harinath@gmail.com>
3066 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
3067 (Class.AddBasesForPart): Move CS0537 check here from ...
3068 * cs-parser.jay (class_declaration): ... here. Move calling of
3069 'AddBasesForPart' to ...
3070 (class_bases): ... here.
3071 (struct_declaration, interface_declaration): Update to changes.
3073 2007-08-02 Marek Safar <marek.safar@gmail.com>
3075 A fix for bug #81923
3077 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
3078 conversion is allowed.
3080 2007-08-02 Marek Safar <marek.safar@gmail.com>
3082 A fix for bug #81564
3084 * ecore.cs (EventExpr): Add IsBase handling.
3086 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
3089 2007-08-02 Raja R Harinath <harinath@gmail.com>
3091 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
3092 * cs-parser.jay: Some whitespace cleanups.
3093 (current_delegate): New.
3095 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
3096 a dummy code block, and use 'type_name' instead of 'member_name'.
3097 (interface_declaration, class_declaration): Likewise.
3098 (delegate_declaration): Likewise. Rearrange slightly and use
3100 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
3101 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
3103 2007-08-02 Marek Safar <marek.safar@gmail.com>
3105 A fix for bug #82039
3107 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
3110 * typemanager.cs (CSharpName): Split to string overload.
3112 2007-08-02 Marek Safar <marek.safar@gmail.com>
3115 * report.cs: Updated warning CS0472.
3117 2007-08-01 Marek Safar <marek.safar@gmail.com>
3119 A fix for bug #82181
3121 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
3123 2007-08-01 Marek Safar <marek.safar@gmail.com>
3125 A fix for bug #82277
3126 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
3128 2007-08-01 Marek Safar <marek.safar@gmail.com>
3130 ** C# 3.0 Type Inference (major bits are working)
3132 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
3133 (.ImplicitStandardConversionExists): Uses compatible.
3134 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
3135 (.InferReturnType): New method.
3136 (.Compatible): Refactored.
3137 (.ResolveParameters): Uses factory to create resolved parameters.
3138 (.CompatibleMethod): Add probing mode support.
3139 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
3140 clearly distinguish between 2 different operations.
3141 (LambdaMethod): Moved to lambda.cs.
3142 (AnonymousMethod): Removed unused fields and methods.
3143 (AnonymousDelegate): Simplified.
3145 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
3147 * convert. cs (ImplicitConversionStandard): Compatible works differently.
3149 * delegate.cs (Delegate): New mehods to reduce code duplication.
3150 (.GetConstructor): New method.
3151 (.GetInvokeMethod): New method.
3152 (DelegateCreation): Updated.
3154 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
3156 (OverloadResolve): Made probing little bit faster.
3158 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
3161 * generic.cs (TypeInferenceContext): Dummy implementation.
3163 * iterators.cs: Updated after Resolve/Define rename.
3165 * lambda.cs (LambdaExpression)
3166 (.ResolveParameters): Handles both type of arguments and type inference too.
3168 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
3169 (InflateTypes): Updated.
3171 * support.cs (InflateTypes): Changed signature and updated.
3173 * typemanager.cs (LookupMemberCache): Better dynamic type check.
3174 (MemberLookup_FindMembers): More MS tricks.
3175 (GetParameterData): Ditto.
3176 (GetDelegateParameters): Uses quick path for dynamic types.
3178 2007-08-01 Marek Safar <marek.safar@gmail.com>
3180 * class.cs (MethodData.Define): EmitContext is required for generic stuff
3183 2007-07-31 Marek Safar <marek.safar@gmail.com>
3185 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
3188 2007-07-26 Jb Evain <jbevain@novell.com>
3190 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
3191 which takes a boolean 'report_errors', similar to the GetMethod.
3192 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
3193 in .net 2.1, do not report errors here.
3195 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
3196 System.Runtime.CompilerServices.RequiredAttributeAttribute and
3197 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
3200 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
3201 of the type InternalsVisibleToAttribute before the first call
3202 to CoreLookupType which is allowed to fail (third boolean parameter
3203 to true). Because, during the resolution for a type that is not
3204 immediately found, we try to check if the type is not defined in
3205 a friend assembly, and to do so, we need the
3206 InternalVisibleToAttribute.
3208 2007-07-23 Miguel de Icaza <miguel@novell.com>
3210 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
3211 feature that allows structs to be compared against null and inline
3212 the result as true or false.
3214 Notice that the same code is not permitted inside a generic block
3215 of code that would do:
3217 class Foo<T> where T : struct {
3224 It is only allowed if the type of T is not bound (no where
3225 clause). In my opinion, this CSC 2 behavior is broken but people
3226 seem to be using it (IronRuby does, a few bug reports on bugzilla
3227 have it and some people have complained about it).
3229 All of the users that depend on this behavior have code that is
3232 * report.cs (Warning, Error): make these take object arguments,
3233 not strings, as that allows us to take advantage of Format.
3235 2007-07-20 William Holmes <billholmes54@gmail.com>
3237 * decl.cs: Changed MemberName.CountTypeArguments to also check the
3238 Left member variable for the Count.
3239 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
3240 MemberName.CountTypeArguments to avoid a NRE.
3242 This code is contributed under the MIT X11 license
3244 2007-07-18 Marek Safar <marek.safar@gmail.com>
3246 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
3248 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
3250 * doc.cs : generic method arguments are written as ``x while generic
3251 type arguments are `x. Combined with the previous change, fixed bug
3254 2007-07-18 Raja R Harinath <rharinath@novell.com>
3257 * expression.cs (Binary.ResolveOperator): When converting
3258 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
3260 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
3262 * doc.cs : when T: or whatever x: is specified, it does not really
3263 check the doc comment's syntax correctness. Fixed bug #82006.
3265 2007-07-18 Marek Safar <marek.safar@gmail.com>
3267 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
3268 LambdaExpression better.
3270 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
3272 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
3274 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
3275 as it can be generated.
3277 * expression.cs (Invocation.Error_InvalidArguments): Show correct
3280 * lambda.cs (LambdaExpression): Refactored to share same code with
3281 AnonymousMethodExpression.
3283 2007-07-17 Marek Safar <marek.safar@gmail.com>
3285 * anonymous.cs (MakeName): Include host name for easier debugging.
3286 (LambdaMethod): New class for lambda spcecific stuff.
3288 * attribute.cs: Set EmitContext return type.
3290 * class.cs: Set EmitContext return type.
3292 * codegen.cs (EmitContext): Return type cannot be null to stop messing
3293 with null/void meaning.
3295 * iterators.cs (ContainerType): Implemented.
3297 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
3299 * statement.cs (Return): Updated to lambda expressions.
3300 (Block.CloneTo): Parent can be null.
3302 2007-07-13 Marek Safar <marek.safar@gmail.com>
3304 A fix for bug #81917
3305 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
3307 * class.cs (FixedField): Check whether field is in unsafe scope.
3309 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
3310 (FieldExpr.Emit): Fixed buffers cannot be volatile.
3312 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
3315 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
3317 2007-07-13 Marek Safar <marek.safar@gmail.com>
3319 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
3320 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
3323 2007-07-13 Marek Safar <marek.safar@gmail.com>
3325 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
3327 2007-07-13 Marek Safar <marek.safar@gmail.com>
3329 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
3330 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
3332 * codegen.cs(EmitContext): Add ProbingMode flag.
3334 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
3336 * driver.cs: For now set both warning values.
3338 * ecore.cs (SimpleName): Name is readonly.
3339 (MethodGroup.OverloadResolve): One quick path for probing.
3341 * expression.cs (Unary): Set Oper r/o.
3342 (Binary): Set Oper r/o.
3343 (ParameterReference): Set few instance variables as r/o.
3344 (ParameterReference.DoResolveBase): Don't capture aruments when
3346 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
3347 (Arglist): arguments are private.
3348 (SizeOf): type is private and r/o.
3349 (MemberAccess): arguments are private.
3351 * report.cs: Enhanced reporting on/off capabilities.
3353 * lambda.cs: Uses ec.IsInProbingMode.
3354 (ContextualReturn): Derives from return.
3356 * rootcontext.cs: For now set both warning values.
3358 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
3360 (Return.Resolve): Don't die immediately.
3361 (Block.Resolve): Speed-up probing.
3362 (Block.CloneTo): Clone only child blocks.
3364 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
3366 * iterators.cs: reverted Miguel's latest change (r81925) as it
3367 breaks the build in System.
3369 2007-07-13 Miguel de Icaza <miguel@novell.com>
3371 * iterators.cs (Yield.CheckContext): Check for the iterator type
3372 also here as we can call into Yield even in codepaths that are not
3374 (MethodOrOperator is the only path that was checked).
3376 In addition to the standard check, use a more specific check for
3377 constructors to report a more verbose error.
3379 2007-07-12 Miguel de Icaza <miguel@novell.com>
3381 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
3382 report the warning and continue
3384 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
3385 values on the stack on the call to Emit. Use EmitStatement if
3386 possible, or using Emit + Pop if not possible. Fixes #82064
3388 2007-07-12 Raja R Harinath <rharinath@novell.com>
3390 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
3391 avoid try...finally in some cases.
3393 2007-07-10 Marek Safar <marek.safar@gmail.com>
3395 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
3397 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
3398 instead of method. Re-use standard error handling.
3399 (ConstructorInitializer.Emit): Simplified.
3401 * delegate.cs: Updated after Invocation.EmitCall change.
3403 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
3404 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
3405 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
3406 method and don't permanently changing input arguments.
3407 (MethodGroupExpr): Introduced resolved best_candidate, when method group
3408 is resolved it has one of the candidates is the best one which is later
3409 used to emit. Removed a few unused method.
3410 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
3412 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
3413 (Binary.ResolveOperator): Ditto.
3414 (ConditionalLogicalOperator.DoResolve): Ditto.
3415 (Invocation): Uses method group.
3416 (Invocation.DoResolve): Simplified.
3417 (Invocation.EmitCall): Removed useless is_static.
3418 (Invocation.Emit): Delegate to method group.
3419 (Invocation.EmitStatement): Simplified.
3420 (New): Uses method group.
3421 (MemberAccess.DoResolve): Don't destroy original expression.
3423 * statement.cs (ForEach.Resolve): Use null for no method arguments.
3425 2007-07-04 Marek Safar <marek.safar@gmail.com>
3427 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
3430 * lambda.cs: Add custom error message type.
3432 2007-07-03 Marek Safar <marek.safar@gmail.com>
3434 * lambda.cs: Simplified little bit.
3436 * parameter.cs: Introduced ImplicitLambdaParameter.
3437 (Parameters.CreateFullyResolved): New factory instead of ctor.
3441 * delegate.cs: Updated parameter creation.
3443 2007-07-03 Marek Safar <marek.safar@gmail.com>
3445 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
3448 * generic.cs: Synchronized with gmcs.
3450 2007-07-03 Marek Safar <marek.safar@gmail.com>
3452 * class.cs (Indexer): Check return type as soon as possible.
3454 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
3457 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
3459 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
3461 * parameter.cs (Parameter): Use expression type when it is available.
3463 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
3464 method modifier for the first parameter only.
3466 2007-06-24 Marek Safar <marek.safar@gmail.com>
3468 A fix for bug #81938
3469 * typemanager.cs (ChangeType): Fixed couple of char conversions.
3471 * constant.cs: Tide up an exception message.
3473 2007-06-22 Marek Safar <marek.safar@gmail.com>
3475 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
3476 an uninitialized variable is used.
3478 * expression.cs (LocalVariableReference.DoResolve): Ditto.
3480 2007-06-22 Marek Safar <marek.safar@gmail.com>
3482 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
3483 not found error handling.
3485 * expression.cs (ArrayCreation): Removed redundant fields and little bit
3487 (ArrayCreation.ResolveArrayElement): To be ready to customization.
3488 (ArrayCreation.DoResolve): Simplified.
3489 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
3490 its own resolve process.
3491 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
3493 2007-06-20 Marek Safar <marek.safar@gmail.com>
3495 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
3498 2007-06-20 Marek Safar <marek.safar@gmail.com>
3500 * cs-tokenizer.cs: Removed var related stuff.
3502 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
3503 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
3504 a type and a keyword at same time.
3506 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
3509 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
3510 implicitly typed arrays, more changes will follow.
3512 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
3514 2007-06-19 Marek Safar <marek.safar@gmail.com>
3516 * ecore.cs (VarExpr): Removed Handled field.
3518 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
3519 build-in assign functionality.
3520 (ForEach.Resolve): Removed all implicitly typed local variable code and
3522 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
3523 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
3525 2007-06-18 Marek Safar <marek.safar@gmail.com>
3527 * assign.cs: Removed implicitly typed local variable check.
3529 * expression.cs (LocalVariableReference.DoResolve): Add check for self
3530 referencing implicitly typed local variable.
3531 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
3534 * statement.cs (Fixed): Removed unsupported implicitly typed local
3537 2007-06-15 Marek Safar <marek.safar@gmail.com>
3539 * decl.cs (MemberName): Moved all Unbound stuff to parser.
3541 2007-06-14 Marek Safar <marek.safar@gmail.com>
3543 A fix for bugs #81855 and #76274
3544 * attribute.cs (AttachTo): Always set owner for global attributes to
3547 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
3550 * cs-parser.jay: Assembly and module attributes must precede all other
3551 elements except using clauses and extern alias declarations.
3553 2007-06-13 Marek Safar <marek.safar@gmail.com>
3555 A fix for bug #81748
3557 * expression.cs: More checks for non ISO-1 features.
3559 2007-06-12 Marek Safar <marek.safar@gmail.com>
3561 A fix for bug #81807
3562 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
3563 present inside switch statement and it is required by nullable check.
3565 2007-06-12 Marek Safar <marek.safar@gmail.com>
3567 A fix for bug #81840
3568 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
3569 when type matching fails.
3571 * namespace.cs: Tiny error message change.
3573 2007-06-12 Marek Safar <marek.safar@gmail.com>
3575 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
3576 reporting. Added automatic property check.
3578 * class.cs: Updated after CheckAbstractAndExtern relocation.
3579 (AEventPropertyAccessor.GetSignatureForError): Customized.
3581 2007-06-11 Marek Safar <marek.safar@gmail.com>
3583 * class.cs (DefineBaseTypes): Base type can be undefined.
3585 * ecore.cs (TypeLookup): Minor refactoring.
3586 (DoResolveAsTypeStep): Removed redundant check.
3588 * namespace.cs (Lookup): Removed redundant check.
3590 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
3591 ResolveAsTypeTerminal step.
3592 (BootstrapCorlib_*): Simplified.
3593 (PopulateCoreType): Core types can be now external.
3595 2007-06-07 Marek Safar <marek.safar@gmail.com>
3597 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
3599 (InferTypeArguments): Infers anonymous expression type arguments.
3600 (Compatible): Split to Compatible and InferTypeArguments.
3602 * lambda.cs: Updated.
3604 2007-06-08 Marek Safar <marek.safar@gmail.com>
3606 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
3608 2007-06-07 Raja R Harinath <harinath@gmail.com>
3610 Fix #80477, cs0135-2.cs, cs0135-3.cs
3611 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
3612 names to the "known" variables list.
3613 (Block.CheckInvariantMeaningInBlock): Handle the fact the
3614 parameter names are also "known".
3615 (Block.CheckError136): Remove.
3616 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
3619 2007-06-07 Marek Safar <marek.safar@gmail.com>
3621 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
3623 2007-06-06 Marek Safar <marek.safar@gmail.com>
3625 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
3626 internal error not an user error.
3628 * expression.cs (IsApplicable): Refactored to make debugging easier.
3630 * support.cs: More tricks for non-mono runtimes.
3632 * typemanager.cs (CoreLookupType): Made public.
3633 (InitSystemCore): All linq specific stuff moved to linq.cs
3635 2007-06-05 Marek Safar <marek.safar@gmail.com>
3637 * typemanager.cs (CSharpSignature): One more missing build-in types
3639 More tricks for non-mono runtime.
3641 2007-06-05 Raja R Harinath <harinath@gmail.com>
3643 * statement.cs (Block.CheckError136_InParents): Remove.
3644 (Block.AddVariable): Use GetParameterInfo instead.
3645 (ToplevelBlock.ProcessArguments): Likewise.
3647 2007-06-04 Raja R Harinath <rharinath@novell.com>
3649 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
3651 (ToplevelBlock.GetParameterInfo): Split out of ...
3652 (ToplevelBlock.GetParameterRefernce): ... this.
3653 (ToplevelBlock.ParameterMap): Remove.
3654 * expression.cs (ParameterReference): Update to use
3655 ToplevelParameterInfo.
3657 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
3660 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
3661 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
3663 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
3664 (ToplevelBlock.ProcessParameters) ... here.
3665 (ToplevelBlock..ctor): Invoke it.
3667 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
3670 * statement.cs (IKnownVariable): New interface.
3671 (LocalInfo): Implement it.
3672 (ToplevelParameterInfo): New class.
3673 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
3674 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
3675 GetKnownVariableInfo.
3677 2007-06-03 Raja R Harinath <harinath@gmail.com>
3679 Partly speed up CS0136 error checks.
3680 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
3681 'recurse' parameter.
3682 (Block.DoCheckError136): Only check errors in parameters. Move
3683 local variable checks ...
3684 (Block.AddVariable): ... here, and ...
3685 (ToplevelBlock.ResolveMeta): ... here.
3687 2007-06-02 Raja R Harinath <harinath@gmail.com>
3689 * statement.cs (Block.IsChildOf): Remove.
3691 * statement.cs (Statement.Clone): Move special case code ...
3692 (Block.CloneTo): ... here.
3694 2007-05-29 Raja R Harinath <rharinath@novell.com>
3696 * statement.cs (ToplevelBlock.container): Remove field. It's
3697 redundant with 'Parent'.
3698 (ToplevelBlock.ContainerBlock): Remove accessor.
3699 (ToplevelBlock..ctor): Update to changes. Register anonymous
3700 child with parent here, ...
3701 * cs-parser.jay (end_anonymous): ... not here. Don't modify
3703 (start_anonymous): Don't save current_block.
3704 (top_current_block): Remove.
3706 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
3707 (Block.Resolve): Update to changes.
3708 (Block..ctor): Move setting of "correct" 'Toplevel'
3709 and 'Explicit' fields to ...
3710 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
3712 2007-05-27 Raja R Harinath <harinath@gmail.com>
3715 * statement.cs (Block.Implicit): Remove.
3716 (Block): Update to changes.
3717 * flowanalysis.cs: Likewise.
3719 Mildly speed up CheckInvariantMeaningInBlock
3720 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
3721 Recursively call AddKnownVariable to all enclosing blocks.
3722 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
3723 Remove recursive calls.
3724 (Block): Update to changes.
3726 New ExplicitBlock invariants
3727 * statement.cs (Block.Explicit): New field. It points to the
3728 immediately enclosing non-implicit block.
3729 (Block..ctor): Maintain the invariant.
3730 * cs-parser.jay: Take advantage of invariant.
3732 Introduce ExplicitBlock
3733 * statement.cs (ExplicitBlock): New.
3734 (ToplevelBlock): Derive from it.
3735 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
3737 (Block.Implicit): Update to changes.
3738 * cs-parser.jay: Update to changes.
3741 * codegen.cs (EmitContext.IsLastStatement): Remove.
3742 * statement.cs (Block.DoEmit): Update to changes.
3744 2007-05-25 Raja R Harinath <rharinath@novell.com>
3746 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
3747 modifying current_block directly.
3749 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
3751 * class.cs: Implemented automatic properties (C# 3.0)
3752 Thanks to Marek for the help.
3754 2007-05-23 Raja R Harinath <rharinath@novell.com>
3756 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
3757 variable as assigned, note also that all its components are
3759 (MyBitVector.SetRange): New. Function to set multiple bits to true.
3761 2007-05-19 Marek Safar <marek.safar@gmail.com>
3763 * anonymous.cs, class.cs: Emit Compiler generated attribute when
3764 member is marked as compiler generated.
3766 * decl.cs (MemberCore): Refactored ModFlags into property.
3768 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
3769 (Check): Check only accessibility modifiers.
3771 2007-05-18 Raja R Harinath <rharinath@novell.com>
3773 Track all assignable slots in one bit array
3774 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
3775 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
3776 logic from VariableMap constructor here. Use the same 'offset'
3777 variable that's later used for computing offsets of local
3779 * flowanalysis.cs (UsageVector.parameters): Remove.
3780 (UsageVector): Update to changes.
3781 (VariableMap): Remove.
3783 Avoid creating ParameterMap in every block
3784 * statement.cs (Block.ParameterMap): Move ...
3785 (ToplevelBlock.ParameterMap): ... here.
3786 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
3788 * flowanalysis.cs (FlowBranching.param_map): Remove.
3789 (FlowBranching.UsageVector): Update to changes.
3790 (FlowBranchingToplevel.CheckOutParameters): Likewise.
3792 * statement.cs (Block.CloneTo): Clone Toplevel field too.
3794 * expression.cs (ParameterReference): Distinguish between block
3795 where parameter was referenced and declared.
3797 2007-05-18 Marek Safar <marek.safar@gmail.com>
3799 * flowanalysis.cs, statement.cs: Put back improved error handling.
3801 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
3805 Imporved object and collection initialization (C# 3.0).
3807 2007-05-15 Marek Safar <marek.safar@gmail.com>
3809 A fix for bug #81380
3810 * expression.cs (Is.DoResolve): Only value types have constant `is'
3813 2007-05-15 Raja R Harinath <rharinath@novell.com>
3815 * statement.cs (ToplevelBlock.child): Remove.
3817 2007-05-15 Raja R Harinath <harinath@gmail.com>
3819 Rationalize ResolveMeta: refactoring
3820 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
3821 out constant handling code into ...
3822 (Block.DoResolveConstants): ... this.
3824 Rationalize ResolveMeta: kill local_map
3825 * statement.cs (Block.local_map, Block.LocalMap): Remove.
3826 (Block.AssignableSlots): New.
3827 (Block.ResolveMeta): Make protected. Don't create a VariableMap
3828 for locals -- move code from VariableMap here. Avoid unnecessary
3830 * flowanalysis.cs (FlowBranching.local_map): Remove.
3831 (FlowBranching..ctor): Use Block.AssignableSlots.
3832 (VariableMap): Remove unused constructors.
3834 2007-05-11 Raja R Harinath <rharinath@novell.com>
3836 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
3838 2007-05-11 Marek Safar <marek.safar@gmail.com>
3840 * typemanager.cs (IsFriendAssembly): Should not be called for building
3843 2007-05-09 Marek Safar <marek.safar@gmail.com>
3845 * literal.cs (NullConstant): Print null in all cases.
3847 * expression.cs (Binary.ResolveOperator): Implemented delegate
3848 comparison based on C# 2.0 changes.
3850 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
3852 This code is contributed under the MIT X11 license
3854 The following enables support for several C# 3.0 language features:
3856 * cs-tokenizer.cs: Added support for the "var" keyword.
3858 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
3859 Added VarExpr class to facilitate type inferencing.
3861 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
3862 to support anonymous types.
3864 * assign.cs: Added support for type inferencing and initialization.
3866 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
3868 * expression.cs: Added implicit array support to ArrayCreation.
3869 Added 5 types and 1 interface:
3871 IInitializable Implementing classes can inject initializing
3872 statements after object instantiation.
3874 Initializer Stores data for object initialization.
3876 AnonymousType An expression for anonymous types.
3878 AnonymousTypeParameter Stores data about an anonymous type's field.
3880 NewInitialize An expression for object initialization.
3882 CollectionInitialize An expression for collection initialization.
3884 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
3887 2007-05-06 Marek Safar <marek.safar@gmail.com>
3889 A fix for bug #81500
3890 * cs-tokenizer.cs: Add special handling for coalescing operator.
3892 2007-05-06 Marek Safar <marek.safar@gmail.com>
3894 A fix for bug #81529
3895 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
3896 its value from base class until it is redefined.
3898 2007-05-02 Raja R Harinath <rharinath@novell.com>
3900 Fix regression in cs0631-3.cs
3901 * cs-parser.jay (operator_declarator): Add opt_attributes to error
3902 fallback. Make error fallback catch more cases.
3904 2007-05-01 Miguel de Icaza <miguel@novell.com>
3906 * cs-parser.jay: Allow parameters in operator declarations to have
3909 2007-04-27 Miguel de Icaza <miguel@novell.com>
3911 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
3914 * lambda.cs (ContextualReturn.Resolve): An expression is valid
3915 inside the ContextualReturn, it does not have to be an
3916 ExpressionStatement.
3918 2007-04-24 Miguel de Icaza <miguel@novell.com>
3920 * lambda.cs (ContextualReturn.Resolve): if the return type is not
3923 2007-04-23 Miguel de Icaza <miguel@novell.com>
3925 * anonymous.cs (AnonymousContainer): split the virtual Resolve
3926 method in two methods: ResolveNoDefine and Resolve.
3928 ResolveNoDefine will stop just after ResolveTopBlock has been
3931 Resolve will then continue by creating a method and issuing the
3932 call to method.Define ().
3934 (AnonymousMethod): Split and implement the new Resolve and
3935 ResolveNoDefine as well.
3937 * lambda.cs (LambdaExpression): Split the anonymous method
3938 resolution code into a separate routine (CoreCompatibilityTest)
3939 from DoCompatibleTest.
3941 (LambdaExpression.TryBuild): New method, this method tries to
3942 build the LambdaExpression with the given set of types to be used
3943 as the types for the various parameters of the lambda expression.
3945 If the compilation succeed with the given types, the infered type
3946 of the Anonymous method is returned, otherwise null is returned.
3948 2007-04-23 Marek Safar <marek.safar@gmail.com>
3950 A fix for bug #81414
3951 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
3953 2007-04-22 Miguel de Icaza <miguel@novell.com>
3955 * cs-tokenizer.cs: Change various identifiers here from the
3956 camelCasing to the recommended Linux-like style for instance
3957 variables from the Coding Guidelines.
3959 2007-04-19 Martin Baulig <martin@ximian.com>
3962 (Convert.ImplicitReferenceConversionCore): Allow conversions from
3963 System.Enum to System.ValueType.
3965 2007-04-13 Martin Baulig <martin@ximian.com>
3967 Rewrote implicit reference conversions. We need to distinguish
3968 between implicit reference conversions (13.1.4) and implicit
3969 boxing conversions (13.1.5).
3971 According to the spec, there's an an implicit conversion
3972 "From a one-dimensional array-type S[] to IList<T> and base
3973 interfaces of this interface, provided there is an implicit
3974 reference conversion from S to T." Note that this does not
3975 include boxing conversions.
3978 (Convert.ImplicitTypeParameterBoxingConversion): New method.
3979 (Convert.ImplicitReferenceConversion): Split into
3980 ImplicitReferenceConversionCore() and
3981 ImplicitBoxingConversionExist().
3982 (Convert.ImplicitReferenceConversionExists): Use the new
3983 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
3985 2007-04-12 Martin Baulig <martin@ximian.com>
3987 * convert.cs (Convert.ImplicitReferenceConversion): Move the
3988 `TypeManager.null_type' checks up to the top of the method.
3990 2007-04-11 Marek Safar <marek.safar@gmail.com>
3992 A fix for bug #81350
3993 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
3996 2007-04-11 Martin Baulig <martin@ximian.com>
3998 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
3999 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
4000 to make this work for generic classes; fixes #79561.
4002 2007-04-11 Martin Baulig <martin@ximian.com>
4004 * expression.cs (As): Add support for nullable types; fixes #79371.
4006 2007-04-11 Martin Baulig <martin@ximian.com>
4008 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
4009 `type.FullName' is null; fixes #80243.
4011 2007-04-11 Martin Baulig <martin@ximian.com>
4013 * expression.cs (Invocation.IsApplicable): Don't modify the method
4014 if type inference succeeded, but the method was not applicable.
4017 2007-04-10 Marek Safar <marek.safar@gmail.com>
4019 A fix for bug #81324
4020 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
4021 internal and external namespaces containers.
4023 2007-04-10 Martin Baulig <martin@ximian.com>
4025 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
4026 TypeManager.DropGenericMethodArguments() so we also call
4027 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
4029 2007-04-10 Martin Baulig <martin@ximian.com>
4031 * iterators.cs (Iterator.CreateIterator): Don't crash if
4032 `method.ReturnType' is null. This happens if something went wrong
4033 while resolving that typ (we already reported an error in this case).
4035 2007-04-10 Martin Baulig <martin@ximian.com>
4037 * expression.cs (New.DoResolve): Don't call CheckComImport() on
4038 generic interfaces; report the CS0144 directly.
4040 2007-04-10 Martin Baulig <martin@ximian.com>
4042 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
4043 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
4045 2007-04-10 Martin Baulig <martin@ximian.com>
4047 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
4049 2007-04-09 Raja R Harinath <rharinath@novell.com>
4052 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
4053 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
4056 * statement.cs (For.Resolve): If resolution fails, use
4059 2007-04-08 Marek Safar <marek.safar@gmail.com>
4061 * anonymous.cs (MakeName): Make faster and zero-based.
4062 (VerifyExplicitParameterCompatibility): Back to mode where generic
4063 parameter is ignored.
4064 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
4066 * class.cs (EmitType): Method can emit another new method.
4068 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
4070 * driver.cs: Updated.
4072 * lambda.cs: Reuse predefined empty parameters.
4074 * parameter.cs: Updated
4076 * support.cs: Implemented InflateTypes.
4078 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
4079 (InitSystemCore): Introduced to isolate 3.0 dependencies.
4081 2007-04-03 Martin Baulig <martin@ximian.com>
4085 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
4086 version of TypeManager.IsOverride() which also works with generic
4089 2007-04-03 Martin Baulig <martin@ximian.com>
4094 (Convert.ExplicitReferenceConversion): We need to cast when
4095 converting from IList<T> to S[].
4097 2007-04-01 Marek Safar <marek.safar@gmail.com>
4099 * decl.cs (FindExtensionMethods): Consider all candidates with same name
4102 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
4104 2007-03-31 Marek Safar <marek.safar@gmail.com>
4106 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
4107 argument and return type inferring.
4109 * codegen.cs (InferReturnType): Flag whether return can be inferred.
4110 (ReturnType): Turned to property.
4112 * statement.cs (Return): Implemented return type inferring.
4114 * support.cs (ReflectionParameters): Use local types if possible.
4116 2007-03-30 Raja R Harinath <rharinath@novell.com>
4118 * flowanalysis.cs (FlowBranching.Reachability): Remove.
4119 (FlowBranching.UsageVector): Update to changes.
4121 Prepare to kill 'Reachability'
4122 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
4123 argument of constructor.
4125 2007-03-29 Raja R Harinath <rharinath@novell.com>
4127 Prepare to kill 'Reachability'
4128 * flowanalysis.cs (UsageVector.is_unreachable): New.
4129 (UsageVector): Update to maintain 'is_unreachable' in parallel to
4130 'reachability', and verify they're consistent.
4133 * expression.cs (New.EmitStatement): Handle type parameters here too.
4135 2007-03-29 Martin Baulig <martin@ximian.com>
4140 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
4141 CompilerGeneratedClass.
4142 (ScopeInfo.EmitScopeInstance): Make this protected.
4143 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
4144 `ec.CurrentAnonymousMethod.Scope == Scope'.
4146 * statement.cs (Block.ScopeInfo): Make this a property.
4148 2007-03-27 Raja R Harinath <harinath@gmail.com>
4150 Prepare to kill 'Reachability'
4151 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
4152 (FlowBranching.UsageVector.Reachability): Remove property.
4153 (FlowBranching.UsageVector.IsUnreachable): New property.
4154 (FlowBranching.UsageVector.ResetBarrier): New.
4155 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
4156 * codegen.cs, statement.cs: Update to changes.
4158 2007-03-27 Martin Baulig <martin@ximian.com>
4163 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
4166 2007-03-26 Raja R Harinath <rharinath@novell.com>
4168 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
4169 instead of TriState. Remove all mention of TriState.
4171 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
4172 replaced by a boolean. Add boolean 'is_unreachable' field, check
4173 and maintain invariants.
4175 2007-03-25 Marek Safar <marek.safar@gmail.com>
4177 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
4179 2007-03-25 Marek Safar <marek.safar@gmail.com>
4181 * expression.cs: Stop using obsolete 2.0 opcodes.
4183 2007-03-25 Marek Safar <marek.safar@gmail.com>
4185 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
4186 one of the latests Martin's fixes.
4188 2007-03-23 Miguel de Icaza <miguel@novell.com>
4190 * expression.cs: On BigEndian systems, swap the bytes, temporary
4191 solution until we get a new bitconverter class.
4193 2007-03-23 Martin Baulig <martin@ximian.com>
4197 * decl.cs (MemberCache.AddMembers): Add generic methods both as
4198 "Method" and "Method`1". Normally, a cache lookup is done on the
4199 "Method" form (ie. without the generic arity), but this one makes
4200 lookups on the full form work as well.
4202 2007-03-22 Raja R Harinath <rharinath@novell.com>
4204 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
4207 2007-03-20 Bill Holmes <billholmes54@gmail.com>
4209 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
4210 ordered_member_list, to TypeBuilder to store members to be defined
4211 in the order they were parsed in.
4212 - ordered_explicit_member_list contains all properties indexers
4213 and methods that are defined as explicit implementation of an
4214 interface or base class.
4215 - ordered_member_list contains all properties indexers and methods
4216 that are not defined as explicit implementation of an interface
4219 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
4220 functionality in these removed classes has been replaced with
4221 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
4222 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
4224 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
4225 to CheckForDuplications inside GetMethod and SetMethod Define Method
4226 to handle method property and indexer name conflicts.
4230 All code is contributed under the MIT/X11 license.
4232 2007-03-20 Martin Baulig <martin@ximian.com>
4234 * class.cs (TypeContainer.Interfaces): Removed; they're now
4235 included in `TypeContainer.Types'.
4237 2007-03-20 Martin Baulig <martin@ximian.com>
4239 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
4241 * class.cs (TypeContainer.CreateType): New public method. This is
4242 now called before DefineType() to create the TypeBuilders.
4243 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
4244 has already been created by CreateType().
4245 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
4246 don't resolve our base classes here; this has been moved into
4247 DefineBaseTypes(). We're now called from CreateType().
4248 (TypeContainer.DefineBaseTypes): New private method; resolve our
4249 base classes here. We're now called from DefineType().
4252 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
4253 our types first to create all the TypeBuilders. After that, call
4254 TypeContainer.DefineType() on all the types which'll resolve their
4255 base classes and setup the resolve order.
4257 2007-03-20 Martin Baulig <martin@ximian.com>
4259 * class.cs (TypeContainer.Enums): Removed; they're now included in
4260 `TypeContainer.Types'.
4262 2007-03-20 Martin Baulig <martin@ximian.com>
4265 (TypeContainer.DefineType): Don't call ResolveMembers() here.
4266 (TypeContainer.DoResolveMembers): Call DefineType() on our
4267 `compiler_generated' classes; moved here from DefineNestedTypes().
4270 (RootContext.ResolveTree): Call ResolveMembers() on all
4271 TypeContainer's in the `type_container_resolve_order'.
4273 2007-03-19 Marek Safar <marek.safar@gmail.com>
4275 * class.cs: Use corlib to handle InternalMethodImplAttribute.
4277 2007-03-17 Marek Safar <marek.safar@gmail.com>
4279 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
4280 implementation flags.
4282 2007-03-17 Marek Safar <marek.safar@gmail.com>
4284 * class.cs: More optimizations for type parameters.
4286 2007-03-15 Marek Safar <marek.safar@gmail.com>
4288 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
4290 * ecore.cs, parameter.cs: More common code for both corlibs.
4292 * typemanager.cs (IsGenericMethod): Simplified.
4294 2007-03-15 Raja R Harinath <rharinath@novell.com>
4296 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
4298 * statement.cs, iterators.cs, lambda.cs: Update to changes.
4300 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
4301 unconditionally. Simplify explanation.
4302 (Try.Resolve, Using.Resolve): Likewise.
4304 2007-03-15 Martin Baulig <martin@ximian.com>
4308 * decl.cs (DeclSpace): If we're a partial class, use our
4309 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
4311 2007-03-15 Raja R Harinath <rharinath@novell.com>
4313 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
4315 (FlowBranching.UsageVector): Update to changes.
4316 (FlowBranching.MergeSiblings): Likewise.
4317 * statement.cs: Likewise.
4319 2007-03-15 Martin Baulig <martin@ximian.com>
4324 (MemberCache): Added a special .ctor for type parameters.
4327 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
4330 2007-03-09 Martin Baulig <martin@ximian.com>
4332 * enum.cs (Enum): Make this a TypeContainer.
4333 (EnumMember): Derive from `Const'.
4336 (Const.DoResolveValue): New protected virtual method; move most of
4337 the functionality of ResolveValue() here so we can override it in
4339 (Const.CreateConstantReference): Make this virtual.
4341 * class.cs (Kind): Add `Kind.Enum'.
4342 (TypeContainer.Emit): Don't emit the enums here; they're already
4343 in the `RootContext.typecontainer_resolve_order'.
4345 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
4346 here; they're already in the `typecontainer_resolve_order'.
4348 * ecore.cs (EnumConstant.ConvertImplicitly): Add
4349 TypeManager.DropGenericTypeArguments().
4352 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
4353 (TypeManager.IsEnumType): Likewise.
4354 (TypeManager.EnumToUnderlying): Likewise.
4355 (TypeManager.IsEqual): Add support for enums.
4357 2007-03-12 Raja R Harinath <rharinath@novell.com>
4359 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
4360 DefaultParameterValueAttribute to be undefined, say if System.dll
4363 2007-03-11 Marek Safar <marek.safar@gmail.com>
4365 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
4368 2007-03-10 Marek Safar <marek.safar@gmail.com>
4370 * class.cs, parameter.cs: Unified parameters verification.
4372 2007-03-08 Martin Baulig <martin@ximian.com>
4374 * cs-parser.jay (constructor_header): Pass the location to the
4375 newly created TopLevelBlock.
4377 2007-03-07 Martin Baulig <martin@ximian.com>
4379 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
4381 2007-03-06 Miguel de Icaza <miguel@novell.com>
4383 * convert.cs (ExplicitReferenceConversionExists): Sync this method
4384 with the changes from David, fixes the build.
4386 2007-03-05 David Mitchell <dmitchell@logos.com>
4388 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
4389 and its base interfaces to a one-dimensional array type S[],
4390 provided there is an implicit or explicit reference conversion
4393 2007-03-03 Marek Safar <marek.safar@gmail.com>
4395 * cs-tokenizer.cs: Implemented basic linq grammar.
4397 * driver.cs: Set linq lang version on demand.
4399 2007-02-26 Marek Safar <marek.safar@gmail.com>
4401 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
4403 2007-02-25 Marek Safar <marek.safar@gmail.com>
4405 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
4408 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
4410 Check property and event extern attributes.
4412 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
4415 2007-02-24 Marek Safar <marek.safar@gmail.com>
4417 A fix for bug #80407
4418 * ecore.cs: Don't report ambiguity error when methods have same parent.
4420 2007-02-23 Marek Safar <marek.safar@gmail.com>
4422 A fix for bug #80878
4423 * class.cs, cs-parser.jay: Event property can host anonymous methods.
4425 2007-02-22 Marek Safar <marek.safar@gmail.com>
4427 * attribute.cs: Enable ExtensionAttribute presence test.
4429 2007-02-22 Marek Safar <marek.safar@gmail.com>
4431 * class.cs: Warn about missing GetHashCode only when Equals is override.
4433 * decl.cs: Check accessibility of type arguments.
4435 * typemanager.cs: Correctly report nullable array.
4437 2007-02-20 Marek Safar <marek.safar@gmail.com>
4439 * class.cs, report.cs: Capture more details when things go wrong.
4441 2007-02-20 Marek Safar <marek.safar@gmail.com>
4443 A fix for bug #80650
4444 * cs-parser.jay: Anonymous container starts at constructor declaration
4445 and not at block beginning because it has to be usable in constructor
4448 * statement.cs: Use context location and not block one for error reporting.
4450 2007-02-18 Marek Safar <marek.safar@gmail.com>
4452 A fix for bug #78712
4453 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
4456 2007-02-18 Marek Safar <marek.safar@gmail.com>
4458 A fix for bug #80493 by Atsushi Enomoto
4459 * cs-parser.jay: Ignore invalid attribute target.
4461 2007-02-18 Marek Safar <marek.safar@gmail.com>
4463 * cs-tokenizer.cs: Ignore '\0' as white space character.
4465 2007-02-17 Miguel de Icaza <miguel@novell.com>
4467 * cs-parser.jay: Add support for lambda expressions to the mcs
4470 * lambda.cs: Only clone when we are probing, not on the final call
4471 (Compatible is the final call).
4473 * statement.cs (CloneContext): Introduce class to provide block
4474 remapping during clone.
4476 All statements Clone themselves now.
4478 (Clone): special handling for blocks, when we clone a block, we
4479 register the block inside this routine, as children of the block
4480 might trigger a lookup.
4482 * expression.cs: Add support for CloneContext in all expressions.
4484 2007-02-17 Marek Safar <marek.safar@gmail.com>
4486 A fix for bug #80493
4487 * statement.cs: Report ambiguous warning when interfaces are not related.
4489 2007-02-15 Marek Safar <marek.safar@gmail.com>
4491 C# 3.0 extension methods.
4493 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
4494 cannot be used directly.
4496 * class.cs (Class.Emit): Emit extension attribute if any class method
4497 is extension method.
4498 (Method.Define): Add basic extension method validation conditions.
4499 (Method.Emit): Emit extension attribute for method.
4501 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
4502 extension method exists. Currently we follow same approach as Microsoft
4503 does, emit even if a method or a class are private but this can change
4506 * cs-parser.jay: Add handling of `this' keyword in method parameters
4509 * decl.cs (DeclSpace.IsStaticClass): New property.
4510 (MemberCache.FindExtensionMethods): Looks for extension methods with
4511 defined name and extension type.
4513 * doc.cs: Updated after OverloadResolve changes.
4515 * driver.cs: Add new soft reference to System.Core.dll.
4517 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
4518 (ExtensionMethodGroupExpr): Represents group of extension methods.
4520 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
4521 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
4522 to MethodGroupExpr and made non-static for easier customization.
4523 (Invocation.DoResolve): Add extension method lookup when no standard
4525 (MemberAccess.DoResolve): Try extension methods if no member exists.
4527 * modifiers.cs: Add METHOD_EXTENSION modifier.
4529 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
4530 as well as candidate extension type.
4531 (ComputeNamespaces): When assembly constains extension methods registers
4533 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
4534 extension method lookup.
4535 (Namespace.LookupExtensionMethod): Looks for extension method in this
4537 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
4538 find a method which matches name and extensionType.
4540 * parameter.cs (Parameter): Add This modifer.
4541 (HasExtensionMethodModifier): New property.
4542 (Resolve): Add extension parameter check.
4543 (ModFlags): turned to property to exclude this modifier as it is not real
4545 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
4547 * support.cs (ParameterData): Add ExtensionMethodType.
4548 (ReflectionParameters): Implemented ExtensionMethodType interface property.
4550 * typemanager.cs: Add type and ctor extension attribute type.
4552 2007-02-15 Miguel de Icaza <miguel@novell.com>
4554 * report.cs (DisableErrors, EnableErrors): used to prevent error
4555 output when we are "trying" to compile various methods with
4558 * ecore.cs (Expression): Add Clone method that calls the virtual
4559 CloneTo method. The current CloneTo method in Expression throws
4560 an exception so we can track down all the places where this must
4561 be implemented (not using abstract, because that would be a lot of
4562 up-front-work before we can start testing the implementation
4565 Important: we only need Clone capabilities for expressions created
4566 by the parser, as the expressions we will be cloning are
4567 expressions in the pre-resolved state. This vastly simplifies
4570 (SimpleName): Add CloneTo that does nothing.
4571 (EmptyCast): Add CloneTo.
4573 * expression.cs (Binary): Implement CloneTo.
4574 (Invocation.IsApplicable): Store the current ec in
4575 EmitContext.TempEc and restore it on return. This is used so we
4576 do not have to sprinkle hundres of methods with an extra
4577 EmitContext, we know that the only user is the lambda expression
4578 ImplicitConversionExists code.
4580 (Argument): Add Cloning capabilities.
4581 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
4582 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
4583 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
4584 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
4585 IndexerAccess): Add Clone capability.
4587 (LocalVariableReference, This): TODO: needs cloned Block mapping.
4589 (Argument): Add cloning capability.
4591 * assign.cs (Assign): Implement CloneTo.
4593 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
4595 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
4596 version by calling Convert with the EmitContext (that we are
4597 currently storing in ec, this is not great, but will do for now,
4598 to avoid passing EmitContext parameters to hundreds of functions
4599 that do not need them now).
4601 (SetExpression): Remove, it is not needed.
4603 (ContextualReturn): Implement CloneTo.
4605 * statement.cs (Statement): Implement cloning infrastructure,
4606 similar to expressions.
4608 (Block): Partial implementation of Clone for statements.
4610 (Return): Implement clone.
4612 * constant.cs (Constant.CloneTo): New method, does nothing.
4614 * codegen.cs (TempEc): Add a static EmitContext as a temporary
4615 solution, until we decide how to exactly do this.
4617 2007-02-14 Marek Safar <marek.safar@gmail.com>
4619 A fix for bug #80493
4620 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
4621 a property is override we need to use second accessor.
4623 2007-02-13 Marek Safar <marek.safar@gmail.com>
4625 A fix for bug #80418
4626 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
4629 2007-02-13 Marek Safar <marek.safar@gmail.com>
4631 Another fix for bug #80749
4632 * pending.cs: Abstract class has priority over interfaces.
4634 2007-02-13 Marek Safar <marek.safar@gmail.com>
4636 Another fix for bug #80749
4637 * pending.cs: Abstract class has priority over interfaces.
4639 2007-02-13 Marek Safar <marek.safar@gmail.com>
4641 Another fix for bug #80749
4642 * pending.cs: Abstract class has priority over interfaces.
4644 2007-02-13 Marek Safar <marek.safar@gmail.com>
4646 Another fix for bug #80749
4647 * pending.cs: Abstract class has priority over interfaces.
4649 2007-02-13 Marek Safar <marek.safar@gmail.com>
4651 * class.cs Better error message.
4653 * driver.cs: Add shorter versions of -optimize option.
4655 2007-02-13 Martin Baulig <martin@ximian.com>
4657 * class.cs (Constructor.Emit): Check the return value of
4658 ec.ResolveTopBlock() and return on error.
4660 2007-02-13 Raja R Harinath <rharinath@novell.com>
4662 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
4663 message to fix error message regression.
4665 2007-02-12 Marek Safar <marek.safar@gmail.com>
4667 * delegate.cs: Delegate creation expression cannot be of Nullable type.
4669 2007-02-12 Marek Safar <marek.safar@gmail.com>
4671 A fix for bug #80749
4672 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
4673 its parent container.
4675 * class.cs (DefineFieldInitializers): Each initializer can has different
4678 * const.cs: Updated.
4680 2007-02-11 Miguel de Icaza <miguel@novell.com>
4682 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
4683 now all the heavy lifting to check that embedded statements or
4684 expressions have the right form is done in the ContextualReturn.
4686 (ContextualReturn): New class.
4688 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
4689 method that can be invoked to report 201, so we do not replicate
4692 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
4694 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
4695 treating tabs as spaces.
4697 2007-02-09 Marek Safar <marek.safar@gmail.com>
4699 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
4700 * assign.cs: Use full implicit conversion for right side check.
4702 2007-02-09 Marek Safar <marek.safar@gmail.com>
4704 * statement.cs (Switch): Switch over boolean type is not standardized.
4706 2007-02-08 Marek Safar <marek.safar@gmail.com>
4708 A fix for bug #80755
4709 * decl.cs (FindBaseEvent): Don't use method cache for events.
4711 2007-02-07 Marek Safar <marek.safar@gmail.com>
4713 * cs-parser.jay: Better syntax error handling.
4715 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
4716 instead of underlying type value.
4718 2007-02-06 Marek Safar <marek.safar@gmail.com>
4720 * driver.cs: Check define identifier before is registered.
4722 * namespace.cs: Use existing error message.
4724 * report.cs: New warning.
4726 2007-02-06 Marek Safar <marek.safar@gmail.com>
4728 A fix for bug #80742
4729 * expression.cs: Delegate Invoke method can be called directly.
4731 2007-02-06 Marek Safar <marek.safar@gmail.com>
4733 A fix for bug #80676
4734 * class.cs (IsEntryPoint): The Main method can have params modifier.
4736 2007-02-04 Miguel de Icaza <miguel@novell.com>
4738 * parameter.cs (Parameter, Parameters): Add Clone method.
4740 * anonymous.cs (Compatible): Turn method into virtual method, so
4741 LambdaExpression can implement a different behavior.
4743 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
4744 out the basic checking here, so it can be used by
4747 * lambda.cs: Introduce "Compatible" function that will do the
4750 2007-02-02 Marek Safar <marek.safar@gmail.com>
4752 * attribute.cs: Unified one error message.
4754 * class.cs (Class): Use type attributes and not properties to test static
4756 (IsEntryPoint): Don's pass local variable.
4758 * convert.cs: Removed duplicate check.
4760 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
4762 * driver.cs: Don't crash when soft reference does not exist.
4764 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
4765 (UsingEntry): Removed redundant allocation.
4767 * parameter.cs: Add fast path for type parameters.
4769 * support.cs: Don't allocate attribute when it's not used.
4771 2007-01-30 Miguel de Icaza <miguel@novell.com>
4774 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
4775 this into a virtual method, so we can override it in LambdaExpression.
4777 * driver.cs: Improve diagnostics in case of failure.
4779 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
4780 write a function that is slightly more complex and that parses:
4782 type identifier [, type identifier]* )
4784 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
4787 (canEmpty ? i >= 0 : i > 0)
4789 2007-01-30 Raja R Harinath <rharinath@novell.com>
4791 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
4792 exception on possibly valid code.
4794 2007-01-29 Raja R Harinath <rharinath@novell.com>
4796 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
4798 (parse_opt_type_arguments): Remove. It's almost the same as
4800 (parse_namespace_or_typename): Use parse_less_than.
4802 2007-01-28 Miguel de Icaza <miguel@novell.com>
4804 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
4805 this bug took a few hours to find, because the state saved and
4806 restored by PushPosition and PopPosition was ignoring the state of
4807 parse_generic_less_than.
4809 I can also now remove the handling of OP_LT and OP_GT, this solves
4812 * cs-tokenizer.cs: store the location for the ARROW token, we use
4815 (PushPosition, PopPosition): save/restore also `current_token',
4816 restore `parse_generic_less_than' (was missing).
4818 (parse_opt_type_arguments): use parse_type, not
4819 parse_namespace_or_typename to parse types.
4821 * lambda.cs: Empty new file, will eventually have the lambda
4822 expression implementation.
4824 * lambda.test: used to test the internal tokenizer.
4826 * report.cs (FeatureIsNotISO1): Rename from
4827 FeatureIsNotStandardized, because it was about the language level
4828 (1 vs 2) it was not about standarization.
4830 (FeatureRequiresLINQ): New.
4832 * support.cs (SeekableStreamReader): Only require that the reader
4833 is a TextReader, not a StreamReader, so we can plug StringReader.
4835 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
4836 given position in the input stream the following tokens can be
4837 parsed as a type followed by an identifier.
4839 (is_punct): after a '(' if parse_type_and_parameter returns true,
4840 then return a special token OPEN_PARENS_LAMBDA which is used to
4841 avoid reduce/reduce errors in the grammar for the
4842 lambda_expression rules.
4844 (parse_type): implement a type parser inside the
4845 tokenizer, the parser only returns true or false depending on
4846 whether the input at a given position can be parsed as a type.
4848 (peek_token): new method used during type parsing.
4850 2007-01-28 Raja R Harinath <rharinath@novell.com>
4853 * anonymous.cs (ScopeInfo.InflateParameters): New.
4854 (AnonymousContainer.Resolve): Use it to redirect types of
4855 delegate parameters.
4857 2007-01-27 Raja R Harinath <rharinath@novell.com>
4860 * expression.cs (Error_InvalidArguments): Don't use two different
4861 messages for CS1503. Use ExtraInformation and
4862 SymbolRelatedToPreviousError instead.
4865 * decl.cs (DeclSpace.initialize_type_params): Don't access
4866 'type_params' of a partial class directly.
4868 2007-01-26 Miguel de Icaza <miguel@novell.com>
4870 * constant.cs: Removed a handful of out-of-range checks that were
4873 2007-01-25 Marek Safar <marek.safar@gmail.com>
4875 * expression.cs (CheckUselessComparison): Add additional check for char
4878 * namespace.cs: Fixed typo.
4880 2007-01-23 Miguel de Icaza <miguel@novell.com>
4882 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
4883 gone, instead we inline the test, preventing the needless casts to
4884 longs, ulongs and doubles for the parameters, avoiding calls to
4885 methods that overchecked stuff, and instead inlined things
4888 2007-01-20 Marek Safar <marek.safar@gmail.com>
4890 * cs-parser.jay: Better parameter error handling.
4892 2007-01-17 Marek Safar <marek.safar@gmail.com>
4894 A fix for bug #80368, #80522
4895 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
4896 whether array initializer contains constants only.
4897 (ArrayCreation.Emit): Use better formula to decide when
4898 are array initializers for static initialization.
4899 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
4900 have to emit even constants otherwise they are pre-initialized.
4902 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
4903 Raja R Harinath <rharinath@novell.com>
4905 Fix emit order of 'get' vs. 'set'.
4906 * support.cs (Accessors): New.
4907 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
4908 Note the order in which accessors are declared in the source.
4909 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
4910 Refactored from Property.Define and Indexer.Define.
4911 (PropertyBase.DefineAccessors): New helper that calls the above in
4912 appropriate order as noted by the parser.
4913 (Property.Define, Indexer.Define): Update to changes.
4914 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
4916 2007-01-17 Raja R Harinath <rharinath@novell.com>
4918 Fix cs0029-6.cs and gcs0029-2.cs (regression)
4919 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
4920 there's an implicit conversion from the current type to the target
4921 type before converting the underlying constant.
4923 2007-01-16 Marek Safar <marek.safar@gmail.com>
4925 * const.cs (ResolveValue): Updated after constant conversion was made more
4928 * constant.cs (GetAttributableValue): constant to object conversion is
4929 used for attributes only.
4930 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
4931 constant conversions.
4932 (LongConstant.ConvertImplicitly): Ditto.
4934 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
4935 (ImplicitConversionStandard): Handle constant conversion as extra step.
4936 It solves the issue when constant conversion was called indirectly like
4937 inside array initializer and constant folding was skipped.
4939 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
4942 * statement.cs(ImplicitConversionStandard): Updated after constant
4943 conversion was made more generic.
4945 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
4947 * expression.cs (As.DoResolve): Use GenericConstraints instead of
4948 Constraints, solves the problem where the compiler incorrectly
4949 reported that a type parameter was not constrained to a class (Bug
4952 2007-01-14 Marek Habersack <grendello@gmail.com>
4954 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
4956 2007-01-14 Marek Safar <marek.safar@gmail.com>
4958 A fix for bug #80368
4959 * assign.cs (FieldInitializer): New class implements field
4960 initializer statement.
4962 * attribute.cs: Update after FieldMember rename.
4964 * class.cs (PropertyBasedMember): New common class for property based
4966 (InterfaceMemberBase): New base class for all members which can be used as
4967 an interface members.
4968 (MethodCore): Moved really common code to InterfaceMemberBase.
4969 (Method.Define): Equal and GetHasCode detection is relevant for methods
4971 (MethodData.Define): Don't assume that public event implements an
4972 interface automatically.
4973 (MethodData.DefineMethodBuilder): Issue an error even if only extern
4975 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
4976 (FieldMember): Merged with FieldBase.
4977 (EventProperty.AEventPropertyAccessor): New specialization to check whether
4978 event extern modifier can be used.
4979 (EventField.EventFieldAccessor): Moved event field specific code here.
4980 (Event.AllowedModifiers): Even event can be extern.
4981 (Event.FindOutBaseMethod): New override specific to events.
4982 (Indexer.parameters): Reintroduce parameters because base class holds
4983 only properties common data.
4984 (Indexer.CheckForDuplications): Indexers are threated as methods so we
4985 need do extra parameters check.
4987 * const.cs: Update after FieldMember rename.
4989 * decl.cs (MemberCache.FindBaseEvent): New method.
4991 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
4992 to reflect that indexer is now derived from PropertyBased.
4994 * ecore.cs (GetMemberType): Made public.
4995 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
4998 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
5000 * typemanager.cs (CSharpSignature): Correctly print event accessors.
5001 (RegisterEvent): Removed.
5002 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
5003 (GetPrivateFieldOfEvent): Renamed to GetEventField.
5005 2007-01-11 Raja R Harinath <rharinath@novell.com>
5008 * statement.cs (CollectionForeach.TryType): Prefer generic
5009 GetEnumerator over non-generic variant. Fix code to follow comments.
5011 2007-01-09 Raja R Harinath <rharinath@novell.com>
5014 * support.cs (ReflectionParameter): Don't use an invalid index on
5015 the generic parameter data.
5017 2007-01-08 Miguel de Icaza <miguel@novell.com>
5019 * driver.cs: Just add a tiny bit of infrastructure.
5021 2007-01-02 Marek Safar <marek.safar@gmail.com>
5023 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
5024 where field type is struct from current assembly.
5026 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
5029 2007-01-02 Marek Safar <marek.safar@gmail.com>
5031 A fix for bug #80381
5032 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
5035 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
5037 (Namespace.LookupType): Always use core types from corlib when speficied.
5039 * report.cs: A new warning.
5041 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
5042 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
5043 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
5045 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
5046 (InitCoreTypes): Set expression type of object_type and value_type
5047 immediately after lookup.
5049 2007-01-01 Miguel de Icaza <miguel@novell.com>
5051 * cs-tokenizer.cs: Accept Pc class characters (Connector
5052 Punctuation) as valid identifiers. Fixes #78259
5054 * expression.cs (Invocation.DoResolve): Moved the check for the
5055 use of `this' for doing method calls to the Invocation resolution
5056 step, after overload resolution has taken place instead of doing
5057 the check at the low-level `This.DoResolve' level.
5059 The `This.DoResolve'(appens before overload resolution, so it has
5060 no way of knowing if the method that will be called will be
5061 instace or static, triggering an erroneous report for cs0188 (Bug
5064 We now do the check for instance method invocations after we know
5065 what method will be called.
5067 (This.CheckThisUsage): Move the actual use of this structure
5068 checking into its own method and expose it.
5070 * Everywhere that called Error_ValueCannotBeConverted: pass a new
5073 Exceptions: Null.ConvertImplicitly,
5074 Constant.ImplicitConversionRequired as there are too many call
5075 sites for passing the ec.
5077 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
5078 EmitContext, if the value is null, then we do not try to provide
5079 the extra information from the error (If a userdefined conversion
5080 exists, as UserDefinedConversion requires a non null-EmitContext).
5084 2006-12-30 Raja R Harinath <rharinath@novell.com>
5086 * flowanalysis.cs (MyBitVector): Document some invariants.
5087 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
5088 introduced below, and add a couple of others,
5090 2006-12-30 Marek Safar <marek.safar@gmail.com>
5092 * attribute.cs (GetMethodObsoleteAttribute): Uses new
5093 GetPropertyFromAccessor and GetEventFromAccessor.
5095 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
5096 overrides non-obsolete one.
5097 (Indexer.Define): Error message has been moved to the parser.
5099 * cs-parser.jay: Better syntax errors handling.
5101 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
5102 when an invocation has no arguments.
5104 * ecore.cs: Removed not used caching.
5106 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
5109 * report.cs: Add a new warning.
5111 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
5113 * typemanager.cs (enumeration_type): Removed.
5114 (CSharpSignature): Reuses IsSpecialMethod.
5115 (IsEqual): Hack for MS BCL.
5116 (GetPropertyFromAccessor): New method.
5117 (GetEventFromAccessor): New method.
5118 (IsSpecialMethod): Fixed to handle more cases.
5120 2006-12-30 Marek Safar <marek.safar@gmail.com>
5122 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
5123 Made white spaces array static.
5125 * ecore.cs (RemoveGenericArity): Optimized.
5127 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
5129 (MyBitVector.initialize_vector): Simplified.
5131 2006-12-22 Miguel de Icaza <miguel@novell.com>
5133 * ecore.cs: Am not entirely happy with this hack, but it seems to
5134 address the issue in 80257 (a small test case for
5137 I set the MethodGroupExpr.Type to an internal compiler type
5138 (itself in this case) to force the resolution to take place. Why
5139 it does not take place with a null is beyond me.
5141 2006-12-20 Marek Safar <marek.safar@gmail.com>
5143 A fix for bug #80288
5144 * expression.cs (ResolveOperator): Consider user defined conversion for
5145 logical and operator too.
5146 (EmitBranchable): Optimization for logical and when full constant folding
5147 could not be applied but one operand is constant.
5149 2006-12-19 Marek Safar <marek.safar@gmail.com>
5151 * class.cs (GetClassBases): Write 5 times every day, will never use
5152 FullName for error reporting.
5154 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
5156 2006-12-19 Martin Baulig <martin@ximian.com>
5158 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
5159 the symbol file info here.
5161 2006-12-18 Marek Safar <marek.safar@gmail.com>
5163 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
5164 of `elseif' is taking then following sections are not taking.
5165 Fixes an issue reported on mono mailing list.
5167 2006-12-18 Marek Safar <marek.safar@gmail.com>
5169 A fix for bug #80300
5170 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
5171 a caller is not taking.
5173 2006-12-18 Raja R Harinath <rharinath@novell.com>
5175 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
5176 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
5177 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
5178 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
5179 * class.cs: Update to changes.
5181 2006-12-17 Marek Safar <marek.safar@gmail.com>
5183 A fix for bug #79934
5184 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
5187 * class.cs (ResolveMembers): Register an iterator in current container and
5190 2006-12-16 Raja R Harinath <rharinath@novell.com>
5193 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
5194 satisfy a params annotated parameter.
5196 2006-12-16 Marek Safar <marek.safar@gmail.com>
5198 A fix for bug #77014
5199 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
5200 paramters correctly and not rely on hacks in Parameters class.
5201 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
5203 (Invocation.VerifyArgumentsCompat): Ditto.
5204 (Invocation.EmitArguments): Changed to correctly emit params arguments at
5207 * parameter.cs (HasParams): Don't assume that params is the last one.
5209 * support.cs (ReflectionParameters.ctor): Look for params attribute
5211 (ReflectionParameters.ParameterType): Removed hack when we returned last
5212 parameter for out of range parameters.
5213 (ParameterName, ParameterModifier): Ditto.
5215 2006-12-14 Marek Safar <marek.safar@gmail.com>
5217 A fix for bug #79987
5218 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
5219 when assembly is not CLS compliant but type is. I have no idea why is this
5222 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
5224 2006-12-13 Miguel de Icaza <miguel@novell.com>
5226 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
5227 in struct constructors, they are basically no-ops.
5229 2006-12-12 Marek Safar <marek.safar@gmail.com>
5231 * cs-tokenizer.cs (Position): Save preprocessor status too.
5233 2006-12-12 Marek Safar <marek.safar@gmail.com>
5235 A fix for bug #77794
5236 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
5238 2006-12-12 Marek Safar <marek.safar@gmail.com>
5240 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
5242 (pp_expr): Report error for an invalid expression.
5243 (handle_preprocessing_directive): Simplified; add more error checking.
5245 2006-12-11 Marek Safar <marek.safar@gmail.com>
5247 A fix for bug #74939
5248 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
5249 directives handling.
5251 2006-12-10 Marek Safar <marek.safar@gmail.com>
5253 A fix for bugs #80093, and #75984
5254 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
5255 logic, it seems to me as it worked before "by coincidence".
5256 (xtoken): Simplified to use reworked handle_preprocessing_directive.
5257 (cleanup): Enabled endif check.
5259 2006-12-09 Marek Safar <marek.safar@gmail.com>
5261 A fix for bug #80162
5262 * statement.cs (CollectionForeach.TryType): Generics and non-generics
5263 enumerators are never ambiguous.
5265 2006-12-08 Raja R Harinath <rharinath@novell.com>
5268 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
5270 2006-12-06 Marek Safar <marek.safar@gmail.com>
5272 A fix for bug #80144
5273 * class.cs (EventProperty.Define): Explicit implementation means
5274 that an even is used.
5276 2006-12-06 Marek Safar <marek.safar@gmail.com>
5278 Fixes the operators implementation (part II)
5280 * cfold.cs (DoConstantNumericPromotions): Renamed to
5281 DoBinaryNumericPromotions and simplified.
5282 (BinaryFold): Couple of conversion fixes; simplified.
5284 * constant.cs, ecore.cs, literal.cs
5285 (ToType): Renamed to ConvertImplicitly.
5286 (Reduce): Renamed to ConvertExplicitly.
5288 * class.cs, convert.cs: Updated.
5290 * expression.cs: TryReduce doesn't throw an exception.
5292 2006-12-01 Marek Safar <marek.safar@gmail.com>
5294 A fix for bug #80108
5295 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
5298 2006-11-30 Marek Safar <marek.safar@gmail.com>
5300 Fixes unary operators implementation (part I)
5303 * cfold.cs (Error_CompileTimeOverflow): Made internal
5305 * const.cs (IConstant): Changed to use reference to constant and
5306 not constant itself.
5307 Updated IConstant implementations.
5309 * constant.cs (CreateConstant): New factory method.
5310 Updated IConstant implementation.
5312 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
5314 * ecore.cs: Updated to use CreateConstantReference.
5316 * enum.cs: Reflects IConstant changes.
5318 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
5320 * literal.cs (NullConstant): Change to be independently usable.
5322 2006-11-29 Martin Baulig <martin@ximian.com>
5324 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
5325 we need to emit the scope initializer before calling the base .ctor.
5327 * anonymous.cs: Merged back from the new anonymous methods branch.
5328 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
5330 * expression.cs (ParameterReference.DoResolveBase): Create a
5331 "normal" ScopeInfo when capturing parameters rather than using the
5332 root scope; this makes things work with anonymous methods having
5336 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
5338 2006-11-22 Marek Safar <marek.safar@gmail.com>
5340 A fix for bug #79987
5341 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
5342 check to a base class.
5343 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
5344 only when assembly has missing attribute.
5345 * report.cs: Update.
5347 2006-11-21 Marek Safar <marek.safar@gmail.com>
5349 * cs-tokenizer.cs: Merged with gmcs version.
5351 2006-11-20 Marek Safar <marek.safar@gmail.com>
5354 * cs-parser.jay: Better error message when partial keyword is misplaced.
5356 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
5358 A fix for bug #79810
5359 report.cs: CS1058 only applies to 2.0 profile (gmcs).
5360 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
5361 a RuntimeWrappedException by default.
5363 2006-11-18 Marek Safar <marek.safar@gmail.com>
5365 A fix for bug #79843
5366 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
5368 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
5370 2006-11-18 Marek Safar <marek.safar@gmail.com>
5372 * driver.cs, namespace.cs: Uses faster IndexOf version.
5374 2006-11-17 Marek Safar <marek.safar@gmail.com>
5376 A fix for bug #79941
5377 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
5379 (Operator.Define): Implicit/Explicit operator of same type is duplicate
5380 even if internal name is different.
5381 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
5382 (UserDefinedConversion): Simplified as the operators cannot be internal.
5383 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
5385 (MethodLookup): Replaced EmitContext with parentType.
5386 * expression.cs: Updated.
5388 2006-11-09 Raja R Harinath <rharinath@novell.com>
5390 * driver.cs (BadAssembly): Handle all the ugliness of
5391 DefineDynamicAssembly.
5393 2006-11-08 Raja R Harinath <rharinath@novell.com>
5395 Address parts of #58244 -- most of what's left is in the runtime
5396 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
5397 CS1509 error checks, and handle them for all assembly loads, not
5398 just the first invocation.
5399 (LoadModule): Likewise. Move handling of 'adder_method' ...
5400 * codegen.cs (AssemblyClass.AddModule): ... here.
5402 2006-11-02 Marek Safar <marek.safar@gmail.com>
5404 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
5405 IEnumerable<T> is ambiguous.
5407 2006-10-31 Marek Safar <marek.safar@gmail.com>
5409 A fix for bug #67689
5410 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
5411 GetEnumerator is ambiguous.
5413 * report.cs: Add new warning.
5415 2006-10-29 Marek Safar <marek.safar@gmail.com>
5417 A fix for bug #78602
5418 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
5419 to protected member can be nested type.
5421 2006-10-28 Marek Safar <marek.safar@gmail.com>
5423 A fix for bug #78965
5424 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
5425 to protected member must derive from current type.
5427 2006-10-27 Marek Safar <marek.safar@gmail.com>
5429 assign.cs: Reuses error method.
5431 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
5432 instead of type for constants.
5433 (Expression.Error_ValueAssignment): Common error method.
5435 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
5438 2006-10-27 Marek Safar <marek.safar@gmail.com>
5440 A fix for bug #79081
5441 * expression.cs (MemberAccess.DoResolve): Check nested type
5444 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
5446 * doc.cs : nested delegates were not handled. Fixed bug #79754.
5448 2006-10-26 Marek Safar <marek.safar@gmail.com>
5450 A fix for bug #76591
5451 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
5453 2006-10-26 Marek Safar <marek.safar@gmail.com>
5455 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
5456 type forwarder of the same type multiple times.
5458 2006-10-26 Raja R Harinath <rharinath@novell.com>
5461 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
5462 instance as an rvalue, even when we later resolve as an lvalue.
5464 2006-10-25 Martin Baulig <martin@ximian.com>
5466 * anonymous.cs: Fix #79673.
5468 2006-10-24 Marek Safar <marek.safar@seznam.cz>
5470 A fix for bug #79666
5471 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
5472 ignored when is optimized (= default value) as its value is already set.
5474 2006-10-23 Marek Safar <marek.safar@seznam.cz>
5476 A fix for bug #79724
5477 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
5478 TypeContainer for type lookup.
5480 2006-10-23 Marek Safar <marek.safar@seznam.cz>
5482 A fix for bug #79231
5483 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
5484 * expression.cs (OverloadResolve): Always convert type name for
5486 (ResolveNamespaceOrType): Don't confuse a nested type with any
5489 2006-10-18 Martin Baulig <martin@ximian.com>
5491 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
5493 2006-10-17 Miguel de Icaza <miguel@novell.com>
5495 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
5496 an int32, but requesting an int64 from the conversion
5498 2006-10-12 Martin Baulig <martin@ximian.com>
5501 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
5503 2006-10-12 Martin Baulig <martin@ximian.com>
5506 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
5508 2006-10-11 Miguel de Icaza <miguel@novell.com>
5510 * convert.cs: Remove broken code: I was doing the "Existance"
5511 tests for Implicit conversions.
5513 2006-10-10 Miguel de Icaza <miguel@novell.com>
5515 * convert.cs: Added one missing case in
5516 ImplicitStandardConversionExists uint64 to intptr.
5520 * typemanager.cs (uintptr_type): another core known type.
5522 * ecore.cs (OperatorCast): routine used to do cast operations that
5523 depend on op_Explicit. We could change some of the Decimal
5524 conversions to use this.
5526 This one has a probe mechanism that checks both types for an op_
5527 which it coudl be used to eliminate two classes: CastToDecimal
5528 and CastFromDecimal.
5530 * convert.cs: Implement the conversions documented in #59800
5532 2006-10-10 Martin Baulig <martin@ximian.com>
5534 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
5535 before RootScope.ResolveMembers().
5537 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
5538 `CurrentType' if appropriate.
5540 2006-10-09 Marek Safar <marek.safar@seznam.cz>
5542 A fix for bug #78568
5543 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
5544 when contains binary operators.
5545 * cs-parser.jay: Updated.
5547 2006-10-09 Martin Baulig <martin@ximian.com>
5550 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
5551 moved that into Define() and also do the other type parameter
5552 checks there. Fixes #79094. Added gtest-292.cs.
5555 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
5556 since that doesn't include type parameters; don't use `Ldelema'
5557 for type parameters. Fixes #78980. Added gtest-293.cs.
5559 2006-10-08 Marek Safar <marek.safar@seznam.cz>
5562 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
5563 conversion is allowed.
5565 2006-10-06 Marek Safar <marek.safar@seznam.cz>
5567 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
5568 error reporting when no error occurs.
5570 2006-10-06 Marek Safar <marek.safar@seznam.cz>
5572 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
5575 2006-10-06 Raja R Harinath <rharinath@novell.com>
5578 * class.cs (DefineTypeBuilder): Check circular dependencies before
5579 setting the parent of the TypeBuilder.
5580 (CheckRecursiveDefinition): Don't use 'BaseType', since
5581 it may not be valid until after DefineTypeBuilder. Use
5582 'base_type' instead.
5584 2006-10-04 Martin Baulig <martin@ximian.com>
5586 Merged the Anonymous Methods patch.
5588 * anonymous.cs, iterators.cs: The new anonymous methods code.
5590 * statement.cs (Variable): New public abstract class.
5591 (LocalInfo.Variable): New public property.
5592 (LocalInfo.ResolveVariable): New public method.
5593 (Block.Flags): Add `IsIterator'.
5594 (Block.AddVariable): Improved the CS0136 check.
5595 (Block.AnonymousChildren): New public property.
5596 (Block.AddAnonymousChild): New public method.
5597 (ToplevelBlock): Update to use the new anonymous method framework.
5598 (ToplevelBlock.ctor): `container' is now a `Block' and not a
5599 `ToplevelBlock'; this is required to correctly implement the
5601 (Fixed, Using): Use `TemporaryVariable' instead of directly
5602 creating the `LocalBuilder'.
5604 * parameter.cs (Parameter.ResolveVariable): New public method.
5605 (Parameters.ResolveVariable): Likewise.
5607 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
5609 * class.cs (TypeContainer): Replaced the `iterators' list and
5610 corresponding methods with a list of `CompilerGeneratedClass'es.
5611 (TypeContainer.ResolveMembers): New public method.
5612 (Method): `IIteratorContainer' has been replaced by
5615 * expression.cs (VariableReference): New public abstract base
5616 class for `LocalVariableReference', `ParameterReference' and
5619 * codegen.cs (EmitContext): Removed `capture_context',
5620 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
5621 (EmitContext.EmitThis): Removed.
5623 * cs-parser.jay: Replace `iterator_container' with
5626 2006-10-04 Martin Baulig <martin@ximian.com>
5628 * generic.cs (GenericMethod): Don't make this abstract.
5629 (Constraints.Clone): Added dummy implementation.
5631 2006-10-04 Raja R Harinath <harinath@gmail.com>
5634 * namespace.cs (LookForAnyGenericType): Avoid nullref on
5635 'declspaces'. Avoid allocating arrays willy-nilly.
5638 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
5639 cases out of the switch.
5641 2006-09-28 Marek Safar <marek.safar@seznam.cz>
5643 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
5644 message when non-generic type is used with the type arguments.
5645 * expression.cs: Updated.
5647 2006-09-28 Raja R Harinath <rharinath@novell.com>
5650 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
5651 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
5652 Change semantics slightly. Don't insist on having only one
5653 temporary EmptyExpression -- just throttle the creation of new ones.
5656 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
5657 non-interfaces too. If no methods are found, don't try to create
5660 2006-09-28 Marek Safar <marek.safar@seznam.cz>
5662 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
5665 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
5666 us produce better error message.
5668 2006-09-27 Marek Safar <marek.safar@seznam.cz>
5670 * expression.cs (Binary.ResolveOperator): Warn about a side effect
5671 of the `|' operator.
5673 * report.cs: A new warning added.
5675 2006-09-27 Martin Baulig <martin@ximian.com>
5677 * generic.cs (GenericMethod): Don't make this abstract.
5679 2006-09-27 Martin Baulig <martin@ximian.com>
5682 (InternalErrorException): Added overloaded ctor taking a params array.
5684 2006-09-26 Marek Safar <marek.safar@seznam.cz>
5686 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
5687 Fixed the cases when same error was reported twice.
5689 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
5690 now report symbol information.
5692 2006-09-25 Martin Baulig <martin@ximian.com>
5694 * class.cs: Completely unified with the gmcs version.
5696 2006-09-25 Martin Baulig <martin@ximian.com>
5698 * typemanager.cs (TypeManager.IsNullableType): New public function.
5699 (TypeManager.IsNullableTypeOf): Likewise.
5700 (TypeManager.IsNullableValueType): Likewise.
5702 * class.cs (MethodCore): Added the `GenericMethod' argument from
5703 gmcs and also unified all classes derived from `MethodCore' with gmcs.
5705 2006-09-24 Raja R Harinath <harinath@gmail.com>
5707 * convert.cs: Unify with gmcs version.
5709 2006-09-24 Marek Safar <marek.safar@seznam.cz>
5711 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
5712 verify them as well.
5714 * report.cs: New warning.
5716 2006-09-24 Marek Safar <marek.safar@seznam.cz>
5718 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
5719 for anonymous block with out argument.
5721 2006-09-24 Marek Safar <marek.safar@seznam.cz>
5723 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
5724 not used private events only.
5726 2006-09-23 Marek Safar <marek.safar@seznam.cz>
5728 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
5730 * const.cs (Const.Define): Check for constant type.
5731 (Const.IsConstantTypeValid): Looks for valid constant types.
5733 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
5735 * ecore.cs (EmptyConstantCast): New common class for all constant based
5738 * expression.cs (Is.DoResolve): Handle null constant especially.
5739 (New.DoResolve): Check for new void().
5740 (MemberAccess.DoResolve): Cope with all kind of nulls.
5742 * literal.cs (NullConstant): Uses EmptyConstantCast.
5743 (NullDefault): Based on EmptyConstantCast.
5744 (NullLiteral): Uses EmptyConstantCast.
5746 * statement.cs (Block.ResolveMeta): Check for constant type.
5748 2006-09-22 Martin Baulig <martin@ximian.com>
5750 * delegate.cs, attribute.cs: Merged with the gmcs versions.
5752 2006-09-22 Raja R Harinath <rharinath@novell.com>
5754 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
5758 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
5759 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
5762 2006-09-22 Martin Baulig <martin@ximian.com>
5764 * ecore.cs: Merged with the gmcs version.
5766 * generic.cs (ConstructedType): New dummy class.
5767 (TypeArguments): Don't make this abstract.
5770 (TypeManager.IsGenericTypeDefinition): New method.
5771 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
5773 2006-09-22 Raja R Harinath <rharinath@novell.com>
5775 * expression.cs (ComposedCast): Check for arrays of TypedReference
5776 before creating the type, not after.
5778 2006-09-21 Marek Safar <marek.safar@seznam.cz>
5780 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
5781 after ToType change.
5783 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
5784 when constant must be implicitly convertible.
5786 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
5788 * ecore.cs (NullCast): Derives from NullConstant.
5790 * expression.cs (Is.DoResolve): Removed useless variables.
5791 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
5792 (New.Constantify): Add enum support.
5793 (MemberAccess.DoResolve): Add warning when accessing null constant or
5796 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
5799 * literal.cs (NullConstant): New abstract class with common
5800 functionality for all null specializations.
5801 (NullDefault): Represents default(X) when result can be
5803 (NullLiteral): Updated.
5805 * report.cs: Add new warning.
5807 2006-09-21 Martin Baulig <martin@ximian.com>
5809 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
5811 2006-09-21 Martin Baulig <martin@ximian.com>
5813 * generic.cs (GenericConstraints): New dummy class.
5814 (Constraints): Likewise.
5815 (TypeParameter): Likewise.
5816 (TypeParameterName): Likewise.
5817 (GenericMethod): Likewise.
5819 * typemanager.cs (TypeManager.GetGenericArguments): New method.
5821 * decl.cs: Merged with the gmcs version.
5823 2006-09-21 Raja R Harinath <rharinath@novell.com>
5825 * generic.cs (TypeParameter): Implement IMemberContainer.
5826 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
5828 * rootcontext.cs: Unify with gmcs version.
5830 * report.cs: Unify with gmcs version.
5831 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
5832 from gmcs/generics.cs.
5833 * generics.cs (TypeParameter): New dummy class.
5835 * support.cs: Unify with gmcs version.
5837 2006-09-20 Raja R Harinath <rharinath@novell.com>
5839 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
5840 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
5842 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
5843 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
5844 * mcs.exe.sources: Add generic.cs.
5846 * codegen.cs: Unify with gmcs version.
5848 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
5849 (EmitContext): Add GenericDeclContainer implementation.
5850 * decl.cs (MemberCore, DeclSpace): Likewise.
5851 * namespace.cs: Remove #ifdef GMCS_SOURCE.
5853 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
5854 MCS TypeManager has a corresponding dummy method.
5856 2006-09-19 Martin Baulig <martin@ximian.com>
5858 * expression.cs: Completely merged with the gmcs version.
5860 2006-09-19 Martin Baulig <martin@ximian.com>
5862 * expression.cs (Invocation): Merged with the gmcs version.
5863 (ArrayAccess.GetStoreOpcode): Likewise.
5865 2006-09-19 Martin Baulig <martin@ximian.com>
5868 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
5869 (TypeManager.IsGenericMethodDefinition): Likewise.
5871 2006-09-19 Martin Baulig <martin@ximian.com>
5874 (TypeManager.IsEqual): Moved the gmcs implementation here.
5875 (TypeManager.DropGenericTypeArguments): Likewise.
5876 (TypeManager.DropGenericMethodArguments): Likewise.
5877 (TypeManager.GetTypeArguments): Moved here from gmcs.
5878 (TypeManager.HasGenericArguments): Likewise.
5880 2006-09-19 Martin Baulig <martin@ximian.com>
5882 * expression.cs (Binary): Merged with the gmcs version.
5884 2006-09-19 Martin Baulig <martin@ximian.com>
5886 * expression.cs (Probe, As, Is): Merged with the gmcs version.
5888 2006-09-19 Martin Baulig <martin@ximian.com>
5890 * typemanager.cs: Merged with the gmcs version.
5892 2006-09-16 Raja R Harinath <rharinath@novell.com>
5894 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
5895 * driver.cs: Likewise.
5897 2006-09-16 Marek Safar <marek.safar@seznam.cz>
5900 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
5901 only if parent type is class.
5902 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
5905 2006-09-15 Marek Safar <marek.safar@seznam.cz>
5908 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
5910 * typemanager.cs(CSharpName): Converts NullType to null.
5912 2006-09-15 Martin Baulig <martin@ximian.com>
5915 (TypeManager.GetMethodName): Added mcs implementation.
5916 (TypeManager.IsEqual): Likewise.
5919 (SimpleName.RemoveGenericArity): Added dummy implementation.
5921 * pending.cs: Merged with the gmcs version.
5923 2006-09-15 Martin Baulig <martin@ximian.com>
5925 * statement.cs: Merge with the gmcs version.
5927 2006-09-15 Martin Baulig <martin@ximian.com>
5929 * statement.cs (Switch): Merge with the gmcs implementation
5930 (without nullables), which is newer.
5932 2006-09-15 Martin Baulig <martin@ximian.com>
5934 * statement.cs (Block.Variables): Make this public.
5935 (ToplevelBlock.Parameters): Make this a property.
5936 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
5938 2006-09-15 Martin Baulig <martin@ximian.com>
5940 * namespace.cs: Merge with the gmcs version.
5942 2006-09-15 Martin Baulig <martin@ximian.com>
5944 * decl.cs (MemberName): Minor code cleanups.
5946 2006-09-15 Martin Baulig <martin@ximian.com>
5948 * parameter.cs: Merge with the gmcs version.
5950 2006-09-15 Martin Baulig <martin@ximian.com>
5952 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
5953 and an error in mcs.
5955 2006-09-15 Martin Baulig <martin@ximian.com>
5957 * flowanalysis.cs: Merged from GMCS; added the generics code into
5958 a `GMCS_SOURCE' conditional so we can share this file.
5960 2006-09-08 Martin Baulig <martin@ximian.com>
5962 * typemanager.cs (TypeManager.interlocked_type): New public field.
5963 (TypeManager.int_interlocked_compare-exchange): New public field.
5964 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
5965 enumerator types here and call InitGenericCoreTypes().
5966 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
5967 after calling InitEnumUnderlyingTypes().
5970 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
5971 `classes_second_stage'.
5973 2006-09-14 Marek Safar <marek.safar@seznam.cz>
5975 * assign.cs, ecore.cs, expression.cs: Share error message text.
5976 * class.cs (FieldMember.Define): Check for varible of static type.
5977 * driver.cs (LoadAssembly): Uses error output for errors.
5978 * statement.cs: Updated.
5980 2006-09-08 Marek Safar <marek.safar@seznam.cz>
5982 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
5985 2006-09-07 Martin Baulig <martin@ximian.com>
5988 (MainDriver): Revert r62663 from Marek; see #70506 for details.
5990 2006-08-29 Miguel de Icaza <miguel@novell.com>
5992 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
5994 2006-08-17 Miguel de Icaza <miguel@novell.com>
5996 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
5997 #52019 and #79064, the use of the \uXXXX sequence in source code
5998 to represent unicode characters.
6000 2006-08-15 Marek Safar <marek.safar@seznam.cz>
6002 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
6004 * class.cs, ecore.cs, statement.cs: Merged to one error message.
6006 2006-08-13 Miguel de Icaza <miguel@novell.com>
6008 * assign.cs: Catch attempts to assign to a method groups in += and
6011 2006-08-13 Marek Safar <marek.safar@seznam.cz>
6014 * cs-parser.jay: Don't destroy current array type by typeof of array's.
6016 2006-08-12 Marek Safar <marek.safar@seznam.cz>
6018 * class.cs (Method.Define): Issue a warning when generic method looks like
6020 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
6023 2006-08-09 Marek Safar <marek.safar@seznam.cz>
6025 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
6027 * decl.cs (MemberCache.FindMembers): When container is interface we need to
6028 search all base interfaces as a member can be ambiguous.
6029 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
6030 Constructor member type filter.
6031 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
6032 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
6033 reporting for returned memberinfos.
6034 * report.cs: Updated.
6035 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
6036 version to work on all runtimes.
6037 (TypeManager.RealMemberLookup): Removed members filtering.
6039 2006-08-08 Raja R Harinath <rharinath@novell.com>
6041 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
6042 (PropertyExpr.EmitAssign): Likewise.
6043 * expression.cs (Indirection.EmitAssign): Likewise.
6044 (LocalVariableReference.EmitAssign): Likewise.
6045 (ParameterReference.EmitAssign): Likewise.
6046 (Invocation.EmitArguments): Likewise.
6047 (ArrayAccess.EmitAssign): Likewise.
6048 (IndexerAccess.EmitAssign): Likewise.
6049 (This.EmitAssign): Likewise.
6050 (ConditionalLogicalOperator.Emit): Likewise.
6053 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
6054 instead of ArrayList. If the hashtable has a LocalBuilder, don't
6055 leave it in after returning it.
6056 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
6058 2006-08-06 Marek Safar <marek.safar@seznam.cz>
6060 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
6063 2006-08-03 Raja R Harinath <rharinath@novell.com>
6065 Fix cs0146-3.cs and cs0146-4.cs.
6066 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
6067 enclosing types don't depend on the current type.
6069 2006-08-02 Raja R Harinath <rharinath@novell.com>
6072 * class.cs (TypeContainer.DoDefineMembers): Use
6073 FindBaseMemberWithSameName on Parent, since we're interested in
6074 whether we hide inherited members or not.
6075 (FindBaseMemberWithSameName): Make slightly more robust.
6077 Fix the non-generic testcase from #77396
6078 * decl.cs (DeclSpace.DeclContainer): Remove override.
6080 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
6081 declspaces for doppelgangers too.
6082 (UsingEntry): Implement IResolveContext.
6083 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
6084 'this' as the resolve context.
6085 (LocalAliasEntry): Likewise.
6087 Implement parts of #77403
6088 * roottypes.cs (RootDeclSpace): New. Used to represent the
6089 toplevel declaration space. Each namespace declaration introduces
6090 a "partial" root declaretion space.
6091 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
6092 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
6093 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
6094 from 'current_namespace.SlaveDeclSpace'.
6095 (namespace_declaration): Likewise.
6096 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
6097 check. It can't happen now.
6098 * decl.cs (DeclSpace.LookupType): Likewise.
6099 * driver.cs (MainDriver): Sanity check.
6101 2006-08-01 Raja R Harinath <rharinath@novell.com>
6103 * decl.cs (DeclSpace.FindNestedType): Remove.
6104 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
6105 LookupTypeContainer to get the container of the nested type.
6106 * class.cs (TypeContainer.FindNestedType): Make non-override.
6108 2006-07-31 Raja R Harinath <rharinath@novell.com>
6110 * decl.cs (DeclSpace.PartialContainer): Move field from ...
6111 * class.cs (TypeContainer.PartialContainer): ... here.
6112 (TypeContainer.AddBasesForPart): New helper.
6113 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
6115 * cs-parser.jay (current_class): Convert to DeclSpace.
6116 (struct_declaration, interface_declaration, class_declaration):
6117 Use AddBasesForPart instead of .Bases directly.
6118 * const.cs, iterators.cs: Update to changes.
6120 2006-07-28 Raja R Harinath <rharinath@novell.com>
6122 * class.cs (TypeContainer.AddMemberType): Rename from
6124 (TypeContainer.AddMember): Rename from AddToMemberContainer.
6125 (AddTypeContainer): New. Combine AddClassOrStruct and
6127 (AddPartial): Update. Add 'is_partial' argument.
6128 * roottypes.cs: Update to changes.
6129 * cs-parser.jay (push_current_class): New helper for handling
6130 current_container and current_class.
6131 (struct_declaration, interface_declaration, class_declaration):
6134 2006-07-26 Raja R Harinath <rharinath@novell.com>
6136 * roottypes.cs: Rename from tree.cs.
6138 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
6139 * tree.cs (Tree, ITreeDump): Remove types.
6140 * rootcontext.cs (tree, Tree): Remove fields.
6141 (root, ToplevelTypes): New.
6142 * *.cs: Update to rename.
6144 * tree.cs (Tree.RecordDecl): Remove.
6145 (RootTypes.AddToTypeContainer): Record the toplevel type in its
6147 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
6149 2006-07-23 Raja R Harinath <harinath@gmail.com>
6151 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
6152 DoFlowAnalysis and OmitStructFlowAnalysis here.
6153 (ec.With): Rename from WithUnsafe and generalize.
6154 (ec.WithCheckState): Remove. All users can be handled by 'With'.
6155 (ec.WithFlowAnalyis): New.
6156 * ecore.cs, expression.cs, statement.cs: Update.
6158 2006-07-22 Raja R Harinath <harinath@gmail.com>
6160 * statement.cs (Block.ResolveMeta): Simplify slightly.
6162 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
6163 multiple boolean fields. Convert InUnsafe, constant_check_state,
6164 check_state to flags.
6165 (CheckState, ConstantCheckState): Update.
6166 (InUnsafe): New read-only property.
6167 (FlagsHandle): Rename from CheckStateHandle and convert to handle
6169 (WithUnsafe): New helper similar to WithCheckState.
6170 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
6171 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
6173 2006-07-21 Raja R Harinath <rharinath@novell.com>
6175 Make comparisons use the same IL irrespective of whether they're
6176 in a 'checked' or 'unchecked' context: one of the issues in #78899
6177 * codegen.cs (EmitContext.CheckState): Make read-only property.
6178 (EmitContext.ConstantCheckState): Likewise.
6179 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
6180 helper that implement a save/restore stack for CheckState
6181 values. This is the only way to change check-state.
6182 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
6183 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
6184 (CheckedExpr.EmitBranchable): New forwarding method.
6185 (UnCheckedExpr): Likewise.
6186 * statement.cs (Block.ResolveMeta): Use WithCheckState.
6187 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
6188 (Checked.Resolve, checked.DoEmit): Likewise.
6190 2006-07-20 Miguel de Icaza <miguel@novell.com>
6192 * anonymous.cs: Cache the resolved anonymous delegate, and return
6193 this so that the ResolveTopBlock is only triggered once, not
6196 Currently we trigger ResolvetopBlock twice due to a first pass of
6197 argument check compatibility, and a second pass that does the
6200 2006-07-15 Marek Safar <marek.safar@seznam.cz>
6202 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
6204 * rootcontext.cs (Reset): Add helper_classes.
6206 2006-07-15 Marek Safar <marek.safar@seznam.cz>
6209 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
6212 2006-07-13 Miguel de Icaza <miguel@novell.com>
6214 * statement.cs (Lock): Handle expressions of type
6215 TypeManager.null_type specially. Fixes #78770
6217 2006-07-08 Marek Safar <marek.safar@seznam.cz>
6219 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
6222 2006-07-08 Marek Safar <marek.safar@seznam.cz>
6224 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
6225 for accessors as well.
6226 * ecore.cs (EventExpr): Add AccessorTable.
6228 2006-07-01 Marek Safar <marek.safar@seznam.cz>
6231 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
6232 for CS0122 where appropriate.
6233 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
6235 (Filter): Assembly can be null in the case of top level attributes.
6237 2006-06-25 Marek Safar <marek.safar@seznam.cz>
6241 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
6242 is done at global level.
6244 2006-06-24 Marek Safar <marek.safar@seznam.cz>
6246 A fix for #77002, Implemented TypeForwarder support.
6248 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
6249 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
6250 * typemanager.cs (): Add type_forwarder_attr_type.
6252 2006-06-24 Marek Safar <marek.safar@seznam.cz>
6254 * report.cs: Add CS0469 warning.
6256 2006-06-21 Martin Baulig <martin@ximian.com>
6258 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
6259 the `try'-block, so we also report CS0016 etc. there.
6261 2006-06-21 Martin Baulig <martin@ximian.com>
6264 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
6266 2006-06-21 Martin Baulig <martin@ximian.com>
6268 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
6269 also report CS1686 for parameters.
6271 2006-06-21 Martin Baulig <martin@ximian.com>
6273 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
6274 instead of an error if the value is not implicitly convertible to
6275 the switch types; fixes #77964.
6277 2006-06-21 Raja R Harinath <rharinath@novell.com>
6280 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
6281 FieldBuilder is null.
6284 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
6285 'left' and 'right' before error-checking.
6287 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
6289 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
6291 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
6292 (FieldExpr.DoResolve): likewise.
6293 (PropertyExpr.InstanceResolve): likewise.
6294 (EventExpr.InstanceResolve): likewise.
6296 2006-06-04 Marek Safar <marek.safar@seznam.cz>
6298 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
6299 attribute applicable tests for attribute argument.
6301 2006-06-02 Raja R Harinath <rharinath@novell.com>
6304 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
6305 (Binary.OverloadResolve_PredefinedIntegral): New.
6306 (Binary.OverloadResolve_PredefinedFloating): New.
6307 (Binary.OverloadResolve_PredefinedString): New.
6308 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
6309 Follow the standard more closely, and treat numeric promotions in
6310 terms of overload resolution.
6311 (Binary.CheckShiftArguments): Simplify.
6313 2006-06-01 Raja R Harinath <rharinath@novell.com>
6315 * flowanalysis.cs (MyBitVector): Simplify representation.
6316 (MyBitVector.Clone): Avoid allocating BitArray.
6317 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
6318 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
6319 (*): Update. Change all references to MyBitVector.And and
6320 MyBitVector.Or to &= and |=.
6322 2006-05-29 Raja R Harinath <rharinath@novell.com>
6325 * cs-parser.jay (formal_parameter_list): Extend the pattern below
6326 to param arguments too.
6328 2006-05-26 Miguel de Icaza <miguel@novell.com>
6330 * cs-parser.jay: Catch another parsing form for arglist being
6331 followed by other arguments. Fixes #78313.
6333 2006-05-24 Raja R Harinath <rharinath@novell.com>
6335 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
6336 checking of out parameters to ...
6337 (FlowBranchingToplevel.Merge): ... here.
6338 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
6339 set, propagate the origin upward, and only complain if there was
6341 (FlowBranchingException.AddContinueOrigin): Likewise.
6342 (FlowBranchingException.AddReturnOrigin): Likewise.
6343 (FlowBranchingException.AddGotoOrigin): Likewise.
6345 2006-05-23 Raja R Harinath <rharinath@novell.com>
6347 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
6348 unreachable, skip it.
6349 (FlowBranchingException.Merge): Always propagate jumps, even if
6350 the finally block renders subsequent code unreachable.
6352 2006-05-18 Raja R Harinath <rharinath@novell.com>
6355 * statement.cs (Goto.Resolve): Move responsibility for resolving
6356 'goto' to FlowBranching.AddGotoOrigin.
6357 (Goto.SetResolvedTarget): New. Callback to set the
6358 LabeledStatement that's the target of the goto.
6359 (Goto.DoEmit): Use Leave instead of Br when crossing an
6360 unwind-protect boundary.
6361 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
6362 LookupLabel and adjust to new semantics.
6363 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
6364 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
6365 Goto.SetResolvedTarget to update target.
6366 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
6367 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
6368 AddBreakOrigin & co. Delay propagation until ...
6369 (FlowBranchingException.Merge): ... this.
6371 * statement.cs (Block.Resolve): Always depend on flow-branching to
6372 determine unreachability. Kill workaround that originally emitted
6373 only one statement after an "unreachable" label (see infloop in
6376 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
6377 This is still "wrong", but anything better would probably need a
6378 multi-pass algorithm.
6379 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
6380 usage vector. Force current usage vector to be reachable, to
6381 optimistically signify backward jumps.
6382 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
6384 (FlowBranchingLabeled.Merge): New. If no backward jump was
6385 detected, return the original salted-away usage vector instead,
6386 updated with appropriate changes. Print unreachable warning if
6388 * statement.cs (Block.Resolve): Don't print unreachable warning on
6389 a labeled statement.
6391 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
6393 * driver.cs: Pass filename without path to AssemblyBuilder's
6394 AddResourceFile. Fixes bug #78407.
6396 2006-05-17 Raja R Harinath <rharinath@novell.com>
6398 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
6399 * flowanalysis.cs (FlowBranchingLabeled): ... here.
6400 (FlowBranching.MergeChild): Overwrite
6401 reachability information from Labeled branchings too.
6403 2006-05-16 Raja R Harinath <rharinath@novell.com>
6405 * statement.cs (Goto.Resolve): Merge jump origins here ...
6406 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
6408 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
6409 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
6410 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
6411 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
6413 * statement.cs (Goto.Resolve): ... not here.
6414 (Goto.Emit): Remove CS1632 check.
6416 2006-05-14 Marek Safar <marek.safar@seznam.cz>
6418 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
6421 2006-05-11 Raja R Harinath <rharinath@novell.com>
6423 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
6424 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
6425 (FlowBranchingException.Label): Likewise.
6427 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
6429 (MyBitVector.Or): Use it to avoid losing information (Count).
6430 (FlowBranching.MergeOrigins): Likewise.
6432 * flowanalysis.cs (UsageVector.IsDirty): Remove.
6433 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
6434 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
6435 (UsageVector.ToString): Simplify.
6436 (UsageVector.MergeSiblings): Move here from ...
6437 (FlowBranching.Merge): ... here.
6438 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
6441 2006-05-10 Raja R Harinath <rharinath@novell.com>
6443 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
6444 null bitvector is treated as all-true.
6446 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
6447 (MyBitVector): Rationalize invariants. 'vector != null' implies
6448 that we have our own copy of the bitvector. Otherwise,
6449 'InheritsFrom == null' implies all inherited bits are true.
6451 2006-05-09 Marek Safar <marek.safar@seznam.cz>
6453 * statement.cs (LocalInfo): Add IsConstant.
6454 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
6455 local variable for constants.
6457 2006-05-09 Raja R Harinath <rharinath@novell.com>
6459 * flowanalysis.cs (MyBitVector.Empty): New.
6460 (MyBitVector): Don't allow InheritedFrom to be null.
6461 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
6462 (UsageVector, FlowBranching): Update to changes.
6464 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
6465 recursion. The 'Parent == null' condition isn't sufficient for
6467 (FlowBranching.AddBreakOrigin): Likewise.
6468 (FlowBranching.AddContinueOrigin): Likewise.
6469 (FlowBranching.AddReturnOrigin): Likewise.
6470 (FlowBranching.StealFinallyClauses): Likewise.
6471 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
6472 (FlowBranching.CheckOutParameters): Likewise.
6473 (FlowBranchingToplevel): Terminate all the above recursions here.
6474 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
6475 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
6477 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
6479 (FlowBranchingToplevel): New. Empty for now.
6480 (FlowBranching.MergeTopBlock): Update.
6481 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
6482 branching for the anonymous delegate.
6483 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
6485 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
6486 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
6487 information at the start of the merge. Reorganize.
6489 2006-05-07 Marek Safar <marek.safar@seznam.cz>
6491 * class.cs (MethodData.Define): Method cannot implement interface accessor.
6493 2006-05-07 Marek Safar <marek.safar@seznam.cz>
6495 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
6496 to newly introduced ctor.
6498 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
6499 message to one place.
6500 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
6503 2006-05-07 Marek Safar <marek.safar@seznam.cz>
6505 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
6507 * ecore.cs (Expression.ResolveAsConstant): Updated.
6509 * statement.cs (ResolveMeta): Updated.
6511 2006-05-06 Marek Safar <marek.safar@seznam.cz>
6513 * cs-parser.jay: __arglist cannot be used in initializer.
6515 2006-05-06 Marek Safar <marek.safar@seznam.cz>
6518 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
6521 2006-05-05 Raja R Harinath <rharinath@novell.com>
6523 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
6524 (LabeledStatement): Add 'name' parameter.
6525 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
6526 (Block.AddLabel): Update to changes.
6527 * cs-parser.jay (labeled_statement): Likewise.
6529 * flowanalysis.cs (BranchingType.Labeled): New.
6530 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
6531 (FlowBranchingLabeled): New. Does nothing for now, but will
6532 eventually handle 'goto' flows.
6533 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
6534 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
6535 that's terminated ...
6536 (Block.Resolve): ... here.
6538 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
6539 (UsageVector.MergeFinallyOrigins): Likewise.
6540 (FlowBranching.InTryOrCatch): Likewise.
6541 (FlowBranching.AddFinallyVector): Likewise.
6542 (FlowBranchingException): Update to changes.
6545 * statement.cs (Return.Resolve): Move error checking to ...
6546 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
6547 (FlowBranchingException): Handle return origins like break and
6549 (FlowBranching.UsageVector.CheckOutParameters): Remove.
6551 2006-05-04 Marek Safar <marek.safar@seznam.cz>
6554 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
6557 2006-05-04 Marek Safar <marek.safar@seznam.cz>
6560 * class.cs (MethodData.Define): Do public accessor check only when method
6561 implements an interface.
6563 2006-05-04 Raja R Harinath <rharinath@novell.com>
6565 Remove special handling of 'break'
6566 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
6567 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
6568 (UsageVector.Break): Remove.
6569 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
6571 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
6573 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
6574 UsageVector.Breaks (). Don't set NeedsReturnLabel.
6576 2006-05-03 Marek Safar <marek.safar@seznam.cz>
6579 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
6580 be the interface member.
6582 2006-05-03 Marek Safar <marek.safar@seznam.cz>
6585 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
6586 for emitting small (int) values.
6588 2006-05-03 Raja R Harinath <rharinath@novell.com>
6591 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
6592 control-flow passes through the 'finally' after merging-in all the
6593 control-flows from 'try' and the 'catch' clauses.
6595 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
6596 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
6597 always true at the only non-recursive entry point.
6598 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
6599 FlowBranchingBreakable.
6600 (FlowBranchingLoop): Remove.
6601 * statement.cs (Return.DoResolve): Update to changes.
6604 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
6605 (FlowBranching.CreateBranching): Handle it: create a
6606 FlowBranchingContinuable.
6607 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
6608 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
6609 except that it handles the 'continue' command.
6610 (FlowBranching.UsageVector.MergeOrigins): Rename from
6612 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
6613 except that it overrides AddContinueOrigin.
6614 (FlowBranchingException): Override AddContinueOrigin, similar to
6616 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
6617 Create a new branching around the embedded statement.
6618 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
6619 control flow after the embedded statement.
6620 (Continue.Resolve): Move all error checking to AddContinueOrigin.
6622 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
6623 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
6624 FlowBranchingBreakable.
6625 (FlowBranchingSwitch): Remove.
6628 * statement.cs (Break.Resolve): Simplify. Move responsibility for
6629 error reporting to ...
6630 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
6631 Rename from 'AddBreakVector'. Add new location argument. Return
6632 a bool indicating whether the 'break' crosses an unwind-protect.
6633 (FlowBranchingException.AddBreakOrigin): Add.
6634 (FlowBranchingException.Merge): Propagate 'break's to surrounding
6635 flowbranching after updating with the effects of the 'finally'
6637 (FlowBranchingBreakable): New common base class for
6638 FlowBranchingLoop and FlowBranchingSwitch.
6640 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
6642 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
6644 2006-05-02 Raja R Harinath <rharinath@novell.com>
6646 * statement.cs (Do.Resolve): If the loop is infinite, set the
6648 (While.Resolve, For.Resolve): Set a barrier after the embedded
6649 statement. There's no direct control flow that goes from the end
6650 of the embedded statement to the end of the loop.
6651 * flowanalysis.cs (FlowBranching.Infinite): Remove.
6652 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
6653 above ensure that the reachability is correctly computed.
6655 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
6656 (UsageVector.MergeBreakOrigins): If the current path is
6657 unreachable, treat it as if all parameters/locals are initialized.
6658 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
6659 infinite loops before merging-in break origins.
6661 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
6662 (Reachability.Reachable): Split part into ...
6663 (Reachability.Unreachable): ... this. Simplify.
6664 (Reachability.IsUnreachable): Use 'Unreachable' instead.
6666 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
6667 (Reachability.SetThrowsSometimes): Likewise.
6668 (FlowBranchingBlock.MergeTopBlock): Don't compare against
6669 TriState.Always, use corresponding property.
6670 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
6671 (Block.Resolve): Likewise. Remove some redundant checks.
6673 2006-05-02 Raja R Harinath <harinath@gmail.com>
6675 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
6676 (Reachability.Meet): Don't bother checking AlwaysThrows --
6677 barrier is always set.
6678 (FlowBranchingBlock.Merge): Likewise.
6680 2006-05-01 Raja R Harinath <harinath@gmail.com>
6682 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
6683 checks for unreachable.
6685 2006-05-01 Marek Safar <marek.safar@seznam.cz>
6688 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
6690 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
6691 whether field is really assigned.
6693 2006-04-30 Raja R Harinath <harinath@gmail.com>
6695 * flowanalysis.cs (Reachability): Make 4-argument constructor
6697 (Reachability.Meet): Rename from 'And'. Remove static variant.
6698 (Reachability.Always): Rename from the highly misleading
6699 'Reachability.Never'.
6700 (FlowBranching.Merge): Update to changes. Mark an impossible
6701 situation with a 'throw'.
6702 (*): Update to changes.
6704 2006-04-29 Raja R Harinath <harinath@gmail.com>
6706 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
6708 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
6709 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
6710 (*): Update to changes.
6711 * statement.cs: Update to changes.
6713 2006-04-28 Marek Safar <marek.safar@seznam.cz>
6716 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
6718 2006-04-28 Raja R Harinath <harinath@gmail.com>
6720 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
6723 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
6724 argument to two arguments: an usage-vector and a bool. Move call
6725 to FlowBranching.Merge () ...
6726 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
6728 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
6729 handling of loop and switch reachability to ...
6730 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
6732 2006-04-27 Raja R Harinath <harinath@gmail.com>
6734 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
6735 handling to FlowBranchingLoop.InLoop.
6736 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
6738 2006-04-26 Marek Safar <marek.safar@seznam.cz>
6741 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
6742 anonymous method is allowed from AnonymousContainer here.
6744 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
6746 2006-04-24 Raja R Harinath <rharinath@novell.com>
6749 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
6751 2006-04-23 Marek Safar <marek.safar@seznam.cz>
6754 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
6755 (DoubleConstant.Reduce): Ditto.
6757 2006-04-23 Raja R Harinath <rharinath@novell.com>
6759 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
6760 Remove 'lvalue_right_side' argument. Move parts to ...
6761 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
6762 (LocalVariable.DoResolveLValue): ... these.
6764 2006-04-21 Raja R Harinath <rharinath@novell.com>
6767 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
6768 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
6769 (LocalVariableReference.DoResolveBase): Use it to implement new
6771 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
6772 (Argument.Resolve): Simplify. Move CS1510 check ...
6773 * ecore.cs (Expression.ResolveLValue): ... here.
6774 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
6775 (PropertyExpr.DoResolveLValue): Likewise.
6776 (FieldExpr.Report_AssignToReadonly): Likewise.
6777 (FieldExpr.DoResolve): Add 'out_access' argument. Use
6778 LValueMemberAccess or LValueMemberOutAccess on instance depending
6780 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
6781 DoResolve as appropriate.
6783 2006-04-20 Raja R Harinath <rharinath@novell.com>
6786 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
6787 implicit conversions on 'out' and 'ref' arguments.
6789 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
6790 improve clarity. Remove dead code.
6793 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
6794 (Catch.Resolve): Resolve VarBlock if it exists.
6796 2006-04-19 Miguel de Icaza <miguel@novell.com>
6798 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
6799 twice, this was some residual code, the enumerator was emitted
6800 properly in the two branche of if later.
6802 2006-04-19 Raja R Harinath <rharinath@novell.com>
6804 * expression.cs (Cast.ResolveLValue): Remove. The result of a
6805 cast is never an lvalue.
6806 (Cast.DoResolve, Cast.ResolveRest): Combine.
6807 (Argument.Emit): Simplify slightly. Move 'Expr is
6808 IMemoryLocation' check ...
6809 (Argument.Resolve): ... here.
6810 (Argument.Error_LValueRequired): Remove. Inline into only user.
6812 Simplifications. Fix cs0191-2.cs
6813 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
6814 CS1649 and CS1651 to ...
6815 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
6816 the actual selection of the error code and message to a lookup
6817 table. Add a dummy return value to simplify callsites.
6818 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
6819 readonly fields of other instances of the same type. Move CS0197
6821 * expression.cs (Argument.Resolve): ... here. Simplify code.
6822 Ensure that ec.InRefOutArgumentResolving is only set during LValue
6823 resolution of an out or ref argument. The code simplification
6824 above uses this invariant.
6826 2006-04-18 Raja R Harinath <rharinath@novell.com>
6828 Possibly fix #77752. Fix cs1690-[4-7].cs.
6829 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
6830 CheckMarshallByRefAccess. Drop parameter.
6831 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
6833 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
6835 * report.cs (AllWarnings): Add CS1690.
6836 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
6838 (LocalVariableReference.DoResolveBase): Update.
6840 2006-04-09 Marek Safar <marek.safar@seznam.cz>
6842 * class.cs (MethodOrOperator): Moved common parts from method class.
6843 detect obsolete attributes.
6844 (Method.Define): Simplified as it reuses code from base.
6845 (Constructor.ValidAttributeTargets): Fixed issue found during
6847 (Destructor.ValidAttributeTargets): Fixed issue found during
6849 (Operator): Finished refactoring set off by #78020. Operator class is now
6850 ordinary method class.
6852 * anonymous.cs: Updated.
6854 * decl.cs (DeclSpace): Add IsGeneric
6856 2006-04-09 Marek Safar <marek.safar@seznam.cz>
6858 * class.cs (Constructor.Emit): Don't emit the attributes twice.
6860 2006-04-09 Marek Safar <marek.safar@seznam.cz>
6862 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
6863 detect obsolete attributes.
6864 (Method.CreateEmitContext): Moved to MethodOrOperator.
6866 2006-04-09 Marek Safar <marek.safar@seznam.cz>
6869 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
6870 customized exception to make crash detection easier.
6871 (MethodOrOperator): Started to work on new base class for methods and
6873 (Method): Derives from MethodOrOperator.
6874 (Constructor.Emit): Emits its own attributes.
6875 (AbstractPropertyEventMethod.Emit): Ditto.
6876 (Operator): Derives from MethodOrOperator, will refactor fully in extra
6878 (Operator.Emit): It's temporary more tricky than should be.
6880 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
6882 * report.cs (InternalErrorException): Add ctor with inner exception.
6884 2006-04-08 Marek Safar <marek.safar@seznam.cz>
6887 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
6890 2006-04-07 Marek Safar <marek.safar@seznam.cz>
6893 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
6896 2006-04-06 Marek Safar <marek.safar@seznam.cz>
6898 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
6899 attribute is present and Guid not.
6900 (Interface.ApplyAttributeBuilder): Ditto.
6902 * attribute.cs: Add error message.
6904 2006-04-06 Marek Safar <marek.safar@seznam.cz>
6908 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
6909 sources (it's composite) so hold them in extra array as they are used in
6910 Emit phase only. It worked in the previous versions by mistake.
6911 (Attribute.Emit): Emit attribute for more owners when exist.
6913 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
6914 it has now different behaviour.
6916 2006-04-04 Marek Safar <marek.safar@seznam.cz>
6918 * constant.cs (Constant.IsDefaultInitializer): New method.
6920 * class.cs: Updated.
6922 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
6923 re-initialize default values. It saves KBs almost for every assembly.
6924 Thanks Zoltan for the idea.
6925 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
6926 (ArrayCreation.DoResolve): Resolve only once.
6927 (ArrayCreation.Emit): Emit static initializer only when it is faster.
6928 (ArrayCreation.GetAttributableValue): Cope with optimized values.
6930 2006-04-03 Zoltan Varga <vargaz@gmail.com>
6932 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
6935 2006-04-01 Marek Safar <marek.safar@seznam.cz>
6937 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
6938 in an embedded statement too.
6940 2006-04-01 Raja R Harinath <rharinath@novell.com>
6943 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
6945 2006-04-01 Marek Safar <marek.safar@seznam.cz>
6949 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
6952 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
6954 2006-03-31 Marek Safar <marek.safar@seznam.cz>
6956 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
6959 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
6960 LocalTemporary change.
6962 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
6964 (ClassOrStruct.DefineFieldInitializers): Implemented static field
6965 initializers optimization.
6966 (ClassOrStruct.TypeAttr): Moved from modifiers.
6967 (Constructor.CheckBase): Don't crash when static ctor has parameters.
6968 (FieldBase.ResolveInitializer): Resolves initializer.
6969 (FieldBase.HasDefaultInitializer): New property.
6971 * cs-parser.jay: Removed message.
6973 * expression.cs (CompilerGeneratedThis): New specialization.
6975 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
6977 2006-03-28 Marek Safar <marek.safar@seznam.cz>
6979 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
6981 2006-03-27 Marek Safar <marek.safar@seznam.cz>
6983 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
6984 be now EnumConstants only.
6986 2006-03-27 Marek Safar <marek.safar@seznam.cz>
6988 * attribute.cs, driver.cs: Reset more caches.
6990 2006-03-26 Marek Safar <marek.safar@seznam.cz>
6992 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
6994 2006-03-26 Marek Safar <marek.safar@seznam.cz>
6996 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
6997 for easier reuse. Updated all overrides.
6998 (IntegralConstant): New base class for all integral constants.
6999 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
7000 of the constant range, report custom error.
7001 (UIntConstant.Reduce): Fixed uint conversion.
7003 * ecore.cs, literal.cs: Reduce updates.
7005 2006-03-26 Marek Safar <marek.safar@seznam.cz>
7009 * class.cs (Constructor.Define): Removed extra if for default ctors.
7010 A patch from Atsushi Enomoto.
7012 2006-03-26 Marek Safar <marek.safar@seznam.cz>
7014 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
7015 GetAttributableValue.
7017 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
7020 * convert.cs (ImplicitConversionRequired): Error message moved to
7023 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
7024 automatic implicit conversion of an output value.
7025 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
7027 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
7029 (TypeOf.GetAttributableValue): Add extra handling for object type.
7031 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
7032 special error message.
7034 2006-03-25 Marek Safar <marek.safar@seznam.cz>
7036 * class.cs (Constructor.Emit): Don't crash when struct ctor is
7038 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
7039 compatible with MS runtime.
7041 2006-03-23 Marek Safar <marek.safar@seznam.cz>
7043 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
7044 attribute arguments here.
7046 * class.cs (Indexer.Define): The check was moved to attribute class.
7048 2006-03-22 Marek Safar <marek.safar@seznam.cz>
7050 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
7051 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
7054 2006-03-22 Raja R Harinath <rharinath@novell.com>
7056 Support ParameterDefaultValueAttribute in gmcs. Also applied to
7057 mcs to keep code differences small.
7058 * attribute.cs (Attribute.GetParameterDefaultValue): New.
7059 * typemanager.cs (parameter_default_value_attribute_type): New.
7060 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
7063 2006-03-21 Marek Safar <marek.safar@seznam.cz>
7065 * expression.cs (StringConcat.Append): Reverted back to no warning state.
7067 2006-03-21 Marek Safar <marek.safar@seznam.cz>
7069 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
7071 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
7074 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
7076 * doc-bootstrap.cs : fix build.
7078 2006-03-20 Marek Safar <marek.safar@seznam.cz>
7080 * expression.cs (StringConcat.Append): Issue a warning when empty string
7083 2006-03-20 Marek Safar <marek.safar@seznam.cz>
7085 * assign.cs (CompoundAssign.ResolveSource): Removed.
7087 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
7090 * class.cs (TypeContainer.FindMethods): Removed.
7091 (TypeContainer.CheckMemberUsage): Made static.
7093 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
7095 * constant.cs (CheckRange): Removed unused type argument.
7096 (CheckUnsigned): Removed unused type argument.
7098 * cs-parser.jay: Updated after MemberAccess clean up.
7099 Uses Length for empty string test.
7101 * cs-tokenizer.cs: Uses Length for empty string test.
7102 (IsCastToken): Made static.
7103 (is_hex): Made static.
7104 (real_type_suffix): Made static.
7106 * decl.cs (SetupCache): Made static.
7107 (OnGenerateDocComment): Removed unused ds argument.
7109 * delegate.cs (VerifyDelegate): Removed unused argument.
7111 * doc.cs: Uses Length for empty string test.
7113 * driver.cs: Uses Length for empty string test.
7115 * enum.cs (IsValidEnumType): Made static
7117 * expression.cs (EnumLiftUp): Removed unused argument.
7118 (ResolveMethodGroup): Ditto.
7119 (BetterConversion): Ditto.
7120 (GetVarargsTypes): Ditto.
7121 (UpdateIndices): Ditto.
7122 (ValidateInitializers): Ditto.
7123 (MemberAccess.ctor): Ditto.
7124 (GetIndexersForType): Ditto.
7126 * flowanalysis.cs: (MergeFinally): Removed unused argument.
7128 * iterators.cs: Updated after MemberAccess clean up.
7130 * location.cs: Uses Length for empty string test.
7132 * namespace.cs: Uses Length for empty string test.
7134 * report.cs (CheckWarningCode): Made static.
7136 * statement.cs (LabeledStatement): Removed unused argument.
7138 * typemanager.cs (FilterNone): Removed.
7140 2006-03-18 Marek Safar <marek.safar@seznam.cz>
7142 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
7145 * class.cs: Updated.
7147 2006-03-18 Marek Safar <marek.safar@seznam.cz>
7149 * cs-parser.jay.cs: __arglist is not allowed for delegates.
7151 2006-03-18 Marek Safar <marek.safar@seznam.cz>
7155 * expression.cs (VerifyArgumentsCompat): Reverted to double error
7156 reporting, it's more tricky than I thought.
7158 2006-03-18 Marek Safar <marek.safar@seznam.cz>
7162 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
7164 (AnonymousMethod.ImplicitStandardConversionExists): New method.
7165 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
7166 Add more error reporting; Fixed issue with params.
7168 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
7170 * cs-parser.jay: AnonymousMethod requires host container.
7172 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
7174 2006-03-18 Raja R Harinath <harinath@gmail.com>
7176 * class.cs: Change 'TypeContainer ds' constructor argument to
7177 'DeclSpace parent'. Some classes were missed below due to
7178 different naming convention.
7180 * class.cs (MemberCore.Parent): Delete. This makes the
7181 ParentContainer changes below enforceable by the compiler.
7183 Treat pointers to enclosing declaration space as 'DeclSpace', not
7185 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
7186 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
7188 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
7190 (Block.AddThisVariable): Likewise.
7191 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
7192 (AbstractPropertyEventMethod.Emit): Likewise.
7193 (AbstractPropertyEventMethod.EmitMethod): Likewise.
7194 (GetMethod.Define, SetMethod.Define): Likewise.
7195 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
7196 (DelegateMethod.EmitMethod): Likewise.
7198 Fix regression test-partial-13.cs.
7199 Rationalize use of PartialContainer. Ensure that the partial
7200 class semantics can be tied to type-correctness, i.e., any
7201 violation will cause a compile error.
7202 * class.cs, const.cs: Access all fields that belong to class
7203 TypeContainer via ParentContainer. Arguments of EmitContexts and
7204 Resolve()-like functions still use 'Parent'.
7206 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
7207 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
7208 (PropertyMethod.CheckModifiers): Remove unused argument.
7209 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
7212 2006-03-17 Raja R Harinath <harinath@gmail.com>
7214 Make semantics of PartialContainer simpler.
7215 * decl.cs (DeclSpace.IsPartial): Remove.
7216 * class.cs (TypeContainer.IsPartial): Likewise.
7217 (TypeContainer..ctor): Set PartialContainer to point to self.
7218 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
7219 (TypeContainer.FindNestedType): Likewise.
7220 (MemberCore.ParentContainer): Simplify. Remove deprecation.
7222 2006-03-17 Marek Safar <marek.safar@seznam.cz>
7224 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
7226 2006-03-15 Marek Safar <marek.safar@seznam.cz>
7228 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
7231 2006-03-15 Marek Safar <marek.safar@seznam.cz>
7233 * class.cs (Operator.Define): An error for base conversion was not
7236 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
7238 * iterator.cs : yield break is allowed in try statement which has
7239 catch clauses. Fixed bug #77767.
7241 2006-03-13 Marek Safar <marek.safar@seznam.cz>
7243 A fix for #77593, #77574.
7245 * class.cs (MethodCore.CheckBase): Another if for operator.
7247 2006-03-09 Marek Safar <marek.safar@seznam.cz>
7249 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
7252 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
7253 (DelegateCreation.ImplicitStandardConversionExists): New method for just
7256 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
7259 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
7260 Updated after another emitcontext usage was clean up. It should help us to
7261 synchronize with gmcs easier.
7263 2006-03-04 Marek Safar <marek.safar@seznam.cz>
7267 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
7268 (Event.Define): ditto
7269 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
7271 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
7272 Removed redundant code and set NewSlot for Invoke method too.
7274 * parameter.cs (Parameters.ctor): Add custom, type ctor.
7275 (Parameters.MergeGenerated): New method. Use this method when you merge
7276 compiler generated argument with user arguments.
7278 2006-03-03 Marek Safar <marek.safar@seznam.cz>
7280 * attribute.cs (ResolveAsTypeTerminal): Removed.
7282 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
7283 specialization for predefined types; 30% speed up.
7284 Finally placed obsolete check to right place.
7285 (Expression.ResolveType): Removed.
7287 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
7288 Updated after ResolveType was removed.
7290 * expression.cs (Cast.ctor): Check void cast.
7291 (Binary.ResolveAsTypeTerminal): Is never type.
7292 (Conditional.ResolveAsTypeTerminal): Is never type.
7294 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
7296 2006-03-01 Raja R Harinath <rharinath@novell.com>
7299 * expression.cs (ParameterReference.DoResolveBase): Change return
7301 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
7305 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
7308 * typemanager.cs (GetFullNameSignature): Don't nullref on
7309 protected accessors.
7311 2006-02-27 Marek Safar <marek.safar@seznam.cz>
7313 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
7314 these two separated members to simplify the code.
7315 (Attribute.Resolve): Refactored to use new fields and methods.
7316 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
7317 implemented obsolete attribute checking.
7318 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
7319 implemented obsolete checking again. It look line never ending quest ;-)
7320 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
7322 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
7324 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
7326 *class.cs (Property.Define): Add RegisterProperty call.
7328 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
7329 argument groups (only 2).
7331 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
7332 encoding expression to arguments.
7333 (Expression.ExprClassToResolveFlags): Just turned to property.
7335 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
7336 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
7337 optimized as well as implemented support for zero-length attributes.
7339 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
7340 Add caching of PropertyInfo's.
7342 2006-02-25 Marek Safar <marek.safar@seznam.cz>
7344 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
7345 error multiple times.
7347 2006-02-25 Marek Safar <marek.safar@seznam.cz>
7349 New partial class implementation.
7350 A fix for #77027, #77029, #77403
7352 * attribute.cs (Attributable): Made attributes protected.
7354 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
7355 the replacements of ClassPart and PartialContainer.
7356 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
7357 (TypeContainer.AddInterface): Ditto.
7358 (TypeContainer.AddPartial): The main method for partial classes. It checks
7359 for errors and merges ModFlags and attributes. At the end class is added to
7361 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
7363 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
7364 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
7365 from the rest of partial classes.
7366 (TypeContainer.GetClassBases): Simplified.
7367 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
7369 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
7370 (TypeContainer.HasExplicitLayout): Uses Flags now.
7371 (PartialContainer): Removed.
7372 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
7373 (StaticClass): Was merged with Class.
7374 (Class.GetClassBases): class and static class bases are verified here.
7375 (Class.TypeAttr): Added static attributes when class is static.
7376 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
7377 (MemberBase): In some cases we need to call parent container for partial
7378 class. It should be eliminated but it's not easy now.
7380 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
7382 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
7383 partial classed to accumulate class comments.
7384 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
7386 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
7388 * driver.cs (MainDriver): Tree.GetDecl was removed.
7390 * modifiers.cs (Modifiers): Add partial modifier.
7392 * tree.cs (Tree.decl): Removed.
7393 (RootTypes): Started to use this class more often for root types
7396 2006-02-22 Marek Safar <marek.safar@seznam.cz>
7400 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
7401 external interface does not have an attribute.
7403 2006-02-22 Marek Safar <marek.safar@seznam.cz>
7405 Another prerequisites for new partial classs implementation.
7407 * attribute.cs (Attribute.Equal): Implemented.
7408 (Attribute.Emit): Changed as attributes can be applied more than twice.
7409 (Attributes.Emit): Check for duplicate attributes here.
7411 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
7412 as a parameter, clean-up.
7414 2006-02-11 Marek Safar <marek.safar@seznam.cz>
7418 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
7419 contains obsolete attribute check which can in some cases look for base
7420 type of current class which is not initialized yet.
7421 (TypeContainer.BaseType): Replacement of ptype.
7423 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
7425 2006-02-11 Marek Safar <marek.safar@seznam.cz>
7427 First of prerequisites for new partial classs implemention.
7429 * attribute.cs (Attributable): Extended by ResolveContext;
7430 Attributes finally have correct context for resolving in all cases.
7431 (AttachTo): Attribute owner is assigned here.
7433 * codegen.cs (IResolveContext): Introduce new interface to hold
7434 all information needed in resolving phase.
7435 (EmitContext): Implements IResolveContext; more clean-up needed here.
7437 * decl.cs (MemberCore): Implemented IResolveContext.
7439 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
7440 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
7441 parameter.cs, statement.cs, tree.cs, typemanager.cs:
7442 Refactored to use new IResolveContext instead of EmitContext; cleanup
7444 2006-02-06 Miguel de Icaza <miguel@novell.com>
7446 * codegen.cs (EmitScopeInitFromBlock): check here the
7447 capture_context, there is no need to make two calls to the
7450 * anonymous.cs: Add some debugging messages that might help me
7451 track other instances of this problem in the future (the
7452 regression of test 467).
7454 * cs-parser.jay: track the variable block, as we need to initalize
7455 any captured variables declared in this block for the "catch"
7456 portion of the "Try" statement.
7458 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
7459 scope initialization for captured variables.
7461 Also, move the emit for the variables after the block location has
7464 2006-02-06 Marek Safar <marek.safar@seznam.cz>
7466 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
7468 2006-02-02 Miguel de Icaza <miguel@novell.com>
7470 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
7471 commit yesterday, the initialization for the roots is necessary.
7472 What is not necessary is the scope activation.
7474 2006-02-02 Raja R Harinath <rharinath@novell.com>
7476 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
7477 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
7479 (Argument.Resolve): Remove CS0206 checks.
7481 2006-02-01 Miguel de Icaza <miguel@novell.com>
7483 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
7484 scopes for all the roots, the scopes will now be emitted when the
7485 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
7487 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
7488 code. This reduces a lot of existing cruft.
7490 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
7491 that the ScopeInfo is generated as we enter the scope, not at the
7492 time of use, which is what we used to do before.
7494 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
7495 every time a Block is about to be emitted if we have a
7498 2006-02-01 Raja R Harinath <rharinath@novell.com>
7500 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
7502 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
7504 * typemanager.cs (cons_param_array_attribute): Make private.
7505 (Reset): Set it to null.
7506 (InitCoreHelpers): Don't initialize it.
7507 (ConsParamArrayAttribute): New. Initialize it as needed.
7508 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
7510 2006-01-31 Miguel de Icaza <miguel@novell.com>
7512 * expression.cs: There might be errors reported during the
7513 selection of applicable methods. If there are errors, do not
7514 continue execution as it will lead the compiler to crash.
7516 2006-01-30 Miguel de Icaza <miguel@novell.com>
7518 * expression.cs: Member access is not allowed on anonymous
7519 methods. Fixes #77402.
7521 2006-01-30 Raja R Harinath <rharinath@novell.com>
7524 * cs-parser.jay (VariableDeclaration): Don't set
7525 current_array_type to null.
7526 (field_declaration, event_declaration, declaration_statement):
7527 Set it to null here.
7529 2006-01-28 Raja R Harinath <harinath@gmail.com>
7531 * typemanager.cs (GenericParameterPosition): New.
7534 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
7536 * doc.cs : To process "include" elements, first we should create
7537 another list than XmlNodeList, because it could result in node
7538 removal, which could result in that the XmlNodeList gives up
7541 (Also made code identical to gmcs again.)
7543 2006-01-25 Miguel de Icaza <miguel@novell.com>
7545 * ecore.cs: Introduce an error report that we were not catching
7546 before, if not silent, we must report the error. Gonzalo ran into
7549 2006-01-23 Miguel de Icaza <miguel@novell.com>
7551 A fix for bug: #76957
7553 * iterators.cs (MoveNextMethod.CreateMethodHost): call
7554 ComputeMethodHost before creating the method, this is a new
7557 * anonymous.cs (AnonymousContainer): Now we track all the scopes
7558 that this method references (RegisterScope). The actual scope
7559 where the method is hosted is computed with the ComputeMethodHost
7560 before we create the method.
7562 Moved the Deepest routine here.
7564 (AnonymousContainer.ComputeMethodHost): New routine used to
7565 compute the proper ScopeInfo that will host the anonymous method.
7567 (ScopeInfo): Deal with multiple roots. The problem was that we
7568 did not have a unique root where all ScopeInfos could be hanged
7569 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
7572 Remove AdjustMethodScope which is now computed at the end. Remove
7573 LinkScope which did a partial link, instead link all ScopeInfos
7574 before code generation from the new "LinkScopes" routine.
7576 Simplify all the Add* routines as they no longer need to maintain
7577 the tree, they just need to record that they are using variables
7580 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
7581 routines to produce the forest of ScopeInfo trees.
7583 * class.cs (TypeContainer.AppendMethod): This is just like
7584 AddMethod, but ensures that an interface implementation method
7585 (IEnumerable.XXX) is not inserted at the beginning of the queue of
7586 methods, but at the end.
7588 We use this functionality to ensure that the generated MoveNext
7589 method in the iterator class is resolved/emitted before the
7590 enumerator methods created.
7592 This is required because the MoveNext method computes the right
7593 ScopeInfo for the method. And the other methods will eventually
7594 need to resolve and fetch information computed from the anonymous
7597 2006-01-21 Raja R Harinath <harinath@gmail.com>
7598 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7601 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
7603 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
7604 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
7606 2006-01-18 Raja R Harinath <rharinath@novell.com>
7608 Fix #76656, cs0231-2.cs.
7609 * cs-parser.jay (formal_parameter_list): Make error case catch
7611 (parenthesized_expression_0): Add CS1026 check.
7612 (invocation_expression): Remove unused { $$ = lexer.Location }.
7614 2006-01-17 Raja R Harinath <rharinath@novell.com>
7617 * cs-parser.jay (statement_expression): Don't list out the
7618 individual statement-expressions. Convert syntax error into
7621 2006-01-16 Raja R Harinath <rharinath@novell.com>
7624 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
7625 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
7626 CheckIntermediateModification.
7627 (FieldExpr.DoResolve): Add new two-argument version that
7628 allows us to resolve the InstanceExpression as an lvalue.
7629 The one-argument variant is now just a wrapper.
7630 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
7631 Resolve the lhs as an lvalue if the it has a value type.
7632 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
7633 from Assign.DoResolve.
7634 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
7635 resolved as an lvalue.
7636 (PropertyExpr.DoResolve): Update.
7637 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
7638 has a value type. Move CS1612 check here from
7639 CheckIntermediateModification.
7640 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
7641 * expression.cs (EmptyExpression.OutAccess): New. Used as the
7642 'right_side' of a ResolveLValue on an 'out' argument.
7643 (EmptyExpression.LValueMemberAccess): New. Used as the
7644 'right_side' of a propagated ResolveLValue on a value type.
7645 (LocalVariableReference.DoResolveBase): Recognize
7646 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
7648 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
7649 EmptyExpression.Null.
7651 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
7653 * typemanager.cs : added IsGenericParameter(). In mcs it always
7655 * doc.cs : for generic parameters, use GenericParameterPosition,
7658 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
7660 * expression.cs: Fix Console.WriteLine ((this = x).foo);
7662 2006-01-12 Miguel de Icaza <miguel@novell.com>
7664 This fixes the problem where we used ldfld instead of ldflda to
7665 load the "THIS" pointer on captured parameters, when THIS is a
7666 value type. See bug #77205.
7668 * iterators.cs (CapturedThisReference.Emit): Pass false to
7669 EmitThis (we do not need the address).
7671 * codegen.cs (EmitThis): it needs to know whether we need the
7672 address of `this' or not. This is used by value types.
7674 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
7675 every other call passes false.
7677 2006-01-12 Raja R Harinath <rharinath@novell.com>
7680 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
7682 * expression.cs (Invocation.OverloadResolve): Update.
7683 (Invocation.DoResolve): Avoid double resolution of invocation.
7685 2006-01-11 Raja R Harinath <rharinath@novell.com>
7688 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
7689 unary negation of floating point types as 0-expr; negation cannot
7690 overflow in floating point types.
7693 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
7694 on operands of 'void' type.
7697 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
7698 and ExclusiveOr for boolean constants too.
7700 2006-01-09 Raja R Harinath <rharinath@novell.com>
7703 * expression.cs (Invocation.OverloadResolve): Replace reflected
7704 override methods with their base virtual methods, rather than
7706 * typemanager.cs (TypeManager.GetOverride): New.
7708 2006-01-05 Jb Evain <jbevain@gmail.com>
7710 * class.cs (Property.Define, Indexer.Define): do not tag the
7711 properties as SpecialName | RTSpecialName.
7713 2006-01-04 Miguel de Icaza <miguel@novell.com>
7715 * class.cs (MethodCore.IsDuplicateImplementation): This method was
7716 doing a low-level comparission of parameter types. It was lacking
7717 a check for __argslist.
7719 2005-12-30 Miguel de Icaza <miguel@novell.com>
7721 * expression.cs (ParameterReference.DoResolveBase): Allow
7722 reference parameters if they are local to this block.
7724 This allows the ref and out parameters of a delegate to be used in
7725 an anonymous method, for example:
7727 delegate void set (out int x);
7729 set s = delegate (out int x){
7733 This is used by functionality introduced late in the C# language.
7735 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
7736 method that take ref and out parameters.
7738 Fixes #77119 which was a late change in the spec.
7740 2005-12-23 Miguel de Icaza <miguel@novell.com>
7742 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
7743 parent if its the same scope. Fixes #77060.
7745 2005-12-21 Miguel de Icaza <miguel@novell.com>
7747 * driver.cs: Report the case of no source files and no -out:
7750 2005-12-20 Raja R Harinath <rharinath@novell.com>
7753 * expression.cs (ComposedCast.GetSignatureForError): Define.
7755 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7759 * namespace.cs (NamespaceEntry): Add extern_aliases as a
7760 ListDictionary, to contain the ExternAliasEntry entries (in
7761 addition to the NamespaceEntry.aliases hashtable). This field is
7762 shared between the original entry and its doppelganger (bodyless
7764 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
7765 extern_aliases field.
7766 (NamespaceEntry.Lookup): Move the IsImplicit check after the
7767 lookup in extern_aliases.
7769 2005-12-16 Raja R Harinath <rharinath@novell.com>
7772 * class.cs (TypeContainer.Mark_HasEquals): New.
7773 (TypeContainer.Mark_HasGetHashCode): New.
7774 (ClassPart): Override them.
7775 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
7778 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
7779 'parent' argument to the base constructor.
7781 Remove all mention of TypeContainer from decl.cs.
7782 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
7783 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
7784 (DeclSpace.DeclSpace): Likewise.
7785 (DeclSpace.DefineMembers): Remove unused argument.
7786 * cs-parser.jay (pop_current_class): Update to changes. Simplify
7787 debugging check -- we don't care if the debug code throws an
7788 InvalidCastException instead of an InternalErrorException.
7789 * class.cs (TypeContainer.DefineMembers): Update to changes.
7790 (TypeContainer.DoDefineMembers): Likewise.
7791 (TypeContainer.GetMethods): Likewise.
7792 (PropertyMember.Define): Likewise.
7793 (MemberBase.Parent): New property that forwards to
7794 MemberCore.Parent, but ensures that we get a TypeContainer.
7795 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
7796 (RootContext.PopulateTypes): Likewise. Remove special case code
7797 for !RootContext.StdLib: DefineMembers is idempotent.
7799 2005-12-14 Miguel de Icaza <miguel@novell.com>
7801 * convert.cs (ExplicitConversionCore): Check the return value from
7802 ExplicitConversionCore which can return null on failure. Fixes #76914
7804 2005-12-13 Marek Safar <marek.safar@seznam.cz>
7806 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
7808 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
7810 * doc.cs : The search for referenced namespace was insufficient to
7811 get global one as it used to do. Fixed bug #76965.
7813 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
7815 * doc.cs : check name in cref in the last phase that whether it is
7818 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
7820 * cs-tokenizer.cs : reverted the latest change: it somehow broke
7823 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
7825 * doc.cs : so it turned out that we cannot skip override check for
7826 interface members. Fixed bug #76954.
7828 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
7830 * cs-tokenizer.cs : fixed bug #75984:
7831 - #warning and #error should not be handled when the source line
7833 - #line is not checked strictly when the source line is disabled.
7834 - #define and #undef is on the other hand checked strictly at any
7837 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
7839 * cs-tokenizer.cs : missing Location (actually, filename) in one of
7842 2005-12-05 Marek Safar <marek.safar@seznam.cz>
7844 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
7846 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
7848 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
7849 (FieldBase.Initializer): Initializer is now optional.
7850 (EventField.Define): Only event field can have initializer.
7852 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
7854 * const.cs (Const): Reuse initializer.
7856 * cs-parser.jay: Updated after FieldBase changes.
7857 Added current_array_type to simplify array initializers.
7859 * ecore.cs (NullCast.IsDefaultValue): Implemented.
7861 * expression.cs, iterators.cs: Updated.
7863 * namespace.cs (NamespaceEntry): Made UsingFound private.
7865 2005-12-05 Marek Safar <marek.safar@seznam.cz>
7867 * parameterCollection.cs: Obsolete, removed.
7868 * parser.cs: Obsolete, removed.
7870 2005-12-05 Marek Safar <marek.safar@seznam.cz>
7873 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
7875 * enum.cs (Enum.Define): Set obsolete context here.
7877 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
7880 - FindDocumentedMember() now expects 1) paramList as null
7881 when "we don't have to check the number of parameters" and
7882 2) Type.EmptyTypes when "there is no arguments".
7883 - Introduced FoundMember struct to hold the exact type which was
7884 used to find the documented member (the above change broke
7885 test-xml-044; it might be better just to use DeclaringType than
7886 what MS does, like this change does, but it depends on usage.)
7888 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
7890 * doc.cs : documented member might be from DeclaringType for nested
7891 types. Fixed bug #76782.
7893 2005-12-03 Ben Maurer <bmaurer@ximian.com>
7895 * anonymous.cs: Have the param code handle leaving copies on the
7896 stack etc. Allows anonymous params to take part in the assignment
7897 code (++, +=, etc). Fixes bug #76550
7899 * expression.cs: Handle the prepare_for_load/leave_copy by passing
7900 it down to the anon code.
7902 * iterators.cs: Use dummy var here
7904 * codegen.cs: Handle new vars
7906 2005-12-01 Marek Safar <marek.safar@seznam.cz>
7909 * class.cs (MethodData.Define): Set proper Obsolete context.
7911 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
7913 (FieldExpr.DoResolve): Ditto.
7915 2005-12-01 Marek Safar <marek.safar@seznam.cz>
7918 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
7919 parent is not obsolete.
7921 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
7923 * doc.cs : (FindDocumentedMember) find parameterless members first
7924 and get CS0419 in the early stage. Fixed first case of bug #76727.
7926 2005-11-30 Marek Safar <marek.safar@seznam.cz>
7929 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
7930 no error was reported.
7932 *expression.cs (Binary.DoResolve): left can be null.
7934 2005-11-22 Marek Safar <marek.safar@seznam.cz>
7937 * class.cs (MethodData.Emit): Parameters should be labeled first.
7939 2005-11-21 Marek Safar <marek.safar@seznam.cz>
7942 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
7944 2005-11-18 Marek Safar <marek.safar@seznam.cz>
7946 * attribute.cs (AreParametersCompliant): Moved to Parameter.
7948 * class.cs (MethodCore): Parameter clean up.
7949 (IMethodData): Added ParameterInfo.
7950 (MethodData): Parameter clean up.
7951 (Indexer.Define): Parameter clean up.
7963 * typemanager.cs: Parameter clean up.
7965 * delegate.cs (Define): Get rid of duplicated code.
7967 * expression.cs (ParameterReference): Removed useless parameters
7969 (Invocation): Ditto.
7971 * parameter.cs (ParamsParameter): New class, params specialization.
7972 (ArglistParameter): Attemp to separate arglist.
7973 (Parameter): Refactored to be reusable and faster.
7974 (Parameter.Modifier): Made understandable.
7975 (Parameters): Changed to be used as a class for `this' assembly
7976 parameters. Refactored to use new specialized classes.
7978 * support.cs (ParameterData): Added Types property.
7979 (InternalParameters): Deleted.
7981 2005-08-20 Martin Baulig <martin@ximian.com>
7983 Merging this patch from GMCS to fix #75867.
7985 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
7986 scope if we don't already have it.
7988 2005-11-17 Martin Baulig <martin@ximian.com>
7991 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
7992 inherit the scope from our parent. Fixes #76653.
7994 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
7996 * doc.cs : the previous patch does not actually fix the bug.
7997 PropertyInfo override check is now implemented and really fixed it.
7998 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
8000 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
8002 * doc.cs : apply "override filter" also to properties.
8005 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
8007 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
8008 no need to check overrides. For classes, omit those results from
8009 interfaces since they must exist in the class. Fixed bug #76726.
8011 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
8013 * typemanager.cs : (GetFullNameSignature) differentiate indexers
8014 with different parameters. Fixed the second problem in #76685.
8016 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
8018 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
8019 get expected 'protected' access in CheckValidFamilyAccess()).
8022 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
8024 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
8025 Fixed bug #76705. CS1569 was incorrectly commented out.
8027 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
8029 * doc.cs : use Invocation.IsOverride() to do real override check.
8030 * expression.cs : made Invocation.IsOverride() internal.
8032 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
8034 * doc.cs : use TypeManager.FindMembers() instead of (possible)
8035 TypeBuilder.FindMembers() and filter overriden base members out.
8038 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
8040 * doc.cs : ref/out parameters are represented as '@' (instead of
8041 '&' in type FullName). Fixed bug #76630 (additionally crefs).
8043 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
8045 * doc.cs : when there was no '.' in cref to methods in doc comment,
8046 then parameters were missing in the output. Fixed bug #76691.
8048 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
8050 * driver.cs : don't output docs when there is an error.
8053 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
8056 Now it should detect indexers. Fixed primary concern in bug #76685.
8057 Fixed CS0419 message to not show the identical member signature in
8060 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
8062 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
8063 instead of Type.FindMembers() since it does not handle events.
8066 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
8068 * codegen.cs: Fixed typo (speficied -> specified).
8070 2005-11-11 Marek Safar <marek.safar@seznam.cz>
8073 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
8075 2005-11-11 Marek Safar <marek.safar@seznam.cz>
8077 * attribute.cs: Changed error message.
8079 * cs-tokenizer.cs: One more check.
8081 2005-11-10 Marek Safar <marek.safar@seznam.cz>
8083 * statement.cs (Block.Resolve): Ignore empty statement.
8085 2005-11-10 Marek Safar <marek.safar@seznam.cz>
8087 * report.cs: Made error/warning methods more strict to avoid
8090 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
8091 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
8092 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
8093 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
8095 2005-11-08 Marek Safar <marek.safar@seznam.cz>
8097 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
8098 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
8100 * class.cs (TypeContainer.IsComImport): New property.
8101 (Constructor.Define): Create proper ctor for ComImport types.
8103 * expression.cs (New.CheckComImport): Fixed.
8105 2005-11-07 Miguel de Icaza <miguel@novell.com>
8107 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
8108 that a parameter has been captured does not mean that we do not
8109 have to do the rest of the processing. This fixes the second part
8110 of #76592. If there was another anonymous method capturing
8111 values in the past, the Scope would never be set for the second
8112 method that captured the same parameter.
8114 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
8115 properly manipulate the stack. Second part of fix for #76592.
8117 * expression.cs (New): Add support for invoking "new" on
8118 interfaces that have been flagged with the ComImport attribute and
8119 the CoClass. Fixes #76637
8121 * statement.cs (Try.DoEmit): When a variable is captured, do not
8122 try to emit the vi.LocalBuilder variable as it has been captured.
8123 Create a temporary variable and store the results on the
8124 FieldBuilder. Fixes #76642
8126 2005-11-07 Marek Safar <marek.safar@seznam.cz>
8128 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
8130 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
8132 * expression.cs (Binary.DoResolve): Added && optimalization.
8134 * typemanager.cs (AddUserType): Removed useless argument.
8136 2005-11-04 Marek Safar <marek.safar@seznam.cz>
8138 * statement.cs (Block.variables): Uses ListDictionary.
8140 2005-11-03 Marek Safar <marek.safar@seznam.cz>
8143 * class.cs (PartialContainer.EmitType): Customized to emit
8144 security attributes.
8145 (ClassPart.ApplyAttributeBuilder): Transform security attribute
8146 for partial classes.
8148 2005-11-03 Marek Safar <marek.safar@seznam.cz>
8151 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
8152 access has to be fixed.
8154 * typemanager.cs (IsUnmanagedType): Wrong common field type.
8156 2005-11-01 Marek Safar <marek.safar@seznam.cz>
8159 * ecore.cs (NullCast.Reduce): Implemented.
8161 * expression.cs (ArrayCreation.CheckIndices): Correcly check
8164 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
8166 (Foreach.Resolve): Catch null properly.
8168 2005-10-29 Marek Safar <marek.safar@seznam.cz>
8170 * cs-tokenizer.cs: Warning text fix.
8172 * driver.cs: AllWarningNumbers exposed on public interface.
8174 * report.cs (): Reviewed warning numbers.
8175 (IsValidWarning): Use binary search.
8177 2005-10-29 Marek Safar <marek.safar@seznam.cz>
8179 * driver.cs: Implemeted resource visibility.
8180 (Resources): New class for code sharing between /res: and
8183 2005-10-28 Marek Safar <marek.safar@seznam.cz>
8186 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
8189 * convert (Convert.ImplicitReferenceConversion): NullCast holds
8192 * ecore.cs (NullCast): Child is contant only.
8194 * literal.cs (NullLiteral.Reduce): null can be converted to any
8197 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
8199 * driver.cs: Use Encoding.Default as default code page instead
8202 2005-10-27 Raja R Harinath <rharinath@novell.com>
8205 * expression.cs (Invocation.Error_InvalidArguments): Handle
8206 __arglist parameters.
8207 (Invocation.VerifyArgumentsCompat): Likewise.
8208 * support.cs (ReflectionParameters.GetSignatureForError): Print
8209 __arglist parameters.
8210 (InternalParamters.GetSignatureForError): Likewise.
8211 * parameter.cs (Parameters.GetSignatureForError): Likewise.
8213 2005-10-26 Marek Safar <marek.safar@seznam.cz>
8215 * attribute.cs (GetPropertyValue): Made public.
8217 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
8219 Add new property WrapNonExceptionThrows to handle 2.0 assembly
8221 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
8224 * driver.cs: Reflect method name change.
8226 * statement.cs (Try.Resolve): Warn when try has both general
8229 * typemanager.cs: runtime_compatibility_attr_type new predefined
8232 2005-10-26 Raja R Harinath <harinath@gmail.com>
8235 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
8236 treat it as an empty parameter list.
8238 2005-10-26 Raja R Harinath <rharinath@novell.com>
8241 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
8242 ResolveAsTypeStep silent.
8243 * statement.cs (Block.AddConstant): Mark block as used.
8244 (Block.ResolveMeta): Avoid piling on error messages
8245 if a constant initializer resolution fails.
8247 2005-10-25 Raja R Harinath <rharinath@novell.com>
8249 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
8251 (NamespaceEntry.VerifyAllUsing): New.
8252 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
8253 behaviour. Delegates actual resolution of alias to ...
8254 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
8255 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
8257 * driver.cs (Driver.MainDriver): Update.
8259 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
8260 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
8262 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
8264 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
8265 RootNamespace.DefineNamespacesForAll.
8267 2005-10-24 Raja R Harinath <harinath@gmail.com>
8269 * typemanager.cs (assemblies, external_aliases, modules)
8270 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
8271 (ComputeNamespaces, GetRootNamespace): Remove extra staging
8272 overhead. Move resposibility ...
8273 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
8274 * driver.cs, attribute.cs, codegen.cs: Update to changes.
8276 2005-10-23 Raja R Harinath <harinath@gmail.com>
8278 * namespace.cs (RootNamespace.all_namespaces): Renamed from
8279 cached_namespaces. Improve usage.
8280 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
8281 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
8282 Move from GlobalRootNamespace and simplify.
8283 (RootNamespace.Global): Make instance variable.
8284 (RootNamespace.RootNamespace): Add "alias name" parameter.
8285 (GlobalRootNamespace): Simplify drastically.
8286 (Namespace.Lookup): Don't use GetNamespace.
8287 * typemanager.cs (GetRootNamespace): Rename from
8288 ComputeNamespaceForAlias.
8289 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
8291 2005-10-23 Marek Safar <marek.safar@seznam.cz>
8293 * anonymous.cs (AnonymousContainer): Don't crash when container
8296 2005-10-23 Marek Safar <marek.safar@seznam.cz>
8298 * expression.cs (Binary.DoResolve): Warn when comparing same
8301 2005-10-23 Marek Safar <marek.safar@seznam.cz>
8304 * expression.cs (Binary.DoResolve): It looks like there are no
8305 convetsion rules in enum context.
8307 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
8309 Add support for extern alias qualifiers.
8310 * typemanager.cs: Move some LookupTypeReflection code
8311 to namespace.cs, to have cleaner code. Added some methods
8312 to help us keep track of the extern aliased references.
8313 * driver.cs: Add suport for extern alias assemblies on command
8314 line and check for their warnings/errors. Also keep track of the
8315 extern aliased assemblies.
8316 * namespace.cs: Move the global functionality of Namespace
8317 to GlobalRootNamespace/RootNamespace. Now the global namespace
8318 is GlobalRootNamespace.Globa. Also the code moved from
8319 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
8320 Finally added LocalAliasEntry (AliasEntry before) and
8321 ExternAliasEntry, to handle alias statements.
8322 * cs-parser.jay: Add support in the grammar for extern alias
8324 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
8325 Update callings to Namespace (now in GlobalRootNamespace).
8327 2005-10-18 Raja R Harinath <rharinath@novell.com>
8330 * class.cs (TypeContainer.DefineType): Move updating of
8331 topological sort earlier in the code.
8332 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
8334 2005-10-18 Marek Safar <marek.safar@seznam.cz>
8337 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
8339 * constant.cs (Constant.TryReduce): Moved from Cast class.
8340 (Reduce): Made little bit more OO and fixed missing conversions.
8342 * ecore.cs (Reduce): Implemented.
8343 (Binary.EnumLiftUp): New method to upgrade values to enum values.
8345 * literal.cs (Reduce): Implemented.
8347 * class.cs: Reverted Miguel's wrong commit.
8349 2005-10-14 Miguel de Icaza <miguel@novell.com>
8351 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
8353 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
8355 * cs-parser.jay, expression.cs : CS0214 was missing error location
8356 for constants. Fixed bug #76404.
8358 2005-10-11 Marek Safar <marek.safar@seznam.cz>
8361 * convert.cs (ExplicitConversionCore): Fixed object->enum
8364 2005-10-10 Raja R Harinath <rharinath@novell.com>
8366 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
8368 (PropertyExpr.EmitCall): Likewise.
8369 * expression.cs (Invocation.EmitArguments): Handle case where
8371 (Invocation.EmitCall): Avoid allocating temporary variable if
8372 there are no arguments.
8374 2005-10-07 Raja R Harinath <rharinath@novell.com>
8377 * convert.cs (ImplicitConversionStandard): Move conversion of
8378 void* to arbitrary pointer types ...
8379 (ExplicitConversionStandard): .. here.
8380 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
8381 error to always print typenames.
8383 2005-10-07 Raja R Harinath <rharinath@novell.com>
8385 * convert.cs (GetConversionOperator): Rename from
8386 GetConversionOperators. Move operator selection code from ...
8387 (UserDefinedConversion): ... here.
8389 2005-10-06 Marek Safar <marek.safar@seznam.cz>
8391 * convert.cs (ExplicitConversionCore): Removed duplicate enum
8394 2005-10-05 Marek Safar <marek.safar@seznam.cz>
8396 * assign.cs (Assign.DoResolve): Error method changed.
8398 * cfold.cs (DoConstantNumericPromotions): Error method changed.
8400 * const.cs (ResolveValue): Reset in_transit immediately.
8402 * constant.cs: Error method changed.
8404 * convert.cs: Removed useless location parameter.
8405 (ExplicitNumericConversion): Don't do double enum check.
8406 (ExplicitConversionCore): Renamed from ExplicitConversion.
8407 (ExplicitUnsafe): Extracted from ExplicitConversion.
8408 (ExplicitConversion): Uses for error reporting.
8410 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
8412 (ResolveBoolean): Uses common error method.
8413 (CastToDecimal): Get rid of ec.
8414 (CastFromDecimal): Optimized.
8415 (ConvCast): Get rid of ec.
8417 * enum.cs (ResolveValue): Reset in_transit immediately.
8418 (Emit): Return after first error.
8420 * expression.cs: Convert changes.
8422 * literal.cs: Error method changed.
8424 * statement.cs: Error method changed.
8426 2005-10-03 Raja R Harinath <rharinath@novell.com>
8428 * support.cs (SeekableStreamReader.Position): Don't error out when
8429 the requested position is just beyond the end of the current
8432 2005-09-28 Raja R Harinath <rharinath@novell.com>
8434 * support.cs (SeekableStreamReader): Simplify drastically. Don't
8435 try to keep in sync with the byte count of the underlying Stream.
8436 However, this limits us to a window size of 2048 characters: i.e.,
8437 the maximum lookahead of our lexer/parser can be 2048 characters.
8439 2005-09-28 Marek Safar <marek.safar@seznam.cz>
8442 * driver.cs: Fix compilation files with full root path.
8444 2005-09-25 Miguel de Icaza <miguel@novell.com>
8446 * report.cs (SymbolRelatedToPreviousError): Format the output so
8447 it does not use an open parenthesis that is never closed.
8449 * driver.cs: Follow coding guidelines
8451 2005-09-27 Marek Safar <marek.safar@seznam.cz>
8454 * const.cs (Const.ResolveValue): Check for assigning non-null
8455 value to reference type.
8457 2005-09-27 Marek Safar <marek.safar@seznam.cz>
8459 * anonymous.cs: Implemented ExprClassName.
8461 * assign.cs (Assign.DoResolve): Don't chrash when type is not
8464 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
8467 * class.cs (StaticClass.DefineContainerMembers): Report protected
8470 * codegen.cs: if(ed) PRODUCTION.
8472 * convert.cs (Error_CannotImplicitConversion): Better error
8475 * cs-parser.jay: More error checks.
8477 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
8479 * driver.cs (CSCParseOption): Enabled wrong option check.
8481 * ecore.cs (Expression.ExprClassName): Turned to property.
8482 (MemberExpr.CheckIntermediateModification): For checking boxed
8483 value types modification.
8485 * statement.cs (Fixed.Resolve): Expression type must be
8486 convertible to fixed type.
8487 (CollectionForeach.GetEnumeratorFilter,TryType):
8488 Small refactoring for easier error checking.
8490 2005-09-26 Marek Safar <marek.safar@seznam.cz>
8492 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
8495 * class.cs (GeneratedBaseInitializer): New class for customization
8496 compiler generated initializers.
8497 (MemberBase.DoDefine): Check Obsolete attribute here.
8498 (FieldMember.DoDefine): Ditto.
8500 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
8503 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
8504 (MemberCore.GetObsoleteAttribute): Removed argument.
8505 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
8506 (MemberCore.CheckObsoleteType): New helper.
8510 * statement.cs: Updates after MemberCore changes.
8512 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
8513 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
8515 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
8516 obsolete attribute for compiler construct.
8517 (As.DoResolve): Cache result.
8519 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
8521 2005-09-26 Raja R Harinath <rharinath@novell.com>
8524 * expression.cs (This.VerifyFixed): In a value type T, the type of
8525 'this' is T&, iow, 'this' is either an out or ref parameter. In a
8526 value type R, 'this' is treated as a value parameter.
8528 2005-09-22 Miguel de Icaza <miguel@novell.com>
8530 * statement.cs (Lock): Use the TemporaryVariable class instead of
8531 manually using local variables as those do not work when variables
8534 * ecore.cs: Moved the TemporaryVariable class from being a nested
8535 class inside Foreach to be a public class that can be employed in
8538 2005-09-19 Marek Safar <marek.safar@seznam.cz>
8540 * cs-parser.jay: interface_accessors replaced by
8541 accessor_declarations.
8543 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
8546 * statement.cs (GotoCase.Resolve): Convert null constant to
8548 (SwitchLabel.ResolveAndReduce): Ditto.
8549 (SwitchLabel.NullStringCase): Custom null stamp.
8550 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
8552 typemanager.cs (CSharpSignature): Don't skip first argument
8555 2005-09-18 Miguel de Icaza <miguel@novell.com>
8557 * driver.cs: Set InEmacs based on the environment variable EMACS.
8559 * location.cs (InEmacs): in this mode, do not report column
8560 location as it confuses Emacs.
8562 2005-09-16 Marek Safar <marek.safar@seznam.cz>
8564 * cfold.cs, constant.cs, convert.cs, ecore.cs,
8565 expression.cs, iterators.cs, literal.cs: Store constants and
8568 * class.cs (MemberBase.ShortName): Pass location.
8570 * cs-parser.jay: Some location fixes.
8572 * ecore.cs (Expression.Location): Made virtual.
8574 2005-09-05 Miguel de Icaza <miguel@novell.com>
8576 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
8577 if the underlying types are the same, otherwise we need to produce
8578 code that will do the proper cast.
8580 This was exposed by Marek's constant rewrite which produced
8581 invalid code for the call site:
8584 void Method (X v) {}
8588 This fixes test-49.cs
8590 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
8592 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
8593 Type/Object should be allowed as well. Fixed bug #75968.
8595 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
8597 * expression.cs : (Binary.DoResolve): when one is enum constant and
8598 another is constant 0, then return enum one *as enum type*.
8601 2005-09-02 Raja R Harinath <rharinath@novell.com>
8603 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
8607 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
8608 flow-branching for LocalVariableReferences in case we were invoked
8609 from a MemberAccess.
8610 * expression.cs (LocalVariableReference.VerifyAssigned): New.
8612 (LocalVariableReference.DoResolveBase): ... this.
8613 (MemberAccess.Resolve): Do the check that was disabled during
8616 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
8619 (PartialContainer.Create): check abstract/sealed/static strictly
8620 but abstract/sealed can exist only at one side. Fixed bug #75883.
8622 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
8625 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
8626 specified, don't default to UnmanagedType.I4.
8628 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
8630 * expression.cs : conditional operator should check possibly
8631 incorrect assign expression. Fixed bug #75946.
8633 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
8635 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
8636 Reverting the change. gmcs is much complex than mcs on this matter.
8638 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
8640 * cs-tokenizer.cs : To read another token ahead of the actual
8641 consumption, use new SavedToken and cache token instead of moving
8642 back the stream with SeekableStreamReader (it seemed problematic).
8644 driver.cs : Thus use StreamReader directly.
8645 * support.cs : Thus removed SeekableStreamReader.
8647 2005-08-30 Raja R Harinath <rharinath@novell.com>
8650 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
8651 (ScopeInfo.EmitScopeType): Use it to construct field names from
8652 names of captured locals.
8655 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
8656 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
8657 Pass 'target_type' to BoxedCast. Don't default to 'object'.
8658 (ExplicitConversion): Remove enum cases already handled by
8659 implicit conversion. Move implicit conversion check to the beginning.
8660 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
8661 * expression.cs (ArrayCreation.EmitDynamicInitializers):
8662 Don't treat System.Enum as a struct.
8664 2005-08-30 Jb Evain <jbevain@gmail.com>
8666 * attribute.cs: handles as expression in parameters.
8668 2005-08-30 Raja R Harinath <rharinath@novell.com>
8671 * class.cs (TypeContainer.VerifyClsName): Don't use a
8672 PartialContainer when verifying CLS compliance.
8673 (AbstractPropertyEventMethod): Set Parent here, ...
8674 (PropertyMethod): ... not here.
8676 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
8678 * attribute.cs : escaped attribute name should not be allowed to be
8679 resolved (e.g. @class as classAttribute). Fixed bug #75930.
8681 2005-08-29 Raja R Harinath <rharinath@novell.com>
8684 * convert.cs (ImplicitStandardConversionExists): Allow zero also
8685 when converting a long constant to unsigned long.
8686 * expression.cs (Invocation.OverloadResolve): Add sanity check to
8687 detect where IsApplicable and VerifyArgumentsCompat disagree.
8689 2005-08-29 Raja R Harinath <rharinath@novell.com>
8690 and Carlos Alberto Cortez <carlos@unixmexico.org>
8693 * class.cs (TypeContainer.CanElideInitializer): New helper.
8694 (TypeContainer.EmitFieldInitializers): Use it to determine if we
8695 can safely emitting the initializer of a field.
8697 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
8699 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
8700 allowed inside a switch (without loop). Fixed bug #75433.
8702 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
8704 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
8705 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
8707 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
8709 * driver.cs : kinda reverting the default encoding changes (not exact
8710 revert since I noticed that "codepage:reset" might not work fine).
8712 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
8714 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
8715 Location. Now getter and setter store location correctly.
8716 (errors/cs0111-12.cs now reports the expected location.)
8718 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
8720 * driver.cs : Use default encoding on the environment.
8721 Removed (now that) extra parameter for SeekableStreamReader.
8722 * support.cs : (SeekableStreamReader) third .ctor() argument for
8723 StreamReader is not required (always true). preamble size could
8724 be acquired in simpler and safe way.
8726 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
8728 * cs-parser.jay: report CS0642 at warning level 3
8729 and report CS0642 for an if else statement also
8730 fixes bug #74745. Patch by John Luke (and a bit
8732 Removed extra CS0642 warning check for "while",
8734 * statement.cs: In Block.Resolve(), CS0642 check
8735 is reimplemented to check a sequence of an empty
8736 statement and a block.
8738 Both fix bug #66777.
8740 2005-08-24 Marek Safar <marek.safar@seznam.cz>
8742 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
8743 detection until I fix it.
8745 * cs-tokenizer.cs: Changed error message.
8747 * cs-parser.jay: Fixed 2 error locations.
8749 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
8750 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
8753 * enum.cs (GetSignatureForError): Fixed.
8755 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
8759 * typemanager.cs (RegisterProperty): Removed.
8761 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
8763 2005-08-24 Raja R Harinath <rharinath@novell.com>
8766 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
8767 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
8769 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
8771 * expression.cs : tiny fix is required for not warning positive ulong.
8774 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
8776 * expression.cs : add CS0652 check for constant and integral
8777 expression. Fixed bug #53974.
8779 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
8781 * expression.cs : in DoNumericPromotions(), check if there is implicit
8782 conversion overload for string (to check CS0034). Fixed bug #52492.
8784 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
8786 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
8788 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
8790 * ecore.cs : report location when it is *not* Null.
8792 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
8798 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
8799 correctly. Fixed bug #75721.
8801 2005-08-23 Raja R Harinath <rharinath@novell.com>
8803 * support.cs (SeekableStreamReader.Position): Avoid an expensive
8804 loop that performs 'min (pos, char_count)'.
8807 * expression.cs (Unary.ResolveOperator): Don't discard implicit
8808 converted value in Operator.OnesComplement.
8810 2005-08-22 Ben Maurer <bmaurer@ximian.com>
8812 * anonymous.cs: If the anon method is pulled into a helper class,
8813 it needs to be `internal' not `private'. Fixes runtime behavior on
8816 2005-08-20 Martin Baulig <martin@ximian.com>
8818 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
8819 scope if we don't already have it.
8821 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
8822 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
8825 2005-08-17 Marek Safar <marek.safar@seznam.cz>
8828 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
8831 2005-08-16 Marek Safar <marek.safar@seznam.cz>
8833 The big constants rewrite
8834 Fix #75746, #75685 and more
8835 As a side effect saved 1MB for MWF ;-)
8837 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
8838 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
8839 enum based for corlib compilation.
8841 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
8844 * class.cs (FixedField.Define): Use ResolveAsConstant.
8846 * const.cs (IConstant): Interface constants and enums.
8847 (Const.ResolveValue): New method for constant resolvning.
8848 (ExternalConstant): Constants from imported assemblies.
8850 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
8851 conversion; like enums.
8852 (Constant.ToType): Converts this constant to different type.
8853 (Constant.Increment): Adds 1.
8855 * convert.cs (ImplicitConversionRequired): Simplified.
8857 * cs-parser.jay: Create EnumMember directly.
8859 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
8861 * doc.cs (GenerateEnumDocComment): Removed.
8863 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
8864 (ConvertIntLiteral): Removed.
8865 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
8867 * enum.cs (EnumMember): Implement IConstant.
8868 (Enum.IsValidEnumConstant): Removed.
8869 (Enum.GetNextDefaultValue): Removed.
8870 (Enum.FindMembers): Updated.
8871 (Enum.GenerateDocComment): Iterate enum members.
8873 * expression.cs (Cast.TryReduce): Handle enums correctly.
8874 (New.Constantify): Made public.
8875 (MemberAccess.DoResolve): Removed contant specific if(s).
8877 * literal.cs (NullLiteral): Implement new abstract methods.
8879 * statement.cs (GotoCase.Resolve): Use new constant methods.
8880 (SwitchLabel.ResolveAndReduce): Use new constant methods.
8882 * typemanager.cs (LookupEnum): Removed.
8883 (IsEnumType): Fixed to work with corlib.
8884 (RegisterConstant): Removed.
8885 (LookupConstant): Removed.
8886 (GetConstant): Changed to work with IConstant.
8888 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
8890 * location.cs : Fixed overflown (>255) column number.
8892 2005-08-03 Raja R Harinath <rharinath@novell.com>
8894 First cut of the qualified-alias-member feature.
8895 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
8897 * cs-parser.jay (DOUBLE_COLON): New token.
8898 (namespace_or_type_name): Add rule for recognizing
8899 qualified-alias-members.
8900 (primary_expression): Likewise.
8901 (element_access): Allow QualifiedAliasMember as a possible
8902 type-bearing expression.
8903 (local_variable_type, local_variable_pointer_type): Likewise.
8904 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
8905 aliases in the current and enclosing namespace declarations.
8906 (NamespaceEntry.UsingAlias): Add CS0440 warning.
8907 * decl.cs (MemberName.is_double_colon): New.
8908 (MemberName.MemberName): Add new constructor for alias-member.
8909 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
8910 * expression.cs (QualifiedAliasMember): New expression type.
8912 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
8914 * location.cs : it borked when no argument was specified.
8916 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
8918 * location.cs : tiny ToString() format fix.
8920 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
8922 * statement.cs : oops, it was missing.
8924 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
8926 A set of fixes for precise line/column location.
8929 "token" field now holds a file/line "delta", a line number offset
8930 from the segment, and a column number. See also:
8931 http://lists.ximian.com/pipermail/mono-devel-list/2004-
8932 December/009508.html
8933 Removed static IsNull. Use instance IsNull property instead.
8935 For some tokens it stores Location. For Identifier it stores
8936 LocatedToken which is a pair of string name and location.
8937 Column numbers are adjusted only at getChar().
8939 Use Location.ToString() for reporting (it now contains column).
8941 Largely modified to use LocatedToken instead of
8942 string (IDENTIFIER), and to acquire Location from some tokens.
8943 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
8944 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
8946 Now MemberName holds Location. DeclSpace.ctor() receives Location
8947 as a parameter. Removed extra parameters to all derived classes.
8948 Replaced Location.IsNull() with instance property.
8949 * assign.cs, expression.cs :
8950 Added .ctor() overload that omits Location.
8952 Added "nameEscaped" flag that indicates the identifier was escaped
8953 in the source file. This fixes bug #57047.
8955 2005-08-02 Marek Safar <marek.safar@seznam.cz>
8957 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
8958 New method, looking for lo-case imported cls type.
8960 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
8963 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
8965 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
8967 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
8969 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
8971 Optimized to save 3.5 MB for SWF compilation.
8973 2005-08-01 Marek Safar <marek.safar@seznam.cz>
8975 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
8976 (PartialContainer.Create): Moved logic AddToContainer.
8977 (PartialContainer.MarkForDuplicationCheck): Shares name.
8979 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
8982 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
8984 (Namespace.GetSignatureForError): New method.
8986 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
8987 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
8989 2005-08-01 Raja R Harinath <rharinath@novell.com>
8992 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
8993 member lookup rather than qualifier_type, since qualifier_type can
8996 2005-08-01 Marek Safar <marek.safar@seznam.cz>
8998 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
9001 2005-07-31 Miguel de Icaza <miguel@novell.com>
9003 * statement.cs: Copy the local exception into the exception
9004 captured local. Fixes 75674
9006 2005-07-31 Raja R Harinath <harinath@gmail.com>
9009 * expression.cs (Invocation.OverloadResolve): Don't report error
9010 CS1501 if error CS1502 has been reported.
9011 (New.DoResolve): Delegate CS1501 reporting to
9012 Invocation.OverloadResolve.
9015 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
9016 invariant-meaning-in-block property in an enclosing block if
9019 2005-07-29 Marek Safar <marek.safar@seznam.cz>
9021 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
9022 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
9023 (Switch.CheckSwitch): Just save 50kb for SWF.
9025 2005-07-27 Martin Baulig <martin@ximian.com>
9027 * anonymous.cs (CaptureContext.AddField): Added
9028 `AnonymousContainer am' argument; compute its toplevel scope if
9029 it's not already computed. Fixes #75649.
9031 2005-07-26 Raja R Harinath <rharinath@novell.com>
9034 * class.cs (Constructor.Emit): Reset block to null if the block
9037 2005-07-25 Marek Safar <marek.safar@seznam.cz>
9039 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
9041 2005-07-25 Marek Safar <marek.safar@seznam.cz>
9043 * class.cs (MethodData.Define): Check whether accessor implementing
9044 interface is public.
9046 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
9048 2005-07-22 Marek Safar <marek.safar@seznam.cz>
9051 * namespace.cs (LookupType): Moved same type check to...
9053 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
9056 2005-07-21 Raja R Harinath <rharinath@novell.com>
9058 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
9059 already found a typebuilder.
9060 * class.cs (MethodCore.IsDuplicateImplementation): Compare
9061 MemberNames, not strings.
9063 * const.cs (Error_ExpressionMustBeConst):
9064 Rename from Error_EpressionMustBeConst.
9065 * const.cs, class.cs, statement.cd: Update.
9067 2005-07-21 Marek Safar <marek.safar@seznam.cz>
9071 * const.cs (Const.LookupConstantValue): Report missing contant expression
9073 (Error_EpressionMustBeConstant): Only one error method.
9075 * class.cs, statement.c: Updated.
9077 2005-07-20 Raja R Harinath <rharinath@novell.com>
9079 * statement.cs (Block.Flags): Add back HasVarargs.
9080 (Block.flags): Make protected.
9081 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
9083 * typemanager.cs (types, typecontainers, user_types): Remove.
9084 (UserTypes, TypeContainers): Likewise.
9085 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
9086 (CleanUp, Reset): Update.
9087 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
9088 (GetNestedType): Use Type.GetNestedType.
9089 (CoreLookupType): Take two arguments, the namespace and the
9090 basename of the type. Update to use the Namespace.Lookup
9092 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
9093 (RealMemberLookup): Use IsNestedChildOf instead of playing with
9094 string concatenation and substring matches.
9095 * class.cs, enum.cs, delegate.cs: Update to changes.
9097 2005-07-20 Marek Safar <marek.safar@seznam.cz>
9099 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
9100 Expression and made virtual.
9102 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
9103 (ImplicitStandardConversionExists): Fixed `byte' typo ?
9105 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
9107 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
9110 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
9113 2005-07-18 Marek Safar <marek.safar@seznam.cz>
9116 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
9117 AssemblyCultureAttribute is not used on executable.
9120 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
9122 2005-07-16 Raja R Harinath <rharinath@novell.com>
9125 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
9126 New. Reports CS0252/CS0253.
9127 Mostly taken from preliminary patch by Duncak Mak.
9128 (Binary.DoResolveOperator): Store results of operator lookup.
9129 Use them to detect if we need to warn about unintended reference
9132 2005-07-15 Raja R Harinath <rharinath@novell.com>
9135 * namespace.cs (Namespace.Lookup): Add back location parameter.
9136 (Namespace.LookupType): Add CS0436 report. Add location parameter.
9137 * delegate.cs, ecore.cs, expression.cs: Update to changes.
9139 * codegen.cs (EmitContext.DeclSpace): Make readonly.
9140 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
9141 (Namespace.LookupType): ... this.
9142 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
9144 * typemanager.cs (LookupTypeReflection): Remove buggy code that
9145 purported to handle pointers.
9146 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
9149 2005-07-15 Marek Safar <marek.safar@seznam.cz>
9151 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
9154 2005-07-15 Raja R Harinath <rharinath@novell.com>
9156 * namespace.cs (Namespace.Lookup): Drop location parameter.
9157 (NamespaceEntry.LookupAlias): Remove. Merge into ...
9158 (NamespaceEntry.Lookup): ... this.
9159 (NamespaceEntry.Error_AmbiguousTypeReference):
9160 Move here from DeclSpace.
9161 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
9163 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
9164 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
9165 Move to NamespaceEntry.
9166 * delegate.cs, expression.cs: Update to changes.
9168 2005-07-14 Marek Safar <marek.safar@seznam.cz>
9170 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
9171 CheckAttributeType and refactored.
9172 (Attribute.ResolvePossibleAttributeType): Changed to reuse
9173 ResolveAsTypeTerminal error handling.
9174 (ResolveAsTypeTerminal): Introduced because of global attributes extra
9176 (GetSignatureForError): Print errors in same way.
9179 * codegen.cs: Reflect attribute GetSignatureForError change.
9182 * expression.cs: Add silent parameter to ResolveAsTypeStep.
9184 * namespace.cs (UsingEntry): Refactored to make fields private.
9187 statement.cs: Error_UnexpectedKind has extra parameter.
9189 2005-07-14 Raja R Harinath <rharinath@novell.com>
9191 * ecore.cs (IAlias): Remove.
9192 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
9193 that implement the interface.
9194 * namespace.cs (Namespace): Likewise.
9195 (Namespace.declspaces): Renamed from 'defined_names'.
9196 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
9197 DeclSpace instead of an IAlias.
9198 * tree.cs (Tree.AddDecl): Update.
9200 2005-07-12 Raja R Harinath <rharinath@novell.com>
9202 * statement.cs (Block.Flags); Remove HasVarargs.
9203 (Block.HasVarargs): Move to ToplevelBlock.
9204 (Block.ThisVariable, Block.AddThisVariable): Likewise.
9205 (Block.Variables): Make protected. Initialize variable hashtable
9207 (Block.AddVariable): Update.
9208 (Block.Resolve): Update to changes.
9209 (ToplevelBlock.HasVarargs): New boolean.
9210 (ToplevelBlock.ThisVariable): Move here from Block.
9211 (ToplevelBlock.AddThisVariable): Likewise.
9212 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
9213 * expression.cs (This.ResolveBase): Update to changes.
9214 (ArglistAccess.DoResolve): Likewise.
9216 2005-07-11 Marek Safar <marek.safar@seznam.cz>
9219 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
9221 * class.cs (TypeContainer.VerifyMembers): Distinguish between
9222 not used and not used & assigned.
9223 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
9225 2005-07-11 Marek Safar <marek.safar@seznam.cz>
9228 * expression.cs (Is.DoResolve): null is never provided type.
9230 2005-07-08 Marek Safar <marek.safar@seznam.cz>
9233 * cs-parser.jay: Less strict event error rule to catch more errors.
9235 2005-07-08 Martin Baulig <martin@ximian.com>
9237 Fix test-iter-10.cs - distinguish whether we `yield' in a property
9238 gettter (allowed) or setter (not allowed).
9240 * class.cs (Accessor): Implement IIteratorContainer.
9241 (Accessor.Yields): New public field.
9242 (PropertyBase.PropertyMethod.Define): Handle iterators on a
9246 (get_accessor_declaration, set_accessor_declaration): Set the
9247 `yields' flag on the accessor, not the property.
9248 (property_declaration): Do the iterators check on a per-accessor
9249 basis and not for the whole property.
9251 2005-07-08 Martin Baulig <martin@ximian.com>
9253 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
9254 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
9256 2005-07-07 Marek Safar <marek.safar@seznam.cz>
9259 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
9260 (ExtractSecurityPermissionSet): Cope with self referencing security
9261 attributes properly.
9263 * driver.cs (SetOutputFile): Made public property OutputFile.
9265 2005-07-07 Raja R Harinath <rharinath@novell.com>
9268 * class.cs (TypeContainer.first_nonstatic_field): Rename from
9269 has_nonstatic_fields. Make into a FieldBase pointer.
9270 (TypeContainer.AddField): Add CS0282 check.
9271 (TypeContainer.EmitType): Update.
9273 2005-07-06 Miguel de Icaza <miguel@novell.com>
9275 * cs-tokenizer.cs (consume_identifier): Do not create strings to
9276 compare if they start with __.
9278 2005-07-06 Raja R Harinath <rharinath@novell.com>
9280 * statement.cs (Switch.SwitchGoverningType): Only look at
9281 UserCasts that don't need implicit standard conversions to one of
9282 the allowed switch types (Fixes test-322.cs).
9283 (LocalInfo.Resolve): Re-enable sanity-test.
9285 2005-07-06 Marek Safar <marek.safar@seznam.cz>
9287 * cs-tokenizer.cs (consume_identifier): Detect double undescores
9289 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
9291 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
9293 2005-07-06 Raja R Harinath <rharinath@novell.com>
9296 * ecore.cs (SimpleName.GetSignatureForError): Add.
9297 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
9298 (MemberAccess.GetSignatureForError): Add.
9300 2005-07-05 Marek Safar <marek.safar@seznam.cz>
9302 The big error and warning messages review.
9332 * typemanager.cs: Updated.
9334 * class.cs: (MethodCore.SetYields): Moved here to share.
9335 (PropertyMethod.Define): Moved iterator setup here.
9337 * iterators.cs: Add orig_method to have full access to parent
9340 2005-07-05 Raja R Harinath <rharinath@novell.com>
9342 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
9343 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
9344 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
9345 variable of struct type.
9346 * expression.cs (Unary.ResolveOperator): Update to change.
9347 (Indirection.VerifyFixed): Likewise.
9348 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
9349 (ParameterReference.VerifyFixed): Value parameters are fixed.
9350 (This.VerifyFixed): Treat 'this' as a value parameter.
9351 * statement.cs (LocalInfo.IsFixed): Remove.
9353 2005-07-01 Martin Baulig <martin@ximian.com>
9355 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
9356 `ec.EmitThis ()' to get the correct scope.
9358 2005-07-01 Martin Baulig <martin@ximian.com>
9360 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
9361 instance is a ParameterReference; fixes #75299.
9363 2005-07-01 Martin Baulig <martin@ximian.com>
9365 Reverted Marek's latest patch (r46725):
9366 - it contains structural changes which are neither mentioned in
9367 the ChangeLog nor explained anywhere; for example the additional
9368 argument of EmitContext's and Iterator's .ctor's and the
9369 TypeContainer.DefineMembers() change.
9370 - structural changes like this should go in in seperate patches
9371 and not be hidden in a huge patch which just seems to affect
9372 warnings and errors.
9373 a big and hard to understand patch.
9374 - it breaks iterators and causes regressions, for instance in
9377 2005-06-30 Raja R Harinath <rharinath@novell.com>
9380 * expression.cs (Indexers.map): Remove.
9381 (Indexers.Append): Filter out inaccessible setters and getters.
9382 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
9385 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
9387 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
9388 (FieldExpr.Emit, PropertyExpr.Emit): Update.
9389 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
9390 * expression.cs (Invocation.EmitCall): Add CS0120 check.
9392 2005-06-30 Marek Safar <marek.safar@seznam.cz>
9395 * class.cs (FieldBase.GetInitializerExpression): One more field
9398 2005-06-28 Miguel de Icaza <miguel@novell.com>
9400 * pending.cs: Do not define a proxy if the base method is virtual,
9401 it will be picked up by the runtime (bug 75270).
9403 2005-06-08 Martin Baulig <martin@ximian.com>
9405 The big Iterators rewrite :-)
9407 * iterators.cs: Rewrite this to use the anonymous methods framework.
9409 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
9410 before the TypeContainers; see 2test-21.cs.
9413 (TypeContainer.DefineType): Don't create a new EmitContext if we
9414 already have one (this only happens if we're an Iterator).
9415 (TypeContainer.Define): Also call Define() on all our iterators.
9416 (Method.CreateEmitContext): Added support for iterators.
9419 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
9420 (AnonymousContainer.CreateMethodHost): Moved here from
9421 AnonymousMethod and made abstract.
9422 (AnonymousContainer.CreateScopeType): New abstract method.
9423 (AnonymousContainer.IsIterator): New public property.
9424 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
9425 get the ScopeTypeBuilder rather than manually defining it here.
9426 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
9429 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
9430 before RootContext.DefineTypes().
9432 * codegen.cs (EmitContext.RemapToProxy): Removed.
9433 (EmitContext.CurrentAnonymousMethod): Changed type from
9434 AnonymousMethod -> AnonymousContainer.
9435 (EmitContext.ResolveTopBlock): Protect from being called twice.
9436 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
9437 (EmitContext.EmitThis): Removed the iterators hacks; use the
9438 anonymous methods framework for that.
9441 (ToplevelBlock.Container): Make this a property, not a field.
9442 (ToplevelBlock.ReParent): New public method; move the
9443 ToplevelBlock into a new container.
9444 (Foreach.TemporaryVariable): Simplify.
9446 2005-06-05 Martin Baulig <martin@ximian.com>
9448 * statement.cs (LocalInfo.CompilerGenerated): New flag.
9449 (Block.AddTemporaryVariable): New public method; creates a new
9450 `LocalInfo' for a temporary variable.
9451 (Block.EmitMeta): Create the LocalBuilders for all the temporary
9453 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
9454 non-iterator variables.
9456 2005-06-05 Martin Baulig <martin@ximian.com>
9458 * statement.cs (Foreach.TemporaryVariable): Create the
9459 LocalBuilder in the Emit phase and not in Resolve since in some
9460 situations, we don't have an ILGenerator during Resolve; see
9461 2test-19.cs for an example.
9463 2005-06-04 Martin Baulig <martin@ximian.com>
9465 **** Merged r45395 from GCS ****
9467 The big Foreach rewrite - Part II.
9469 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
9470 with `PropertyInfo ienumerator_getcurrent'.
9472 * codegen.cs (VariableStorage): Removed.
9475 (Foreach): Derive from Statement, not ExceptionStatement.
9476 (Foreach.CollectionForeach): New nested class. Moved all the code
9477 dealing with collection foreach here.
9478 (Foreach.ForeachHelperMethods): Removed.
9479 (Foreach.TemporaryVariable): Implement IMemoryLocation.
9481 2005-05-23 Martin Baulig <martin@ximian.com>
9483 * statement.cs (Try.DoResolve): Don't create a `finally' if we
9484 don't need to. Fix #75014.
9486 2005-05-20 Martin Baulig <martin@ximian.com>
9488 Merged r44808 from GMCS.
9490 * class.cs (TypeContainer.CircularDepException): Removed.
9491 (TypeContainer.DefineType): Removed the `InTransit' stuff.
9492 (TypeContainer.CheckRecursiveDefinition): Check for circular class
9493 (CS0146) and interface (CS0529) dependencies here.
9495 2005-06-21 Raja R Harinath <rharinath@novell.com>
9497 * expression.cs (Invocation.EmitCall): Fix initialization
9498 'this_call' to reflect current behaviour. Fix indentation.
9500 * convert.cs (FindMostEncompassedType): Add two trivial special
9501 cases (number_of_types == 0 || number_of_types == 1).
9502 (FindMostEncompasingType): Likewise.
9504 2005-06-17 Raja R Harinath <rharinath@novell.com>
9506 Some cleanups preparing for the fix of #75283.
9507 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
9509 (EventExpr.InstanceResolve): Likewise.
9510 (EventExpr.DoResolve): Remove redundant checks.
9512 2005-06-10 Duncan Mak <duncan@novell.com>
9514 * cs-tokenizer.cs (process_directives): New flag for controlling
9515 the processing of preprocessor directives.
9516 (x_token): After seeing a '#', return Token.NONE instead of going
9517 to handle_preprocessing_directive() when not processing
9518 directives. This avoids unnecessary processing during the token peek in
9523 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
9524 the existing error reporting methods instead of Report.Error.
9526 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
9527 after Raja's rewrite.
9529 2005-06-08 Miguel de Icaza <miguel@novell.com>
9531 * class.cs: Small fix.
9533 2005-06-08 Raja R Harinath <rharinath@novell.com>
9536 * class.cs (GetPartialBases): Fix return value check of
9539 2005-06-07 Raja R Harinath <rharinath@novell.com>
9541 Ensure that partial classes are registered in their enclosing
9542 namespace. Initial part of fix of #75160.
9543 * tree.cs (Tree.RecordDecl): Add new namespace argument.
9544 Register declspace with namespace here, not in
9545 DeclSpace.RecordDecl.
9546 * cs-parser.jay: Pass namespace to RecordDecl.
9547 * class.cs (PartialContainer.Create): Likewise.
9548 (ClassPart.DefineType): New sanity-check. Throws an exception if
9550 * decl.cs (Declspace.RecordDecl): Remove.
9551 * namespace.cs (NamespaceEntry.DefineName): Remove.
9553 2005-06-06 Marek Safar <marek.safar@seznam.cz>
9555 * rootcontext.cs: Reset TargetExt as well.
9557 2005-06-03 Raja R Harinath <rharinath@novell.com>
9559 * ecore.cs (Expression.Resolve): Emit CS0654 error when
9562 2005-06-02 Raja R Harinath <rharinath@novell.com>
9564 Fix #75080, cs0119.cs.
9565 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
9567 (Expression.Resolve): ... this. Use it. Remove bogus code
9568 allowing ExprClass.Type and ExprClass.Namespace for
9569 ResolveFlags.VariableOrValue.
9570 (Expression.Resolve) [1-argument variant]: Change default resolve
9571 flags based on language version.
9572 (Expression.Error_UnexpectedKind): Use a simple string array
9573 rather than an ArrayList.
9574 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
9576 (TypeOfVoid.DoResolve): Likewise.
9577 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
9578 flags argument -- it always has the same value.
9580 2005-05-31 Raja R Harinath <rharinath@novell.com>
9583 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
9584 Use it in the error message.
9585 * assign.cs, expression.cs, statement.cs: Update.
9587 2005-05-30 Raja R Harinath <rharinath@novell.com>
9590 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
9591 the "almostMatchedMember" case too.
9592 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
9593 that failed the accessibility checks to 'almost_match'.
9595 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
9597 * attribute.cs: Use internal MethodBuilder methods to set
9598 ExactSpelling and SetLastError on PInvoke methods, instead
9599 of passing them via charset. Fixes #75060.
9601 2005-05-27 Raja R Harinath <rharinath@novell.com>
9603 * parameter.cs (Parameter): Remove TODO comment.
9604 (Parameter.DefineParameter): Remove Location parameter.
9605 (Parameters.LabelParameters): Likewise.
9606 * class.cs (Constructor.Emit): Update to change.
9607 (MethodData.Emit): Likewise.
9608 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
9609 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
9611 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
9614 Removed Parameters.Location and added Parameter.Location instead.
9615 Removed Location parameter from Emit() and GetSignature().
9622 Modified all related calls.
9624 2005-05-26 Raja R Harinath <rharinath@novell.com>
9626 Improve user-defined conversion handling.
9627 * convert.cs (GetConversionOperators): Rewrite. Return only the
9628 applicable operators.
9629 (AddConversionOperators): New. Helper for GetConversionOperators.
9630 (FindMostEncompassedType, FindMostEncompassingType): Verify that
9631 there is only one most encompassed/encompassing type.
9632 (FindMostSpecificSource, FindMostSpecificTarget): Remove
9633 "applicable operator" handling.
9634 (UserConversion): Move cache here from GetConversionOperators.
9635 Directly cache the chosen operator, rather than the whole
9637 (ExplicitNumericConversion): Fix buggy implementation of Decimal
9638 case. Allow conversion of decimal to sbyte and byte too.
9639 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
9640 New static methods. Used to avoid allocating EmptyExpressions in
9643 2005-05-24 Duncan Mak <duncan@novell.com>
9645 * ecore.cs (CastFromDecimal): New class for casting a decimal to
9646 another class, used in Convert.ExplicitNumericConversion.
9647 (CastToDecimal): New class, similar to above, but casts to
9648 System.Decimal, used in Convert.ImplicitNumericConversion and also
9649 in explicit convesion from double/float to decimal.
9651 * convert.cs (ImplicitNumericConversion): Handle implicit
9652 conversions to System.Decimal.
9653 (ExplicitNumericConversion): handle explicit conversions to
9658 2005-05-20 Miguel de Icaza <miguel@novell.com>
9660 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
9661 know the type at this stage, just break through. Fixes #75008
9663 2005-05-19 Martin Baulig <martin@ximian.com>
9666 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
9667 to disable error reporting.
9669 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
9670 here since we don't want to report an error; see the new test-336.cs.
9672 2005-05-19 Raja R Harinath <rharinath@novell.com>
9674 * statement.cs (ToplevelBlock.GetParameterReference)
9675 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
9676 Move here from class Block.
9677 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
9678 * expression.cs (ParameterReference.DoResolveBase): Likewise.
9680 2005-05-18 Martin Baulig <martin@ximian.com>
9685 (FlowBranching.Reachability): Add non-static public And() and Or()
9687 (FlowBranchingSwitch): New class; do the `break_origins' thing
9688 like in FlowBranchingLoop.
9689 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
9690 reachability, not just locals and parameters.
9691 (FlowBranching.MergeChild): Remove some of the hacks for loop and
9692 switch; MergeBreakOrigins() now takes care of that.
9694 2005-05-18 Martin Baulig <martin@ximian.com>
9696 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9697 a loop and may leave it, reset the barrier; fixes #74974.
9699 2005-05-17 Marek Safar <marek.safar@seznam.cz>
9701 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
9704 * cs-parser.jay: Catch more lexical errors.
9706 * report.cs: Add one more Error method.
9709 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
9711 2005-05-17 Martin Baulig <martin@ximian.com>
9713 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
9716 2005-05-16 Raja R Harinath <rharinath@novell.com>
9718 Fix test-382.cs. Emit values of decimal constants.
9719 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
9721 (TypeContainer.AddField): ... this.
9722 (TypeContainer.EmitFieldInitializers): Allow the list of fields
9723 with initializers to include 'Const's.
9724 (ClassPart.RegisterFieldForInitialization): Forward to
9726 * const.cs (Const.Const): Pass initializer to base class.
9727 (Const.Define): In case of decimal constants, register them for
9728 initialization in a static constructor.
9730 2005-05-14 Martin Baulig <martin@ximian.com>
9732 * statement.cs (Block.Resolve): Correctly handle unreachable code;
9733 do not call ResolveUnreachable() on unreachable statements in
9734 here, see the comment in the source code.
9736 2005-05-13 Raja R Harinath <rharinath@novell.com>
9739 * expression.cs (BinaryResolveOperator): If one of the operands of
9740 an equality comparison is 'null' and the other is a pointer type,
9741 convert the null to a NullPointer.
9742 * convert.cs (ImplicitReferenceConversion): If the expression is a
9743 NullLiteral and the target type is a pointer type, return a
9744 NullPointer instead.
9745 (ImplicitConversionStandard): Likewise.
9747 2005-05-13 Marek Safar <marek.safar@seznam.cz>
9749 * cs-parser.jay: Set readonly context based on special constructs.
9751 * expression.cs (LocalVariableReference.DoResolveBase): Improved
9752 readonly variable error handling.
9754 * rootcontext.cs (EmitCode): Don't verify members when error
9757 * statement.cs (LocalInfo): Add reaodnly context information.
9758 (SetReadOnlyContext, GetReadOnlyContext): New methods.
9760 2005-05-13 Raja R Harinath <rharinath@novell.com>
9762 * statement.cs (Block.Resolve): Revert change below. Modify fix
9763 for #74041 to initialize 'resolved' to false only for explicit
9764 blocks. Fixes #74873.
9766 2005-05-12 Raja R Harinath <harinath@gmail.com>
9769 * typemanager.cs (unmanaged_enclosing_types): New.
9770 (IsUnmanagedType): Avoid infloops by using
9771 'unmanaged_enclosing_types' to talk with recursive invocations.
9773 2005-05-13 Martin Baulig <martin@ximian.com>
9775 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
9776 instance variable, not a local. Fix #74873.
9777 (Block.ResolveUnreachable): Set it to true here.
9779 2005-05-11 Duncan Mak <duncan@novell.com>
9781 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
9782 continuing to process for 'arg'.
9783 (handle_preprocessing_directive): Check the argument of the #endif
9784 directive and report error CS1025 if there are any trailing
9787 According to the C# spec, having even whitespace after the #endif
9788 directive is illegal; however, because we call arg.TrimEnd ()
9789 beforehand, we have the same behavior as csc, allowing whitespace
9790 after the directive.
9794 2005-05-11 Marek Safar <marek.safar@seznam.cz>
9798 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
9799 (Constructor.GetObsoleteAttribute): Implemented correctly.
9801 2005-05-10 Martin Baulig <martin@ximian.com>
9803 * support.cs (ReflectionParameters.ParameterModifier): Use
9804 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
9805 and `ParameterAttributes.In'. Fixes #74884.
9807 2005-05-10 Marek Safar <marek.safar@seznam.cz>
9809 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
9811 * expression.cs (Argument.GetParameterModifier): Turned to property.
9812 (Invocation.Error_InvalidArguments): Add more descriptive errors.
9814 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
9817 2005-05-09 Raja R Harinath <rharinath@novell.com>
9820 * decl.cs (MemberCache.AddMethods): Register override methods,
9821 rather than non-override methods.
9822 * typemanager.cs (RegisterOverride): New.
9823 (IsOverride): Update.
9825 2005-05-09 Marek Safar <marek.safar@seznam.cz>
9829 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
9830 recursive declaration.
9832 * statement.cs (Block.ResolveMeta): Report any error in resolving.
9834 2005-05-06 Marek Safar <marek.safar@seznam.cz>
9836 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
9838 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
9840 2005-05-05 Raja R Harinath <rharinath@novell.com>
9843 * decl.cs (DeclSpace.FamilyAccessible):
9844 Use TypeManager.IsNestedFamilyAccessible.
9846 Fix reopened #64812.
9847 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
9850 2005-05-04 Raja R Harinath <rharinath@novell.com>
9851 Abin Thomas <projectmonokochi@rediffmail.com>
9852 Anoob V E <projectmonokochi@rediffmail.com>
9853 Harilal P R <projectmonokochi@rediffmail.com>
9856 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
9857 allow access to all static members.
9859 2005-05-04 Martin Baulig <martin@ximian.com>
9861 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
9863 2005-05-04 Martin Baulig <martin@ximian.com>
9867 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
9868 section at the end; make things work if `default' is not the last
9871 2005-05-04 Martin Baulig <martin@ximian.com>
9875 * statement.cs (Switch): Replaced the `got_default' field with a
9876 `default_section' one.
9877 (Switch.CheckSwitch): Set `default_section' here.
9878 (Switch.Resolve): If we're a constant switch and the constant is
9879 not found, use the default section.
9881 2005-05-03 Martin Baulig <martin@ximian.com>
9883 * expression.cs (ArrayAccess.EmitGetLength): New public method.
9885 * statement.cs (Foreach.ArrayForeach): New nested class.
9886 (Foreach.TemporaryVariable): New nested class.
9887 (Foreach.EmitArrayForeach): Removed; this is now in the new
9890 2005-05-03 Raja R Harinath <rharinath@novell.com>
9892 * pending.cs (BaseImplements): Move the #74773 fix here. This is
9894 (VerifyPendingMethods): Revert change below.
9896 * typemanager.cs (IsOverride, RegisterNonOverride): New.
9897 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
9898 that used to trigger warning -28. Remove warning -28.
9899 * expression.cs (Invocation.OverloadResolve): Use
9900 TypeManager.IsOverride to distinguish override methods.
9903 * pending.cs (VerifyPendingMethods): If a base type implements the
9904 requested interface, don't bother checking individual methods of
9905 the base type. As a side-effect, this prevents the creation of
9906 unnecessary proxies.
9908 2005-05-02 Martin Baulig <martin@ximian.com>
9912 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9913 Also `And' the locals if the old vector is null.
9914 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
9915 null; in this case we basically reset all the variables.
9917 2005-05-02 Martin Baulig <martin@ximian.com>
9921 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
9922 Added `FlowBranching branching' argument; always `and' the
9923 variables instead of `or'ing them unless we're an infinite loop.
9925 * statement.cs (While.Resolve): Create a new sibling unless we're
9928 2005-05-02 Martin Baulig <martin@ximian.com>
9932 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
9933 arguments; use it instead of creating a new TopLevelBlock.
9934 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
9935 our ConstructorInitializer.
9938 (TopLevelBlock.TopLevelBranching): New public property.
9939 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
9940 and create our `TopLevelBranching'.
9942 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
9943 anonymous method host, use `block.TopLevelBranching' rather than
9944 creating a new branching.
9946 2005-04-20 Miguel de Icaza <miguel@novell.com>
9948 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
9949 a ScopeInfo, if any of the current children is a child of the new
9950 entry, move those children there.
9952 2005-04-30 Martin Baulig <martin@ximian.com>
9954 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
9955 at the beginning of a SwitchSection. Fix #73335.
9957 2005-04-27 Marek Safar <marek.safar@seznam.cz>
9960 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
9962 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
9963 (FieldExpr.DoResolve): Obsolete members are ignored for field
9966 2005-04-26 Marek Safar <marek.safar@seznam.cz>
9968 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
9969 of arrays detection.
9971 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
9973 (Field.VerifyClsCompliance): Volatile fields are not compliant.
9975 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
9978 2005-04-25 Ben Maurer <bmaurer@ximian.com>
9980 * cs-parser.jay: Use the prefered version of -unsafe in error
9983 2005-04-22 Marek Safar <marek.safar@seznam.cz>
9985 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
9988 2005-04-20 John Luke <john.luke@gmail.com>
9990 * driver.cs: fix typo in error message, --outout to --output
9992 2005-04-20 Marek Safar <marek.safar@seznam.cz>
9994 * codegen.cs (InRefOutArgumentResolving): New field.
9996 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
9997 fields outside contructor.
9999 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
10001 2005-04-19 Miguel de Icaza <miguel@novell.com>
10003 * anonymous.cs (CaptureContext.EmitParameterInstance): The
10004 parameter code was not completed ever, so it was not as up-to-date
10005 as local variables. Must finish it.
10007 The bug fix was to compare the Toplevel of the block, not the
10008 current block. Thanks for Ben for pointing this out.
10010 2005-04-19 Raja R Harinath <rharinath@novell.com>
10012 * decl.cs (AddMethods): Use the declaring type of the problem
10013 method to determine if we want to squash a warning.
10015 2005-04-19 Marek Safar <marek.safar@seznam.cz>
10017 * attribute.cs: Removed debug output.
10019 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
10021 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
10024 2005-04-18 Raja R Harinath <rharinath@novell.com>
10027 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
10028 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
10029 all null comparisons against reference types.
10031 2005-04-18 Marek Safar <marek.safar@seznam.cz>
10034 * class.cs (TypeContainer.CircularDepException) New nested
10036 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
10037 (TypeContainer.DefineType): Removed error, reset InTransit before
10039 (Class.DefineType): Throw exception when is in Transit.
10040 Catch exception and report error.
10041 (Struct.DefineType): Throw exception when is in Transit.
10042 Catch exception and report error.
10043 (Interface.DefineType): Throw exception when is in Transit.
10044 Catch exception and report error.
10046 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
10047 handle nested exception handlers.
10049 * flowanalysis.cs (InTryWithCatch): New method, search for try with
10052 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
10053 InFinally and InCatch storage.
10055 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
10056 (Catch.Resolve): Set and Restore ec.InCatch.
10057 (Try.Resolve): Set and Restore ec.InFinally.
10058 (Try.HasCatch): True when try has catch.
10060 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
10062 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
10063 for the same event member, so exclude such cases from warning 419.
10066 2005-04-16 Miguel de Icaza <miguel@novell.com>
10068 * expression.cs (Binary.ResolveOperator): Apply patch from John
10069 Luke to fix bug 59864: operators &, | and ^ on enumerations
10070 require that the same enum type on both sides.
10072 * driver.cs: Add warnings to old flag usage, this is to assist
10073 people who produce Makefiles and hope that the Makefiles will be
10076 * class.cs (TypeContainer.EmitType): Moved the definition of the
10077 special $PRIVATE$ field from the resolve phase to the Emit phase.
10078 During resolve we do not know if we are a struct with
10079 HasExplicitLayout, we know this only after the attributes for the
10082 Set the FieldOffset to zero on the dummy field that we create for
10083 the class. Fixes 74590.
10085 2005-04-16 Raja R Harinath <rharinath@novell.com>
10088 * ecore.cs (PropertyExpr.resolved): New.
10089 (DoResolve): Use it to handle a case of double resolution here.
10090 Handle a case of identical-name-and-type-name.
10091 * expression.cs (ArrayCreation.CheckIndices): Avoid double
10092 resolution by storing the results of expression resolution back
10093 into the "probes" array.
10095 2005-04-15 Raja R Harinath <rharinath@novell.com>
10097 Fix cs0208-7.cs and cs0208-8.cs.
10098 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
10099 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
10100 error reporting to point out the reason a struct is not unmanaged.
10102 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
10104 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
10105 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
10107 2005-04-13 Raja R Harinath <rharinath@novell.com>
10110 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
10111 IdenticalNameAndTypeName here.
10112 (EventExpr.InstanceResolve): Likewise.
10114 2005-04-13 Marek Safar <marek.safar@seznam.cz>
10116 C# 2.0 DefaultCharSetAttribute implementation
10118 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
10119 which allows us to set GlobalNamespace for every resolve.
10120 (Attribute.ResolveArguments): Cut from Resolve.
10121 (Attribute.GetCharSetValue): Returns CharSet named argument.
10122 (Attribute.DefinePInvokeMethod): Gets default charset from
10124 (GlobalAttribute.ResolveAsTypeStep): Override.
10125 (GlobalAttribute.ResolveArguments): Override.
10127 * class.cs (TypeAttr): Is protected.
10129 * codegen.cs (ModuleClass.DefaultCharSet): New member.
10130 (ModuleClass.DefaultCharSetType): New memeber.
10131 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
10133 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
10134 charset from module.
10136 * delegate.cs (TypeAttr): Override.
10137 (Delegate.DefineType): Use this TypeAttr.
10139 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
10140 at very early stage (before types are defined) to resolve model
10141 module attributes. It will probably not work with corlib but it
10144 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
10145 charset from module.
10147 * typemanager.cs (default_charset_type): New type.
10149 2005-04-13 Raja R Harinath <rharinath@novell.com>
10151 * decl.cs (MemberCache.AddMethods): Don't warn if
10152 System.Object.Finalize has buggy MethodAttributes.
10154 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
10157 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
10159 * doc.cs : detect ambiguous reference to overloaded members.
10160 Fixed bug #71603. MS 1.1 csc does not detect it.
10162 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
10164 * doc.cs : delegates must not be referenced with parameters.
10167 2005-04-12 Miguel de Icaza <miguel@novell.com>
10169 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
10171 2005-04-10 Miguel de Icaza <miguel@novell.com>
10173 * driver.cs (MainDriver): Stop processing if the CLS stage found
10176 (CompilerCallableEntryPoint.InvokeCompiler): Always
10177 reset after execution; Take a TextWriter argument for the
10180 * report.cs: Use the error stream instead of hardcoding stderr.
10182 2005-04-09 Miguel de Icaza <miguel@novell.com>
10184 * class.cs: Reduce code paths to test, too small of an
10185 optimization to make it worth the extra testing. Always perform
10188 2005-04-08 Raja R Harinath <rharinath@novell.com>
10191 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
10192 operators that had errors reported on them.
10194 2005-04-08 Marek Safar <marek.safar@seznam.cz>
10196 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
10198 (Attribute.Resolve): Add named argument type checking.
10200 * class.cs (FixedField.Define): Use IsPrimitiveType
10202 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
10204 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
10205 unsafe parameter types.
10207 * statement.cs (Using.ResolveExpression): Add better error description.
10209 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
10211 2005-04-08 Raja R Harinath <rharinath@novell.com>
10214 * attribute.cs (Attribute.GetAttributeUsage): Resolve
10215 AttributeUsageAttribute in the emitcontext of the attribute class,
10216 not in the emitcontext of the attributable entity it was attached to.
10217 * cs-parser.jay: Use 'current_class', not 'current_container',
10218 when creating a GlobalAttribute.
10220 2005-04-08 Alp Toker <alp@atoker.com>
10222 * pending.cs: The fix to #58413 failed to compile methods implementing
10223 interfaces with/without params modifiers and vice versa, even though
10224 params modifiers aren't part of the signature. Make the modifier check
10225 less strict as in csc.
10227 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
10228 Anoob V E <projectmonokochi@rediffmail.com>
10229 Harilal P R <projectmonokochi@rediffmail.com>
10232 * pending.cs (TypeAndMethods.mods): New. Store the parameter
10233 modifiers of pending methods.
10234 (PendingImplementation.PendingImplementation): Initialize it.
10235 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
10236 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
10237 with ParameterData. Add check for modifiers.
10238 * class.cs (MethodData.Define): Update to changes.
10240 2005-04-07 Raja R Harinath <rharinath@novell.com>
10242 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
10244 2005-04-07 Marek Safar <marek.safar@seznam.cz>
10246 * class.cs (PropertyMethod.Define): Check private accessor in abstract
10249 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
10252 * typemanager.cs: Registered RequiredAttributeAttribute.
10254 2005-04-06 Marek Safar <marek.safar@seznam.cz>
10256 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
10257 Warning CS0169 is back at level 3.
10258 (IMethodData.SetMemberIsUsed): New method.
10260 * decl.cs (IsUsed): New value; moved from FieldBase.Status
10261 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
10263 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
10265 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
10267 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
10270 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
10273 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
10274 to avoid the problems with nested types.
10276 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
10277 Anoob V.E <projectmonokochi@rediffmail.com>
10278 Harilal P.R <projectmonokochi@rediffmail.com>
10279 Raja R Harinath <rharinath@novell.com>
10282 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
10284 * typemanager (GetConstructor): Make public.
10286 2005-04-05 John Luke <john.luke@gmail.com>
10287 Raja R Harinath <rharinath@novell.com>
10290 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
10291 struct too. Return false quicker in a few cases.
10292 (VerifyUnManaged): Use it.
10294 2005-04-05 Raja R Harinath <rharinath@novell.com>
10297 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
10298 not 'unreachable_seen'.
10300 2005-04-04 Marek Safar <marek.safar@seznam.cz>
10302 * attribute.cs (Attribute.GetValue): Removed unused.
10304 * codegen.cs (CodeGen.TrimExt): Removed unused.
10306 * cs-parser.jay (output): Removed unused.
10308 * cs-tokenizer.cs (hex_digits): Removed unused.
10310 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
10312 * expression.cs (Indirection.LoadExprValue): Removed unused.
10313 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
10315 * iterators.cs (Iterator.param_types): Removed unused.
10317 * statement.cs (Goto.block): Removed unused.
10318 (ToplevelBlock.did): Removed unused.
10319 (Switch.ResolveConstantSwitch): Removed unused.
10321 2005-04-01 Ben Maurer <bmaurer@ximian.com>
10323 * rootcontext.cs: Allow mcs to bootstrap with the compilation
10326 2005-04-01 Raja R Harinath <rharinath@novell.com>
10328 Fix #74232 and cs0208-3.cs.
10329 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
10330 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
10331 unmanaged type. Don't use FieldBuilders when 't' is a
10332 TypeBuilder. Use ModFlags and MemberType fields.
10333 * class.cs (MemberBase.member_type): Rename from MemberType.
10334 (MemberBase.MemberType): New property. Determines member_type on
10336 (MemberBase.DoDefine): Don't initialize MemberType here.
10337 (FieldMember.Define): Likewise.
10339 2005-04-01 Marek Safar <marek.safar@seznam.cz>
10342 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
10343 Attributes are emitted there.
10345 2005-04-01 Raja R Harinath <rharinath@novell.com>
10347 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
10348 keyword in 'partial enum' too.
10349 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
10351 Report from Kamil Skalski <nazgul@omega.pl>.
10354 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
10355 have partial containers too.
10357 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
10358 in block' checks to Block.CheckInvariantMeaningInBlock.
10359 * statement.cs (Block.GetKnownVariableInfo): Make private.
10360 (Block.IsVariableUsedInChildBlock): Remove.
10361 (Block.IsVariableUsedInBlock): Likewise.
10362 (Block.CheckInvariantMeaningInBlock): New. Show location of
10363 conflicting declaration.
10364 (Block.AddVariable): Make error messages less long-winded and more
10365 specific. Show location of conflicting declaration.
10366 * parameter.cs (Parameters.Location): New readonly property.
10368 2005-03-31 Raja R Harinath <rharinath@novell.com>
10370 Clean up semantics of invoking ResolveMemberAccess.
10371 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
10372 can have an instance, ensure that we pass in a non-TypeExpression
10373 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
10374 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
10375 argument. Update to changes and simplify.
10376 (FieldExpr.Emitinstance): Remove CS0120 check.
10377 (PropertyExpr.EmitInstance): Likewise.
10378 * expression.cs (Argument.Resolve): Likewise.
10379 (Invocation.DoResolve): Update to changes in semantics of
10380 InstanceExpression.
10382 2005-03-31 Marek Safar <marek.safar@seznam.cz>
10385 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
10388 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
10390 2005-03-31 Raja R Harinath <rharinath@novell.com>
10392 Fix difference in behaviour with commandline invocation.
10393 * driver.cs (Driver.Reset): New.
10394 (CompilerCallableEntryPoint): Call it.
10396 * statement.cs (If.Resolve): Avoid spurious "uninitialized
10397 variable" warnings if the boolean expression failed to resolve.
10399 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
10401 * attribute.cs: Fix the union of several permissions when some of them
10402 are unrestricted (so the result isn't an unrestricted permission set).
10405 2005-03-30 Raja R Harinath <rharinath@novell.com>
10407 * ecore.cs (MemberExpr): New class. Convert from interface
10409 (MemberExpr.ResolveMemberAccess): Refactor and move here from
10410 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
10412 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
10413 (MethodGroupExpr.IsExplicitImpl): Remove.
10414 (Expression.GetFieldFromEvent): Remove.
10415 (SimpleName.MemberStaticCheck): Remove.
10416 (SimpleName.DoSimpleNameResolve): Update to changes.
10417 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
10418 (MemberAccess.IdenticalNameAndTypeName): Remove.
10419 (MemberAccess.error176): Move to MemberExpr.
10420 (MemberAccess.DoResolve): Update to changes.
10421 (BaseAccess.DoResolve): Likewise.
10423 2005-03-30 Marek Safar <marek.safar@seznam.cz>
10425 C# 2.0 Conditional attribute class implementation
10427 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
10428 Analyzes class whether it has attribute which has ConditionalAttribute
10429 and its condition is not defined.
10431 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
10432 (Class.IsExcluded): New method. Search for at least one defined
10433 condition in ConditionalAttribute of attribute class.
10435 2005-03-30 Raja R Harinath <rharinath@novell.com>
10437 * ecore.cs (PropertyExpr): Derive from Expression, not
10438 ExpressionStatement.
10439 (PropertyExpr.EmitStatement): Remove.
10441 2005-03-29 Raja R Harinath <rharinath@novell.com>
10444 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
10445 internal field "value__" of an enum be private. The examples for
10446 "value__" that I found on MSDN all used FieldAttributes.Private.
10448 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
10449 Don't mention IL method attribute names.
10451 Fix #47991. Remove a TODO.
10452 * statement.cs (Block.Toplevel): Make into a field.
10453 (Block.Parameters): Move into ToplevelBlock.
10454 (Block.known_variables): Rename from child_variable_names.
10455 (Block.Block): Remove variants that take Parameters. Initialize
10456 'Toplevel' with the immediately surrounding toplevel block.
10457 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
10458 LocalInfo parameter.
10459 (Block.GetKnownVariableInfo): New.
10460 (Block.IsVariableNameUsedInChildBlock): Update.
10461 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
10462 the block, even though it may not be in scope.
10463 (Block.AddVariable): Remove Parameters parameter. Use
10464 Toplevel.Parameters instead.
10465 (Block.AddConstant): Remove Parameters parameter.
10466 (Block.GetParameterReference): Update to use Toplevel.Parameters.
10467 (Block.IsParamaterReference): Likewise.
10468 (Block.IsLocalParameter): Likewise. Simplify a lot.
10469 (ToplevelBlock.Parameters): New. Moved from Block.
10470 (ToplevelBlock.ToplevelBlock): Update to changes. Always
10471 initialize Parameters to a non-null value.
10472 * cs-parser.jay: Update to changes.
10473 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
10474 simple names that mean different things in the same block. Use
10475 Block.IsVariableNameUsedInBlock.
10477 2005-03-28 Raja R Harinath <rharinath@novell.com>
10479 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
10480 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
10481 GetTypeHandle. It is possible for a reflected type to derive from
10482 a TypeBuilder (e.g., int[] derives from the TypeBuilder
10483 System.Array during mscorlib compilation).
10484 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
10485 contain a method_hash, don't create one either. Don't create a
10486 deep copy of the base cache's method_hash.
10487 (MemberCache.SetupCache): Rename back from DeepCopy.
10488 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
10489 already initialized. If we see an override function, add its
10490 underlying base virtual function to the member_hash too.
10492 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
10494 2005-03-26 Raja R Harinath <harinath@acm.org>
10497 * assign.cs (Assign.DoResolve): When the RHS of an assignment
10498 fails to resolve, ensure that the LHS is still resolved as an
10501 2005-03-25 Raja R Harinath <harinath@acm.org>
10503 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
10505 (Enum.current_ec): Remove.
10506 (Enum.LookupEnumValue): Remove EmitContext argument.
10507 Just uses the one created during DefineType.
10508 (Enum.FindMembers): Update.
10509 * expression.cs (MemberAccess.DoResolve): Update.
10511 2005-03-22 Marek Safar <marek.safar@seznam.cz>
10513 * assign.cs (Assign.DoResolve): Check for CS1717 when
10514 source and target are same (uses Equals).
10516 * expression.cs (LocalVariableReference, ParameterReference,
10517 This): Implemented Equals, GetHashCode.
10519 * statement.cs (Block.GetParameterReference): Removed useless
10522 2005-03-22 Raja R Harinath <rharinath@novell.com>
10525 * statement.cs (Block.AddVariable): Ensure that we skip implicit
10526 blocks before deciding whether the error is cs0136 or cs0128.
10528 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
10529 (using_alias_directive, using_namespace_directive): Pass
10530 MemberName, not an expression to Namespace.UsingAlias and
10532 (MakeName): Use the MemberName of the namespace.
10533 * namespace.cs (Namespace.MemberName): New.
10534 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
10535 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
10537 * decl.cs (MemberName.Name): Make readonly.
10538 (MemberName.FromDotted): New "constructor".
10539 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
10540 (MemberCore.Name): Compute from MemberName on demand.
10541 (MemberCore.SetMemberName): Provide a way to change the
10543 (MemberCore.AddToContainer): Don't take a fullname parameter.
10544 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
10545 fully qualified name of the container to the member name.
10546 (TypeContainer.AddToTypeContainer): Use a fully qualified name
10547 only if the type is a member of the root container.
10548 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
10549 MemberName.Left rather than searching for an embedded ".".
10550 (PartialContainer.CreatePart): Update to changes in RootContext.
10551 (MemberBase.ShortName): Turn into a property. Use
10552 MemberCore.SetMemberName.
10553 (MemberBase.ExplicitInterfaceName): Remove.
10554 (MemberBase.UpdateMemberName): Remove.
10555 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
10556 (PropertyBase.SetMemberName): New override.
10557 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
10558 (Tree.GetDecl): New.
10559 (Tree.AllDecls): Rename from Decls.
10560 * attribute.cs, enum.cs, report.cs: Update to changes.
10561 * driver.cs (MainDriver): Use MemberName.FromDotted on
10562 RootContext.MainClass.
10564 2005-03-21 Marek Safar <marek.safar@seznam.cz>
10566 * class.cs (FixedField.Define): Check for CS1664 and more sanity
10569 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
10571 2005-03-18 Marek Safar <marek.safar@seznam.cz>
10573 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
10574 property accessor modifiers.
10576 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
10577 fixed buffer attribute (CS1716).
10578 (PropertyMethod.HasCustomAccessModifier): When property accessor
10579 has custom modifier.
10581 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
10583 (PropertyExpr.DoResolveLValue): Add CS0272.
10585 2005-03-17 Miguel de Icaza <miguel@novell.com>
10587 * convert.cs: When converting to a pointer, use the proper Conv.U
10588 or Conv.I depending on the source data type.
10590 * cs-tokenizer.cs: Make the size for large decimal constants,
10593 2005-03-17 Martin Baulig <martin@ximian.com>
10595 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
10596 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
10598 2005-03-17 Martin Baulig <martin@ximian.com>
10600 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
10601 to bool so we can return an error condition.
10602 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
10605 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
10607 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
10610 2005-03-16 Raja R Harinath <rharinath@novell.com>
10612 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
10613 Refactor to avoid traversing the list of assemblies, and to avoid
10614 string concatenation.
10615 * typemanager.cs (guid_attr_type): Remove.
10616 (negative_hits, pointers, references): Remove hashes.
10618 (GetConstructedType): New. Uses type_hash to handle constructed
10619 types (arrays, references, pointers).
10620 (GetReferenceType, GetPointerType): Use it.
10621 (GetNestedType): New. Uses type_hash to handle nested types of
10623 (LookupType, LookupTypeDirect): Remove.
10624 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
10625 'types' hash and LookupTypeReflection directly.
10626 (params_string, params_object): Use GetConstructedType.
10627 * namespace.cs (Namespace.cached_types): New. Cache of reflected
10629 (Namespace.Lookup): Use cached_types.
10630 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
10631 provided by old TypeManager.LookupType.
10632 * rootcontext.cs (MakeFQN): Remove.
10633 * decl.cs (DeclSpace.MakeFQN): Likewise.
10634 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
10635 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
10636 TypeManager.GetConstructedType.
10637 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
10639 2005-03-15 Marek Safar <marek.safar@seznam.cz>
10641 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
10644 * cs-parser.jay: Reports CS1527 for any namespace element.
10646 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
10649 * expression.cs (ParameterReference.IsAssigned): Changed error to
10651 (Error_WrongNumArguments): Moved CS0245 detection here.
10653 * statement.cs (Return.Resolve): Add CS1622 report.
10655 2005-03-11 Marek Safar <marek.safar@seznam.cz>
10657 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
10659 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
10661 * attribute.cs expression.cs: Get rid of some allocations.
10663 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
10665 * doc.cs : just eliminate the latest change.
10667 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
10669 * doc.cs : commented out the latest change. It breaks xml-030.cs
10671 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
10673 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
10674 fail. So invoke CreateType() in FindDocumentedType().
10676 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
10678 * cs-tokenizer.cs : added IsKeyword().
10679 * doc.cs : Detect keyword incorrectly used as identifier.
10680 Allow identifiers prefixed by @.
10682 2005-03-10 Marek Safar <marek.safar@seznam.cz>
10684 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
10685 It caused exception in namespace resolving (again!).
10687 * class.cs (Class.ctor): Removed exit.
10688 (PropertyMethod.ctor): ditto.
10690 * codegen.cs (Codegen.Reset): Reset static data.
10691 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
10693 * cs-tokenizer.cs (Cleanup): Removed.
10695 * driver.cs (GetSystemDir): Rewrote to one line command.
10696 It caused problem with unloaded dynamic modules.
10697 (UnixParseOption): Removed Exit.
10698 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
10699 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
10700 Now can be mcs used as library.
10702 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
10705 * location.cs (Reset): Reset static data.
10707 * namespace.cs (Reset): Reset static data.
10709 * report.cs (Report.Reset): Reset static data.
10711 * rootcontext.cs (RootContext.Reset): Reset static data.
10713 * tree.cs (RootTypes.ctor): Use Location.Null
10715 * typemanager.cs (TypeManager.Reset): Reset static data.
10716 (CoreLookupType): Removed Exit.
10717 (TypeHandle.Reset): Reset static data.
10719 2005-03-10 Raja R Harinath <rharinath@novell.com>
10722 * typemanager.cs (ComputeNamespaces): Import namespaces from
10723 referenced modules too.
10725 2005-03-09 Raja R Harinath <rharinath@novell.com>
10727 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
10730 2005-03-09 Raja R Harinath <rharinath@novell.com>
10732 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
10733 enclosing DeclSpace. This ensures that a name-lookup populates
10734 more caches and there are fewer 'TypeExpression's. Carve out
10735 nested type lookup into ...
10736 (LookupNestedTypeInHierarchy): ... this.
10738 2005-03-09 Raja R Harinath <rharinath@novell.com>
10740 Clean up a few partial-class semantics.
10741 Fixes test-357.cs and cs1618-2.cs.
10742 * cs-parser.jay (struct_declaration): Use 'current_class' as
10743 parent of newly-created struct. Remove call to Register ().
10744 Use 'pop_current_class' to complete handing the current struct.
10745 (interface_declaration): Likewise.
10746 (class_declaration): Likewise.
10747 (enum_declaration): Use 'current_class' as parent of newly created
10749 (delegate_declaration): Likewise.
10750 (pop_current_class): New function. This is used to handle closing
10751 up the 'current_class' and 'current_container', and pointing them
10752 to the enclosing class/container.
10753 (CSharpParser): Initialize 'current_class' too.
10754 * decl.cs (MemberCore): Add check for invariant: a partial
10755 container is not a parsed entity, and thus does not enclose any
10757 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
10758 (DeclSpace.BaseTypeExpr): Use it.
10759 (DeclSpace.LookupType): Add check for invariant.
10760 * class.cs (TypeContainer): Add check for invariant: a nested
10761 class should have the same NamespaceEntry as its enclosing class.
10762 (TypeContainer.EmitFieldInitializers): Make virtual.
10763 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
10765 (TypeContainer.Register): Remove.
10766 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
10767 null. Use TypeResolveEmitContext for resolving base types and
10768 interfaces. Move initialization of Parts.TypeBuilder here from
10770 (TypeContainer.DefineNestedTypes): ... here.
10771 (PartialContainer): Take a Namespace not a NamespaceEntry.
10772 (PartialContainer.Create): Don't use Register. Call the
10773 appropriate Add... function directly.
10774 (ClassPart): Take both the PartialContainer and the enclosing
10775 class as constructor arguments.
10776 (ClassPart.EmitFieldInitializers): Override.
10777 (ClassPart.PartFindNestedTypes): Remove.
10778 (FieldBase.GetInitializerExpression): Resolve the initializer
10779 expression in the emit context of the enclosing class.
10780 * tree.cs (RootTypes): Remove Register ().
10782 2005-03-08 Marek Safar <marek.safar@seznam.cz>
10784 * cs-parser.jay: Removed CS0134.
10786 * driver.cs: Removed CS1901.
10788 * expression.cs (SizeOf.DoResolve): Don't report CS0233
10789 for predefined types.
10791 2005-03-07 Duncan Mak <duncan@novell.com>
10793 * codegen.cs (Save): Catch UnauthorizedAccessException as
10794 well. Fixes bug #73454.
10796 2005-03-07 Marek Safar <marek.safar@seznam.cz>
10798 * cs-tokenizer.cs (xtoken): Add CS1035.
10800 * class.cs (MethodData.Define): Add CS0683.
10801 (FieldMember.ctor): Add CS0681.
10803 2005-03-07 Raja R Harinath <rharinath@novell.com>
10805 * ecore.cs (SimpleName.DoResolve): Rename from
10806 SimpleName.DoResolveAllowStatic.
10807 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
10808 Pass 'intermediate' flag to MemberStaticCheck.
10809 (SimpleName.MemberStaticCheck): Skip "static check" only in case
10810 of "intermediate" lookups via MemberAccess.
10811 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
10812 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
10814 2005-03-07 Raja R Harinath <rharinath@novell.com>
10817 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
10818 slipped in because of variable names that are identical to a
10819 builtin type's BCL equivalent ('string String;', 'int Int32;').
10820 (PropertyExpr.EmitInstance): Likewise.
10822 2005-03-04 Marek Safar <marek.safar@seznam.cz>
10824 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
10826 * report.cs (warning_ignore_table): Made public.
10828 2005-03-04 Raja R Harinath <rharinath@novell.com>
10831 * class.cs (MethodData.Emit): Pass 'container' to
10832 container.GetObsoleteAttribute instead of 'container.Parent'.
10834 2005-03-03 Marek Safar <marek.safar@seznam.cz>
10836 * cs-parser.jay: Add 1534 error test.
10838 * iterators.cs (Yield.CheckContext): Add error 1629.
10839 (Iterator.ctor): Save unsafe modifier.
10840 (MoveNextMethod.DoEmit): Restore unsafe context.
10842 * namespace.cs (UsingAlias): Better error message.
10844 2005-03-03 Dan Winship <danw@novell.com>
10846 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
10847 the warning message [#73219]
10849 2005-03-03 Raja R Harinath <rharinath@novell.com>
10851 Fix compile with MCS 1.0.0.0.
10852 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
10853 w_restore to not depend on string constant folding.
10855 2005-03-03 Raja R Harinath <rharinath@novell.com>
10857 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
10858 CS0246 check to users who passed 'silent = false'.
10859 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
10861 (SimpleName.SimpleNameResolve): Update.
10862 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
10863 (MemberAccess.IdenticalNameAndTypeName): Update.
10864 * doc.cs (FindDocumentedTypeNonArray): Update.
10866 2005-03-03 Raja R Harinath <rharinath@novell.com>
10868 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
10869 * parameters.cs (ComputeAndDefineParameters): Remove.
10870 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
10871 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
10872 Use GetParameterInfo.
10874 2005-03-02 Marek Safar <marek.safar@seznam.cz>
10876 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
10878 2005-03-02 Raja R Harinath <rharinath@novell.com>
10880 Unify DeclSpace.LookupType and DeclSpace.FindType.
10881 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
10882 is in charge of defining nested types on demand.
10883 (DeclSpace.LookupType): Use it when the current_type is a
10884 TypeBuilder. Use LookupTypeDirect for reflected types.
10885 (DeclSpace.FindType): Remove.
10886 (DeclSpace.LookupInterfaceOrClass): Likewise.
10887 (DeclSpace.DefineTypeAndParents): Likewise.
10888 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
10889 DeclSpace.LookupType.
10890 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
10891 * typemanager.cs (LookupType): Simplify.
10892 (AddUserType): Remove type from negative_hits.
10893 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
10894 * class.cs (TypeContainer.FindMembers): Move handling of nested
10896 (TypeContainer.FindMembers_NestedTypes): ... here.
10897 (TypeContainer.FindNestedType): Implement override.
10898 (ClassPart.FindNestedType): Delegate to PartialContainer.
10899 (ClassPart.PartFindNestedType): Looks up the nested types of the
10902 2005-03-02 Martin Baulig <martin@ximian.com>
10904 * class.cs (TypeContainer.DoDefineMembers): We also need a default
10905 static constructor in static classes.
10907 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
10909 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
10910 sizeParamIndex is not specified.
10912 2005-03-01 Marek Safar <marek.safar@seznam.cz>
10915 * report.cs (WarningMessage.IsEnabled): Missing null check.
10917 2005-02-28 Marek Safar <marek.safar@seznam.cz>
10919 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
10920 in the fields and not in the properties.
10922 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
10924 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
10927 2005-02-28 Marek Safar <marek.safar@seznam.cz>
10929 * attribute.cs: Small refactoring (improved robustness).
10930 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
10931 (ValidateGuid): Removed.
10932 (Resolve): Removed referenced to above mentioned.
10933 (GetAttributeUsage): Made private and changed to work without
10935 (GetIndexerAttributeValue): Don't crash.
10936 (GetConditionalAttributeValue): Ditto.
10937 (GetClsCompliantAttributeValue): Ditto.
10938 (ExtractSecurityPermissionSet): All attributes exceptions are
10940 (GetPropertyValue): New helper.
10941 (GetMethodImplOptions): New method.
10942 (DefinePInvokeMethod): Reuse common code. Implemented handling of
10943 some missing properties.
10945 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
10946 (Method.ApplyAttributeBuilder): Updated.
10948 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
10951 2005-02-28 Raja R Harinath <rharinath@novell.com>
10954 * report.cs (Report.SymbolRelatedToPreviousError): Handle
10955 non-simple types (array, pointer, reference).
10957 2005-02-28 Marek Safar <marek.safar@seznam.cz>
10959 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
10961 * class.cs (MethodCore.IsDuplicateImplementation): Special error
10963 (Method.CheckBase): Catch wrong destructor here.
10964 (MethodData.Define): Add errors 550, 668.
10966 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
10968 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
10970 * pending.cs (VerifyPendingMethods): Add error 551.
10972 * typemanager.cs (CSharpName): Next error report helper.
10974 2005-02-25 Marek Safar <marek.safar@seznam.cz>
10976 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
10977 attributes. Removed useless attribute double check.
10978 It saves almost 2MBs for corlib.
10980 2005-02-25 Raja R Harinath <rharinath@novell.com>
10983 * statement.cs (ExpressionStatement.Resolve): Make robust to being
10984 called twice in case of error.
10986 2005-02-23 Chris Toshok <toshok@ximian.com>
10988 Fix compiler portions of #72827.
10989 * statement.cs (Block.Emit): call Begin/EndScope on the
10990 EmitContext instead of the ILGenerator.
10992 * codegen.cs (EmitContext.BeginScope): new method, call
10993 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
10995 (EmitContext.BeginScope): same, but EndScope and CloseScope
10997 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
10998 offset and call the superclass's OpenScope(int) with it.
10999 (SymbolWriter.CloseScope): get the current il
11000 offset and call superclass's CloseScope(int) with it.
11002 2005-02-23 Marek Safar <marek.safar@seznam.cz>
11004 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
11005 CS1677 for out and ref as well.
11007 * class.cs (Method.Define): Add error CS1599 detection.
11009 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
11011 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
11013 * delegate.cs (Delegate.Define): Add error CS1599 detection.
11015 * support.cs.cs (ModifierDesc): New helper method.
11017 2005-02-23 Raja R Harinath <rharinath@novell.com>
11018 Abin Thomas <projectmonokochi@rediffmail.com>
11019 Anoob V E <projectmonokochi@rediffmail.com>
11020 Harilal P R <projectmonokochi@rediffmail.com>
11022 Fix #57851, #72718.
11023 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
11024 MemberLookup (used for error reporting) actually returns a result.
11025 Fix error report number (122, not 112).
11027 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
11028 Anoob V E <projectmonokochi@rediffmail.com>
11029 Harilal P R <projectmonokochi@rediffmail.com>
11032 * pending.cs (PendingImplementation.GetAbstractMethods):
11033 Find NonPublic members too.
11035 2005-02-22 Marek Safar <marek.safar@seznam.cz>
11037 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
11040 * class.cs (MethodCore.CheckMethodAgainstBase):
11041 Add error 239 report.
11043 2005-02-21 Raja R Harinath <rharinath@novell.com>
11046 * expression.cs (Invocation.IsApplicable): Make public.
11047 (Invocation.IsParamsMethodApplicable): Likewise.
11048 * delegate.cs (Delegate.VerifyApplicability): Don't use
11049 Invocation.VerifyArgumentCompat for parameter applicability
11050 testing. Use Invocation.IsApplicable and
11051 Invocation.IsParamsMethodApplicable.
11053 2005-02-21 Marek Safar <marek.safar@seznam.cz>
11055 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
11057 * class.cs (Operator.Define): Add error 217 report.
11059 2005-02-21 Raja R Harinath <rharinath@novell.com>
11061 * namespace.cs (UsingEntry.Resolve): Undo change below.
11063 2005-02-21 Raja R Harinath <rharinath@novell.com>
11066 * ecore.cs (Expression.MemberLookupFailed): Add argument to
11067 disable the error message when the extended MemberLookup also
11069 (Expression.MemberLookupFinal): Update.
11070 (SimpleName.DoSimpleNameResolve): Update.
11071 * expression.cs (MemberAccess.ResolveNamespaceOrType):
11072 Don't use MemberLookupFinal.
11073 (New.DoResolve): Update.
11074 (BaseAccess.CommonResolve): Update.
11076 2005-02-21 Raja R Harinath <rharinath@novell.com>
11079 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
11080 occured previously, don't resolve again.
11082 2005-02-21 Marek Safar <marek.safar@seznam.cz>
11085 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
11086 argument. Call ResolveAttributeUsage for unresolved.
11087 when types doesn't match ctor arguments.
11089 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
11090 for nested attribute classes.
11091 (Class.attribute_usage): Removed.
11092 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
11093 for attribute class.
11095 * ecore.cs (IsAttribute): Removed.
11097 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
11099 * rootcontext.cs (RegisterAttribute): Removed, attributes are
11101 (attribute_types): Removed.
11102 (EmitCode): Global attributes are emited as the latest.
11104 2005-02-18 Marek Safar <marek.safar@seznam.cz>
11106 * class.cs (EmitFieldInitializers): Don't emit field initializer
11107 for default values when optimilization is on.
11109 * constant.cs (Constant.IsDefaultValue): New property.
11111 * driver.cs: Add /optimize handling.
11115 * literal.cs: Implement new IsDefaultValue property.
11117 * rootcontext.cs (Optimize): New field, holds /optimize option.
11119 2005-02-18 Raja R Harinath <rharinath@novell.com>
11121 Fix crasher in re-opened #72347.
11122 * namespace.cs (Namespace.Lookup): Return null if
11123 DeclSpace.DefineType returns null.
11126 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
11128 2005-02-18 Raja R Harinath <rharinath@novell.com>
11130 Fix remainder of #63202. Change semantics of DoResolveLValue: it
11131 now returns null if it cannot resolve to an lvalue.
11132 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
11133 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
11134 returned null. Remove check for SimpleName.
11135 (EventExpr.DoResolveLValue): New.
11136 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
11137 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
11139 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
11140 avoid CS0131 error.
11141 (Unary.ResolveOperator): Move CS0211 check ...
11142 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
11144 (Unary.DoResolveLValue): Simplify.
11145 (AddressOf.DoResolveLValue): New.
11146 (ArrayAccess.DoResolveLValue): New.
11148 2005-02-16 Marek Safar <marek.safar@seznam.cz>
11150 * attribute.cs (Attribute.Resolve): Add arguments casting for
11151 when types doesn't match ctor arguments.
11153 2005-02-16 Raja R Harinath <rharinath@novell.com>
11155 Fix parts of #63202.
11156 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
11157 lookup of operator in base type. Ensure that all checks happen
11158 when the operator resolves to an "op_..." method.
11160 2005-02-15 Raja R Harinath <rharinath@novell.com>
11163 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
11164 'ignore_cs0104' parameter. Pass it to ...
11165 (NamespaceEntry.Lookup): ... this.
11166 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
11167 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
11168 (TypeLookupExpression.DoResolveAsTypeStep): Update.
11169 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
11170 Update. Request that cs0104 errors be ignored.
11171 (ComposedCast.ResolveAsTypeStep): Update.
11173 2005-02-14 Raja R Harinath <rharinath@novell.com>
11176 * expression.cs (Invocation.BetterFunction): Remove support for
11177 comparing virtual functions and their overrides.
11178 (Invocation.IsOverride): New.
11179 (Invocation.OverloadResolve): Don't consider 'override' functions
11180 during candidate selection. Store them in a lookaside list.
11181 If the selected method is a 'virtual' function, use the list to
11182 find any overrides that are closer to the LHS type.
11184 2005-02-14 Marek Safar <marek.safar@seznam.cz>
11186 * expression.cs (New.DoResolve): Add complex core type reduction.
11187 (New.Constantify): Converts complex core type syntax like 'new int ()'
11188 to simple constant.
11190 2005-02-14 Raja R Harinath <rharinath@novell.com>
11192 * decl.cs (EntryType.EntryType): New constructor to create an
11193 updated copy of a cache entry.
11194 (MemberCache.AddMethods): Use it.
11195 (MemberCache.ClearDeclaredOnly): Remove.
11196 (MemberCache.MemberCache): Update.
11198 2005-02-11 Miguel de Icaza <miguel@novell.com>
11200 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
11201 variable. This one is represents the actual low-level declaration
11202 of the method, as opposed to the semantic level `IsStatic'.
11204 An anonymous method which is hosted into a static method might be
11205 actually an instance method. IsStatic would reflect the
11206 container, while MethodIsStatic represents the actual code
11209 * expression.cs (ParameterReference): Use the new MethodIsStatic
11210 instead of IsStatic.
11212 * anonymous.cs (AnonymousMethod.Compatible): Pass the
11213 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
11214 set on the current EmitContext.
11216 * expression.cs (Cast): Overload DoResolveLValue so we can pass
11217 resolve our casted expression as an LValue. This triggers the
11218 proper LValue processing that is later required by Assign.
11222 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
11224 2005-02-11 Marek Safar <marek.safar@seznam.cz>
11226 C# 2.0 Fixed buffer implementation
11228 * anonymous.cs: Update after RegisterHelperClass renaming.
11230 * attribute.cs (AttributeTester.fixed_buffer_cache):
11231 Cache of external fixed buffers.
11232 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
11233 implementation if field is fixed buffer else null.
11236 (TypeContainer.AddField): Accept FieldMember instead of Field.
11237 (FieldBase.IsFieldClsCompliant): Extracted code from
11238 VerifyClsCompliance descendant customization.
11239 (FixedField): New class handles fixed buffer fields.
11240 (FixedFieldExternal): Keeps information about imported fixed
11242 (IFixedField): Make access to internal or external fixed buffer
11245 * cs-parser.jay: Add fixed buffer parsing.
11247 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
11250 * expression.cs (Indirection): Extended implementation to accept
11251 fixed buffer field.
11252 (PointerArithmetic.Emit): Get element from fixed buffer as well.
11253 (ElementAccess.MakePointerAccess): Get type as parameter.
11254 (DoResolve): Add fixed buffer field expression conversion.
11255 (DoResolveLValue): Ditto.
11256 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
11257 (ArrayPtr): Derives from FixedBufferPtr.
11258 (ArrayPtr.Emit): Add extra emit for array elements.
11260 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
11262 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
11263 for compiler generated types.
11264 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
11266 * statement.cs (Fixed): Refactored to be easier add fixed buffer
11267 and consume less memory.
11268 (Fixed.Resolve): Add fixed buffer case.
11270 * typemanager.cs (compiler_generated_attr_ctor,
11271 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
11272 (HasElementType): Add our own implementation to work on every
11275 2005-02-11 Miguel de Icaza <miguel@novell.com>
11277 * anonymous.cs (CaptureContext): Track whether `this' has been
11280 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
11281 only captured `this' if it was implicitly done (instance
11282 methods/variables were used).
11284 * codegen.cs (EmitContext.CaptureThis): New method to flag that
11285 `this' must be captured.
11287 2005-01-30 Miguel de Icaza <miguel@novell.com>
11289 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
11290 is null it means that there has been no need to capture anything,
11291 so we just create a sibling.
11293 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
11295 Just a partial fix. The other half is fairly elusive.
11297 2005-02-10 Raja R Harinath <rharinath@novell.com>
11299 Fix #52586, cs0121-4.cs.
11300 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
11301 and return a hashtable.
11302 (MemberCache.ClearDeclaredOnly): New.
11303 (MemberCache.MemberCache): Update to change. Make a deep copy of
11304 the method_hash of a base type too.
11305 (MemberCache.AddMethods): Adapt to having a deep copy of the base
11306 type methods. Overwrite entries with the same MethodHandle so
11307 that the ReflectedType is correct. The process leaves in base
11308 virtual functions and their overrides as distinct entries.
11309 (CacheEntry): Now a class instead of a struct. It shouldn't alter
11310 matters since it was boxed in a ArrayList before.
11311 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
11313 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
11314 case of a virtual function and its override (choose the overload
11316 (Invocation.OverloadResolve): Avoid 'override' members during
11317 'applicable_type' calculation.
11319 2005-02-09 Raja R Harinath <rharinath@novell.com>
11321 Combine two near-redundant caches.
11322 * typemanager.cs (method_params): Rename from method_internal_params.
11323 (TypeManager.GetParameterData): New. Replace
11324 Invocation.GetParameterData.
11325 (TypeManager.LookupParametersByBuilder): Remove.
11326 * expression.cs (Invocation.method_parameter_cache): Remove.
11327 (Invocation.GetParameterData): Remove.
11329 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
11332 2005-02-08 Raja R Harinath <rharinath@novell.com>
11335 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
11336 TypeManager.multicast_delegate_type is null, resolve it by looking
11337 up "System.MulticastDelegate".
11338 * rootcontext.cs (RootContext.ResolveCore): Simplify.
11340 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
11341 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
11342 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
11345 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
11346 (LabeledStatement.AddReference): New. Set 'referenced'.
11347 (Goto.Resolve): Use it.
11349 2005-02-05 John Luke <john.luke@gmail.com>
11351 * driver.cs: remove duplicate -doc line in Usage ()
11353 2005-02-04 Raja R Harinath <rharinath@novell.com>
11355 * location.cs (Location.AddFile): Fix CS2002 error report.
11357 2005-02-02 Martin Baulig <martin@ximian.com>
11359 * delegate.cs (Delegate.DefineType): Report an internal error if
11360 TypeManager.multicast_delegate_type is null. See bug #72015 for
11363 2005-02-02 Raja R Harinath <rharinath@novell.com>
11365 Fix a crasher in a variant of #31984.
11366 * const.cs (Constant.CheckBase): New override that defers the
11367 new-or-override check in case the base type hasn't been populated
11369 (Constant.Define): Ensure the new-or-override check is performed.
11371 2005-02-01 Duncan Mak <duncan@ximian.com>
11373 * const.cs (LookupConstantValue): Check that `ce' is not null
11374 before calling GetValue ().
11376 2005-02-01 Raja R Harinath <rharinath@novell.com>
11378 Fix test-334.cs (#69519).
11379 * cs-parser.jay (using_alias_directive): Pass in an expression to
11380 NamespaceEntry.UsingAlias.
11381 (using_namespace_directive): Pass in an expression to
11382 NamespaceEntry.Using.
11383 (namespace_name): Don't flatten to a string.
11384 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
11385 (NamespaceEntry.AliasEntry.Resolve): Lookup using
11387 (NamespaceEntry.UsingEntry): Likewise.
11388 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
11390 (NamespaceEntry.LookupForUsing): Remove.
11391 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
11393 (NamespaceEntry.Lookup): Remove support for dotted names.
11395 2005-02-01 Raja R Harinath <rharinath@novell.com>
11397 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
11399 (NamespaceEntry.ImplicitParent): Compute on demand.
11400 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
11401 parallels the current.
11402 (NamespaceEntry.LookupForUsing): Use it.
11403 (NamespaceEntry.Lookup): If the current namespace-entry is
11404 implicit, don't search aliases and using tables.
11406 2005-02-01 Raja R Harinath <rharinath@novell.com>
11409 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
11411 (TypeContainer.BaseCache): Compute on demand.
11412 (TypeContainer.FindMembers): Define constants and types if they're
11413 not already created.
11414 (FieldMember.Define): Move resetting of ec.InUnsafe before error
11416 * const.cs (Constant.Define): Make idempotent.
11418 2005-01-29 Miguel de Icaza <miguel@novell.com>
11420 * pending.cs: Produce better code (no nops produced by using Ldarg
11423 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
11424 i - 1' it should be arg + 1.
11428 2005-01-28 Raja R Harinath <rharinath@novell.com>
11430 * attribute.cs (Attribute.CheckAttributeType): Make private
11432 (Attribute.ResolveType): Make virtual.
11433 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
11434 handling of RootContext.Tree.Types.
11436 2005-01-27 Raja R Harinath <rharinath@novell.com>
11438 Update attribute-handling to use the SimpleName/MemberAccess
11440 * cs-parser.jay (attribute): Pass in an expression to the
11441 constructors of Attribute and GlobalAttribute.
11442 * attribute.cs (Attribute): Take an expression for the name.
11443 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
11444 passed in attribute name expression.
11445 (Attribute.CheckAttributeType): Use it.
11446 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
11447 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
11448 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
11449 argument to prevent error messages if the lookup fails.
11451 2005-01-27 Marek Safar <marek.safar@seznam.cz>
11453 * expression.cs (Indirection): Implemented IVariable interface
11454 to support indirection in AddressOf operator.
11455 (PointerArithmetic.Emit): Add optimalization for case where
11456 result can be precomputed.
11458 2005-01-26 Martin Baulig <martin@ximian.com>
11460 * class.cs (TypeContainer.AttributeTargets): Return the correct
11461 AttributeTargets depending on our `Kind' instead of throwing an
11462 exception; fixes #71632.
11464 2005-01-26 Marek Safar <marek.safar@seznam.cz>
11467 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
11470 2005-01-25 Raja R Harinath <rharinath@novell.com>
11473 * expression.cs (MemberAccess.DoResolve): Don't complain with
11474 cs0572 when the LHS of a member access has identical name and type
11477 2005-01-25 Marek Safar <marek.safar@seznam.cz>
11480 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
11482 Create custom PermissionSet only for PermissionSetAttribute.
11484 2005-01-24 Marek Safar <marek.safar@seznam.cz>
11487 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
11488 delegates in static class.
11490 2005-01-24 Martin Baulig <martin@ximian.com>
11492 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11493 merging an implicit block, just use its reachability.
11495 * statement.cs (Block.Resolve): Make the unreachable code check
11496 work wrt. implicit blocks; see test-337 from #63842.
11498 2005-01-21 Alp Toker <alp@atoker.com>
11500 * cs-parser.jay: destructor_declaration's container is PartialContainer
11501 not Class when partial types are used, so use Kind prop instead of
11504 2005-01-22 Miguel de Icaza <miguel@ximian.com>
11506 * cs-parser.jay: Improve error reporting when an interface
11507 declares new types.
11509 2005-01-20 Dick Porter <dick@ximian.com>
11511 * support.cs: SeekableStreamReader fix from Sandor Dobos
11512 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
11513 chars are read. Fixes bug 70369.
11515 2005-01-20 Raja R Harinath <rharinath@novell.com>
11517 * cs-parser.jay (catch_clause): Simplify current_block handling
11520 2005-01-17 Miguel de Icaza <miguel@ximian.com>
11522 * convert.cs (ImplicitStandardConversionExists): Synchronize the
11523 code with ImplicitStandardConversion to handle the implicit
11524 conversion of method groups into valid delegate invocations.
11526 The problem is that in parameter handling we were using this code
11527 path. Fixes bug #64698
11529 2005-01-19 Raja R Harinath <rharinath@novell.com>
11531 * cs-parser.jay: Fix several infelicities.
11532 - Avoid assigning to the parser value stack. Code like
11533 '$3 = null' is unclean. Synthesize a value for the code block
11535 - Avoid using oob_stack for storing location information. Use ...
11536 (_mark_): ... this. New (empty) rule. Saves the current location
11538 (foreach_statement): Avoid using oob_stack for current_block
11539 handling. Use technique used in for_statement and
11540 using_statement. Synthesize a value for the code block to store
11541 additional intermediate information.
11543 2005-01-13 Miguel de Icaza <miguel@ximian.com>
11545 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
11546 of a different type is only allowed to private fields of a
11547 containing type, not on fields of a base class.
11549 See test-174.cs and error cs0122-9.cs
11551 2005-01-13 Raja R Harinath <rharinath@novell.com>
11553 Fix test-335.cs (bug #58126).
11554 * cs-parser.jay (argument): Split out non-expression parts of the
11555 rule into 'non_simple_argument'.
11556 (invocation_expression): Support parenthesized invocations with
11557 multiple arguments, and with single non-simple arguments.
11559 2005-01-13 Raja R Harinath <rharinath@novell.com>
11561 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
11564 2005-01-12 Raja R Harinath <rharinath@novell.com>
11566 Fix cs0038-1.cs, cs1640-6.cs.
11567 * ecore.cs (Expression.Resolve): Remove special-case for
11568 SimpleName in error-handling.
11569 (Expression.almostMatchedMembers): Relax access permission to
11571 (Expression.MemberLookupFailed): Handle duplicates in
11572 almostMatchedMembers list.
11573 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
11574 * expression.cs (New.DoResolve): Report CS1540 for more cases.
11575 * typemanager.cs (GetFullNameSignature): Use the MethodBase
11576 overload if the passed in MemberInfo is a MethodBase.
11578 2005-01-12 Marek Safar <marek.safar@seznam.cz>
11581 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
11582 for non-CAS & merge permission sets properly.
11584 2005-01-11 Raja R Harinath <rharinath@novell.com>
11586 Improve standard-compliance of simple name and member access
11587 resolution. Fixes bugs #52697, #57200, #67520, #69519.
11588 * ecore.cs (FullNamedExpression): New abstract base class
11589 for Namespaces and TypeExpressions.
11590 (ResolveFlags.SimpleName): Remove.
11591 (SimpleName): Remove support for dotted names.
11592 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
11593 DeclSpace.FindType and DeclSpace.LookupType.
11594 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
11595 (Expression.ExprClassName): Make member function.
11596 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
11597 a namespace. Remove creation of dotted "SimpleName"s.
11598 (MemberAccess.DoResolve): Likewise.
11599 * decl.cs (DeclSpace.Cache): Make private.
11600 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
11601 (DeclSpace.FindType): Update.
11602 (DeclSpace.LookupType): Move here from RootContext. Return a
11603 FullNamedExpression.
11604 * namespace.cs (Namespace): Derive from FullNamedExpression
11605 so that it can be part of expression resolution.
11606 (Namespace.Lookup): Return an FullNamedExpression.
11607 (NamespaceEntry.LookupAlias): Lookup aliases only in current
11609 * rootcontext.cs (NamespaceLookup): Remove.
11610 (LookupType): Move to DeclSpace.
11611 * attribute.cs (CheckAttributeType): Update.
11612 * doc.cs (FindDocumentedType): Remove allowAlias argument.
11613 (FindDocumentedTypeNonArray): Likewise.
11615 2005-01-11 Raja R Harinath <rharinath@novell.com>
11617 Fix cs0509.cs, cs1632.cs.
11618 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
11619 is the same as IsInterface.
11620 (TypeContainer.GetClassBases): Likewise.
11621 * statement.cs (LabeledStatement.ig): New field.
11622 (LabeledStatement.LabelTarget): Save ILGenerator which created the
11624 (LabeledStatement.DoEmit): Check that the label was created with
11625 the same ILGenerator.
11627 2005-01-10 Marek Safar <marek.safar@seznam.cz>
11630 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
11631 accessors to its properties.
11633 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
11634 from accessors to property.
11636 2005-01-10 Marek Safar <marek.safar@seznam.cz>
11639 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
11640 only for overrides.
11642 2005-01-08 Miguel de Icaza <miguel@ximian.com>
11644 * attribute.cs: Check for null and empty strings.
11646 I have lost another battle to Paolo.
11648 2005-01-07 Marek Safar <marek.safar@seznam.cz>
11651 * class.cs (PropertyMethod): Set Parent field in ctors.
11652 (SetMethod.InternalParameters): Add unsafe switch hack.
11653 Override MarkForDuplicationCheck where it is appropriate.
11655 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
11656 It says whether container allows members with the same name.
11657 Base default is no.
11658 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
11659 Removed is_method parameter.
11661 2005-01-06 Duncan Mak <duncan@ximian.com>
11663 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
11664 because the previous change led to incorrect reporting of CS1032
11665 ("Cannot define/undefine preprocessor symbols after first token in
11666 file"). Instead of using `tokens_seen' as the only flag that
11667 triggers CS1040, introduce `comments_seen'. This new flag is used
11668 to signify having seen comments on the current line, so it is
11669 unset after a newline.
11671 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
11673 * doc.cs : When searching for a type, find nested type too.
11674 This fixes bug #71040.
11676 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
11679 - Warn missing member comment on those classes which also does not
11680 have doc comments. Fixed bug #71041.
11681 - Don't warn missing doc comment on default constructor.
11684 2005-01-06 Duncan Mak <duncan@ximian.com>
11686 * cs-tokenizer.cs (xtoken): After handling traditional C-style
11687 comments, set `tokens_seen' to true. This allows us to detect
11688 misplaced preprocessor directives (i.e. not at the beginning of
11689 the a line, nor after whitespaces). In that case, report error
11690 CS1040. This fixes bug #56460.
11692 * cs-parser.jay (interface_member_declaration): Add checks for
11693 IsExplicitImpl, and report CS0541 error if an interface member is
11694 defined as an explicit interface declaration.
11696 2005-01-06 Marek Safar <marek.safar@seznam.cz>
11699 * class.cs (PropertyMethod): Set Parent field in ctors.
11700 (SetMethod.InternalParameters): Add unsafe switch hack.
11702 * decl.cs (MemberCore.Parent): Cannot be readonly.
11704 2005-01-06 Raja R Harinath <rharinath@novell.com>
11706 * decl.cs (DeclSpace.ResolveType): Remove.
11707 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
11708 Merge in code from ...
11709 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
11710 * class.cs, enum.cs: Update to changes.
11712 2005-01-06 Miguel de Icaza <miguel@ximian.com>
11714 * anonymous.cs: Ensure that we init the scope of our parent if it
11715 has not been initialized yet.
11717 2004-12-30 Duncan Mak <duncan@ximian.com>
11719 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
11720 if field.FieldBuilder is null. Fixes #70758.
11722 * convert.cs: Fixed some typos and updated some of the comments.
11723 (ImplicitStandardConversionExists):
11724 (TryImplicitIntConversion): If `target_type' is an interface and
11725 the type of `ic' implements this interface, return true or a new
11726 BoxedCast instead of null. This fixes #70468.
11728 2004-12-29 Duncan Mak <duncan@ximian.com>
11730 * expression.cs (Argument.Emit): Check that Expr is
11731 IMemoryLocation before casting to it, and report CS1510 otherwise.
11735 2004-12-21 Ben Maurer <bmaurer@ximian.com>
11737 * statement.cs (Block.ThisVariable): remove the recursion here, to
11738 make the --profile more sane.
11740 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
11742 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
11743 assembly, by JB Evain.
11745 2004-12-17 Raja R Harinath <rharinath@novell.com>
11747 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
11748 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
11749 "parent" refers to enclosing type/class. "base" refers to superclass.
11751 2004-12-17 Raja R Harinath <rharinath@novell.com>
11753 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11754 Ensure that we only have GlobalAttributes.
11755 * attribute.cs (Attribute.Emit): Make non-virtual.
11756 (GlobalAttribute.Emit): Remove.
11757 (Attribute.Resolve): Make virtual.
11758 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
11759 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
11760 the argument. Don't create one.
11761 (Attribute.GetObsoleteAttribute): Likewise.
11762 (Attribute.GetClsCompliantAttributeValue): Likewise.
11763 * class.cs, decl.cs: Update to changes.
11765 2004-12-17 Marek Safar <marek.safar@seznam.cz>
11767 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
11769 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
11771 * statement.cs (Foreach.Resolve): Add error 186 report.
11773 2004-12-16 Marek Safar <marek.safar@seznam.cz>
11775 * expression.cs (Conditional.DoResolve): Add warning 429.
11777 * statement.cs (If.Resolve): Add warning 665.
11779 2004-12-16 Raja R Harinath <rharinath@novell.com>
11781 New invariant: RootContext.Tree.Types.NamespaceEntry == null
11782 except when in the parser, and in GlobalAttribute.
11783 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
11784 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
11785 RootContext.Tree.Types.NamespaceEntry once work is done.
11786 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
11787 and resets RootContext.Tree.Types.NamespaceEntry.
11789 2004-12-15 Marek Safar <marek.safar@seznam.cz>
11791 * cs-parser.jay: Don't create a block for every variable.
11793 2004-12-14 Miguel de Icaza <miguel@ximian.com>
11795 * location.cs: Provide extra information.
11797 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
11798 variables from the captured environment, it is the ldarg_0.
11800 2004-12-14 Marek Safar <marek.safar@seznam.cz>
11802 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
11805 * class.cs: Changed warning level for 169 to avoid developer
11806 displeasure from warning flooding. It will be changed back when they
11807 fix most of current BCL warnings.
11809 * RootContext.cs: Pushed default WarningLevel to 3.
11811 * statement.cs: Removed unused variable.
11813 2004-12-14 Marek Safar <marek.safar@seznam.cz>
11815 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
11816 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
11817 Add error 502 report.
11818 (StaticClass.DefineType): Add error 441 report.
11819 (Class.AllowedModifiersProp): New virtual property as temporary
11820 extension to AllowedModifiers.
11821 (Class.DefineType): Add error 418 report. Moved ModFlags check here
11822 to share implementation with StaticClass and don't call virtual
11825 * driver.cs (MainDriver): Add error 1558 test.
11827 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
11828 report. Moved error 36 test here.
11830 * statement.cs (Throw.Resolve): Add error 724 report.
11832 * typemanager.cs: Add out_attribute_type core type.
11834 2004-12-13 Marek Safar <marek.safar@seznam.cz>
11836 * class.cs (TypeContainer.VerifyClsCompliance): Add error
11838 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
11840 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
11843 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
11845 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
11846 Add error 3023 report.
11847 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
11849 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
11852 2004-12-12 John Luke <john.luke@gmail.com>
11854 * driver.cs (AddArgs): take -- into account when
11855 adding arguments, fixes bug 65710
11857 2004-12-12 Martin Baulig <martin@ximian.com>
11859 * expression.cs (Unary.TryReduceNegative): Added support for
11860 SByteConstant and ByteConstant.
11861 (Unary.Reduce): Check error values from TryReduceNegative().
11863 2004-12-10 Marek Safar <marek.safar@seznam.cz>
11865 * attributes.cs (Attribute.Resolve): Avoid multiple error report
11866 and report exception as error 182.
11868 2004-12-10 Raja R Harinath <rharinath@novell.com>
11870 * driver.cs (Main): Fix message when there are warnings.
11872 2004-12-09 Miguel de Icaza <miguel@ximian.com>
11874 * delegate.cs: Fixed my fix from yesterday, sorry about that.
11876 2004-12-09 Marek Safar <marek.safar@seznam.cz>
11878 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
11879 Reduced number of warnings.
11881 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
11883 2004-12-08 Miguel de Icaza <miguel@ximian.com>
11885 * driver.cs: Removed message.
11887 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
11889 2004-12-08 <vargaz@freemail.hu>
11891 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
11893 2004-12-08 Martin Baulig <martin@ximian.com>
11895 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
11896 instead of a CS3002 for properties and indexer.
11898 2004-12-08 Martin Baulig <martin@ximian.com>
11900 * decl.cs (MemberName.ToString): Make this work again.
11902 2004-12-08 Marek Safar <marek.safar@seznam.cz>
11904 * attribute.cs (Resolve): Add error 591 detection.
11906 * class.cs (FieldMember.Define): Add error 1547 detection.
11907 (Indexer.Define): Add error 620 detection.
11908 (Operator.Define): Add error 590 detection.
11910 * ecore.cs: Missing argument for error 79.
11912 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
11915 2004-12-07 Marek Safar <marek.safar@seznam.cz>
11918 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
11921 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
11923 * cs-parser.jay : handle doc comments on implicit/explicit operators.
11924 Some operator comments were suppressed.
11925 * doc.cs : Implicit/explicit operator name in doc comments are like
11926 "op_Explicit(type)~returnType", so added suffix handling.
11928 2004-12-07 Martin Baulig <martin@ximian.com>
11931 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
11932 (MemberCore.GetClsCompliantAttributeValue): Likewise.
11933 (DeclSpace.ec): New protected field; store the EmitContext here.
11934 (DeclSpace.EmitContext): New public property; moved here from
11936 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
11939 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
11940 (Enum.Emit): Don't create a new EmitContext.
11942 * delegate.cs (Delegate.DefineType): Always create the
11945 * iterators.cs (Iterators.DefineIterator): Create a new
11946 EmitContext and store it in `ec'.
11948 2004-08-24 Martin Baulig <martin@ximian.com>
11951 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
11952 this for accessibility checks.
11953 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
11954 IsNestedFamilyAccessible.
11955 (TypeManager.IsSubclassOf): New method, do what the name actually
11958 2004-12-06 Raja R Harinath <rharinath@novell.com>
11960 Fix crash on cs0657-17.cs.
11961 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11962 Use RootContext.Tree.Types, not 'new RootTypes ()'.
11963 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
11964 the case where the NamespaceEntry gets overwritten.
11966 2004-12-06 Marek Safar <marek.safar@seznam.cz>
11968 Fixed #69195, #56821
11969 * ecore.cs (ResolveBoolean): Tiny refactoring.
11971 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
11972 of right expression resolving when left is false constant and
11973 operator is LogicalAnd OR true constant and operator is LogicalOr.
11975 * statement.cs (ResolveUnreachable): Always reports warning.
11977 2004-12-05 Miguel de Icaza <miguel@ximian.com>
11979 * class.cs: Distinguish between 1721 and 1722 (just a little help
11980 for the programmer).
11982 2004-12-03 Miguel de Icaza <miguel@ximian.com>
11984 * delegate.cs: Only allow this on new versions of the language.
11986 2004-12-02 Duncan Mak <duncan@ximian.com>
11988 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
11990 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
11991 here as a static method. Take an additional bool out parameter
11992 `must_do_cs1540_check' for signaling to InstanceResolve.
11993 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
11994 member field from PropertyExpr class and made it an argument of
11995 the method instead.
11996 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
11997 check for MarshalByRefObject, and report CS0122 instead of CS1540.
11998 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
11999 and `remove_accessor' as well as InstanceResolve: report CS0122
12004 2004-12-03 Raja R Harinath <rharinath@novell.com>
12006 Fix test-327.cs, test-328.cs, and put in early infrastructure
12007 for eventually fixing #52697.
12008 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
12009 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
12010 from other methods.
12011 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
12012 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
12013 (VerifyUsing, error246): Update.
12014 * rootcontext.cs (RootContext.NamespaceLookup): Just use
12015 'NamespaceEntry.LookupNamespaceOrType'.
12017 2004-12-03 Martin Baulig <martin@ximian.com>
12019 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
12020 method as our child, call AnonymousMethod.Compatible() on it.
12022 2004-12-03 Raja R Harinath <rharinath@novell.com>
12024 Disable XML documentation support in 'basic' profile.
12025 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
12026 Redirect XmlElement to System.Object.
12027 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
12028 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
12029 * mcs.exe.sources: Add doc-bootstrap.cs.
12030 * doc-bootstrap.cs: New file. Contains empty stub implementation
12033 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
12035 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
12036 comments are allowed.
12038 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
12040 * delegate.cs: Add checks for subtypes in paramaters and return values
12041 in VerifyMethod () to add support for Covariance/Contravariance
12044 2004-12-02 Miguel de Icaza <miguel@ximian.com>
12046 * report.cs: Remove extra closing parenthesis.
12048 * convert.cs (Error_CannotImplicitConversion): If the name of the
12049 types are the same, provide some extra information.
12051 * class.cs (FieldBase): Use an unused bit field from the field to
12052 encode the `has_offset' property from the FieldMember. This saves
12053 a couple of Ks on bootstrap compilation.
12055 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
12056 method as our child, return the AnonymousMethod resolved
12059 * expression.cs (New.DoResolve): Allow return values from
12060 NewDelegate to also include AnonymousMethods.
12064 2004-12-02 Marek Safar <marek.safar@seznam.cz>
12067 * attribute.cs (Resolve): Improved implementation of params
12068 attribute arguments.
12070 * support.cs (ParameterData): Add HasParams to be faster.
12072 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
12074 all things are for /doc support:
12076 * doc.cs: new file that supports XML documentation generation.
12077 * mcs.exe.sources: added doc.cs.
12079 Handle /doc command line option.
12080 Report error 2006 instead of 5 for missing file name for /doc.
12081 Generate XML documentation when required, after type resolution.
12083 Added support for picking up documentation (/// and /** ... */),
12084 including a new XmlCommentState enumeration.
12086 Added lines to fill Documentation element for field, constant,
12087 property, indexer, method, constructor, destructor, operator, event
12088 and class, struct, interface, delegate, enum.
12089 Added lines to warn incorrect comment.
12091 Added Documentation field (passed only when /doc was specified).
12093 Added DocComment, DocCommentHeader, GenerateDocComment() and
12094 OnGenerateDocComment() and some supporting private members for
12095 /doc feature to MemberCore.
12097 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
12099 Added overriden DocCommentHeader.
12101 Added overriden DocCommentHeader and GenerateDocComment().
12103 2004-12-01 Miguel de Icaza <miguel@ximian.com>
12105 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
12106 unwrapping the enumeration values, chain to
12107 DoConstantNumericPromotions again, so we can promote things to the
12108 fundamental types (takes care of enums that are bytes, sbytes).
12112 2004-12-01 Raja R Harinath <rharinath@novell.com>
12114 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
12115 Fix long-standing bug in type-lookup. Use FindType instead of
12116 LookupType when ec.ResolvingTypeTree.
12117 (Attribute.ResolveType, Attribute.Resolve)
12118 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
12120 (Attributes.Search): Remove internal version. Update.
12121 (Attributes.SearchMulti): Update.
12122 (Attributes.GetClsCompliantAttribute): Remove.
12123 (Attributes.GetIndexerNameAttribute): Remove.
12124 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
12125 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
12126 * class.cs (Indexer.Define): Likewise.
12128 2004-12-01 Marek Safar <marek.safar@seznam.cz>
12131 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
12132 MarshallByReference members access.
12134 * expression.cs: Use CheckMarshallByRefAccess;
12135 Better error CS0197 message.
12137 * report.cs: Print whole related error message.
12139 2004-11-30 Raja R Harinath <rharinath@novell.com>
12141 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
12142 the current directory to help debugging.
12144 2004-11-29 Marek Safar <marek.safar@seznam.cz>
12146 * class (GetClassBases): Better error 60 report.
12147 (EventProperty): Disabled warning 67 detection.
12149 2004-11-29 Marek Safar <marek.safar@seznam.cz>
12152 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
12154 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
12157 2004-11-29 Marek Safar <marek.safar@seznam.cz>
12160 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
12162 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
12164 2004-11-26 Miguel de Icaza <miguel@ximian.com>
12166 * attribute.cs (Attribute.Resolve): Refine error reporting and
12167 report a cs0117 if the identifier does not exist, to distinguish
12168 from 0617 which is a miss-use of the actual identifier.
12170 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
12171 between cs0070 and cs0079.
12173 * class.cs (MemberBase.DoDefine): When reporting a wrong
12174 accessibility level, we use MethodCore to compare instead of
12175 Method (this was a regression in some refactoring effort).
12177 So now we correctly report cs0056 again.
12179 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
12180 testing the target_type (which was known to be object_type) and
12181 not the source type (which is anonymous_method).
12183 Fixed reporting of error cs1660.
12185 * expression.cs (UserCast.Source): Expose the underlying cast.
12187 * statement.cs (Switch.SwitchGoverningType): Sort the list of
12188 allowed types to find a match to int32 first (most common).
12190 In addition, it ignores any ImplicitUserConversions that did an
12191 internal implicit conversion (as the switch statement allows only
12192 one integral conversion to exist).
12194 * class.cs (PartialContainer.Create): rename `name' to
12195 `member_name' for clarity. Then replace the string calls with a
12196 call to MemberName.GetPartialName, as now using
12197 MemberName.ToString is an error (this is due to the side effects
12198 it had, that were fixed in the past).
12200 This will restore the error reporting on a number of partial class
12201 errors that were missusing this (and getting an exception as a
12202 results, which is now just a plain textual warning, because
12203 yyparse debug output would crash otherwise).
12205 2004-11-26 Raja R Harinath <rharinath@novell.com>
12207 * Makefile (PROGRAM_INSTALL_DIR): Remove.
12209 2004-11-25 Ben Maurer <bmaurer@ximian.com>
12211 * rootcontext.cs (LookupType): Make sure to cache lookups that
12212 don't give us a negative result. This saves about 5% of corlib
12215 2004-11-25 Miguel de Icaza <miguel@ximian.com>
12217 * report.cs (AbstractMessage.Print): messages are sent to stderr
12219 * class.cs (TypeContainer.GetClassBases): It is an error to have a
12220 non-interface in the list of interfaces (at this point, either
12221 parent was properly set, or a base class is being listed in the
12222 interfaces section).
12224 This flags error 1722, and resolves the crash from bug 69259.
12226 2004-11-25 Ben Maurer <bmaurer@ximian.com>
12228 * statement.cs (Using.EmitExpressionFinally): make this work right
12229 for valuetypes. Fixes 69926.
12231 2004-11-25 Miguel de Icaza <miguel@ximian.com>
12233 * const.cs (Const.ChangeType): Cope with the "0 literal can be
12234 converted to an enum" here, before we try to change the underlying
12235 type. This code exists, but it is a different code path than the
12236 one used while encoding constants.
12238 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
12239 old bug: when converting from the null literal to a pointer,
12240 return an EmptyCast, not the NullLiteral.
12242 This fixes #69921, the recent null_type changes probably made this
12243 bug more prominent.
12245 (ImplicitReferenceConversionExists): In addition, resynchronized
12246 the code here, so it matches the same code in
12247 ImplicitReferenceConversionExists for the `from any class-type S
12248 to any interface-type T'.
12251 2004-11-25 Marek Safar <marek.safar@seznam.cz>
12253 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
12255 2004-11-24 Miguel de Icaza <miguel@ximian.com>
12257 * cs-parser.jay: Use verbosity accordingly.
12259 2004-11-24 Marek Safar <marek.safar@seznam.cz>
12261 * expression.cs (Unary.ResolveOperator): Do not report warning;
12262 AddressOf reads from variable.
12264 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
12266 2004-11-24 Marek Safar <marek.safar@seznam.cz>
12270 * attribute.cs (Attributable): Removed CheckTargets.
12271 (Attributes.Emit): Explicit attribute targets are tested here.
12273 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
12274 not enabled for interfaces.
12276 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
12277 (GetAssemblyName): Ouch next bug there.
12279 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
12281 * expression.cs: Error 275 added.
12283 2004-11-23 Marek Safar <marek.safar@seznam.cz>
12285 Fix bug #69177 (Implemented decimal constant support)
12287 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
12288 (BinaryFold): Add DecimalConstant.
12290 * const.cs (Define): Decimal constant
12292 (ChangeType): Add decimal type handling.
12293 (LookupConstantValue): Don't set value for decimal type but
12294 emit DecimalConstantAttribute. Needed for constant optimization.
12296 * constant.cs (ToDecimal): New method.
12297 (ConvertToDecimal): New method.
12298 (IntConstant): Implemented ConvertToDecimal.
12299 (DecimalConstant.Emit): Emit optimized version for decimals in
12302 * expression.cs (ResolveOperator): Changed order of constant
12303 reduction to work correctly with native types which have
12304 overloaded operators.
12305 (ResolveMemberAccess): Extract constant value from attribute
12308 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
12310 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
12311 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
12312 (ChangeType): Decimal is special.
12313 (TypeToCoreType): Add decimal type.
12315 2004-11-22 Marek Safar <marek.safar@seznam.cz>
12317 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
12320 2004-11-22 Marek Safar <marek.safar@seznam.cz>
12322 * class.cs (EventField.ApplyAttributeBuilder): Fix error
12325 2004-11-19 Marek Safar <marek.safar@seznam.cz>
12327 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
12329 * pending.cs (PendingImplementation): Grab only interfaces.
12331 2004-11-19 Marek Safar <marek.safar@seznam.cz>
12333 * statement.cs (ForeachHelperMethods): Add location member and
12334 error 202 detection.
12336 2004-11-19 Raja R Harinath <rharinath@novell.com>
12338 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
12339 automatically handled by executable.make.
12340 (PROGRAM): Make profile-specific.
12342 2004-11-18 Marek Safar <marek.safar@seznam.cz>
12344 * expression.cs (DoResolveBase): Fixed wrong warning for out
12347 2004-11-18 Martin Baulig <martin@ximian.com>
12349 Merged latest changes into gmcs. Please keep this comment in
12350 here, it makes it easier for me to see what changed in MCS since
12351 the last time I merged.
12353 2004-11-17 Raja R Harinath <rharinath@novell.com>
12355 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
12356 (TypeHandle.GetMemberCache): New.
12357 (TypeHandle.TypeHandle): Update.
12358 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
12359 (TypeManager.LookupParentInterfacesCache):
12360 Rename from LookupInterfaceCache. Optimize slightly.
12361 (TypeManager.MemberLookup_FindMembers): Update.
12362 * decl.cs (MemberCache.MemberCache): Set Container to null in the
12363 multi-type variant.
12364 (AddCacheContents): Rename from AddHashtable.
12365 * class.cs (TypeContainer.parent_container): Remove.
12366 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
12367 (TypeContainer.DoDefineMembers): Don't initialize it.
12368 Update to name changes.
12370 2004-11-17 Miguel de Icaza <miguel@ximian.com>
12372 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
12373 that factors the code to check access modifiers on override.
12375 (PropertyBase): Use the code here.
12377 Patch from Lluis S'anchez, fixes bug #69361.
12379 2004-11-15 Miguel de Icaza <miguel@ximian.com>
12381 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
12382 routine that is used to report the use of a captured variable
12383 whose address has been taken.
12385 There are two checks: one when variables are being captured and
12386 the other check is when the address of a variable is taken.
12388 (because an anonymous methods might be resolved before *or* after
12389 the address has been taken) and
12391 * expression.cs (Conditional.DoResolve): Remove the special
12392 casing that Martin added to trueExpr and falseExpr being both
12393 NullLiteral. We get the right behavior now just by introducing
12394 the null_type into the compiler.
12396 * convert.cs (ExplicitConversion): Change the code to use
12397 null_type instead of testing `expr is NullLiteral'.
12398 (ImplicitConversionStandard): use null_type too.
12399 (ImplicitReferenceConversionExists): use null_type too.
12400 (ImplicitReferenceConversion): use null_type too.
12402 * literal.cs: The type of `NullLiteral' is now null_type instead
12404 (Resolve): Set the type here.
12406 * typemanager.cs: Introduce null_type.
12408 2004-11-17 Martin Baulig <martin@ximian.com>
12410 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
12411 direction, like FindMembers() does. Fixes #69546, testcase is in
12414 2004-11-16 Martin Baulig <martin@ximian.com>
12416 This is based on a patch from Marek Safar, see bug #69082.
12417 Fixes bugs #63705 and #67130.
12419 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
12420 method; create a MemberCache for an interface type and cache the
12423 * decl.cs (IMemberContainer.ParentContainer): Removed.
12424 (IMemberContainer.ParentCache): New property.
12425 (MemberCache.SetupCacheForInterface): Removed.
12426 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
12427 to create a cache for an interface's "parent".
12429 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
12432 2004-11-16 Martin Baulig <martin@ximian.com>
12434 Merged back from gmcs; these changes already went into gmcs a
12435 couple of weeks ago.
12438 (TypeManager.AddUserType): Removed the `ifaces' argument.
12439 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
12441 (TypeManager.AddUserInterface): Removed.
12442 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
12444 (TypeManager.GetInterfaces): Likewise.
12445 (TypeManager.GetExplicitInterfaces): Likewise.
12447 * ecore.cs (TypeExpr.GetInterfaces): Removed.
12449 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
12450 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
12452 2004-11-14 Ben Maurer <bmaurer@ximian.com>
12454 * statement.cs: Avoid adding bools to a hashtable.
12456 2004-11-07 Miguel de Icaza <miguel@ximian.com>
12458 * expression.cs (Invocation.OverloadResolve): Flag error if we are
12459 calling an unsafe method from a safe location.
12461 2004-11-06 Marek Safar <marek.safar@seznam.cz>
12464 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
12466 2004-11-06 Miguel de Icaza <miguel@ximian.com>
12468 * namespace.cs (VerifyUsing): use GetPartialName instead of
12471 2004-11-05 Miguel de Icaza <miguel@ximian.com>
12473 * statement.cs (Return.Resolve): Fix regression in typo: if
12474 `in_exc', we have to request a NeedReturnLabel, this was a typo
12475 introduced in the anonymous method check-in. Fixes #69131.
12477 * Indexers were using the ShortName when defining themselves,
12478 causing a regression in the compiler bootstrap when applying the
12479 patch from 2004-11-02 (first part), now they use their full name
12480 and the bug is gone.
12482 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
12484 * driver.cs: Strip the path from the names of embedded resources. Fixes
12487 2004-11-04 Raja R Harinath <rharinath@novell.com>
12489 Fix error message regression: cs0104-2.cs.
12490 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
12491 (AliasEntry.Resolve): Update.
12492 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
12494 (RootContext.LookupType): Update.
12496 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
12498 * cs-parser.jay: Add support for handling accessor modifiers
12499 * class: Add support port accessor modifiers and error checking,
12500 define PropertyMethod.Define as virtual (not abstract anymore)
12501 * ecore.cs: Add checking for proeprties access with access modifiers
12502 * iterators.cs: Modify Accessor constructor call based in the modified
12504 2004-11-02 Ben Maurer <bmaurer@ximian.com>
12506 * expression.cs (StringConcat): Handle being called twice,
12507 as when we have a concat in a field init with more than two
12510 2004-11-02 Miguel de Icaza <miguel@ximian.com>
12512 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
12513 special case explicit implementations, we should always produce
12514 the .property or .event declaration.
12516 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
12517 since it will not return correct data if people use this
12518 unresolved in the presence of using statements (see test-313).
12520 * class.cs (MethodData.Define): If we are an explicit interface
12521 implementation, set the method name to the full name of the
12522 interface plus the name of the method.
12524 Notice that using the method.MethodName.GetFullName() does not
12525 work, as it will only contain the name as declared on the source
12526 file (it can be a shorthand in the presence of using statements)
12527 and not the fully qualifed type name, for example:
12531 class D : ICloneable {
12532 object ICloneable.Clone () {
12536 Would produce a method called `ICloneable.Clone' instead of
12537 `System.ICloneable.Clone'.
12539 * namespace.cs (Alias.Resolve): Use GetPartialName.
12541 2004-11-01 Marek Safar <marek.safar@seznam.cz>
12543 * cs-parser.jay: Add error 1055 report.
12545 2004-11-01 Miguel de Icaza <miguel@ximian.com>
12547 * assign.cs (Assign.DoResolve): Only do the transform of
12548 assignment into a New if the types are compatible, if not, fall
12549 through and let the implicit code deal with the errors and with
12550 the necessary conversions.
12552 2004-11-01 Marek Safar <marek.safar@seznam.cz>
12554 * cs-parser.jay: Add error 1031 report.
12556 * cs-tokenizer.cs: Add location for error 1038.
12558 2004-10-31 Marek Safar <marek.safar@seznam.cz>
12560 * cs-parser.jay: Add error 1016 report.
12562 2004-10-31 Marek Safar <marek.safar@seznam.cz>
12564 * cs-parser.jay: Add errors 1575,1611 report.
12566 2004-10-31 Marek Safar <marek.safar@seznam.cz>
12568 * cs-parser.jay: Add error 1001 report.
12570 2004-10-31 Marek Safar <marek.safar@seznam.cz>
12573 * attribute.cs (GetMarshal): Add method argument for
12574 caller identification.
12576 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
12577 agument for GetMarshal and RuntimeMissingSupport.
12579 2004-10-31 Marek Safar <marek.safar@seznam.cz>
12581 * attribute.cs (ExtractSecurityPermissionSet): Removed
12582 TypeManager.code_access_permission_type.
12584 * typemanager.cs: Removed TypeManager.code_access_permission_type.
12586 2004-10-27 Miguel de Icaza <miguel@ximian.com>
12588 * expression.cs (LocalVariableReference.DoResolveLValue): Check
12589 for obsolete use of a variable here. Fixes regression on errors
12590 cs0619-25 and cs0619-26.
12592 2004-10-27 Marek Safar <marek.safar@seznam.cz>
12594 Fix #62358, implemented security attribute encoding.
12596 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
12597 Tests permitted SecurityAction for assembly or other types.
12598 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
12599 data from SecurityPermissionAttribute to PermisionSet class.
12601 * class.cs (ApplyAttributeBuilder): Added special handling
12602 for System.Security.Permissions.SecurityAttribute based types.
12604 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
12605 special handling for System.Security.Permissions.SecurityAttribute
12608 * enum.cs (ApplyAttributeBuilder): Added special handling
12609 for System.Security.Permissions.SecurityAttribute based types.
12611 * parameter.cs (ApplyAttributeBuilder): Added special handling
12612 for System.Security.Permissions.SecurityAttribute based types.
12614 * rootcontext.cs: Next 2 core types.
12616 * typemanager.cs (TypeManager.security_permission_attr_type):
12617 Built in type for the SecurityPermission Attribute.
12618 (code_access_permission_type): Build in type.
12620 2004-10-17 Miguel de Icaza <miguel@ximian.com>
12622 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
12623 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
12624 all of this information into
12625 EmitContext.EmitCapturedVariableInstance.
12627 * codegen.cs (EmitCapturedVariableInstance): move here the
12628 funcionality of emitting an ldarg.0 in the presence of a
12629 remapping. This centralizes the instance emit code.
12631 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
12632 then emit a load of this: it means that we have reached the
12633 topmost ScopeInfo: the one that contains the pointer to the
12634 instance of the class hosting the anonymous method.
12636 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
12637 captures to the topmost CaptureContext.
12639 2004-10-12 Miguel de Icaza <miguel@ximian.com>
12641 * expression.cs (LocalVariableReference): Move the knowledge about
12642 the iterators into codegen's EmitCapturedVariableInstance.
12644 2004-10-11 Miguel de Icaza <miguel@ximian.com>
12646 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
12647 all code paths return a value from an anonymous method (it is the
12648 same as the 161 error, but for anonymous methods).
12650 2004-10-08 Miguel de Icaza <miguel@ximian.com>
12652 The introduction of anonymous methods in the compiler changed
12653 various ways of doing things in the compiler. The most
12654 significant one is the hard split between the resolution phase
12655 and the emission phases of the compiler.
12657 For instance, routines that referenced local variables no
12658 longer can safely create temporary variables during the
12659 resolution phase: they must do so from the emission phase,
12660 since the variable might have been "captured", hence access to
12661 it can not be done with the local-variable operations from the runtime.
12665 (Block.Flags): New flag `IsTopLevel' to indicate that this block
12666 is a toplevel block.
12668 (ToplevelBlock): A new kind of Block, these are the blocks that
12669 are created by the parser for all toplevel method bodies. These
12670 include methods, accessors and anonymous methods.
12672 These contain some extra information not found in regular blocks:
12673 A pointer to an optional CaptureContext (for tracking captured
12674 local variables and parameters). A pointer to the parent
12677 (Return.Resolve): Catch missmatches when returning a value from an
12678 anonymous method (error 1662).
12679 Invoke NeedReturnLabel from the Resolve phase instead of the emit
12682 (Break.Resolve): ditto.
12684 (SwitchLabel): instead of defining the labels during the
12685 resolution phase, we now turned the public ILLabel and ILLabelCode
12686 labels into methods called GetILLabelCode() and GetILLabel() that
12687 only define the label during the Emit phase.
12689 (GotoCase): Track the SwitchLabel instead of the computed label
12690 (its contained therein). Emit the code by using
12691 SwitchLabel.GetILLabelCode ().
12693 (LocalInfo.Flags.Captured): A new flag has been introduce to track
12694 whether the Local has been captured or not.
12696 (LocalInfo.IsCaptured): New property, used to tell whether the
12697 local has been captured.
12699 * anonymous.cs: Vastly updated to contain the anonymous method
12702 The main classes here are: CaptureContext which tracks any
12703 captured information for a toplevel block and ScopeInfo used to
12704 track the activation frames for various local variables.
12706 Each toplevel block has an optional capture context associated
12707 with it. When a method contains an anonymous method both the
12708 toplevel method and the anonymous method will create a capture
12709 context. When variables or parameters are captured, they are
12710 recorded on the CaptureContext that owns them, for example:
12714 MyDelegate d = delegate {
12719 Here `a' will be recorded as captured on the toplevel
12720 CapturedContext, the inner captured context will not have anything
12721 (it will only have data if local variables or parameters from it
12722 are captured in a nested anonymous method.
12724 The ScopeInfo is used to track the activation frames for local
12725 variables, for example:
12727 for (int i = 0; i < 10; i++)
12728 for (int j = 0; j < 10; j++){
12729 MyDelegate d = delegate {
12734 At runtime this captures a single captured variable `i', but it
12735 captures 10 different versions of the variable `j'. The variable
12736 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
12737 recorded on a child.
12739 The toplevel ScopeInfo will also track information like the `this'
12740 pointer if instance variables were referenced (this is necessary
12741 as the anonymous method lives inside a nested class in the host
12742 type of the method).
12744 (AnonymousMethod): Expanded to track the Toplevel, implement
12745 `AnonymousMethod.Compatible' to tell whether an anonymous method
12746 can be converted to a target delegate type.
12748 The routine now also produces the anonymous method content
12750 (AnonymousDelegate): A helper class that derives from
12751 DelegateCreation, this is used to generate the code necessary to
12752 produce the delegate for the anonymous method that was created.
12754 * assign.cs: API adjustments for new changes in
12755 Convert.ImplicitStandardConversionExists.
12757 * class.cs: Adjustments to cope with the fact that now toplevel
12758 blocks are of type `ToplevelBlock'.
12760 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
12761 insteda of standard blocks.
12763 Flag errors if params arguments are passed to anonymous methods.
12765 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
12766 `CurrentAnonymousMethod' which points to the current Anonymous
12767 Method. The variable points to the AnonymousMethod class that
12768 holds the code being compiled. It is set in the new EmitContext
12769 created for the anonymous method.
12771 (EmitContext.Phase): Introduce a variable and an enumeration to
12772 assist in enforcing some rules about when and where we are allowed
12773 to invoke certain methods (EmitContext.NeedsReturnLabel is the
12774 only one that enfonces this right now).
12776 (EmitContext.HaveCaptureInfo): new helper method that returns
12777 whether we have a CapturedContext initialized.
12779 (EmitContext.CaptureVariable): New method used to register that a
12780 LocalInfo must be flagged for capturing.
12782 (EmitContext.CapturedParameter): New method used to register that a
12783 parameters must be flagged for capturing.
12785 (EmitContext.CapturedField): New method used to register that a
12786 field must be flagged for capturing.
12788 (EmitContext.HaveCapturedVariables,
12789 EmitContext.HaveCapturedFields): Return whether there are captured
12790 variables or fields.
12792 (EmitContext.EmitMethodHostInstance): This is used to emit the
12793 instance for the anonymous method. The instance might be null
12794 (static methods), this (for anonymous methods that capture nothing
12795 and happen to live side-by-side with the current method body) or a
12796 more complicated expression if the method has a CaptureContext.
12798 (EmitContext.EmitTopBlock): Routine that drives the emission of
12799 code: it will first resolve the top block, then emit any metadata
12800 and then emit the code. The split is done so that we can extract
12801 any anonymous methods and flag any captured variables/parameters.
12803 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
12804 during this phase, the ILGenerator should not be used as labels
12805 and local variables declared here might not be accessible to any
12806 code that is part of an anonymous method.
12808 Exceptions to this include the temporary variables that are
12809 created by some statements internally for holding temporary
12812 (EmitContext.EmitMeta): New routine, in charge of emitting all the
12815 (EmitContext.TemporaryReturn): This method is typically called
12816 from the Emit phase, and its the only place where we allow the
12817 ReturnLabel to be defined other than the EmitMeta. The reason is
12818 that otherwise we would have to duplicate a lot of logic in the
12819 Resolve phases of various methods that today is on the Emit
12822 (EmitContext.NeedReturnLabel): This no longer creates the label,
12823 as the ILGenerator is not valid during the resolve phase.
12825 (EmitContext.EmitThis): Extended the knowledge in this class to
12826 work in anonymous methods in addition to iterators.
12828 (EmitContext.EmitCapturedVariableInstance): This emits whatever
12829 code is necessary on the stack to access the instance to a local
12830 variable (the variable will be accessed as a field).
12832 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
12833 EmitContext.EmitAddressOfParameter): Routines to support
12834 parameters (not completed at this point).
12836 Removals: Removed RemapLocal and RemapLocalLValue. We probably
12837 will also remove the parameters.
12839 * convert.cs (Convert): Define a `ConstantEC' which points to a
12840 null. This is just to prefity some code that uses
12841 ImplicitStandardConversion code and do not have an EmitContext
12844 The idea is to flag explicitly that at that point in time, it is
12845 known that the conversion will not trigger the delegate checking
12846 code in implicit conversions (which requires a valid
12849 Everywhere: pass new EmitContext parameter since
12850 ImplicitStandardConversionExists now requires it to check for
12851 anonymous method conversions.
12853 (Convert.ImplicitStandardConversionExists): If the type of an
12854 expression is the anonymous_method_type, and the type is a
12855 delegate, we invoke the AnonymousMethod.Compatible method to check
12856 whether an implicit conversion is possible.
12858 (Convert.ImplicitConversionStandard): Only do implicit method
12859 group conversions if the language level is not ISO_1.
12861 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
12862 MethodInfo for the Invoke method. used by Delegate and
12865 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
12866 method conversions if the target type is a delegate.
12868 Removed extra debugging nops.
12870 (LocalVariableReference): Turn the `local_info' into a public
12873 Add `prepared' field, the same hack used for FieldExprs to cope
12874 with composed assignments, as Local variables do not necessarily
12875 operate purely on the stack as they used to: they can be captured
12878 Add `temp' for a temporary result, like fields.
12880 Refactor DoResolve and DoResolveLValue into DoResolveBase.
12882 It now copes with Local variables that are captured and emits the
12883 proper instance variable to load it from a field in the captured
12886 (ParameterReference.DoResolveBase): During the resolve phase,
12887 capture parameters if we are in an anonymous method.
12889 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
12890 anonymous method, use the EmitContext helper routines to emit the
12891 parameter reference.
12893 * iterators.cs: Set RemapToProxy to true/false during the
12896 * parameters.cs (GetParameterByName): New helper method.
12898 * typemanager.cs (anonymous_method_type) a new type that
12899 represents an anonyous method. This is always an internal type,
12900 used as a fencepost to test against the anonymous-methodness of an
12903 2004-10-20 Marek Safar <marek.safar@seznam.cz>
12905 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
12907 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
12909 2004-10-18 Martin Baulig <martin@ximian.com>
12911 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
12912 `Type' directly, but call ResolveType() on it.
12913 (Catch.Resolve): Likewise.
12914 (Foreach.Resolve): Likewise.
12916 2004-10-18 Martin Baulig <martin@ximian.com>
12918 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
12919 `Type' directly, but call ResolveType() on it.
12920 (Probe.DoResolve): Likewise.
12921 (ArrayCreation.LookupType): Likewise.
12922 (TypeOf.DoResolve): Likewise.
12923 (SizeOf.DoResolve): Likewise.
12925 2004-10-18 Martin Baulig <martin@ximian.com>
12927 * expression.cs (Invocation.BetterFunction): Put back
12928 TypeManager.TypeToCoreType().
12930 2004-10-18 Raja R Harinath <rharinath@novell.com>
12932 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
12935 2004-10-18 Martin Baulig <martin@ximian.com>
12937 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
12938 `Type' directly, but call ResolveType() on it.
12940 2004-10-18 Martin Baulig <martin@ximian.com>
12942 * class.cs (FieldMember.Define): Don't access the TypeExpr's
12943 `Type' directly, but call ResolveType() on it.
12944 (MemberBase.DoDefine): Likewise.
12946 * expression.cs (New.DoResolve): Don't access the TypeExpr's
12947 `Type' directly, but call ResolveType() on it.
12948 (ComposedCast.DoResolveAsTypeStep): Likewise.
12950 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
12951 `Type' directly, but call ResolveType() on it.
12953 2004-10-17 John Luke <john.luke@gmail.com>
12955 * class.cs (Operator.GetSignatureForError): use CSharpName
12957 * parameter.cs (Parameter.GetSignatureForError): Returns
12958 correct name even if was not defined.
12960 2004-10-13 Raja R Harinath <rharinath@novell.com>
12963 * class.cs (TypeContainer.EmitContext): New property.
12964 (DefineNestedTypes): Create an emitcontext for each part.
12965 (MethodCore.DoDefineParameters): Use container's emitcontext.
12966 Pass type array to InternalParameters.
12967 (MemberBase.DoDefine): Use container's emitcontext.
12968 (FieldMember.Define): Likewise.
12969 (Event.Define): Likewise.
12970 (SetMethod.GetParameterInfo): Change argument to EmitContext.
12971 Pass type array to InternalParameters.
12972 (SetIndexerMethod.GetParameterInfo): Likewise.
12973 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
12974 * delegate.cs (Define): Pass emitcontext to
12975 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
12976 array to InternalParameters.
12977 * expression.cs (ParameterReference.DoResolveBase): Pass
12978 emitcontext to GetParameterInfo.
12979 (ComposedCast.DoResolveAsTypeStep): Remove check on
12980 ec.ResolvingTypeTree.
12981 * parameter.cs (Parameter.Resolve): Change argument to
12982 EmitContext. Use ResolveAsTypeTerminal.
12983 (Parameter.GetSignature): Change argument to EmitContext.
12984 (Parameters.ComputeSignature): Likewise.
12985 (Parameters.ComputeParameterTypes): Likewise.
12986 (Parameters.GetParameterInfo): Likewise.
12987 (Parameters.ComputeAndDefineParameterTypes): Likewise.
12988 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
12989 * support.cs (InternalParameters..ctor): Remove variant that takes
12991 * typemanager.cs (system_intptr_expr): New.
12992 (InitExpressionTypes): Initialize it.
12994 2004-10-12 Chris Toshok <toshok@ximian.com>
12996 * cs-parser.jay: fix location for try_statement and catch_clause.
12998 2004-10-11 Martin Baulig <martin@ximian.com>
13000 * report.cs: Don't make --fatal abort on warnings, we have
13001 -warnaserror for that.
13003 2004-10-07 Raja R Harinath <rharinath@novell.com>
13005 More DeclSpace.ResolveType avoidance.
13006 * decl.cs (MemberCore.InUnsafe): New property.
13007 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
13008 with newly created EmitContext.
13009 (FieldMember.Define): Likewise.
13010 * delegate.cs (Delegate.Define): Likewise.
13011 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
13012 only if normal name-lookup fails.
13013 (TypeExpr.DoResolve): Enable error-checking.
13014 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
13015 (SizeOf.DoResolve): Likewise.
13016 (ComposedCast.DoResolveAsTypeStep): Likewise.
13017 (StackAlloc.DoResolve): Likewise.
13018 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
13019 (Block.Unsafe): New property.
13020 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
13021 (Unsafe): Set 'unsafe' flag of contained block.
13022 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
13023 (Fixed.Resolve): Likewise.
13024 (Catch.Resolve): Likewise.
13025 (Using.ResolveLocalVariableDecls): Likewise.
13026 (Foreach.Resolve): Likewise.
13028 2004-10-05 John Luke <john.luke@gmail.com>
13030 * cs-parser.jay: add location to error CS0175
13032 2004-10-04 Miguel de Icaza <miguel@ximian.com>
13034 * ecore.cs (Expression.Constantity): Add support for turning null
13037 * const.cs (Const.Define): Allow constants to be reference types
13038 as long as the value is Null.
13040 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
13042 * namespace.cs (NamespaceEntry.Using): No matter which warning
13043 level is set, check if this namespace name has already been added.
13045 2004-10-03 Ben Maurer <bmaurer@ximian.com>
13047 * expression.cs: reftype [!=]= null should always use br[true,false].
13050 2004-10-03 Marek Safar <marek.safar@seznam.cz>
13053 * attribute.cs: Enum conversion moved to
13054 GetAttributeArgumentExpression to be applied to the all
13057 2004-10-01 Raja R Harinath <rharinath@novell.com>
13059 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
13060 * class.c (TypeContainer.DefineType): Flag error if
13061 base types aren't accessible due to access permissions.
13062 * decl.cs (DeclSpace.ResolveType): Move logic to
13063 Expression.ResolveAsTypeTerminal.
13064 (DeclSpace.ResolveTypeExpr): Thin layer over
13065 Expression.ResolveAsTypeTerminal.
13066 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
13067 Refactor code into NestedAccess. Use it.
13068 (DeclSpace.NestedAccess): New.
13069 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
13070 argument to silence errors. Check access permissions.
13071 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
13072 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
13073 (Cast.DoResolve): Likewise.
13074 (New.DoResolve): Likewise.
13075 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
13076 (TypeOf.DoResolve): Likewise.
13078 * expression.cs (Invocation.BetterConversion): Return the Type of
13079 the better conversion. Implement section 14.4.2.3 more faithfully.
13080 (Invocation.BetterFunction): Make boolean. Make correspondence to
13081 section 14.4.2.2 explicit.
13082 (Invocation.OverloadResolve): Update.
13083 (Invocation): Remove is_base field.
13084 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
13085 (Invocation.Emit): Likewise.
13087 2004-09-27 Raja R Harinath <rharinath@novell.com>
13089 * README: Update to changes.
13091 2004-09-24 Marek Safar <marek.safar@seznam.cz>
13093 * cs-parser.jay: Reverted 642 warning fix.
13095 2004-09-23 Marek Safar <marek.safar@seznam.cz>
13098 * decl.cs (FindMemberWithSameName): Indexer can have more than
13101 2004-09-23 Marek Safar <marek.safar@seznam.cz>
13103 * expression.cs (LocalVariableReference.DoResolveLValue):
13104 Do not report warning 219 for out values.
13105 (EmptyExpression.Null): New member to avoid extra allocations.
13107 2004-09-23 Marek Safar <marek.safar@seznam.cz>
13109 * cs-parser.jay: Fix wrong warning 642 report.
13111 * cs-tokenizer.cs (CheckNextToken): New helper;
13112 Inspect next character if is same as expected.
13114 2004-09-23 Martin Baulig <martin@ximian.com>
13116 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
13117 (Convert.ImplicitReferenceConversionExists): Likewise.
13119 2004-09-23 Marek Safar <marek.safar@seznam.cz>
13121 * class.cs (Operator.Define): Add error 448 and 559 report.
13123 2004-09-22 Marek Safar <marek.safar@seznam.cz>
13125 * class.cs (MemberBase.IsTypePermitted): New protected
13126 method for checking error CS0610.
13128 2004-09-22 Marek Safar <marek.safar@seznam.cz>
13130 * class.cs (TypeContainer.HasExplicitLayout): New property
13131 Returns whether container has StructLayout attribute set Explicit.
13132 (FieldMember): New abstract class for consts and fields.
13133 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
13134 (Field): Reuse FieldMember.
13136 * const.cs (Const): Reuse FieldMember.
13138 * rootcontext.cs: EmitConstants call moved to class.
13140 2004-09-22 Martin Baulig <martin@ximian.com>
13142 Thanks to Peter Sestoft for this bug report.
13144 * expression.cs (Conditional): If both the `trueExpr' and the
13145 `falseExpr' is a NullLiteral, return a NullLiteral.
13147 2004-09-22 Martin Baulig <martin@ximian.com>
13149 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
13150 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
13151 for the "get_Current" call.
13153 2004-09-22 Martin Baulig <martin@ximian.com>
13155 Marek and me just fixed one of our oldest bugs: #28562 :-)
13157 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
13159 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
13160 we're an EnumConstant, just return that.
13161 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
13162 an EnumConstant. In this case, we need to use GetValueAsEnumType()
13163 to get the value which'll actually be written into the attribute.
13164 However, we have to use GetValue() to access the attribute's value
13167 2004-09-22 Marek Safar <marek.safar@seznam.cz>
13169 * constant.cs (Constant.IsNegative): New abstract property
13172 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
13173 (StackAlloc.DoResolve): Reused IsNegative.
13175 2004-09-21 Martin Baulig <martin@ximian.com>
13177 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
13178 if we're used in an iterator, we may be called from different
13181 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
13182 we actually have an exception block.
13184 2004-09-20 John Luke <jluke@cfl.rr.com>
13186 * class.cs, cs-parser.jay: Improve the error report for 1520:
13187 report the actual line where the error happens, not where the
13188 class was declared.
13190 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
13191 Pass location information that was available elsewhere.
13193 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
13195 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
13196 runtime to delay sign assemblies.
13198 2004-09-19 Miguel de Icaza <miguel@ximian.com>
13200 * cs-parser.jay: Do not report the stack trace, this is barely
13203 2004-08-22 John Luke <john.luke@gmail.com>
13205 * driver.cs : check that a resource id is not already used
13206 before adding it, report CS1508 if it is, bug #63637
13208 2004-09-19 Miguel de Icaza <miguel@ximian.com>
13210 * ecore.cs: Removed dead code.
13212 2004-09-18 Marek Safar <marek.safar@seznam.cz>
13214 * class.cs: Do not report warning CS0067 on the interfaces.
13216 2004-09-16 Marek Safar <marek.safar@seznam.cz>
13218 * cs-parser.jay: Add error 504 report.
13220 2004-09-16 Marek Safar <marek.safar@seznam.cz>
13222 * rootcontext.cs: WarningLevel is 4 by default now.
13224 * statement.cs (Fixed.Resolve): Do not null
13227 2004-09-16 Marek Safar <marek.safar@seznam.cz>
13230 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
13231 deep search when property is not virtual.
13232 (PropertyExpr.ResolveAccessors): Make one call for both
13235 2004-09-15 Marek Safar <marek.safar@seznam.cz>
13238 * statement.cs: Error 152 report constains also location.
13240 2004-09-15 Marek Safar <marek.safar@seznam.cz>
13243 * const.cs: Explicitly set constant as static.
13245 2004-09-15 Marek Safar <marek.safar@seznam.cz>
13248 * cs-parser.jay: Add error 1017 report.
13250 2004-09-15 Marek Safar <marek.safar@seznam.cz>
13252 Fixed bug #59980, #64224
13253 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
13255 * typemanager.cs (IsSpecialMethod): Simplified
13257 2004-09-14 Marek Safar <marek.safar@seznam.cz>
13259 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
13260 condition with better params.
13262 2004-09-14 Marek Safar <marek.safar@seznam.cz>
13265 * attribute.cs (Resolve): Property has to have both
13268 2004-09-14 Martin Baulig <martin@ximian.com>
13270 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
13272 2004-09-14 Marek Safar <marek.safar@seznam.cz>
13275 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
13276 called and is obsolete then this member suppress message
13277 when call is inside next [Obsolete] method or type.
13279 * expression.cs: Use TestObsoleteMethodUsage member.
13281 2004-09-14 Martin Baulig <martin@ximian.com>
13283 * cs-parser.jay: Sync a bit with the GMCS version.
13285 2004-09-14 Martin Baulig <martin@ximian.com>
13287 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
13288 (CSharpParser.yacc_verbose_flag): New public field.
13290 * genericparser.cs: Removed.
13292 2004-09-14 Raja R Harinath <rharinath@novell.com>
13294 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
13296 2004-09-13 Marek Safar <marek.safar@seznam.cz>
13298 * class.cs (MethodCore.CheckBase): Fix bug #65757.
13300 2004-09-10 Martin Baulig <martin@ximian.com>
13302 Backported my MemberName changes from GMCS into MCS.
13304 - we are now using a special `MemberName' class instead of using
13305 strings; in GMCS, the `MemberName' also contains the type
13308 - changed the grammar rules a bit:
13309 * the old `member_name' is now a `namespace_or_type_name':
13310 The rule is that we use `namespace_or_type_name' everywhere
13311 where we expect either a "member name" (GetEnumerator) or a
13312 "member name" with an explicit interface name
13313 (IEnumerable.GetEnumerator).
13314 In GMCS, the explicit interface name may include type arguments
13315 (IEnumerable<T>.GetEnumerator).
13316 * we use `member_name' instead of just `IDENTIFIER' for
13318 The rule is that we use `member_name' wherever a member may
13319 have type parameters in GMCS.
13321 * decl.cs (MemberName): New public class.
13322 (MemberCore.MemberName): New public readonly field.
13323 (MemberCore.ctor): Take a `MemberName' argument, not a string.
13324 (DeclSpace): Likewise.
13326 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
13327 * enum.cs (Enum.ctor): Likewise.
13329 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
13331 (AliasEntry.ctor): Take a MemberName, not an Expression.
13332 (AliasEntry.UsingAlias): Likewise.
13334 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
13335 (IMethodData.MemberName): Changed type from string to MemberName.
13336 (MemberBase.ExplicitInterfaceName): Likewise.
13337 (AbstractPropertyEventMethod.SetupName): Make this private.
13338 (AbstractPropertyEventMethod.ctor): Added `string prefix'
13339 argument; compute the member name here.
13340 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
13341 on the `member.MemberName' and the `prefix'.
13343 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
13345 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
13346 thus, we get a `MemberName' instead of a `string'. These
13347 declarations may have type parameters in GMCS.
13348 (interface_method_declaration, delegate_declaration): Likewise.
13349 (class_declaration, interface_declaration): Likewise.
13350 (method_header): Use `namespace_or_type_name' instead of
13351 `member_name'. We may be an explicit interface implementation.
13352 (property_declaration, event_declaration): Likewise.
13353 (member_name): This is now just an `IDENTIFIER', not a
13354 `namespace_or_type_name'.
13355 (type_name, interface_type): Removed.
13356 (namespace_or_type_name): Return a MemberName, not an Expression.
13357 (primary_expression): Use `member_name' instead of `IDENTIFIER';
13358 call GetTypeExpression() on the MemberName to get an expression.
13359 (IndexerDeclaration.interface_type): Changed type from string to
13361 (MakeName): Operate on MemberName's instead of string's.
13363 2004-09-13 Raja R Harinath <rharinath@novell.com>
13366 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
13367 (NamespaceEntry.Lookup): Add new argument to flag if we want the
13368 lookup to avoid symbols introduced by 'using'.
13369 * rootcontext.cs (NamespaceLookup): Update.
13371 2004-09-12 Marek Safar <marek.safar@seznam.cz>
13373 * class.cs (TypeContainer.DoDefineMembers): Do not call
13374 DefineDefaultConstructor for static classes.
13376 2004-09-12 Marek Safar <marek.safar@seznam.cz>
13378 * attribute.cs (Attribute.Resolve): Add error 653 report.
13380 * class.cs (Class.ApplyAttributeBuilder): Add error 641
13382 (Method.ApplyAttributeBuilder): Add error 685 report.
13383 (Operator.Define): Add error 564 report.
13385 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
13387 * expression.cs (Invocation.DoResolve): Add error
13388 245 and 250 report.
13390 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
13393 2004-09-11 Marek Safar <marek.safar@seznam.cz>
13395 * class.cs (ConstructorInitializer.Resolve):
13396 Wrong error number (515->516).
13398 2004-09-11 Marek Safar <marek.safar@seznam.cz>
13400 * class.cs (Indexer.Define): Add error 631 report.
13402 2004-09-11 Marek Safar <marek.safar@seznam.cz>
13404 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
13406 2004-09-11 Marek Safar <marek.safar@seznam.cz>
13408 * expression.cs (Probe.DoResolve): Add error CS0241 report.
13410 2004-09-10 Marek Safar <marek.safar@seznam.cz>
13412 * cs-parser.jay: Added error CS0241 report.
13414 2004-09-10 Raja R Harinath <rharinath@novell.com>
13416 * cs-parser.jay (fixed_statement): Introduce a scope for the
13417 declaration in the 'fixed' statement.
13419 2004-09-09 Marek Safar <marek.safar@seznam.cz>
13421 * cs-parser.jay: Added CS0230 error report.
13423 2004-09-09 Marek Safar <marek.safar@seznam.cz>
13425 * cs-parser.jay: Added errors CS0231 and CS0257 report.
13427 2004-09-09 Marek Safar <marek.safar@seznam.cz>
13429 * expression.cs (Argument.Resolve): Added error CS0192 and
13432 2004-09-09 Marek Safar <marek.safar@seznam.cz>
13434 C# 2.0 #pragma warning feature
13436 * cs-tokenizer.cs (PreProcessPragma): New method;
13437 Handles #pragma directive.
13439 * report.cs (WarningRegions): New class; Support
13440 class for #pragma warning directive. It tests whether
13441 warning is enabled for a given line.
13443 2004-09-08 Miguel de Icaza <miguel@ximian.com>
13445 * const.cs: Add more descriptive error report, tahnks to
13448 2004-09-08 Marek Safar <marek.safar@seznam.cz>
13450 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
13452 2004-09-07 Miguel de Icaza <miguel@ximian.com>
13454 * expression.cs: Apply patch from Ben: Remove dead code from
13455 ArrayCreation, and remove the TurnintoConstant call in const.cs,
13456 as that code just threw an exception anwyays.
13458 * const.cs: Remove the call to the turnintoconstant, for details
13461 * literal.cs: The type of the null-literal is the null type; So
13462 we use a placeholder type (literal.cs:System.Null, defined here)
13465 * expression.cs (Conditional.DoResolve): Remove some old code that
13466 is no longer needed, conversions have been fixed.
13468 (ArrayCreationExpression.DoResolve): Return false if we fail to
13469 resolve the inner expression.
13471 2004-09-07 Raja R Harinath <rharinath@novell.com>
13474 * cs-parser.jay (delegate_declaration): Record a delegate
13475 declaration as a type declaration.
13476 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
13478 2004-09-06 Miguel de Icaza <miguel@ximian.com>
13480 * parameter.cs: Do not crash if the type can not be resolved.
13482 * expression.cs: Report errors with unsafe pointers, fixes #64896
13484 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
13486 * expression.cs: Pointer arith always needs to do a conv.i
13487 if the operand is a long. fix 65320
13489 2004-09-04 Marek Safar <marek.safar@seznam.cz>
13491 Fixed cs0619-37.cs, cs0619-38.cs
13493 * enum.cs (GetObsoleteAttribute): Removed.
13495 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
13496 on Enum member is double staged. The first is tested member
13499 2004-09-04 Marek Safar <marek.safar@seznam.cz>
13501 Fixed #56986, #63631, #65231
13503 * class.cs: (TypeContainer.AddToMemberContainer): New method,
13504 adds member to name container.
13505 (TypeContainer.AddToTypeContainer): New method, adds type to
13507 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
13508 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
13509 AddOperator): Simplified by reusing AddToMemberContainer.
13510 (TypeContainer.UserDefinedStaticConstructor): Changed to property
13512 (Method.CheckForDuplications): Fixed implementation to test all
13514 (MemberBase): Detection whether member is explicit interface
13515 implementation is now in constructor.
13516 (MemberBase.UpdateMemberName): Handles IndexerName.
13517 (Accessor): Changed to keep also location information.
13518 (AbstractPropertyEventMethod): Is derived from MemberCore.
13519 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
13520 will be emited or not.
13521 (PropertyBase.AreAccessorsDuplicateImplementation):
13522 Tests whether accessors are not in collision with some method.
13523 (Operator): Is derived from MethodCore to simplify common
13526 * decl.cs (Flags.TestMethodDuplication): Test for duplication
13528 (DeclSpace.AddToContainer): Adds the member to defined_names
13529 table. It tests for duplications and enclosing name conflicts.
13531 * enum.cs (EnumMember): Clean up to reuse the base structures
13533 2004-09-03 Martin Baulig <martin@ximian.com>
13535 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
13536 into TypeContainer, to make partial classes work again.
13538 2004-09-03 Martin Baulig <martin@ximian.com>
13540 * rootcontext.cs (RootContext.V2): Removed.
13542 2004-03-23 Martin Baulig <martin@ximian.com>
13544 * expression.cs (Invocation.OverloadResolve): Added `bool
13545 may_fail' argument and use it instead of the Location.IsNull() hack.
13547 2004-09-03 Martin Baulig <martin@ximian.com>
13549 Merged latest changes into gmcs. Please keep this comment in
13550 here, it makes it easier for me to see what changed in MCS since
13551 the last time I merged.
13553 2004-09-03 Raja R Harinath <rharinath@novell.com>
13556 * expression.cs (BetterConversion): Don't allow either conversion
13557 to be null. Remove redundant implicit conversion test when 'q ==
13558 null' -- when this function is invoked, we already know that the
13559 implicit conversion exists.
13560 (BetterFunction): Assume that 'best' is non-null. Remove
13561 redundant reimplementation of IsApplicable when 'best' is null.
13562 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
13563 number of arguments.
13564 (IsAncestralType): Extract from OverloadResolve.
13565 (OverloadResolve): Make robust to the MethodGroupExpr being
13566 unsorted. Implement all the logic of Section 14.5.5.1, and
13567 support overloading of methods from multiple applicable types.
13568 Clean up logic somewhat. Don't pass null methods to BetterFunction.
13570 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
13571 (RealError, Warning): Append type of report to related symbol.
13573 2004-09-03 Marek Safar <marek.safar@seznam.cz>
13575 * enum.cs: Fixed CLS-Compliance checks for enum members.
13576 Error tests cs3008-8.cs, cs3014-8.cs
13578 2004-09-02 Marek Safar <marek.safar@seznam.cz>
13580 Fixed bug #62342, #63102
13581 * class.cs: ImplementIndexer uses member.IsExplicitImpl
13582 like ImplementMethod.
13584 2004-09-02 Marek Safar <marek.safar@seznam.cz>
13586 * attribute.cs (Attribute.GetAttributeArgumentExpression):
13589 2004-09-02 Martin Baulig <martin@ximian.com>
13591 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
13592 TypeManager.GetArgumentTypes() rather than calling GetParameters()
13595 2004-09-01 Marek Safar <marek.safar@seznam.cz>
13597 C# 2.0 Static classes implemented
13599 * class.cs (TypeContainer): instance_constructors,
13600 initialized_fields, initialized_static_fields,
13601 default_constructor, base_inteface_types are protected to be
13602 accessible from StaticClass.
13603 (TypeContainer.DefineDefaultConstructor): New virtual method
13604 for custom default constructor generating
13605 (StaticClass): New class to handle "Static classes" feature.
13607 * cs-parser.jay: Handle static keyword on class like instance
13610 * driver.cs: Added "/langversion" command line switch with two
13611 options (iso-1, default).
13613 2004-08-31 Marek Safar <marek.safar@seznam.cz>
13615 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
13617 2004-08-31 Miguel de Icaza <miguel@ximian.com>
13619 * delegate.cs: Style.
13621 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
13623 * delegate.cs: Add seperate instance expr field for miguel.
13625 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
13627 * PointerArithmetic (Resolve): make sure we are not doing
13628 pointer arith on void*. Also, make sure we are resolved
13629 by not setting eclass until resolve.
13631 All callers: Make sure that PointerArithmetic gets resolved.
13633 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
13635 * ArrayCreation (LookupType): If the type does not resolve
13636 to an array, give an error.
13638 2004-08-27 Marek Safar <marek.safar@seznam.cz>
13640 * statement.cs (Try.Resolve): Fixed bug #64222
13642 2004-08-27 Martin Baulig <martin@ximian.com>
13645 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
13648 2004-08-26 Marek Safar <marek.safar@seznam.cz>
13650 * ecore.cs (Constantify): Get underlying type via
13651 System.Enum.GetUnderlyingType to avoid StackOverflow on the
13652 Windows in special cases.
13654 2004-08-26 Marek Safar <marek.safar@seznam.cz>
13656 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
13657 for obtaining also private methods.
13658 (GetRemoveMethod): Used GetRemoveMethod (true)
13659 for obtaining also private methods.
13661 2004-08-24 Martin Baulig <martin@ximian.com>
13663 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
13664 MethodAttributes.HideBySig for operators.
13666 2004-08-23 Martin Baulig <martin@ximian.com>
13668 Back to the old error reporting system :-)
13670 * report.cs (Message): Removed.
13671 (Report.MessageData, ErrorData, WarningData): Removed.
13672 (Report.Error, Warning): Back to the old system.
13674 2004-08-23 Martin Baulig <martin@ximian.com>
13676 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
13678 * class.cs (TypeContainer.ParentContainer): New public virtual
13679 method; replaces the explicit interface implementation.
13680 (ClassPart.ParentContainer): Override.
13682 2004-08-23 Martin Baulig <martin@ximian.com>
13684 * statement.cs (Switch): Added support for constant switches; see
13685 #59428 or test-285.cs.
13687 2004-08-22 Marek Safar <marek.safar@seznam.cz>
13690 * statement.cs (GetEnumeratorFilter): Removed useless
13691 logic because C# specs is strict. GetEnumerator must be
13694 2004-08-22 Martin Baulig <martin@ximian.com>
13696 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13697 a switch and may break, reset the barrier. Fixes #59867.
13699 2004-08-22 Marek Safar <marek.safar@seznam.cz>
13701 CLS-Compliance speed up (~5% for corlib)
13703 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
13704 New method. Tests container for CLS-Compliant names
13706 * class.cs (TypeContainer.VerifyClsName): New method.
13707 Checks whether container name is CLS Compliant.
13708 (Constructor): Implements IMethodData.
13710 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
13711 low-case table for CLS Compliance test.
13712 (MemberCache.VerifyClsParameterConflict): New method.
13713 Checks method parameters for CS3006 error.
13715 * enum.cs (EnumMember): Is derived from MemberCore.
13716 (Enum.VerifyClsName): Optimized for better performance.
13718 2004-08-06 Marek Safar <marek.safar@seznam.cz>
13720 * report.cs: Renamed Error_T to Error and changed all
13723 2004-08-06 Marek Safar <marek.safar@seznam.cz>
13725 * class.cs (TypeContainer.IndexerArrayList): New inner class
13726 container for indexers.
13727 (TypeContainer.DefaultIndexerName): New constant for default
13728 indexer name. Replaced all "Item" with this constant.
13729 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
13731 * typemanager.cs (TypeManager.default_member_ctor): Cache here
13732 DefaultMemberAttribute constructor.
13734 2004-08-05 Martin Baulig <martin@ximian.com>
13736 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
13739 2004-08-05 Marek Safar <marek.safar@seznam.cz>
13741 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
13742 multi platforms problem.
13744 * compiler.csproj: Included shared files.
13746 2004-08-04 Marek Safar <marek.safar@seznam.cz>
13748 Fix bug 60333, 55971 in the more general way
13749 * attribute.cs (Attribute.GetAttributeArgumentExpression):
13750 Added arg_type argument for constant conversion.
13751 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
13753 2004-08-04 Marek Safar <marek.safar@seznam.cz>
13756 * class.cs (TypeContainer ): New inner classes MethodArrayList,
13757 OperatorArrayList, MethodCoreArrayList for typecontainer
13758 containers. Changed class member types to these new types.
13759 (MethodArrayList.DefineMembers): Added test for CS0659.
13761 2004-08-04 Miguel de Icaza <miguel@ximian.com>
13763 * cfold.cs: Synchronize the folding with the code in expression.cs
13764 Binary.DoNumericPromotions for uint operands.
13766 * attribute.cs: Revert patch from Raja, it introduced a regression
13767 while building Blam-1.2.1 (hard to isolate a test case).
13769 2004-08-04 Marek Safar <marek.safar@seznam.cz>
13773 (TypeContainer.Define): Renamed to DefineContainerMembers because of
13775 (MethodCore.parent_method): New member. The method we're overriding
13776 if this is an override method.
13777 (MethodCore.CheckBase): Moved from Method class and made common.
13778 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
13780 (MethodCore.CheckForDuplications): New abstract method. For custom
13781 member duplication search in a container
13782 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
13783 method and its return type.
13784 (Event.conflict_symbol): New member. Symbol with same name in the
13788 (MemberCache.FindMemberWithSameName): New method. The method
13789 is looking for conflict with inherited symbols.
13791 2004-08-04 Martin Baulig <martin@ximian.com>
13793 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
13795 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
13797 2004-08-03 Marek Safar <marek.safar@seznam.cz>
13799 * report.cs (Message): New enum for better error, warning reference in
13801 (MessageData): New inner abstract class. It generally handles printing of
13802 error and warning messages.
13803 Removed unused Error, Warning, Message methods.
13805 2004-08-03 Marek Safar <marek.safar@seznam.cz>
13807 Fix for cs0592-8.cs test
13809 (Attributable.ValidAttributeTargets): Made public.
13810 (Attribute.ExplicitTarget): New member for explicit target value.
13811 (Attribute.CheckTargets): Now we translate explicit attribute
13812 target to Target here.
13814 2004-08-03 Ben Maurer <bmaurer@ximian.com>
13816 * ecore.cs (MethodGroupExpr): new IsBase property.
13818 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
13820 * delegate.cs (DelegateCreation): store a MethodGroupExpr
13821 rather than an instance expr.
13823 (DelegateCreation.Emit): Use the method group rather than
13824 the instance expression. Also, if you have base.Foo as the
13825 method for a delegate, make sure to emit ldftn, not ldftnvirt.
13827 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
13829 (NewDelegate.DoResolve): Only check for the existance of Invoke
13830 if the method is going to be needed. Use MethodGroupExpr.
13832 (NewDelegate.Emit): Remove, DelegateCreation implements this.
13834 * expression.cs: For pointer arith., make sure to use
13835 the size of the type, not the size of the pointer to
13838 2004-08-03 Marek Safar <marek.safar@seznam.cz>
13841 * class.cs (Class): Added error CS0502 test.
13843 2004-08-03 John Luke <jluke@cfl.rr.com>
13844 Raja R Harinath <rharinath@novell.com>
13847 * attribute.cs (Attribute.complained_before): New flag.
13848 (Attribute.ResolveType, Attribute.Resolve),
13849 (Attribute.DefinePInvokeMethod): Set it.
13850 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
13852 2004-08-03 Martin Baulig <martin@ximian.com>
13854 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
13855 use a user-defined operator; we still need to do numeric
13856 promotions in case one argument is a builtin type and the other
13857 one has an implicit conversion to that type. Fixes #62322.
13859 2004-08-02 Martin Baulig <martin@ximian.com>
13861 * statement.cs (LocalInfo.Flags): Added `IsThis'.
13862 (LocalInfo.IsThis): New public property.
13863 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
13865 2004-08-01 Martin Baulig <martin@ximian.com>
13867 * class.cs (TypeContainer.GetClassBases): Don't set the default
13868 here since we may get called from GetPartialBases().
13869 (TypeContainer.DefineType): If GetClassBases() didn't return a
13870 parent, use the default one.
13872 2004-07-30 Duncan Mak <duncan@ximian.com>
13874 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
13876 2004-07-30 Martin Baulig <martin@ximian.com>
13878 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
13880 * class.cs (SourceMethod): New public class, derive from the
13881 symbol writer's ISourceMethod.
13882 (Method): Use the new symbol writer API.
13884 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
13885 as argument and use the new symbol writer.
13888 (SourceFile): Implement the symbol writer's ISourceFile.
13889 (Location.SymbolDocument): Removed.
13890 (Location.SourceFile): New public property.
13892 * symbolwriter.cs: Use the new symbol writer API.
13894 2004-07-30 Raja R Harinath <rharinath@novell.com>
13896 * Makefile (install-local): Remove. Functionality moved to
13899 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
13901 * Makefile: Install mcs.exe.config file together with mcs.exe.
13902 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
13903 correct runtime version.
13905 2004-07-25 Martin Baulig <martin@ximian.com>
13908 (TypeContainer.RegisterOrder): Removed, this was unused.
13909 (TypeContainer, interface_order): Removed.
13910 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
13911 TypeContainer as argument since we can also be called with a
13912 `PartialContainer' for a partial class/struct/interface.
13913 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
13914 of checking whether we're an `Interface' - we could be a
13915 `PartialContainer'.
13916 (PartialContainer.Register): Override; call
13917 AddClass()/AddStruct()/AddInterface() on our parent.
13919 * cs-parser.jay (interface_member_declaration): Add things to the
13920 `current_container', not the `current_class'.
13922 * rootcontext.cs (RegisterOrder): The overloaded version which
13923 takes an `Interface' was unused, removed.
13925 * typemanager.cs (TypeManager.LookupInterface): Return a
13926 `TypeContainer', not an `Interface'.
13927 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
13928 contain a `PartialContainer' for an interface, so check it's
13929 `Kind' to figure out what it is.
13931 2004-07-25 Martin Baulig <martin@ximian.com>
13933 * class.cs (Class.DefaultTypeAttributes): New public constant.
13934 (Struct.DefaultTypeAttributes): Likewise.
13935 (Interface.DefaultTypeAttributes): Likewise.
13936 (PartialContainer.TypeAttr): Override this and add the
13937 DefaultTypeAttributes.
13939 2004-07-25 Martin Baulig <martin@ximian.com>
13941 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
13942 we can just use the `Parent' field instead.
13944 2004-07-25 Martin Baulig <martin@ximian.com>
13946 * class.cs (TypeContainer.Emit): Renamed to EmitType().
13948 2004-07-25 Martin Baulig <martin@ximian.com>
13950 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
13951 our parts before defining any methods.
13952 (TypeContainer.VerifyImplements): Make this virtual.
13953 (ClassPart.VerifyImplements): Override and call VerifyImplements()
13954 on our PartialContainer.
13956 2004-07-25 Martin Baulig <martin@ximian.com>
13958 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
13960 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
13961 argument, we can just use the `Parent' field instead.
13964 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
13965 (MemberBase.DoDefine): Likewise.
13967 2004-07-24 Martin Baulig <martin@ximian.com>
13969 * decl.cs (MemberCore.Parent): New public field.
13970 (DeclSpace.Parent): Moved to MemberCore.
13972 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
13973 (MemberBase.ctor): Added TypeContainer argument, pass it to our
13975 (FieldBase, Field, Operator): Likewise.
13976 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
13977 (EventField, Event): Likewise.
13979 2004-07-23 Martin Baulig <martin@ximian.com>
13981 * class.cs (PartialContainer): New public class.
13982 (ClassPart): New public class.
13983 (TypeContainer): Added support for partial classes.
13984 (TypeContainer.GetClassBases): Splitted some of the functionality
13985 out into GetNormalBases() and GetPartialBases().
13987 * cs-tokenizer.cs (Token.PARTIAL): New token.
13988 (Tokenizer.consume_identifier): Added some hacks to recognize
13989 `partial', but only if it's immediately followed by `class',
13990 `struct' or `interface'.
13992 * cs-parser.jay: Added support for partial clases.
13994 2004-07-23 Martin Baulig <martin@ximian.com>
13996 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
13997 a `DeclSpace' and also made it readonly.
13998 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
13999 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
14000 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
14002 * cs-parser.jay: Pass the `current_class', not the
14003 `current_container' (at the moment, this is still the same thing)
14004 to a new Method, Property, Event, Indexer or Constructor.
14006 2004-07-23 Martin Baulig <martin@ximian.com>
14008 * cs-parser.jay (CSharpParser): Added a new `current_class' field
14009 and removed the `current_interface' one.
14010 (struct_declaration, class_declaration, interface_declaration):
14011 Set `current_class' to the newly created class/struct/interface;
14012 set their `Bases' and call Register() before parsing their body.
14014 2004-07-23 Martin Baulig <martin@ximian.com>
14016 * class.cs (Kind): New public enum.
14017 (TypeContainer): Made this class abstract.
14018 (TypeContainer.Kind): New public readonly field.
14019 (TypeContainer.CheckDef): New public method; moved here from
14021 (TypeContainer.Register): New public abstract method.
14022 (TypeContainer.GetPendingImplementations): New public abstract
14024 (TypeContainer.GetClassBases): Removed the `is_class' and
14025 `is_iface' parameters.
14026 (TypeContainer.DefineNestedTypes): Formerly known as
14028 (ClassOrStruct): Made this class abstract.
14030 * tree.cs (RootTypes): New public type.
14032 2004-07-20 Martin Baulig <martin@ximian.com>
14034 * tree.cs (Tree.RecordNamespace): Removed.
14035 (Tree.Namespaces): Removed.
14037 * rootcontext.cs (RootContext.IsNamespace): Removed.
14039 * cs-parser.jay (namespace_declaration): Just create a new
14040 NamespaceEntry here.
14042 2004-07-20 Martin Baulig <martin@ximian.com>
14044 * statement.cs (ExceptionStatement): New abstract class. This is
14045 now used as a base class for everyone who's using `finally'.
14046 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
14047 our local variables before using them.
14049 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
14050 virtual method. This is used by Yield.Resolve() to "steal" an
14051 outer block's `finally' clauses.
14052 (FlowBranchingException): The .ctor now takes an ExceptionStatement
14055 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
14056 version which takes an ExceptionStatement. This version must be
14057 used to create exception branchings.
14060 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
14061 (Iterator.EmitMoveNext): Added exception support; protect the
14062 block with a `fault' clause, properly handle 'finally' clauses.
14063 (Iterator.EmitDispose): Run all the `finally' clauses here.
14065 2004-07-20 Martin Baulig <martin@ximian.com>
14067 * iterator.cs: This is the first of a set of changes in the
14068 iterator code. Match the spec more closely: if we're an
14069 IEnumerable, then GetEnumerator() must be called. The first time
14070 GetEnumerator() is called, it returns the current instance; all
14071 subsequent invocations (if any) must create a copy.
14073 2004-07-19 Miguel de Icaza <miguel@ximian.com>
14075 * expression.cs: Resolve the constant expression before returning
14078 2004-07-19 Martin Baulig <martin@ximian.com>
14080 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
14081 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
14082 the return type of the new EmitContext.
14084 2004-07-18 Martin Baulig <martin@ximian.com>
14086 * class.cs (Property.Define): Fix iterators.
14088 * iterators.cs (Iterator.Define): Moved the
14089 `container.AddInterator (this)' call here from the .ctor; only do
14090 it if we resolved successfully.
14092 2004-07-17 Miguel de Icaza <miguel@ximian.com>
14094 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
14095 `true' for preprocessing directives that we parse. The return
14096 value indicates whether we should return to regular tokenizing or
14097 not, not whether it was parsed successfully.
14099 In the past if we were in: #if false ... #line #endif, we would
14100 resume parsing after `#line'. See bug 61604.
14102 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
14103 building: IsEnumType should return true only for enums, not for
14104 enums or System.Enum itself. This fixes #61593.
14106 Likely what happened is that corlib was wrong: mcs depended on
14107 this bug in some places. The bug got fixed, we had to add the
14108 hack, which caused bug 61593.
14110 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
14111 that was a workaround for the older conditions.
14113 2004-07-16 Ben Maurer <bmaurer@ximian.com>
14115 * assign.cs: IAssignMethod has a new interface, as documented
14116 inline. All assignment code now uses this new api.
14118 * ecore.cs, expression.cs: All classes which implement
14119 IAssignMethod now use the new interface.
14121 * expression.cs (Invocation): add a hack to EmitCall so that
14122 IndexerAccess can be the target of a compound assignment without
14123 evaluating its arguments twice.
14125 * statement.cs: Handle changes in Invocation api.
14127 2004-07-16 Martin Baulig <martin@ximian.com>
14129 * iterators.cs: Rewrote this. We're now using one single Proxy
14130 class for both the IEnumerable and the IEnumerator interface and
14131 `Iterator' derives from Class so we can use the high-level API.
14133 * class.cs (TypeContainer.AddIterator): New method.
14134 (TypeContainer.DoDefineType): New protected virtual method, which
14135 is called from DefineType().
14136 (TypeContainer.DoDefineMembers): Call DefineType() and
14137 DefineMembers() on all our iterators.
14138 (TypeContainer.Emit): Call Emit() on all our iterators.
14139 (TypeContainer.CloseType): Call CloseType() on all our iterators.
14141 * codegen.cs (EmitContext.CurrentIterator): New public field.
14143 2004-07-15 Martin Baulig <martin@ximian.com>
14146 (TypeManager.not_supported_exception_type): New type.
14148 2004-07-14 Martin Baulig <martin@ximian.com>
14150 * iterators.cs: Use real error numbers.
14152 2004-07-14 Martin Baulig <martin@ximian.com>
14154 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
14155 requires this to be a System.Collection.IEnumerable and not a
14156 class implementing that interface.
14157 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
14159 2004-07-13 Marek Safar <marek.safar@seznam.cz>
14161 * class.cs: Fixed previous fix, it broke some error tests.
14163 2004-07-12 Martin Baulig <martin@ximian.com>
14165 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
14168 2004-07-09 Miguel de Icaza <miguel@ximian.com>
14170 * assign.cs (LocalTemporary): Add new argument: is_address,If
14171 `is_address' is true, then the value that we store is the address
14172 to the real value, and not the value itself.
14174 * ecore.cs (PropertyExpr): use the new local temporary
14175 stuff to allow us to handle X.Y += z (where X is a struct)
14177 2004-07-08 Martin Baulig <martin@ximian.com>
14179 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
14180 not always return, just like we're doing in Using.Resolve().
14182 2004-07-07 Miguel de Icaza <miguel@ximian.com>
14184 * cs-parser.jay (fixed_statement): flag this as Pinned.
14186 2004-07-06 Miguel de Icaza <miguel@ximian.com>
14188 * typemanager.cs (TypeManager): Removed MakePinned method, this
14189 mechanism is replaced with the .NET 2.x compatible mechanism of
14190 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
14192 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
14193 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
14194 `IsFixed' property which has a different meaning.
14196 2004-07-02 Raja R Harinath <rharinath@novell.com>
14198 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
14199 visible from inside a nested class, not just the names of the
14200 immediately enclosing class.
14201 Fix for bug #60730.
14203 2004-06-24 Raja R Harinath <rharinath@novell.com>
14205 * expression.cs (BetterConversion): Remove buggy special-case
14206 handling of "implicit constant expression conversions". At this
14207 point, we already know that the conversion is possible -- we're
14208 only checking to see which is better.
14210 2004-06-24 Marek Safar <marek.safar@seznam.cz>
14212 * cs-parser.jay: Added error CS0210 test.
14214 2004-06-24 Marek Safar <marek.safar@seznam.cz>
14216 * cs-parser.jay: Added error CS0134 test.
14218 2004-06-24 Marek Safar <marek.safar@seznam.cz>
14221 * cs-parser.jay: Added error CS0145 test.
14223 2004-06-24 Marek Safar <marek.safar@seznam.cz>
14225 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
14227 2004-06-23 Ben Maurer <bmaurer@ximian.com>
14229 * expression.cs (StackAlloc.Resolve): The argument may not
14230 be a constant; deal with this case.
14232 2004-06-23 Marek Safar <marek.safar@seznam.cz>
14234 * attribute.cs (IndexerName_GetIndexerName): Renamed to
14235 GetIndexerAttributeValue.
14236 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
14238 * class.cs (Indexer.Define): Added error tests for CS0415,
14241 2004-06-23 Miguel de Icaza <miguel@ximian.com>
14243 * attribute.cs (Attribute.Resolve): Keep field code in sync with
14246 2004-06-23 Martin Baulig <martin@ximian.com>
14248 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
14249 neither return nor throw, reset the barrier as well. Fixes #60457.
14251 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
14253 * class.cs : EventAttributes is now set to None by default.
14254 This fixes bug #60459.
14256 2004-06-18 Marek Safar <marek.safar@seznam.cz>
14259 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
14260 Don't throw exception but return null (it's sufficient now).
14262 2004-06-18 Marek Safar <marek.safar@seznam.cz>
14264 * typemanager.cs (GetArgumentTypes): Faster implementation.
14266 2004-06-18 Martin Baulig <martin@ximian.com>
14268 * attribute.cs (Attribute.Resolve): Check whether we're an
14269 EmptyCast which a Constant child. Fixes #60333.
14271 2004-06-17 Ben Maurer <bmaurer@ximian.com>
14273 * statement.cs (EmitCollectionForeach): Account for the fact that
14274 not all valuetypes are in areas which we can take the address of.
14275 For these variables, we store to a temporary variable. Also, make
14276 sure that we dont emit a `callvirt' on a valuetype method.
14278 2004-06-15 Marek Safar <marek.safar@seznam.cz>
14280 * expression.cs (StackAlloc.DoReSolve): Added test for
14281 negative parameter (CS0247).
14283 2004-06-15 Marek Safar <marek.safar@seznam.cz>
14286 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
14288 2004-06-15 Marek Safar <marek.safar@seznam.cz>
14291 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
14294 2004-06-14 Marek Safar <marek.safar@seznam.cz>
14296 Fix bug #58254 & cs1555.cs, cs1556.cs
14297 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
14299 2004-06-14 Marek Safar <marek.safar@seznam.cz>
14301 * cs-parser.jay: Added error CS1669 test for indexers.
14303 2004-06-11 Martin Baulig <martin@ximian.com>
14305 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
14306 call this twice: for params and varargs methods.
14308 2004-06-11 Marek Safar <marek.safar@seznam.cz>
14311 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
14313 2004-06-11 Marek Safar <marek.safar@seznam.cz>
14315 * attribute.cs (Attribute.GetValidTargets): Made public.
14318 (AbstractPropertyEventMethod): New class for better code sharing.
14319 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
14321 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
14323 2004-06-11 Raja R Harinath <rharinath@novell.com>
14326 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
14327 that the call to Resolve is part of a MemberAccess.
14328 (Expression.Resolve): Use it for SimpleName resolution.
14329 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
14330 Add 'intermediate' boolean argument.
14331 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
14332 error message when the SimpleName can be resolved ambiguously
14333 between an expression and a type.
14334 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
14336 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
14337 call on the left-side.
14339 2004-06-11 Marek Safar <marek.safar@seznam.cz>
14342 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
14344 2004-06-11 Marek Safar <marek.safar@seznam.cz>
14346 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
14348 2004-06-11 Martin Baulig <martin@ximian.com>
14350 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
14351 varargs methods if applicable.
14353 2004-06-11 Martin Baulig <martin@ximian.com>
14355 * expression.cs (Invocation.EmitCall): Don't use
14356 `method.CallingConvention == CallingConventions.VarArgs' since the
14357 method could also have `CallingConventions.HasThis'.
14359 2004-06-11 Marek Safar <marek.safar@seznam.cz>
14361 * class.cs (Event.GetSignatureForError): Implemented.
14362 Fixed crash in error test cs3010.cs
14364 2004-06-10 Miguel de Icaza <miguel@ximian.com>
14366 * cs-tokenizer.cs: Change the way we track __arglist to be
14367 consistent with the other keywords.
14369 2004-06-09 Miguel de Icaza <miguel@ximian.com>
14371 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
14374 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
14376 * codegen.cs: Check that all referenced assemblies have a strongname
14377 before strongnaming the compiled assembly. If not report error CS1577.
14378 Fix bug #56563. Patch by Jackson Harper.
14379 * typemanager.cs: Added a method to return all referenced assemblies.
14380 Fix bug #56563. Patch by Jackson Harper.
14382 2004-06-08 Marek Safar <marek.safar@seznam.cz>
14385 (Method.ApplyAttributeBuilder): Moved and added conditional
14386 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
14389 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
14391 2004-06-08 Marek Safar <marek.safar@seznam.cz>
14394 * class.cs: (EventField.attribute_targets): Changed default target.
14396 2004-06-08 Martin Baulig <martin@ximian.com>
14398 * expression.cs (Invocation.EmitCall): Enable varargs methods.
14400 2004-06-08 Martin Baulig <martin@ximian.com>
14402 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
14404 2004-06-07 Martin Baulig <martin@ximian.com>
14406 Added support for varargs methods.
14408 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
14411 * cs-parser.jay: Added support for `__arglist'.
14413 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
14415 * expression.cs (Argument.AType): Added `ArgList'.
14416 (Invocation): Added support for varargs methods.
14417 (ArglistAccess): New public class.
14418 (Arglist): New public class.
14420 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
14422 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
14423 a method's top-level block if the method has varargs.
14425 * support.cs (ReflectionParameters, InternalParameters): Added
14426 support for varargs methods.
14428 2004-06-07 Miguel de Icaza <miguel@ximian.com>
14430 * class.cs: Provide location in indexer error report.
14432 * driver.cs: Use standard names.
14434 * namespace.cs: Catch the use of using after a namespace has been
14435 declared also on using aliases.
14437 2004-06-03 Raja R Harinath <rharinath@novell.com>
14440 * typemanager.cs (closure_private_ok, closure_invocation_type)
14441 (closure_qualifier_type, closure_invocation_assembly)
14442 (FilterWithClosure): Move to ...
14443 (Closure): New internal nested class.
14444 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
14445 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
14446 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
14447 (MemberLookup, MemberLookupFailed): Use it.
14448 * expression.cs (New.DoResolve): Treat the lookup for the
14449 constructor as being qualified by the 'new'ed type.
14450 (Indexers.GetIndexersForTypeOrInterface): Update.
14452 2004-06-03 Marek Safar <marek.safar@seznam.cz>
14455 (GetConditionalAttributeValue): New method. Returns
14456 condition of ConditionalAttribute.
14457 (SearchMulti): New method. Returns all attributes of type 't'.
14458 Use it when attribute is AllowMultiple = true.
14459 (IsConditionalMethodExcluded): New method.
14462 (Method.IsExcluded): Implemented. Returns true if method has conditional
14463 attribute and the conditions is not defined (method is excluded).
14464 (IMethodData): Extended interface for ConditionalAttribute support.
14465 (PropertyMethod.IsExcluded): Implemented.
14468 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
14471 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
14474 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
14476 * expression.cs (ArrayCreationExpression): Make this just an
14477 `expression'. It can't be a statement, so the code here was
14480 2004-06-02 Marek Safar <marek.safar@seznam.cz>
14483 * typemanager.cs (GetFullNameSignature): New method for
14486 2004-06-02 Marek Safar <marek.safar@seznam.cz>
14489 * class.cs (MemberBase.GetSignatureForError): New virtual method.
14490 Use this method when MethodBuilder is null.
14491 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
14492 Added test for error CS0626 (MONO reports error for this situation).
14493 (IMethodData.GetSignatureForError): Extended interface.
14495 2004-06-01 Marek Safar <marek.safar@seznam.cz>
14498 (AttributeTester.GetObsoleteAttribute): Returns instance of
14499 ObsoleteAttribute when type is obsolete.
14502 (TypeContainer.VerifyObsoleteAttribute): Override.
14503 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
14504 (MethodCode.VerifyObsoleteAttribute): Override.
14505 (MemberBase.VerifyObsoleteAttribute): Override.
14508 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
14509 and report proper error.
14512 Delegate.VerifyObsoleteAttribute): Override.
14515 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
14516 and report proper error.
14517 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
14520 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
14524 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
14525 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
14526 Added test for ObsoleteAttribute.
14529 (Catch): Derived from Statement.
14531 2004-06-01 Marek Safar <marek.safar@seznam.cz>
14533 Fixed bug #59071 & cs0160.cs
14535 * statement.cs (Try.Resolve): Check here whether order of catch
14536 clauses matches their dependencies.
14538 2004-05-31 Miguel de Icaza <miguel@ximian.com>
14540 * Reverted patch to namespace.cs (Use lookuptypedirect). This
14541 caused a regression: #59343. Referencing nested classes from an
14542 assembly stopped working.
14544 2004-05-31 Martin Baulig <martin@ximian.com>
14546 MCS is now frozen for beta 2.
14548 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
14550 * convert.cs: add a trivial cache for overload operator resolution.
14552 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
14554 * decl.cs: If possible, use lookuptypedirect here. We can only do
14555 this if there is no `.' after the namespace. Avoids using
14556 LookupType, which does lots of slow processing.
14557 (FindNestedType) New method, does what it says :-).
14558 * namespace.cs: use LookupTypeDirect.
14559 * rootcontext.cs: use membercache, if possible.
14560 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
14562 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
14565 According to the spec,
14567 In a member access of the form E.I, if E is a single identifier,
14568 and if the meaning of E as a simple-name (§7.5.2) is a constant,
14569 field, property, localvariable, or parameter with the same type as
14570 the meaning of E as a type-name (§3.8), then both possible
14571 meanings of E are permitted.
14573 We did not check that E as a simple-name had the same type as E as
14576 This trivial check gives us 5-7% on bootstrap time.
14578 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
14580 * expression.cs (Invocation.OverloadResolve): Avoid the
14581 use of hashtables and boxing here by allocating on demand.
14583 2004-05-30 Martin Baulig <martin@ximian.com>
14585 * rootcontext.cs (RootContext.LookupType): Don't cache things if
14586 we're doing a silent lookup. Don't try to lookup nested types in
14587 TypeManager.object_type (thanks to Ben Maurer).
14589 2004-05-30 Martin Baulig <martin@ximian.com>
14591 Committing a patch from Ben Maurer.
14593 * rootcontext.cs (RootContext.LookupType): Cache negative results.
14595 2004-05-29 Martin Baulig <martin@ximian.com>
14597 * class.cs (IMethodData.ShouldIgnore): New method.
14599 * typemanager.cs (TypeManager.MethodFlags): Don't take a
14600 `Location' argument, we don't need it anywhere. Use
14601 `IMethodData.ShouldIgnore ()' instead of
14602 `MethodData.GetMethodFlags ()'.
14603 (TypeManager.AddMethod): Removed.
14604 (TypeManager.AddMethod2): Renamed to AddMethod.
14606 2004-05-29 Martin Baulig <martin@ximian.com>
14608 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
14610 * convert.cs (Convert.ImplicitReferenceConversion): If we're
14611 converting from a class type S to an interface type and we already
14612 have an object on the stack, don't box it again. Fixes #52578.
14614 2004-05-29 Martin Baulig <martin@ximian.com>
14616 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
14617 Added support for `params' parameters. Fixes #59267.
14619 2004-05-29 Martin Baulig <martin@ximian.com>
14621 * literal.cs (NullPointer): Provide a private .ctor which sets
14622 `type' to TypeManager.object_type. Fixes #59048.
14624 2004-05-29 Martin Baulig <martin@ximian.com>
14626 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
14627 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
14629 * ecore.cs (EventExpr.instance_expr): Make the field private.
14631 2004-05-26 Marek Safar <marek.safar@seznam.cz>
14633 Fixed bug #50080 & cs0214-2.cs
14634 * expression.cs (Cast.DoResolve): Check unsafe context here.
14636 * statement.cs (Resolve.DoResolve): Likewise.
14638 2004-05-26 Martin Baulig <martin@ximian.com>
14640 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
14642 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
14643 (RootContext.LookupType): Pass down the `silent' flag.
14645 2004-05-25 Martin Baulig <martin@ximian.com>
14648 (MethodGroupExpr.IdenticalTypeName): New public property.
14649 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
14650 expression actually refers to a type.
14652 2004-05-25 Martin Baulig <martin@ximian.com>
14654 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
14655 for #56176 and made it actually work.
14657 2004-05-25 Martin Baulig <martin@ximian.com>
14659 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
14660 (FieldExpr, PropertyExpr): Override and implement
14661 CacheTemporaries. Fixes #52279.
14663 2004-05-25 Miguel de Icaza <miguel@ximian.com>
14665 * location.cs: In the new compiler listing a file twice is a
14666 warning, not an error.
14668 2004-05-24 Martin Baulig <martin@ximian.com>
14670 * enum.cs (Enum.DefineType): For the `BaseType' to be a
14671 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
14673 2004-05-24 Martin Baulig <martin@ximian.com>
14675 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
14676 walking the `using' list. Fixes #53921.
14678 2004-05-24 Martin Baulig <martin@ximian.com>
14680 * const.cs (Const.LookupConstantValue): Added support for
14681 EmptyCast's; fixes #55251.
14683 2004-05-24 Martin Baulig <martin@ximian.com>
14685 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
14686 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
14687 which does the CS0135 check. The reason is that we first need to
14688 check whether the variable actually exists.
14690 2004-05-24 Martin Baulig <martin@ximian.com>
14692 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
14693 than RootContext.LookupType() to find the explicit interface
14694 type. Fixes #58584.
14696 2004-05-24 Raja R Harinath <rharinath@novell.com>
14698 * Makefile: Simplify. Use executable.make.
14699 * mcs.exe.sources: New file. List of sources of mcs.exe.
14701 2004-05-24 Anders Carlsson <andersca@gnome.org>
14705 Use the invariant culture when doing String.Compare for CLS case
14708 2004-05-23 Martin Baulig <martin@ximian.com>
14710 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
14711 don't have any dots. Fixes #52622, added cs0246-8.cs.
14713 * namespace.cs (NamespaceEntry.Lookup): Likewise.
14715 2004-05-23 Marek Safar <marek.safar@seznam.cz>
14717 * class.cs (MemberBase.Define): Reuse MemberType member for
14718 resolved type. Other methods can use it too.
14720 2004-05-23 Martin Baulig <martin@ximian.com>
14722 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
14723 the variable also exists in the current block (otherwise, we need
14724 to report a CS0103). Fixes #58670.
14726 2004-05-23 Martin Baulig <martin@ximian.com>
14728 * flowanalysis.cs (Reachability.Reachable): Compute this
14729 on-the-fly rather than storing it as a field.
14731 2004-05-23 Martin Baulig <martin@ximian.com>
14733 * flowanalysis.cs (Reachability.And): Manually compute the
14734 resulting `barrier' from the reachability.
14736 2004-05-23 Marek Safar <marek.safar@seznam.cz>
14739 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
14740 instance of ObsoleteAttribute when symbol is obsolete.
14743 (IMethodData): Extended interface for ObsoleteAttribute support.
14745 2004-05-22 Marek Safar <marek.safar@seznam.cz>
14747 * attribute.cs: Fix bug #55970
14749 2004-05-22 Marek Safar <marek.safar@seznam.cz>
14753 (GetObsoleteAttribute): New method. Creates the instance of
14755 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
14756 ObsoleteAttribute when member is obsolete.
14757 (AttributeTester.Report_ObsoleteMessage): Common method for
14758 Obsolete error/warning reporting.
14761 (TypeContainer.base_classs_type): New member for storing parent type.
14764 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
14765 for this MemberCore.
14767 2004-05-21 Marek Safar <marek.safar@seznam.cz>
14769 * attribute.cs, const.cs: Fix bug #58590
14771 2004-05-21 Martin Baulig <martin@ximian.com>
14773 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
14774 out parameters if the end of the method is unreachable. Fixes
14777 2004-05-21 Marek Safar <marek.safar@seznam.cz>
14779 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
14780 Hari was right, why extra method.
14782 2004-05-21 Marek Safar <marek.safar@seznam.cz>
14784 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
14786 2004-05-20 Martin Baulig <martin@ximian.com>
14788 Merged this back from gmcs to keep the differences to a minumum.
14790 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
14791 instead of a Declspace.
14792 (Attribute.ResolveType): Likewise.
14793 (Attributes.Search): Likewise.
14794 (Attributes.Contains): Likewise.
14795 (Attributes.GetClsCompliantAttribute): Likewise.
14797 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
14799 (MethodData.ApplyAttributes): Take an EmitContext instead of a
14802 2004-05-19 Marek Safar <marek.safar@seznam.cz>
14804 Fix bug #58688 (MCS does not report error when the same attribute
14807 * attribute.cs (Attribute.Emit): Distinction between null and default.
14809 2004-05-19 Raja R Harinath <rharinath@novell.com>
14811 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
14812 of a top-level attribute without an attribute target.
14813 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
14815 (Attribute.Conditional_GetConditionName),
14816 (Attribute.Obsolete_GetObsoleteMessage): Update.
14817 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
14818 part of ScanForIndexerName.
14819 (Attribute.CanIgnoreInvalidAttribute): New function.
14820 (Attribute.ScanForIndexerName): Move to ...
14821 (Attributes.ScanForIndexerName): ... here.
14822 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
14823 (Attributes.Search): New internal variant that can choose not to
14824 complain if types aren't resolved. The original signature now
14826 (Attributes.GetClsCompliantAttribute): Use internal variant, with
14827 complaints suppressed.
14828 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
14829 only if it not useful.
14830 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
14831 top-level for attributes that are shared between the assembly
14832 and a top-level class.
14833 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
14834 * class.cs: Update to reflect changes.
14835 (DefineIndexers): Fuse loops.
14836 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
14837 a couple more variants of attribute names.
14839 2004-05-18 Marek Safar <marek.safar@seznam.cz>
14841 Fix bug #52585 (Implemented explicit attribute declaration)
14844 (Attributable.ValidAttributeTargets): New abstract method. It gets
14845 list of valid attribute targets for explicit target declaration.
14846 (Attribute.Target): It holds target itself.
14847 (AttributeSection): Removed.
14848 (Attribute.CheckTargets): New method. It checks whether attribute
14849 target is valid for the current element.
14852 (EventProperty): New class. For events that are declared like
14853 property (with add and remove accessors).
14854 (EventField): New class. For events that are declared like field.
14857 * cs-parser.jay: Implemented explicit attribute target declaration.
14859 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
14860 Override ValidAttributeTargets.
14863 (ReturnParameter): Class for applying custom attributes on
14865 (ParameterAtribute): New class. Class for applying custom
14866 attributes on the parameter type.
14868 2004-05-17 Miguel de Icaza <miguel@ximian.com>
14870 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
14873 (Method): Allow UNSAFE here.
14875 * modifiers.cs: Support unsafe reporting.
14877 2004-05-17 Marek Safar <marek.safar@seznam.cz>
14879 * decl.cs: Fix bug #58478.
14881 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14883 * statement.cs: When checking for unreachable code on an EmptyStatement,
14884 set the location. Fixes bug #58488.
14886 2004-05-13 Miguel de Icaza <miguel@ximian.com>
14888 * driver.cs: Add -pkg handling.
14890 From Gonzalo: UseShelLExecute=false
14892 2004-05-12 Marek Safar <marek.safar@seznam.cz>
14895 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
14897 (Attribute.IsClsCompliaceRequired): Moved to base for better
14899 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
14900 when attribute is AttributeUsageAttribute.
14901 (Attribute.GetValidTargets): Simplified.
14902 (Attribute.GetAttributeUsage): New method returns AttributeUsage
14903 attribute for this type.
14904 (Attribute.ApplyAttributes): Method renamed to Emit and make
14906 (GlobalAttributeSection): New class for special handling of global
14907 attributes (assembly, module).
14908 (AttributeSection.Emit): New method.
14910 * class.cs: Implemented Attributable abstract methods.
14911 (MethodCore.LabelParameters): Moved to Parameter class.
14912 (Accessor): Is back simple class.
14913 (PropertyMethod): Implemented Attributable abstract class.
14914 (DelegateMethod): Implemented Attributable abstract class.
14915 (Event): New constructor for disctintion between normal Event
14916 and Event with accessors.
14918 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
14920 * codegen.cs, const.cs, decl.cs, delegate.cs:
14921 (CommonAssemblyModulClass): Implemented Attributable abstract class
14924 * enum.cs: Implement IAttributeSupport interface.
14925 (EnumMember): New class for emum members. Implemented Attributable
14929 (ParameterBase): Is abstract.
14930 (ReturnParameter): New class for easier [return:] attribute handling.
14932 * typemanager.cs: Removed builder_to_attr.
14934 2004-05-11 Raja R Harinath <rharinath@novell.com>
14937 * attribute.cs (Attribute.GetPositionalValue): New function.
14938 * class.cs (TypeContainer.VerifyMembers): New function.
14939 (TypeContainer.Emit): Use it.
14940 (ClassOrStruct): New base class for Class and Struct.
14941 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
14942 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
14944 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
14945 then each non-static field should have a FieldOffset attribute.
14946 Otherwise, none of the fields should have a FieldOffset attribute.
14947 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
14948 and FieldOffset attributes.
14949 * typemanager.cs (TypeManager.struct_layout_attribute_type)
14950 (TypeManager.field_offset_attribute_type): New core types.
14951 (TypeManager.InitCoreTypes): Initialize them.
14953 2004-05-11 Michal Moskal <malekith@pld-linux.org>
14955 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
14956 Return correct type.
14959 2004-05-09 Miguel de Icaza <miguel@ximian.com>
14961 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
14962 be implicitly converted to ulong.
14964 * expression.cs: The logic for allowing operator &, | and ^ worked
14965 was wrong, it worked before because we did not report an error in
14966 an else branch. Fixes 57895.
14968 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
14969 allow volatile fields to be reference types.
14971 2004-05-07 Miguel de Icaza <miguel@ximian.com>
14973 * driver.cs: Add support for /debug-
14975 2004-05-07 Raja R Harinath <rharinath@novell.com>
14977 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
14978 Add a 'complain' parameter to silence errors.
14979 (Attribute.Resolve): Update to changes. Put in sanity check to catch
14980 silently overlooked type-resolutions.
14981 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
14982 to reflect changes.
14983 (Attributes.Search): New function.
14984 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
14985 (Attributes.GetAttributeFullName): Remove hack.
14986 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
14987 Update to reflect changes.
14988 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
14989 Use Attributes.Search instead of nested loops.
14991 2004-05-07 Marek Safar <marek.safar@seznam.cz>
14994 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
14995 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
14996 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
14998 * report.cs: (Report.Warning): Renamed to Warning_T because of
14999 parameter collision.
15001 2004-05-05 Raja R Harinath <rharinath@novell.com>
15003 * expression.cs (MemberAccess.ResolveMemberAccess):
15004 Exit with non-zero status after Report.Error.
15005 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
15007 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
15009 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
15011 * support.cs: Don't hang when the file is empty.
15013 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
15015 * support.cs: In SeekableStreamReader, compute the preamble size of the
15016 underlying stream. Position changes should take into account that initial
15019 2004-05-03 Todd Berman <tberman@sevenl.net>
15021 * driver.cs: remove unused GetSysVersion function.
15023 2004-05-03 Todd Berman <tberman@sevenl.net>
15025 * driver.cs: Remove the hack from saturday, as well as the hack
15026 from jackson (LoadAssemblyFromGac), also adds the CWD to the
15027 link_paths to get that bit proper.
15029 2004-05-01 Todd Berman <tberman@sevenl.net>
15031 * driver.cs: Try a LoadFrom before a Load, this checks the current
15032 path. This is currently a bug in mono that is be fixed, however, this
15033 provides a workaround for now. This will be removed when the bug
15036 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
15038 * CryptoConvert.cs: Updated to latest version. Fix issue with
15039 incomplete key pairs (#57941).
15041 2004-05-01 Todd Berman <tberman@sevenl.net>
15043 * driver.cs: Remove '.' from path_chars, now System.* loads properly
15046 2004-04-30 Jackson Harper <jackson@ximian.com>
15048 * codegen.cs: Open keys readonly.
15050 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15052 * typemanager.cs: don't report cyclic struct layout when a struct
15053 contains 2 or more fields of the same type. Failed for Pango.AttrShape
15054 which has 2 Pango.Rectangle fields.
15056 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
15058 * expression.cs: Handle IntPtr comparisons with IL code
15059 rather than a method call.
15061 2004-04-29 Martin Baulig <martin@ximian.com>
15063 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
15064 the list of PropertyInfo's in class hierarchy and find the
15065 accessor. Fixes #56013.
15067 2004-04-29 Martin Baulig <martin@ximian.com>
15069 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
15071 2004-04-29 Martin Baulig <martin@ximian.com>
15073 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
15075 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
15077 2004-04-29 Martin Baulig <martin@ximian.com>
15079 * class.cs (ConstructorInitializer.Resolve): Check whether the
15080 parent .ctor is accessible. Fixes #52146.
15082 2004-04-29 Martin Baulig <martin@ximian.com>
15084 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
15086 * statement.cs (Using.EmitLocalVariableDecls): Use
15087 TypeManager.idisposable_type, not typeof (IDisposable).
15088 (Foreach.EmitCollectionForeach): Added support for valuetypes.
15090 2004-04-29 Martin Baulig <martin@ximian.com>
15092 * class.cs (Event.Define): Don't emit the field and don't set
15093 RTSpecialName and SpecialName for events on interfaces. Fixes
15096 2004-04-29 Raja R Harinath <rharinath@novell.com>
15098 Refactor Attribute.ApplyAttributes.
15099 * attribute.cs (Attributable): New base class for objects that can
15100 have Attributes applied on them.
15101 (Attribute): Make AttributeUsage fields public.
15102 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
15103 (Attribute.IsInternalCall): New property.
15104 (Attribute.UsageAttr): Convert to a public read-only property.
15105 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
15106 (Attribute.ResolveType, Attribute.Resolve)
15107 (Attribute.ScanForIndexerName): Update to reflect changes.
15108 (Attribute.CheckAttributeTarget): Re-format.
15109 (Attribute.ApplyAttributes): Refactor, to various
15110 Attributable.ApplyAttributeBuilder methods.
15111 * decl.cs (MemberCore): Make Attributable.
15112 * class.cs (Accessor): Make Attributable.
15113 (MethodData.ApplyAttributes): Use proper attribute types, not
15115 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
15116 (TypeContainer.ApplyAttributeBuilder)
15117 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
15118 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
15119 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
15120 (Operator.ApplyAttributeBuilder): New factored-out methods.
15121 * const.cs (Const.ApplyAttributeBuilder): Likewise.
15122 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
15123 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
15124 * parameter.cs (ParameterBase): New Attributable base class
15125 that can also represent Return types.
15126 (Parameter): Update to the changes.
15128 2004-04-29 Jackson Harper <jackson@ximian.com>
15130 * driver.cs: Prefer the corlib system version when looking for
15131 assemblies in the GAC. This is still a hack, but its a better hack
15134 2004-04-29 Marek Safar <marek.safar@seznam.cz>
15136 * decl.cs, enum.cs: Improved error 3005 reporting.
15138 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
15139 (related_symbols): New private member for list of symbols
15140 related to reported error/warning.
15142 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
15144 2004-04-29 Martin Baulig <martin@ximian.com>
15146 * ecore.cs (Expression.Constantify): If we're an enum and
15147 TypeManager.TypeToCoreType() doesn't give us another type, use
15148 t.UnderlyingSystemType. Fixes #56178.
15150 2004-04-29 Martin Baulig <martin@ximian.com>
15152 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
15153 interfaces and for each interface, only add members directly
15154 declared in that interface. Fixes #53255.
15156 2004-04-28 Martin Baulig <martin@ximian.com>
15158 * expression.cs (ConditionalLogicalOperator): Use a temporary
15159 variable for `left' to avoid that we evaluate it more than once;
15162 2004-04-28 Martin Baulig <martin@ximian.com>
15164 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
15167 2004-04-28 Martin Baulig <martin@ximian.com>
15169 * statement.cs (LocalInfo.Resolve): Check whether the type is not
15172 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
15173 whether the type is not void (CS1547).
15175 2004-04-28 Martin Baulig <martin@ximian.com>
15177 * expression.cs (Unary.DoResolveLValue): Override this and report
15178 CS0131 for anything but Operator.Indirection.
15180 2004-04-28 Martin Baulig <martin@ximian.com>
15182 Committing a patch from Ben Maurer; see bug #50820.
15184 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
15187 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
15190 2004-04-28 Martin Baulig <martin@ximian.com>
15192 Committing a patch from Ben Maurer; see bug #50820.
15194 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
15197 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
15200 2004-04-28 Martin Baulig <martin@ximian.com>
15202 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
15203 (Block.AddLabel): Call DoLookupLabel() to only search in the
15206 2004-04-28 Martin Baulig <martin@ximian.com>
15208 * cfold.cs (ConstantFold.BinaryFold): Added special support for
15209 comparing StringConstants and NullLiterals in Equality and Inequality.
15211 2004-04-28 Jackson Harper <jackson@ximian.com>
15213 * driver.cs: Attempt to load referenced assemblies from the
15214 GAC. This is the quick and dirty version of this method that
15215 doesnt take into account versions and just takes the first
15216 canidate found. Will be good enough for now as we will not have more
15217 then one version installed into the GAC until I update this method.
15219 2004-04-28 Martin Baulig <martin@ximian.com>
15221 * typemanager.cs (TypeManager.CheckStructCycles): New public
15222 static method to check for cycles in the struct layout.
15224 * rootcontext.cs (RootContext.PopulateTypes): Call
15225 TypeManager.CheckStructCycles() for each TypeContainer.
15226 [Note: We only need to visit each type once.]
15228 2004-04-28 Martin Baulig <martin@ximian.com>
15230 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
15232 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
15233 success and added `out object value'. Use a `bool resolved' field
15234 to check whether we've already been called rather than
15235 `ConstantValue != null' since this breaks for NullLiterals.
15237 2004-04-28 Raja R Harinath <rharinath@novell.com>
15239 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
15240 setting of this flag, since the 'set' method may be non-public.
15242 2004-04-28 Raja R Harinath <rharinath@novell.com>
15244 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
15245 check on current_vector.Block.
15247 2004-04-27 Martin Baulig <martin@ximian.com>
15249 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
15250 a field initializer. Fixes #56459.
15252 2004-04-27 Martin Baulig <martin@ximian.com>
15254 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
15255 we're not attempting to use an indexer. Fixes #52154.
15257 2004-04-27 Martin Baulig <martin@ximian.com>
15259 * statement.cs (Return): Don't create a return label if we don't
15260 need it; reverts my change from January 20th. Thanks to Ben
15263 2004-04-27 Martin Baulig <martin@ximian.com>
15265 According to the spec, `goto' can only leave a nested scope, but
15268 * statement.cs (Block.LookupLabel): Only lookup in the current
15269 block, don't recurse into parent or child blocks.
15270 (Block.AddLabel): Check in parent and child blocks, report
15271 CS0140/CS0158 if we find a duplicate.
15272 (Block): Removed this indexer for label lookups.
15273 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
15274 this already does the error reporting for us.
15277 (FlowBranching.UsageVector.Block): New public variable; may be null.
15278 (FlowBranching.CreateSibling): Added `Block' argument.
15279 (FlowBranching.LookupLabel): New public virtual method. Lookup a
15280 label for the target of a `goto' and check whether we're not
15281 leaving a `finally'.
15283 2004-04-27 Martin Baulig <martin@ximian.com>
15285 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
15286 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
15289 2004-04-27 Martin Baulig <martin@ximian.com>
15291 * statement.cs (Block.AddLabel): Also check for implicit blocks
15292 and added a CS0158 check.
15294 2004-04-27 Martin Baulig <martin@ximian.com>
15296 * flowanalysis.cs (FlowBranchingLoop): New class.
15297 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
15298 UsageVector's instead of an ArrayList.
15299 (FlowBranching.Label): Likewise.
15300 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
15301 (FlowBranching.AddBreakVector): New method.
15303 2004-04-27 Miguel de Icaza <miguel@ximian.com>
15305 * attribute.cs: Small regression fix: only convert the type if we
15306 the type is different, fixes System.Drawing build.
15308 2004-04-27 Martin Baulig <martin@ximian.com>
15310 * attribute.cs (Attribute.Resolve): If we have a constant value
15311 for a named field or property, implicity convert it to the correct
15314 2004-04-27 Raja R Harinath <rharinath@novell.com>
15316 * statement.cs (Block.Block): Implicit blocks share
15317 'child_variable_names' fields with parent blocks.
15318 (Block.AddChildVariableNames): Remove.
15319 (Block.AddVariable): Mark variable as "used by a child block" in
15320 every surrounding block.
15321 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
15322 been used in a child block, complain about violation of "Invariant
15323 meaning in blocks" rule.
15324 * cs-parser.jay (declare_local_variables): Don't use
15325 AddChildVariableNames.
15326 (foreach_statement): Don't create an implicit block: 'foreach'
15327 introduces a scope.
15329 2004-04-23 Miguel de Icaza <miguel@ximian.com>
15331 * convert.cs (ImplicitNumericConversion): 0 is also positive when
15332 converting from 0L to ulong. Fixes 57522.
15334 2004-04-22 Marek Safar <marek.safar@seznam.cz>
15336 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
15337 derived class hides via 'new' keyword field from base class (test-242.cs).
15338 TODO: Handle this in the more general way.
15340 * class.cs (CheckBase): Ditto.
15342 2004-04-22 Marek Safar <marek.safar@seznam.cz>
15344 * decl.cs (caching_flags): New member for storing cached values
15346 (MemberCore.Flags): New enum where bit flags for caching_flags
15348 (MemberCore.cls_compliance): Moved to caching_flags.
15349 (DeclSpace.Created): Moved to caching_flags.
15351 * class.cs: Use caching_flags instead of DeclSpace.Created
15353 2004-04-21 Miguel de Icaza <miguel@ximian.com>
15355 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
15356 if we are only a derived class, not a nested class.
15358 * typemanager.cs: Same as above, but do this at the MemberLookup
15359 level (used by field and methods, properties are handled in
15360 PropertyExpr). Allow for the qualified access if we are a nested
15363 2004-04-21 Marek Safar <marek.safar@seznam.cz>
15365 * class.cs: Refactoring.
15366 (IMethodData): New inteface; Holds links to parent members
15367 to avoid member duplication (reduced memory allocation).
15368 (Method): Implemented IMethodData interface.
15369 (PropertyBase): New inner classes for get/set methods.
15370 (PropertyBase.PropertyMethod): Implemented IMethodData interface
15371 (Event): New inner classes for add/remove methods.
15372 (Event.DelegateMethod): Implemented IMethodData interface.
15374 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
15375 EmitContext (related to class.cs refactoring).
15377 2004-04-21 Raja R Harinath <rharinath@novell.com>
15379 * delegate.cs (Delegate.VerifyApplicability): If the number of
15380 arguments are the same as the number of parameters, first try to
15381 verify applicability ignoring any 'params' modifier on the last
15385 2004-04-16 Raja R Harinath <rharinath@novell.com>
15387 * class.cs (TypeContainer.AddIndexer): Use
15388 'ExplicitInterfaceName' to determine if interface name was
15389 explicitly specified. 'InterfaceType' is not initialized at this time.
15390 (TypeContainer.DefineIndexers): Remove use of temporary list. The
15391 Indexers array is already in the required order. Initialize
15392 'IndexerName' only if there are normal indexers.
15393 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
15394 (TypeContainer.Emit): Emit DefaultMember attribute only if
15395 IndexerName is initialized.
15398 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
15400 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
15403 2004-04-15 Raja R Harinath <rharinath@novell.com>
15405 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
15409 * attribute.cs (Attribute.Resolve): Check for duplicate named
15413 2004-04-15 Miguel de Icaza <miguel@ximian.com>
15415 * iterators.cs (MarkYield): track whether we are in an exception,
15416 and generate code accordingly. Use a temporary value to store the
15417 result for our state.
15419 I had ignored a bit the interaction of try/catch with iterators
15420 since their behavior was not entirely obvious, but now it is
15421 possible to verify that our behavior is the same as MS .NET 2.0
15425 2004-04-14 Miguel de Icaza <miguel@ximian.com>
15427 * iterators.cs: Avoid creating temporaries if there is no work to
15430 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
15431 Enumerations, use TypeManager.EnumToUnderlying and call
15434 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
15437 (This.Emit): Use EmitContext.EmitThis to emit our
15440 (This.EmitAssign): Ditto.
15442 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
15443 codepaths, we will move all the functionality into
15446 (FieldExpr.EmitAssign): Ditto.
15448 This fixes several hidden bugs that I uncovered while doing a code
15449 review of this today.
15451 * codegen.cs (EmitThis): reworked so the semantics are more clear
15452 and also support value types "this" instances.
15454 * iterators.cs: Changed so that for iterators in value types, we
15455 do not pass the value type as a parameter.
15457 Initialization of the enumerator helpers is now done in the caller
15458 instead of passing the parameters to the constructors and having
15459 the constructor set the fields.
15461 The fields have now `assembly' visibility instead of private.
15463 2004-04-11 Miguel de Icaza <miguel@ximian.com>
15465 * expression.cs (Argument.Resolve): Check if fields passed as ref
15466 or out are contained in a MarshalByRefObject.
15468 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
15469 another compiler type.
15471 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
15473 * class.cs (Indexer.Define): use the new name checking method.
15474 Also, return false on an error.
15475 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
15476 (is_identifier_[start/part]_character): make static.
15478 2004-04-10 Miguel de Icaza <miguel@ximian.com>
15480 * expression.cs (Binary.ResolveOperator): Do no append strings
15481 twice: since we can be invoked more than once (array evaluation)
15482 on the same concatenation, take care of this here. Based on a fix
15483 from Ben (bug #56454)
15485 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
15487 * codegen.cs: Fix another case where CS1548 must be reported (when
15488 delay-sign isn't specified and no private is available #56564). Fix
15489 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
15490 error when MCS is used on the MS runtime and we need to delay-sign
15491 (which seems unsupported by AssemblyBuilder - see #56621).
15493 2004-04-08 Marek Safar <marek.safar@seznam.cz>
15495 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
15496 (TypeManager.ComputeNamespaces): Faster implementation for
15499 * compiler.csproj: Updated AssemblyName to mcs.
15501 2004-04-07 Miguel de Icaza <miguel@ximian.com>
15503 * rootcontext.cs: Add new types to the boot resolution.
15505 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
15506 MulticastDelegate is not allowed.
15508 * typemanager.cs: Add new types to lookup: System.TypedReference
15511 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
15512 check for TypedReference or ArgIterator, they are not allowed.
15514 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
15515 makes us properly catch 1510 in some conditions (see bug 56016 for
15518 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
15520 * CryptoConvert.cs: update from corlib version
15523 2004-04-05 Miguel de Icaza <miguel@ximian.com>
15525 * class.cs (Indexer.Define): Check indexername declaration
15527 2004-04-05 Marek Safar <marek.safar@seznam.cz>
15529 * attribute.cs (IsClsCompliant): Fixed problem with handling
15530 all three states (compliant, not-compliant, undetected).
15532 2004-03-30 Marek Safar <marek.safar@seznam.cz>
15534 * attribute.cs (Attribute): Location is now public.
15535 (Resolve): Store resolved arguments (pos_values) in attribute class.
15536 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
15537 (GetClsCompliantAttributeValue): New method that gets
15538 CLSCompliantAttribute value.
15539 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
15540 if exists else null.
15541 (AttributeTester): New class for CLS-Compliant verification routines.
15543 * class.cs (Emit): Add CLS-Compliant verification.
15544 (Method.GetSignatureForError): Implemented.
15545 (Constructor.GetSignatureForError): Implemented
15546 (Constructor.HasCompliantArgs): Returns if constructor has
15547 CLS-Compliant arguments.
15548 (Constructor.Emit): Override.
15549 (Construcor.IsIdentifierClsCompliant): New method; For constructors
15550 is needed to test only parameters.
15551 (FieldBase.GetSignatureForError): Implemented.
15552 (TypeContainer): New member for storing base interfaces.
15553 (TypeContainer.FindMembers): Search in base interfaces too.
15555 * codegen.cs (GetClsComplianceAttribute): New method that gets
15556 assembly or module CLSCompliantAttribute value.
15557 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
15559 (ModuleClass.Emit): Add error 3012 test.
15561 * const.cs (Emit): Override and call base for CLS-Compliant tests.
15563 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
15564 state for all decl types.
15565 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
15566 if CLS-Compliant tests are required.
15567 (IsClsCompliaceRequired): New method. Analyze whether code
15568 must be CLS-Compliant.
15569 (IsExposedFromAssembly): New method. Returns true when MemberCore
15570 is exposed from assembly.
15571 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
15572 value or gets cached value.
15573 (HasClsCompliantAttribute): New method. Returns true if MemberCore
15574 is explicitly marked with CLSCompliantAttribute.
15575 (IsIdentifierClsCompliant): New abstract method. This method is
15576 used to testing error 3005.
15577 (IsIdentifierAndParamClsCompliant): New method. Common helper method
15578 for identifier and parameters CLS-Compliant testing.
15579 (VerifyClsCompliance): New method. The main virtual method for
15580 CLS-Compliant verifications.
15581 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
15582 null. I don't know why is null (too many public members !).
15583 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
15584 and get value of first CLSCompliantAttribute that found.
15586 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
15587 (VerifyClsCompliance): Override and add extra tests.
15589 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
15590 clscheck- disable CLS-Compliant verification event if assembly is has
15591 CLSCompliantAttribute(true).
15593 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
15594 ApllyAttribute is now called in emit section as in the other cases.
15595 Possible future Emit integration.
15596 (IsIdentifierClsCompliant): New override.
15597 (VerifyClsCompliance): New override.
15598 (GetEnumeratorName): Returns full enum name.
15600 * parameter.cs (GetSignatureForError): Implemented.
15602 * report.cs (WarningData): New struct for Warning message information.
15603 (LocationOfPreviousError): New method.
15604 (Warning): New method. Reports warning based on the warning table.
15605 (Error_T): New method. Reports error based on the error table.
15607 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
15608 verifications are done here.
15610 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
15612 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
15613 CLSCompliantAttribute.
15614 (all_imported_types): New member holds all imported types from other
15616 (LoadAllImportedTypes): New method fills static table with exported types
15617 from all referenced assemblies.
15618 (Modules): New property returns all assembly modules.
15620 2004-03-30 Miguel de Icaza <miguel@ximian.com>
15622 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
15623 throwing a parser error.
15625 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
15626 which removes the hardcoded get_/set_ prefixes for properties, as
15627 IL allows for the properties to be named something else.
15631 * expression.cs: Do not override operand before we know if it is
15632 non-null. Fix 56207
15634 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
15636 * typemanager.cs: support for pinned variables.
15638 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
15640 * decl.cs, typemanager.cs: Avoid using an arraylist
15641 as a buffer if there is only one result set.
15643 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
15645 * expression.cs: Make sure you cant call a static method
15646 with an instance expression, bug #56174.
15648 2004-03-29 Miguel de Icaza <miguel@ximian.com>
15650 * class.cs (IsDuplicateImplementation): Improve error reporting to
15651 flag 663 (method only differs in parameter modifier).
15653 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
15654 in preprocessor directives.
15656 * location.cs (LookupFile): Allow for the empty path.
15658 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
15659 better approach for some of that patch, but its failing with the
15660 CharSet enumeration. For now try/catch will do.
15662 * typemanager.cs: Do not crash if a struct does not have fields.
15665 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
15667 * expression.cs: cs0213, cant fix a fixed expression.
15670 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
15672 * cs-parser.jay: detect invalid embeded statements gracefully.
15675 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
15677 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
15680 the invocation type may not be a subclass of the tye of the item/
15681 The type of the item must be a subclass of the invocation item.
15686 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
15688 * attribute.cs: Added methods to get a string and a bool from an
15689 attribute. Required to information from AssemblyKeyFileAttribute,
15690 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
15691 * codegen.cs: Modified AssemblyName creation to include support for
15692 strongnames. Catch additional exceptions to report them as CS1548.
15693 * compiler.csproj: Updated include CryptoConvert.cs.
15694 * compiler.csproj.user: Removed file - user specific configuration.
15695 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
15696 Mono.Security assembly. The original class is maintained and tested in
15697 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
15698 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
15699 like CSC 8.0 (C# v2) supports.
15700 * Makefile: Added CryptoConvert.cs to mcs sources.
15701 * rootcontext.cs: Added new options for strongnames.
15703 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
15705 * driver.cs: For --expect-error, report error code `2'
15706 if the program compiled with no errors, error code `1' if
15707 it compiled with an error other than the one expected.
15709 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
15711 * compiler.csproj: Updated for Visual Studio .NET 2003.
15712 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
15713 * compiler.sln: Updated for Visual Studio .NET 2003.
15715 2004-03-24 Ravi Pratap M <ravi@ximian.com>
15717 * expression.cs: Fix bug #47234. We basically need to apply the
15718 rule that we prefer the conversion of null to a reference type
15719 when faced with a conversion to 'object' (csc behaviour).
15721 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
15723 * statement.cs: Shorter form for foreach, eliminates
15724 a local variable. r=Martin.
15726 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
15728 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
15729 checks if we can use brtrue/brfalse to test for 0.
15730 * expression.cs: use the above in the test for using brtrue/brfalse.
15731 cleanup code a bit.
15733 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
15735 * expression.cs: Rewrite string concat stuff. Benefits:
15737 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
15738 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
15739 rather than a concat chain.
15741 * typemanager.cs: Add lookups for more concat overloads.
15743 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
15745 * expression.cs: Emit shorter il code for array init.
15762 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
15764 * statement.cs: Before, two switch blocks would be merged if the
15765 total size of the blocks (end_item - begin_item + 1) was less than
15766 two times the combined sizes of the blocks.
15768 Now, it will only merge if after the merge at least half of the
15773 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
15775 * class.cs : csc build fix for GetMethods(). See bug #52503.
15777 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
15779 * expression.cs: Make sure fp comparisons work with NaN.
15780 This fixes bug #54303. Mig approved this patch a long
15781 time ago, but we were not able to test b/c the runtime
15784 2004-03-19 Miguel de Icaza <miguel@ximian.com>
15786 * ecore.cs (TypExpr.GetHashCode): implement this overload.
15788 2004-03-19 Martin Baulig <martin@ximian.com>
15790 * class.cs (MemberCore.IsDuplicateImplementation): Report the
15791 error here and not in our caller.
15793 2004-03-19 Martin Baulig <martin@ximian.com>
15795 * interface.cs: Completely killed this file.
15796 (Interface): We're now a TypeContainer and live in class.cs.
15798 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
15799 argument; we're now also called for interfaces.
15800 (TypeContainer.DefineMembers): Allow this method being called
15802 (TypeContainer.GetMethods): New public method; formerly known as
15803 Interface.GetMethod(). This is used by PendingImplementation.
15804 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
15805 it's now private and non-static.
15806 (Interface): Moved this here; it's now implemented similar to
15808 (Method, Property, Event, Indexer): Added `bool is_interface'
15809 argument to their .ctor's.
15810 (MemberBase.IsInterface): New public field.
15812 * cs-parser.jay: Create normal Method, Property, Event, Indexer
15813 instances instead of InterfaceMethod, InterfaceProperty, etc.
15814 (opt_interface_base): Removed; we now use `opt_class_base' instead.
15815 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
15817 2004-03-19 Martin Baulig <martin@ximian.com>
15819 * class.cs (MethodCore.IsDuplicateImplementation): New private
15820 method which does the CS0111 checking.
15821 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
15822 Use IsDuplicateImplementation().
15824 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
15826 * decl.cs (FindMemberToOverride): New method to find the correct
15827 method or property to override in the base class.
15829 - Make Method/Property use the above method to find the
15830 version in the base class.
15831 - Remove the InheritableMemberSignatureCompare as it is now
15834 This patch makes large code bases much faster to compile, as it is
15835 O(n) rather than O(n^2) to do this validation.
15837 Also, it fixes bug 52458 which is that nested classes are not
15838 taken into account when finding the base class member.
15840 Reviewed/Approved by Martin.
15842 2004-03-17 Marek Safar <marek.safar@seznam.cz>
15844 * interface.cs: In all interface classes removed redundant
15845 member initialization.
15847 2004-03-16 Martin Baulig <martin@ximian.com>
15849 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
15851 2004-03-15 Miguel de Icaza <miguel@ximian.com>
15853 * decl.cs (DefineTypeAndParents): New helper method to define a
15854 type's containers before the type itself is defined; This is a
15855 bug exposed by the recent changes to Windows.Forms when an
15856 implemented interface was defined inside a class that had not been
15859 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
15861 (Check): Loop correctly to report errors modifiers
15862 (UNSAFE was not in the loop, since it was the same as TOP).
15864 * interface.cs: Every interface member now takes a ModFlags,
15865 instead of a "is_new" bool, which we set on the base MemberCore.
15867 Every place where we called "UnsafeOk" in the interface, now we
15868 call the proper member (InterfaceMethod.UnsafeOK) instead to get
15869 the unsafe settings from the member declaration instead of the
15870 container interface.
15872 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
15874 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
15875 `set_indexer_name' to the pending bits (one per type).
15877 We fixed a bug today that was picking the wrong method to
15878 override, since for properties the existing InterfaceMethod code
15879 basically ignored the method name. Now we make sure that the
15880 method name is one of the valid indexer names.
15882 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
15884 * support.cs (SeekableStreamReader): Keep track of stream byte
15885 positions and don't mix them with character offsets to the buffer.
15887 Patch from Gustavo Giráldez
15889 2004-03-15 Marek Safar <marek.safar@seznam.cz>
15891 * interface.cs (InterfaceSetGetBase): Removed double member
15892 initialization, base class does it as well.
15894 2004-03-13 Martin Baulig <martin@ximian.com>
15896 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
15897 when compiling corlib.
15899 2004-03-13 Miguel de Icaza <miguel@ximian.com>
15901 * convert.cs (ExplicitConversion): We were reporting an error on
15902 certain conversions (object_type source to a value type, when the
15903 expression was `null') before we had a chance to pass it through
15904 the user defined conversions.
15906 * driver.cs: Replace / and \ in resource specifications to dots.
15909 * class.cs: Add check for duplicate operators. Fixes 52477
15911 2004-03-11 Miguel de Icaza <miguel@ximian.com>
15913 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
15914 that are in the middle of the statements, not only at the end.
15917 * class.cs (TypeContainer.AddField): No longer set the
15918 `HaveStaticConstructor' flag, now we call it
15919 `UserDefineStaticConstructor' to diferentiate the slightly
15920 semantic difference.
15922 The situation is that we were not adding BeforeFieldInit (from
15923 Modifiers.TypeAttr) to classes that could have it.
15924 BeforeFieldInit should be set to classes that have no static
15929 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
15931 And most importantly Zoltan's comment:
15933 http://bugzilla.ximian.com/show_bug.cgi?id=44229
15935 "I think beforefieldinit means 'it's ok to initialize the type sometime
15936 before its static fields are used', i.e. initialization does not need
15937 to be triggered by the first access to the type. Setting this flag
15938 helps the JIT to compile better code, since it can run the static
15939 constructor at JIT time, and does not need to generate code to call it
15940 (possibly lots of times) at runtime. Unfortunately, mcs does not set
15941 this flag for lots of classes like String.
15943 csc sets this flag if the type does not have an explicit static
15944 constructor. The reasoning seems to be that if there are only static
15945 initalizers for a type, and no static constructor, then the programmer
15946 does not care when this initialization happens, so beforefieldinit
15949 This bug prevents the AOT compiler from being usable, since it
15950 generates so many calls to mono_runtime_class_init that the AOT code
15951 is much slower than the JITted code. The JITted code is faster,
15952 because it does not generate these calls if the vtable is type is
15953 already initialized, which is true in the majority of cases. But the
15954 AOT compiler can't do this."
15956 2004-03-10 Miguel de Icaza <miguel@ximian.com>
15958 * class.cs (MethodData.Emit): Refactor the code so symbolic
15959 information is generated for destructors; For some reasons we
15960 were taking a code path that did not generate symbolic information
15963 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
15965 * class.cs: Create a Constructor.CheckBase method that
15966 takes care of all validation type code. The method
15967 contains some code that was moved from Define.
15969 It also includes new code that checks for duplicate ctors.
15970 This fixes bug #55148.
15972 2004-03-09 Joshua Tauberer <tauberer@for.net>
15974 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
15975 a { ... }-style array creation invokes EmitStaticInitializers
15976 which is not good for reference-type arrays. String, decimal
15977 and now null constants (NullCast) are not counted toward
15978 static initializers.
15980 2004-03-05 Martin Baulig <martin@ximian.com>
15982 * location.cs (SourceFile.HasLineDirective): New public field;
15983 specifies whether the file contains or is referenced by a "#line"
15985 (Location.DefineSymbolDocuments): Ignore source files which
15986 either contain or are referenced by a "#line" directive.
15988 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
15990 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
15991 direct access to our parent, so check the method inline there.
15993 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
15995 * expression.cs (Invocation.EmitCall): Miguel's last commit
15996 caused a regression. If you had:
16001 In Foo the implict this would be null.
16003 2004-02-27 Miguel de Icaza <miguel@ximian.com>
16005 * expression.cs (Invocation.EmitCall): If the method is not
16006 virtual, do not emit a CallVirt to it, use Call.
16008 * typemanager.cs (GetFullNameSignature): Improve the method to
16009 cope with ".ctor" and replace it with the type name.
16011 * class.cs (ConstructorInitializer.Resolve): Now the method takes
16012 as an argument the ConstructorBuilder where it is being defined,
16013 to catch the recursive constructor invocations.
16015 2004-02-26 Miguel de Icaza <miguel@ximian.com>
16017 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
16018 routines to check if a type is an enumerable/enumerator allow
16019 classes that implement the IEnumerable or IEnumerator interfaces.
16021 * class.cs (Property, Operator): Implement IIteratorContainer, and
16022 implement SetYields.
16024 (Property.Define): Do the block swapping for get_methods in the
16025 context of iterators. We need to check if Properties also
16026 include indexers or not.
16028 (Operator): Assign the Block before invoking the
16029 OperatorMethod.Define, so we can trigger the Iterator code
16032 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
16033 Property and Operator classes are not created when we parse the
16034 declarator but until we have the block completed, so we use a
16035 singleton SimpleIteratorContainer.Simple to flag whether the
16036 SetYields has been invoked.
16038 We propagate this setting then to the Property or the Operator to
16039 allow the `yield' to function.
16041 2004-02-25 Marek Safar <marek.safar@seznam.cz>
16043 * codegen.cs: Implemented attribute support for modules.
16044 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
16045 Assembly/Module functionality.
16047 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
16048 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
16049 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
16051 2004-02-16 Marek Safar <marek.safar@seznam.cz>
16053 * interface.cs (FindMembers): The operation is performed on all base
16054 interfaces and not only on the first. It is required for future CLS Compliance patch.
16056 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
16058 * statement.cs, codegen.cs:
16059 This patch deals with patterns such as:
16061 public class List : IEnumerable {
16063 public MyEnumerator GetEnumerator () {
16064 return new MyEnumerator(this);
16067 IEnumerator IEnumerable.GetEnumerator () {
16071 public struct MyEnumerator : IEnumerator {
16076 Before, there were a few things we did wrong:
16077 1) we would emit callvirt on a struct, which is illegal
16078 2) we emited ldarg when we needed to emit ldarga
16079 3) we would mistakenly call the interface methods on an enumerator
16080 type that derived from IEnumerator and was in another assembly. For example:
16082 public class MyEnumerator : IEnumerator
16084 Would have the interface methods called, even if there were public impls of the
16085 method. In a struct, this lead to invalid IL code.
16087 2004-02-11 Marek Safar <marek.safar@seznam.cz>
16089 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
16092 * delegate.cs (Define): Fixed crash when delegate type is undefined.
16094 2004-02-11 Miguel de Icaza <miguel@ximian.com>
16096 * cs-parser.jay: Fix small regression: we were not testing V2
16097 compiler features correctly.
16099 * interface.cs: If the emit context is null, then create one
16101 2004-02-09 Marek Safar <marek.safar@seznam.cz>
16103 * decl.cs (GetSignatureForError): New virtual method to get full name
16104 for error messages.
16106 * attribute.cs (IAttributeSupport): New interface for attribute setting.
16107 Now it is possible to rewrite ApplyAttributes method to be less if/else.
16109 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
16110 Duplicated members and code in these classes has been removed.
16111 Better encapsulation in these classes.
16113 2004-02-07 Miguel de Icaza <miguel@ximian.com>
16115 * assign.cs (Assign.DoResolve): When dealing with compound
16116 assignments, there is a new rule in ECMA C# 2.4 (might have been
16117 there before, but it is documented here) that states that in:
16121 If b is of type int, and the `op' is a shift-operator, then the
16122 above is evaluated as:
16126 * expression.cs (Binary.ResolveOperator): Instead of testing for
16127 int/uint/long/ulong, try to implicitly convert to any of those
16128 types and use that in pointer arithmetic.
16130 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
16131 method to print information for from the type, not from the
16132 null-method we were given.
16134 2004-02-01 Duncan Mak <duncan@ximian.com>
16136 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
16137 parsing for cmd, fixes bug #53694.
16139 2004-02-04 Marek Safar <marek.safar@seznam.cz>
16141 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
16142 in the member name duplication tests. Property and operator name duplication
16143 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
16145 2004-02-03 Marek Safar <marek.safar@seznam.cz>
16147 * interface.cs (PopulateMethod): Fixed crash when interface method
16148 returns not existing type (error test cs0246-3.cs).
16150 2004-02-02 Ravi Pratap M <ravi@ximian.com>
16152 * cs-parser.jay (interface_accessors): Re-write actions to also
16153 store attributes attached to get and set methods. Fix spelling
16156 (inteface_property_declaration): Modify accordingly.
16158 (InterfaceAccessorInfo): New helper class to store information to pass
16159 around between rules that use interface_accessors.
16161 * interface.cs (Emit): Apply attributes on the get and set
16162 accessors of properties and indexers too.
16164 * attribute.cs (ApplyAttributes): Modify accordingly to use the
16165 right MethodBuilder when applying attributes to the get and set accessors.
16167 2004-01-31 Miguel de Icaza <miguel@ximian.com>
16169 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
16171 2004-01-26 Miguel de Icaza <miguel@ximian.com>
16173 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
16175 2004-01-25 Miguel de Icaza <miguel@ximian.com>
16177 * cs-parser.jay: Remove YIELD token, instead use the new grammar
16178 changes that treat `yield' specially when present before `break'
16179 or `return' tokens.
16181 * cs-tokenizer.cs: yield is no longer a keyword.
16183 2004-01-23 Marek Safar <marek.safar@seznam.cz>
16185 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
16186 setting for default constructors.
16187 For default constructors are almost every time set wrong Modifier. The
16188 generated IL code has been alright. But inside mcs this values was
16189 wrong and this was reason why several of my CLS Compliance tests
16192 2004-01-22 Martin Baulig <martin@ximian.com>
16194 * cs-parser.jay (namespace_or_type_name): Return an Expression,
16195 not a QualifiedIdentifier. This is what `type_name_expression'
16196 was previously doing.
16197 (type_name_expression): Removed; the code is now in
16198 `namespace_or_type_name'.
16199 (qualified_identifier): Removed, use `namespace_or_type_name'
16201 (QualifiedIdentifier): Removed this class.
16203 2004-01-22 Martin Baulig <martin@ximian.com>
16205 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
16206 not a string as alias name.
16208 2004-01-21 Miguel de Icaza <miguel@ximian.com>
16210 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
16211 #52730 bug, and instead compute correctly the need to use a
16212 temporary variable when requesting an address based on the
16213 static/instace modified of the field and the constructor.
16215 2004-01-21 Martin Baulig <martin@ximian.com>
16217 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
16218 class and namespace before looking up aliases. Fixes #52517.
16220 2004-01-21 Martin Baulig <martin@ximian.com>
16222 * flowanalysis.cs (UsageVector.Merge): Allow variables being
16223 assinged in a 'try'; fixes exception4.cs.
16225 2004-01-21 Marek Safar <marek.safar@seznam.cz>
16226 * class.cs : Implemented parameter-less constructor for TypeContainer
16228 * decl.cs: Attributes are now stored here. New property OptAttributes
16230 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
16232 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
16234 2004-01-21 Marek Safar <marek.safar@seznam.cz>
16236 * typemanager.cs (CSharpSignature): Now reports also inner class name.
16237 (CSharpSignature): New method for indexer and property signature.
16239 2004-01-21 Marek Safar <marek.safar@seznam.cz>
16241 * pending.cs (IsVirtualFilter): Faster implementation.
16243 2004-01-21 Marek Safar <marek.safar@seznam.cz>
16245 * typemanager.cs: Avoid inclusion of same assembly more than once.
16247 2004-01-21 Marek Safar <marek.safar@seznam.cz>
16249 * cs-parser.jay: Fixed problem where the last assembly attribute
16250 has been applied also to following declaration (class, struct, etc.)
16252 2004-01-21 Marek Safar <marek.safar@seznam.cz>
16254 * class.cs: Added error CS0538, CS0539 reporting.
16255 Fixed crash on Microsoft runtime when field type is void.
16257 * cs-parser.jay: Added error CS0537 reporting.
16259 * pending.cs: Added error CS0535 reporting.
16260 Improved error report for errors CS0536, CS0534.
16262 2004-01-20 Miguel de Icaza <miguel@ximian.com>
16264 Merge a few bits from the Anonymous Method MCS tree.
16266 * statement.cs (ToplevelBlock): New class for toplevel methods,
16267 will hold anonymous methods, lifted variables.
16269 * cs-parser.jay: Create toplevel blocks for delegates and for
16270 regular blocks of code.
16272 2004-01-20 Martin Baulig <martin@ximian.com>
16274 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
16275 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
16276 and `NeedExplicitReturn'; added `IsLastStatement'.
16277 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
16278 have a `ReturnLabel' or we're not unreachable.
16280 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
16281 child's reachability; don't just override ours with it. Fixes
16282 #58058 (lluis's example).
16283 (FlowBranching): Added public InTryOrCatch(), InCatch(),
16284 InFinally(), InLoop(), InSwitch() and
16285 BreakCrossesTryCatchBoundary() methods.
16287 * statement.cs (Return): Do all error checking in Resolve().
16288 Unless we are the last statement in a top-level block, always
16289 create a return label and jump to it.
16290 (Break, Continue): Do all error checking in Resolve(); also make
16291 sure we aren't leaving a `finally'.
16292 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
16293 statement in a top-level block.
16294 (Block.Flags): Added `IsDestructor'.
16295 (Block.IsDestructor): New public property.
16297 2004-01-20 Martin Baulig <martin@ximian.com>
16299 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
16301 2004-01-20 Martin Baulig <martin@ximian.com>
16303 * statement.cs (Statement.ResolveUnreachable): New public method.
16304 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
16305 (Block.Resolve): Resolve unreachable statements.
16307 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
16309 * expression.cs: We need to fix the case where we do
16310 not have a temp variable here.
16312 * assign.cs: Only expression compound assignments need
16313 temporary variables.
16315 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
16317 * flowanalysis.cs: Reduce memory allocation in a few ways:
16318 - A block with no variables should not allocate a bit
16320 - A method with no out parameters does not need any tracking
16321 for assignment of the parameters, so we need not allocate
16324 public readonly Type[] VariableTypes;
16325 public readonly string[] VariableNames;
16326 Are redundant. The data is already stored in the variable
16327 map, so we need not allocate another array for it.
16328 - We need to add alot of checks for if (params | locals) == null
16329 due to the first two changes.
16331 2004-01-18 Miguel de Icaza <miguel@ximian.com>
16333 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
16334 implement IMemoryLocation, we store a copy on a local variable and
16335 take the address of it. Patch from Benjamin Jemlich
16337 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
16338 to use a special "type_name_expression" rule which reduces the
16339 number of "QualifiedIdentifier" classes created, and instead
16340 directly creates MemberAccess expressions.
16342 2004-01-17 Miguel de Icaza <miguel@ximian.com>
16344 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
16345 that fixes #52853. Null literal assignment to ValueType
16347 * class.cs (MethodData.Emit): Instead of checking the name of the
16348 method to determine if its a destructor, create a new derived
16349 class from Method called Destructor, and test for that.
16351 * cs-parser.jay: Create a Destructor object instead of a Method.
16353 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
16357 2004-01-16 Miguel de Icaza <miguel@ximian.com>
16359 * expression.cs (Binary.ResolveOperator): Perform an implicit
16360 conversion from MethodGroups to their delegate types on the
16361 Addition operation.
16363 * delegate.cs: Introduce a new class DelegateCreation that is the
16364 base class for `NewDelegate' and `ImplicitDelegateCreation',
16365 factor some code in here.
16367 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
16368 conversion from MethodGroups to compatible delegate types.
16370 * ecore.cs (Expression.Resolve): Do not flag error 654
16371 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
16372 we allow conversions from MethodGroups to delegate types now.
16374 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
16375 assignments in v2 either.
16377 2004-01-10 Miguel de Icaza <miguel@ximian.com>
16379 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
16380 static read-only fields in ctors.
16382 Applied patch from Benjamin Jemlich
16384 * expression.cs (UnaryMutator): Avoid leaking local variables.
16386 2004-01-09 Miguel de Icaza <miguel@ximian.com>
16388 * cs-tokenizer.cs (IsCastToken): Allow the various native types
16389 here to return true, as they can be used like this:
16391 (XXX) int.MEMBER ()
16393 Fixed 49836 and all the other dups
16395 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
16397 * driver.cs: Implement /win32res and /win32icon.
16399 2004-01-08 Miguel de Icaza <miguel@ximian.com>
16401 * cs-parser.jay: Add a rule to improve error handling for the
16402 common mistake of placing modifiers after the type.
16404 2004-01-07 Miguel de Icaza <miguel@ximian.com>
16406 * cs-parser.jay (interface_event_declaration): Catch
16407 initialization of events on interfaces, and report cs0068
16409 * cs-parser.jay (interface_event_declaration): Catch
16410 initialization of events.
16412 * ecore.cs: Better report missing constructors.
16414 * expression.cs (Binary.ResolveOperator): My previous bug fix had
16415 the error reporting done in the wrong place. Fix.
16417 * expression.cs (Binary.ResolveOperator): Catch the
16418 operator + (E x, E y) error earlier, and later allow for implicit
16419 conversions in operator +/- (E e, U x) from U to the underlying
16422 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
16423 52596, if the container class is abstract, the default constructor
16424 is protected otherwise its public (before, we were always public).
16426 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
16429 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
16430 Jemlich that fixes bug #52597, MCS was generating invalid code for
16431 idisposable structs. Thanks to Ben for following up with this
16434 2004-01-06 Miguel de Icaza <miguel@ximian.com>
16436 * driver.cs: Allow assemblies without code to be generated, fixes
16439 2004-01-07 Nick Drochak <ndrochak@gol.com>
16441 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
16443 2004-01-05 Miguel de Icaza <miguel@ximian.com>
16445 * cs-parser.jay: Add rules to improve error reporting if fields or
16446 methods are declared at the namespace level (error 116)
16448 * Add rules to catch event add/remove
16450 2004-01-04 David Sheldon <dave-mono@earth.li>
16452 * expression.cs: Added matching ")" to error message for
16455 2004-01-03 Todd Berman <tberman@gentoo.org>
16457 * ecore.cs, attribute.cs:
16458 Applying fix from #52429.
16460 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
16462 * ecore.cs, expression.cs, statement.cs:
16463 Total rewrite of how we handle branching. We
16464 now handle complex boolean expressions with fewer
16465 jumps. As well if (x == 0) no longer emits a ceq.
16467 if (x is Foo) is much faster now, because we generate
16470 Overall, we get a pretty big improvement on our benchmark
16471 tests. The code we generate is smaller and more readable.
16473 I did a full two-stage bootstrap. The patch was reviewed
16474 by Martin and Miguel.
16476 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
16478 * cs-parser.jay: Make primary_expression not take a QI.
16479 we dont need this because the member_access rule covers
16480 us here. So we replace the rule with just IDENTIFIER.
16482 This has two good effects. First, we remove a s/r conflict.
16483 Second, we allocate many fewer QualifiedIdentifier objects.
16485 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
16487 * attribute.cs: Handle MarshalAs attributes as pseudo, and
16488 set the correct information via SRE. This prevents
16489 hanging on the MS runtime. Fixes #29374.
16491 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
16493 * convert.cs: correctly handle conversions to value types
16494 from Enum and ValueType as unboxing conversions.
16496 Fixes bug #52569. Patch by Benjamin Jemlich.
16498 2004-01-02 Ravi Pratap <ravi@ximian.com>
16500 * expression.cs (BetterConversion): Prefer int -> uint
16501 over int -> ulong (csc's behaviour). This fixed bug #52046.
16503 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
16505 * decl.cs (MemberCache.FindMembers): now returns a
16508 * typemanager.cs: In general, go with with ^^.
16509 (CopyNewMethods): take an IList.
16510 (RealMemberLookup): Only allocate an arraylist
16511 if we copy from two sets of methods.
16513 This change basically does two things:
16514 1) Fewer array lists allocated due to CopyNewMethods.
16515 2) the explicit cast in MemberList costed ALOT.
16517 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
16519 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
16520 a hashtable to avoid needless string allocations when an identifier is
16521 used more than once (the common case).
16523 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
16525 * pending.cs: MS's TypeBuilder.GetInterfaces ()
16526 is broken, it will not return anything. So, we
16527 have to use the information we have in mcs to
16530 * typemanager.cs: Add a cache for GetInterfaces,
16531 since this will now be used more often (due to ^^)
16533 (GetExplicitInterfaces) New method that gets the
16534 declared, not effective, interfaces on a type
16535 builder (eg, if you have interface IFoo, interface
16536 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
16539 This patch makes MCS able to bootstrap itself on
16542 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
16544 * expression.cs: Remove the Nop's that Miguel put
16547 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
16549 * report.cs, codegen.cs: Give the real stack trace to
16550 the error when an exception is thrown.
16552 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
16554 * decl.cs: only allocate hashtables for ifaces if
16557 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
16559 * expression.cs: fix the error from cs0121-2.cs
16560 (a parent interface has two child interfaces that
16561 have a function with the same name and 0 params
16562 and the function is called through the parent).
16564 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
16566 * class.cs, rootcontext.cs, typmanager.cs: do not
16569 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
16571 * codegen.cs: remove stack for the ec flow branching.
16572 It is already a linked list, so no need.
16574 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
16576 * Makefile: Allow custom profiler here.
16578 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
16580 * typemanager.cs (LookupType):
16581 - Use a static char [], because split takes
16582 a param array for args, so it was allocating
16584 - Do not store true in a hashtable, it boxes.
16586 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
16588 * flowanalysis.cs: bytify common enums.
16590 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
16592 * modifiers.cs: Add a new set of flags for the
16593 flags allowed on explicit interface impls.
16594 * cs-parser.jay: catch the use of modifiers in
16595 interfaces correctly.
16596 * class.cs: catch private void IFoo.Blah ().
16598 All related to bug #50572.
16600 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
16602 * decl.cs: Rewrite the consistant accessability checking.
16603 Accessability is not linear, it must be implemented in
16604 a tableish way. Fixes #49704.
16606 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
16608 * expression.cs: Handle negation in a checked context.
16609 We must use subtraction from zero. Fixes #38674.
16611 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
16613 * class.cs: Ignore static void main in DLLs.
16614 * rootcontext.cs: Handle the target type here,
16615 since we are have to access it from class.cs
16616 * driver.cs: account for the above.
16618 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
16620 * report.cs: Give line numbers and files if available.
16622 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
16624 * driver.cs: Implement /addmodule.
16626 * typemanager.cs: Change 'modules' field so it now contains Modules not
16629 2003-12-20 Martin Baulig <martin@ximian.com>
16631 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
16632 (FieldBase.IsAssigned): Removed this field.
16633 (FieldBase.SetAssigned): New public method.
16634 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
16636 2003-12-20 Martin Baulig <martin@ximian.com>
16638 * expression.cs (LocalVariableReference.DoResolve): Don't set
16639 `vi.Used' if we're called from DoResolveLValue().
16641 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
16642 returns the usage vector it just merged into the current one -
16643 pass this one to UsageWarning().
16644 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
16645 of the `EmitContext', don't call this recursively on our children.
16647 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
16649 * driver.cs: Implement /target:module.
16651 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
16653 * support.cs (CharArrayHashtable): New helper class.
16655 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
16656 char arrays, not strings, so we can avoid creating a string in
16657 consume_identifier if the identifier is a keyword.
16659 2003-12-16 Martin Baulig <martin@ximian.com>
16661 * statement.cs (LocalInfo.Assigned): Removed this property.
16662 (LocalInfo.Flags): Removed `Assigned'.
16663 (LocalInfo.IsAssigned): New public method; takes the EmitContext
16664 and uses flow analysis.
16665 (Block.UsageWarning): Made this method private.
16666 (Block.Resolve): Call UsageWarning() if appropriate.
16668 * expression.cs (LocalVariableReference.DoResolve): Always set
16669 LocalInfo.Used here.
16671 2003-12-13 Martin Baulig <martin@ximian.com>
16673 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
16674 any value here; we're now using flow analysis to figure out
16675 whether a statement/block returns a value.
16677 2003-12-13 Martin Baulig <martin@ximian.com>
16679 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
16681 (FlowBranching.MergeFinally): Don't call
16682 `branching.CheckOutParameters()' here, this is called in
16684 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
16685 when adding the `finally' vector.
16687 2003-12-13 Martin Baulig <martin@ximian.com>
16690 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
16691 actually work and also fix #48962.
16693 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
16695 * decl.cs: Do not check System.Object for nested types,
16696 since we know it does not have any. Big bang for buck:
16699 Run 1: 8.35 seconds
16700 Run 2: 8.32 seconds
16701 corlib: 17.99 seconds
16703 Run 1: 8.17 seconds
16704 Run 2: 8.17 seconds
16705 corlib: 17.39 seconds
16707 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
16709 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
16710 time we are returning 0 members, so we save alot here.
16712 2003-12-11 Martin Baulig <martin@ximian.com>
16714 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
16715 `MergeChild()', also just take the `FlowBranching' as argument;
16716 call Merge() on it and return the result.
16717 (FlowBranching.Merge): We don't need to do anything if we just
16720 2003-12-11 Martin Baulig <martin@ximian.com>
16722 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
16723 them in an `ArrayList' to reduce memory usage. Thanks to Ben
16724 Maurer for this idea.
16726 2003-12-11 Martin Baulig <martin@ximian.com>
16728 * flowanalysis.cs (MergeResult): This class is now gone; we now
16729 use the `UsageVector' for this. The reason for this is that if a
16730 branching just has one sibling, we don't need to "merge" them at
16731 all - that's the next step to do.
16732 (FlowBranching.Merge): We now return a `UsageVector' instead of a
16735 2003-12-11 Martin Baulig <martin@ximian.com>
16737 Reworked flow analyis and made it more precise and bug-free. The
16738 most important change is that we're now using a special `Reachability'
16739 class instead of having "magic" meanings of `FlowReturns'. I'll
16740 do some more cleanups and optimizations and also add some more
16741 documentation this week.
16743 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
16744 largely reworked this class.
16745 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
16746 the new `Reachability' class instead of having "magic" values here.
16747 (FlowBranching): We're now using an instance of `Reachability'
16748 instead of having separate `Returns', `Breaks' etc. fields.
16750 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
16751 based on flow analysis; ignore the return value of block.Emit ().
16753 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
16755 * driver.cs typemanager.cs: Find the mono extensions to corlib even
16756 if they are private.
16758 2003-12-09 Martin Baulig <martin@ximian.com>
16760 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
16761 call them directly on the UsageVector.
16763 2003-12-09 Martin Baulig <martin@ximian.com>
16765 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
16766 Changed return type from `FlowReturns' to `Reachability'.
16768 2003-12-09 Martin Baulig <martin@ximian.com>
16770 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
16771 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
16772 `Reachable' fields with a single `Reachability' one.
16774 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
16776 * class.cs (FindMembers): Remove foreach's.
16781 Run 1: 8.74 seconds
16782 Run 2: 8.71 seconds
16785 Run 1: 8.64 seconds
16786 Run 2: 8.58 seconds
16789 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
16794 This patch does a few things:
16795 1. EmptyStatement is now a singleton, so it is never reallocated.
16796 2. All blah is EmptyStatement constructs have been changed to
16797 blah == EmptyStatement.Value, which is much faster and valid
16798 now that EmptyStatement is a singleton.
16799 3. When resolving a block, rather than allocating a new array for
16800 the non-empty statements, empty statements are replaced with
16801 EmptyStatement.Value
16802 4. Some recursive functions have been made non-recursive.
16803 Mainly the performance impact is from (3), however (1) and (2) are needed for
16804 this to work. (4) does not make a big difference in normal situations, however
16805 it makes the profile look saner.
16810 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
16811 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
16812 Total memory allocated: 56397 KB
16815 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
16816 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
16817 Total memory allocated: 55666 KB
16819 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
16821 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
16822 than the hashtable in a hashtable version
16824 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
16825 we always end up concating a string. This results in a huge perf
16826 loss, because many strings have to be tracked by the GC. In this
16827 patch, we first use a hashtable that works with two keys, so that
16828 the strings do not need to be concat'ed.
16832 Run 1: 8.74 seconds
16833 Run 2: 8.71 seconds
16836 Run 1: 8.65 seconds
16837 Run 2: 8.56 seconds
16839 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
16841 * Makefile: Add a new target `do-time' that does a quick and simple
16842 profile, leaving easy to parse output.
16844 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
16846 * codegen.cs (Init): Create the dynamic assembly with
16847 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
16849 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
16851 * support.cs: Make the PtrHashtable use only one
16852 instance of its comparer.
16854 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
16856 * typemanager.cs: Fix lookup of GetNamespaces.
16858 2003-11-29 Miguel de Icaza <miguel@ximian.com>
16860 * expression.cs: Removed redundant line.
16862 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
16863 ArrayLists, use for loops with bounds.
16865 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
16868 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
16869 arraylists, use for loop with bounds.
16871 The above three changes give us a 0.071 second performance
16872 improvement out of 3.294 seconds down to 3.223. On my machine
16873 the above changes reduced the memory usage by 1,387 KB during
16874 compiler bootstrap.
16876 * cs-parser.jay (QualifiedIdentifier): New class used to represent
16877 QualifiedIdentifiers. Before we created a new string through
16878 concatenation, and mostly later on, the result would be
16879 manipulated by DecomposeQI through string manipulation.
16881 This reduced the compiler memory usage for bootstrapping from
16882 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
16883 compile times in 0.05 seconds.
16885 2003-11-28 Dick Porter <dick@ximian.com>
16887 * support.cs: Do string compares with the Invariant culture.
16895 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
16896 the comparison is done with the Invariant culture.
16898 2003-11-27 Miguel de Icaza <miguel@ximian.com>
16900 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
16901 GetEnumerator method.
16903 (ProbeCollectionType): Iterate starting at the most specific type
16904 upwards looking for a GetEnumerator
16906 * expression.cs: Shift count can be up to 31 for int/uint and 63
16909 2003-11-26 Miguel de Icaza <miguel@ximian.com>
16911 * statement.cs (Block.LookupLabel): Also look for the label on the
16912 children blocks. Use a hash table to keep track of visited
16915 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
16916 we actually did transform the other operand, otherwise fall back
16917 to the common codepath that casts to long.
16919 * cs-tokenizer.cs: Use the same code pattern as the int case.
16920 Maybe I should do the parsing myself, and avoid depending on the
16921 Parse routines to get this done.
16923 2003-11-25 Miguel de Icaza <miguel@ximian.com>
16925 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
16926 which fixes bug 51347. This time test it.
16928 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
16929 attributes for example can not tell the difference between these.
16930 The difference was only a syntax feature of the language.
16932 * attribute.cs: Apply attributes to delegates.
16934 * delegate.cs: Call the apply attributes method.
16936 2003-11-24 Miguel de Icaza <miguel@ximian.com>
16938 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
16939 comparing 0 vs Byte.MinValue, not the value
16941 (ImplicitConversionRequired): When reporting a conversion error,
16942 use error 31 to print out the constant error instead of the
16945 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
16946 which fixes bug 51347.
16948 2003-11-22 Miguel de Icaza <miguel@ximian.com>
16950 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
16951 which fixes the -warnaserror command line option.
16953 2003-11-21 Miguel de Icaza <miguel@ximian.com>
16955 * cfold.cs (DoNumericPromotions): During constant folding of
16956 additions on UIntConstant, special case intconstants with
16957 IntConstants like we do on the expression binary operator.
16959 2003-11-12 Miguel de Icaza <miguel@ximian.com>
16961 * convert.cs (ImplicitReferenceConversion): We were missing a case
16962 (System.Enum are not value types or class types, so we need to
16963 classify them separatedly).
16965 * driver.cs: We do not support error 2007.
16967 2003-11-12 Jackson Harper <jackson@ximian.com>
16969 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
16970 system directory. Also use the full file name so users can
16971 libraries names mscorlib-o-tron.dll in a non system dir.
16973 2003-11-10 Martin Baulig <martin@ximian.com>
16975 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
16976 (TypeManager.InitCoreTypes): Initialize them here, but instead of
16977 calling `ResolveType()' on them, directly assign their `Type'.
16979 2003-11-08 Martin Baulig <martin@ximian.com>
16981 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
16982 return value and the `out parent' parameter.
16983 (TypeContainer.DefineType): Moved the CS0644 check into
16984 GetClassBases(). Don't pass the interface types to the
16985 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
16986 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
16988 * ecore.cs (TypeExpr.IsAttribute): New property.
16989 (TypeExpr.GetInterfaces): New method.
16991 * interface.cs (Interface.GetInterfaceTypeByName): Return a
16992 TypeExpr instead of a Type.
16993 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
16994 (Interface.DefineType): Don't pass the interface types to the
16995 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
16996 them later and then call `TypeBulider.AddInterfaceImplementation()'.
16998 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
16999 instead of a `Type[]'.
17000 (TypeManager.RegisterBuilder): Likewise.
17001 (TypeManager.AddUserInterface): Likewise.
17002 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
17003 `Type[]' and also return a `TypeExpr[]'.
17004 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
17006 2003-11-08 Martin Baulig <martin@ximian.com>
17008 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
17011 2003-11-08 Martin Baulig <martin@ximian.com>
17013 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
17014 TypeManager.ResolveExpressionTypes().
17016 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
17017 instead of an Expression.
17018 (TypeExpr): This is now an abstract base class for `TypeExpression'.
17019 (TypeExpression): New public class; formerly known as `TypeExpr'.
17021 * expression.cs (ComposedCast): Derive from TypeExpr.
17023 * typemanager.cs (TypeManager.system_*_expr): These are now
17024 TypExpr's instead of Expression's.
17025 (TypeManager.ResolveExpressionTypes): New public static function;
17026 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
17029 2003-11-06 Miguel de Icaza <miguel@ximian.com>
17031 * expression.cs (New.DoResolve): Do not dereference value that
17032 might be a null return.
17034 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
17035 sure that the constant value has the right type. Fixes an
17036 unreported bug, similar to 50425.
17038 * const.cs (Const.LookupConstantValue): Call
17039 ImplicitStandardConversionExists before doing a conversion to
17040 avoid havng the TypeManager.ChangeType do conversions.
17042 Reduced the number of casts used
17044 (Const.ChangeType): New routine to enable reuse of the constant
17045 type changing code from statement.
17047 * typemanager.cs (ChangeType): Move common initialization to
17048 static global variables.
17052 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
17053 every value type to go through, even if it was void. Fix that.
17055 * cs-tokenizer.cs: Use is_identifier_start_character on the start
17056 character of the define, and the is_identifier_part_character for
17057 the rest of the string.
17059 2003-11-05 Miguel de Icaza <miguel@ximian.com>
17061 * expression.cs (UnaryMutator.EmitCode): When I updated
17062 LocalVariableReference.DoResolve, I overdid it, and dropped an
17063 optimization done on local variable references.
17065 2003-11-04 Miguel de Icaza <miguel@ximian.com>
17067 * ecore.cs: Convert the return from Ldlen into an int.
17069 2003-10-20 Miguel de Icaza <miguel@ximian.com>
17071 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
17072 the accessibility, this is a special case for toplevel non-public
17073 classes (internal for instance).
17075 2003-10-20 Nick Drochak <ndrochak@gol.com>
17077 * ecore.cs: Fix typo and build. Needed another right paren.
17079 2003-10-19 Miguel de Icaza <miguel@ximian.com>
17081 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
17082 `internal' case regular and protected, but not allowing protected
17083 to be evaluated later. Bug 49840
17085 2003-10-15 Miguel de Icaza <miguel@ximian.com>
17087 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
17088 to kb.Nlast, and not the kb.nFirst to isolate the switch
17091 Extract the underlying type, so enumerations of long/ulong are
17092 treated like long/ulong.
17094 2003-10-14 Miguel de Icaza <miguel@ximian.com>
17096 * expression.cs (New): Overload the meaning of RequestedType to
17097 track the possible creation of the NewDelegate type, since
17098 DoResolve is invoked more than once for new constructors on field
17101 See bugs: #48800 and #37014
17103 * cs-parser.jay (declare_local_constants): Take an arraylist
17104 instead of a single constant.
17106 (local_constant_declaration): It should take a
17107 constant_declarators, not a constant_declarator. Fixes 49487
17109 * convert.cs: Fix error report.
17111 2003-10-13 Jackson Harper <jackson@ximian.com>
17113 * typemanager.cs (TypeToCoreType): Add float and double this fixes
17116 2003-10-09 Martin Baulig <martin@ximian.com>
17118 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
17120 (MethodCore.DoDefineParameters): Removed the TypeContainer
17121 argument; use the DeclSpace which was passed to the .ctor instead.
17122 (MethodCore.CheckParameter): Take a DeclSpace instead of a
17123 TypeContainer; we only need a DeclSpace here.
17125 2003-10-09 Martin Baulig <martin@ximian.com>
17127 * class.cs (MethodData): Added additional `DeclSpace ds' argument
17129 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
17130 EmitContext's .ctor.
17132 2003-10-09 Martin Baulig <martin@ximian.com>
17134 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
17135 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
17136 AsAccessible(), moved them as well.
17138 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
17140 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
17142 * cs-parser.jay : Renamed yyName to yyNames related to jay.
17144 2003-10-07 Miguel de Icaza <miguel@ximian.com>
17146 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
17147 generation for >=, as spotted by Paolo, bug 48679.
17148 Patch from David Waite.
17150 * cs-tokenizer.cs: Add handling for #pragma.
17152 * cs-parser.jay: Allow for both yield and yield return in the
17153 syntax. The anti-cobolization of C# fight will go on!
17155 * class.cs (TypeBuilder.DefineType): Catch error condition here
17156 (Parent.DefineType erroring out and returning null).
17158 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
17159 coping with enumerations variables, we were mistakenly processing
17160 them as a regular value type instead of built-in types. Fixes the
17163 * typemanager.cs (IsBuiltinOrEnum): New method.
17165 2003-09-30 Miguel de Icaza <miguel@ximian.com>
17167 * cs-parser.jay: Upgrade: yield now needs the return clause.
17169 2003-09-19 Martin Baulig <martin@ximian.com>
17171 * decl.cs (MemberCache.SetupCacheForInterface): Take a
17172 `MemberCache parent' argument. Normally, an interface doesn't
17173 have a parent type except System.Object, but we use this in gmcs
17174 for generic type parameters.
17176 2003-09-18 Martin Baulig <martin@ximian.com>
17178 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
17179 on `type.IsInterface'; don't check whether the type has a parent
17180 to determine whether it's an interface.
17182 2003-09-15 Martin Baulig <martin@ximian.com>
17184 * class.cs (TypeContainer.DefineType): Added an error flag to
17185 avoid reporting duplicate CS0146's ("class definition is
17188 * driver.cs (Driver.MainDriver): Abort if
17189 RootContext.ResolveTree() reported any errors.
17191 2003-09-07 Martin Baulig <martin@ximian.com>
17193 * report.cs (Error, Warning): Added overloaded versions which take
17194 a `params object[] args' and call String.Format().
17196 2003-09-07 Martin Baulig <martin@ximian.com>
17198 * decl.cs (DeclSpace..ctor): Don't call
17199 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
17200 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
17201 (DeclSpace.RecordDecl): New method.
17203 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
17205 2003-09-02 Ravi Pratap <ravi@ximian.com>
17207 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
17208 value attributes to be applied to ParameterBuilders.
17210 * class.cs (MethodCore.LabelParameters): Make static and more
17211 generic so that it can be used from other places - like interface
17212 methods, for instance.
17214 * interface.cs (Interface.Emit): Call LabelParameters before
17215 emitting attributes on the InterfaceMethod.
17217 2003-08-26 Martin Baulig <martin@ximian.com>
17219 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
17220 resolving aliases; fixes #47927.
17222 2003-08-26 Martin Baulig <martin@ximian.com>
17224 * statement.cs (Using.DoResolve): This is internally emitting a
17225 try/finally clause, so we need to set ec.NeedExplicitReturn if we
17226 do not always return. Fixes #47681.
17228 2003-08-26 Martin Baulig <martin@ximian.com>
17230 * decl.cs (MemberCore): Moved WarningNotHiding(),
17231 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
17233 (AdditionResult): Make this nested in DeclSpace.
17234 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
17235 argument; call NamespaceEntry.Define() unless we're nested in a
17238 * namespace.cs (Namespace.DefineName): New public function. This
17239 is called from DeclSpace's .ctor to add
17240 (Namespace.Lookup): Include DeclSpaces in the lookup.
17242 * class.cs (Operator): Derive from MemberBase, not MemberCore.
17244 * const.cs (Const): Derive from MemberBase, not MemberCore.
17246 2003-08-25 Martin Baulig <martin@ximian.com>
17248 * convert.cs (Convert.ExplicitReferenceConversion): When
17249 converting from an interface type to a class, unbox if the target
17250 type is a struct type. Fixes #47822.
17252 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17254 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
17257 2003-08-22 Martin Baulig <martin@ximian.com>
17259 * class.cs (TypeManager.DefineType): When defining a nested type,
17260 call DefineType() on our parent; fixes #47801.
17262 2003-08-22 Martin Baulig <martin@ximian.com>
17264 * class.cs (MethodData.Define): While checking if a method is an
17265 interface implementation, improve the test a bit more to fix #47654.
17267 2003-08-22 Martin Baulig <martin@ximian.com>
17269 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
17270 correctly; fixes #47722.
17272 2003-08-22 Martin Baulig <martin@ximian.com>
17274 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
17275 LocalVariableReference, ensure it's not read-only. Fixes #47536.
17277 * statement.cs (Fixed.DoResolve): Make all variables read-only.
17279 2003-08-22 Martin Baulig <martin@ximian.com>
17281 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
17282 can only be assigned in static constructors. Fixes #47161.
17284 2003-08-22 Martin Baulig <martin@ximian.com>
17286 Rewrote and improved the flow analysis code.
17288 * flowbranching.cs (FlowBranching): Make this class abstract.
17289 (FlowBranching.CreateBranching): New static function to create a
17290 new flow branching.
17291 (FlowBranchingBlock, FlowBranchingException): New classes.
17292 (FlowBranching.UsageVector.Type): New public readonly field.
17293 (FlowBranching.UsageVector.Breaks): Removed the setter.
17294 (FlowBranching.UsageVector.Returns): Removed the setter.
17295 (FlowBranching.UsageVector): Added Break(), Return(),
17296 NeverReachable() and Throw() methods to modify the reachability.
17297 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
17298 done by FlowBranching.Merge().
17299 (FlowBranching.UsageVector.MergeChild): New method; merges the
17300 merge result into the current vector.
17301 (FlowBranching.Merge): New abstract method to merge a branching.
17303 2003-08-12 Martin Baulig <martin@ximian.com>
17305 * expression.cs (Indirection.CacheTemporaries): Create the
17306 LocalTemporary with the pointer type, not its element type.
17308 2003-08-10 Miguel de Icaza <miguel@ximian.com>
17310 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
17311 token was a keyword or not.
17313 Add `error' options where an IDENTIFIER was expected; Provide
17314 CheckToken and CheckIdentifierToken convenience error reporting
17317 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
17319 * decl.cs: Rename `NamespaceEntry Namespace' public field into
17320 NameSpaceEntry NameSpaceEntry.
17322 (LookupInterfaceOrClass): Avoid creating a full qualified name
17323 from namespace and name: avoid doing lookups when we know the
17324 namespace is non-existant. Use new Tree.LookupByNamespace which
17325 looks up DeclSpaces based on their namespace, name pair.
17327 * driver.cs: Provide a new `parser verbose' to display the
17328 exception thrown during parsing. This is turned off by default
17329 now, so the output of a failure from mcs is more graceful.
17331 * namespace.cs: Track all the namespaces defined in a hashtable
17334 (IsNamespace): New method
17336 2003-08-09 Miguel de Icaza <miguel@ximian.com>
17338 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
17339 we know that we need to concatenate (full typename can never be
17344 * statement.cs: Use a bitfield; Do not initialize to null things
17345 which are done by the constructor by default.
17347 * cs-parser.jay: bug fix, parameter was 4, not 3.
17349 * expression.cs: Just use the property;
17351 * statement.cs: No need for GetVariableInfo method.
17353 2003-08-08 Martin Baulig <martin@ximian.com>
17355 * flowanalysis.cs (FlowReturns): This is now nested in the
17356 `FlowBranching' class.
17357 (MyBitVector): Moved this here from statement.cs.
17358 (FlowBranching.SiblingType): New enum type.
17359 (FlowBranching.CreateSibling): Added `SiblingType' argument.
17361 2003-08-07 Martin Baulig <martin@ximian.com>
17363 * flowanalysis.cs (FlowBranchingType): This is now nested in the
17364 `FlowBranching' class and called `BranchingType'.
17366 2003-08-07 Martin Baulig <martin@ximian.com>
17368 * flowanalysis.cs: Moved all the control flow analysis code into
17371 2003-08-07 Martin Baulig <martin@ximian.com>
17373 * assign.cs (Assign.DoResolve): `target' must either be an
17374 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
17377 2003-08-07 Miguel de Icaza <miguel@ximian.com>
17379 * expression.cs (BinaryMethod): This kind of expression is created by the
17380 Binary class if it determines that the operator has to be handled
17383 (BinaryDelegate): This kind of expression is created if we are
17384 dealing with a + or - operator on delegates.
17386 (Binary): remove method, argumetns, and DelegateOperator: when
17387 dealing with methods,
17389 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
17391 * statement.cs (Block): use bitfields for the three extra booleans
17392 we had in use. Remove unused topblock parameter.
17394 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
17396 * assign.cs: Drop extra unneeded tests.
17398 2003-08-06 Miguel de Icaza <miguel@ximian.com>
17400 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
17402 * statement.cs (Foreach): Use VariableStorage instead of
17405 * codegen.cs (VariableStorage): New class used by clients that
17406 require a variable stored: locals or fields for variables that
17407 need to live across yield.
17409 Maybe provide a convenience api for EmitThis+EmitLoad?
17411 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
17414 2003-08-05 Miguel de Icaza <miguel@ximian.com>
17416 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
17417 RemapParameterLValue): New methods that are used to turn a
17418 precomputed FieldInfo into an expression like this:
17422 The idea is to use this instead of making LocalVariableReference
17423 have more than one meaning.
17425 * cs-parser.jay: Add error production to BASE.
17427 * ecore.cs: Deal with TypeManager.GetField returning null, which
17428 is now a valid return value.
17430 (FieldExprNoAddress): New expression for Fields whose address can
17433 * expression.cs (LocalVariableReference): During the resolve
17434 phases, create new expressions if we are in a remapping context.
17435 Remove code that dealt with remapping here.
17437 (ParameterReference): same.
17439 (ProxyInstance): New expression, like the `This' expression, but
17440 it is born fully resolved. We know what we are doing, so remove
17441 the errors that are targeted to user-provided uses of `this'.
17443 * statement.cs (Foreach): our variable is now stored as an
17444 Expression; During resolution, follow the protocol, dont just
17445 assume it will return this.
17447 2003-08-06 Martin Baulig <martin@ximian.com>
17449 * support.cs (SeekableStreamReader.cs): New public class.
17451 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
17452 SeekableStreamReader instead of the normal StreamReader.
17454 2003-08-04 Martin Baulig <martin@ximian.com>
17456 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
17457 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
17458 deambiguate casts and delegate invocations.
17459 (parenthesized_expression): Use the new tokens to ensure this is
17460 not a cast of method invocation.
17462 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
17463 when reading a `)' and Deambiguate_CloseParens () was previously
17466 * expression.cs (ParenthesizedExpression): New class. This is
17467 just used for the CS0075 test.
17468 (Binary.DoResolve): Check for CS0075.
17470 2003-07-29 Ravi Pratap <ravi@ximian.com>
17472 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
17473 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
17474 reference comparison.
17476 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
17477 examine the ReturnType for equality - this is necessary in the
17478 cases of implicit and explicit operators whose signature also
17479 includes the return type.
17481 2003-07-26 Miguel de Icaza <miguel@ximian.com>
17483 * namespace.cs: Cache the result of the namespace computation,
17484 instead of computing it every time.
17486 2003-07-24 Miguel de Icaza <miguel@ximian.com>
17488 * decl.cs: Use a global arraylist that we reuse over invocations
17489 to avoid excesive memory consumption. Reduces memory usage on an
17490 mcs compile by one meg (45 average).
17492 * typemanager.cs (LookupTypeReflection): In .NET pointers are
17493 private, work around that.
17495 2003-07-23 Miguel de Icaza <miguel@ximian.com>
17497 * literal.cs (IntLiteral): Define Zero and One static literals.
17499 * cs-parser.jay (integer_literal): use static literals to reduce
17500 memory usage for the most used literals (0, 1 and -1). 211kb
17501 reduced in memory usage.
17503 Replace all calls to `new ArrayList' with `new
17504 ArrayList(4)' which is a good average number for most allocations,
17505 and also requires only 16 bytes of memory for its buffer by
17508 This reduced MCS memory usage in seven megabytes for the RSS after
17511 2003-07-28 Ravi Pratap <ravi@ximian.com>
17513 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
17514 handle params methods the correct way by forming only one
17515 applicable set with params and normal methods in them. Earlier we
17516 were looking at params methods only if we found no normal methods
17517 which was not the correct thing to do.
17519 (Invocation.BetterFunction): Take separate arguments indicating
17520 when candidate and the best method are params methods in their
17523 This fixes bugs #43367 and #46199.
17525 * attribute.cs: Documentation updates.
17527 (CheckAttribute): Rename to CheckAttributeTarget.
17528 (GetValidPlaces): Rename to GetValidTargets.
17530 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
17531 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
17535 2003-07-28 Martin Baulig <martin@ximian.com>
17537 * class.cs (TypeContainer.DefineMembers): Use the base type's full
17538 name when looking up the base class of a nested class. Fixes #46977.
17540 2003-07-26 Martin Baulig <martin@ximian.com>
17542 * expression.cs (Indexers.Indexer): New nested struct; contains
17543 getter, setter and the indexer's type.
17544 (Indexers.Properties): This is now an ArrayList of
17545 Indexers.Indexer's.
17546 (IndexerAccess.DoResolveLValue): Correctly set the type if the
17547 indexer doesn't have any getters.
17549 * assign.cs (Assign.DoResolve): Also do the implicit conversions
17550 for embedded property and indexer assignments.
17552 2003-07-26 Martin Baulig <martin@ximian.com>
17554 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
17555 preprocessor directive is not the first non-whitespace character
17558 2003-07-26 Martin Baulig <martin@ximian.com>
17560 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
17561 namespace parsing, follow the spec more closely.
17563 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
17564 NamespaceEntry.Lookup().
17566 2003-07-25 Martin Baulig <martin@ximian.com>
17568 * MethodCore.cs (OverridesSomething): New public field; it's set
17569 from TypeContainer.DefineMembers if this method overrides
17570 something (which doesn't need to be a method). Fix #39462.
17572 2003-07-25 Ravi Pratap <ravi@ximian.com>
17574 * typemanager.cs (GetMembers): Ensure that the list of members is
17575 reversed. This keeps things in sync.
17577 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
17578 find an AttributeUsage attribute.
17580 * expression.cs (Invocation.OverloadResolve): Perform the check
17581 which disallows Invoke to be directly called on a Delegate.
17583 (Error_InvokeOnDelegate): Report error cs1533.
17585 2003-07-25 Martin Baulig <martin@ximian.com>
17587 * expression.cs (Indexers.GetIndexersForType): Only look in the
17588 interface hierarchy if the requested type is already an
17589 interface. Fixes #46788 while keeping #46502 fixed.
17591 2003-07-25 Martin Baulig <martin@ximian.com>
17593 * class.cs (TypeContainer.DefineMembers): Check whether all
17594 readonly fields have been assigned and report warning CS0649 if
17597 * statement.cs (LocalInfo.IsFixed): Always return true if this is
17600 2003-07-24 Ravi Pratap <ravi@ximian.com>
17602 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
17603 returned from GetMethods to make things consistent with the
17604 assumptions MCS makes about ordering of methods.
17606 This should comprehensively fix bug #45127 and it does :-)
17608 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
17609 ordering is actually reverse.
17611 * Clean up some debug messages I left lying around.
17613 * interface.cs (Populate*): Get rid of code which emits attributes
17614 since the stage in which we emit attributes is the 'Emit' stage,
17615 not the define stage.
17617 (Emit): Move attribute emission for interface members here.
17619 2003-07-22 Ravi Pratap <ravi@ximian.com>
17621 * expression.cs (Invocation.OverloadResolve): Follow the spec more
17622 closely: we eliminate methods in base types when we have an
17623 applicable method in a top-level type.
17625 Please see section 14.5.5.1 for an exact description of what goes
17628 This fixes bug #45127 and a host of other related to corlib compilation.
17630 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
17631 array is the method corresponding to the top-level type (this is
17632 because of the changes made to icall.c) so we change this
17635 (MethodGroupExpr.Name): This too.
17637 * typemanager.cs (GetElementType): New method which does the right
17638 thing when compiling corlib.
17640 * everywhere: Make use of the above in the relevant places.
17642 2003-07-22 Martin Baulig <martin@ximian.com>
17644 * cs-parser.jay (invocation_expression): Moved
17645 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
17646 `cast_expression', but create a InvocationOrCast which later
17647 resolves to either an Invocation or a Cast.
17649 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
17650 method; call this before EmitStatement() to make sure that this
17651 expression can be used as a statement.
17653 * expression.cs (InvocationOrCast): New class; resolves to either
17654 an Invocation or a Cast.
17656 * statement.cs (StatementExpression): Call ResolveStatement() on
17657 the ExpressionStatement before emitting it.
17659 2003-07-21 Martin Baulig <martin@ximian.com>
17661 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
17662 `ref' and `out' attributes match; fixes #46220.
17663 (MemberAccess.ResolveMemberAccess): You can't reference a type
17664 through an expression; fixes #33180.
17665 (Indexers.GetIndexersForType): Don't return the indexers from
17666 interfaces the class implements; fixes #46502.
17668 2003-07-21 Martin Baulig <martin@ximian.com>
17670 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
17671 CS0661 checks; fixes bug #30442.
17673 2003-07-21 Martin Baulig <martin@ximian.com>
17675 * decl.cs (AdditionResult): Added `Error'.
17677 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
17679 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
17680 makes cs0031.cs actually work.
17682 2003-07-20 Martin Baulig <martin@ximian.com>
17684 * namespace.cs: Fixed that bug which caused a crash when compiling
17685 the debugger's GUI.
17687 2003-07-20 Miguel de Icaza <miguel@ximian.com>
17689 * typemanager.cs (LookupTypeReflection): Never expose types which
17690 are NotPublic, NestedPrivate, NestedAssembly, or
17691 NestedFamANDAssem. We used to return these, and later do a check
17692 that would report a meaningful error, but the problem is that we
17693 would not get the real match, if there was a name override.
17695 2003-07-18 Miguel de Icaza <miguel@ximian.com>
17697 * namespace.cs (Namespace, Name): Do not compute the namespace
17698 name dynamically, compute it in the constructor. This reduced
17699 memory usage by 1697 KB.
17701 * driver.cs: Use --pause to pause at the end.
17703 2003-07-17 Peter Williams <peter@newton.cx>
17705 * Makefile: Change the name of the test target so that it doesn't
17706 conflict with the recursive test target.
17708 2003-07-17 Miguel de Icaza <miguel@ximian.com>
17710 * expression.cs (LocalVariableReference.Emit, EmitAssign,
17711 AddressOf): Do not use EmitThis, that was wrong, use the actual
17714 2003-07-15 Miguel de Icaza <miguel@ximian.com>
17716 * class.cs (MethodData.Define): While checking if a method is an
17717 interface implementation, improve the test: If we are not public
17718 (use new test here: use the computed MethodAttributes directly,
17719 instead of the parsed modifier flags) check if the `implementing'
17720 method comes from an interface or not.
17722 * pending.cs (VerifyPendingMethods): Slightly better error
17725 * makefile: add test target that does the mcs bootstrap.
17727 2003-07-16 Ravi Pratap <ravi@ximian.com>
17729 * interface.cs (Define): Do nothing here since there are no
17730 members to populate etc. Move the attribute emission out of here
17731 since this was just totally the wrong place to put it. Attribute
17732 application happens during the 'Emit' phase, not in the 'Define'
17735 (Emit): Add this method and move the attribute emission here
17737 * rootcontext.cs (EmitCode): Call the Emit method on interface
17740 2003-07-14 Ravi Pratap M <ravi@ximian.com>
17742 * expression.cs (OverloadResolve): Report error only if Location
17743 is not 'Null' which means that there was a probe going on.
17745 2003-07-14 Martin Baulig <martin@ximian.com>
17747 * expression.cs (ConditionalLogicalOperator): New public class to
17748 implement user defined conditional logical operators.
17749 This is section 14.11.2 in the spec and bug #40505.
17751 2003-07-14 Martin Baulig <martin@ximian.com>
17753 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
17755 2003-07-14 Martin Baulig <martin@ximian.com>
17757 * codegen.cs (EmitContext.InFixedInitializer): New public field.
17759 * ecore.cs (IVariable.VerifyFixed): New interface method.
17761 * expression.cs (Unary.ResolveOperator): When resolving the `&'
17762 operator, check whether the variable is actually fixed. Fixes bug
17763 #36055. Set a variable definitely assigned when taking its
17764 address as required by the spec.
17766 * statement.cs (LocalInfo.IsFixed): New field.
17767 (LocalInfo.MakePinned): Set `IsFixed' to true.
17769 2003-07-14 Ravi Pratap M <ravi@ximian.com>
17771 * attribute.cs (Attribute.Resolve): While doing a Member lookup
17772 for .ctors, ensure that we only ask for members declared in the
17773 attribute type (BindingFlags.DeclaredOnly).
17777 * expression.cs (Error_WrongNumArguments): Report error 1501
17778 correctly the way CSC does.
17780 2003-07-13 Martin Baulig <martin@ximian.com>
17782 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
17783 lookup on the fully qualified name, to make things like "X.X" work
17784 where "X.X" is a fully qualified type name, but we also have a
17785 namespace "X" in the using list. Fixes #41975.
17787 2003-07-13 Martin Baulig <martin@ximian.com>
17789 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
17790 function. If we're a CompoundAssign, we need to create an embedded
17791 CompoundAssign, not an embedded Assign.
17792 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
17795 2003-07-13 Martin Baulig <martin@ximian.com>
17797 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
17798 work to fix bug #46088.
17800 2003-07-13 Ravi Pratap <ravi@ximian.com>
17802 * class.cs (Operator.Emit): Do not emit attributes here - it is
17803 taken care of by the Method class that we delegate too. This takes
17804 care of bug #45876.
17806 2003-07-10 Martin Baulig <martin@ximian.com>
17808 * expression.cs (TypeOfVoid): New class.
17809 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
17811 2003-07-10 Martin Baulig <martin@ximian.com>
17813 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
17816 2003-07-10 Martin Baulig <martin@ximian.com>
17818 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
17819 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
17821 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
17823 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
17825 2003-07-10 Martin Baulig <martin@ximian.com>
17827 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
17828 of decimal. Fixes #42850.
17830 NOTE: I also fixed the created byte blob, but this doesn't work on
17831 the MS runtime and csc never produces any byte blobs for decimal
17834 2003-07-10 Martin Baulig <martin@ximian.com>
17836 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
17837 structs; fixes #32068.
17838 (Block.AddChildVariableNames): Fixed #44302.
17840 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17842 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
17844 2003-07-07 Miguel de Icaza <miguel@ximian.com>
17846 * attribute.cs: And this test is onger needed.
17848 2003-07-08 Martin Baulig <martin@ximian.com>
17850 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
17851 inaccessible types. Fixes #36313.
17853 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
17855 * namespace.cs (NamespaceEntry): Create implicit entries for all
17856 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
17857 implicit entries for N1.N2 and N1.
17859 2003-07-08 Martin Baulig <martin@ximian.com>
17861 Rewrote the handling of namespaces to fix a lot of the issues
17862 wrt. `using' aliases etc.
17864 * namespace.cs (Namespace): Splitted this class into a
17865 per-assembly `Namespace' and a per-file `NamespaceEntry'.
17867 * typemanager.cs (TypeManager.IsNamespace): Removed.
17868 (TypeManager.ComputeNamespaces): Only compute namespaces from
17869 loaded assemblies here, not the namespaces from the assembly we're
17870 currently compiling.
17872 2003-07-08 Martin Baulig <martin@ximian.com>
17874 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
17876 2003-07-07 Miguel de Icaza <miguel@ximian.com>
17878 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
17881 I thought about the memory savings here, but LookupTypeReflection
17882 is used under already very constrained scenarios. Compiling
17883 corlib or mcs only exposes one hit, so it would not really reduce
17884 any memory consumption.
17886 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17888 * typemanager.cs: fixes bug #45889 by only adding public types from
17889 other assemblies to the list of known types.
17891 2003-07-07 Miguel de Icaza <miguel@ximian.com>
17893 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
17894 on the type we resolved.
17896 2003-07-05 Martin Baulig <martin@ximian.com>
17898 * pending.cs (PendingImplementation.ParentImplements): Don't
17899 create the proxy if the parent is abstract.
17901 * class.cs (TypeContainer.DefineIndexers): Process explicit
17902 interface implementations first. Fixes #37714.
17904 2003-07-04 Miguel de Icaza <miguel@ximian.com>
17906 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
17907 defined recursively; but since we modify the input parameters
17908 (left is set to `this' temporarily), we reset this value if the
17909 left_is_explicit is false, which gives the original semantics to
17912 * literal.cs (NullPointer): new class used to represent a null
17913 literal in a pointer context.
17915 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
17916 type is a pointer, use a NullPointer object instead of a
17917 NullLiteral. Closes 43687
17919 (ExplicitConversion): Convert pointer values using
17920 the conv opcode to the proper type.
17922 * ecore.cs (New): change ValueTypeVariable property into a method,
17923 that returns whether the valuetype is suitable for being used.
17925 * expression.cs (Binary.DoNumericPromotions): Only return if we
17926 the int constant was a valid uint, and we can return both left and
17927 right as uints. If not, we continue processing, to trigger the
17928 type conversion. This fixes 39018.
17930 * statement.cs (Block.EmitMeta): During constant resolution, set
17931 the CurrentBlock property on the emitcontext, so that we resolve
17932 constants propertly.
17934 2003-07-02 Martin Baulig <martin@ximian.com>
17936 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
17937 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
17939 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
17940 than emitting it here.
17942 * statement.cs: Fixed some more flow analysis bugs.
17944 2003-07-02 Martin Baulig <martin@ximian.com>
17946 * class.cs (MethodData.Define): When implementing interface
17947 methods, set Final unless we're Virtual.
17949 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
17950 check work for interface methods.
17952 2003-07-01 Martin Baulig <martin@ximian.com>
17954 * ecore.cs (EmitContext.This): Replaced this property with a
17955 GetThis() method which takes a Location argument. This ensures
17956 that we get the correct error location for a CS0188.
17958 2003-07-01 Miguel de Icaza <miguel@ximian.com>
17960 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
17961 ImplicitStandardConversion.
17963 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
17965 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
17967 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
17970 2003-06-30 Miguel de Icaza <miguel@ximian.com>
17972 * class.cs (Constructor.Define): Turn off initlocals for unsafe
17975 (MethodData.Define): Turn off initlocals for unsafe methods.
17977 2003-06-29 Miguel de Icaza <miguel@ximian.com>
17979 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
17980 complete; Fixes #37521.
17982 * delegate.cs: Use Modifiers.TypeAttr to compute the
17983 TypeAttributes, instead of rolling our own. This makes the flags
17984 correct for the delegates.
17986 2003-06-28 Miguel de Icaza <miguel@ximian.com>
17988 * class.cs (Constructor.Define): Set the private flag for static
17989 constructors as well.
17991 * cs-parser.jay (statement_expression): Set the return value to
17992 null, to avoid a crash when we catch an error.
17994 2003-06-24 Miguel de Icaza <miguel@ximian.com>
17996 * cs-parser.jay: Applied patch from Jackson that adds support for
17997 extern and unsafe modifiers to destructor declarations.
17999 * expression.cs: Report error 21 if the user is trying to index a
18002 * driver.cs: Add an error message, suggested by the bug report.
18004 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
18005 if we do not have a ": this ()" constructor initializer. Fixes 45149
18007 2003-06-14 Miguel de Icaza <miguel@ximian.com>
18009 * namespace.cs: Add some information to reduce FAQs.
18011 2003-06-13 Miguel de Icaza <miguel@ximian.com>
18013 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
18014 underlying enumeration types. Fixes #43915.
18016 * expression.cs: Treat ushort/short as legal values to be used in
18017 bitwise operations.
18019 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
18021 * delegate.cs: transfer custom attributes for paramenters from
18022 the delegate declaration to Invoke and BeginInvoke.
18024 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
18026 * attribute.cs: handle custom marshalers and emit marshal info
18029 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
18031 * makefile.gnu: Added anonymous.cs to the compiler sources.
18033 2003-05-28 Miguel de Icaza <miguel@ximian.com>
18035 * iterators.cs: Change the name of the proxy class to include two
18038 * cs-parser.jay: Update grammar to include anonymous methods.
18040 * anonymous.cs: new file.
18042 2003-05-27 Miguel de Icaza <miguel@ximian.com>
18044 * class.cs (Field.Define): Add missing test for pointers and
18047 2003-05-27 Ravi Pratap <ravi@ximian.com>
18049 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
18050 we use the stobj opcode.
18052 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
18053 since it wasn't the correct fix.
18055 It still is puzzling that we are required to use stobj for IntPtr
18056 which seems to be a ValueType.
18058 2003-05-26 Miguel de Icaza <miguel@ximian.com>
18060 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
18061 during regular simple name resolution. Now, the trick is that
18062 instead of returning for processing the simplename, we do a
18063 TypeManager.LookupType (ie, a rooted lookup as opposed to a
18064 contextual lookup type). If a match is found, return that, if
18065 not, return for further composition.
18067 This fixes long-standing 30485.
18069 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
18070 using the address to initialize an object, do an Stobj instead of
18071 using the regular Stelem.
18073 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
18074 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
18075 Because if we are a BaseIndexerAccess that value will be true.
18078 * statement.cs (GotoCase.Resolve): Return after reporting an
18079 error, do not attempt to continue.
18081 * expression.cs (PointerArithmetic.Emit): If our operand is a
18082 long, convert our constants to match the operand before
18083 multiplying. Convert to I type before adding. Fixes 43670.
18085 2003-05-14 Ravi Pratap <ravi@ximian.com>
18087 * enum.cs (ImplicitConversionExists) : Rename to
18088 ImplicitEnumConversionExists to remove ambiguity.
18090 * ecore.cs (NullCast): New type of cast expression class which
18091 basically is very similar to EmptyCast with the difference being
18092 it still is a constant since it is used only to cast a null to
18094 (eg. (string) null)
18096 * convert.cs (ImplicitReferenceConversion): When casting a null
18097 literal, we return a NullCast.
18099 * literal.cs (NullLiteralTyped): Remove - I don't see why this
18100 should be around anymore.
18102 The renaming (reported was slightly wrong). Corrections:
18104 ConvertImplicitStandard -> ImplicitConversionStandard
18105 ConvertExplicitStandard -> ExplicitConversionStandard
18107 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
18108 before passing them in !
18110 * convert.cs (ImplicitConversionStandard): When comparing for
18111 equal expr and target types, ensure that expr is not a
18114 In general, we must not be checking (expr_type ==
18115 target_type) in the top level conversion methods
18116 (ImplicitConversion, ExplicitConversion etc). This checking is
18117 done in the methods that they delegate to.
18119 2003-05-20 Miguel de Icaza <miguel@ximian.com>
18121 * convert.cs: Move Error_CannotConvertType,
18122 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
18123 ImplicitNumericConversion, ImplicitConversionExists,
18124 ImplicitUserConversionExists, StandardConversionExists,
18125 FindMostEncompassedType, FindMostSpecificSource,
18126 FindMostSpecificTarget, ImplicitUserConversion,
18127 ExplicitUserConversion, GetConversionOperators,
18128 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
18129 TryImplicitIntConversion, Error_CannotConvertImplicit,
18130 ConvertImplicitRequired, ConvertNumericExplicit,
18131 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
18132 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
18135 Perform the following renames:
18137 StandardConversionExists -> ImplicitStandardConversionExists
18138 ConvertImplicit -> ImplicitConversion
18139 ConvertImplicitStandard -> ImplicitStandardConversion
18140 TryImplicitIntConversion -> ImplicitIntConversion
18141 ConvertImplicitRequired -> ImplicitConversionRequired
18142 ConvertNumericExplicit -> ExplicitNumericConversion
18143 ConvertReferenceExplicit -> ExplicitReferenceConversion
18144 ConvertExplicit -> ExplicitConversion
18145 ConvertExplicitStandard -> ExplicitStandardConversion
18147 2003-05-19 Martin Baulig <martin@ximian.com>
18149 * statement.cs (TypeInfo.StructInfo): Made this type protected.
18150 (TypeInfo): Added support for structs having structs as fields.
18152 * ecore.cs (FieldExpr): Implement IVariable.
18153 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
18154 VariableInfo for the field.
18156 2003-05-18 Martin Baulig <martin@ximian.com>
18158 * expression.cs (This.DoResolve): Report a CS0027 if we're
18159 emitting a field initializer.
18161 2003-05-18 Martin Baulig <martin@ximian.com>
18163 * expression.cs (This.ResolveBase): New public function.
18164 (This.DoResolve): Check for CS0188.
18166 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
18169 * ecore.cs (MethodGroupExpr.DoResolve): Set the
18170 `instance_expression' to null if we don't have any non-static
18173 2003-05-18 Martin Baulig <martin@ximian.com>
18175 Reworked the way how local variables and parameters are handled by
18176 the flow analysis code.
18178 * statement.cs (TypeInfo, VariableMap): New public classes.
18179 (VariableInfo): New public class. This is now responsible for
18180 checking whether a variable has been assigned. It is used for
18181 parameters and local variables.
18182 (Block.EmitMeta): Take the InternalParameters as argument; compute
18183 the layout of the flow vectors here.
18184 (Block.LocalMap, Block.ParameterMap): New public properties.
18185 (FlowBranching): The .ctor doesn't get the InternalParameters
18186 anymore since Block.EmitMeta() now computes the layout of the flow
18188 (MyStructInfo): This class is now known as `StructInfo' and nested
18189 in `TypeInfo'; we don't access this directly anymore.
18191 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
18192 property and removed IsAssigned(), IsFieldAssigned(),
18193 SetAssigned() and SetFieldAssigned(); we now call them on the
18194 VariableInfo so we don't need to duplicate this code everywhere.
18196 * expression.cs (ParameterReference): Added `Block block' argument
18198 (LocalVariableReference, ParameterReference, This): The new
18199 VariableInfo class is now responsible for all the definite
18202 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
18203 IsParameterAssigned, SetParameterAssigned): Removed.
18205 2003-05-18 Martin Baulig <martin@ximian.com>
18207 * typemanager.cs (InitCoreTypes): Try calling
18208 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
18209 the 3-args-version. Corlib now also needs our `void_type'.
18210 (GetMethod): Added overloaded version which takes an optional
18211 `bool report_errors' to allow lookups of optional methods.
18213 2003-05-12 Martin Baulig <martin@ximian.com>
18215 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
18216 only used for locals and not for parameters.
18218 2003-05-12 Miguel de Icaza <miguel@ximian.com>
18220 * support.cs (InternalParameters.ParameterType): Return the
18221 ExternalType of the parameter.
18223 * parameter.cs (Parameter.ExternalType): drop the two arguments,
18226 2003-05-11 Miguel de Icaza <miguel@ximian.com>
18228 * class.cs (MethodData.Define): Do not set the `newslot' on
18229 interface members, if they are also flagged as "override".
18231 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
18232 better code for ++i and i++. This only works for static fields
18233 and local variables.
18235 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
18236 want to pull the DeclSpace out of the builder_to_declspace instead
18237 of the TypeBuilder (like in TypeContainer.FindMembers).
18239 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
18240 instead of LookupTypeContainer. Fixes the crash on .NET for
18241 looking up interface members.
18243 * const.cs: Create our own emit context during the Definition
18244 stage, so that constants are evaluated in the proper context, when
18245 a recursive definition happens.
18247 2003-05-11 Martin Baulig <martin@ximian.com>
18249 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
18250 new block for a switch section.
18251 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
18252 the adding/lookup in the switch block. Fixes #39828.
18254 2003-05-09 Miguel de Icaza <miguel@ximian.com>
18256 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
18257 functionality: I needed to convert the data after I had performed
18258 the add/sub operation into the operands type size.
18260 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
18261 pass the type for the box operation, otherwise the resulting
18262 object would have been of type object.
18264 (BoxedCast): Add constructor to specify the type to box as.
18266 2003-05-07 Miguel de Icaza <miguel@ximian.com>
18268 * iterators.cs: I was reusing the `count' variable inadvertently,
18269 take steps to not allow this to happen.
18271 2003-05-06 Miguel de Icaza <miguel@ximian.com>
18273 * attribute.cs (Attribute.Resolve): Params attributes are encoded
18274 by creating an array at the point where the params starts and
18275 putting all those arguments there, then adjusting the size of the
18278 2003-05-05 Miguel de Icaza <miguel@ximian.com>
18280 * expression.cs (New.AddressOf): Implement interface
18281 IMemoryLocation. This is used when the `new' operator is used in
18282 the context of an invocation to a method on a value type.
18284 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
18287 * namespace.cs: Also check the using aliases here.
18289 * driver.cs: Move the test for using validity after the types have
18290 been entered, so we do a single pass that also includes the using
18293 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
18294 in the regular case. CreateSiblingForFinally is doing extra
18297 * attribute.cs (GetAttributeArgumentExpression): Store the result
18298 on an out value, and use the return value to indicate failure
18299 instead of using null (which is a valid return for Constant.GetValue).
18301 * statement.cs: Perform the analysis flow for the increment
18302 portion after the statement, because this will be the real flow of
18303 execution. Fixes #42385
18305 * codegen.cs (EmitContext.EmitArgument,
18306 EmitContext.EmitStoreArgument): New helper functions when the
18307 RemapToProxy flag is set.
18309 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
18312 Add support for remapping parameters.
18314 * iterators.cs: Propagate parameter values; Store parameter
18315 values in the proxy classes.
18317 2003-05-04 Miguel de Icaza <miguel@ximian.com>
18319 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
18320 need a proxy reference; I do not know what I was thinking
18322 * cs-parser.jay (constructor_initializer): catch another error,
18323 and display nice message.
18325 (field_declaration): catch void field declaration
18326 to flag a better error.
18328 * class.cs (MemberBase.CheckBase): Report an error instead of a
18329 warning if a new protected member is declared in a struct.
18330 (Field.Define): catch the error of readonly/volatile.
18332 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
18334 (FieldExpr.AddressOf): ditto. Catch error where the address of a
18335 volatile variable is taken
18337 2003-05-02 Miguel de Icaza <miguel@ximian.com>
18339 * statement.cs (Fixed.Resolve): Report an error if we are not in
18342 2003-05-01 Miguel de Icaza <miguel@ximian.com>
18344 * typemanager.cs: reuse the code that handles type clashes for
18345 delegates and enumerations.
18347 * class.cs (Report28): Always report.
18349 * expression.cs (EncodeAsAttribute): Allow nulls here.
18351 2003-04-28 Miguel de Icaza <miguel@ximian.com>
18353 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
18354 the functionality for testing whether an expression is valid for
18355 an attribute here. Also handle the case of arrays of elements
18358 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
18359 encoding a linear array into an array of objects that are suitable
18360 to be passed to an CustomAttributeBuilder.
18362 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
18364 * ecore.cs: (FieldExpr): Handle field remapping here.
18366 * iteratators.cs: Pass the instance variable (if the method is an
18367 instance method) to the constructors, so we can access the field
18368 variables on the class.
18370 TODO: Test this with structs. I think the THIS variable on
18371 structs might have to be a pointer, and not a refenrece
18373 2003-04-27 Miguel de Icaza <miguel@ximian.com>
18375 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
18376 local variables to fields in a proxy class.
18378 * iterators.cs (PopulateProxy): Rename our internal fields to
18380 Create a <THIS> field if we are an instance method, so we can
18381 reference our parent container variables.
18382 (MapVariable): Called back from the EmitContext code to enter a
18383 new variable to field mapping into the proxy class (we just create
18387 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
18388 for using the remapped locals to fields.
18390 I placed the code here, because that gives the same semantics to
18391 local variables, and only changes the Emit code.
18393 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
18394 statements inside iterators.
18395 (VariableInfo): Add a FieldBuilder for the cases when we are
18396 remapping local variables to fields in a proxy class
18398 * ecore.cs (SimpleNameResolve): Avoid testing two times for
18399 current_block != null.
18401 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
18402 not cope with strings, as it has been moved to the
18403 TableSwitchEmit. Fixed bug in switch generation.
18405 * expression.cs (New.DoResolve): Provide more context for the user
18406 when reporting an error.
18408 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
18411 * expression.cs (MemberAccess.DoResolve): When we get a type back,
18412 check the permissions for it. Note than in a type-resolution
18413 context the check was already present in DeclSpace.ResolveType,
18414 but was missing from the MemberAccess.
18416 (ArrayCreation.CheckIndices): warn if the user has
18417 more nested levels of expressions, but there are no more
18418 dimensions specified. Avoids crash on bug 41906.
18420 2003-04-26 Miguel de Icaza <miguel@ximian.com>
18422 * statement.cs (Block): replace Implicit bool, for a generic
18424 New flag: `Unchecked'. This is used during the EmitMeta phase
18425 (which is out-of-line with the regular Resolve/Emit process for a
18426 statement, as this is done ahead of time, but still gets a chance
18427 to call constant resolve).
18429 (Block.Flags): new enum for adding a new flag.
18431 (Block.EmitMeta): track the state of unchecked.
18433 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
18434 to enable constant resolution to work there as well.
18436 2003-04-22 Miguel de Icaza <miguel@ximian.com>
18438 * typemanager.cs (ienumerable_type): Also look up
18439 System.Collections.IEnumerable.
18441 2003-04-21 Miguel de Icaza <miguel@ximian.com>
18443 TODO: Test more than one conditional per method.
18445 * class.cs (Indexer.Define): Report the location where the user is
18446 referencing the unsupported feature.
18448 (MethodData): Overload the use of `conditionals' to
18449 minimize the creation of needless ArrayLists. This saves roughly
18450 212kb on my machine.
18452 (Method): Implement the new IIteratorContainer interface.
18453 (Method.SetYields): Implement the method by setting the ModFlags
18454 to contain METHOD_YIELDS.
18456 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
18457 which just got set to null.
18459 * iterators.cs: New file.
18461 (Yield, YieldBreak): New statements.
18463 * statement.cs (Return.Resolve): Flag an error if we are used in
18464 an iterator method.
18466 * codegen.cs (InIterator): New flag set if the code is being
18467 compiled in an iterator method.
18469 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
18470 internal modifier, and we just use it to avoid adding extra
18471 fields, as this is seldom used.
18473 * cs-parser.jay: Add yield_statement (yield and yield break).
18475 * driver.cs: New flag -v2 to turn on version 2 features.
18477 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
18478 hashtable when v2 is enabled.
18480 2003-04-20 Miguel de Icaza <miguel@ximian.com>
18482 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
18483 there is already a namespace defined with this name.
18485 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
18486 people upgraded their corlibs.
18488 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
18489 always use fully qualified types, no need to use the compiler
18492 (TypeManager.IsNamespace): Use binarysearch.
18494 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
18495 AddDelegate): I did not quite use the new IsValid API properly: I
18496 have to pass the short-name and the fullname. I was passing only
18497 the basename instead of the fullname sometimes.
18499 (TypeContainer.DefineType): call NamespaceClash.
18501 * interface.cs (Interface.DefineType): use NamespaceClash before
18504 * delegate.cs (Delegate.DefineType): use NamespaceClash before
18507 * enum.cs: (Enum.DefineType): use NamespaceClash before
18510 * typemanager.cs (: 3-line patch that gives us some tasty 11%
18511 speed increase. First, use the negative_hits cache when we get a
18512 negative. Second, add the type with its full original name
18513 instead of the new . and + encoded name (reflection uses + to
18514 separate type from a nested type). Use LookupTypeReflection
18515 directly which bypasses the type->name hashtable (that we already
18516 know does not contain the type.
18518 * decl.cs (DeclSpace.ResolveTypeExpr): track the
18519 location/container type.
18521 * driver.cs: When passing utf8, use directly the UTF8Encoding.
18523 2003-04-19 Miguel de Icaza <miguel@ximian.com>
18525 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
18527 * delegate.cs (NewDelegate.Resolve): Test whether an instance
18528 method is being referenced in the method group from a static
18529 context, and report error 120 if so.
18531 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
18534 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
18535 is created, we create the A namespace).
18537 * cs-parser.jay: A namespace also introduces a DeclarationFound.
18540 2003-04-18 Miguel de Icaza <miguel@ximian.com>
18542 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
18543 invocation to ModuleBuilder.GetType with the same values will
18544 return a new type instance, so we need to cache its return
18547 * expression.cs (Binary.ResolveOperator): Only allow the compare
18548 operators on enums if they are of the same type.
18550 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
18551 types of ValueType on their own case. Before we were giving them
18552 the same treatment as objects.
18554 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
18555 fullname. Short name is used to compare against container name.
18556 Fullname is used to check against defined namespace names.
18558 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
18559 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
18561 (Method.CheckBase): Call parent.
18562 (MemberBase.CheckBase): Check for protected members on sealed
18564 (PropertyBase.CheckBase): Call parent.
18565 (Field.Define): Call parent.
18567 * report.cs: Negative error codes are now mapped to 8000 - code,
18568 so that the display is render more nicely.
18570 * typemanager.cs: Do not use try/catch, instead report a regular
18573 (GetPointerType, GetReferenceType): These methods provide
18574 mechanisms to obtain the T* and T& from a T. We had the code
18575 previously scattered around the code base, and it also used
18576 TypeManager.LookupType that would go through plenty of caches.
18577 This one goes directly to the type source.
18579 In some places we did the Type.GetType followed by
18580 ModuleBuilder.GetType, but not in others, so this unifies the
18581 processing as well.
18583 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
18584 statements now that we have namespace information.
18586 * typemanager.cs (IsNamespace): New method, returns whether the
18587 string presented is a namespace or not.
18589 (ComputeNamespaces): New public entry point, computes the list of
18590 available namespaces, using the GetNamespaces API call in Mono, or
18591 the slower version in MS.NET.
18593 Now before we start the semantic analysis phase, we have a
18594 complete list of namespaces including everything that the user has
18597 Deleted old code to cache namespaces in .nsc files.
18599 2003-04-17 Miguel de Icaza <miguel@ximian.com>
18601 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
18602 class/struct location definition Location for the implicit
18603 constructor location.
18605 (Operator.Define): Use the location of the operator for the
18606 implicit Method definition.
18608 (Constructor.Emit): use the constructor location for the implicit
18609 base initializer constructor.
18611 * ecore.cs: Remove ITypeExpression. This interface is now gone,
18612 and the Expression class now contains two new methods:
18614 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
18615 isolate type lookup from the rest of the resolution process.
18617 Since we use Expressions to hold type definitions due to the way
18618 we parse the input we have historically overloaded Resolve to
18619 perform the Type lookups if a special flag is passed. Now this is
18620 eliminated and two methods take their place.
18622 The differences in the two methods between xStep and xTerminal is
18623 that xStep is involved in our current lookup system that uses
18624 SimpleNames to compose a name, while xTerminal is used just to
18625 catch the case where the simplename lookup failed.
18627 2003-04-16 Miguel de Icaza <miguel@ximian.com>
18629 * expression.cs (ResolveMemberAccess): Remove redundant code.
18630 TypeExpr expressions are always born fully resolved.
18632 * interface.cs (PopulateMethod): Do not lookup the types twice.
18633 We were doing it once during SemanticAnalysis and once during
18636 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
18637 in local variable type definitions, were being returned as a
18638 SimpleName (we decomposed everything into a string), that is
18639 because primary_expression was being used instead of a type in the
18640 grammar (reduce/reduce conflicts).
18642 The part that was wrong is that we converted the expression into a
18643 string (an oversimplification in one hand, compounded with primary
18644 expressions doing string concatenation).
18650 Would return "A.B.C[]" as a SimpleName. This stopped things like
18651 using clauses from working on this particular context. And a type
18652 was being matched directly against "A.B.C[]".
18654 We now use the correct approach, and allow for ComposedCast to be
18655 part of the unary expression. So the "A.B.C []" become a composed
18656 cast of "A.B.C" (as a nested group of MemberAccess with a
18657 SimpleName at the end) plus the rank composition "[]".
18661 2003-04-10 Miguel de Icaza <miguel@ximian.com>
18663 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
18664 for the access level checking.
18666 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
18667 `TypeContainer container', because I kept getting confused when I
18668 was debugging this code.
18670 * expression.cs (Indexers): Instead of tracking getters/setters,
18671 we now track them in parallel. We create one arraylist less, but
18672 most importantly it is possible now for the LValue code to find a
18673 matching get for a set.
18675 (IndexerAccess.DoResolveLValue): Update the code.
18676 GetIndexersForType has been modified already to extract all the
18677 indexers from a type. The code assumed it did not.
18679 Also make the code set the correct return type for the indexer.
18680 This was fixed a long time ago for properties, but was missing for
18681 indexers. It used to be void_type.
18683 (Binary.Emit): Test first for doubles instead of
18684 floats, as they are more common.
18686 (Binary.EmitBranchable): Use the .un version of the branch opcodes
18687 when dealing with floats and the <=, >= operators. This fixes bug
18690 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
18691 to load the array value by emitting a load on the foreach variable
18692 type. This was incorrect.
18694 We now emit the code to load an element using the the array
18695 variable type, and then we emit the conversion operator.
18699 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
18701 * attribute.cs: Avoid allocation of ArrayLists in the common case.
18703 2003-04-09 Miguel de Icaza <miguel@ximian.com>
18705 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
18706 test for protection before we test for signatures.
18708 (MethodSignature.ToString): implement.
18710 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
18711 to the case where we reduced into a LongConstant.
18713 * decl.cs (CheckAccessLevel): If the type is an array, we can not
18714 depend on whether the information is acurrate, because the
18715 Microsoft runtime will always claim that the array type is public,
18716 regardless of the real state.
18718 If the type is a pointer, another problem happens: the type is
18719 reported as non-public in Microsoft.
18721 In both cases we have to call CheckAccessLevel recursively with
18722 the underlying type as the argument to be tested.
18724 2003-04-08 Miguel de Icaza <miguel@ximian.com>
18726 * assign.cs (Assign.Emit): If we are dealing with a compound
18727 assignment expression, we should use the code path that stores the
18728 intermediate result in a temporary value. This fixes #40903.
18730 *expression.cs (Indirection.ToString): Provide ToString method for
18733 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
18735 * class.cs: Null out fields holding references to Block objects so
18736 they can be garbage collected.
18738 * expression.cs (OverloadResolve): Remove unused local.
18740 2003-04-07 Martin Baulig <martin@ximian.com>
18742 * codegen.cs (EmitContext.CurrentFile): New public field.
18743 (EmitContext.Mark): Use the CurrentFile to check whether the
18744 location is in the correct file.
18745 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
18747 2003-04-07 Martin Baulig <martin@ximian.com>
18749 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
18751 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
18752 location. [FIXME: The location argument which gets passed to this
18753 method is sometimes wrong!]
18755 2003-04-07 Nick Drochak <ndrochak@gol.com>
18757 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
18759 2003-04-07 Miguel de Icaza <miguel@ximian.com>
18761 * expression.cs (Indirection.EmitAssign): We were using the
18762 temporary, but returning immediately instead of continuing the
18765 2003-04-06 Martin Baulig <martin@ximian.com>
18767 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
18768 if it's a nested child, but also deriving from the outer class.
18771 * typemanager.cs (IsNestedChildOf): Make this work if it's a
18772 nested child, but also deriving from the outer class. See
18774 (FilterWithClosure): We may access private members of the outer
18775 class if we're a nested child and deriving from the outer class.
18776 (RealMemberLookup): Only set `closure_private_ok' if the
18777 `original_bf' contained BindingFlags.NonPublic.
18779 2003-04-05 Martin Baulig <martin@ximian.com>
18781 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
18783 2003-04-02 Miguel de Icaza <miguel@ximian.com>
18785 * class.cs (Event.Define): Do not allow abstract events to have
18788 2003-04-01 Miguel de Icaza <miguel@ximian.com>
18790 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
18791 block in event declarations.
18793 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
18794 value type, get its address.
18796 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
18797 leaving a class on the stack instead of a boolean value (int
18798 0/1). Change the code so we compare against null, and then the
18799 result against zero.
18801 * class.cs (TypeContainer.GetClassBases): We were checking for the
18802 parent class being sealed too late.
18804 * expression.cs (Binary.Emit): For <= and >= when dealing with
18805 floating point values, use cgt.un and clt.un instead of cgt and
18808 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
18810 * statement.cs: Apply the same optimization as MS: skip the
18811 GetEnumerator returning an IEnumerator, and use the one returning a
18812 CharEnumerator instead. This allows us to avoid the try-finally block
18815 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
18817 * cs-parser.jay: Attributes cannot be applied to
18818 namespaces. Fixes #40473
18820 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18823 (Add*): check if the name is valid using the full name for constants,
18824 fields, properties and events.
18826 2003-03-28 Miguel de Icaza <miguel@ximian.com>
18828 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
18829 char constants to be part of the enumeration.
18831 * expression.cs (Conditional.DoResolve): Add support for operator
18832 true. Implements the missing functionality from 14.12
18834 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
18835 operator true/false as required by the spec.
18837 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
18838 implicit conversion to boolean.
18840 * statement.cs (Statement.ResolveBoolean): A boolean expression is
18841 also one where the type implements `operator true'.
18843 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
18844 get an expression that will invoke operator true based on an
18847 (GetConversionOperators): Removed the hack that called op_True
18850 (Expression.ResolveBoolean): Move this from Statement.
18852 2003-03-17 Miguel de Icaza <miguel@ximian.com>
18854 * ecore.cs (FieldExpr): do not allow initialization of initonly
18855 fields on derived classes
18857 2003-03-13 Martin Baulig <martin@ximian.com>
18859 * statement.cs (Block.Emit): Call ig.BeginScope() and
18860 ig.EndScope() when compiling with debugging info; call
18861 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
18863 2003-03-08 Miguel de Icaza <miguel@ximian.com>
18865 * expression.cs (Indexers): Do not construct immediately, allow
18866 for new members to be appended as we go. Fixes 38143
18868 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18870 * expression.cs: save/restore context when resolving an unchecked
18873 2003-03-05 Miguel de Icaza <miguel@ximian.com>
18875 * cfold.cs: Catch division by zero in modulus operator during
18878 2003-03-03 Miguel de Icaza <miguel@ximian.com>
18880 * interface.cs (Interface.DefineMembers): Avoid defining members
18883 2003-02-27 Miguel de Icaza <miguel@ximian.com>
18885 * driver.cs: handle the +/- options for -noconfig
18887 * statement.cs (Unckeched.Resolve): Also track the state of
18888 unchecked in the Resolve phase.
18890 2003-02-27 Martin Baulig <martin@ximian.com>
18892 * ecore.cs (Expression.MemberLookup): Don't create a
18893 MethodGroupExpr for something which is not a method. Fixes #38291.
18895 2003-02-25 Miguel de Icaza <miguel@ximian.com>
18897 * class.cs (MemberBase.CheckParameters): Also check that the type
18898 is unmanaged if it is a pointer.
18900 * expression.cs (SizeOf.Resolve): Add location information.
18902 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
18903 a managed type is declared.
18905 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
18906 parameter modifiers as well. Fixes bug 38606
18908 * class.cs: Very sad. Am backing out the speed up changes
18909 introduced by the ArrayList -> Array in the TypeContainer, as they
18910 were not actually that much faster, and introduced a bug (no error
18911 reports on duplicated methods).
18913 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
18914 source first, this will guarantee that we have a valid expression
18915 before calling in lower levels functions that will require a
18916 resolved object. Then use this original_source in the
18917 target.ResolveLValue instead of the original source that was
18920 Another change. Use target.Resolve instead of LValueResolve.
18921 Although we are resolving for LValues, we will let the Assign code
18922 take care of that (it will be called again from Resolve). This
18923 basically allows code like this:
18925 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
18926 class Y { void A (X x) { x [0] += o; }
18928 The problem was that the indexer was trying to resolve for
18929 set_Item (idx, object o) and never finding one. The real set_Item
18930 was set_Item (idx, X). By delaying the process we get the right
18935 2003-02-23 Martin Baulig <martin@ximian.com>
18937 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
18938 while calling DoEmit ().
18940 * codegen.cs (EmitContext.Mark): Don't mark locations in other
18941 source files; if you use the #line directive inside a method, the
18942 compiler stops emitting line numbers for the debugger until it
18943 reaches the end of the method or another #line directive which
18944 restores the original file.
18946 2003-02-23 Martin Baulig <martin@ximian.com>
18948 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
18950 2003-02-23 Martin Baulig <martin@ximian.com>
18952 * statement.cs (Block.AddChildVariableNames): We need to call this
18953 recursively, not just for our immediate children.
18955 2003-02-23 Martin Baulig <martin@ximian.com>
18957 * class.cs (Event.Define): Always make the field private, like csc does.
18959 * typemanager.cs (TypeManager.RealMemberLookup): Make events
18960 actually work, fixes bug #37521.
18962 2003-02-23 Miguel de Icaza <miguel@ximian.com>
18964 * delegate.cs: When creating the various temporary "Parameters"
18965 classes, make sure that we call the ComputeAndDefineParameterTypes
18966 on those new parameters (just like we do with the formal ones), to
18967 allow them to be resolved in the context of the DeclSpace.
18969 This fixes the bug that Dick observed in Bugzilla #38530.
18971 2003-02-22 Miguel de Icaza <miguel@ximian.com>
18973 * expression.cs (ResolveMemberAccess): When resolving a constant,
18974 do not attempt to pull a constant if the value was not able to
18975 generate a valid constant.
18977 * const.cs (LookupConstantValue): Do not report more errors than required.
18979 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18981 * expression.cs: fixes bug #38328.
18983 2003-02-18 Miguel de Icaza <miguel@ximian.com>
18985 * class.cs: Changed all the various members that can be part of a
18986 class from being an ArrayList to be an Array of the right type.
18987 During the DefineType type_list, interface_list, delegate_list and
18988 enum_list are turned into types, interfaces, delegates and enums
18991 And during the member population, indexer_list, event_list,
18992 constant_list, field_list, instance_constructor_list, method_list,
18993 operator_list and property_list are turned into their real arrays.
18995 Although we could probably perform this operation earlier, for
18996 good error reporting we need to keep the lists and remove the
18997 lists for longer than required.
18999 This optimization was triggered by Paolo profiling the compiler
19000 speed on the output of `gen-sample-program.pl' perl script.
19002 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
19003 not crash in methods like MemberLookupFailed that use this field.
19005 This problem arises when the compiler fails to resolve a type
19006 during interface type definition for example.
19008 2003-02-18 Miguel de Icaza <miguel@ximian.com>
19010 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
19011 inherit from System.Object, so we have to stop at null, not only
19012 when reaching System.Object.
19014 2003-02-17 Miguel de Icaza <miguel@ximian.com>
19016 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
19017 DeclaredOnly because the parent indexer might have had a different
19018 name, but did not loop until the top of the hierarchy was reached.
19020 The problem this one fixes is 35492: when a class implemented an
19021 indexer from an interface, we were getting the interface method
19022 (which was abstract) and we were flagging an error (can not invoke
19025 This also keeps bug 33089 functioning, and test-148 functioning.
19027 * typemanager.cs (IsSpecialMethod): The correct way of figuring
19028 out if a method is special is to see if it is declared in a
19029 property or event, or whether it is one of the predefined operator
19030 names. This should fix correctly #36804.
19032 2003-02-15 Miguel de Icaza <miguel@ximian.com>
19034 The goal here is to remove the dependency on EmptyCast.Peel ().
19035 Killing it completely.
19037 The problem is that currently in a number of places where
19038 constants are expected, we have to "probe" for an EmptyCast, and
19039 Peel, which is not the correct thing to do, as this will be
19040 repetitive and will likely lead to errors.
19042 The idea is to remove any EmptyCasts that are used in casts that
19043 can be reduced to constants, so we only have to cope with
19046 This bug hunt was triggered by Bug 37363 and the desire to remove
19047 the duplicate pattern where we were "peeling" emptycasts to check
19048 whether they were constants. Now constants will always be
19051 * ecore.cs: Use an enumconstant here instead of wrapping with
19054 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
19055 throwing me off. By handling this we can get rid of a few hacks.
19057 * statement.cs (Switch): Removed Peel() code.
19059 2003-02-14 Miguel de Icaza <miguel@ximian.com>
19061 * class.cs: Location information for error 508
19063 * expression.cs (New.DoResolve): Add a guard against double
19064 resolution of an expression.
19066 The New DoResolve might be called twice when initializing field
19067 expressions (see EmitFieldInitializers, the call to
19068 GetInitializerExpression will perform a resolve on the expression,
19069 and later the assign will trigger another resolution
19071 This leads to bugs (#37014)
19073 * delegate.cs: The signature for EndInvoke should contain any ref
19074 or out parameters as well. We were not doing this in the past.
19076 * class.cs (Field.Define): Do not overwrite the type definition
19077 inside the `volatile' group. Turns out that volatile enumerations
19078 were changing the type here to perform a validity test, which
19081 2003-02-12 Miguel de Icaza <miguel@ximian.com>
19083 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
19084 and structs, we do not want to load the instance variable
19086 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
19087 enum_type has to be handled like an object reference (implicit
19088 conversions exists from this to object), but the regular IsClass
19089 and IsValueType tests will never return true for this one.
19091 Also we use TypeManager.IsValueType instead of type.IsValueType,
19092 just for consistency with the rest of the code (this is only
19093 needed if we ever use the construct exposed by test-180.cs inside
19094 corlib, which we dont today).
19096 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
19098 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
19101 2003-02-09 Martin Baulig <martin@ximian.com>
19103 * namespace.cs (Namespace..ctor): Added SourceFile argument.
19104 (Namespace.DefineNamespaces): New static public method; this is
19105 called when we're compiling with debugging to add all namespaces
19106 to the symbol file.
19108 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
19109 pass it to the Namespace's .ctor.
19111 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
19112 and MethodBase arguments; pass the namespace ID to the symwriter;
19113 pass the MethodBase instead of the token to the symwriter.
19114 (SymbolWriter.DefineNamespace): New method to add a namespace to
19117 2003-02-09 Martin Baulig <martin@ximian.com>
19119 * symbolwriter.cs: New file. This is a wrapper around
19120 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
19121 methods here in near future.
19123 2003-02-09 Martin Baulig <martin@ximian.com>
19125 * codegen.cs (EmitContext.Mark): Just pass the arguments to
19126 ILGenerator.MarkSequencePoint() which are actually used by the
19129 2003-02-09 Martin Baulig <martin@ximian.com>
19131 * location.cs (SourceFile): New public sealed class. This
19132 contains the name and an index which is used in the location's token.
19133 (Location): Reserve an appropriate number of bits in the token for
19134 the source file instead of walking over that list, this gives us a
19135 really huge performance improvement when compiling with debugging.
19137 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
19138 `SourceFile' argument instead of a string.
19139 (Driver.ProcessFile): Add all the files via Location.AddFile(),
19140 but don't parse/tokenize here, we need to generate the list of all
19141 source files before we do that.
19142 (Driver.ProcessFiles): New static function. Parses/tokenizes all
19145 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
19146 instead of a string.
19148 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
19151 2003-02-09 Martin Baulig <martin@ximian.com>
19153 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
19154 filename on `#line default'.
19156 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
19158 * statement.cs: don't clear the pinned var when the fixed statement
19159 returns from the method (fixes bug#37752).
19161 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
19163 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
19166 2003-02-07 Martin Baulig <martin@ximian.com>
19168 * driver.cs: Removed the `--debug-args' command line argument.
19170 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
19171 automatically by the AsssemblyBuilder.
19172 (CodeGen.InitializeSymbolWriter): We don't need to call any
19173 initialization function on the symbol writer anymore. This method
19174 doesn't take any arguments.
19176 2003-02-03 Miguel de Icaza <miguel@ximian.com>
19178 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
19179 from referenced assemblies as well.
19181 2003-02-02 Martin Baulig <martin@ximian.com>
19183 * class.cs (MethodData.Emit): Generate debugging info for external methods.
19185 2003-02-02 Martin Baulig <martin@ximian.com>
19187 * class.cs (Constructor.Emit): Open the symbol writer before
19188 emitting the constructor initializer.
19189 (ConstructorInitializer.Emit): Call ec.Mark() to allow
19190 single-stepping through constructor initializers.
19192 2003-01-30 Miguel de Icaza <miguel@ximian.com>
19194 * class.cs: Handle error 549: do not allow virtual methods in
19197 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
19199 * decl.cs: Check access levels when resolving types
19201 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
19203 * statement.cs: Add parameters and locals set in catch blocks that might
19204 return to set vector
19206 2003-01-29 Miguel de Icaza <miguel@ximian.com>
19208 * class.cs (Operator): Set the SpecialName flags for operators.
19210 * expression.cs (Invocation.DoResolve): Only block calls to
19211 accessors and operators on SpecialName methods.
19213 (Cast.TryReduce): Handle conversions from char constants.
19216 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
19218 * statement.cs: small memory and time optimization in FlowBranching.
19220 2003-01-28 Pedro Mart <yoros@wanadoo.es>
19222 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
19223 problem that the last fix but in the other sid (Set).
19225 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
19226 access when there is no indexer in the hierarchy.
19228 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
19230 * class.cs: Combine some if statements.
19232 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19234 * driver.cs: fixed bug #37187.
19236 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
19238 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
19239 any indexer, it's needed to build a list with all the indexers in the
19240 hierarchy (AllGetters), else we have problems. Fixes #35653.
19242 2003-01-23 Miguel de Icaza <miguel@ximian.com>
19244 * class.cs (MethodData.Define): It is wrong for an interface
19245 implementation to be static in both cases: explicit and implicit.
19246 We were only handling this in one case.
19248 Improve the if situation there to not have negations.
19250 * class.cs (Field.Define): Turns out that we do not need to check
19251 the unsafe bit on field definition, only on usage. Remove the test.
19253 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19255 * driver.cs: use assembly.Location instead of Codebase (the latest
19256 patch made mcs fail when using MS assemblies).
19258 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
19260 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
19261 get the path to *corlib.dll.
19263 2003-01-21 Nick Drochak <ndrochak@gol.com>
19267 * typemanager.cs: Remove compiler warnings
19269 2003-01-20 Duncan Mak <duncan@ximian.com>
19271 * AssemblyInfo.cs: Bump the version number to 0.19.
19273 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19275 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
19277 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
19279 * class.cs (Constructor::Emit): Emit debugging info for constructors.
19281 2003-01-17 Miguel de Icaza <miguel@ximian.com>
19283 * cs-parser.jay: Small fix: we were not comparing the constructor
19284 name correctly. Thanks to Zoltan for the initial pointer.
19286 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
19288 * cs-tokenizer.cs: Set file name when specified with #line
19290 2003-01-15 Miguel de Icaza <miguel@ximian.com>
19292 * cs-parser.jay: Only perform the constructor checks here if we
19293 are named like the class; This will help provider a better
19294 error. The constructor path is taken when a type definition is
19295 not found, but most likely the user forgot to add the type, so
19296 report that rather than the constructor error.
19298 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
19300 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
19303 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
19305 * cs-parser.jay: Add cleanup call.
19307 2003-01-13 Duncan Mak <duncan@ximian.com>
19309 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
19310 consistent with other methods.
19312 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
19314 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
19316 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
19318 * attribute.cs: only set GuidAttr to true when we have a
19321 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19325 * typemanager.cs: fixes to allow mcs compile corlib with the new
19326 Type.IsSubclassOf fix.
19328 2003-01-08 Miguel de Icaza <miguel@ximian.com>
19330 * expression.cs (LocalVariableReference.DoResolve): Classify a
19331 constant as a value, not as a variable. Also, set the type for
19334 * cs-parser.jay (fixed_statement): take a type instead of a
19335 pointer_type, so we can produce a better error message later.
19337 * statement.cs (Fixed.Resolve): Flag types that are not pointers
19340 (For.DoEmit): Make inifinite loops have a
19341 non-conditional branch back.
19343 (Fixed.DoEmit): First populate the pinned variables, then emit the
19344 statement, then clear the variables. Before I was emitting the
19345 code once for each fixed piece.
19348 2003-01-08 Martin Baulig <martin@ximian.com>
19350 * statement.cs (FlowBranching.MergeChild): A break in a
19351 SWITCH_SECTION does not leave a loop. Fixes #36155.
19353 2003-01-08 Martin Baulig <martin@ximian.com>
19355 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
19356 lives in the same number space than `param_map'. Fixes #36154.
19358 2003-01-07 Miguel de Icaza <miguel@ximian.com>
19360 * cs-parser.jay (constructor_declaration): Set the
19361 Constructor.ModFlags before probing for it. This makes the
19362 compiler report 514, 515 and 132 (the code was there, but got
19365 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
19366 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
19367 (GotoCase.Resolve): Set `Returns' to ALWAYS.
19369 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
19371 * enum.cs: create the enum static fields using the enum type.
19373 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
19375 * class.cs: don't try to create the ParamBuilder for the return
19376 type if it's not needed (and handle it breaking for the ms runtime
19379 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
19381 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
19383 2002-12-29 Miguel de Icaza <miguel@ximian.com>
19385 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
19386 the command. This showed up while compiling the JANET source
19387 code, which used \r as its only newline separator.
19389 2002-12-28 Miguel de Icaza <miguel@ximian.com>
19391 * class.cs (Method.Define): If we are an operator (because it
19392 reuses our code), then set the SpecialName and HideBySig. #36128
19394 2002-12-22 Miguel de Icaza <miguel@ximian.com>
19396 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
19397 exception, report error 120 `object reference required'.
19399 * driver.cs: Add --pause option, used during to measure the size
19400 of the process as it goes with --timestamp.
19402 * expression.cs (Invocation.DoResolve): Do not allow methods with
19403 SpecialName to be invoked.
19405 2002-12-21 Miguel de Icaza <miguel@ximian.com>
19407 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
19408 number before adding it.
19410 2002-12-21 Ravi Pratap <ravi@ximian.com>
19412 * ecore.cs (StandardImplicitConversion): When in an unsafe
19413 context, we allow conversion between void * to any other pointer
19414 type. This fixes bug #35973.
19416 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
19418 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
19419 is not thrown when extensionless outputs are used
19421 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19423 * rootcontext.cs: fixed compilation of corlib.
19425 2002-12-19 Miguel de Icaza <miguel@ximian.com>
19427 * attribute.cs (Attributes.Contains): Add new method.
19429 * class.cs (MethodCore.LabelParameters): if the parameter is an
19430 `out' parameter, check that no attribute `[In]' has been passed.
19432 * enum.cs: Handle the `value__' name in an enumeration.
19434 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
19436 * decl.cs: Added special case to allow overrides on "protected
19439 2002-12-18 Ravi Pratap <ravi@ximian.com>
19441 * attribute.cs (Attributes.AddAttributeSection): Rename to this
19442 since it makes much more sense.
19444 (Attributes.ctor): Don't require a Location parameter.
19446 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
19448 * attribute.cs (ApplyAttributes): Remove extra Location parameters
19449 since we already have that information per attribute.
19451 * everywhere : make appropriate changes.
19453 * class.cs (LabelParameters): Write the code which actually
19454 applies attributes to the return type. We can't do this on the MS
19455 .NET runtime so we flag a warning in the case an exception is
19458 2002-12-18 Miguel de Icaza <miguel@ximian.com>
19460 * const.cs: Handle implicit null conversions here too.
19462 2002-12-17 Ravi Pratap <ravi@ximian.com>
19464 * class.cs (MethodCore.LabelParameters): Remove the extra
19465 Type [] parameter since it is completely unnecessary. Instead
19466 pass in the method's attributes so that we can extract
19467 the "return" attribute.
19469 2002-12-17 Miguel de Icaza <miguel@ximian.com>
19471 * cs-parser.jay (parse): Use Report.Error to flag errors instead
19472 of ignoring it and letting the compile continue.
19474 * typemanager.cs (ChangeType): use an extra argument to return an
19475 error condition instead of throwing an exception.
19477 2002-12-15 Miguel de Icaza <miguel@ximian.com>
19479 * expression.cs (Unary.TryReduce): mimic the code for the regular
19480 code path. Perform an implicit cast in the cases where we can
19481 implicitly convert to one of the integral types, and then reduce
19482 based on that constant. This fixes bug #35483.
19484 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19486 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
19488 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19490 * namespace.cs: fixed bug #35489.
19492 2002-12-12 Miguel de Icaza <miguel@ximian.com>
19494 * class.cs: Remove some dead code.
19496 * cs-parser.jay: Estimate the number of methods needed
19497 (RootContext.MethodCount);
19499 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
19500 numbers instead of StringBuilders.
19502 * support.cs (PtrHashtable): Add constructor with initial size;
19503 We can now reduce reallocations of the method table.
19505 2002-12-10 Ravi Pratap <ravi@ximian.com>
19507 * attribute.cs (ApplyAttributes): Keep track of the emitted
19508 attributes on a per-target basis. This fixes bug #35413.
19510 2002-12-10 Miguel de Icaza <miguel@ximian.com>
19512 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
19513 default to the Windows 1252 encoding.
19515 (UnixParseOption): Support version, thanks to Alp for the missing
19518 * AssemblyInfo.cs: Add nice assembly information.
19520 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
19523 * cs-parser.jay: Allow a trailing comma before the close bracked
19524 in the attribute_section production.
19526 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
19527 address of the instance was being taken, I will take this out,
19528 because we take the address of the object immediately here.
19530 2002-12-09 Ravi Pratap <ravi@ximian.com>
19532 * typemanager.cs (AreMultipleAllowed): Take care of the most
19533 obvious case where attribute type is not in the current assembly -
19536 2002-12-08 Miguel de Icaza <miguel@ximian.com>
19538 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
19539 definitions, instead of doing that afterwards.
19541 Also we use a nice little hack, depending on the constructor, we
19542 know if we are a "composed" name or a simple name. Hence, we
19543 avoid the IndexOf test, and we avoid
19545 * codegen.cs: Add code to assist in a bug reporter to track down
19546 the source of a compiler crash.
19548 2002-12-07 Ravi Pratap <ravi@ximian.com>
19550 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
19551 types have been emitted for a given element and flag an error
19552 if something which does not have AllowMultiple set is used more
19555 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
19556 attribute types and their corresponding AllowMultiple properties
19558 (AreMultipleAllowed): Check the property for a given type.
19560 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
19561 property in the case we have a TypeContainer.
19563 (Attributes.AddAttribute): Detect duplicates and just skip on
19564 adding them. This trivial fix catches a pretty gross error in our
19565 attribute emission - global attributes were being emitted twice!
19567 Bugzilla bug #33187 is now fixed.
19569 2002-12-06 Miguel de Icaza <miguel@ximian.com>
19571 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
19572 instead of pp_and).
19574 * expression.cs (Binary.ResolveOperator): I can only use the
19575 Concat (string, string, string) and Concat (string, string,
19576 string, string) if the child is actually a concatenation of
19579 2002-12-04 Miguel de Icaza <miguel@ximian.com>
19581 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
19582 context where we need a 2-character lookahead.
19584 * pending.cs (PendingImplementation): Rework so we can keep track
19585 of interface types all the time, and flag those which were
19586 implemented by parents as optional.
19588 2002-12-03 Miguel de Icaza <miguel@ximian.com>
19590 * expression.cs (Binary.ResolveOperator): Use
19591 String.Concat(string,string,string) or
19592 String.Concat(string,string,string,string) when possible.
19594 * typemanager: More helper methods.
19597 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
19599 * pending.cs: remove the bogus return from GetMissingInterfaces()
19600 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
19602 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19604 * namespace.cs: avoid duplicated 'using xxx' being added to
19605 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
19606 when we get more than one 'using' statement for the same namespace.
19607 Report a CS0105 warning for it.
19609 2002-11-30 Miguel de Icaza <miguel@ximian.com>
19611 * cs-tokenizer.cs (consume_identifier): use read directly, instead
19612 of calling getChar/putback, uses internal knowledge of it.
19614 (xtoken): Reorder tokenizer so most common patterns are checked
19615 first. This reduces the compilation time in another 5% (from 8.11s
19616 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
19618 The parsing time is 22% of the compilation in mcs, and from that
19619 64% is spent on the tokenization process.
19621 I tried using a binary search for keywords, but this is slower
19622 than the hashtable. Another option would be to do a couple of
19625 * Not use a StringBuilder, instead use an array of chars,
19626 with a set value. Notice that this way we could catch
19627 the 645 error without having to do it *afterwards*.
19629 * We could write a hand-parser to avoid the hashtable
19630 compares altogether.
19632 The identifier consumption process takes 37% of the tokenization
19633 time. Another 15% is spent on is_number. 56% of the time spent
19634 on is_number is spent on Int64.Parse:
19636 * We could probably choose based on the string length to
19637 use Int32.Parse or Int64.Parse and avoid all the 64-bit
19640 Another 3% is spend on wrapping `xtoken' in the `token' function.
19642 Handle 0xa0 as whitespace (#34752)
19644 2002-11-26 Miguel de Icaza <miguel@ximian.com>
19646 * typemanager.cs (IsCLRType): New routine to tell whether a type
19647 is one of the builtin types.
19649 Maybe it needs to use TypeCodes to be faster. Maybe we could use
19650 typecode in more places instead of doing pointer comparissions.
19651 We could leverage some knowledge about the way the typecodes are
19654 New code to cache namespaces in assemblies, it is currently not
19655 invoked, to be used soon.
19657 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
19659 * expression.cs (Binary.ResolveOperator): specially handle
19660 strings, and do not perform user-defined operator overloading for
19663 2002-11-24 Miguel de Icaza <miguel@ximian.com>
19665 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
19666 internalcall as it is a pretty simple operation; Avoid whenever
19667 possible to call Char.IsLetter.
19669 (consume_identifier): Cut by half the number of
19670 hashtable calls by merging the is_keyword and GetKeyword behavior.
19672 Do not short-circuit, because if we do, we
19673 report errors (ie, #if false && true would produce an invalid
19677 2002-11-24 Martin Baulig <martin@ximian.com>
19679 * expression.cs (Cast.TryReduce): If we're in checked syntax,
19680 check constant ranges and report a CS0221. Fixes #33186.
19682 2002-11-24 Martin Baulig <martin@ximian.com>
19684 * cs-parser.jay: Make this work for uninitialized variable
19685 declarations in the `for' initializer. Fixes #32416.
19687 2002-11-24 Martin Baulig <martin@ximian.com>
19689 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
19690 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
19692 2002-11-24 Martin Baulig <martin@ximian.com>
19694 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
19695 argument; if true, we also check for user-defined conversions.
19696 This is only needed if both arguments are of a user-defined type.
19697 Fixes #30443, added test-175.cs.
19698 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
19700 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
19702 2002-11-24 Martin Baulig <martin@ximian.com>
19704 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
19705 function to get the store opcode.
19706 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
19707 only emit the Ldelema if the store opcode is Stobj. You must run
19708 both test-34 and test-167 to test this. Fixes #34529.
19710 2002-11-23 Martin Baulig <martin@ximian.com>
19712 * ecore.cs (Expression.MemberLookup): Added additional
19713 `qualifier_type' argument which is used when we're being called
19714 from MemberAccess.DoResolve() and null if we're called from a
19716 (Expression.MemberLookupFailed): New method to report errors; this
19717 does the CS1540 check and reports the correct error message.
19719 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
19720 argument for the CS1540 check and redone the way how we're dealing
19721 with private members. See the comment in the source code for details.
19722 (FilterWithClosure): Reverted this back to revision 1.197; renamed
19723 `closure_start_type' to `closure_qualifier_type' and check whether
19724 it's not null. It was not this filter being broken, it was just
19725 being called with the wrong arguments.
19727 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
19728 and pass it the correct `qualifier_type'; this also does the error
19731 2002-11-22 Miguel de Icaza <miguel@ximian.com>
19733 * expression.cs (Invocation.EmitParams): If the we are dealing
19734 with a non-built-in value type, load its address as well.
19736 (ArrayCreation): Use a a pretty constant instead
19737 of the hardcoded value 2. Use 6 instead of 2 for the number of
19738 static initializers.
19740 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
19741 because they are not really value types, just glorified integers.
19743 * driver.cs: Do not append .exe, the CSC compiler does not do it.
19745 * ecore.cs: Remove redundant code for enumerations, make them use
19746 the same code path as everything else, fixes the casting issue
19747 with enumerations in Windows.Forms.
19749 * attribute.cs: Do only cast to string if it is a string, the
19750 validation happens later.
19752 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
19753 people upgrade their corlibs.
19755 * ecore.cs: Oops, enumerations were not following the entire code path
19757 2002-11-21 Miguel de Icaza <miguel@ximian.com>
19759 * typemanager.cs (FilterWithClosure): Commented out the test for
19760 1540 in typemanager.cs, as it has problems when accessing
19761 protected methods from a parent class (see test-174.cs).
19763 * attribute.cs (Attribute.ValidateGuid): new method.
19764 (Attribute.Resolve): Use above.
19766 2002-11-19 Miguel de Icaza <miguel@ximian.com>
19768 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
19770 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
19771 handling for enumerations, as we only needed the TypeContainer
19772 functionality to begin with (this is required for the fix below to
19773 work for enums that reference constants in a container class for
19776 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
19778 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
19779 a valid TypeBuilder to perform lookups on.o
19781 * class.cs (InheritableMemberSignatureCompare): Use true in the
19782 call to GetGetMethod and GetSetMethod, because we are comparing
19783 the signature, and we need to get the methods *even* if they are
19786 (PropertyBase.CheckBase): ditto.
19788 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
19789 GotoCase.Resolve): Use Peel on EmpytCasts.
19791 * ecore.cs (EmptyCast): drop child, add Peel method.
19793 2002-11-17 Martin Baulig <martin@ximian.com>
19795 * ecore.cs (EmptyCast.Child): New public property.
19797 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
19798 label resolved to an EmptyCast. Fixes #34162.
19799 (GotoCase.Resolve): Likewise.
19800 (Block.EmitMeta): Likewise.
19802 2002-11-17 Martin Baulig <martin@ximian.com>
19804 * expression.cs (Invocation.BetterConversion): Prefer int over
19805 uint; short over ushort; long over ulong for integer literals.
19806 Use ImplicitConversionExists instead of StandardConversionExists
19807 since we also need to check for user-defined implicit conversions.
19808 Fixes #34165. Added test-173.cs.
19810 2002-11-16 Martin Baulig <martin@ximian.com>
19812 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
19813 with the `true' and `false' literals. Fixes #33151.
19815 2002-11-16 Martin Baulig <martin@ximian.com>
19817 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
19818 October 22nd; don't do the cs1540 check for static members.
19820 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
19821 now using our own filter here and doing the cs1540 check again.
19823 2002-11-16 Martin Baulig <martin@ximian.com>
19825 * support.cs (InternalParameters): Don't crash if we don't have
19826 any fixed parameters. Fixes #33532.
19828 2002-11-16 Martin Baulig <martin@ximian.com>
19830 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
19831 when looking up static methods to make this work on Windows.
19834 2002-11-16 Martin Baulig <martin@ximian.com>
19836 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
19837 a setter rather than using PropertyInfo.CanWrite.
19839 2002-11-15 Nick Drochak <ndrochak@gol.com>
19841 * class.cs: Allow acces to block member by subclasses. Fixes build
19844 2002-11-14 Martin Baulig <martin@ximian.com>
19846 * class.cs (Constructor.Emit): Added the extern/block check.
19849 2002-11-14 Martin Baulig <martin@ximian.com>
19851 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
19852 iteration while looking for indexers, this is needed because the
19853 indexer may have a different name in our base classes. Fixed the
19854 error reporting (no indexers at all, not get accessor, no
19855 overloaded match). Fixes bug #33089.
19856 (IndexerAccess.DoResolveLValue): Likewise.
19858 2002-11-14 Martin Baulig <martin@ximian.com>
19860 * class.cs (PropertyBase.CheckBase): Make this work for multiple
19861 indexers. Fixes the first part of bug #33089.
19862 (MethodSignature.InheritableMemberSignatureCompare): Added support
19865 2002-11-13 Ravi Pratap <ravi@ximian.com>
19867 * attribute.cs (Attribute.Resolve): Catch the
19868 NullReferenceException and report it since it isn't supposed to
19871 2002-11-12 Miguel de Icaza <miguel@ximian.com>
19873 * expression.cs (Binary.EmitBranchable): Also handle the cases for
19874 LogicalOr and LogicalAnd that can benefit from recursively
19875 handling EmitBranchable. The code now should be nice for Paolo.
19877 2002-11-08 Miguel de Icaza <miguel@ximian.com>
19879 * typemanager.cs (LookupType): Added a negative-hit hashtable for
19880 the Type lookups, as we perform quite a number of lookups on
19881 non-Types. This can be removed once we can deterministically tell
19882 whether we have a type or a namespace in advance.
19884 But this might require special hacks from our corlib.
19888 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
19889 and double which avoids a conversion from an integer to a double.
19891 * expression.cs: tiny optimization, avoid calling IsConstant,
19892 because it effectively performs the lookup twice.
19894 2002-11-06 Miguel de Icaza <miguel@ximian.com>
19896 But a bogus return here to keep the semantics of the old code
19897 until the Mono runtime is fixed.
19899 * pending.cs (GetMissingInterfaces): New method used to remove all
19900 the interfaces that are already implemented by our parent
19901 classes from the list of pending methods.
19903 * interface.cs: Add checks for calls after ResolveTypeExpr.
19905 2002-11-05 Miguel de Icaza <miguel@ximian.com>
19907 * class.cs (Class.Emit): Report warning 67: event not used if the
19908 warning level is beyond 3.
19910 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
19911 being a NullLiteral.
19913 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
19916 * class.cs (TypeContainer.GetClassBases): Cover a missing code
19917 path that might fail if a type can not be resolved.
19919 * expression.cs (Binary.Emit): Emit unsigned versions of the
19922 * driver.cs: use error 5.
19924 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
19926 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
19928 2002-11-01 Miguel de Icaza <miguel@ximian.com>
19930 * cs-parser.jay (switch_section): A beautiful patch from Martin
19931 Baulig that fixed 33094.
19933 2002-10-31 Miguel de Icaza <miguel@ximian.com>
19935 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
19936 Check whether the base is abstract and report an error if so.
19938 * expression.cs (IndexerAccess.DoResolveLValue,
19939 IndexerAccess.DoResolve): ditto.
19941 (Invocation.DoResolve): ditto.
19943 (Invocation.FullMethodDesc): Improve the report string.
19945 * statement.cs (Block): Eliminate IsVariableDefined as it is
19946 basically just a wrapper for GetVariableInfo.
19948 * ecore.cs (SimpleName): Use new
19950 * support.cs (ReflectionParamter.ParameterType): We unwrap the
19951 type, as we return the actual parameter ref/unref state on a
19954 2002-10-30 Miguel de Icaza <miguel@ximian.com>
19956 * support.cs: Return proper flags REF/OUT fixing the previous
19959 * expression.cs: Reverted last patch, that was wrong. Is_ref is
19960 not used to mean `ref' but `ref or out' in ParameterReference
19962 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
19963 full type signature instead of calling TypeManger.CSharpName
19966 * support.cs (InternalParameters.ParameterDesc): Do not compare
19967 directly to the modflags, because REF/OUT will actually be bitsets
19970 * delegate.cs (VerifyMethod): Check also the modifiers.
19972 * cs-tokenizer.cs: Fix bug where floating point values with an
19973 exponent where a sign was missing was ignored.
19975 * driver.cs: Allow multiple assemblies to be specified in a single
19978 2002-10-28 Miguel de Icaza <miguel@ximian.com>
19980 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
19981 because identifiers after a parenthesis would end up in this kind
19982 of production, and we needed to desamiguate it for having casts
19985 (UserDefinedType *) xxx
19987 2002-10-24 Miguel de Icaza <miguel@ximian.com>
19989 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
19990 we should set on the Bindingflags.NonPublic, but not turn on
19991 private_ok. private_ok controls whether a Private member is
19992 returned (this is chekced on the filter routine), while the
19993 BindingFlags.NonPublic just controls whether private/protected
19994 will be allowed. This fixes the problem part of the problem of
19995 private properties being allowed to be used in derived classes.
19997 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
19998 so we can call the children DoResolveLValue method (this will
19999 properly signal errors on lvalue assignments to base properties)
20001 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
20002 getter are null, and we have a property info, we know that this
20003 happened because the lookup failed, so we report an error 122 for
20004 protection level violation.
20006 We also silently return if setter and getter are null in the
20007 resolve functions, this condition only happens if we have flagged
20008 the error before. This is the other half of the problem.
20010 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
20011 not have accessibility information, that is why we were returning
20012 true in the filter function in typemanager.cs.
20014 To properly report 122 (property is inaccessible because of its
20015 protection level) correctly, we report this error in ResolveAccess
20016 by failing if both the setter and the getter are lacking (ie, the
20019 DoResolve and DoLResolve have been modified to check for both
20020 setter/getter being null and returning silently, the reason being
20021 that I did not want to put the knowledge about this error in upper
20024 int old = Report.Errors;
20025 x = new PropertyExpr (...);
20026 if (old != Report.Errors)
20031 So the property expr is returned, but it is invalid, so the error
20032 will be flagged during the resolve process.
20034 * class.cs: Remove InheritablePropertySignatureCompare from the
20035 class, as we no longer depend on the property signature to compute
20036 whether it is possible to implement a method or not.
20038 The reason is that calling PropertyInfo.GetGetMethod will return
20039 null (in .NET, in Mono it works, and we should change this), in
20040 cases where the Get Method does not exist in that particular
20045 class X { public virtual int A { get { return 1; } } }
20047 class Z : Y { public override int A { get { return 2; } } }
20049 Would fail in Z because the parent (Y) would not have the property
20050 defined. So we avoid this completely now (because the alternative
20051 fix was ugly and slow), and we now depend exclusively on the
20054 (PropertyBase.CheckBase): Use a method-base mechanism to find our
20055 reference method, instead of using the property.
20057 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
20058 routines are gone now.
20060 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
20061 names, they were incorrectly named.
20063 * cs-tokenizer.cs: Return are more gentle token on failure.
20065 * pending.cs (PendingImplementation.InterfaceMethod): This routine
20066 had an out-of-sync index variable, which caused it to remove from
20067 the list of pending methods the wrong method sometimes.
20069 2002-10-22 Miguel de Icaza <miguel@ximian.com>
20071 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
20072 CanWrite, because those refer to this particular instance of the
20073 property, and do not take into account the fact that we can
20074 override single members of a property.
20076 Constructor requires an EmitContext. The resolution process does
20077 not happen here, but we need to compute the accessors before,
20078 because the resolution does not always happen for properties.
20080 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
20081 subclass, before we did not update this flag, but we did update
20084 (GetAccessors): Drop this routine, as it did not work in the
20085 presence of partially overwritten set/get methods.
20087 Notice that this broke the cs1540 detection, but that will require
20090 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20094 * driver.cs: issue a warning instead of an error if we don't support
20095 debugging for the platform. Also ignore a couple of errors that may
20096 arise when trying to write the symbols. Undo my previous patch.
20098 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20100 * driver.cs: ignore /debug switch except for Unix platforms.
20102 2002-10-23 Nick Drochak <ndrochak@gol.com>
20104 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
20106 2002-10-21 Miguel de Icaza <miguel@ximian.com>
20108 * driver.cs: Do not make mcs-debug conditional, so we do not break
20109 builds that use it.
20111 * statement.cs (UsageVector.MergeChildren): I would like Martin to
20112 review this patch. But basically after all the children variables
20113 have been merged, the value of "Breaks" was not being set to
20114 new_breaks for Switch blocks. I think that it should be set after
20115 it has executed. Currently I set this to the value of new_breaks,
20116 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
20117 conservative, but I do not understand this code very well.
20119 I did not break anything in the build, so that is good ;-)
20121 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
20123 2002-10-20 Mark Crichton <crichton@gimp.org>
20125 * cfold.cs: Fixed compile blocker. Really fixed it this time.
20127 2002-10-20 Nick Drochak <ndrochak@gol.com>
20129 * cfold.cs: Fixed compile blocker.
20131 2002-10-20 Miguel de Icaza <miguel@ximian.com>
20133 * driver.cs: I was chekcing the key, not the file.
20135 2002-10-19 Ravi Pratap <ravi@ximian.com>
20137 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
20138 message that we were generating - we just need to silently return
20141 2002-10-19 Miguel de Icaza <miguel@ximian.com>
20143 * class.cs (Event.Define): Change my previous commit, as this
20144 breaks the debugger. This is a temporary hack, as it seems like
20145 the compiler is generating events incorrectly to begin with.
20147 * expression.cs (Binary.ResolveOperator): Added support for
20148 "U operator - (E x, E y)"
20150 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
20153 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
20154 init-only variables, but this path did not take into account that
20155 there might be also instance readonly variables. Correct this
20158 This fixes bug 32253
20160 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
20163 * driver.cs: Change the extension for modules to `netmodule'
20165 * cs-parser.jay: Improved slightly the location tracking for
20166 the debugger symbols.
20168 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
20169 modifiers that were specified instead of the hardcoded value
20170 (FamAndAssem). This was basically ignoring the static modifier,
20171 and others. Fixes 32429.
20173 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
20174 fixed a bug in the process (32476)
20176 * expression.cs (ArrayAccess.EmitAssign): Patch from
20177 hwang_rob@yahoo.ca that fixes bug 31834.3
20179 2002-10-18 Miguel de Icaza <miguel@ximian.com>
20181 * driver.cs: Make the module extension .netmodule.
20183 2002-10-16 Miguel de Icaza <miguel@ximian.com>
20185 * driver.cs: Report an error if the resource file is not found
20186 instead of crashing.
20188 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
20189 false, like Emit does.
20191 2002-10-16 Nick Drochak <ndrochak@gol.com>
20193 * typemanager.cs: Remove unused private member. Also reported mcs
20194 bug to report this as a warning like csc.
20196 2002-10-15 Martin Baulig <martin@gnome.org>
20198 * statement.cs (Statement.Emit): Made this a virtual method; emits
20199 the line number info and calls DoEmit().
20200 (Statement.DoEmit): New protected abstract method, formerly knows
20201 as Statement.Emit().
20203 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
20205 2002-10-11 Miguel de Icaza <miguel@ximian.com>
20207 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
20208 have fixed a remaining problem: not every AddXXXX was adding a
20209 fully qualified name.
20211 Now everyone registers a fully qualified name in the DeclSpace as
20212 being defined instead of the partial name.
20214 Downsides: we are slower than we need to be due to the excess
20215 copies and the names being registered this way.
20217 The reason for this is that we currently depend (on the corlib
20218 bootstrap for instance) that types are fully qualified, because
20219 we dump all the types in the namespace, and we should really have
20220 types inserted into the proper namespace, so we can only store the
20221 basenames in the defined_names array.
20223 2002-10-10 Martin Baulig <martin@gnome.org>
20225 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
20226 from bug #31834, see the bug report for a testcase which is
20229 2002-10-10 Martin Baulig <martin@gnome.org>
20231 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
20232 flow analysis code for this.
20234 * statement.cs (Do, While, For): Tell the flow analysis code about
20236 (FlowBranching.UsageVector): Added support for infinite loops.
20237 (Block.Resolve): Moved the dead code elimination here and use flow
20240 2002-10-09 Miguel de Icaza <miguel@ximian.com>
20242 * class.cs (Field.Define): Catch cycles on struct type
20245 * typemanager.cs (IsUnmanagedtype): Do not recursively check
20246 fields if the fields are static. We only need to check instance
20249 * expression.cs (As.DoResolve): Test for reference type.
20251 * statement.cs (Using.ResolveExpression): Use
20252 ConvertImplicitRequired, not ConvertImplicit which reports an
20254 (Using.ResolveLocalVariableDecls): ditto.
20256 * expression.cs (Binary.ResolveOperator): Report errors in a few
20257 places where we had to.
20259 * typemanager.cs (IsUnmanagedtype): Finish implementation.
20261 2002-10-08 Miguel de Icaza <miguel@ximian.com>
20263 * expression.cs: Use StoreFromPtr instead of extracting the type
20264 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
20266 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
20267 an enumeration value to a System.Enum, but System.Enum is not a
20268 value type, but an class type, so we need to box.
20270 (Expression.ConvertExplicit): One codepath could return
20271 errors but not flag them. Fix this. Fixes #31853
20273 * parameter.cs (Resolve): Do not allow void as a parameter type.
20275 2002-10-06 Martin Baulig <martin@gnome.org>
20277 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
20278 if it's a class type and not a struct. Fixes #31815.
20280 2002-10-06 Martin Baulig <martin@gnome.org>
20282 * statement.cs: Reworked the flow analysis code a bit to make it
20283 usable for dead code elimination.
20285 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20287 * cs-parser.jay: allow empty source files. Fixes bug #31781.
20289 2002-10-04 Miguel de Icaza <miguel@ximian.com>
20291 * expression.cs (ComposedCast.DoResolveType): A quick workaround
20292 to fix the test 165, will investigate deeper.
20294 2002-10-04 Martin Baulig <martin@gnome.org>
20296 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
20297 finally blocks actually work.
20298 (Try.Resolve): We don't need to create a sibling for `finally' if
20299 there is no finally block.
20301 2002-10-04 Martin Baulig <martin@gnome.org>
20303 * class.cs (Constructor.Define): The default accessibility for a
20304 non-default constructor is private, not public.
20306 2002-10-04 Miguel de Icaza <miguel@ximian.com>
20308 * class.cs (Constructor): Make AllowedModifiers public, add
20311 * cs-parser.jay: Perform the modifiers test here, as the
20312 constructor for the Constructor class usually receives a zero
20313 because of the way we create it (first we create, later we
20314 customize, and we were never checking the modifiers).
20316 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
20317 is a version of LookupTypeReflection that includes the type-name
20318 cache. This can be used as a fast path for functions that know
20319 the fully qualified name and are only calling into *.GetType() to
20320 obtain a composed type.
20322 This is also used by TypeManager.LookupType during its type
20325 (LookupType): We now also track the real type name, as sometimes
20326 we can get a quey for the real type name from things like
20327 ComposedCast. This fixes bug 31422.
20329 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
20330 complete type fullname, it does not have to go through the type
20331 resolution system to obtain the composed version of the type (for
20332 obtaining arrays or pointers).
20334 (Conditional.Emit): Use the EmitBoolExpression to
20335 generate nicer code, as requested by Paolo.
20337 (ArrayCreation.CheckIndices): Use the patch from
20338 hwang_rob@yahoo.ca to validate the array initializers.
20340 2002-10-03 Miguel de Icaza <miguel@ximian.com>
20342 * class.cs (ConstructorInitializer.Emit): simplify code by using
20343 Invocation.EmitCall, and at the same time, fix the bugs in calling
20344 parent constructors that took variable arguments.
20346 * ecore.cs (Expression.ConvertNumericExplicit,
20347 Expression.ImplicitNumericConversion): Remove the code that
20348 manually wrapped decimal (InternalTypeConstructor call is now gone
20351 * expression.cs (Cast.TryReduce): Also handle decimal types when
20352 trying to perform a constant fold on the type.
20354 * typemanager.cs (IsUnmanagedtype): Partially implemented.
20356 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
20357 that only turned off an error report, and did nothing else.
20359 2002-10-02 Miguel de Icaza <miguel@ximian.com>
20361 * driver.cs: Handle and ignore /fullpaths
20363 2002-10-01 Miguel de Icaza <miguel@ximian.com>
20365 * expression.cs (Binary.ResolveOperator): Catch the case where
20366 DoNumericPromotions returns true,
20368 (Binary.DoNumericPromotions): Simplify the code, and the tests.
20370 2002-09-27 Miguel de Icaza <miguel@ximian.com>
20372 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
20375 2002-09-26 Miguel de Icaza <miguel@ximian.com>
20377 * ecore.cs (ConvertNumericExplicit): It is not enough that the
20378 conversion exists, but it is also required that the conversion be
20379 performed. This manifested in "(Type64Enum) 2".
20381 * class.cs (TypeManager.AddMethod): The fix is not to change
20382 AddEnum, because that one was using a fully qualified name (every
20383 DeclSpace derivative does), but to change the AddMethod routine
20384 that was using an un-namespaced name. This now correctly reports
20385 the duplicated name.
20387 Revert patch until I can properly fix it. The issue
20388 is that we have a shared Type space across all namespaces
20389 currently, which is wrong.
20391 Options include making the Namespace a DeclSpace, and merge
20392 current_namespace/current_container in the parser.
20394 2002-09-25 Miguel de Icaza <miguel@ximian.com>
20396 * cs-parser.jay: Improve error reporting when we get a different
20397 kind of expression in local_variable_type and
20398 local_variable_pointer_type.
20400 Propagate this to avoid missleading errors being reported.
20402 * ecore.cs (ImplicitReferenceConversion): treat
20403 TypeManager.value_type as a target just like object_type. As
20408 Is valid, and needs to result in the int 1 being boxed before it
20409 is assigned to the value type v.
20411 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
20412 to validate the enumeration name.
20414 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
20415 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
20416 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
20418 * ecore.cs (TryImplicitIntConversion): When doing an
20419 implicit-enumeration-conversion, check if the type is 64-bits and
20420 perform a conversion before passing to EnumConstant.
20422 2002-09-23 Miguel de Icaza <miguel@ximian.com>
20424 * decl.cs (Error_AmbiguousTypeReference); New routine used to
20425 report ambiguous type references. Unlike the MS version, we
20426 report what the ambiguity is. Innovation at work ;-)
20428 (DeclSpace.FindType): Require a location argument to
20429 display when we display an ambiguous error.
20431 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
20433 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
20435 * expression.cs (EmitDynamicInitializers): Apply patch from
20436 hwang_rob@yahoo.ca that fixes the order in which we emit our
20439 2002-09-21 Martin Baulig <martin@gnome.org>
20441 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
20442 delegate takes no arguments.
20444 2002-09-20 Miguel de Icaza <miguel@ximian.com>
20446 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
20449 * expression.cs: Extract the underlying type.
20451 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
20453 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
20455 2002-09-19 Miguel de Icaza <miguel@ximian.com>
20457 * class.cs (TypeContainer.DefineType): We can not use the nice
20458 PackingSize with the size set to 1 DefineType method, because it
20459 will not allow us to define the interfaces that the struct
20462 This completes the fixing of bug 27287
20464 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
20465 means also structs. This fixes part of the problem.
20466 (Expresion.ImplicitReferenceConversionExists): ditto.
20468 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
20469 error if there were no errors reported during the type lookup
20470 process, to avoid duplicates or redundant errors. Without this
20471 you would get an ambiguous errors plus a type not found. We have
20472 beaten the user enough with the first error.
20474 (DeclSparce.FindType): Emit a warning if we have an ambiguous
20477 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
20478 during the resolution process, stop the lookup, this avoids
20479 repeated error reports (same error twice).
20481 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
20483 * typemanager.cs (LookupType): Redo the type lookup code to match
20484 the needs of System.Reflection.
20486 The issue is that System.Reflection requires references to nested
20487 types to begin with a "+" sign instead of a dot. So toplevel
20488 types look like: "NameSpace.TopLevelClass", and nested ones look
20489 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
20492 2002-09-19 Martin Baulig <martin@gnome.org>
20494 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
20495 says that a method always returns or always throws an exception,
20496 don't report the CS0161.
20498 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
20499 set `Returns = new_returns'.
20501 2002-09-19 Martin Baulig <martin@gnome.org>
20503 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
20504 to an enum constant, check for a CS0176.
20506 2002-09-18 Miguel de Icaza <miguel@ximian.com>
20508 * class.cs (TypeContainer.CheckPairedOperators): Now we check
20509 for operators that must be in pairs and report errors.
20511 * ecore.cs (SimpleName.DoResolveType): During the initial type
20512 resolution process, when we define types recursively, we must
20513 check first for types in our current scope before we perform
20514 lookups in the enclosing scopes.
20516 * expression.cs (MakeByteBlob): Handle Decimal blobs.
20518 (Invocation.VerifyArgumentsCompat): Call
20519 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
20520 I thought we were supposed to always call this, but there are a
20521 few places in the code where we dont do it.
20523 2002-09-17 Miguel de Icaza <miguel@ximian.com>
20525 * driver.cs: Add support in -linkres and -resource to specify the
20526 name of the identifier.
20528 2002-09-16 Miguel de Icaza <miguel@ximian.com>
20530 * ecore.cs (StandardConversionExists): Sync with the conversion
20531 code: allow anything-* to void* conversions.
20533 (FindMostSpecificSource): Use an Expression argument
20534 instead of a Type, because we might be handed over a Literal which
20535 gets a few more implicit conversions that plain types do not. So
20536 this information was being lost.
20538 Also, we drop the temporary type-holder expression when not
20541 2002-09-17 Martin Baulig <martin@gnome.org>
20543 * class.cs (PropertyBase.CheckBase): Don't check the base class if
20544 this is an explicit interface implementation.
20546 2002-09-17 Martin Baulig <martin@gnome.org>
20548 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
20549 different `IndexerName' attributes.
20551 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
20552 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
20553 virtual CommonResolve().
20555 2002-09-16 Miguel de Icaza <miguel@ximian.com>
20557 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
20558 and convert that to the UnderlyingType.
20560 * statement.cs (Foreach.Resolve): Indexers are just like variables
20561 or PropertyAccesses.
20563 * cs-tokenizer.cs (consume_string): Track line numbers and columns
20564 inside quoted strings, we were not doing this before.
20566 2002-09-16 Martin Baulig <martin@gnome.org>
20568 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
20569 resolve it. This is needed for the definite assignment check of the
20570 instance expression, fixes bug #29846.
20571 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
20573 2002-09-16 Nick Drochak <ndrochak@gol.com>
20575 * parameter.cs: Fix compile error. Cannot reference static member
20576 from an instance object. Is this an mcs bug?
20578 2002-09-14 Martin Baulig <martin@gnome.org>
20580 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
20581 multiple times. Fixes bug #30295, added test-166.cs.
20583 2002-09-14 Martin Baulig <martin@gnome.org>
20585 * statement.cs (Block.Emit): Don't emit unreachable code.
20586 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
20587 `break' statements.
20588 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
20590 2002-09-14 Martin Baulig <martin@gnome.org>
20592 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
20595 2002-09-14 Martin Baulig <martin@gnome.org>
20597 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
20598 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
20599 be false on the ms runtime.
20601 2002-09-13 Martin Baulig <martin@gnome.org>
20603 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
20604 the CS0038 error message.
20606 2002-09-12 Miguel de Icaza <miguel@ximian.com>
20608 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
20609 constant inside, return it.
20611 2002-09-12 Martin Baulig <martin@gnome.org>
20613 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
20614 implicit conversion can be done between enum types.
20616 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
20617 check whether an implicit conversion to the current enum's UnderlyingType
20618 exists and report an error if not.
20620 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
20621 without debugging support.
20623 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
20624 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
20626 2002-09-12 Martin Baulig <martin@gnome.org>
20628 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
20630 * ecore.cs (IMemberExpr.DeclaringType): New property.
20631 (SimpleName.SimpleNameResolve): Check whether we're accessing a
20632 nonstatic member of an outer type (CS0038).
20634 2002-09-11 Miguel de Icaza <miguel@ximian.com>
20636 * driver.cs: Activate the using-error detector at warning level
20637 4 (at least for MS-compatible APIs).
20639 * namespace.cs (VerifyUsing): Small buglett fix.
20641 * pending.cs (PendingImplementation): pass the container pointer.
20643 * interface.cs (GetMethods): Allow for recursive definition. Long
20644 term, I would like to move every type to support recursive
20645 definitions, not the current ordering mechanism that we have right
20648 The situation is this: Attributes are handled before interfaces,
20649 so we can apply attributes to interfaces. But some attributes
20650 implement interfaces, we will now handle the simple cases
20651 (recursive definitions will just get an error).
20653 * parameter.cs: Only invalidate types at the end if we fail to
20656 2002-09-09 Martin Baulig <martin@gnome.org>
20658 * ecore.cs (PropertyExpr.Emit): Also check for
20659 TypeManager.system_int_array_get_length so this'll also work when
20660 compiling corlib. Fixes #30003.
20662 2002-09-09 Martin Baulig <martin@gnome.org>
20664 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
20665 and throw an exception if we can't get the type's size. Fixed #30040,
20668 2002-09-09 Martin Baulig <martin@gnome.org>
20670 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
20672 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
20673 context. Fixes bug #30027.
20675 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
20676 virtual functions. Fixes bug #30043, added test-164.cs.
20678 2002-09-08 Ravi Pratap <ravi@ximian.com>
20680 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
20682 2002-09-08 Nick Drochak <ndrochak@gol.com>
20684 * driver.cs: Use an object to get the windows codepage since it's not a
20687 2002-09-08 Miguel de Icaza <miguel@ximian.com>
20689 * statement.cs (For.Emit): for infinite loops (test == null)
20690 return whether there is a break inside, not always "true".
20692 * namespace.cs (UsingEntry): New struct to hold the name of the
20693 using definition, the location where it is defined, and whether it
20694 has been used in a successful type lookup.
20696 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
20701 2002-09-06 Ravi Pratap <ravi@ximian.com>
20703 * attribute.cs : Fix incorrect code which relied on catching
20704 a NullReferenceException to detect a null being passed in
20705 where an object was expected.
20707 2002-09-06 Miguel de Icaza <miguel@ximian.com>
20709 * statement.cs (Try): flag the catch variable as assigned
20711 * expression.cs (Cast): Simplified by using ResolveType instead of
20712 manually resolving.
20714 * statement.cs (Catch): Fix bug by using ResolveType.
20716 2002-09-06 Ravi Pratap <ravi@ximian.com>
20718 * expression.cs (BetterConversion): Special case for when we have
20719 a NullLiteral as the argument and we have to choose between string
20720 and object types - we choose string the way csc does.
20722 * attribute.cs (Attribute.Resolve): Catch the
20723 NullReferenceException and report error #182 since the Mono
20724 runtime no more has the bug and having this exception raised means
20725 we tried to select a constructor which takes an object and is
20728 2002-09-05 Ravi Pratap <ravi@ximian.com>
20730 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
20731 message (1502, 1503) when we can't locate a method after overload
20732 resolution. This is much more informative and closes the bug
20735 * interface.cs (PopulateMethod): Return if there are no argument
20736 types. Fixes a NullReferenceException bug.
20738 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
20739 expressions too. Previously we were checking only in one place for
20740 positional arguments leaving out named arguments.
20742 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
20743 type to the enum type is not allowed. Remove code corresponding to
20746 (ConvertNumericExplicit): Allow explicit conversions from
20747 the underlying type to enum type. This precisely follows the spec
20748 and closes a bug filed by Gonzalo.
20750 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20753 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
20755 2002-09-03 Miguel de Icaza <miguel@ximian.com>
20757 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
20758 it was important that we stored the right value after the
20759 reduction in `converted'.
20761 2002-09-04 Martin Baulig <martin@gnome.org>
20763 * location.cs (Location.SymbolDocument): Use full pathnames for the
20766 2002-08-30 Miguel de Icaza <miguel@ximian.com>
20768 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
20769 of the expression resolve mechanism, because that will catch the
20770 SimpleName error failures.
20772 (Conditional): If we can not resolve the
20773 expression, return, do not crash.
20775 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20778 (location): display token name instead of its number.
20780 2002-08-28 Martin Baulig <martin@gnome.org>
20782 * expression.cs (Binary.ResolveOperator): Don't silently return
20783 but return an error if an operator cannot be applied between two
20786 2002-08-28 Martin Baulig <martin@gnome.org>
20788 * class.cs (Constructor.Define): Set the permission attributes
20789 correctly instead of making all constructors public.
20791 2002-08-28 Martin Baulig <martin@gnome.org>
20793 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
20794 for private members before reporting a CS0103; if we find anything,
20797 2002-08-28 Martin Baulig <martin@gnome.org>
20799 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
20800 to check whether `closure_start_type == closure_invocation_type',
20801 we also need to check whether `m.DeclaringType == closure_invocation_type'
20802 before bypassing the permission checks. We might be accessing
20803 protected/private members from the base class.
20804 (TypeManager.RealMemberLookup): Only set private_ok if private
20805 members were requested via BindingFlags.NonPublic.
20807 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
20809 * expression.cs (MemberAccess.ResolveMemberAccess): Set
20810 MethodGroupExpr.IsExplicitImpl if appropriate.
20811 (Invocation.DoResolve): Don't report the CS0120 for explicit
20812 interface implementations.
20814 2002-08-27 Martin Baulig <martin@gnome.org>
20816 * expression.cs (Invocation.DoResolve): If this is a static
20817 method and we don't have an InstanceExpression, we must report
20820 2002-08-25 Martin Baulig <martin@gnome.org>
20822 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
20823 `==' between a valuetype and an object.
20825 2002-08-25 Miguel de Icaza <miguel@ximian.com>
20827 * ecore.cs (TypeExpr): Provide a ToString method.
20829 2002-08-24 Martin Baulig <martin@gnome.org>
20831 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
20832 now called proggie.dbg and it's a binary file.
20834 2002-08-23 Martin Baulig <martin@gnome.org>
20836 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
20838 2002-08-23 Martin Baulig <martin@gnome.org>
20840 * struct.cs (MyStructInfo.ctor): Make this work with empty
20841 structs; it's not allowed to use foreach() on null.
20843 2002-08-23 Martin Baulig <martin@gnome.org>
20845 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
20846 writer the full pathname of the generated assembly.
20848 2002-08-23 Martin Baulig <martin@gnome.org>
20850 * statements.cs (FlowBranching.UsageVector.MergeChildren):
20851 A `finally' block never returns or breaks; improved handling of
20854 2002-08-23 Martin Baulig <martin@gnome.org>
20856 * statement.cs (Throw.Resolve): Allow `throw null'.
20858 2002-08-23 Martin Baulig <martin@gnome.org>
20860 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
20861 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
20862 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
20863 MemberLookup would return a wrong event if this is an explicit
20864 interface implementation and the class has an event with the same
20867 2002-08-23 Martin Baulig <martin@gnome.org>
20869 * statement.cs (Block.AddChildVariableNames): New public method.
20870 (Block.AddChildVariableName): Likewise.
20871 (Block.IsVariableNameUsedInChildBlock): Likewise.
20872 (Block.AddVariable): Check whether a variable name has already
20873 been used in a child block.
20875 * cs-parser.jay (declare_local_variables): Mark all variable names
20876 from the current block as being used in a child block in the
20879 2002-08-23 Martin Baulig <martin@gnome.org>
20881 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
20882 find the symbol writer.
20884 * driver.cs: csc also allows the arguments to /define being
20885 separated by commas, not only by semicolons.
20887 2002-08-23 Martin Baulig <martin@gnome.org>
20889 * interface.cs (Interface.GetMembers): Added static check for events.
20891 2002-08-15 Martin Baulig <martin@gnome.org>
20893 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
20894 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
20896 * ecore.cs (Expression.MemberLookup): Added documentation and explained
20897 why the MethodData.EmitDestructor() change was necessary.
20899 2002-08-20 Martin Baulig <martin@gnome.org>
20901 * class.cs (TypeContainer.FindMembers): Added static check for events.
20903 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
20905 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
20906 use Type.GetEvents(), not Type.FindMembers().
20908 2002-08-20 Martin Baulig <martin@gnome.org>
20910 * decl.cs (MemberCache): Added a special method cache which will
20911 be used for method-only searched. This ensures that a method
20912 search will return a MethodInfo with the correct ReflectedType for
20915 2002-08-20 Martin Baulig <martin@gnome.org>
20917 * decl.cs (DeclSpace.FindMembers): Made this public.
20919 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20921 * delegate.cs: fixed build on windows.
20922 [FIXME: Filed as bug #29150: MCS must report these errors.]
20924 2002-08-19 Ravi Pratap <ravi@ximian.com>
20926 * ecore.cs (StandardConversionExists): Return a false
20927 if we are trying to convert the void type to anything else
20928 since that is not allowed.
20930 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
20931 we flag error 70 in the event an event is trying to be accessed
20932 directly from outside the declaring type.
20934 2002-08-20 Martin Baulig <martin@gnome.org>
20936 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
20937 MemberCache from typemanager.cs to decl.cs.
20939 2002-08-19 Martin Baulig <martin@gnome.org>
20941 * class.cs (TypeContainer): Implement IMemberContainer.
20942 (TypeContainer.DefineMembers): Create the MemberCache.
20943 (TypeContainer.FindMembers): Do better BindingFlags checking; only
20944 return public members if BindingFlags.Public was given, check
20945 whether members are static.
20947 2002-08-16 Martin Baulig <martin@gnome.org>
20949 * decl.cs (DeclSpace.Define): Splitted this in Define and
20950 DefineMembers. DefineMembers is called first and initializes the
20953 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
20954 DefineMembers() on all our DeclSpaces.
20956 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
20957 but call DefineMembers() on all nested interfaces. We call their
20958 Define() in our new Define() function.
20960 * interface.cs (Interface): Implement IMemberContainer.
20961 (Interface.Define): Moved all code except the attribute stuf to
20963 (Interface.DefineMembers): Initialize the member cache.
20965 * typemanager.cs (IMemberFinder): Removed this interface, we don't
20966 need this anymore since we can use MemberCache.FindMembers directly.
20968 2002-08-19 Martin Baulig <martin@gnome.org>
20970 * typemanager.cs (MemberCache): When creating the cache for an
20971 interface type, add all inherited members.
20972 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
20973 to `out bool used_cache' and documented it.
20974 (TypeManager.MemberLookup): If we already used the cache in the first
20975 iteration, we don't need to do the interfaces check.
20977 2002-08-19 Martin Baulig <martin@gnome.org>
20979 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
20980 here from IMemberFinder and don't implement this interface anymore.
20981 (DeclSpace.MemberCache): Moved here from IMemberFinder.
20983 * typemanager.cs (IMemberFinder): This interface is now only used by
20984 classes which actually support the member cache.
20985 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
20986 since we only put DeclSpaces into this Hashtable.
20987 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
20988 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
20990 2002-08-16 Martin Baulig <martin@gnome.org>
20992 * typemanager.cs (ICachingMemberFinder): Removed.
20993 (IMemberFinder.MemberCache): New property.
20994 (TypeManager.FindMembers): Merged this with RealFindMembers().
20995 This function will never be called from TypeManager.MemberLookup()
20996 so we can't use the cache here, just the IMemberFinder.
20997 (TypeManager.MemberLookup_FindMembers): Check whether the
20998 IMemberFinder has a MemberCache and call the cache's FindMembers
21000 (MemberCache): Rewrote larger parts of this yet another time and
21001 cleaned it up a bit.
21003 2002-08-15 Miguel de Icaza <miguel@ximian.com>
21005 * driver.cs (LoadArgs): Support quoting.
21007 (Usage): Show the CSC-like command line arguments.
21009 Improved a few error messages.
21011 2002-08-15 Martin Baulig <martin@gnome.org>
21013 * typemanager.cs (IMemberContainer.Type): New property.
21014 (IMemberContainer.IsInterface): New property.
21016 The following changes are conditional to BROKEN_RUNTIME, which is
21017 defined at the top of the file.
21019 * typemanager.cs (MemberCache.MemberCache): Don't add the base
21020 class'es members, but add all members from TypeHandle.ObjectType
21021 if we're an interface.
21022 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
21023 is the current type.
21024 (MemberCache.CacheEntry.Container): Removed this field.
21025 (TypeHandle.GetMembers): Include inherited members.
21027 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21029 * typemanager.cs: fixed compilation and added a comment on a field that
21032 2002-08-15 Martin Baulig <martin@gnome.org>
21034 * class.cs (ConstructorInitializer.Resolve): In the
21035 Expression.MemberLookup call, use the queried_type as
21038 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
21039 declared' attribute, it's always true.
21040 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
21041 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
21042 temporary wrapper for FindMembers which tells MemberLookup whether
21043 members from the base classes are included in the return value.
21044 This will go away soon.
21045 (TypeManager.MemberLookup): Use this temporary hack here; once the
21046 new MemberCache is completed, we don't need to do the DeclaredOnly
21047 looping here anymore since the MemberCache will take care of this.
21048 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
21049 (MemberCache): When creating the MemberCache for a class, get
21050 members from the current class and all its base classes.
21051 (MemberCache.CacheEntry.Container): New field. This is a
21052 temporary hack until the Mono runtime is fixed to distinguish
21053 between ReflectedType and DeclaringType. It allows us to use MCS
21054 with both the MS runtime and the unfixed Mono runtime without
21055 problems and without accecting performance.
21056 (MemberCache.SearchMembers): The DeclaredOnly looping from
21057 TypeManager.MemberLookup is now done here.
21059 2002-08-14 Martin Baulig <martin@gnome.org>
21061 * statement.cs (MyStructInfo.MyStructInfo): Don't call
21062 Type.GetFields on dynamic types but get the fields from the
21063 corresponding TypeContainer.
21064 (MyStructInfo.GetStructInfo): Added check for enum types.
21066 * typemanager.cs (MemberList.IsSynchronized): Implemented.
21067 (MemberList.SyncRoot): Implemented.
21068 (TypeManager.FilterWithClosure): No need to check permissions if
21069 closure_start_type == closure_invocation_type, don't crash if
21070 closure_invocation_type is null.
21072 2002-08-13 Martin Baulig <martin@gnome.org>
21074 Rewrote TypeContainer.FindMembers to use a member cache. This
21075 gives us a speed increase of about 35% for the self-hosting MCS
21076 build and of about 15-20% for the class libs (both on GNU/Linux).
21078 * report.cs (Timer): New class to get enhanced profiling. This
21079 whole class is "TIMER" conditional since it remarkably slows down
21082 * class.cs (MemberList): New class. This is an IList wrapper
21083 which we're now using instead of passing MemberInfo[]'s around to
21084 avoid copying this array unnecessarily.
21085 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
21086 (ICachingMemberFinder, IMemberContainer): New interface.
21087 (TypeManager.FilterWithClosure): If `criteria' is null, the name
21088 has already been checked, otherwise use it for the name comparision.
21089 (TypeManager.FindMembers): Renamed to RealMemberFinder and
21090 provided wrapper which tries to use ICachingMemberFinder.FindMembers
21091 if possible. Returns a MemberList, not a MemberInfo [].
21092 (TypeHandle): New class, implements IMemberContainer. We create
21093 one instance of this class per type, it contains a MemberCache
21094 which is used to do the member lookups.
21095 (MemberCache): New class. Each instance of this class contains
21096 all members of a type and a name-based hash table.
21097 (MemberCache.FindMembers): This is our new member lookup
21098 function. First, it looks up all members of the requested name in
21099 the hash table. Then, it walks this list and sorts out all
21100 applicable members and returns them.
21102 2002-08-13 Martin Baulig <martin@gnome.org>
21104 In addition to a nice code cleanup, this gives us a performance
21105 increase of about 1.4% on GNU/Linux - not much, but it's already
21106 half a second for the self-hosting MCS compilation.
21108 * typemanager.cs (IMemberFinder): New interface. It is used by
21109 TypeManager.FindMembers to call FindMembers on a TypeContainer,
21110 Enum, Delegate or Interface.
21111 (TypeManager.finder_to_member_finder): New PtrHashtable.
21112 (TypeManager.finder_to_container): Removed.
21113 (TypeManager.finder_to_delegate): Removed.
21114 (TypeManager.finder_to_interface): Removed.
21115 (TypeManager.finder_to_enum): Removed.
21117 * interface.cs (Interface): Implement IMemberFinder.
21119 * delegate.cs (Delegate): Implement IMemberFinder.
21121 * enum.cs (Enum): Implement IMemberFinder.
21123 * class.cs (TypeContainer): Implement IMemberFinder.
21125 2002-08-12 Martin Baulig <martin@gnome.org>
21127 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
21129 2002-08-12 Martin Baulig <martin@gnome.org>
21131 * ecore.cs (ITypeExpression): New interface for expressions which
21133 (TypeExpression): Renamed to TypeLookupExpression.
21134 (Expression.DoResolve): If we're doing a types-only lookup, the
21135 expression must implement the ITypeExpression interface and we
21136 call DoResolveType() on it.
21137 (SimpleName): Implement the new ITypeExpression interface.
21138 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
21139 hack, the situation that we're only looking up types can't happen
21140 anymore when this method is called. Moved the type lookup code to
21141 DoResolveType() and call it.
21142 (SimpleName.DoResolveType): This ITypeExpression interface method
21143 is now doing the types-only lookup.
21144 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
21145 (ResolveFlags): Added MaskExprClass.
21147 * expression.cs (MemberAccess): Implement the ITypeExpression
21149 (MemberAccess.DoResolve): Added support for a types-only lookup
21150 when we're called via ITypeExpression.DoResolveType().
21151 (ComposedCast): Implement the ITypeExpression interface.
21153 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
21154 Expression.Resolve() with ResolveFlags.Type instead.
21156 2002-08-12 Martin Baulig <martin@gnome.org>
21158 * interface.cs (Interface.Define): Apply attributes.
21160 * attribute.cs (Attribute.ApplyAttributes): Added support for
21161 interface attributes.
21163 2002-08-11 Martin Baulig <martin@gnome.org>
21165 * statement.cs (Block.Emit): Only check the "this" variable if we
21166 do not always throw an exception.
21168 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
21169 whether the property has a set accessor.
21171 2002-08-11 Martin Baulig <martin@gnome.org>
21173 Added control flow analysis support for structs.
21175 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
21176 with control flow analysis turned off.
21177 (IVariable): New interface.
21178 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
21179 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
21180 (FieldExpr.DoResolve): Resolve the instance expression with flow
21181 analysis turned off and do the definite assignment check after the
21182 resolving when we know what the expression will resolve to.
21184 * expression.cs (LocalVariableReference, ParameterReference):
21185 Implement the new IVariable interface, only call the flow analysis
21186 code if ec.DoFlowAnalysis is true.
21187 (This): Added constructor which takes a Block argument. Implement
21188 the new IVariable interface.
21189 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
21190 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
21191 This does the definite assignment checks for struct members.
21193 * class.cs (Constructor.Emit): If this is a non-static `struct'
21194 constructor which doesn't have any initializer, call
21195 Block.AddThisVariable() to tell the flow analysis code that all
21196 struct elements must be initialized before control returns from
21199 * statement.cs (MyStructInfo): New public class.
21200 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
21201 argument to this indexer. If non-zero, check an individual struct
21202 member, not the whole struct.
21203 (FlowBranching.CheckOutParameters): Check struct members.
21204 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
21205 overloaded versions of these methods which take an additional
21206 `int field_idx' argument to check struct members.
21207 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
21208 overloaded versions of these methods which take an additional
21209 `string field_name' argument to check struct member.s
21210 (VariableInfo): Implement the IVariable interface.
21211 (VariableInfo.StructInfo): New public property. Returns the
21212 MyStructInfo instance of the variable if it's a struct or null.
21213 (Block.AddThisVariable): New public method. This is called from
21214 Constructor.Emit() for non-static `struct' constructor which do
21215 not have any initializer. It creates a special variable for the
21216 "this" instance variable which will be checked by the flow
21217 analysis code to ensure that all of the struct's fields are
21218 initialized before control returns from the constructor.
21219 (UsageVector): Added support for struct members. If a
21220 variable/parameter is a struct with N members, we reserve a slot
21221 in the usage vector for each member. A struct is considered fully
21222 initialized if either the struct itself (slot 0) or all its
21223 members are initialized.
21225 2002-08-08 Martin Baulig <martin@gnome.org>
21227 * driver.cs (Driver.MainDriver): Only report an error CS5001
21228 if there were no compilation errors.
21230 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
21231 `UnsafeContext' property to determine whether the parent is in
21232 unsafe context rather than checking the parent's ModFlags:
21233 classes nested in an unsafe class are unsafe as well.
21235 2002-08-08 Martin Baulig <martin@gnome.org>
21237 * statement.cs (UsageVector.MergeChildren): Distinguish between
21238 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
21239 we return. Added test17() and test18() to test-154.cs.
21241 2002-08-08 Martin Baulig <martin@gnome.org>
21243 * typemanager.cs (TypeManager.FilterWithClosure): If we have
21244 Family access, make sure the invoking type isn't a subclass of the
21245 queried type (that'd be a CS1540).
21247 * ecore.cs (Expression.MemberLookup): Added overloaded version of
21248 this method which takes an additional `Type invocation_type'.
21250 * expression.cs (BaseAccess.DoResolve): Use the base type as
21251 invocation and query type.
21252 (MemberAccess.DoResolve): If the lookup failed and we're about to
21253 report a CS0122, try a lookup with the ec.ContainerType - if this
21254 succeeds, we must report a CS1540.
21256 2002-08-08 Martin Baulig <martin@gnome.org>
21258 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
21259 (MethodGroupExpr): Implement the IMemberExpr interface.
21261 * expression (MemberAccess.ResolveMemberAccess): No need to have
21262 any special code for MethodGroupExprs anymore, they're now
21265 2002-08-08 Martin Baulig <martin@gnome.org>
21267 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
21268 Family, FamANDAssem and FamORAssem permissions.
21269 (TypeManager.IsSubclassOrNestedChildOf): New public method.
21271 2002-08-08 Martin Baulig <martin@gnome.org>
21273 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
21274 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
21277 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
21279 * driver.cs: implemented /resource option to embed managed resources.
21281 2002-08-07 Martin Baulig <martin@gnome.org>
21283 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
21284 (FieldBase.HasFieldInitializer): New public property.
21285 (FieldBase.GetInitializerExpression): New public method. Resolves and
21286 returns the field initializer and makes sure it is only resolved once.
21287 (TypeContainer.EmitFieldInitializers): Call
21288 FieldBase.GetInitializerExpression to get the initializer, this ensures
21289 that it isn't resolved multiple times.
21291 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
21292 the resolving process (SimpleName/MemberLookup) that we're currently
21293 emitting a field initializer (which must not access any instance members,
21294 this is an error CS0236).
21296 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
21297 argument, if the `IsFieldInitializer' flag is set, we must report and
21298 error CS0236 and not an error CS0120.
21300 2002-08-07 Martin Baulig <martin@gnome.org>
21302 * ecore.cs (IMemberExpr): New public interface.
21303 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
21304 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
21305 if the expression is an IMemberExpr.
21307 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
21308 to be null, implicitly default to `this' if we're non-static in
21309 this case. Simplified the code a lot by using the new IMemberExpr
21310 interface. Also fixed bug #28176 here.
21312 2002-08-06 Martin Baulig <martin@gnome.org>
21314 * cs-parser.jay (SimpleLookup): Removed. We need to create
21315 ParameterReferences during semantic analysis so that we can do a
21316 type-only search when resolving Cast, TypeOf and SizeOf.
21317 (block): Pass the `current_local_parameters' to the Block's
21320 * class.cs (ConstructorInitializer): Added `Parameters parameters'
21321 argument to the constructor.
21322 (ConstructorInitializer.Resolve): Create a temporary implicit
21323 block with the parameters.
21325 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
21326 references here if we aren't doing a type-only search.
21328 * statement.cs (Block): Added constructor which takes a
21329 `Parameters parameters' argument.
21330 (Block.Parameters): New public property.
21332 * support.cs (InternalParameters.Parameters): Renamed `parameters'
21333 to `Parameters' and made it public readonly.
21335 2002-08-06 Martin Baulig <martin@gnome.org>
21337 * ecore.cs (Expression.Warning): Made this public as well.
21339 * report.cs (Report.Debug): Print the contents of collections.
21341 2002-08-06 Martin Baulig <martin@gnome.org>
21343 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
21344 used to tell Resolve() which kinds of expressions it may return.
21345 (Expression.Resolve): Added overloaded version of this method which
21346 takes a `ResolveFlags flags' argument. This can be used to tell
21347 Resolve() which kinds of expressions it may return. Reports a
21349 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
21350 ResolveFlags.SimpleName.
21351 (Expression.Error118): Added overloaded version of this method which
21352 takes a `ResolveFlags flags' argument. It uses the flags to determine
21353 which kinds of expressions are allowed.
21355 * expression.cs (Argument.ResolveMethodGroup): New public method.
21356 Resolves an argument, but allows a MethodGroup to be returned.
21357 This is used when invoking a delegate.
21359 * TODO: Updated a bit.
21361 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21363 Fixed compilation with csc.
21365 * ecore.cs: Expression.Error made public. Is this correct? Should
21366 Warning be made public too?
21368 * expression.cs: use ea.Location instead of ea.loc.
21369 [FIXME: Filed as bug #28607: MCS must report these errors.]
21371 2002-08-06 Martin Baulig <martin@gnome.org>
21373 * ecore.cs (Expression.loc): Moved the location here instead of
21374 duplicating it in all derived classes.
21375 (Expression.Location): New public property.
21376 (Expression.Error, Expression.Warning): Made them non-static and
21377 removed the location argument.
21378 (Expression.Warning): Added overloaded version which takes an
21379 `int level' argument.
21380 (Expression.Error118): Make this non-static and removed the
21381 expression and location arguments.
21382 (TypeExpr): Added location argument to the constructor.
21384 * expression.cs (StaticCallExpr): Added location argument to
21386 (Indirection, PointerArithmetic): Likewise.
21387 (CheckedExpr, UnCheckedExpr): Likewise.
21388 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
21389 (StringPtr): Likewise.
21392 2002-08-05 Martin Baulig <martin@gnome.org>
21394 * expression.cs (BaseAccess.DoResolve): Actually report errors.
21396 * assign.cs (Assign.DoResolve): Check whether the source
21397 expression is a value or variable.
21399 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
21400 while resolving the corresponding blocks.
21402 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
21403 an error, don't silently return null.
21405 * statement.cs (Block.AddVariable): Do the error reporting here
21406 and distinguish between CS0128 and CS0136.
21407 (Block.DoResolve): Report all unused labels (warning CS0164).
21408 (LabeledStatement): Pass the location to the constructor.
21409 (LabeledStatement.HasBeenReferenced): New property.
21410 (LabeledStatement.Resolve): Set it to true here.
21412 * statement.cs (Return.Emit): Return success even after reporting
21413 a type mismatch error (CS0126 or CS0127), this is what csc does and
21414 it avoids confusing the users with any consecutive errors.
21416 2002-08-05 Martin Baulig <martin@gnome.org>
21418 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
21420 * const.cs (Const.LookupConstantValue): Catch circular definitions.
21422 * expression.cs (MemberAccess.DoResolve): Silently return if an
21423 error has already been reported.
21425 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
21426 error has already been reported.
21428 2002-08-05 Martin Baulig <martin@gnome.org>
21430 * statement.cs (UsageVector): Only initialize the `parameters'
21431 vector if we actually have any "out" parameters.
21433 2002-08-05 Martin Baulig <martin@gnome.org>
21435 * expression.cs (Binary.ResolveOperator): When combining delegates,
21436 they must have the same type.
21438 2002-08-05 Martin Baulig <martin@gnome.org>
21440 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
21441 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
21442 work with the ms runtime and we also don't need it: if we're a
21443 PropertyBuilder and not in the `indexer_arguments' hash, then we
21444 are a property and not an indexer.
21446 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
21447 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
21448 since the latter one doesn't work with the ms runtime.
21450 2002-08-03 Martin Baulig <martin@gnome.org>
21452 Fixed bugs #27998 and #22735.
21454 * class.cs (Method.IsOperator): New public field.
21455 (Method.CheckBase): Report CS0111 if there's already a method
21456 with the same parameters in the current class. Report CS0508 when
21457 attempting to change the return type of an inherited method.
21458 (MethodData.Emit): Report CS0179 if a method doesn't have a body
21459 and it's not marked abstract or extern.
21460 (PropertyBase): New abstract base class for Property and Indexer.
21461 (PropertyBase.CheckBase): Moved here from Property and made it work
21463 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
21464 the same so we can reuse it there.
21465 (Property, Indexer): Derive from PropertyBase.
21466 (MethodSignature.inheritable_property_signature_filter): New delegate
21467 to find properties and indexers.
21469 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
21470 argument and improved error reporting.
21472 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
21473 EmptyReadOnlyParameters and made it a property.
21475 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
21476 version of this method which takes a `PropertyInfo indexer'.
21477 (TypeManager.RegisterIndexer): New method.
21479 * class.cs: Added myself as author of this file :-)
21481 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21483 * class.cs: fixed compilation on windoze.
21485 2002-08-03 Martin Baulig <martin@gnome.org>
21487 * interface.cs (Interface.GetInterfaceBases): Check whether all
21488 base interfaces are at least as accessible than the current one.
21490 * class.cs (TypeContainer.GetClassBases): Check whether base types
21491 are at least as accessible than the current type.
21492 (TypeContainer.AsAccessible): Implemented and made non-static.
21493 (MemberBase.CheckParameters): Report errors if the accessibility
21496 * delegate.cs (Delegate.Delegate): The default visibility is
21497 internal for top-level types and private for nested types.
21498 (Delegate.Define): Report errors if the accessibility checks fail.
21500 * enum.cs (Enum.Enum): The default visibility is internal for
21501 top-level types and private for nested types.
21502 (Enum.DefineType): Compute the correct visibility.
21504 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
21505 function which takes a `bool is_toplevel' instead of a TypeContainer.
21507 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
21510 2002-08-02 Martin Baulig <martin@gnome.org>
21512 * expression.cs (LocalVariableReferenc): Added constructor which
21513 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
21514 (LocalVariableReference.IsReadOnly): New property.
21515 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
21516 variable is readonly, use our own readonly flag to do this; you can
21517 use the new constructor to get a writable reference to a read-only
21520 * cs-parser.jay (foreach_statement, using_statement): Get a writable
21521 reference to the local variable.
21523 2002-08-01 Miguel de Icaza <miguel@ximian.com>
21525 * rootcontext.cs (ResolveCore): Also include System.Exception
21527 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
21528 we reach an EmptyStatement.
21530 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
21533 * expression.cs (Binary.ResolveOperator): Check error result in
21536 use brtrue/brfalse directly and avoid compares to null.
21538 2002-08-02 Martin Baulig <martin@gnome.org>
21540 * class.cs (TypeContainer.Define): Define all nested interfaces here.
21541 Fixes bug #28407, added test-155.cs.
21543 2002-08-01 Martin Baulig <martin@gnome.org>
21545 * class.cs (Event.EmitDefaultMethod): Make this work with static
21546 events. Fixes #28311, added verify-3.cs.
21548 2002-08-01 Martin Baulig <martin@gnome.org>
21550 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
21551 `is_disposable' fields.
21552 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
21553 `hm.is_disposable' if we're using the collection pattern.
21554 (Foreach.EmitCollectionForeach): Use the correct type for the
21555 enumerator's local variable, only emit the try/finally block if
21556 necessary (fixes #27713).
21558 2002-08-01 Martin Baulig <martin@gnome.org>
21560 * ecore.cs (Expression.report118): Renamed to Error118 and made
21563 * statement.cs (Throw.Resolve): Check whether the expression is of
21564 the correct type (CS0118) and whether the type derives from
21565 System.Exception (CS0155).
21566 (Catch.Resolve): New method. Do the type lookup here and check
21567 whether it derives from System.Exception (CS0155).
21568 (Catch.CatchType, Catch.IsGeneral): New public properties.
21570 * typemanager.cs (TypeManager.exception_type): Added.
21572 2002-07-31 Miguel de Icaza <miguel@ximian.com>
21574 * driver.cs: Updated About function.
21576 2002-07-31 Martin Baulig <martin@gnome.org>
21578 Implemented Control Flow Analysis.
21580 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
21581 (EmitContext.CurrentBranching): Added.
21582 (EmitContext.StartFlowBranching): Added.
21583 (EmitContext.EndFlowBranching): Added.
21584 (EmitContext.KillFlowBranching): Added.
21585 (EmitContext.IsVariableAssigned): Added.
21586 (EmitContext.SetVariableAssigned): Added.
21587 (EmitContext.IsParameterAssigned): Added.
21588 (EmitContext.SetParameterAssigned): Added.
21589 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
21590 Added control flow analysis stuff here.
21592 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
21593 resolve the expression as lvalue.
21594 (LocalVariableReference.DoResolve): Check whether the variable has
21595 already been assigned.
21596 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
21597 the parameter as assigned here.
21598 (ParameterReference.DoResolve): Check whether the parameter has already
21600 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
21601 expression as lvalue.
21603 * statement.cs (FlowBranching): New class for the flow analysis code.
21604 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
21605 (LabeledStatement.IsDefined): New public property.
21606 (LabeledStatement.AddUsageVector): New public method to tell flow
21607 analyis that the label may be reached via a forward jump.
21608 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
21610 (VariableInfo.Number): New public field. This is used by flow analysis
21611 to number all locals of a block.
21612 (Block.CountVariables): New public property. This is the number of
21613 local variables in this block (including the locals from all parent
21615 (Block.EmitMeta): Number all the variables.
21617 * statement.cs: Added flow analysis support to all classes.
21619 2002-07-31 Martin Baulig <martin@gnome.org>
21621 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
21622 To get debugging messages, compile mcs with /define:MCS_DEBUG and
21623 then use this argument.
21625 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
21627 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
21628 use this to specify /define options.
21630 2002-07-29 Martin Baulig <martin@gnome.org>
21632 * statement.cs (Fixed): Moved all code that does variable lookups
21633 and resolvings from Emit to Resolve.
21635 * statement.cs (For): Moved all code that does variable lookups
21636 and resolvings from Emit to Resolve.
21638 * statement.cs (Using): Moved all code that does variable lookups
21639 and resolvings from Emit to Resolve.
21641 2002-07-29 Martin Baulig <martin@gnome.org>
21643 * attribute.cs (Attribute.Resolve): Explicitly catch a
21644 System.NullReferenceException when creating the
21645 CustromAttributeBuilder and report a different warning message.
21647 2002-07-29 Martin Baulig <martin@gnome.org>
21649 * support.cs (ParameterData.ParameterName): Added method to
21650 get the name of a parameter.
21652 * typemanager.cs (TypeManager.IsValueType): New public method.
21654 2002-07-29 Martin Baulig <martin@gnome.org>
21656 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
21657 is a flag which specifies that it's either ref or out.
21658 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
21659 the out parameter to `out Parameter.Modifier mod', also set the
21660 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
21662 * support.cs (InternalParameters.ParameterModifier): Distinguish
21663 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
21664 Parameter.Modifier.ISBYREF flag if it's either ref or out.
21666 * expression.cs (Argument.GetParameterModifier): Distinguish
21667 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
21668 Parameter.Modifier.ISBYREF flag if it's either ref or out.
21670 2002-07-29 Martin Baulig <martin@gnome.org>
21672 * expression.cs (ParameterReference.ParameterReference): Added
21673 `Location loc' argument to the constructor.
21675 * cs-parser.jay: Pass location to ParameterReference.
21677 2002-07-28 Miguel de Icaza <miguel@ximian.com>
21679 * statement.cs (Try): Initialize the location.
21681 * cs-parser.jay: pass location to Try.
21683 * expression.cs (Unary.Reduce): Change the prototype to return
21684 whether a constant fold could be performed or not. The result is
21685 returned in an out parameters. In the case of Indirection and
21686 AddressOf, we want to perform the full tests.
21688 2002-07-26 Miguel de Icaza <miguel@ximian.com>
21690 * statement.cs (Statement.Emit): Flag dead code.
21692 2002-07-27 Andrew Birkett <andy@nobugs.org>
21694 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
21696 2002-07-27 Martin Baulig <martin@gnome.org>
21698 * class.cs (MethodData.Define): Put back call to
21699 TypeManager.AddMethod(), accidentally commented this out.
21701 * report.cs (Debug): New public method to print debugging information,
21702 this is `[Conditional ("DEBUG")]'.
21704 2002-07-26 Martin Baulig <martin@gnome.org>
21706 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
21707 (switch_statement): Push the current_block to the switch_stack and
21708 pop it again when we're done with the switch.
21709 (switch_section): The new block is a child of the current_block.
21710 Fixes bug #24007, added test-152.cs.
21712 2002-07-27 Martin Baulig <martin@gnome.org>
21714 * expression.cs (Invocation.EmitArguments): When calling a varargs
21715 function with only its fixed arguments, we need to pass an empty
21718 2002-07-27 Martin Baulig <martin@gnome.org>
21720 Mono 0.13 has been released.
21722 2002-07-25 Miguel de Icaza <miguel@ximian.com>
21724 * driver.cs: Rename --resource to --linkres, because that is what
21725 we do currently, we dont support --resource yet.
21727 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
21729 2002-07-25 Martin Baulig <martin@gnome.org>
21731 * class.cs (MethodData): New public class. This is a `method builder'
21732 class for a method or one accessor of a Property/Indexer/Event.
21733 (MethodData.GetMethodFlags): Moved here from MemberBase.
21734 (MethodData.ApplyAttributes): Likewise.
21735 (MethodData.ApplyObsoleteAttribute): Likewise.
21736 (MethodData.ApplyConditionalAttribute): Likewise.
21737 (MethodData.ApplyDllImportAttribute): Likewise.
21738 (MethodData.CheckAbstractAndExternal): Likewise.
21739 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
21740 (MethodData.Emit): Formerly known as Method.Emit().
21741 (MemberBase): Moved everything which was specific to a single
21742 accessor/method to MethodData.
21743 (Method): Create a new MethodData and call Define() and Emit() on it.
21744 (Property, Indexer, Event): Create a new MethodData objects for each
21745 accessor and call Define() and Emit() on them.
21747 2002-07-25 Martin Baulig <martin@gnome.org>
21749 Made MethodCore derive from MemberBase to reuse the code from there.
21750 MemberBase now also checks for attributes.
21752 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
21753 (MemberBase.GetMethodFlags): Moved here from class Method and marked
21755 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
21756 `CallingConventions cc' and `Attributes opt_attrs' arguments.
21757 (MemberBase.ApplyAttributes): New virtual method; applies the
21758 attributes to a method or accessor.
21759 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
21760 (MemberBase.ApplyConditionalAttribute): Likewise.
21761 (MemberBase.ApplyDllImportAttribute): Likewise.
21762 (MemberBase.CheckAbstractAndExternal): Likewise.
21763 (MethodCore.ParameterTypes): This is now a property instead of a
21764 method, it's initialized from DoDefineParameters().
21765 (MethodCore.ParameterInfo): Removed the set accessor.
21766 (MethodCore.DoDefineParameters): New protected virtual method to
21767 initialize ParameterTypes and ParameterInfo.
21768 (Method.GetReturnType): We can now simply return the MemberType.
21769 (Method.GetMethodFlags): Override the MemberBase version and add
21770 the conditional flags.
21771 (Method.CheckBase): Moved some code from Define() here, call
21772 DoDefineParameters() here.
21773 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
21774 here to avoid some larger code duplication.
21775 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
21776 ensure that abstract and external accessors don't declare a body.
21778 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
21779 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
21780 lookup in the attribute's parent classes, so we need to abort as soon
21781 as we found the first match.
21782 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
21783 the attribute has no arguments.
21785 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
21788 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21790 * cs-parser.jay: reverted previous patch.
21792 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21794 * cs-parser.jay: fixed bug #22119.
21796 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21798 * attribute.cs: fixed compilation. The error was:
21799 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
21800 be assigned to before control leaves the current method."
21801 [FIXME: Filed as bug #28186: MCS must report this error.]
21803 2002-07-25 Martin Baulig <martin@gnome.org>
21805 * attribute.cs (Attribute.Conditional_GetConditionName): New static
21806 method to pull the condition name ouf of a Conditional attribute.
21807 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
21808 the obsolete message and error flag out of an Obsolete attribute.
21810 * class.cs (Method.GetMethodFlags): New public method to get the
21811 TypeManager.MethodFlags for this method.
21812 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
21814 (Method.Define): Get and apply the Obsolete and Conditional attributes;
21815 if we're overriding a virtual function, set the new private variable
21816 `parent_method'; call the new TypeManager.AddMethod().
21818 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
21819 the MethodBuilder and the Method in a PtrHashtable.
21820 (TypeManager.builder_to_method): Added for this purpose.
21821 (TypeManager.MethodFlags): Added IsObsoleteError.
21822 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
21823 Obsolete and Conditional arguments in MethodBuilders. If we discover
21824 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
21825 the message from the attribute.
21827 2002-07-24 Martin Baulig <martin@gnome.org>
21829 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
21830 preprocessor directives, ensure that the argument to #define/#undef is
21831 exactly one identifier and that it's actually an identifier.
21833 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
21836 2002-07-24 Martin Baulig <martin@gnome.org>
21838 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
21839 initialize it to TypeManager.object_type in the constructor.
21840 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
21841 of the `hm.get_current' method if we're using the collection pattern.
21842 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
21843 for the explicit conversion to make it work when we're using the collection
21844 pattern and the `Current' property has a different return type than `object'.
21847 2002-07-24 Martin Baulig <martin@gnome.org>
21849 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
21850 does not match, but don't report any errors. This method is called in
21851 order for all methods in a MethodGroupExpr until a matching method is
21852 found, so we don't want to bail out if the first method doesn't match.
21853 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
21854 matches, report the 123. Fixes #28070.
21856 2002-07-24 Martin Baulig <martin@gnome.org>
21858 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
21859 TypeManager.TypeToCoreType() to the top of the method so the
21860 following equality checks will work. Fixes #28107.
21862 2002-07-24 Martin Baulig <martin@gnome.org>
21864 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
21865 operand is of type uint, and the other operand is of type sbyte,
21866 short or int, the operands are converted to type long." -
21867 Actually do what this comment already told us. Fixes bug #28106,
21870 2002-07-24 Martin Baulig <martin@gnome.org>
21872 * class.cs (MethodBase): New abstract class. This is now a base
21873 class for Property, Indexer and Event to avoid some code duplication
21874 in their Define() and DefineMethods() methods.
21875 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
21876 generic methods for Define() and DefineMethods().
21877 (FieldBase): Derive from MemberBase, not MemberCore.
21878 (Property): Derive from MemberBase, not MemberCore.
21879 (Property.DefineMethod): Moved all the code from this method to the
21880 new MethodBase.DefineAccessor(), just call it with appropriate
21882 (Property.Define): Call the new Property.DoDefine(), this does some
21883 sanity checks and we don't need to duplicate the code everywhere.
21884 (Event): Derive from MemberBase, not MemberCore.
21885 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
21886 accessors, this will also make them work with interface events.
21887 (Indexer): Derive from MemberBase, not MemberCore.
21888 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
21889 (Indexer.Define): Use the new MethodBase functions.
21891 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
21892 argument to the constructor.
21893 (Interface.FindMembers): Added support for interface events.
21894 (Interface.PopluateEvent): Implemented.
21896 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
21898 2002-07-22 Miguel de Icaza <miguel@ximian.com>
21900 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
21901 but this is required to check for a method name being the same as
21902 the containing class.
21906 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21908 * interface.cs: initialize variable.
21910 2002-07-23 Martin Baulig <martin@gnome.org>
21912 Implemented the IndexerName attribute in interfaces.
21914 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
21915 name if this is an explicit interface implementation.
21916 (Indexer.InterfaceIndexerName): New public variable. If we're
21917 implementing an interface indexer, this is the IndexerName in that
21918 interface. Otherwise, it's the IndexerName.
21919 (Indexer.DefineMethod): If we're implementing interface indexer,
21920 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
21921 and Pending.ImplementIndexer methods.
21922 (Indexer.Define): Also define the PropertyBuilder if we're
21923 implementing an interface indexer and this is neither an explicit
21924 interface implementation nor do the IndexerName match the one in
21927 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
21928 If a method is defined here, then we always need to create a proxy
21929 for it. This is used when implementing interface indexers.
21930 (Pending.IsInterfaceIndexer): New public method.
21931 (Pending.ImplementIndexer): New public method.
21932 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
21933 This is used when implementing interface indexers to define a proxy
21935 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
21936 define a proxy if necessary.
21938 * interface.cs (Interface.IndexerName): New public variable.
21939 (Interface.PopulateIndexer): Set the IndexerName.
21940 (Interface.DefineIndexers): New private method. Populate all the
21941 indexers and make sure their IndexerNames match.
21943 * typemanager.cs (IndexerPropertyName): Added support for interface
21946 2002-07-22 Martin Baulig <martin@gnome.org>
21948 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
21949 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
21950 ret if HasReturnLabel.
21951 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
21954 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
21955 and set the ec.LoopBeginTryCatchLevel.
21956 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
21957 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
21958 the current ec.TryCatchLevel, the branch goes out of an exception
21959 block. In this case, we need to use Leave and not Br.
21961 2002-07-22 Martin Baulig <martin@gnome.org>
21963 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
21964 block unless the block does not always return or it is contained in
21965 another try { ... } catch { ... } block. Fixes bug #26506.
21966 Added verify-1.cs to the test suite.
21968 2002-07-22 Martin Baulig <martin@gnome.org>
21970 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
21971 then we do not always return. Fixes bug #24985.
21973 2002-07-22 Martin Baulig <martin@gnome.org>
21975 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
21976 lookup on a per-class level; ie. walk up the class hierarchy until we
21977 found at least one applicable method, then choose the best among them.
21978 Fixes bug #24463 and test-29.cs.
21980 2002-07-22 Martin Baulig <martin@gnome.org>
21982 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
21983 return types of the methods. The return type is not part of the
21984 signature and we must not check it to make the `new' modifier work.
21985 Fixes bug #27999, also added test-147.cs.
21986 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
21988 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
21989 on the method's return type.
21991 2002-07-21 Martin Baulig <martin@gnome.org>
21993 * assign.cs: Make this work if the rightmost source is a constant and
21994 we need to do an implicit type conversion. Also adding a few more tests
21995 to test-38.cs which should have caught this.
21997 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
21998 target in the makefile for this. The makefile.gnu is primarily intended
21999 for end-users who don't want to debug the compiler.
22001 2002-07-21 Martin Baulig <martin@gnome.org>
22003 * assign.cs: Improved the Assign class so it can now handle embedded
22004 assignments (X = Y = Z = something). As a side-effect this'll now also
22005 consume less local variables. test-38.cs now passes with MCS, added
22006 a few new test cases to that test.
22008 2002-07-20 Martin Baulig <martin@gnome.org>
22010 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
22011 instructions. Fixes bug #27977, also added test-146.cs.
22013 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22015 * cs-tokenizer.cs: fixed getHex ().
22017 2002-07-19 Martin Baulig <martin@gnome.org>
22019 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
22020 not Type.GetType() to lookup the array type. This is needed when
22021 we're constructing an array of a user-defined type.
22022 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
22023 single-dimensional arrays, but also for single-dimensial arrays of
22026 2002-07-19 Martin Baulig <martin@gnome.org>
22028 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
22029 this function is called, it's not allowed to share LocalBuilders
22030 among ILGenerators.
22032 2002-07-19 Martin Baulig <martin@gnome.org>
22034 * expression.cs (Argument.Resolve): Report an error 118 when trying
22035 to pass a type as argument.
22037 2002-07-18 Martin Baulig <martin@gnome.org>
22039 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
22040 Conv_R_Un for the signed `long' type.
22042 2002-07-15 Miguel de Icaza <miguel@ximian.com>
22044 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
22045 `expr' for the temporary result, as that will fail if we do
22046 multiple resolves on the same expression.
22048 2002-07-05 Miguel de Icaza <miguel@ximian.com>
22050 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
22051 ec.TypeContainer for looking up aliases.
22053 * class.cs (TypeContainer): Remove LookupAlias from here.
22055 * decl.cs (DeclSpace); Move here.
22057 2002-07-01 Miguel de Icaza <miguel@ximian.com>
22059 * class.cs (FindMembers): Only call filter if the constructor
22060 bulider is not null.
22062 Also handle delegates in `NestedTypes' now. Now we will perform
22063 type lookups using the standard resolution process. This also
22066 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
22067 This uses Expressions (the limited kind that can be parsed by the
22068 tree) instead of strings.
22070 * expression.cs (ComposedCast.ToString): Implement, used to flag
22071 errors since now we have to render expressions.
22073 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
22076 * ecore.cs (SimpleName.ToString): ditto.
22078 * cs-parser.jay: Instead of using strings to assemble types, use
22079 Expressions to assemble the type (using SimpleName, ComposedCast,
22080 MemberAccess). This should fix the type lookups in declarations,
22081 because we were using a different code path for this.
22083 * statement.cs (Block.Resolve): Continue processing statements
22084 even when there is an error.
22086 2002-07-17 Miguel de Icaza <miguel@ximian.com>
22088 * class.cs (Event.Define): Also remove the `remove' method from
22089 the list of pending items.
22091 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
22092 generate more compact code.
22094 2002-07-17 Martin Baulig <martin@gnome.org>
22096 * const.cs (Const.LookupConstantValue): Add support for constant
22097 `unchecked' and `checked' expressions.
22098 Also adding test case test-140.cs for this.
22100 2002-07-17 Martin Baulig <martin@gnome.org>
22102 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
22103 check whether mi.ReturnType implements the IEnumerator interface; the
22104 `==' and the IsAssignableFrom() will fail in this situation.
22106 2002-07-16 Ravi Pratap <ravi@ximian.com>
22108 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
22111 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22113 * expression.cs: fixed bug #27811.
22115 2002-07-14 Miguel de Icaza <miguel@ximian.com>
22117 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
22118 Molaro: when we are a ref, the value already contains a pointer
22119 value, do not take the address of it.
22121 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
22122 * removed mb-parser.jay and mb-tokenizer.cs
22124 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
22126 * expression.cs: check against the building corlib void type.
22128 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
22130 * ecore.cs: fix for valuetype static readonly fields: when
22131 initializing them, we need their address, not the address of a copy.
22133 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
22135 * typemanager.cs: register also enum_type in corlib.
22137 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
22139 * class.cs: allow calling this (but not base) initializers in structs.
22141 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
22143 * ecore.cs: make sure we compare against the building base types
22146 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
22148 * typemanager.cs: fix TypeToCoreType() to handle void and object
22149 (corlib gets no more typerefs after this change).
22151 2002-07-12 Miguel de Icaza <miguel@ximian.com>
22153 * expression.cs (ArrayCreation.EmitArrayArguments): use
22154 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
22156 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
22157 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
22158 array indexes, the runtime actually forbids them.
22160 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
22161 for array arguments here.
22163 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
22164 instead of the default for ValueTypes.
22166 (New.DoEmit): Use IsValueType instead of
22167 IsSubclassOf (value_type)
22168 (New.DoResolve): ditto.
22169 (Invocation.EmitCall): ditto.
22171 * assign.cs (Assign): ditto.
22173 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
22174 Statements *are* currently doing part of their resolution during
22177 Expressions do always resolve during resolve, but statements are
22178 only required to propagate resolution to their children.
22180 2002-07-11 Miguel de Icaza <miguel@ximian.com>
22182 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
22184 (LoadAssembly): Do not add the dll if it is already specified
22186 (MainDriver): Add the System directory to the link path at the end,
22187 after all the other -L arguments.
22189 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
22190 wrong opcode for loading bytes and bools (ldelem.i1 instead of
22191 ldelem.u1) and using the opposite for sbytes.
22193 This fixes Digger, and we can finally run it.
22195 * driver.cs (UnixParseOption): Move the option parsing here.
22196 (CSCParseOption): Implement CSC-like parsing of options.
22198 We now support both modes of operation, the old Unix way, and the
22199 new CSC-like way. This should help those who wanted to make cross
22200 platform makefiles.
22202 The only thing broken is that /r:, /reference: and /lib: are not
22203 implemented, because I want to make those have the same semantics
22204 as the CSC compiler has, and kill once and for all the confussion
22205 around this. Will be doing this tomorrow.
22207 * statement.cs (Unsafe.Resolve): The state is checked during
22208 resolve, not emit, so we have to set the flags for IsUnsfe here.
22210 2002-07-10 Miguel de Icaza <miguel@ximian.com>
22212 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
22213 not catch the Error_ObjectRefRequired in SimpleName (as it is
22214 possible to have a class/instance variable name that later gets
22215 deambiguated), we have to check this here.
22217 2002-07-10 Ravi Pratap <ravi@ximian.com>
22219 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
22220 make static and put into Expression.
22222 (Event.Define): Register the private field of the event with the
22223 TypeManager so that GetFieldFromEvent can get at it.
22225 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
22226 keep track of the private field associated with an event which
22229 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
22232 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
22234 2002-07-10 Miguel de Icaza <miguel@ximian.com>
22236 * expression.cs (Binary.EmitBranchable): this routine emits the
22237 Binary expression in a branchable context. This basically means:
22238 we need to branch somewhere, not just get the value on the stack.
22240 This works together with Statement.EmitBoolExpression.
22242 * statement.cs (Statement.EmitBoolExpression): Use
22245 2002-07-09 Miguel de Icaza <miguel@ximian.com>
22247 * statement.cs (For): Reduce the number of jumps in loops.
22249 (For): Implement loop inversion for the For statement.
22251 (Break): We can be breaking out of a Try/Catch controlled section
22252 (foreach might have an implicit try/catch clause), so we need to
22253 use Leave instead of Br.
22255 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
22256 now). If the instace expression supports IMemoryLocation, we use
22257 the AddressOf method from the IMemoryLocation to extract the
22258 address instead of emitting the instance.
22260 This showed up with `This', as we were emitting the instance
22261 always (Emit) instead of the Address of This. Particularly
22262 interesting when This is a value type, as we dont want the Emit
22263 effect (which was to load the object).
22265 2002-07-08 Miguel de Icaza <miguel@ximian.com>
22267 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
22269 * statement.cs (Checked): Set the CheckedState during the resolve
22270 process too, as the ConvCast operations track the checked state on
22271 the resolve process, and not emit.
22273 * cs-parser.jay (namespace_member_declaration): Flag that we have
22274 found a declaration when we do. This is used to flag error 1529
22276 * driver.cs: Report ok when we display the help only.
22278 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
22280 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
22282 2002-07-04 Miguel de Icaza <miguel@ximian.com>
22284 * cs-tokenizer.cs (define): We also have to track locally the
22285 defines. AllDefines is just used for the Conditional Attribute,
22286 but we also need the local defines for the current source code.
22288 2002-07-03 Miguel de Icaza <miguel@ximian.com>
22290 * statement.cs (While, For, Do): These loops can exit through a
22291 Break statement, use this information to tell whether the
22292 statement is the last piece of code.
22294 (Break): Flag that we break.
22296 * codegen.cs (EmitContexts): New `Breaks' state variable.
22298 2002-07-03 Martin Baulig <martin@gnome.org>
22300 * class.cs (TypeContainer.MethodModifiersValid): Allow override
22301 modifiers in method declarations in structs. Otherwise, you won't
22302 be able to override things like Object.Equals().
22304 2002-07-02 Miguel de Icaza <miguel@ximian.com>
22306 * class.cs (Method, Property, Indexer): Do not allow the public
22307 modifier to be used in explicit interface implementations.
22309 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
22310 override modifiers in method declarations in structs
22312 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
22314 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
22315 integer or real overflow, report an error
22317 2002-07-02 Martin Baulig <martin@gnome.org>
22319 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
22320 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
22321 to tell the runtime about our newly created System.Object and
22322 System.ValueType types.
22324 2002-07-02 Miguel de Icaza <miguel@ximian.com>
22326 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
22327 struct instead of Ldarg/Starg.
22329 2002-07-02 Martin Baulig <martin@gnome.org>
22331 * expression.cs (Indirection.Indirection): Call
22332 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
22334 2002-07-02 Martin Baulig <martin@gnome.org>
22336 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
22337 ValueType, call TypeManager.TypeToCoreType() on it.
22338 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
22339 the OpCodes.Newarr argument.
22341 2002-07-02 Martin Baulig <martin@gnome.org>
22343 * expression.cs (Invocation.EmitCall): When compiling corlib,
22344 replace all calls to the system's System.Array type to calls to
22345 the newly created one.
22347 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
22348 System.Array methods.
22349 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
22350 from the system's System.Array type which must be replaced.
22352 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
22354 * typemanager.cs: load unverifiable_code_ctor so we can build
22355 corlib using the correct type. Avoid using GetTypeCode() with
22357 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
22358 TypeManager.object_type to allow building corlib.
22360 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
22362 * ecore.cs: handle System.Enum separately in LoadFromPtr().
22364 2002-07-01 Martin Baulig <martin@gnome.org>
22366 * class.cs: Make the last change actually work, we need to check
22367 whether `ifaces != null' to avoid a crash.
22369 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
22371 * class.cs: when we build structs without fields that implement
22372 interfaces, we need to add the interfaces separately, since there is
22373 no API to both set the size and add the interfaces at type creation
22376 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
22378 * expression.cs: the dimension arguments to the array constructors
22379 need to be converted if they are a long.
22381 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
22383 * class.cs: don't emit ldarg.0 if there is no parent constructor
22384 (fixes showstopper for corlib).
22386 2002-06-29 Martin Baulig <martin@gnome.org>
22388 MCS now compiles corlib on GNU/Linux :-)
22390 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
22391 ie. check for MethodImplOptions.InternalCall.
22393 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
22394 and TypeManager.attribute_type are null, so we must explicitly check
22395 whether parent is not null to find out whether it's an attribute type.
22396 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
22397 and SetBuilder, not only if the property is neither abstract nor external.
22398 This is necessary to set the MethodImplOptions on the accessor methods.
22399 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
22400 SetBuilder, see Property.Emit().
22402 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
22403 populate "System.Object", "System.ValueType" and "System.Attribute" since
22404 they've already been populated from BootCorlib_PopulateCoreTypes().
22406 2002-06-29 Martin Baulig <martin@gnome.org>
22408 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
22409 is the NullLiteral, we also need to make sure that target_type is not
22412 2002-06-29 Martin Baulig <martin@gnome.org>
22414 * rootcontext.cs (RootContext.ResolveCore): We must initialize
22415 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
22416 before calling BootstrapCorlib_ResolveDelegate ().
22418 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22420 * statement.cs: fixed build-breaker. All tests passed ok.
22422 2002-06-27 Martin Baulig <martin@gnome.org>
22424 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
22425 for System.Decimal when compiling corlib.
22427 2002-06-27 Martin Baulig <martin@gnome.org>
22429 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
22430 switch blocks which contain nothing but a default clause.
22432 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
22434 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
22436 2002-06-27 Martin Baulig <martin@gnome.org>
22438 * ecore.cs (PropertyExpr.PropertyExpr): Call
22439 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
22441 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
22442 is already a TypeBuilder.
22444 2002-06-27 Martin Baulig <martin@gnome.org>
22446 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
22447 `target_type == TypeManager.array_type', not IsAssignableFrom() in
22448 the "from an array-type to System.Array" case. This makes it work
22449 when compiling corlib.
22451 2002-06-27 Martin Baulig <martin@gnome.org>
22453 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
22454 non-static PropertyExpr, set its InstanceExpression. This makes
22455 the `ICollection.Count' property work in System/Array.cs.
22457 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
22459 * driver.cs: Made error handling more consistent. Errors now
22460 tracked by Report class, so many methods which used to return int
22461 now return void. Main() now prints success/failure and
22462 errors/warnings message.
22464 Renamed '--probe' compiler argument to '--expect-error'. Removed
22465 the magic number return values (123 and 124). Now, if the
22466 expected error occurs, the compiler exits with success (exit value
22467 0). If the compilation completes without seeing that particular
22468 error, the compiler exits with failure (exit value 1). The
22469 makefile in mcs/errors has been changed to handle the new behaviour.
22471 * report.cs: Made 'expected error' number a property and renamed
22472 it from 'Probe' to 'ExpectedError'.
22474 * genericparser.cs: Removed error handling support, since it is
22475 now all done by Report class.
22477 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
22478 class, so parse() no longer returns an int.
22480 * namespace.cs: Use Report.Error instead of GenericParser.error
22482 2002-06-22 Miguel de Icaza <miguel@ximian.com>
22484 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
22485 TypeContainer.AddOperator): At the front of the list put the
22486 explicit implementations, so they get resolved/defined first.
22488 2002-06-21 Miguel de Icaza <miguel@ximian.com>
22490 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
22491 interface type is implemented by this TypeContainer. Used during
22492 explicit interface implementation.
22494 (Property.Define, Indexer.Define, Method.Define): Validate that
22495 the given interface in the explicit implementation is one of the
22496 base classes for the containing type.
22498 Also if we are explicitly implementing an interface, but there is
22499 no match in the pending implementation table, report an error.
22501 (Property.Define): Only define the property if we are
22502 not explicitly implementing a property from an interface. Use the
22503 correct name also for those properties (the same CSC uses,
22504 although that is really not needed).
22506 (Property.Emit): Do not emit attributes for explicitly implemented
22507 properties, as there is no TypeBuilder.
22509 (Indexer.Emit): ditto.
22511 Hiding then means that we do not really *implement* a pending
22512 implementation, which makes code fail.
22514 2002-06-22 Martin Baulig <martin@gnome.org>
22516 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
22517 the return value of Object.GetType(). [FIXME: we need to do this whenever
22518 we get a type back from the reflection library].
22520 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
22522 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
22524 2002-06-20 Miguel de Icaza <miguel@ximian.com>
22526 * attribute.cs: Return null if we can not look up the type.
22528 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
22529 the interface types found.
22531 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
22532 interface types found.
22534 * typemanager.cs (GetInterfaces): Make this routine returns alll
22535 the interfaces and work around the lame differences between
22536 System.Type and System.Reflection.Emit.TypeBuilder in the results
22537 result for GetInterfaces.
22539 (ExpandInterfaces): Given an array of interface types, expand and
22540 eliminate repeated ocurrences of an interface. This expands in
22541 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
22544 2002-06-21 Martin Baulig <martin@gnome.org>
22546 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
22549 2002-06-21 Martin Baulig <martin@gnome.org>
22551 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
22552 and called with one of the core types, return the corresponding typebuilder for
22555 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
22558 2002-06-21 Martin Baulig <martin@gnome.org>
22560 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
22561 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
22562 (Expression.ConvertReferenceExplicit): Likewise.
22564 * expression.cs (ElementAccess.DoResolve): Likewise.
22565 (ElementAccess.DoResolveLValue): Likewise.
22567 2002-06-10 Martin Baulig <martin@gnome.org>
22569 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
22570 add the "value" parameter to the parameter list.
22572 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
22575 2002-06-19 Miguel de Icaza <miguel@ximian.com>
22577 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
22578 the argument to an int, uint, long or ulong, per the spec. Also
22579 catch negative constants in array creation.
22581 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
22583 * class.cs: do not allow the same interface to appear twice in
22584 the definition list.
22586 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
22588 * ecore.cs: don't use ldlen with System.Array.
22590 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
22592 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
22594 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
22596 * modifiers.cs: produce correct field attributes for protected
22597 internal. Easy fix so miguel can work on ther harder stuff:-)
22599 2002-06-18 Miguel de Icaza <miguel@ximian.com>
22601 * pending.cs: New file. Move the code from class.cs here.
22602 Support clearning the pending flag for all methods (when not doing
22603 explicit interface implementation).
22605 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
22607 * rootcontext.cs: added a couple more types needed to bootstrap.
22609 2002-06-17 Miguel de Icaza <miguel@ximian.com>
22611 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
22612 constructor in the type, instead of any constructor in the type
22613 hierarchy. Thanks to Paolo for finding this bug (it showed up as
22614 a bug in the Mono runtime when applying the params attribute).
22616 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
22617 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
22619 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
22621 * expression.cs (Unary.ResolveOperator): Use TypeManager
22622 to resolve the type.
22624 2002-06-13 Ravi Pratap <ravi@ximian.com>
22626 * cs-parser.jay (enum_member_declaration): Pass in the attributes
22629 * enum.cs (AddEnumMember): Add support to store the attributes associated
22630 with each member too.
22632 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
22633 field builders too - this takes care of the enum member case.
22635 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
22637 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
22638 address-of operator on both value types and pointers.
22640 2002-06-10 Martin Baulig <martin@gnome.org>
22642 * interface.cs (Interface.PopulateIndexer): Add the indexer's
22643 PropertyBuilder to the `property_builders' list.
22645 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
22646 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
22647 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
22648 find any indexers which are inherited from an interface.
22650 2002-06-09 Martin Baulig <martin@gnome.org>
22652 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
22653 the same type as the constant if necessary. There's also a test-130.cs
22656 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
22658 * typemanager.cs (TypeManager.ChangeType): Previously known as
22659 Enum.ChangeEnumType().
22661 2002-06-09 Martin Baulig <martin@gnome.org>
22663 * expression.cs (Cast.TryReduce): Added support for consts.
22665 2002-06-08 Ravi Pratap <ravi@ximian.com>
22667 * class.cs (Accessor): Hold attributes information so we can pass
22670 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
22671 Modify to pass in attributes attached to the methods.
22673 (add_accessor_declaration, remove_accessor_declaration): Ditto.
22675 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
22676 to handle the Accessor kind :-)
22678 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
22680 2002-06-08 Martin Baulig <martin@gnome.org>
22682 * expression.cs (Unary.TryReduceNegative): Added support for
22685 2002-06-08 Martin Baulig <martin@gnome.org>
22687 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
22688 name can't be found in the `defined_names' - the caller will do a
22689 MemberLookup in this case and thus find methods in System.Enum
22690 such as Enum.IsDefined().
22692 2002-06-08 Martin Baulig <martin@gnome.org>
22694 * enum.cs (Enum.ChangeEnumType): This is a custom version of
22695 Convert.ChangeType() which works with TypeBuilder created types.
22696 (Enum.LookupEnumValue, Enum.Define): Use it here.
22698 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
22699 `TypeBuilder.BaseType != null' check.
22700 (TypeContainer.FindMembers): Only lookup parent members if we
22701 actually have a parent.
22702 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
22703 (ConstructorInitializer.Resolve): Likewise.
22705 * interface.cs (Interface.FindMembers): Added
22706 `TypeBuilder.BaseType != null' check.
22708 * rootcontext.cs (RootContext.ResolveCore): Added
22709 "System.Runtime.CompilerServices.IndexerNameAttribute" to
22710 classes_second_stage.
22712 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
22713 debug_type and trace_type when compiling with --nostdlib.
22715 2002-06-07 Martin Baulig <martin@gnome.org>
22717 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
22718 (AddField): Set it to true when adding a non-static field.
22719 (DefineType): Use `have_nonstatic_fields' to find out whether we
22720 have non-static fields, not `Fields != null'.
22722 2002-06-02 Miguel de Icaza <miguel@ximian.com>
22724 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
22725 dereferencing a null on the static-field code path)
22727 2002-05-30 Martin Baulig <martin@gnome.org>
22729 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
22730 to take command line arguments. Use reflection to call the new
22731 custom `Initialize' function on the symbol writer and pass it the
22732 command line arguments.
22734 * driver.cs (--debug-args): New command line argument to pass command
22735 line arguments to the symbol writer.
22737 2002-05-28 Miguel de Icaza <miguel@ximian.com>
22739 * assign.cs (DoResolve): Forgot to do the implicit conversion to
22740 the target type for indexers and properties. Thanks to Joe for
22743 2002-05-27 Miguel de Icaza <miguel@ximian.com>
22745 * typemanager.cs (MethodFlags): returns the method flags
22746 (Obsolete/ShouldIgnore) that control warning emission and whether
22747 the invocation should be made, or ignored.
22749 * expression.cs (Invocation.Emit): Remove previous hack, we should
22750 not do this on matching a base type, we should do this based on an attribute
22752 Only emit calls to System.Diagnostics.Debug and
22753 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
22754 on the command line.
22756 * rootcontext.cs: Global settings for tracing and debugging.
22758 * cs-tokenizer.cs (define): New utility function to track
22759 defines. Set the global settings for TRACE and DEBUG if found.
22761 2002-05-25 Ravi Pratap <ravi@ximian.com>
22763 * interface.cs (Populate*): Pass in the TypeContainer as well as
22764 the DeclSpace as parameters so that we can create EmitContexts and
22765 then use that to apply attributes etc.
22767 (PopulateMethod, PopulateEvent, PopulateProperty)
22768 (PopulateIndexer): Apply attributes everywhere.
22770 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
22773 (ApplyAttributes): Update accordingly.
22775 We now apply interface attributes for all members too.
22777 2002-05-26 Miguel de Icaza <miguel@ximian.com>
22779 * class.cs (Indexer.Define); Correctly check if we are explicit
22780 implementation (instead of checking the Name for a ".", we
22781 directly look up if the InterfaceType was specified).
22783 Delay the creation of the PropertyBuilder.
22785 Only create the PropertyBuilder if we are not an explicit
22786 interface implementation. This means that explicit interface
22787 implementation members do not participate in regular function
22788 lookups, and hence fixes another major ambiguity problem in
22789 overload resolution (that was the visible effect).
22791 (DefineMethod): Return whether we are doing an interface
22794 * typemanager.cs: Temporary hack until we get attributes in
22795 interfaces (Ravi is working on that) and we get IndexerName
22796 support in interfaces.
22798 * interface.cs: Register the indexers as properties.
22800 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
22801 warning, I have verified that this is a bug in the .NET runtime
22802 (JavaScript suffers of the same problem).
22804 * typemanager.cs (MemberLookup): When looking up members for
22805 interfaces, the parent of an interface is the implicit
22806 System.Object (so we succeed in searches of Object methods in an
22807 interface method invocation. Example: IEnumerable x; x.ToString
22810 2002-05-25 Miguel de Icaza <miguel@ximian.com>
22812 * class.cs (Event): Events should also register if they do
22813 implement the methods that an interface requires.
22815 * typemanager.cs (MemberLookup); use the new GetInterfaces
22818 (GetInterfaces): The code used to lookup interfaces for a type is
22819 used in more than one place, factor it here.
22821 * driver.cs: Track the errors at the bottom of the file, we kept
22824 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
22825 instance if the method we are calling is static!
22827 2002-05-24 Miguel de Icaza <miguel@ximian.com>
22829 * attribute.cs (ApplyAttributes): Make this function filter out
22830 the IndexerName attribute (as that attribute in reality is never
22831 applied) and return the string constant for the IndexerName
22834 * class.cs (TypeContainer.Emit): Validate that all the indexers
22835 have the same IndexerName attribute, and if so, set the
22836 DefaultName attribute on the class.
22838 * typemanager.cs: The return value might contain other stuff (not
22839 only methods). For instance, consider a method with an "Item"
22840 property and an Item method.
22842 * class.cs: If there is a problem with the parameter types,
22845 2002-05-24 Ravi Pratap <ravi@ximian.com>
22847 * ecore.cs (ImplicitConversionExists): Wrapper function which also
22848 looks at user defined conversion after making a call to
22849 StandardConversionExists - we need this for overload resolution.
22851 * expression.cs : Update accordingly the various method calls.
22853 This fixes 2 bugs filed against implicit user defined conversions
22855 2002-05-22 Miguel de Icaza <miguel@ximian.com>
22857 * statement.cs: Track the result of the assignment.
22859 2002-05-21 Miguel de Icaza <miguel@ximian.com>
22861 * expression.cs (MemberAccess): Improved error reporting for
22862 inaccessible members.
22864 2002-05-22 Martin Baulig <martin@gnome.org>
22866 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
22867 itself with debugging support.
22869 2002-05-22 Martin Baulig <martin@gnome.org>
22871 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
22872 Removed, this isn't needed anymore.
22874 2002-05-20 Martin Baulig <martin@gnome.org>
22876 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
22877 be underlying type for an enum.
22879 2002-05-20 Miguel de Icaza <miguel@ximian.com>
22881 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
22882 that splits out the loading of just the core types.
22884 * rootcontext.cs (ResolveCore): Split the struct resolution in
22885 two, so we can load the enumeration underlying types before any
22888 * expression.cs (Is): Bandaid until we fix properly Switch (see
22889 bug #24985 for details).
22891 * typemanager.cs (ImplementsInterface): The hashtable will contain
22892 a null if there are no interfaces implemented.
22894 2002-05-18 Miguel de Icaza <miguel@ximian.com>
22896 * cs-parser.jay (indexer_declarator): It is fine to have array
22899 2002-05-17 Miguel de Icaza <miguel@ximian.com>
22901 * typemanager.cs: (RegisterBuilder): New function used to register
22902 TypeBuilders that implement interfaces. Since
22903 TypeBuilder.GetInterfaces (as usual) does not work with lame
22905 (AddUserType): register interfaces.
22907 (ImplementsInterface): Use the builder_to_ifaces hash if we are
22908 dealing with TypeBuilder. Also, arrays are showing up as
22909 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
22910 methods can not be invoked on them!
22912 * ecore.cs (ExplicitReferenceConversionExists): Made public.
22913 (ImplicitReferenceConversionExists): Split out from
22914 StandardConversionExists.
22916 * expression.cs (As): We were only implementing one of the three
22917 cases for the as operator. We now implement them all.
22918 (Is): Implement the various other cases for Is as well.
22920 * typemanager.cs (CACHE): New define used to control if we want or
22921 not the FindMembers cache. Seems to have a negative impact on
22922 performance currently
22924 (MemberLookup): Nested types have full acess to
22925 enclosing type members
22927 Remove code that coped with instance/static returns for events, we
22928 now catch this in RealFindMembers.
22930 (RealFindMembers): only perform static lookup if the instance
22931 lookup did not return a type or an event.
22933 2002-05-17 Miguel de Icaza <miguel@ximian.com>
22935 * assign.cs (CompoundAssign): We pass more semantic information
22936 now to Compound Assignments than we did before: now we have all
22937 the information at hand, and now we resolve the target *before* we
22938 do the expression expansion, which allows the "CacheValue" method
22939 to have the effect we intended (before, a [x] += 1 would generate
22940 two differen ArrayAccess expressions from the ElementAccess,
22941 during the resolution process).
22943 (CompoundAssign.DoResolve): Resolve target and original_source here.
22945 2002-05-16 Miguel de Icaza <miguel@ximian.com>
22947 * expression.cs (ArrayAccess): dropped debugging information.
22949 * typemanager.cs: Small bug fix: I was always returning i_members,
22950 instead of one of i_members or s_members (depending on which had
22953 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
22954 method is invoked before any code generation takes place, and it
22955 is a mechanism to inform that the expression will be invoked more
22956 than once, and that the method should use temporary values to
22957 avoid having side effects
22959 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
22961 * ecore.cs (Expression.CacheTemporaries): Provide empty default
22964 * expression.cs (Indirection, ArrayAccess): Add support for
22965 CacheTemporaries in these two bad boys.
22967 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
22968 ldobj or ldind_ref.
22969 (StoreFromPtr): Handle stobj as well.
22971 * expression.cs (UnaryMutator): Share more code.
22973 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
22974 down: I was not tracking the Filter function as well, which
22975 was affecting the results of the cache.
22977 2002-05-15 Miguel de Icaza <miguel@ximian.com>
22979 * attribute.cs: Remove the hack to handle the CharSet property on
22982 2002-05-14 Miguel de Icaza <miguel@ximian.com>
22984 * attribute.cs (DoResolve): More uglyness, we now only try to
22985 resolve the attribute partially, to extract the CharSet
22986 information (only if we are a StructLayout attribute). Otherwise
22988 (GetExtraTypeInfo): Add some code to conditionally kill in the
22989 future this. I am more and more convinced that the .NET
22990 framework has special code to handle the attribute setting on
22993 * expression.cs (IsParamsMethodApplicable): Revert my previous
22994 foreach change here, it was wrong.
22996 2002-05-13 Miguel de Icaza <miguel@ximian.com>
22998 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
22999 (pp_expr): do not abort on unknown input, just return.
23000 (eval): abort if there are pending chars.
23002 * attribute.cs (Attribute.Resolve): Positional parameters are
23003 optional. Deal with that case.
23005 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
23006 the Ansi/Unicode/Auto information for the type.
23008 (TypeContainer.DefineType): instantiate the EmitContext here, as
23009 we will be using it during the type definition (to resolve
23010 attributes) and during the emit phase.
23012 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
23013 to pull type information out of the attributes
23015 (Attribute.Resolve): track the constructor builder, and allow for
23016 multiple invocations (structs and classes will use this).
23018 * ecore.cs (MemberLookupFinal): new version with all the
23019 parameters customizable.
23021 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
23022 constructors. Return if the result value is null (as the error
23023 would have been flagged already by MemberLookupFinal)
23025 Do not allow instances of abstract classes or interfaces to be
23028 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
23029 We have to compare the assembly property here when dealing with
23030 FamANDAssem and Assembly access modifiers, because we might be
23031 creating an assembly from *modules* (that means that we are not
23032 getting TypeBuilders for types defined in other modules that are
23033 part of this assembly).
23035 (Method.Emit): If the method is marked abstract and has a body,
23038 (TypeContainer.DefineMembers): If both the defined member and the
23039 parent name match are methods, then do not emit any warnings: let
23040 the Method.Define routine take care of flagging warnings. But if
23041 there is a mismatch (method overrides something else, or method is
23042 overriwritten by something, then emit warning).
23044 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
23045 set to null, this means `do not check for the return type on the
23048 (Method.Define): set the return type for the method signature to
23049 null, so that we get methods with the same name and parameters and
23050 different return types. This is used to flag warning 114 (you are
23051 hiding a method, and you probably want to use the new/override
23054 * typemanager.cs (MemberLookup): Implemented proper access
23055 control, closing a long standing set of bug reports. The problem
23056 was that the Framework only has two bits: Public and NonPublic,
23057 and NonPublic includes private and protected methods, but we need
23058 to enforce the FamANDAssem, FamOrAssem and Family.
23060 2002-05-11 Miguel de Icaza <miguel@ximian.com>
23062 * statement.cs (GotoCase): Return true: Ammounts to giving up
23063 knowledge on whether we return or not, and letting the other case
23064 be responsible for it.
23066 2002-05-10 Miguel de Icaza <miguel@ximian.com>
23068 * driver.cs: Do not load directories for each file processed, only
23069 do it if there is a pattern.
23071 * ecore.cs: Report readonly assigns here as well, as we might have
23072 been resolved only by MemberAccess.
23074 (SimpleName.SimpleNameResolve): Also be useful for LValue
23075 resolution. We need this to propagate assign to local readonly variables
23077 * typemanager.cs: Use a ptrhashtable for the criteria, because we
23078 do not want to reuse potential criteria memory.
23080 * class.cs (MyEventBuilder): Set reflected_type;
23082 * ecore.cs (Constantify): Added support for constifying bools.
23084 (RootContext.LookupType): Added a cache for values looked up in
23085 the declaration space.
23087 * typemanager.cs (FindMembers): Now is a front-end to
23088 RealFindMembers, and provides a two-level hashtable-based cache to
23091 15% performance improvement: from 22.5 to 19.2 seconds.
23093 * expression.cs (IsParamsMethodApplicable): use foreach.
23094 (Invocation.DoResolve): ditto.
23095 (New.DoResolve): ditto.
23096 (ArrayCreation.DoResolve): ditto.
23098 * ecore.cs (FindMostEncompassingType): use foreach.
23100 * delegate.cs (NewDelegate.DoResolve): Use foreach
23102 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
23103 (RemoveMethods): use foreach.
23105 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
23106 nested foreach statements instead of for, and also break out of
23107 the inner loop once a match is found.
23109 (Invocation.OverloadResolve): Use foreach, simplify the code.
23111 2002-05-08 Miguel de Icaza <miguel@ximian.com>
23113 * cfold.cs (BinaryFold): During an enumeration evaluation context,
23114 we actually unwrap the expression to allow for extra information
23117 * expression.cs: Use Shr_Un on unsigned operations.
23119 2002-05-08 Ravi Pratap <ravi@ximian.com>
23121 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
23122 applicable operators was not being considered correctly. This closes
23123 the bug Miguel reported.
23125 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
23127 * attribute.cs: check that the type derives from System.Attribute
23128 and report the correct error in that case (moved the duplicate code to
23129 its own method, too).
23131 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
23133 * attribute.cs: lookup attribute type name as the spec says: first the
23134 bare attribute name and then name + "Attribute" (nant compiles with
23135 mcs after this fix).
23137 2002-05-07 Miguel de Icaza <miguel@ximian.com>
23139 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
23140 Because of the way we parse things, we should try to see if a
23141 UIntConstant can fit in an integer.
23143 2002-05-07 Ravi Pratap <ravi@ximian.com>
23145 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
23146 when we are in an explicit context.
23148 (ConvertReferenceExplicit): When converting from Iface type S to Class
23149 T make sure the rules are implemented as an OR.
23151 * parameter.cs (ParameterType): Make it a property for now although the
23152 purpose really isn't anything immediate.
23154 * expression.cs (Is*Applicable): Do better checking on the parameter type
23155 of a ref/out parameter. The ones from the system assemblies are already
23156 marked with the correct type so we don't need to do any correction.
23158 * ecore.cs (StandardConversionExists): Conversion from Interface types to
23159 the object type is standard too so include that.
23161 2002-05-06 Miguel de Icaza <miguel@ximian.com>
23163 * ecore.cs (StandardConversionExists): Augment with missing code:
23164 deal with IntConstant, LongConstants and Enumerations.
23166 * assign.cs: Report the error, instead of failing silently
23168 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
23169 typecontainer that they are declared, because the
23170 typecontainer/namespace will have the list of using clauses that
23171 need to be applied.
23173 Assembly Attributes were escaping the normal registration
23176 (EmitCode): Apply attributes within an EmitContext that represents
23177 the container they were declared on.
23179 * cs-parser.jay: Track bases for structs. How did I get this wrong?
23181 2002-05-06 Ravi Pratap <ravi@ximian.com>
23183 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
23184 Revamp completely - make much cleaner as we now operate only
23187 (FindMostSpecificSource, FindMostSpecificTarget): New methods
23188 to implement the logic detailed in the spec more correctly.
23190 (UserDefinedConversion): Update accordingly.
23192 2002-05-06 Miguel de Icaza <miguel@ximian.com>
23194 * statement.cs: Return flow analysis information up.
23196 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
23199 (token): Do not consume an extra character before calling
23202 2002-05-06 Piers Haken <piersh@friskit.com>
23204 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
23206 2002-05-06 Miguel de Icaza <miguel@ximian.com>
23208 * class.cs (Constructor.Emit): Set the IsStatic flag in the
23209 EmitContext during the instance constructor initializer
23210 resolution, to stop access to instance variables.
23212 This is mandated by the spec, last paragraph of the `constructor
23213 initializers' section.
23215 2002-05-05 Miguel de Icaza <miguel@ximian.com>
23217 * cs-parser.jay, class.cs (Accessor): new class used to represent
23218 an accessor (get or set). In the past we used `null' to represent
23219 a missing accessor. But this is ambiguous because there was no
23220 way to tell in abstract indexers/properties if one of them was
23223 Now there is a way of addressing that.
23225 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
23226 instead of FindMembers.
23228 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
23229 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
23231 * attribute.cs: Treat indexers and properties as the same in terms
23232 of applying attributes
23234 * ecore.cs (FindMostEncompassedType): Use statically initialized
23235 EmptyExpressions()s like we do elsewhere to avoid creating useless
23236 objects (and we take this out of the tight loop).
23238 (GetConversionOperators): Move the code to extract the actual
23239 operators to a separate routine to clean things up.
23241 2002-05-04 Miguel de Icaza <miguel@ximian.com>
23243 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
23244 events are always registered FieldBuilders.
23246 * class.cs (FieldBase): New class shared by Fields
23248 * delegate.cs: If we are a toplevel delegate, use our full name.
23249 If we are a nested delegate, then only use our tail name.
23251 2002-05-02 Ravi Pratap <ravi@ximian.com>
23253 * expression.cs (IsApplicable): Ensure that we add the "&" to
23254 ref/out types before comparing it with the type of the argument.
23256 (IsParamsMethodApplicable): Ditto.
23258 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
23261 * delegate.cs : Handle the case when we have more than one applicable
23262 method. Flag an error only when we finish checking all.
23264 2002-05-02 Miguel de Icaza <miguel@ximian.com>
23266 * expression.cs: Add support for boolean static initializers.
23268 2002-05-01 Miguel de Icaza <miguel@ximian.com>
23270 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
23272 * parameter.cs (ComputeParameterTypes,
23273 ComputeAndDefineParameterTypes): Better error handling: now we
23274 clear the `types' cache if we fail during any of the type lookups.
23275 We also return the status code correctly to our caller
23277 * delegate.cs: If we fail to define a delegate, abort the extra
23280 * expression.cs (Binary.ResolveOperator): for
23281 operator==(object,object) and operator !=(object, object) we also
23282 have to verify that there is an implicit conversion from one to
23285 (ArrayAccess.DoResolve): Array Access can operate on
23288 2002-04-30 Miguel de Icaza <miguel@ximian.com>
23290 * assign.cs (CompoundAssign): A new class used as a "flag" that
23291 the assignment actually is happening as part of a compound
23292 assignment operator.
23294 During compound assignment, a few new rules exist to enable things
23301 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
23302 to the type of x) if y is implicitly convertible to the type of x,
23303 and the operator is a builtin operator and the return type of the
23304 operator is explicitly convertible to the type of x.
23306 * rootcontext.cs: Reset warning level to 2. 4 catches various
23307 "interesting" features in mcs, we must clean this up at some
23308 point, but currently am trying to kill other bugs ;-)
23310 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
23311 in container classes as well.
23313 * expression.cs (Binary.ResolveOperator): Handle string case
23314 before anything else (as operator overloading does emit an error
23315 before doing anything else).
23317 This code could go away when we move to a table driven model, but
23318 i could not come up with a good plan last night.
23320 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
23322 * typemanager.cs (CSharpName): reimplementation using regex.
23323 * class.cs: added null check for fields in Emit
23324 * rootcontext.cs: set warninglevel to 4
23326 2002-04-29 Miguel de Icaza <miguel@ximian.com>
23328 * typemanager.cs (CSharpName): reimplemented with Lupus
23331 2002-04-28 Miguel de Icaza <miguel@ximian.com>
23333 * statement.cs (If): correclty implement Resolve, because we were
23334 not catching sem errors in there. The same process is needed
23336 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
23339 (Statement.Warning_DeadCodeFound): Factorize code.
23340 (While): Report dead code here too.
23342 (Statement): Added Resolve virtual method to allow
23343 for resolution split from the emit code.
23345 2002-04-26 Miguel de Icaza <miguel@ximian.com>
23347 * statement.cs (EmitBoolExpression): No longer try to resolve the
23349 (MakeBoolean): New utility function that resolve, implicitly
23350 converts to boolean and tags the expression.
23353 (If, Do): Implement dead code elimination.
23354 (While): Implement loop inversion
23356 (Do, While, For, If): Resolve the expression prior to calling our
23359 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
23362 - added method Report28 (warning: program has more than one entry point)
23363 - added method IsEntryPoint, implements paragraph 10.1 of the spec
23364 - modified method Method.Define, the part at the end of the method
23366 * rootcontext.cs: added static public Location EntryPointLocation;
23368 * ../errors/cs0028.cs : Add test case for the above warning.
23371 - modified method CSharpName to allow arrays of primitive type to
23372 be printed nicely (e.g. instead of System.Int32[][] it now prints
23374 - added method CSharpSignature: returns the signature of a method
23375 in string format to be used in reporting errors, warnings, etc.
23377 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
23380 2002-04-26 Ravi Pratap <ravi@ximian.com>
23382 * delegate.cs (Define): Fix extremely silly bug where I was
23383 setting the type of the 'object' parameter of the BeginInvoke
23384 method to System.IAsyncResult instead of System.Object ;-)
23386 2002-04-26 Miguel de Icaza <miguel@ximian.com>
23388 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
23391 (Constructor.Emit): return if we fail to initialize the
23392 constructor. Another door closed!
23394 * expression.cs (New.DoResolve): Improve error message (from -6 to
23395 1501). Use DeclaredOnly lookup to find the exact constructor.
23397 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
23398 loop. This is useful.
23400 * cs-parser.jay: Adjust the default parameters so that destructors
23401 have the proper signature.
23403 2002-04-26 Martin Baulig <martin@gnome.org>
23405 * driver.cs (LoadAssembly): If `assembly' contains any characters
23406 which are only valid in path names and not in assembly names
23407 (currently slash, backslash and point), use Assembly.LoadFrom ()
23408 instead of Assembly.Load () on the `assembly' (before iteration
23409 over the link_paths).
23411 2002-04-26 Martin Baulig <martin@gnome.org>
23413 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
23415 2002-04-25 Miguel de Icaza <miguel@ximian.com>
23417 * class.cs (Property): use the new typemanager.MemberLookup
23419 (TypeContainer.MemberLookup): Implement using the
23420 TypeManager.MemberLookup now.
23422 * typemanager.cs: Make MemberLookup a function of the TypeManager,
23423 and return MemberInfos, so that these can be used without an
23424 EmitContext (what we had before).
23426 2002-04-24 Miguel de Icaza <miguel@ximian.com>
23428 * expression.cs: Fix the case where the argument to params if the
23429 type of the params. I omitted handling this before. Fixed
23431 2002-04-22 Miguel de Icaza <miguel@ximian.com>
23433 * driver.cs: Call BootCorlib_PopulateCoreType
23435 * class.cs (Property.CheckBase): Check for properties only, not
23438 * interface.cs: Temporary hack: try/catch around the
23439 CustomAttributeBuilder, because I am getting an exception that I
23442 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
23443 types whose definitions are required to be there (attributes are
23444 defined before standard types).
23446 Compute definitions as we boot the various types, as they are used
23447 immediately (value_type class will need object_type, but if we do
23448 not initialize object_type, we will pass a null, which will let
23449 the runtime pick the System.Object from the existing corlib, which
23450 is not what we want).
23452 2002-04-22 Patrik Torstensson <totte@labs2.com>
23454 * cs-tokenizer.cs: fixed a number of trim() issues.
23456 2002-04-22 Ravi Pratap <ravi@ximian.com>
23458 * expression.cs (Argument.Type): Ensure that we return the correct
23459 type when we have out or ref parameters [in which case we
23462 2002-04-22 Miguel de Icaza <miguel@ximian.com>
23464 * class.cs (Property, Indexer): Allow extern modifier in there.
23466 * typemanager.cs (InitBaseTypes): Initializes object_type and
23467 value_type, since those will be used early on during the bootstrap
23468 process to compile corlib.
23470 (InitCoreTypes): Move code from here to InitBaseTypes.
23472 2002-04-21 Miguel de Icaza <miguel@ximian.com>
23474 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
23475 single-dimension arrays as using the ldlen opcode.
23477 Daniel Lewis discovered this optimization.
23479 * typemanager.cs: Add signature for System.Array::get_Length
23481 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23483 * statement.cs: report the error when the foreach does not apply to an
23484 array nor a collection.
23486 2002-04-19 Miguel de Icaza <miguel@ximian.com>
23488 * expression.cs: Add implicit conversions to the operator ~.
23490 * constant.cs (DecimalConstant.Emit): Emit decimal value.
23492 * typemanager.cs: Locate the decimal constructor.
23494 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23496 * attribute.cs: use the new property of TypeOf.
23497 * expression.cs: added 'get' property around typearg.
23499 These changes fix a build breaker reported by NickD. Is this the
23500 correct way to fix? If not, please, revert my changes and make it
23503 2002-04-17 Miguel de Icaza <miguel@ximian.com>
23505 * attribute.cs: Add support for typeof in attribute invocations.
23506 I am not sure that this is right though.
23508 2002-04-14 Duncan Mak <duncan@ximian.com>
23510 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
23511 Binary.Operator.Division case.
23513 2002-04-13 Ravi Pratap <ravi@ximian.com>
23515 * class.cs (DefineType): Ensure that we do a proper check on
23516 attribute types and also register it with the TypeManager.
23518 (TypeContainer.Targets): The default for attribute types is
23519 AttributeTargets.All.
23521 * attribute.cs (ApplyAttributes): Registering the attribute type
23522 is done elsewhere, not when we discover we have a Usage attribute.
23524 2002-04-12 Ravi Pratap <ravi@ximian.com>
23526 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
23527 and get rid of is_delegate parameter.
23529 * everywhere : update.
23531 2002-04-12 Ravi Pratap <ravi@ximian.com>
23533 * cs-parser.jay (compilation_unit): Revamp completely to use
23534 some new ideas that I got from Rhys' grammar to solve the problems
23535 with assembly level attributes.
23537 (outer_declaration): New grammar production.
23539 (attribute_sections): Add.
23541 (opt_attributes): Base on attribute_sections
23543 (namespace_declaration): Allow opt_attributes to tackle the case
23544 when we have assembly level attributes - we are clever in this
23547 * attribute.cs (ApplyAttributes): Do not worry about assembly
23548 attributes in the non-global context.
23550 * rootcontext.cs (AddGlobalAttributes): Go back to using this
23551 instead of SetGlobalAttributes.
23553 * class.cs, rootcontext.cs : Ensure we define and generate
23554 attribute types before anything else.
23556 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
23557 and flag the new error -20 for the case when the attribute type
23558 does not have valid targets specified. csc does not catch this.
23560 * ../errors/errors.txt : update for error # -20
23562 2002-04-11 Ravi Pratap <ravi@ximian.com>
23564 * support.cs (InternalParameters.ParameterModifier): Do some null
23565 checking and return sane values.
23567 * class.cs (Method.Define): If we are a PInvoke method, ensure
23568 that we are static and extern. Report error # 601
23570 * ../errors/cs0601.cs : Add test case for the above error.
23572 2002-04-07 Ravi Pratap <ravi@ximian.com>
23574 * rootcontext.cs (attribute_types): We need to keep type of
23575 all attribute types separately and emit code for them first.
23577 (RegisterAttribute) : Implement.
23579 * class.cs (DefineType): Check if the current Type is a custom
23580 attribute type and register it accordingly.
23582 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
23583 adding the first attribute twice and rename to
23585 (SetGlobalAttributes): this.
23587 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
23590 * attribute.cs (ApplyAttributes): Take an additional argument telling us
23591 if we are processing global arguments. Hmm, I am unsure of this.
23593 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23595 * expression.cs: added static array of strings to avoid calling
23596 Enum.ToString () for Operator in Binary. Significant recover of
23599 2002-04-10 Miguel de Icaza <miguel@ximian.com>
23601 * class.cs (FindMembers): Allow the Builders of the various
23602 members to be null. If they are skip them. This only happens
23603 during the PInvoke declaration.
23605 2002-04-09 Miguel de Icaza <miguel@ximian.com>
23607 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
23608 failure, so we do not keep going afterwards.
23610 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
23611 wanted to pass `false' as the `is_delegate' argument. If this is
23612 the case, why not use delegate_type == null to mean `is_delegate =
23613 false' and anything else as is_delegate = true.
23615 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
23617 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
23618 code for the section, not the beginning of the tests.
23620 2002-04-08 Miguel de Icaza <miguel@ximian.com>
23622 * cfold.cs: Handle operator + (Enum x, Underlying x)
23624 * expression.cs (Binary): same. Warn about errors where we have
23625 Enum/Enum in operator + as well.
23627 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
23630 - added support for switch(bool)
23631 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
23632 - add TableSwitchEmit() to handle table-based switch statements
23634 2002-04-05 Ravi Pratap <ravi@ximian.com>
23636 * expression.cs (Invocation.OverloadResolve): Factor out code which
23637 does parameter compatibility checking with arguments so that we can
23638 re-use the code even from Delegate.VerifyApplicability
23640 (VerifyArgumentsCompat): Move above code here.
23642 * delegate.cs (VerifyApplicability): Get rid of duplicate code
23643 and instead make a call to the above method.
23645 2002-03-31 Ravi Pratap <ravi@ximian.com>
23647 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
23648 We use it to keep track of classes which are attribute types.
23650 2002-04-02 Miguel de Icaza <miguel@ximian.com>
23652 * delegate.cs (Delegate.Define): Correctly define the types in the
23653 presence of fixed and array parameters.
23655 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
23658 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
23659 include NonPublic after the first iteration.
23661 * class.cs (Indexer.CheckBase): Only check if both parents are
23664 * cs-parser.jay (accessor_body): If empty, set to null.
23666 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
23667 same code path here to resolve constants names that we did have in
23668 MemberAccess.DoResolve. There is too much code duplicated here.
23670 2002-04-01 Miguel de Icaza <miguel@ximian.com>
23672 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
23674 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
23677 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
23678 tokens, numbers and strings.
23680 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
23683 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
23684 asyncronous parameters and the regular parameters.
23686 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
23687 specify the target directory.
23689 * expression.cs: (This.DoResolve): Simplify
23690 (As.Emit): Optimize, do not generate IsInst if the expression is
23691 always of the given type.
23693 (Is.DoResolve): Bug fix, we were reporting both always/never for
23696 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
23697 creating too many unnecessary arrays.
23699 2002-03-31 Miguel de Icaza <miguel@ximian.com>
23701 * class.cs (EmitFieldInitializer): Use Assign expression to assign
23702 fields instead of rolling our own initializer. Takes care of all
23703 implicit conversions, and drops unnecessary static checks/argument.
23705 2002-03-31 Dick Porter <dick@ximian.com>
23707 * driver.cs: use the GetDirectories() return values properly, and
23708 use "/" as path separator.
23710 2002-03-30 Miguel de Icaza <miguel@ximian.com>
23712 * expression.cs (Unary): Optimize - - expr into expr.
23713 (Binary): Optimize a + (-b) into a -b.
23715 * codegen.cs (CodeGen): Made all methods static.
23717 2002-03-29 Miguel de Icaza <miguel@ximian.com>
23721 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
23722 TypeBuilder property.
23724 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
23727 * tree.cs: Removed the various RecordXXXX, and replaced with a
23728 single RecordDecl. Removed all the accessor methods, and just
23729 left a single access point Type
23731 * enum.cs: Rename DefineEnum to DefineType.
23733 * decl.cs: New abstract method `DefineType' used to unify the
23734 Defines for Enumerations, Interfaces, TypeContainers and
23737 (FindType): Moved LookupInterfaceOrClass here. Moved the
23738 LookupBaseClasses method that used to live in class.cs and
23739 interface.cs here, and renamed to FindType.
23741 * delegate.cs: Implement DefineType. Take advantage of the
23742 refactored pattern for locating the parent builder without taking
23743 the parent_builder argument (which we know does not work if we are
23744 nested, and triggering a toplevel definition).
23746 2002-03-28 Miguel de Icaza <miguel@ximian.com>
23748 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
23749 accessibility of a member has changed during override and report
23752 * class.cs (Method.Define, Property.Define): Only complain on
23753 overrides if the method is private, any other accessibility is
23754 fine (and since we just checked the permission is the same, we are
23757 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
23758 and elif are processed always. The other pre-processing
23759 directives are only processed if we are "taking" the path
23761 2002-03-29 Martin Baulig <martin@gnome.org>
23763 * class.cs (Method.Emit): Only emit symbolic debugging info if the
23764 current location is not Null.
23766 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
23767 a separate method so we can profile it.
23769 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
23770 `span.Seconds' are just seconds, but no minutes or hours.
23771 (MainDriver): Profile the CodeGen.SaveSymbols calls.
23773 2002-03-28 Miguel de Icaza <miguel@ximian.com>
23775 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
23776 Remove the gratuitous set of Final:
23778 // If an interface implementation, then we can set Final.
23779 if (((flags & MethodAttributes.Abstract) == 0) &&
23780 implementing.DeclaringType.IsInterface)
23781 flags |= MethodAttributes.Final;
23783 I do not know what I was smoking when I used that.
23786 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
23787 step into fixing the name resolution issues for delegates and
23788 unifying the toplevel name resolution.
23790 2002-03-28 Martin Baulig <martin@gnome.org>
23792 * class.cs (Method.Emit): If we have a symbol writer, call its
23793 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
23794 tell it about the current method.
23796 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
23797 writer that we're going to emit the first byte of IL code for a new
23798 statement (a new source line).
23799 (EmitContext.EmitTopBlock): If we have a symbol writer, call
23800 EmitContext.Mark() before emitting any code.
23802 * location.cs (SymbolDocument): Return null when we're Null.
23804 * statement.cs (Statement): Moved the `Location loc' variable here.
23805 (Statement.EmitBoolExpression): If we have a symbol writer, call
23806 ec.Mark() before emitting any code to tell it that we're at the
23807 beginning of a new statement.
23808 (StatementExpression): Added `Location' argument to the constructor.
23809 (Block): Added public readonly variable `StartLocation' and public
23810 variable `EndLocation'. The latter is to be set using SetEndLocation().
23811 (Block): Added constructor which takes a start and end location.
23812 (Block.SetEndLocation): New method. This sets the end location.
23813 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
23814 local variables we create.
23815 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
23816 each statement and do also mark the begin and end of the block.
23818 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
23819 tell it the current lexer.Location, use Location.Null for the end of the
23821 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
23822 current block, set its end location using SetEndLocation().
23823 (statement_expression): StatementExpression constructor now takes the
23824 lexer.Location as additional argument.
23825 (for_statement, declare_local_variables): Likewise.
23826 (declare_local_variables): When creating a new implicit block, use the
23827 new Block constructor and pass it the lexer.Location.
23829 2002-03-28 Miguel de Icaza <miguel@ximian.com>
23831 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
23832 members also on the parent interfaces recursively.
23834 2002-03-27 Miguel de Icaza <miguel@ximian.com>
23836 * report.cs: Use new formats, since Gonzalo finished the missing
23839 * expression.cs (Binary.ResolveOperator): added missing operator|
23840 operator& and operator^ for bool/bool.
23842 * cs-parser.jay: CheckDef now takes a Location argument that is
23843 used to report errors more precisly (instead of reporting the end
23844 of a definition, we try to track something which is a lot closer
23845 to the source of the problem).
23847 * cs-tokenizer.cs: Track global token use, so we can properly flag
23848 the use of #define/#undef after the first token has been seen.
23850 Also, rename the reportXXXX to Error_DescriptiveName
23852 * decl.cs (DeclSpace.IsTopLevel): Move property here from
23853 TypeContainer, so that Enum and Interface can use this too.
23855 * class.cs (TypeContainer.LookupInterfaceOrClass,
23856 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
23857 `builder' argument. Typically this was used to pass the parent
23858 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
23861 The problem is that a nested class could trigger the definition of
23862 a toplevel class, and the builder would be obviously wrong in that
23865 So we drop this argument, and we compute dynamically the
23866 TypeBuilder/ModuleBuilder (the correct information was available
23867 to us anyways from DeclSpace.Parent)
23869 * interface.cs (Interface.DefineInterface): Drop builder
23870 parameter cleanup like class.cs
23872 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
23875 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
23878 (Try.Emit): Propagate the returns value from the statement.
23880 (Return.Emit): Even if we are leavning
23882 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
23884 * modifiers.cs: Fix the computation of MethodAttributes flags.
23886 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
23888 * driver.cs: allow compilation of files that start with '/'.
23889 Add a default case when checking the argument of --target.
23891 2002-03-25 Miguel de Icaza <miguel@ximian.com>
23893 * interface.cs: Implement the same search algorithm for types in
23894 the interface code.
23896 * delegate.cs: Do not allow multiple definition.
23898 * Recovered ChangeLog that got accidentally amputated
23900 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
23902 * rootcontext.cs: Load manually enum to allow core classes to
23903 contain enumerations.
23905 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
23906 Update to new static methods in TypeManager.
23908 * typemanager.cs (GetMethod, GetConstructor): Use our
23909 implementation of FindMembers to find the members, since during
23910 corlib compilation, the types are TypeBuilders and GetMethod and
23911 GetConstructor do not work.
23913 Make all methods in TypeManager static.
23915 (InitCodeHelpers): Split the functionality from
23916 the InitCodeTypes function.
23918 * driver.cs: Call InitCodeHelpers after we have populated the
23921 * cs-parser.jay (delegate_declaration): we did not used to compute
23922 the delegate name correctly for void delegates.
23924 2002-03-24 Miguel de Icaza <miguel@ximian.com>
23926 * rootcontext.cs (RootContext): Init the interface_resolve_order
23927 and type_container_resolve_order always.
23929 (ResolveCore, BootstrapCorlib_ResolveClass,
23930 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
23931 compiler when compiling with --nostdlib
23933 * class.cs (TypeContainer.DefineType): Check that our parent is
23934 not null. This test is most important when we are bootstraping
23937 * codegen.cs: Split out the symbol writing code.
23939 2002-03-25 Martin Baulig <martin@gnome.org>
23941 * driver.cs (-g): Made -g an alias for --debug.
23943 2002-03-24 Martin Baulig <martin@gnome.org>
23945 * codegen.cs (SymbolWriter): New public variable. Returns the
23946 current symbol writer.
23947 (CodeGen): Added `bool want_debugging_support' argument to the
23948 constructor. If true, tell the ModuleBuild that we want debugging
23949 support and ask it for the ISymbolWriter.
23950 (Save): If we have a symbol writer, call it's Close() method after
23951 saving the assembly.
23953 * driver.c (--debug): New command line argument to create a
23954 debugger information file.
23956 * location.cs (SymbolDocument): New public property. Returns an
23957 ISymbolDocumentWriter object for the current source file or null
23958 if we don't have a symbol writer.
23960 2002-03-21 Miguel de Icaza <miguel@ximian.com>
23962 * driver.cs (LoadAssembly): Correctly return when all the paths
23963 have been tried and not before.
23965 * statement.cs (Switch.Emit): return the actual coverage for this
23966 statement (returns/not-returns)
23968 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
23969 switch of the statement if we are the last switch section. That
23970 kills two problems: try/catch problems (we used to emit an empty
23971 nop at the end) and switch statements where all branches would
23974 2002-03-19 Miguel de Icaza <miguel@ximian.com>
23976 * driver.cs: Add default assemblies (the equivalent to the
23977 Microsoft CSC.RSP file)
23979 * cs-tokenizer.cs: When updating `cols and setting it to zero,
23980 also update tokens_seen and set it to false.
23982 * driver.cs: Implement --recurse for Mike.
23984 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
23985 correctly splitting out the paths.
23987 2002-03-18 Miguel de Icaza <miguel@ximian.com>
23989 * interface.cs (Interface.PopulateProperty): Instead of using
23990 `parent' as the declaration space for the set parameters, use
23993 * support.cs (InternalParameters): InternalParameters constructor
23994 takes a DeclSpace instead of a TypeContainer.
23996 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
23997 types are being initialized, load the address of it before calling
24000 (New): Provide a mechanism to disable the generation of local
24001 value type temporaries when the caller will be providing us with
24002 an address to store it.
24004 (ArrayCreation.EmitDynamicInitializers): Use it.
24006 2002-03-17 Miguel de Icaza <miguel@ximian.com>
24008 * expression.cs (Invocation.EmitArguments): Only probe for array
24009 property if there is more than one argument. Sorry about that.
24011 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
24012 empty param arrays.
24014 * class.cs (Method.LabelParameters): Fix incorrect code path that
24015 prevented the `ParamArrayAttribute' from being applied to the
24018 2002-03-16 Miguel de Icaza <miguel@ximian.com>
24020 * support.cs (ReflectionParameters): Correctly compute whether the
24021 last argument is a params array. Fixes the problem with
24024 * typemanager.cs: Make the assemblies array always be non-null
24025 (empty, but non-null)
24027 * tree.cs (RecordDecl): New function that abstracts the recording
24028 of names. This reports error 101, and provides a pointer to the
24029 previous declaration. Fixes a crash in the compiler.
24031 * cs-parser.jay (constructor_declaration): Update to new grammar,
24032 and provide a constructor_body that can be empty.
24034 2002-03-15 Miguel de Icaza <miguel@ximian.com>
24036 * driver.cs: Add support for --resources.
24038 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
24039 Make all types for the various array helper methods be integer.
24041 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
24042 CheckState to ConvCast.
24044 (ConvCast): Now it takes a `checked' state argument, to avoid
24045 depending on the emit context for the conversion, and just using
24046 the resolve time setting.
24048 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
24049 instead of Invocation.EmitArguments. We do not emit the original
24050 arguments, instead we emit those which have been converted to
24051 unsigned int expressions.
24053 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
24055 * codegen.cs: ditto.
24057 * expression.cs (LocalVariableReference): Drop the use of the
24058 Store function that depended on the variable index.
24060 * statement.cs (VariableInfo): Drop the `Idx' property from this
24061 class, as this is not taking into account the indexes for
24062 temporaries tat we generate during the execution, getting the
24065 * class.cs: First emit class initializers, then call the parent
24068 * expression.cs (Binary): Fix opcode emision.
24069 (UnaryMutator.EmitCode): Support checked code generation
24071 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
24072 matches for events for both the Static and Instance scans,
24073 pointing to the same element. Fix that.
24075 2002-03-14 Miguel de Icaza <miguel@ximian.com>
24077 * rootcontext.cs (ResolveTree): Always set the
24078 interface_resolve_order, because nested interfaces will be calling
24081 * class.cs (GetInterfaceOrClass): Track the same resolution
24082 process used by TypeManager.LookupType. This fixes the nested
24083 type lookups in class declarations (separate path from
24086 (TypeContainer.DefineType): Also define nested interfaces.
24087 (TypeContainer.RegisterOrder): New public function used to
24088 register the order in which child interfaces need to be closed.
24090 Nested interfaces need to be closed after their parents have been
24093 * interface.cs (InterfaceAttr): Put all the logic for computing
24094 the interface attribute here.
24096 (DefineInterface): Register our interface order with the
24097 RootContext or with the TypeContainer depending on the case.
24099 2002-03-12 Miguel de Icaza <miguel@ximian.com>
24101 * cs-parser.jay: rework foreach statement to work with the new
24102 changes to the policy on SimpleNames.
24104 * report.cs: support Stacktrace on warnings as well.
24106 * makefile: drop --unsafe and /unsafe from the compile.
24108 2002-03-13 Ravi Pratap <ravi@ximian.com>
24110 * ecore.cs (StandardConversionExists): Modify to take an Expression
24111 as the first parameter. Ensure we do null -> reference type conversion
24114 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
24115 temporary Expression objects.
24117 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
24119 * interface.cs: workaround bug in method overloading resolution
24120 (there is already a bugzilla bug for it).
24122 2002-03-12 Miguel de Icaza <miguel@ximian.com>
24124 We could also solve this problem by having a separate path for
24125 performing type lookups, instead of DoResolve, we could have a
24126 ResolveType entry point, and only participating pieces of the
24127 production (simplename, deref, array) would implement this.
24129 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
24130 signal SimpleName to only resolve type names and not attempt to
24131 resolve anything else.
24133 * expression.cs (Cast): Set the flag.
24135 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
24137 * class.cs: Only report 108 if there is no `new' modifier.
24139 * cs-parser.jay: rework foreach statement to work with the new
24140 changes to the policy on SimpleNames.
24142 * report.cs: support Stacktrace on warnings as well.
24144 * makefile: drop --unsafe and /unsafe from the compile.
24146 2002-03-11 Miguel de Icaza <miguel@ximian.com>
24148 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
24149 lookups here, instead of doing that at parse time. This means
24150 that our grammar will not introduce `LocalVariableReferences' as
24151 expressions at this point. That solves the problem of code like
24155 static void Main ()
24159 This is only half the fix. The full fix requires parameters to
24160 also be handled in this way.
24162 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
24163 makes the use more obvious of the DeclSpace. The
24164 ec.TypeContainer.TypeBuilder is now only used to pull the
24165 TypeBuilder for it.
24167 My theory is that I can get rid of the TypeBuilder completely from
24168 the EmitContext, and have typecasts where it is used (from
24169 DeclSpace to where it matters).
24171 The only pending problem is that the code that implements Aliases
24172 is on TypeContainer, and probably should go in DeclSpace.
24174 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
24175 lookups here, instead of doing that at parse time. This means
24176 that our grammar will not introduce `LocalVariableReferences' as
24177 expressions at this point. That solves the problem of code like
24181 static void Main ()
24185 This is only half the fix. The full fix requires parameters to
24186 also be handled in this way.
24188 * class.cs (Property.DefineMethod): When implementing an interface
24189 method, set newslot, when implementing an abstract method, do not
24190 set the flag (before we tried never setting it, or always setting
24191 it, which is the difference).
24192 (Indexer.DefineMethod): same.
24193 (Method.DefineMethod): same.
24195 * ecore.cs: Only set the status used flag if we get back a Field.
24197 * attribute.cs: Temporary hack, so Paolo can keep working.
24199 2002-03-08 Ravi Pratap <ravi@ximian.com>
24201 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
24202 the unmanaged type in the case we have a MarshalAs attribute.
24204 (Resolve): Handle the case when we are parsing the special MarshalAs
24205 attribute [we need to store the unmanaged type to use later]
24207 * typemanager.cs (marshal_as_attr_type): Built in type for the
24208 MarshalAs Attribute.
24210 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
24211 on parameters and accordingly set the marshalling info.
24213 2002-03-09 Miguel de Icaza <miguel@ximian.com>
24215 * class.cs: Optimizing slightly by removing redundant code after
24216 we switched to the `NoTypes' return value.
24217 (Property.DefineMethod): use NoTypes here too.
24219 This fixes the bug I introduced in my last batch of changes.
24221 2002-03-05 Ravi Pratap <ravi@ximian.com>
24223 * tree.cs (RecordEnum): Add. We now keep track of enums too.
24225 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
24226 Enums since those are types too.
24228 * cs-parser.jay (enum_declaration): Record enums as we parse them.
24230 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
24231 thanks to a call during the lookup process.
24233 2002-03-07 Miguel de Icaza <miguel@ximian.com>
24235 * statement.cs (Foreach): Lots of work to accomodate a particular
24236 kind of foreach statement that I had not kept in mind. It is
24237 possible to have foreachs on classes that provide a GetEnumerator
24238 method that return objects that implement the "pattern" for using
24239 a foreach, there is no need to support GetEnumerator
24242 This is needed to compile nant.
24244 * decl.cs: Only report 114 if the member is not `Finalize' and if
24245 the warning level is at least 2.
24247 * class.cs: Moved the compare function from Method to
24250 (MethodSignature.InheritableMemberSignatureCompare): Add new
24251 filter function that is used to extract inheritable methods from a
24254 (Method.Define): Use the new `inheritable_method_signature_filter'
24257 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
24260 2002-03-06 Miguel de Icaza <miguel@ximian.com>
24262 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
24264 * cs-parser.jay: Add opt_semicolon to the interface declaration.
24266 * expression.cs: Pass location information to
24267 ConvertImplicitStandard.
24269 * class.cs: Added debugging code to track return values from
24272 2002-03-05 Miguel de Icaza <miguel@ximian.com>
24274 * expression.cs (Is.DoResolve): If either side of the `is' is an
24275 interface, do not flag the warning.
24277 * ecore.cs (ImplicitReferenceConversion): We need a separate test
24280 * report.cs: Allow for --fatal to be used with --probe.
24282 * typemanager.cs (NoTypes): Move the definition for the empty Type
24285 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
24287 (TypeContainer.DefineProxy): New function used to proxy to parent
24288 implementations when implementing interfaces.
24289 (TypeContainer.ParentImplements): used to lookup if our parent
24290 implements a public function that is required by an interface.
24291 (TypeContainer.VerifyPendingMethods): Hook this up.
24293 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
24294 `modules' and `assemblies' arraylists into arrays. We only grow
24295 these are the very early start up of the program, so this improves
24296 the speedof LookupType (nicely measured).
24298 * expression.cs (MakeByteBlob): Replaced unsafe code with
24299 BitConverter, as suggested by Paolo.
24301 * cfold.cs (ConstantFold.Binary): Special case: perform constant
24302 folding of string concatenation, but if either side is a string,
24303 and the other is not, then return null, and let the runtime use
24304 the concatenation on the string plus the object (using
24305 `Object.ToString').
24307 2002-03-04 Miguel de Icaza <miguel@ximian.com>
24309 Constant Folding has been implemented now.
24311 * expression.cs (Unary.Reduce): Do not throw an exception, catch
24312 the error instead on types that are not supported in one's
24315 * constant.cs (Constant and all children): New set of functions to
24316 perform implict and explicit conversions.
24318 * ecore.cs (EnumConstant): Implement the new functions to perform
24319 conversion by proxying to the child expression.
24321 * codegen.cs: (ConstantCheckState): Constant evaluation has its
24322 own separate setting that can not be turned off from the command
24323 line using --unchecked or --checked and is only controlled using
24324 the checked/unchecked statements and expressions. This setting is
24325 used by the constant folder to flag errors.
24327 * expression.cs (CheckedExpr, UncheckedExpr): Set the
24328 ConstantCheckState as well.
24330 During Resolve, they also have to flag the state, because the
24331 constant folder runs completely in the Resolve phase.
24333 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
24336 2002-03-01 Miguel de Icaza <miguel@ximian.com>
24338 * cfold.cs: New file, this file contains the constant folder.
24340 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
24341 argument to track whether we are using the resulting address to
24342 load or store a value and provide better error messages.
24344 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
24345 new AddressOf arguments.
24347 * statement.cs (Foreach.EmitCollectionForeach): Update
24349 * expression.cs (Argument.Emit): Call AddressOf with proper
24350 arguments to track usage.
24352 (New.DoEmit): Call AddressOf with new arguments.
24354 (Unary.Emit): Adjust AddressOf call.
24356 2002-03-01 Ravi Pratap <ravi@ximian.com>
24358 * cs-parser.jay (member_access): Change the case for pre-defined types
24359 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
24362 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
24365 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
24366 essentially like methods and apply attributes like MethodImplOptions to them too.
24368 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
24371 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
24372 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
24375 * Update code everywhere accordingly.
24377 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
24379 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
24381 2002-02-28 Ravi Pratap <ravi@ximian.com>
24383 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
24384 try performing lookups against those instead of jumping straight into using
24385 the 'using' clauses.
24387 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
24389 (LookupType): Perform lookups in implicit parents too.
24391 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
24392 sequence as RootContext.LookupType.
24394 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
24395 the various cases of namespace lookups into this method.
24397 2002-03-01 Miguel de Icaza <miguel@ximian.com>
24399 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
24400 in positional arguments)
24402 * class.cs (Operator): Update the AllowedModifiers to contain
24405 * cs-parser.jay: Update operator declaration to allow for the
24406 operator body to be empty.
24408 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
24411 2002-02-27 Miguel de Icaza <miguel@ximian.com>
24413 * class.cs (Method.Emit): Label parameters.
24415 * driver.cs: Return 1 or 0 as the program exit code.
24417 2002-02-26 Miguel de Icaza <miguel@ximian.com>
24419 * expression.cs: Special case the `null' object when trying to
24420 auto-compute the type, as anything can be explicitly converted to
24423 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
24424 spotting this Paolo.
24426 (Expression.ImplicitNumericConversion): Perform comparissions of
24427 the type using the underlying type in the case of an enumeration
24428 rather than using the enumeration type for the compare.
24430 Cope with the underlying == type case, which is not possible to
24433 (Expression.ConvertNumericExplicit): Perform comparissions of
24434 the type using the underlying type in the case of an enumeration
24435 rather than using the enumeration type for the compare.
24437 * driver.cs: If the user does not supply an extension, assume .exe
24439 * cs-parser.jay (if_statement): Rewrote so that we can track the
24440 location for the if statement.
24442 * expression.cs (Binary.ConstantFold): Only concat strings when
24443 the operation is "+", not everything ;-)
24445 * statement.cs (Statement.EmitBoolExpression): Take a location
24447 (If, While, Do): Track location.
24449 * expression.cs (Binary.ResolveOperator): In the object + string
24450 case, I was missing a call to ConvertImplicit
24452 2002-02-25 Ravi Pratap <ravi@ximian.com>
24454 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
24455 Location arguments. Ensure we use RootContext.LookupType to do our work
24456 and not try to do a direct Type.GetType and ModuleBuilder.GetType
24458 * interface.cs (PopulateMethod): Handle the type of the parameter being
24461 * expression.cs (Invocation.BetterFunction): Handle the case when we
24462 have a params method with no fixed arguments and a call is made with no
24465 2002-02-25 Miguel de Icaza <miguel@ximian.com>
24467 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
24468 the verbatim-string-literal
24470 * support.cs (InternalParameters.ParameterModifier): handle null
24472 (InternalParameters.ParameterType): ditto.
24474 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
24475 duplicating the name of the variable parameter.
24476 (GetParameterByName): Fix bug where we were not looking up array
24477 paramters if they were the only present (thanks Paolo!).
24478 (GetParameterInfo): We only have an empty set of types if both
24479 fixed and array are set to null.
24480 (GetParameterInfo-idx): Handle FixedParameter == null
24482 * cs-parser.jay: Handle the case where there is no catch
24483 statements (missing null test).
24485 2002-02-22 Miguel de Icaza <miguel@ximian.com>
24487 * driver.cs (MainDriver): Be conservative on our command line
24490 Catch DirectoryNotFoundException when calling GetFiles.
24492 (SplitPathAndPattern): Used to split the input specification into
24493 a path and a pattern that we can feed to Directory.GetFiles.
24495 2002-02-21 Miguel de Icaza <miguel@ximian.com>
24497 * statement.cs (Fixed): Implement the last case of the Fixed
24498 statement (string handling).
24500 * expression.cs (StringPtr): New class used to return a char * to
24501 a string; Used by the Fixed statement.
24503 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
24505 * expression.cs (Binary.ResolveOperator): Remove redundant
24506 MemberLookup pn parent type.
24507 Optimize union call, we do not need a union if the types are the same.
24508 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
24511 Specialize the use of MemberLookup everywhere, instead of using
24512 the default settings.
24514 (StackAlloc): Implement stackalloc keyword.
24516 * cs-parser.jay: Add rule to parse stackalloc.
24518 * driver.cs: Handle /h, /help, /?
24520 * expression.cs (MakeByteBlob): Removed the hacks we had in place
24521 before we supported unsafe code.
24523 * makefile: add --unsafe to the self compilation of mcs.
24525 2002-02-20 Miguel de Icaza <miguel@ximian.com>
24527 * expression.cs (PointerArithmetic): New class that is used to
24528 perform pointer arithmetic.
24529 (Binary.Resolve): Handle pointer arithmetic
24530 Handle pointer comparission.
24531 (ArrayPtr): Utility expression class that is used to take the
24532 address of an array.
24534 (ElementAccess): Implement array access for pointers
24536 * statement.cs (Fixed): Implement fixed statement for arrays, we
24537 are missing one more case before we are done.
24539 * expression.cs (Indirection): Implement EmitAssign and set the
24540 ExprClass to Variable. This allows pointer dereferences to be
24541 treated as variables, and to have values assigned to them.
24543 * ecore.cs (Expression.StoreFromPtr): New utility function to
24544 store values dereferencing.
24546 2002-02-20 Ravi Pratap <ravi@ximian.com>
24548 * expression.cs (Binary.ResolveOperator): Ensure that we are
24549 not trying to operate on a void type - this fixes the reported
24552 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
24553 the parent implementation is sealed.
24555 * ../errors/cs0239.cs : Add.
24557 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
24559 * typemanager.cs (unverifiable_code_type): Corresponds to
24560 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
24561 which have unsafe code in them.
24563 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
24566 2002-02-19 Miguel de Icaza <miguel@ximian.com>
24568 * cs-tokenizer.cs: Add support for @"litreal strings"
24570 Make tokenizer accept pre-processor directives
24571 on any column (remove the old C-like limitation).
24573 * rootcontext.cs (EmitCode): Emit any global attributes.
24574 (AddGlobalAttributes): Used to keep track of assembly attributes.
24576 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
24578 * cs-parser.jay: Add support for global attributes.
24580 2002-02-17 Miguel de Icaza <miguel@ximian.com>
24582 * expression.cs (Indirection): New helper class. Unary will
24583 create Indirection classes to be able to implement the
24584 IMemoryLocation interface on it.
24586 2002-02-16 Miguel de Icaza <miguel@ximian.com>
24588 * cs-parser.jay (fixed_statement): reference the right statement.
24590 * statement.cs (Fixed.Emit): Finish implementing the fixed
24591 statement for the &x case.
24593 2002-02-14 Miguel de Icaza <miguel@ximian.com>
24595 * class.cs (Property.Define, Method.Define): Remove newslot when
24598 * modifiers.cs: My use of NewSlot when `Abstract' was set was
24599 wrong. NewSlot should only be used if the `new' keyword is present.
24601 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
24602 locating our system dir. Sorry about this.
24604 2002-02-13 Miguel de Icaza <miguel@ximian.com>
24606 * driver.cs (GetSystemDir): Compute correctly the location of our
24607 system assemblies. I was using the compiler directory instead of
24608 the library directory.
24610 2002-02-13 Ravi Pratap <ravi@ximian.com>
24612 * expression.cs (BetterFunction): Put back in what Miguel commented out
24613 since it is the correct fix. The problem is elsewhere ;-)
24615 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
24616 parameters of the parms method are themselves compatible or not !
24618 (StandardConversionExists): Fix very dangerous bug where we were forgetting
24619 to check that a class implements an interface before saying that an implicit
24620 conversion was allowed. Use ImplementsInterface to do the checking.
24622 2002-02-13 Miguel de Icaza <miguel@ximian.com>
24624 * class.cs (Method.Define): Track whether we are an explicit
24625 implementation or not. And only call DefineMethodOverride if we
24626 are an explicit implementation.
24628 (Property.DefineMethod): Ditto.
24630 2002-02-11 Ravi Pratap <ravi@ximian.com>
24632 * expression.cs (BetterFunction): Catch hideous bug which was
24633 preventing us from detecting ambiguous calls due to implicit casts i.e
24636 2002-01-29 Miguel de Icaza <miguel@ximian.com>
24638 * support.cs (Pair): Remove un-needed method. I figured why I was
24639 getting the error in cs-parser.jay, the variable in a foreach loop
24640 is readonly, and the compiler does not really treat this as a variable.
24642 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
24643 instead of EQUALS in grammar.
24645 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
24647 * expression.cs (Unary.DoResolve): Check whether the argument is
24650 2002-01-28 Miguel de Icaza <miguel@ximian.com>
24652 * support.cs: Api for Pair to set a value. Despite the fact that
24653 the variables are public the MS C# compiler refuses to compile
24654 code that accesses the field if the variable is part of a foreach
24657 * statement.cs (Fixed): Begin implementation of the fixed
24660 (Block.AddVariable): Return the VariableInfo on success and null
24661 on failure instead of true/false.
24663 * cs-parser.jay (foreach): Catch errors on variables already
24664 defined (we were ignoring this value before) and properly unwind
24665 the block hierarchy
24667 (fixed_statement): grammar for the fixed statement.
24669 2002-01-25 Miguel de Icaza <miguel@ximian.com>
24671 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
24672 pointer types to be incretemented.
24674 (SizeOf): Implement.
24676 * cs-parser.jay (pointer_member_access): Implement
24677 expr->IDENTIFIER production.
24679 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
24680 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
24683 (Unary): Implement indirection.
24685 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
24686 use in non-unsafe context).
24688 (SimpleName.DoResolve): Check for pointers in field access on safe
24691 (Expression.LoadFromPtr): Factor the load-indirect code in this
24692 function. This was duplicated in UnboxCast and ParameterReference
24694 2002-01-24 Miguel de Icaza <miguel@ximian.com>
24696 * expression.cs (ComposedCast): report an error if a pointer cast
24697 is used in a safe region.
24699 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
24700 pointer type casts in unsafe context.
24702 * codegen.cs (EmitContext): Set up IsUnsafe.
24704 * cs-parser.jay (non_expression_type): Add productions for pointer
24707 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
24708 code. We should not use force into static mode if the method is
24709 not virtual. Fixes bug in MIS
24711 * statement.cs (Do.Emit, While.Emit, For.Emit,
24712 Statement.EmitBoolExpression): Add support to Do and While to
24713 propagate infinite loop as `I do return' semantics.
24715 Improve the For case to also test for boolean constants.
24717 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
24718 to the list of attributes we can add.
24720 Remove `EmitContext' argument.
24722 * class.cs (Method.Define): Apply parameter attributes.
24723 (Constructor.Define): Apply parameter attributes.
24724 (MethodCore.LabelParameters): Move here the core of labeling
24727 * support.cs (ReflectionParameters.ParameterModifier,
24728 InternalParameters.ParameterModifier): Use IsByRef on the type and
24729 only return the OUT bit for these parameters instead of in/out/ref
24732 This is because I miss-understood things. The ParameterInfo.IsIn
24733 and IsOut represent whether the parameter has the [In] and [Out]
24736 2002-01-22 Miguel de Icaza <miguel@ximian.com>
24738 * ecore.cs (FieldExpr.Emit): Release temporaries.
24740 * assign.cs (LocalTemporary.Release): new function.
24742 * codegen.cs (EmitContext.GetTemporaryStorage,
24743 EmitContext.FreeTemporaryStorage): Rework the way we deal with
24744 temporary storage. Now we can "put back" localbuilders when we
24747 2002-01-21 Miguel de Icaza <miguel@ximian.com>
24749 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
24750 need to make a copy of the variable to generate verifiable code.
24752 2002-01-19 Miguel de Icaza <miguel@ximian.com>
24754 * driver.cs: Compute dynamically the system directory.
24756 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
24757 Slower, but more generally useful. Used by the abstract
24758 registering implementation.
24760 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
24761 the rules for the special rule on Type/instances. First check if
24762 we have the same name, and if so, try that special static path
24763 rather than the instance path.
24765 2002-01-18 Miguel de Icaza <miguel@ximian.com>
24767 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
24770 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
24771 Enum, ValueType, Delegate or Array for non-corlib compiles.
24773 * cs-tokenizer.cs: Catch long identifiers (645)
24775 * typemanager.cs (IndexerPropetyName): Ravi never tested this
24778 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
24779 fix, we were returning too early, so we were not registering
24780 pending methods from abstract classes.
24782 Do not register pending methods if the class is abstract.
24784 * expression.cs (Conditional.DoResolve): Report circular implicit
24785 conversions when we neecd to compute it for conditional
24788 (Is.DoResolve): If the expression is always of the provided type,
24789 flag warning 183. If the expression can not ever be of the
24790 provided type flag warning 184.
24792 * class.cs: Catch 169 as well.
24794 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
24797 2002-01-18 Nick Drochak <ndrochak@gol.com>
24799 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
24801 2002-01-17 Miguel de Icaza <miguel@ximian.com>
24803 * interface.cs: (PopulateMethod): Check for pointers being defined
24804 only if the unsafe context is active.
24805 (PopulateProperty): ditto.
24806 (PopulateIndexer): ditto.
24808 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
24809 specified. If pointers are present, make sure that they are
24810 present in an unsafe context.
24811 (Constructor, Constructor.Define): ditto.
24812 (Field, Field.Define): ditto.
24813 (Property, Property.Define): ditto.
24814 (Event, Event.Define): ditto.
24816 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
24817 hashtable if there are classes or structs defined.
24819 * expression.cs (LocalVariableReference.DoResolve): Simplify this
24820 code, as the constant resolution moved.
24822 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
24823 the metadata, so we can flag error 133.
24825 * decl.cs (MemberCore.UnsafeOK): New function to test that a
24826 pointer is being declared in an unsafe context.
24828 2002-01-16 Miguel de Icaza <miguel@ximian.com>
24830 * modifiers.cs (Modifiers.Check): Require a Location argument.
24831 Report error 227 for Unsafe use.
24833 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
24835 * statement.cs (For.Emit): If the test is null, then report that
24836 we do `return', as we wont reach anything afterwards.
24838 (Switch.SwitchGoverningType): Track the expression that matched
24841 * driver.cs: Allow negative numbers as an error code to flag.
24843 * cs-parser.jay: Handle 1551.
24845 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
24847 2002-01-15 Miguel de Icaza <miguel@ximian.com>
24849 * cs-parser.jay: Report 1518 (type declaration can only contain
24850 class, struct, interface, enum or delegate)
24852 (switch_label): Report 1523 (keywords `case' or `default' must
24855 (opt_switch_sections): Report 1522 (empty switch)
24857 * driver.cs: Report 1515 (response file specified multiple times)
24858 Report 1516 (Source file specified multiple times).
24860 * expression.cs (Argument.Resolve): Signal 1510
24862 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
24863 access not allowed in static code)
24865 2002-01-11 Ravi Pratap <ravi@ximian.com>
24867 * typemanager.cs (IsPointerType): Utility method which we are going
24870 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
24871 the object type, so we take care of that.
24873 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
24875 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
24876 added to non-params parameters :-)
24878 * typemanager.cs (CSharpName): Include 'void' type too.
24880 (void_ptr_type): Include in the set of core types.
24882 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
24885 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
24888 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
24889 completely forgotten about it.
24891 2002-01-10 Ravi Pratap <ravi@ximian.com>
24893 * cs-parser.jay (pointer_type): Add. This begins our implementation
24894 of parsing rules for unsafe code.
24896 (unsafe_statement): Implement.
24898 (embedded_statement): Modify to include the above.
24900 * statement.cs (Unsafe): Implement new class for unsafe blocks.
24902 * codegen.cs (EmitContext.InUnsafe): Add. This determines
24903 if the current context is an unsafe one.
24905 * cs-parser.jay (local_variable_pointer_type): Since local variable types
24906 are handled differently, we need separate rules for them.
24908 (local_variable_declaration): Update to use local_variable_pointer_type
24909 to allow variable declarations of unmanaged pointer types.
24911 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
24912 in unsafe contexts.
24914 * ../errors/cs0214.cs : Add.
24916 2002-01-16 Nick Drochak <ndrochak@gol.com>
24918 * makefile: remove 'response' file when cleaning.
24920 2002-01-15 Miguel de Icaza <miguel@ximian.com>
24922 * cs-parser.jay: Report 1524.
24924 2002-01-14 Miguel de Icaza <miguel@ximian.com>
24926 * typemanager.cs (RegisterMethod): drop checking if we have
24927 registered this from here
24929 2002-01-12 Miguel de Icaza <miguel@ximian.com>
24931 * class.cs (Method.EmitDestructor): Implement calling our base
24934 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
24935 value of InFinally.
24937 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
24938 this routine and will wrap the call in a try/catch block. Deal
24941 2002-01-11 Miguel de Icaza <miguel@ximian.com>
24943 * ecore.cs (Expression.MemberLookup): instead of taking a
24944 parameter `same_type' that was used to tell whether we could
24945 access private members we compute our containing type from the
24948 (FieldExpr): Added partial support for volatile fields. This does
24949 not work for volatile fields exposed from assemblies, as I can not
24950 figure out how to extract the modreq from it.
24952 Updated all the source files to use this.
24954 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
24955 because it is referenced by MemberLookup very often.
24957 2002-01-09 Ravi Pratap <ravi@ximian.com>
24959 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
24960 TypeBuilder.GetCustomAttributes to retrieve what we need.
24962 Get rid of redundant default_member_attr_type as this is the same as
24963 default_member_type which already exists.
24965 * interface.cs, attribute.cs : Update accordingly.
24967 2002-01-08 Miguel de Icaza <miguel@ximian.com>
24969 * typemanager.cs: Enable IndexerPropertyName again. It does not
24970 work for TYpeBuilders though. Ravi, can you please fix this?
24972 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
24974 * expression.cs (Argument.Emit): Handle the case of ref objects
24975 being passed to ref functions;
24977 (ParameterReference.EmitLoad): Loads the content of the pointer
24978 without dereferencing.
24980 2002-01-07 Miguel de Icaza <miguel@ximian.com>
24982 * cs-tokenizer.cs: Implemented the pre-processing expressions.
24984 2002-01-08 Ravi Pratap <ravi@ximian.com>
24986 * class.cs (Indexer.DefineMethod): Incorporate the interface
24987 type in the name of the method if we are doing explicit interface
24990 * expression.cs (ConversionExists): Remove as it is completely obsolete.
24992 (BetterConversion): Fix extremely trivial bug where we were referring to
24993 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
24996 * ../errors/bug16.cs : Add although we have fixed it.
24998 2002-01-07 Miguel de Icaza <miguel@ximian.com>
25000 * expression.cs (BaseIndexer): Begin implementation.
25002 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
25004 * cs-parser.jay (indexer_declarator): Use qualified_identifier
25005 production directly to remove a shift/reduce, and implement
25006 explicit interface implementation.
25008 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
25009 after a floating point suffix.
25011 * expression.cs (DoNumericPromotions): Improved the conversion for
25012 uint/uint. If we have a constant, we avoid doing a typecast to a
25015 * class.cs (Indexer): Implement explicit interface implementation
25018 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
25020 * class.cs: make the default instance constructor public and hidebysig.
25022 2001-01-03 Ravi Pratap <ravi@ximian.com>
25024 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
25025 so we can call it from elsewhere.
25027 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
25028 we emit it internally if the class has a defined indexer; otherwise the user
25029 emits it by decorating the class definition with the DefaultMemberAttribute.
25031 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
25032 attribute is not used on a type which defines an indexer.
25034 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
25035 character when we skip whitespace.
25037 * ../errors/cs0646.cs : Add.
25039 2002-01-03 Miguel de Icaza <miguel@ximian.com>
25041 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
25044 * makefile: Add practical target `mcs3.exe' which builds the third
25045 generation compiler.
25047 * expression.cs (New): Fix structures constructor calling.
25049 * class.cs (Property, Method, Indexer): Emit Final flag on the
25050 method if we are an interface implementation and we are not
25053 * ecore.cs (PropertyExpr): New public field `IsBase', tells
25054 whether this property is referencing a `base' method.
25056 * expression.cs (Invocation.EmitCall): take an extra argument:
25057 is_base, this is used to determine whether the `call' or
25058 `callvirt' opcode should be used.
25061 * delegate.cs: update EmitCall.
25063 * class.cs (Method.Define): Set NewSlot for the cases where we are
25064 not implementing an interface method.
25066 (Property.Define): ditto.
25068 2002-01-02 Miguel de Icaza <miguel@ximian.com>
25070 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
25071 'r'. Allows mcs to parse itself fully.
25073 2002-01-02 Ravi Pratap <ravi@ximian.com>
25075 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
25076 of the number of initializers that require the InitializeArray method.
25078 (CheckIndices): Store the Expression in all cases - not the plain value. Also
25079 update the above field where necessary.
25081 (MakeByteBlob): Update accordingly.
25083 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
25086 (EmitDynamicInitializers): Update in accordance with the new optimization.
25088 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
25089 same OpCode applies.
25091 * cs-parser.jay : Fix some glaring errors I introduced.
25093 2002-01-01 Ravi Pratap <ravi@ximian.com>
25095 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
25096 so that we can check for name clashes there too.
25098 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
25099 for interface indexers.
25101 * interfaces.cs (Define): Emit the default member attribute.
25103 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
25104 variable was being referred to while setting the value ;-)
25106 2002-01-01 Miguel de Icaza <miguel@ximian.com>
25108 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
25109 byte-by-byte information when we know the data is zero.
25111 Make the block always a multiple of 4, because
25112 DefineInitializedData has a bug.
25114 * assign.cs: Fix, we should assign from the temporary, not from
25117 * expression.cs (MakeByteBlob): Fix my incorrect code.
25119 2001-12-31 Miguel de Icaza <miguel@ximian.com>
25121 * typemanager.cs (EnumToUnderlying): This function is used to get
25122 the underlying type from an enumeration, because it does not
25125 * constant.cs: Use the I4_S form for values between -128 and 127.
25127 * statement.cs (Block.LookupLabel): Looks up a label.
25128 (Block): Drop support for labeled blocks.
25130 (LabeledStatement): New kind of statement that represents a label
25133 (Goto): Finally implement this bad boy.
25135 * cs-parser.jay: Update to reflect new mechanism to implement
25138 2001-12-30 Miguel de Icaza <miguel@ximian.com>
25140 * codegen.cs (EmitContext.This): a codegen property that keeps the
25141 a single instance of this instead of creating many different this
25144 * delegate.cs (Delegate.DoResolve): Update to use the property;
25146 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
25148 * expression.cs (BaseAccess.DoResolve): Ditto.
25150 2001-12-29 Ravi Pratap <ravi@ximian.com>
25152 * typemanager.cs (methodimpl_attr_type): Add to hold the type
25153 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
25155 (InitCoreTypes): Update accordingly.
25157 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
25158 so we can quickly store the state.
25160 (ApplyAttributes): Set the correct implementation flags
25161 for InternalCall methods.
25163 2001-12-29 Miguel de Icaza <miguel@ximian.com>
25165 * expression.cs (EmitCall): if a method is not virtual, then do
25166 not use callvirt on it.
25168 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
25169 user defined stuff) requires the use of stobj, which takes an
25170 address on the stack instead of an array and an index. So emit
25171 the Ldelema operation for it.
25173 (EmitStoreOpcode): Use stobj for valuetypes.
25175 (UnaryMutator.EmitCode): Use the right 1 value depending on
25176 whether we are dealing with int64/uint64, float or doubles.
25178 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
25179 constructors that I implemented last night.
25181 (Constructor.IsDefault): Fix to work properly for static
25184 * cs-parser.jay (CheckDef): report method signature errors.
25185 Update error number 103 to be 132.
25187 * decl.cs: New AdditionResult enumeration value: MethodExists.
25188 Although we do this check for methods later on in the semantic
25189 analysis, catching repeated default constructors is so easy that
25190 we catch these here.
25192 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
25195 (ParameterReference.EmitAssign, Emit): handle
25198 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
25199 (ArrayAccess.EmitStoreOpcode): ditto.
25201 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
25203 * expression.cs (MakeByteBlob): Complete all the missing types
25204 (uint, short, ushort, byte, sbyte)
25206 * class.cs: Only init instance field initializers on instance
25209 Rename `constructors' to instance_constructors.
25211 (TypeContainer.AddConstructor): Only add constructors to the list
25212 if it is not static.
25214 Make sure that we handle default_static_constructor independently
25215 everywhere where we handle instance_constructors
25217 2001-12-28 Miguel de Icaza <miguel@ximian.com>
25219 * class.cs: Do not lookup or create a base initializer for a
25220 static constructor.
25222 (ConstructorInitializer.Resolve): use the proper type to lookup
25225 * cs-parser.jay: Report error 1585 (modifiers between type and name).
25227 * enum.cs, interface.cs: Remove CloseType, this is taken care by
25230 * decl.cs: CloseType is now an virtual method, the default
25231 implementation just closes this type.
25233 2001-12-28 Ravi Pratap <ravi@ximian.com>
25235 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
25236 to PreserveSig by default. Also emit HideBySig on such methods.
25238 Basically, set the defaults to standard values.
25240 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
25241 argument, if candidate is better, it can't be worse than the best !
25243 (Invocation): Re-write bits to differentiate between methods being
25244 applicable in their expanded form and their normal form - for params
25247 Get rid of use_standard everywhere as only standard conversions are allowed
25248 in overload resolution.
25250 More spec conformance.
25252 2001-12-27 Miguel de Icaza <miguel@ximian.com>
25254 * driver.cs: Add --timestamp, to see where the compiler spends
25257 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
25258 `this' in static code.
25260 (SimpleName.DoResolve): Implement in terms of a helper function
25261 that allows static-references to be passed upstream to
25264 (Expression.ResolveWithSimpleName): Resolve specially simple
25265 names when called by MemberAccess to implement the special
25268 (Expression.ImplicitReferenceConversion): Handle conversions from
25269 Null to reference types before others, as Null's type is
25272 * expression.cs (Invocation.EmitCall): Handle the special case of
25273 calling methods declared on a reference type from a ValueType
25274 (Base classes System.Object and System.Enum)
25276 (MemberAccess.Resolve): Only perform lookups on Enumerations if
25277 the left hand side is a TypeExpr, not on every enumeration.
25279 (Binary.Resolve): If types are reference types, then do a cast to
25280 object on operators != and == of both arguments.
25282 * typemanager.cs (FindMembers): Extract instance and static
25283 members if requested.
25285 * interface.cs (PopulateProperty): Use void_type instead of null
25286 as the return type for the setter method.
25288 (PopulateIndexer): ditto.
25290 2001-12-27 Ravi Pratap <ravi@ximian.com>
25292 * support.cs (ReflectionParameters): Fix minor bug where we
25293 were examining the wrong parameter for the ParamArray attribute.
25295 Cope with requests for the type of the parameter at position
25296 greater than the params parameter's. We now return the element
25297 type of the params array as that makes more sense.
25299 * expression.cs (Invocation.IsParamsMethodApplicable): Update
25300 accordingly as we no longer have to extract the element type
25303 (Invocation.OverloadResolve): Update.
25305 2001-12-27 Miguel de Icaza <miguel@ximian.com>
25307 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
25308 against IEnumerator, test whether the return value is a descendant
25309 of the IEnumerator interface.
25311 * class.cs (Indexer.Define): Use an auxiliary method to implement
25312 the other bits of the method definition. Begin support for
25313 explicit interface implementation.
25315 (Property.DefineMethod): Use TypeManager.void_type instead of null
25316 for an empty return value.
25318 2001-12-26 Miguel de Icaza <miguel@ximian.com>
25320 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
25321 dealing with a FieldExpr which is composed of a FieldBuilder, in
25322 the code path we did extract the constant, but we should have
25323 obtained the underlying value to be able to cast it (otherwise we
25324 end up in an infinite loop, this is what Ravi was running into).
25326 (ArrayCreation.UpdateIndices): Arrays might be empty.
25328 (MemberAccess.ResolveMemberAccess): Add support for section
25329 14.5.4.1 that deals with the special case of E.I when E is a type
25330 and something else, that I can be a reference to a static member.
25332 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
25333 handle a particular array type to create byte blobs, it is just
25334 something we dont generate byteblobs for.
25336 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
25339 * location.cs (Push): remove the key from the hashtable that we
25340 are about to add. This happens for empty files.
25342 * driver.cs: Dispose files after we have parsed them.
25344 (tokenize): new function that only runs the tokenizer on its
25345 input, for speed testing.
25347 2001-12-26 Ravi Pratap <ravi@ximian.com>
25349 * class.cs (Event.Define): Define the private field only if there
25350 are no accessors defined.
25352 * expression.cs (ResolveMemberAccess): If there is no associated
25353 field with the event, that means we have an event defined with its
25354 own accessors and we should flag error cs0070 since transforming
25355 ourselves into a field is not valid in that case.
25357 * ecore.cs (SimpleName.DoResolve): Same as above.
25359 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
25360 and charset to sane values.
25362 2001-12-25 Ravi Pratap <ravi@ximian.com>
25364 * assign.cs (DoResolve): Perform check on events only if they
25365 are being accessed outside the declaring type.
25367 * cs-parser.jay (event_declarations): Update rules to correctly
25368 set the type of the implicit parameter etc.
25370 (add_accessor, remove_accessor): Set current local parameters.
25372 * expression.cs (Binary): For delegate addition and subtraction,
25373 cast the return value from the method into the appropriate delegate
25376 2001-12-24 Ravi Pratap <ravi@ximian.com>
25378 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
25379 of these as the workaround is unnecessary.
25381 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
25382 delegate data - none of that is needed at all.
25384 Re-write bits to extract the instance expression and the delegate method
25387 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
25390 * attribute.cs (ApplyAttributes): New method to take care of common tasks
25391 of attaching attributes instead of duplicating code everywhere.
25393 * everywhere : Update code to do attribute emission using the above method.
25395 2001-12-23 Miguel de Icaza <miguel@ximian.com>
25397 * expression.cs (IsParamsMethodApplicable): if there are not
25398 parameters, return immediately.
25400 * ecore.cs: The 0 literal can be implicity converted to an enum
25403 (SimpleName.DoResolve): First lookup the type, then lookup the
25406 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
25407 want to get its address. If the InstanceExpression is not
25408 addressable, store the result in a temporary variable, then get
25411 * codegen.cs: Only display 219 errors on warning level or above.
25413 * expression.cs (ArrayAccess): Make it implement the
25414 IMemoryLocation interface.
25416 (Binary.DoResolve): handle the operator == (object a, object b)
25417 and operator != (object a, object b) without incurring into a
25418 BoxedCast (because 5 != o should never be performed).
25420 Handle binary enumerator operators.
25422 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
25423 value type, otherwise use Ldelem_ref.
25425 Use precomputed names;
25427 (AddressOf): Implement address of
25429 * cs-parser.jay (labeled_statement): Fix recursive block
25430 addition by reworking the production.
25432 * expression.cs (New.DoEmit): New has a special case:
25434 If we are dealing with a ValueType, we have a few
25435 situations to deal with:
25437 * The target of New is a ValueType variable, that is
25438 easy, we just pass this as the variable reference
25440 * The target of New is being passed as an argument,
25441 to a boxing operation or a function that takes a
25444 In this case, we need to create a temporary variable
25445 that is the argument of New.
25448 2001-12-23 Ravi Pratap <ravi@ximian.com>
25450 * rootcontext.cs (LookupType): Check that current_type is not null before
25451 going about looking at nested types.
25453 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
25454 not implement the IAssignMethod interface any more.
25456 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
25457 where we tranform them into FieldExprs if they are being resolved from within
25458 the declaring type.
25460 * ecore.cs (SimpleName.DoResolve): Do the same here.
25462 * assign.cs (DoResolve, Emit): Clean up code considerably.
25464 * ../errors/bug10.cs : Add.
25466 * ../errors/cs0070.cs : Add.
25468 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
25470 * assign.cs : Get rid of EventIsLocal everywhere.
25472 2001-12-23 Miguel de Icaza <miguel@ximian.com>
25474 * ecore.cs (ConvertIntLiteral): finished the implementation.
25476 * statement.cs (SwitchLabel): Convert the value we are using as a
25477 key before looking up the table.
25479 2001-12-22 Miguel de Icaza <miguel@ximian.com>
25481 * codegen.cs (EmitTopBlock): Require a Location argument now.
25483 * cs-parser.jay (constructor_declarator): We need to setup
25484 current_local_parameters before we parse the
25485 opt_constructor_initializer, to allow the variables to be bound
25486 to the constructor arguments.
25488 * rootcontext.cs (LookupType): First lookup nested classes in our
25489 class and our parents before we go looking outside our class.
25491 * expression.cs (ConstantFold): Extract/debox the values at the
25494 * rootcontext.cs (EmitCode): Resolve the constants first before we
25495 resolve the types. This is not really needed, but it helps debugging.
25497 * statement.cs: report location.
25499 * cs-parser.jay: pass location to throw statement.
25501 * driver.cs: Small bug fix.
25503 * report.cs: Updated format to be 4-zero filled digits.
25505 2001-12-22 Ravi Pratap <ravi@ximian.com>
25507 * expression.cs (CheckIndices): Fix minor bug where the wrong
25508 variable was being referred to ;-)
25510 (DoEmit): Do not call EmitStaticInitializers when the
25511 underlying type is System.Object.
25513 2001-12-21 Ravi Pratap <ravi@ximian.com>
25515 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
25516 and do the usual workaround for SRE.
25518 * class.cs (MyEventBuilder.EventType): New member to get at the type
25519 of the event, quickly.
25521 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
25523 * assign.cs (Assign.DoResolve): Handle the case when the target
25524 is an EventExpr and perform the necessary checks.
25526 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
25529 (SimpleName.MemberStaticCheck): Include check for EventExpr.
25531 (EventExpr): Set the type in the constructor itself since we
25532 are meant to be born fully resolved.
25534 (EventExpr.Define): Revert code I wrote earlier.
25536 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
25537 instance expression is null. The instance expression is a This in that case
25538 or a null, depending on whether it is a static method or not.
25540 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
25541 refers to more than one method.
25543 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
25544 and accordingly flag errors.
25546 2001-12-21 Miguel de Icaza <miguel@ximian.com>
25548 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
25550 2001-12-22 Miguel de Icaza <miguel@ximian.com>
25552 * location.cs (ToString): Provide useful rutine.
25554 2001-12-21 Miguel de Icaza <miguel@ximian.com>
25556 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
25557 objects, return the actual integral boxed.
25559 * statement.cs (SwitchLabel): define an ILLabel for each
25562 (Switch.CheckSwitch): If the value is a Literal, extract
25563 the underlying literal.
25565 Also in the unused hashtable we had, add the SwitchLabel so we can
25566 quickly look this value up.
25568 * constant.cs: Implement a bunch of new constants. Rewrite
25569 Literal based on this. Made changes everywhere to adapt to this.
25571 * expression.cs (Expression.MakeByteBlob): Optimize routine by
25572 dereferencing array only once, and also copes with enumrations.
25574 bytes are two bytes wide, not one.
25576 (Cast): Perform constant conversions.
25578 * ecore.cs (TryImplicitIntConversion): Return literals instead of
25579 wrappers to the literals here.
25581 * expression.cs (DoNumericPromotions): long literals can converted
25582 to ulong implicity (this is taken care of elsewhere, but I was
25583 missing this spot).
25585 * ecore.cs (Expression.Literalize): Make the return type Literal,
25586 to improve type checking.
25588 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
25590 2001-12-20 Miguel de Icaza <miguel@ximian.com>
25592 * literal.cs: Revert code from ravi that checked the bounds. The
25593 bounds are sane by the definition of the type itself.
25595 * typemanager.cs: Fix implementation of ImplementsInterface. We
25596 need to actually look up in our parent hierarchy for interfaces
25599 * const.cs: Use the underlying type for enumerations
25601 * delegate.cs: Compute the basename for the delegate creation,
25602 that should fix the delegate test case, and restore the correct
25603 Type Lookup semantics in rootcontext
25605 * rootcontext.cs: Revert Ravi's last patch. The correct way of
25606 referencing a nested type with the Reflection API is using the "+"
25609 * cs-parser.jay: Do not require EOF token at the end.
25611 2001-12-20 Ravi Pratap <ravi@ximian.com>
25613 * rootcontext.cs (LookupType): Concatenate type names with
25614 a '.' instead of a '+' The test suite passes again.
25616 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
25617 field of the enumeration.
25619 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
25620 the case when the member is an EventExpr.
25622 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
25623 static has an associated instance expression.
25625 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
25627 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
25629 * class.cs (Event.Define): Register event and perform appropriate checks
25632 We define the Add and Remove methods even if the use provides none because
25633 in that case, we provide default implementations ourselves.
25635 Define a private field of the type of the event. This is done by the CSC compiler
25636 and we should be doing it too ;-)
25638 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
25639 More methods we use in code we generate.
25641 (multicast_delegate_type, delegate_type): Two separate types since the distinction
25644 (InitCoreTypes): Update accordingly for the above.
25646 * class.cs (Event.Emit): Generate code for default accessors that we provide
25648 (EmitDefaultMethod): Do the job in the above.
25650 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
25653 2001-12-20 Miguel de Icaza <miguel@ximian.com>
25655 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
25656 builders even if we were missing one.
25658 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
25659 pass the Basename as our class name instead of the Name. The
25660 basename will be correctly composed for us.
25662 * parameter.cs (Paramters): Now takes a Location argument.
25664 * decl.cs (DeclSpace.LookupType): Removed convenience function and
25665 make all the code call directly LookupType in RootContext and take
25666 this chance to pass the Location information everywhere.
25668 * Everywhere: pass Location information.
25670 2001-12-19 Miguel de Icaza <miguel@ximian.com>
25672 * class.cs (Constructor.Define): Updated way of detecting the
25673 length of the parameters.
25675 (TypeContainer.DefineType): Use basename as the type name for
25678 (TypeContainer.Define): Do not recursively define types here, as
25679 definition is taken care in order by the RootContext.
25681 * tree.cs: Keep track of namespaces in a per-file basis.
25683 * parameter.cs (Parameter.ComputeSignature): Update to use
25686 (Parameters.GetSignature): ditto.
25688 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
25689 instead of a TypeContainer.
25691 (Interface.SemanticAnalysis): Use `this' instead of our parent to
25692 resolve names. Because we need to be resolve in our context, not
25695 * driver.cs: Implement response files.
25697 * class.cs (TypeContainer.DefineType): If we are defined, do not
25698 redefine ourselves.
25700 (Event.Emit): Emit the code for add/remove handlers.
25701 (Event.Define): Save the MethodBuilders for add/remove.
25703 * typemanager.cs: Use pair here too.
25705 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
25706 DictionaryEntry requires the first argument to be non-null.
25708 (enum_declaration): Compute full name for registering the
25711 (delegate_declaration): Instead of using
25712 formal_parameter_list, use opt_formal_parameter_list as the list
25715 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
25716 (EventParsing): New property that controls whether `add' and
25717 `remove' are returned as tokens or identifiers (for events);
25719 2001-12-19 Ravi Pratap <ravi@ximian.com>
25721 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
25722 use MyEventBuilder only and let it wrap the real builder for us.
25724 (MyEventBuilder): Revamp constructor etc.
25726 Implement all operations that we perform on EventBuilder in precisely the same
25729 (FindMembers): Update to use the EventBuilder member.
25731 (Event.Emit): Update accordingly.
25733 2001-12-18 Ravi Pratap <ravi@ximian.com>
25735 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
25736 by calling the appropriate methods.
25738 (GetCustomAttributes): Make stubs as they cannot possibly do anything
25741 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
25743 2001-12-17 Ravi Pratap <ravi@ximian.com>
25745 * delegate.cs (Delegate.Populate): Check that the return type
25746 and various parameters types are indeed accessible.
25748 * class.cs (Constructor.Define): Same here.
25750 (Field.Define): Ditto.
25752 (Event.Define): Ditto.
25754 (Operator.Define): Check that the underlying Method defined itself
25755 correctly - so it's MethodBuilder should not be null.
25757 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
25758 expression happens to be null.
25760 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
25761 members but as of now we don't seem to be able to do anything really useful with it.
25763 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
25764 not the EventBuilder.
25766 2001-12-18 Miguel de Icaza <miguel@ximian.com>
25768 * cs-tokenizer.cs: Add support for defines.
25769 Add support for #if, #elif, #else, #endif
25771 (eval_var): evaluates a variable.
25772 (eval): stubbed for evaluating functions.
25774 * cs-parser.jay: Pass the defines information
25776 * driver.cs: Add --define command line option.
25778 * decl.cs: Move MemberCore here.
25780 Make it the base class for DeclSpace. This allows us to catch and
25781 report 108 and 109 for everything now.
25783 * class.cs (TypeContainer.Define): Extract all the members
25784 before populating and emit the warning 108 (new keyword required
25785 to override) instead of having each member implement this.
25787 (MemberCore.Define): New abstract method, we will be using this in
25788 the warning reporting engine in Populate.
25790 (Operator.Define): Adjust to new MemberCore protocol.
25792 * const.cs (Const): This does not derive from Expression, it is a
25793 temporary object we use to create fields, it is a MemberCore.
25795 * class.cs (Method.Define): Allow the entry point to be in a
25798 * driver.cs: Rewrite the argument handler to clean it up a bit.
25800 * rootcontext.cs: Made it just an auxiliary namespace feature by
25801 making everything static.
25803 * driver.cs: Adapt code to use RootContext type name instead of
25806 * delegate.cs: Remove RootContext argument.
25808 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
25811 * class.cs (Event.Define): The lookup can fail.
25813 * cs-tokenizer.cs: Begin implementation of pre-procesor.
25815 * expression.cs: Resolve the this instance before invoking the code.
25817 2001-12-17 Miguel de Icaza <miguel@ximian.com>
25819 * cs-parser.jay: Add a production in element_access that allows
25820 the thing to become a "type" reference. This way we can parse
25821 things like "(string [])" as a type.
25823 Note that this still does not handle the more complex rules of
25827 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
25829 * ecore.cs: (CopyNewMethods): new utility function used to
25830 assemble the list of methods from running FindMembers.
25832 (MemberLookup): Rework FindMembers so that
25834 2001-12-16 Miguel de Icaza <miguel@ximian.com>
25836 * class.cs (TypeContainer): Remove Delegates who fail to be
25839 * delegate.cs (Populate): Verify that we dont get null return
25840 values. TODO: Check for AsAccessible.
25842 * cs-parser.jay: Use basename to emit error 574 (destructor should
25843 have the same name as container class), not the full name.
25845 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
25846 possible representation.
25848 Also implements integer type suffixes U and L.
25850 2001-12-15 Miguel de Icaza <miguel@ximian.com>
25852 * expression.cs (ArrayCreation.DoResolve): We need to do the
25853 argument resolution *always*.
25855 * decl.cs: Make this hold the namespace. Hold the root context as
25857 (LookupType): Move here.
25859 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
25861 * location.cs (Row, Name): Fixed the code, it was always returning
25862 references to the first file.
25864 * interface.cs: Register properties defined through interfaces.
25866 * driver.cs: Add support for globbing on the command line
25868 * class.cs (Field): Make it derive from MemberCore as well.
25871 2001-12-15 Ravi Pratap <ravi@ximian.com>
25873 * class.cs (Event::Define): Check that the type of the event is a delegate
25874 type else flag error #66.
25876 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
25879 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
25880 values of EntryPoint, CharSet etc etc.
25882 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
25884 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
25885 be null and we should ignore this. I am not sure if this is really clean. Apparently,
25886 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
25887 which needs this to do its work.
25889 * ../errors/cs0066.cs : Add.
25891 2001-12-14 Miguel de Icaza <miguel@ximian.com>
25893 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
25896 * class.cs: (MethodSignature.MethodSignature): Removed hack that
25897 clears out the parameters field.
25898 (MemberSignatureCompare): Cleanup
25900 (MemberCore): New base class used to share code between MethodCore
25903 (RegisterRequiredImplementations) BindingFlags.Public requires
25904 either BindingFlags.Instace or Static. Use instance here.
25906 (Property): Refactored code to cope better with the full spec.
25908 * parameter.cs (GetParameterInfo): Return an empty array instead
25911 * class.cs (Property): Abstract or extern properties have no bodies.
25913 * parameter.cs (GetParameterInfo): return a zero-sized array.
25915 * class.cs (TypeContainer.MethodModifiersValid): Move all the
25916 method modifier validation to the typecontainer so we can reuse
25917 this on properties.
25919 (MethodCore.ParameterTypes): return an empty sized array of types.
25921 (Property.Define): Test property modifier validity.
25923 Add tests for sealed/override too.
25925 (Method.Emit): abstract or extern methods have no bodies.
25927 2001-12-14 Ravi Pratap <ravi@ximian.com>
25929 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
25932 (Method::Define, ::Emit): Modify accordingly.
25934 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
25936 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
25938 * makefile: Pass in /unsafe.
25940 2001-12-13 Miguel de Icaza <miguel@ximian.com>
25942 * class.cs (MakeKey): Kill routine.
25944 * class.cs (TypeContainer.Define): Correctly define explicit
25945 method implementations (they require the full interface name plus
25948 * typemanager.cs: Deply the PtrHashtable here and stop using the
25949 lame keys. Things work so much better.
25951 This of course broke everyone who depended on `RegisterMethod' to
25952 do the `test for existance' test. This has to be done elsewhere.
25954 * support.cs (PtrHashtable): A hashtable that avoid comparing with
25955 the object stupid Equals method (because, that like fails all over
25956 the place). We still do not use it.
25958 * class.cs (TypeContainer.SetRequiredInterface,
25959 TypeContainer.RequireMethods): Killed these two routines and moved
25960 all the functionality to RegisterRequiredImplementations.
25962 (TypeContainer.RegisterRequiredImplementations): This routine now
25963 registers all the implementations required in an array for the
25964 interfaces and abstract methods. We use an array of structures
25965 which can be computed ahead of time to reduce memory usage and we
25966 also assume that lookups are cheap as most classes will not
25967 implement too many interfaces.
25969 We also avoid creating too many MethodSignatures.
25971 (TypeContainer.IsInterfaceMethod): Update and optionally does not
25972 clear the "pending" bit if we find that there are problems with
25975 (TypeContainer.VerifyPendingMethods): Update to report errors of
25976 methods that look like implementations but are not.
25978 (TypeContainer.Define): Add support for explicit interface method
25981 2001-12-12 Miguel de Icaza <miguel@ximian.com>
25983 * typemanager.cs: Keep track of the parameters here instead of
25984 being a feature of the TypeContainer.
25986 * class.cs: Drop the registration of parameters here, as
25987 InterfaceMethods are also interface declarations.
25989 * delegate.cs: Register methods with the TypeManager not only with
25990 the TypeContainer. This code was buggy.
25992 * interface.cs: Full registation here.
25994 2001-12-11 Miguel de Icaza <miguel@ximian.com>
25996 * expression.cs: Remove reducer for binary expressions, it can not
25999 * const.cs: Put here the code that used to go into constant.cs
26001 * constant.cs: Put here the code for constants, this is a new base
26002 class for Literals.
26004 * literal.cs: Make Literal derive from Constant.
26006 2001-12-09 Miguel de Icaza <miguel@ximian.com>
26008 * statement.cs (Return.Emit): Report error 157 if the user
26009 attempts to return from a finally block.
26011 (Return.Emit): Instead of emitting a return, jump to the end of
26014 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
26015 LocalBuilder to store the result of the function. ReturnLabel is
26016 the target where we jump.
26019 2001-12-09 Radek Doulik <rodo@ximian.com>
26021 * cs-parser.jay: remember alias in current namespace
26023 * ecore.cs (SimpleName::DoResolve): use aliases for types or
26026 * class.cs (LookupAlias): lookup alias in my_namespace
26028 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
26030 (LookupAlias): lookup alias in this and if needed in parent
26033 2001-12-08 Miguel de Icaza <miguel@ximian.com>
26037 * rootcontext.cs: (ModuleBuilder) Made static, first step into
26038 making things static. I need this to avoid passing the
26039 TypeContainer when calling ParameterType.
26041 * support.cs (InternalParameters.ParameterType): Remove ugly hack
26042 that did string manipulation to compute the type and then call
26043 GetType. Use Parameter.ParameterType instead.
26045 * cs-tokenizer.cs: Consume the suffix for floating values.
26047 * expression.cs (ParameterReference): figure out whether this is a
26048 reference parameter or not. Kill an extra variable by computing
26049 the arg_idx during emission.
26051 * parameter.cs (Parameters.GetParameterInfo): New overloaded
26052 function that returns whether a parameter is an out/ref value or not.
26054 (Parameter.ParameterType): The type of the parameter (base,
26055 without ref/out applied).
26057 (Parameter.Resolve): Perform resolution here.
26058 (Parameter.ExternalType): The full type (with ref/out applied).
26060 * statement.cs (Using.Emit, Using.EmitExpression): Implement
26061 support for expressions on the using statement.
26063 2001-12-07 Miguel de Icaza <miguel@ximian.com>
26065 * statement.cs (Using.EmitLocalVariableDecls): Split the
26066 localvariable handling of the using statement.
26068 (Block.EmitMeta): Keep track of variable count across blocks. We
26069 were reusing slots on separate branches of blocks.
26071 (Try.Emit): Emit the general code block, we were not emitting it.
26073 Check the type of the declaration to be an IDisposable or
26074 something that can be implicity converted to it.
26076 Emit conversions if required.
26078 * ecore.cs (EmptyExpression): New utility class.
26079 (Expression.ImplicitConversionExists): New utility function.
26081 2001-12-06 Miguel de Icaza <miguel@ximian.com>
26083 * statement.cs (Using): Implement.
26085 * expression.cs (LocalVariableReference): Support read only variables.
26087 * statement.cs: Remove the explicit emit for the Leave opcode.
26088 (VariableInfo): Add a readonly field.
26090 2001-12-05 Miguel de Icaza <miguel@ximian.com>
26092 * ecore.cs (ConvCast): new class used to encapsulate the various
26093 explicit integer conversions that works in both checked and
26094 unchecked contexts.
26096 (Expression.ConvertNumericExplicit): Use new ConvCast class to
26097 properly generate the overflow opcodes.
26099 2001-12-04 Miguel de Icaza <miguel@ximian.com>
26101 * statement.cs: The correct type for the EmptyExpression is the
26102 element_type, not the variable type. Ravi pointed this out.
26104 2001-12-04 Ravi Pratap <ravi@ximian.com>
26106 * class.cs (Method::Define): Handle PInvoke methods specially
26107 by using DefinePInvokeMethod instead of the usual one.
26109 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
26110 above to do the task of extracting information and defining the method.
26112 2001-12-04 Ravi Pratap <ravi@ximian.com>
26114 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
26115 of the condition for string type.
26117 (Emit): Move that here.
26119 (ArrayCreation::CheckIndices): Keep string literals in their expression
26122 (EmitDynamicInitializers): Handle strings appropriately.
26124 2001-12-04 Miguel de Icaza <miguel@ximian.com>
26126 * codegen.cs (EmitContext): Replace multiple variables with a
26127 single pointer to the current Switch statement.
26129 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
26132 2001-12-03 Miguel de Icaza <miguel@ximian.com>
26136 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
26139 (Foreach.Emit): Foreach on arrays was not setting
26140 up the loop variables (for break/continue).
26142 (GotoCase): Semi-implented.
26144 2001-12-03 Ravi Pratap <ravi@ximian.com>
26146 * attribute.cs (CheckAttribute): Handle system attributes by using
26147 Attribute.GetAttributes to examine information we need.
26149 (GetValidPlaces): Same here.
26151 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
26153 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
26155 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
26157 (Method::Define): Set appropriate flags if we have a DllImport attribute.
26159 (Method::Emit): Handle the case when we are a PInvoke method.
26161 2001-12-03 Miguel de Icaza <miguel@ximian.com>
26163 * expression.cs: Use ResolveWithSimpleName on compound names.
26165 2001-12-02 Ravi Pratap <ravi@ximian.com>
26167 * constant.cs (EmitConstant): Make sure we resolve the associated expression
26168 before trying to reduce it.
26170 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
26172 * constant.cs (LookupConstantValue): Implement.
26174 (EmitConstant): Use the above in emitting the constant.
26176 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
26177 that are user-defined by doing a LookupConstantValue on them.
26179 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
26182 2001-11-29 Miguel de Icaza <miguel@ximian.com>
26184 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
26186 (BaseAccess.DoResolve): Implement.
26188 (MemberAccess.DoResolve): Split this routine into a
26189 ResolveMemberAccess routine that can be used independently
26191 2001-11-28 Miguel de Icaza <miguel@ximian.com>
26193 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
26194 As that share bits of the implementation. Is returns a boolean,
26195 while As returns the Type that is being probed.
26197 2001-12-01 Ravi Pratap <ravi@ximian.com>
26199 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
26200 instead of a Literal - much easier.
26202 (EnumInTransit): Remove - utterly useless :-)
26204 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
26206 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
26208 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
26209 chain when we have no associated expression.
26211 2001-11-30 Ravi Pratap <ravi@ximian.com>
26213 * constant.cs (Define): Use Location while reporting the errror.
26215 Also emit a warning when 'new' is used and there is no inherited
26218 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
26221 (LookupEnumValue): Implement to lookup an enum member's value and define it
26224 (Populate): Re-write accordingly to use the above routine.
26226 2001-11-27 Miguel de Icaza <miguel@ximian.com>
26228 * expression.cs (This): Fix prototype for DoResolveLValue to
26229 override the base class DoResolveLValue.
26231 * cs-parser.cs: Report errors cs574 and cs575 (destructor
26234 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
26235 (we need to load the address of the field here). This fixes
26238 (FieldExpr.DoResolveLValue): Call the DoResolve
26239 function to initialize the Instance expression.
26241 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
26242 correctly the GetEnumerator operation on a value type.
26244 * cs-parser.jay: Add more simple parsing error catches.
26246 * statement.cs (Switch): Add support for string switches.
26247 Handle null specially.
26249 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
26251 2001-11-28 Ravi Pratap <ravi@ximian.com>
26253 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
26255 (declare_local_constant): New helper function.
26257 * statement.cs (AddConstant): Keep a separate record of constants
26259 (IsConstant): Implement to determine if a variable is a constant.
26261 (GetConstantExpression): Implement.
26263 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
26265 * statement.cs (IsVariableDefined): Re-write.
26267 2001-11-27 Ravi Pratap <ravi@ximian.com>
26269 * class.cs (TypeContainer::FindMembers): Look for constants
26270 in the case when we are looking for MemberTypes.Field
26272 * expression.cs (MemberAccess::DoResolve): Check that in the
26273 case we are a FieldExpr and a Literal, we are not being accessed
26274 by an instance reference.
26276 * cs-parser.jay (local_constant_declaration): Implement.
26278 (declaration_statement): Implement for constant declarations.
26280 2001-11-26 Miguel de Icaza <miguel@ximian.com>
26282 * statement.cs (Switch): Catch double defaults.
26284 (Switch): More work on the switch() statement
26285 implementation. It works for integral values now, need to finish
26289 2001-11-24 Miguel de Icaza <miguel@ximian.com>
26291 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
26292 integer literals into other integer literals. To be used by
26295 2001-11-24 Ravi Pratap <ravi@ximian.com>
26297 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
26300 (EmitDynamicInitializers): Cope with the above since we extract data
26301 directly from ArrayData now.
26303 (ExpectInitializers): Keep track of whether initializers are mandatory
26306 (Bounds): Make it a hashtable to prevent the same dimension being
26307 recorded for every element in that dimension.
26309 (EmitDynamicInitializers): Fix bug which prevented the Set array method
26312 Also fix bug which was causing the indices to be emitted in the reverse
26315 2001-11-24 Miguel de Icaza <miguel@ximian.com>
26317 * expression.cs (ArrayCreation): Implement the bits that Ravi left
26318 unfinished. They do not work, because the underlying code is
26321 2001-11-22 Miguel de Icaza <miguel@ximian.com>
26323 * cs-parser.jay: Remove bogus fixme.
26325 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
26326 on Switch statement.
26328 2001-11-23 Ravi Pratap <ravi@ximian.com>
26330 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
26333 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
26334 parameter. Apparently, any expression is allowed.
26336 (ValidateInitializers): Update accordingly.
26338 (CheckIndices): Fix some tricky bugs thanks to recursion.
26340 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
26341 I was being completely brain-dead.
26343 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
26344 and re-write acordingly.
26346 (DelegateInvocation): Re-write accordingly.
26348 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
26350 (MakeByteBlob): Handle types more correctly.
26352 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
26353 initialization from expressions but it is incomplete because I am a complete
26356 2001-11-22 Miguel de Icaza <miguel@ximian.com>
26358 * statement.cs (If.Emit): Fix a bug that generated incorrect code
26359 on If. Basically, we have to return `true' (ie, we do return to
26360 our caller) only if both branches of the if return.
26362 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
26363 short-circuit operators, handle them as short circuit operators.
26365 (Cast.DoResolve): Resolve type.
26366 (Cast.Cast): Take an expression as the target type.
26368 * cs-parser.jay (cast_expression): Remove old hack that only
26369 allowed a limited set of types to be handled. Now we take a
26370 unary_expression and we resolve to a type during semantic
26373 Use the grammar productions from Rhys to handle casts (this is
26374 not complete like Rhys syntax yet, we fail to handle that corner
26375 case that C# has regarding (-x), but we will get there.
26377 2001-11-22 Ravi Pratap <ravi@ximian.com>
26379 * class.cs (EmitFieldInitializer): Take care of the case when we have a
26380 field which is an array type.
26382 * cs-parser.jay (declare_local_variables): Support array initialization too.
26384 * typemanager.cs (MakeKey): Implement.
26386 (everywhere): Use the above appropriately.
26388 * cs-parser.jay (for_statement): Update for array initialization while
26389 declaring variables.
26391 * ecore.cs : The error message was correct, it's the variable's names that
26392 were misleading ;-) Make the code more readable.
26394 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
26395 the correct type etc.
26397 (ConvertExplicit): Handle Enum types by examining the underlying type.
26399 2001-11-21 Ravi Pratap <ravi@ximian.com>
26401 * parameter.cs (GetCallingConvention): Always return
26402 CallingConventions.Standard for now.
26404 2001-11-22 Miguel de Icaza <miguel@ximian.com>
26406 * expression.cs (Binary.ResolveOperator): Update the values of `l'
26407 and `r' after calling DoNumericPromotions.
26409 * ecore.cs: Fix error message (the types were in the wrong order).
26411 * statement.cs (Foreach.ProbeCollectionType): Need to pass
26412 BindingFlags.Instance as well
26414 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
26415 implicit int literal conversion in an empty cast so that we
26416 propagate the right type upstream.
26418 (UnboxCast): new class used to unbox value types.
26419 (Expression.ConvertExplicit): Add explicit type conversions done
26422 (Expression.ImplicitNumericConversion): Oops, forgot to test for
26423 the target type before applying the implicit LongLiterals to ULong
26426 2001-11-21 Miguel de Icaza <miguel@ximian.com>
26428 * cs-parser.jay (for_statement): Reworked the way For works: now
26429 we declare manually any variables that are introduced in
26430 for_initializer to solve the problem of having out-of-band code
26431 emition (that is what got for broken).
26433 (declaration_statement): Perform the actual variable declaration
26434 that used to be done in local_variable_declaration here.
26436 (local_variable_declaration): Do not declare anything, just pass
26437 the information on a DictionaryEntry
26439 2001-11-20 Ravi Pratap <ravi@ximian.com>
26441 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
26442 re-write of the logic to now make it recursive.
26444 (UpdateIndices): Re-write accordingly.
26446 Store element data in a separate ArrayData list in the above methods.
26448 (MakeByteBlob): Implement to dump the array data into a byte array.
26450 2001-11-19 Ravi Pratap <ravi@ximian.com>
26452 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
26455 * constant.cs (Define): Implement.
26457 (EmitConstant): Re-write fully.
26459 Pass in location info.
26461 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
26464 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
26465 DictionaryEntry since we need location info too.
26467 (constant_declaration): Update accordingly.
26469 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
26470 code into another method : UpdateIndices.
26472 2001-11-18 Ravi Pratap <ravi@ximian.com>
26474 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
26475 some type checking etc.
26477 2001-11-17 Ravi Pratap <ravi@ximian.com>
26479 * expression.cs (ArrayCreation::ValidateInitializers): Implement
26480 bits to provide dimension info if the user skips doing that.
26482 Update second constructor to store the rank correctly.
26484 2001-11-16 Ravi Pratap <ravi@ximian.com>
26486 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
26487 and try to implement.
26489 * ../errors/cs0150.cs : Add.
26491 * ../errors/cs0178.cs : Add.
26493 2001-11-16 Miguel de Icaza <miguel@ximian.com>
26495 * statement.cs: Implement foreach on multi-dimensional arrays.
26497 * parameter.cs (Parameters.GetParameterByName): Also lookup the
26498 name of the params argument.
26500 * expression.cs: Use EmitStoreOpcode to get the right opcode while
26501 initializing the array.
26503 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
26504 we can use this elsewhere.
26506 * statement.cs: Finish implementation of foreach for single
26509 * cs-parser.jay: Use an out-of-band stack to pass information
26510 around, I wonder why I need this.
26512 foreach_block: Make the new foreach_block the current_block.
26514 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
26515 function used to return a static Parameters structure. Used for
26516 empty parameters, as those are created very frequently.
26518 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
26520 2001-11-15 Ravi Pratap <ravi@ximian.com>
26522 * interface.cs : Default modifier is private, not public. The
26523 make verify test passes again.
26525 2001-11-15 Ravi Pratap <ravi@ximian.com>
26527 * support.cs (ReflectionParameters): Fix logic to determine
26528 whether the last parameter is a params one. Test 9 passes again.
26530 * delegate.cs (Populate): Register the builders we define with
26531 RegisterParameterForBuilder. Test 19 passes again.
26533 * cs-parser.jay (property_declaration): Reference $6 instead
26534 of $$ to get at the location.
26536 (indexer_declaration): Similar stuff.
26538 (attribute): Ditto.
26540 * class.cs (Property): Register parameters for the Get and Set methods
26541 if they exist. Test 23 passes again.
26543 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
26544 call to EmitArguments as we are sure there aren't any params arguments.
26545 Test 32 passes again.
26547 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
26548 IndexOutOfRangeException.
26550 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
26551 Test 33 now passes again.
26553 2001-11-15 Miguel de Icaza <miguel@ximian.com>
26555 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
26556 broke a bunch of things. Will have to come up with a better way
26557 of tracking locations.
26559 * statement.cs: Implemented foreach for single dimension arrays.
26561 2001-11-09 Miguel de Icaza <miguel@ximian.com>
26563 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
26564 an error. This removes the lookup from the critical path.
26566 * cs-parser.jay: Removed use of temporary_loc, which is completely
26569 2001-11-14 Miguel de Icaza <miguel@ximian.com>
26571 * support.cs (ReflectionParameters.ParameterModifier): Report
26572 whether the argument is a PARAMS argument or not.
26574 * class.cs: Set the attribute `ParamArrayAttribute' on the
26575 parameter argument.
26577 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
26578 and cons_param_array_attribute (ConstructorInfo for
26579 ParamArrayAttribute).,
26581 * codegen.cs: Emit the return using the `Return' statement, that
26582 way we can report the error correctly for missing return values.
26584 * class.cs (Method.Emit): Clean up.
26586 * expression.cs (Argument.Resolve): Take another argument: the
26587 location where this argument is used. Notice that this is not
26588 part of the "Argument" class as to reduce the size of the
26589 structure (we know the approximate location anyways).
26591 Test if the argument is a variable-reference, if not, then
26592 complain with a 206.
26594 (Argument.Emit): Emit addresses of variables.
26596 (Argument.FullDesc): Simplify.
26598 (Invocation.DoResolve): Update for Argument.Resolve.
26600 (ElementAccess.DoResolve): ditto.
26602 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
26603 method should be virtual, as this method is always virtual.
26605 (NewDelegate.DoResolve): Update for Argument.Resolve.
26607 * class.cs (ConstructorInitializer.DoResolve): ditto.
26609 * attribute.cs (Attribute.Resolve): ditto.
26611 2001-11-13 Miguel de Icaza <miguel@ximian.com>
26613 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
26615 * expression.cs (ParameterReference): Drop IStackStorage and implement
26616 IAssignMethod instead.
26618 (LocalVariableReference): ditto.
26620 * ecore.cs (FieldExpr): Drop IStackStorage and implement
26621 IAssignMethod instead.
26623 2001-11-13 Miguel de Icaza <miguel@ximian.com>
26625 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
26626 enumerations that are used in heavily used structures derive from
26627 byte in a laughable and pathetic attempt to reduce memory usage.
26628 This is the kind of pre-optimzations that you should not do at
26629 home without adult supervision.
26631 * expression.cs (UnaryMutator): New class, used to handle ++ and
26632 -- separatedly from the other unary operators. Cleans up the
26633 code, and kills the ExpressionStatement dependency in Unary.
26635 (Unary): Removed `method' and `Arguments' from this class, making
26636 it smaller, and moving it all to SimpleCall, so I can reuse this
26637 code in other locations and avoid creating a lot of transient data
26638 strucutres when not required.
26640 * cs-parser.jay: Adjust for new changes.
26642 2001-11-11 Miguel de Icaza <miguel@ximian.com>
26644 * enum.cs (Enum.Populate): If there is a failure during
26647 * cs-parser.jay (opt_enum_base): we used to catch type errors
26648 here, but this is really incorrect. The type error should be
26649 catched during semantic analysis.
26651 2001-12-11 Ravi Pratap <ravi@ximian.com>
26653 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
26654 current_local_parameters as expected since I, in my stupidity, had forgotten
26657 * attribute.cs (GetValidPlaces): Fix stupid bug.
26659 * class.cs (Method::Emit): Perform check on applicability of attributes.
26661 (Constructor::Emit): Ditto.
26663 (Field::Emit): Ditto.
26665 (Field.Location): Store location information.
26667 (Property, Event, Indexer, Operator): Ditto.
26669 * cs-parser.jay (field_declaration): Pass in location for each field.
26671 * ../errors/cs0592.cs : Add.
26673 2001-11-12 Ravi Pratap <ravi@ximian.com>
26675 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
26677 (InitCoreTypes): Update accordingly.
26679 (RegisterAttrType, LookupAttr): Implement.
26681 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
26682 info about the same.
26684 (Resolve): Update to populate the above as necessary.
26686 (Error592): Helper.
26688 (GetValidPlaces): Helper to the above.
26690 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
26692 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
26694 2001-11-12 Ravi Pratap <ravi@ximian.com>
26696 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
26698 * ../errors/cs0617.cs : Add.
26700 2001-11-11 Ravi Pratap <ravi@ximian.com>
26702 * enum.cs (Emit): Rename to Populate to be more consistent with what
26703 we expect it to do and when exactly it is called.
26705 * class.cs, rootcontext.cs : Update accordingly.
26707 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
26708 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
26710 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
26712 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
26713 of a fieldinfo using the above, when dealing with a FieldBuilder.
26715 2001-11-10 Ravi Pratap <ravi@ximian.com>
26717 * ../errors/cs0031.cs : Add.
26719 * ../errors/cs1008.cs : Add.
26721 * ../errrors/cs0543.cs : Add.
26723 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
26726 (FindMembers): Implement.
26728 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
26729 enums and delegates too.
26731 (enum_types): Rename to builder_to_enum.
26733 (delegate_types): Rename to builder_to_delegate.
26735 * delegate.cs (FindMembers): Implement.
26737 2001-11-09 Ravi Pratap <ravi@ximian.com>
26739 * typemanager.cs (IsEnumType): Implement.
26741 * enum.cs (Emit): Re-write parts to account for the underlying type
26742 better and perform checking etc.
26744 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
26745 of the underlying type.
26747 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
26750 * enum.cs (error31): Helper to report error #31.
26752 * cs-parser.jay (enum_declaration): Store location of each member too.
26754 * enum.cs (member_to_location): New hashtable.
26756 (AddEnumMember): Update location hashtable.
26758 (Emit): Use the location of each member while reporting errors.
26760 2001-11-09 Miguel de Icaza <miguel@ximian.com>
26762 * cs-parser.jay: A for_initializer if is a
26763 local_variable_declaration really ammount to have an implicit
26764 block with the variable declaration and no initializer for for.
26766 * statement.cs (For.Emit): Cope with null initializers.
26768 This fixes the infinite loop on for initializers.
26770 2001-11-08 Miguel de Icaza <miguel@ximian.com>
26772 * enum.cs: More cleanup.
26774 * ecore.cs: Remove dead code.
26776 * class.cs (Property.Emit): More simplification.
26777 (Event.Emit): ditto.
26779 Reworked to have less levels of indentation.
26781 2001-11-08 Ravi Pratap <ravi@ximian.com>
26783 * class.cs (Property): Emit attributes.
26793 * enum.cs (Emit): Ditto.
26795 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
26798 * class.cs (Field, Event, etc.): Move attribute generation into the
26799 Emit method everywhere.
26801 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
26802 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
26803 as we had no way of defining nested enums !
26805 * rootcontext.cs : Adjust code accordingly.
26807 * typemanager.cs (AddEnumType): To keep track of enum types separately.
26809 2001-11-07 Ravi Pratap <ravi@ximian.com>
26811 * expression.cs (EvalConstantExpression): Move into ecore.cs
26813 * enum.cs (Enum): Rename some members and make them public and readonly
26814 according to our convention.
26816 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
26819 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
26821 (Enum::Emit): Write a simple version for now which doesn't try to compute
26822 expressions. I shall modify this to be more robust in just a while.
26824 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
26826 (TypeContainer::CloseType): Create the Enum types too.
26828 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
26830 * expression.cs (EvalConstantExpression): Get rid of completely.
26832 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
26833 user-defined values and other cases.
26835 (IsValidEnumLiteral): Helper function.
26837 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
26838 out there in the case we had a literal FieldExpr.
26840 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
26842 (Literalize): Revamp a bit to take two arguments.
26844 (EnumLiteral): New class which derives from Literal to wrap enum literals.
26846 2001-11-06 Ravi Pratap <ravi@ximian.com>
26848 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
26850 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
26852 (Resolve): Use the above to ensure we have proper initializers.
26854 2001-11-05 Ravi Pratap <ravi@ximian.com>
26856 * expression.cs (Expression::EvalConstantExpression): New method to
26857 evaluate constant expressions.
26859 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
26861 2001-11-07 Miguel de Icaza <miguel@ximian.com>
26863 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
26866 (Binary.ResolveOperator): Handle operator != (object a, object b)
26867 and operator == (object a, object b);
26869 (Binary.DoNumericPromotions): Indicate whether the numeric
26870 promotion was possible.
26872 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
26875 Made the ArrayAccess implement interface IAssignMethod instead of
26876 IStackStore as the order in which arguments are passed reflects
26879 * assign.cs: Instead of using expr.ExprClass to select the way of
26880 assinging, probe for the IStackStore/IAssignMethod interfaces.
26882 * typemanager.cs: Load InitializeArray definition.
26884 * rootcontext.cs (RootContext.MakeStaticData): Used to define
26885 static data that can be used to initialize arrays.
26887 2001-11-05 Miguel de Icaza <miguel@ximian.com>
26889 * expression.cs: Handle operator== and operator!= for booleans.
26891 (Conditioal.Reduce): Implement reducer for the ?: operator.
26893 (Conditional.Resolve): Implement dead code elimination.
26895 (Binary.Resolve): Catch string literals and return a new
26896 concatenated string.
26898 (Unary.Reduce): Implement reduction of unary expressions.
26900 * ecore.cs: Split out the expression core handling here.
26902 (Expression.Reduce): New method used to perform constant folding
26903 and CSE. This is needed to support constant-expressions.
26905 * statement.cs (Statement.EmitBoolExpression): Pass true and false
26906 targets, and optimize for !x.
26908 2001-11-04 Ravi Pratap <ravi@ximian.com>
26910 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
26911 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
26912 set custom atttributes.
26914 * literal.cs (Literal::GetValue): New abstract method to return the actual
26915 value of the literal, cast as an object.
26917 (*Literal): Implement GetValue method.
26919 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
26920 expressions to the arraylist but objects of type Argument.
26922 * class.cs (TypeContainer::Emit): Emit our attributes too.
26924 (Method::Emit, Constructor::Emit): Ditto.
26926 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
26927 to be ignoring earlier.
26929 2001-11-03 Ravi Pratap <ravi@ximian.com>
26931 * attribute.cs (AttributeSection::Define): Implement to do the business
26932 of constructing a CustomAttributeBuilder.
26934 (Attribute): New trivial class. Increases readability of code.
26936 * cs-parser.jay : Update accordingly.
26938 (positional_argument_list, named_argument_list, named_argument): New rules
26940 (attribute_arguments): Use the above so that we are more correct.
26942 2001-11-02 Ravi Pratap <ravi@ximian.com>
26944 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
26945 to perform all checks for a method with a params parameter.
26947 (Invocation::OverloadResolve): Update to use the above method and therefore
26948 cope correctly with params method invocations.
26950 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
26953 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
26954 constructors in our parent too because we can't afford to miss out on
26957 * attribute.cs (AttributeSection): New name for the class Attribute
26959 Other trivial changes to improve readability.
26961 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
26962 use the new class names.
26964 2001-11-01 Ravi Pratap <ravi@ximian.com>
26966 * class.cs (Method::Define): Complete definition for params types too
26968 (Indexer::Define): Ditto.
26970 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
26971 Cope everywhere with a request for info about the array parameter.
26973 2001-11-01 Ravi Pratap <ravi@ximian.com>
26975 * tree.cs (RecordNamespace): Fix up to check for the correct key.
26977 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
26978 local_variable_type to extract the string corresponding to the type.
26980 (local_variable_type): Fixup the action to use the new helper method.
26982 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
26985 * expression.cs : Clean out code which uses the above.
26987 2001-10-31 Ravi Pratap <ravi@ximian.com>
26989 * typemanager.cs (RegisterMethod): Check if we already have an existing key
26990 and bale out if necessary by returning a false.
26992 (RegisterProperty): Ditto.
26994 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
26995 and print out appropriate error messages.
26997 * interface.cs (everywhere): Ditto.
26999 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
27000 location to constructor.
27002 * class.cs (Property, Event, Indexer): Update accordingly.
27004 * ../errors/cs111.cs : Added.
27006 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
27007 of a method, as laid down by the spec.
27009 (Invocation::OverloadResolve): Use the above method.
27011 2001-10-31 Ravi Pratap <ravi@ximian.com>
27013 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
27014 now take a TypeContainer and a Parameters object.
27016 (ParameterData): Modify return type of ParameterModifier method to be
27017 Parameter.Modifier and not a string.
27019 (ReflectionParameters, InternalParameters): Update accordingly.
27021 * expression.cs (Argument::GetParameterModifier): Same here.
27023 * support.cs (InternalParameters::ParameterType): Find a better way of determining
27024 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
27025 symbol in it at all so maybe this is only for now.
27027 2001-10-30 Ravi Pratap <ravi@ximian.com>
27029 * support.cs (InternalParameters): Constructor now takes an extra argument
27030 which is the actual Parameters class.
27032 (ParameterDesc): Update to provide info on ref/out modifiers.
27034 * class.cs (everywhere): Update call to InternalParameters to pass in
27035 the second argument too.
27037 * support.cs (ParameterData): Add ParameterModifier, which is a method
27038 to return the modifier info [ref/out etc]
27040 (InternalParameters, ReflectionParameters): Implement the above.
27042 * expression.cs (Argument::ParameterModifier): Similar function to return
27043 info about the argument's modifiers.
27045 (Invocation::OverloadResolve): Update to take into account matching modifiers
27048 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
27049 a new SetFormalParameters object which we pass to InternalParameters.
27051 2001-10-30 Ravi Pratap <ravi@ximian.com>
27053 * expression.cs (NewArray): Merge into the ArrayCreation class.
27055 2001-10-29 Ravi Pratap <ravi@ximian.com>
27057 * expression.cs (NewArray): Merge classes NewBuiltinArray and
27058 NewUserdefinedArray into one as there wasn't much of a use in having
27061 * expression.cs (Argument): Change field's name to ArgType from Type.
27063 (Type): New readonly property which returns the proper type, taking into
27064 account ref/out modifiers.
27066 (everywhere): Adjust code accordingly for the above.
27068 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
27069 whether we are emitting for a ref or out parameter.
27071 * expression.cs (Argument::Emit): Use the above field to set the state.
27073 (LocalVariableReference::Emit): Update to honour the flag and emit the
27076 * parameter.cs (Attributes): Set the correct flags for ref parameters.
27078 * expression.cs (Argument::FullDesc): New function to provide a full desc.
27080 * support.cs (ParameterData): Add method ParameterDesc to the interface.
27082 (ReflectionParameters, InternalParameters): Implement the above method.
27084 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
27087 (Invocation::FullMethodDesc): Ditto.
27089 2001-10-29 Miguel de Icaza <miguel@ximian.com>
27091 * cs-parser.jay: Add extra production for the second form of array
27094 * expression.cs (ArrayCreation): Update to reflect the above
27097 * Small changes to prepare for Array initialization.
27099 2001-10-28 Miguel de Icaza <miguel@ximian.com>
27101 * typemanager.cs (ImplementsInterface): interface might be null;
27102 Deal with this problem;
27104 Also, we do store negative hits on the cache (null values), so use
27105 this instead of calling t.GetInterfaces on the type everytime.
27107 2001-10-28 Ravi Pratap <ravi@ximian.com>
27109 * typemanager.cs (IsBuiltinType): New method to help determine the same.
27111 * expression.cs (New::DoResolve): Get rid of array creation code and instead
27112 split functionality out into different classes.
27114 (New::FormArrayType): Move into NewBuiltinArray.
27116 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
27119 (NewBuiltinArray): New class to handle creation of built-in arrays.
27121 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
27122 account creation of one-dimensional arrays.
27124 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
27126 (NewUserdefinedArray::DoResolve): Implement.
27128 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
27130 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
27131 we maintain inside the TypeManager. This is necessary to perform lookups on the
27134 (LookupType): Update to perform GetType on the module builders too.
27136 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
27138 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
27140 2001-10-23 Ravi Pratap <ravi@ximian.com>
27142 * expression.cs (New::DoResolve): Implement guts of array creation.
27144 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
27146 2001-10-27 Miguel de Icaza <miguel@ximian.com>
27148 * expression.cs: Fix bug I introduced lsat night that broke
27151 (Expression.Resolve): Report a 246 error (can not resolve name)
27152 if we find a SimpleName in the stream.
27154 (Expression.ResolveLValue): Ditto.
27156 (Expression.ResolveWithSimpleName): This function is a variant of
27157 ResolveName, this one allows SimpleNames to be returned without a
27158 warning. The only consumer of SimpleNames is MemberAccess
27160 2001-10-26 Miguel de Icaza <miguel@ximian.com>
27162 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
27163 might arrive here. I have my doubts that this is correct.
27165 * statement.cs (Lock): Implement lock statement.
27167 * cs-parser.jay: Small fixes to support `lock' and `using'
27169 * cs-tokenizer.cs: Remove extra space
27171 * driver.cs: New flag --checked, allows to turn on integer math
27174 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
27175 Threading.Monitor.Exit
27177 2001-10-23 Miguel de Icaza <miguel@ximian.com>
27179 * expression.cs (IndexerAccess::DoResolveLValue): Set the
27180 Expression Class to be IndexerAccess.
27182 Notice that Indexer::DoResolve sets the eclass to Value.
27184 2001-10-22 Miguel de Icaza <miguel@ximian.com>
27186 * class.cs (TypeContainer::Emit): Emit code for indexers.
27188 * assign.cs (IAssignMethod): New interface implemented by Indexers
27189 and Properties for handling assignment.
27191 (Assign::Emit): Simplify and reuse code.
27193 * expression.cs (IndexerAccess, PropertyExpr): Implement
27194 IAssignMethod, clean up old code.
27196 2001-10-22 Ravi Pratap <ravi@ximian.com>
27198 * typemanager.cs (ImplementsInterface): New method to determine if a type
27199 implements a given interface. Provides a nice cache too.
27201 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
27204 (ConvertReferenceExplicit): Ditto.
27206 * delegate.cs (Delegate::Populate): Update to define the parameters on the
27207 various methods, with correct names etc.
27209 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
27210 Operator.UnaryNegation.
27212 * cs-parser.jay (operator_declarator): Be a little clever in the case where
27213 we have a unary plus or minus operator.
27215 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
27218 * everywhere : update accordingly.
27220 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
27223 * class.cs (Method::Define): For the case where we are implementing a method
27224 inherited from an interface, we need to set the MethodAttributes.Final flag too.
27225 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
27227 2001-10-21 Ravi Pratap <ravi@ximian.com>
27229 * interface.cs (FindMembers): Implement to work around S.R.E
27232 * typemanager.cs (IsInterfaceType): Implement.
27234 (FindMembers): Update to handle interface types too.
27236 * expression.cs (ImplicitReferenceConversion): Re-write bits which
27237 use IsAssignableFrom as that is not correct - it doesn't work.
27239 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
27240 and accordingly override EmitStatement.
27242 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
27243 using the correct logic :-)
27245 2001-10-19 Ravi Pratap <ravi@ximian.com>
27247 * ../errors/cs-11.cs : Add to demonstrate error -11
27249 2001-10-17 Miguel de Icaza <miguel@ximian.com>
27251 * assign.cs (Assign::Resolve): Resolve right hand side first, and
27252 then pass this as a hint to ResolveLValue.
27254 * expression.cs (FieldExpr): Add Location information
27256 (FieldExpr::LValueResolve): Report assignment to readonly
27259 (Expression::ExprClassFromMemberInfo): Pass location information.
27261 (Expression::ResolveLValue): Add new method that resolves an
27264 (Expression::DoResolveLValue): Default invocation calls
27267 (Indexers): New class used to keep track of indexers in a given
27270 (IStackStore): Renamed from LValue, as it did not really describe
27271 what this did. Also ResolveLValue is gone from this interface and
27272 now is part of Expression.
27274 (ElementAccess): Depending on the element access type
27276 * typemanager.cs: Add `indexer_name_type' as a Core type
27277 (System.Runtime.CompilerServices.IndexerNameAttribute)
27279 * statement.cs (Goto): Take a location.
27281 2001-10-18 Ravi Pratap <ravi@ximian.com>
27283 * delegate.cs (Delegate::VerifyDelegate): New method to verify
27284 if two delegates are compatible.
27286 (NewDelegate::DoResolve): Update to take care of the case when
27287 we instantiate a delegate from another delegate.
27289 * typemanager.cs (FindMembers): Don't even try to look up members
27290 of Delegate types for now.
27292 2001-10-18 Ravi Pratap <ravi@ximian.com>
27294 * delegate.cs (NewDelegate): New class to take care of delegate
27297 * expression.cs (New): Split the delegate related code out into
27298 the NewDelegate class.
27300 * delegate.cs (DelegateInvocation): New class to handle delegate
27303 * expression.cs (Invocation): Split out delegate related code into
27304 the DelegateInvocation class.
27306 2001-10-17 Ravi Pratap <ravi@ximian.com>
27308 * expression.cs (New::DoResolve): Implement delegate creation fully
27309 and according to the spec.
27311 (New::DoEmit): Update to handle delegates differently.
27313 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
27314 because of which we were printing out arguments in reverse order !
27316 * delegate.cs (VerifyMethod): Implement to check if the given method
27317 matches the delegate.
27319 (FullDelegateDesc): Implement.
27321 (VerifyApplicability): Implement.
27323 * expression.cs (Invocation::DoResolve): Update to accordingly handle
27324 delegate invocations too.
27326 (Invocation::Emit): Ditto.
27328 * ../errors/cs1593.cs : Added.
27330 * ../errors/cs1594.cs : Added.
27332 * delegate.cs (InstanceExpression, TargetMethod): New properties.
27334 2001-10-16 Ravi Pratap <ravi@ximian.com>
27336 * typemanager.cs (intptr_type): Core type for System.IntPtr
27338 (InitCoreTypes): Update for the same.
27340 (iasyncresult_type, asynccallback_type): Ditto.
27342 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
27345 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
27348 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
27349 the builders for the 4 members of a delegate type :-)
27351 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
27354 * expression.cs (New::DoResolve): Implement guts for delegate creation.
27356 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
27358 2001-10-15 Miguel de Icaza <miguel@ximian.com>
27360 * statement.cs (Break::Emit): Implement.
27361 (Continue::Emit): Implement.
27363 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
27364 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
27365 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
27366 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
27369 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
27370 properties that track the label for the current loop (begin of the
27371 loop and end of the loop).
27373 2001-10-15 Ravi Pratap <ravi@ximian.com>
27375 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
27376 use of emitting anything at all.
27378 * class.cs, rootcontext.cs : Get rid of calls to the same.
27380 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
27382 (Populate): Define the constructor correctly and set the implementation
27385 * typemanager.cs (delegate_types): New hashtable to hold delegates that
27388 (AddDelegateType): Implement.
27390 (IsDelegateType): Implement helper method.
27392 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
27394 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
27395 and accordingly handle it.
27397 * delegate.cs (Populate): Take TypeContainer argument.
27398 Implement bits to define the Invoke method. However, I still haven't figured out
27399 how to take care of the native int bit :-(
27401 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
27402 Qualify the name of the delegate, not its return type !
27404 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
27407 (StandardConversionExists): Checking for array types turns out to be recursive.
27409 (ConvertReferenceExplicit): Implement array conversion.
27411 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
27413 2001-10-12 Ravi Pratap <ravi@ximian.com>
27415 * cs-parser.jay (delegate_declaration): Store the fully qualified
27416 name as it is a type declaration.
27418 * delegate.cs (ReturnType, Name): Rename members to these. Make them
27421 (DefineDelegate): Renamed from Define. Does the same thing essentially,
27422 as TypeContainer::DefineType.
27424 (Populate): Method in which all the definition of the various methods (Invoke)
27427 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
27430 (CloseDelegate): Finally creates the delegate.
27432 * class.cs (TypeContainer::DefineType): Update to define delegates.
27433 (Populate, Emit and CloseType): Do the same thing here too.
27435 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
27436 delegates in all these operations.
27438 2001-10-14 Miguel de Icaza <miguel@ximian.com>
27440 * expression.cs: LocalTemporary: a new expression used to
27441 reference a temporary that has been created.
27443 * assign.cs: Handle PropertyAccess back here, so that we can
27444 provide the proper semantic access to properties.
27446 * expression.cs (Expression::ConvertReferenceExplicit): Implement
27447 a few more explicit conversions.
27449 * modifiers.cs: `NEW' modifier maps to HideBySig.
27451 * expression.cs (PropertyExpr): Make this into an
27452 ExpressionStatement, and support the EmitStatement code path.
27454 Perform get/set error checking, clean up the interface.
27456 * assign.cs: recognize PropertyExprs as targets, and if so, turn
27457 them into toplevel access objects.
27459 2001-10-12 Miguel de Icaza <miguel@ximian.com>
27461 * expression.cs: PropertyExpr::PropertyExpr: use work around the
27464 * typemanager.cs: Keep track here of our PropertyBuilders again to
27465 work around lameness in SRE.
27467 2001-10-11 Miguel de Icaza <miguel@ximian.com>
27469 * expression.cs (LValue::LValueResolve): New method in the
27470 interface, used to perform a second resolution pass for LValues.
27472 (This::DoResolve): Catch the use of this in static methods.
27474 (This::LValueResolve): Implement.
27476 (This::Store): Remove warning, assigning to `this' in structures
27479 (Invocation::Emit): Deal with invocation of
27480 methods on value types. We need to pass the address to structure
27481 methods rather than the object itself. (The equivalent code to
27482 emit "this" for structures leaves the entire structure on the
27483 stack instead of a pointer to it).
27485 (ParameterReference::DoResolve): Compute the real index for the
27486 argument based on whether the method takes or not a `this' pointer
27487 (ie, the method is static).
27489 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
27490 value types returned from functions when we need to invoke a
27491 method on the sturcture.
27494 2001-10-11 Ravi Pratap <ravi@ximian.com>
27496 * class.cs (TypeContainer::DefineType): Method to actually do the business of
27497 defining the type in the Modulebuilder or Typebuilder. This is to take
27498 care of nested types which need to be defined on the TypeBuilder using
27499 DefineNestedMethod.
27501 (TypeContainer::GetClassBases): Implement. Essentially the code from the
27502 methods in RootContext, only ported to be part of TypeContainer.
27504 (TypeContainer::GetInterfaceOrClass): Ditto.
27506 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
27508 * interface.cs (Interface::DefineInterface): New method. Does exactly
27509 what RootContext.CreateInterface did earlier, only it takes care of nested types
27512 (Interface::GetInterfaces): Move from RootContext here and port.
27514 (Interface::GetInterfaceByName): Same here.
27516 * rootcontext.cs (ResolveTree): Re-write.
27518 (PopulateTypes): Re-write.
27520 * class.cs (TypeContainer::Populate): Populate nested types too.
27521 (TypeContainer::Emit): Emit nested members too.
27523 * typemanager.cs (AddUserType): Do not make use of the FullName property,
27524 instead just use the name argument passed in as it is already fully
27527 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
27528 to TypeContainer mapping to see if a type is user-defined.
27530 * class.cs (TypeContainer::CloseType): Implement.
27532 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
27533 the default constructor.
27535 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
27538 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
27540 * interface.cs (CloseType): Create the type here.
27542 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
27545 Remove all the methods which are now in TypeContainer.
27547 2001-10-10 Ravi Pratap <ravi@ximian.com>
27549 * delegate.cs (Define): Re-write bits to define the delegate
27552 2001-10-10 Miguel de Icaza <miguel@ximian.com>
27554 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
27556 * expression.cs (ImplicitReferenceConversion): handle null as well
27557 as a source to convert to any reference type.
27559 * statement.cs (Return): Perform any implicit conversions to
27560 expected return type.
27562 Validate use of return statement.
27564 * codegen.cs (EmitContext): Pass the expected return type here.
27566 * class.cs (Method, Constructor, Property): Pass expected return
27567 type to EmitContext.
27569 2001-10-09 Miguel de Icaza <miguel@ximian.com>
27571 * expression.cs: Make DoResolve take an EmitContext instead of a
27574 Replaced `l' and `location' for `loc', for consistency.
27576 (Error, Warning): Remove unneeded Tc argument.
27578 * assign.cs, literal.cs, constant.cs: Update to new calling
27581 * codegen.cs: EmitContext now contains a flag indicating whether
27582 code is being generated in a static method or not.
27584 * cs-parser.jay: DecomposeQI, new function that replaces the old
27585 QualifiedIdentifier. Now we always decompose the assembled
27586 strings from qualified_identifier productions into a group of
27589 2001-10-08 Miguel de Icaza <miguel@ximian.com>
27591 * rootcontext.cs: Deal with field-less struct types correctly now
27592 by passing the size option to Define Type.
27594 * class.cs: Removed hack that created one static field.
27596 2001-10-07 Miguel de Icaza <miguel@ximian.com>
27598 * statement.cs: Moved most of the code generation here.
27600 2001-10-09 Ravi Pratap <ravi@ximian.com>
27602 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
27605 (ElementAccess): Remove useless bits for now - keep checks as the spec
27608 2001-10-08 Ravi Pratap <ravi@ximian.com>
27610 * expression.cs (ElementAccess::DoResolve): Remove my crap code
27611 and start performing checks according to the spec.
27613 2001-10-07 Ravi Pratap <ravi@ximian.com>
27615 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
27616 rank_specifiers instead.
27618 (rank_specifiers): Change the order in which the rank specifiers are stored
27620 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
27622 * expression.cs (ElementAccess): Implement the LValue interface too.
27624 2001-10-06 Ravi Pratap <ravi@ximian.com>
27626 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
27627 except that user defined conversions are not included.
27629 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
27630 perform the conversion of the return type, if necessary.
27632 (New::DoResolve): Check whether we are creating an array or an object
27633 and accordingly do the needful.
27635 (New::Emit): Same here.
27637 (New::DoResolve): Implement guts of array creation.
27639 (New::FormLookupType): Helper function.
27641 2001-10-07 Miguel de Icaza <miguel@ximian.com>
27643 * codegen.cs: Removed most of the code generation here, and move the
27644 corresponding code generation bits to the statement classes.
27646 Added support for try/catch/finalize and throw.
27648 * cs-parser.jay: Added support for try/catch/finalize.
27650 * class.cs: Catch static methods having the flags override,
27651 virtual or abstract.
27653 * expression.cs (UserCast): This user cast was not really doing
27654 what it was supposed to do. Which is to be born in fully resolved
27655 state. Parts of the resolution were being performed at Emit time!
27659 2001-10-05 Miguel de Icaza <miguel@ximian.com>
27661 * expression.cs: Implicity convert the result from UserCast.
27663 2001-10-05 Ravi Pratap <ravi@ximian.com>
27665 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
27666 prevented it from working correctly.
27668 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
27669 merely ConvertImplicit.
27671 2001-10-05 Miguel de Icaza <miguel@ximian.com>
27673 * typemanager.cs: Make the LookupTypeContainer function static,
27674 and not per-instance.
27676 * class.cs: Make static FindMembers (the one that takes a Type
27679 * codegen.cs: Add EmitForeach here.
27681 * cs-parser.jay: Make foreach a toplevel object instead of the
27682 inline expansion, as we need to perform semantic analysis on it.
27684 2001-10-05 Ravi Pratap <ravi@ximian.com>
27686 * expression.cs (Expression::ImplicitUserConversion): Rename to
27687 UserDefinedConversion.
27689 (Expression::UserDefinedConversion): Take an extra argument specifying
27690 whether we look for explicit user conversions too.
27692 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
27694 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
27696 (ExplicitUserConversion): Make it a call to UserDefinedConversion
27697 with the appropriate arguments.
27699 * cs-parser.jay (cast_expression): Record location too.
27701 * expression.cs (Cast): Record location info.
27703 (Expression::ConvertExplicit): Take location argument.
27705 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
27706 to determine if we are doing explicit conversions.
27708 (UserCast::Emit): Update accordingly.
27710 (Expression::ConvertExplicit): Report an error if everything fails.
27712 * ../errors/cs0030.cs : Add.
27714 2001-10-04 Miguel de Icaza <miguel@ximian.com>
27716 * modifiers.cs: If the ABSTRACT keyword is present, also set the
27717 virtual and newslot bits.
27719 * class.cs (TypeContainer::RegisterRequiredImplementations):
27720 Record methods we need.
27722 (TypeContainer::MakeKey): Helper function to make keys for
27723 MethodBases, since the Methodbase key is useless.
27725 (TypeContainer::Populate): Call RegisterRequiredImplementations
27726 before defining the methods.
27728 Create a mapping for method_builders_to_methods ahead of time
27729 instead of inside a tight loop.
27731 (::RequireMethods): Accept an object as the data to set into the
27732 hashtable so we can report interface vs abstract method mismatch.
27734 2001-10-03 Miguel de Icaza <miguel@ximian.com>
27736 * report.cs: Make all of it static.
27738 * rootcontext.cs: Drop object_type and value_type computations, as
27739 we have those in the TypeManager anyways.
27741 Drop report instance variable too, now it is a global.
27743 * driver.cs: Use try/catch on command line handling.
27745 Add --probe option to debug the error reporting system with a test
27748 * report.cs: Add support for exiting program when a probe
27749 condition is reached.
27751 2001-10-03 Ravi Pratap <ravi@ximian.com>
27753 * expression.cs (Binary::DoNumericPromotions): Fix the case when
27754 we do a forcible conversion regardless of type, to check if
27755 ForceConversion returns a null.
27757 (Binary::error19): Use location to report error.
27759 (Unary::error23): Use location here too.
27761 * ../errors/cs0019.cs : Check in.
27763 * ../errors/cs0023.cs : Check in.
27765 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
27766 case of a non-null MethodInfo object with a length of 0 !
27768 (Binary::ResolveOperator): Flag error if overload resolution fails to find
27769 an applicable member - according to the spec :-)
27770 Also fix logic to find members in base types.
27772 (Unary::ResolveOperator): Same here.
27774 (Unary::report23): Change name to error23 and make first argument a TypeContainer
27775 as I was getting thoroughly confused between this and error19 :-)
27777 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
27778 (::FindMostEncompassedType): Implement.
27779 (::FindMostEncompassingType): Implement.
27780 (::StandardConversionExists): Implement.
27782 (UserImplicitCast): Re-vamp. We now need info about most specific
27783 source and target types so that we can do the necessary conversions.
27785 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
27786 mathematical union with no duplicates.
27788 2001-10-03 Miguel de Icaza <miguel@ximian.com>
27790 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
27791 in order from base classes to child classes, so that we can in
27792 child classes look up in our parent for method names and
27793 attributes (required for handling abstract, virtual, new, override
27794 constructs: we need to instrospect our base class, and if we dont
27795 populate the classes in order, the introspection might be
27796 incorrect. For example, a method could query its parent before
27797 the parent has any methods and would determine that the parent has
27798 no abstract methods (while it could have had them)).
27800 (RootContext::CreateType): Record the order in which we define the
27803 2001-10-02 Miguel de Icaza <miguel@ximian.com>
27805 * class.cs (TypeContainer::Populate): Also method definitions can
27806 fail now, keep track of this.
27808 (TypeContainer::FindMembers): Implement support for
27809 DeclaredOnly/noDeclaredOnly flag.
27811 (Constructor::Emit) Return the ConstructorBuilder.
27813 (Method::Emit) Return the MethodBuilder.
27814 Check for abstract or virtual methods to be public.
27816 * rootcontext.cs (RootContext::CreateType): Register all the
27817 abstract methods required for the class to be complete and the
27818 interface methods that must be implemented.
27820 * cs-parser.jay: Report error 501 (method requires body if it is
27821 not marked abstract or extern).
27823 * expression.cs (TypeOf::Emit): Implement.
27825 * typemanager.cs: runtime_handle_type, new global type.
27827 * class.cs (Property::Emit): Generate code for properties.
27829 2001-10-02 Ravi Pratap <ravi@ximian.com>
27831 * expression.cs (Unary::ResolveOperator): Find operators on base type
27832 too - we now conform exactly to the spec.
27834 (Binary::ResolveOperator): Same here.
27836 * class.cs (Operator::Define): Fix minor quirk in the tests.
27838 * ../errors/cs0215.cs : Added.
27840 * ../errors/cs0556.cs : Added.
27842 * ../errors/cs0555.cs : Added.
27844 2001-10-01 Miguel de Icaza <miguel@ximian.com>
27846 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
27847 single integer which is really efficient
27849 2001-10-01 Ravi Pratap <ravi@ximian.com>
27851 * expression.cs (Expression::ImplicitUserConversion): Use location
27852 even in the case when we are examining True operators.
27854 * class.cs (Operator::Define): Perform extensive checks to conform
27855 with the rules for operator overloading in the spec.
27857 * expression.cs (Expression::ImplicitReferenceConversion): Implement
27858 some of the other conversions mentioned in the spec.
27860 * typemanager.cs (array_type): New static member for the System.Array built-in
27863 (cloneable_interface): For System.ICloneable interface.
27865 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
27866 we start resolving the tree and populating types.
27868 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
27870 2001-10-01 Miguel de Icaza <miguel@ximian.com>
27872 * expression.cs (Expression::ExprClassFromMemberInfo,
27873 Expression::Literalize): Create literal expressions from
27874 FieldInfos which are literals.
27876 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
27877 type casts, because they were wrong. The test suite in tests
27880 (ImplicitNumericConversion): ushort to ulong requires a widening
27883 Int32 constant to long requires widening cast as well.
27885 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
27886 for integers because the type on the stack is not i4.
27888 2001-09-30 Miguel de Icaza <miguel@ximian.com>
27890 * expression.cs (report118): require location argument.
27892 * parameter.cs: Do not dereference potential null value.
27894 * class.cs: Catch methods that lack the `new' keyword when
27895 overriding a name. Report warnings when `new' is used without
27896 anything being there to override.
27898 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
27900 * class.cs: Only add constructor to hashtable if it is non-null
27901 (as now constructors can fail on define).
27903 (TypeManager, Class, Struct): Take location arguments.
27905 Catch field instance initialization in structs as errors.
27907 accepting_filter: a new filter for FindMembers that is static so
27908 that we dont create an instance per invocation.
27910 (Constructor::Define): Catch errors where a struct constructor is
27913 * cs-parser.jay: Pass location information for various new
27916 * delegate.cs (Delegate): take a location argument.
27918 * driver.cs: Do not call EmitCode if there were problesm in the
27919 Definition of the types, as many Builders wont be there.
27921 * decl.cs (Decl::Decl): Require a location argument.
27923 * cs-tokenizer.cs: Handle properly hex constants that can not fit
27924 into integers, and find the most appropiate integer for it.
27926 * literal.cs: Implement ULongLiteral.
27928 * rootcontext.cs: Provide better information about the location of
27929 failure when CreateType fails.
27931 2001-09-29 Miguel de Icaza <miguel@ximian.com>
27933 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
27936 * expression.cs (Binary::CheckShiftArguments): Add missing type
27938 (Binary::ResolveOperator): Add type to the logical and and logical
27939 or, Bitwise And/Or and Exclusive Or code paths, it was missing
27942 (Binary::DoNumericPromotions): In the case where either argument
27943 is ulong (and most signed types combined with ulong cause an
27944 error) perform implicit integer constant conversions as well.
27946 2001-09-28 Miguel de Icaza <miguel@ximian.com>
27948 * expression.cs (UserImplicitCast): Method should always be
27950 (Invocation::BetterConversion): Simplified test for IntLiteral.
27952 (Expression::ImplicitNumericConversion): Split this routine out.
27953 Put the code that performs implicit constant integer conversions
27956 (Expression::Resolve): Become a wrapper around DoResolve so we can
27957 check eclass and type being set after resolve.
27959 (Invocation::Badness): Remove this dead function
27961 (Binary::ResolveOperator): Do not compute the expensive argumnets
27962 unless we have a union for it.
27964 (Probe::Emit): Is needs to do an isinst and then
27965 compare against null.
27967 (::CanConvert): Added Location argument. If the Location argument
27968 is null (Location.Null), then we do not report errors. This is
27969 used by the `probe' mechanism of the Explicit conversion. We do
27970 not want to generate an error for something that the user
27971 explicitly requested to be casted. But the pipeline for an
27972 explicit cast first tests for potential implicit casts.
27974 So for now, if the Location is null, it means `Probe only' to
27975 avoid adding another argument. Might have to revise this
27978 (ClassCast): New class used to type cast objects into arbitrary
27979 classes (used in Explicit Reference Conversions).
27981 Implement `as' as well.
27983 Reverted all the patches from Ravi below: they were broken:
27985 * The use of `level' as a mechanism to stop recursive
27986 invocations is wrong. That was there just to catch the
27987 bug with a strack trace but not as a way of addressing
27990 To fix the problem we have to *understand* what is going
27991 on and the interactions and come up with a plan, not
27992 just get things going.
27994 * The use of the type conversion cache that I proposed
27995 last night had an open topic: How does this work across
27996 protection domains. A user defined conversion might not
27997 be public in the location where we are applying the
27998 conversion, a different conversion might be selected
27999 (ie, private A->B (better) but public B->A (worse),
28000 inside A, A->B applies, but outside it, B->A will
28003 * On top of that (ie, even if the above is solved),
28004 conversions in a cache need to be abstract. Ie, `To
28005 convert from an Int to a Short use an OpcodeCast', not
28006 `To convert from an Int to a Short use the OpcodeCast on
28007 the variable 5' (which is what this patch was doing).
28009 2001-09-28 Ravi Pratap <ravi@ximian.com>
28011 * expression.cs (Invocation::ConversionExists): Re-write to use
28012 the conversion cache
28014 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
28015 cache all conversions done, not just user-defined ones.
28017 (Invocation::BetterConversion): The real culprit. Use ConversionExists
28018 to determine if a conversion exists instead of acutually trying to
28019 perform the conversion. It's faster too.
28021 (Expression::ConvertExplicit): Modify to use ConversionExists to check
28022 and only then attempt the implicit conversion.
28024 2001-09-28 Ravi Pratap <ravi@ximian.com>
28026 * expression.cs (ConvertImplicit): Use a cache for conversions
28027 already found. Check level of recursion and bail out if necessary.
28029 2001-09-28 Miguel de Icaza <miguel@ximian.com>
28031 * typemanager.cs (string_concat_string_string, string_concat_object_object):
28032 Export standard methods that we expect for string operations.
28034 * statement.cs (Block::UsageWarning): Track usage of variables and
28035 report the errors for not used variables.
28037 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
28040 2001-09-27 Miguel de Icaza <miguel@ximian.com>
28042 * codegen.cs: remove unnneded code
28044 * expression.cs: Removed BuiltinTypeAccess class
28046 Fix the order in which implicit conversions are
28049 The previous fixed dropped support for boxed conversions (adding a
28050 test to the test suite now)
28052 (UserImplicitCast::CanConvert): Remove test for source being null,
28053 that code is broken. We should not feed a null to begin with, if
28054 we do, then we should track the bug where the problem originates
28055 and not try to cover it up here.
28057 Return a resolved expression of type UserImplicitCast on success
28058 rather than true/false. Ravi: this is what I was talking about,
28059 the pattern is to use a static method as a "constructor" for
28062 Also, do not create arguments until the very last minute,
28063 otherwise we always create the arguments even for lookups that
28064 will never be performed.
28066 (UserImplicitCast::Resolve): Eliminate, objects of type
28067 UserImplicitCast are born in a fully resolved state.
28069 * typemanager.cs (InitCoreTypes): Init also value_type
28070 (System.ValueType).
28072 * expression.cs (Cast::Resolve): First resolve the child expression.
28074 (LValue): Add new method AddressOf to be used by
28077 Change the argument of Store to take an EmitContext instead of an
28078 ILGenerator, because things like FieldExpr need to be able to call
28079 their children expression to generate the instance code.
28081 (Expression::Error, Expression::Warning): Sugar functions for
28084 (Expression::MemberLookup): Accept a TypeContainer instead of a
28085 Report as the first argument.
28087 (Expression::ResolvePrimary): Killed. I still want to improve
28088 this as currently the code is just not right.
28090 (Expression::ResolveMemberAccess): Simplify, but it is still
28093 (Unary::Resolve): Catch errors in AddressOf operators.
28095 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
28096 index to a byte for the short-version, or the compiler will choose
28097 the wrong Emit call, which generates the wrong data.
28099 (ParameterReference::Emit, ::Store): same.
28101 (FieldExpr::AddressOf): Implement.
28103 * typemanager.cs: TypeManager: made public variable instead of
28106 * driver.cs: document --fatal.
28108 * report.cs (ErrorMessage, WarningMessage): new names for the old
28109 Error and Warning classes.
28111 * cs-parser.jay (member_access): Turn built-in access to types
28112 into a normal simplename
28114 2001-09-27 Ravi Pratap <ravi@ximian.com>
28116 * expression.cs (Invocation::BetterConversion): Fix to cope
28117 with q being null, since this was introducing a bug.
28119 * expression.cs (ConvertImplicit): Do built-in conversions first.
28121 2001-09-27 Ravi Pratap <ravi@ximian.com>
28123 * expression.cs (UserImplicitCast::Resolve): Fix bug.
28125 2001-09-27 Ravi Pratap <ravi@ximian.com>
28127 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
28128 I had introduced long ago (what's new ?).
28130 * expression.cs (UserImplicitCast::CanConvert): Static method to do
28131 the work of all the checking.
28132 (ConvertImplicit): Call CanConvert and only then create object if necessary.
28133 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
28135 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
28136 that is the right way.
28138 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
28139 overloading resolution. Use everywhere instead of cutting and pasting code.
28141 (Binary::ResolveOperator): Use MakeUnionSet.
28143 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
28144 we have to convert to bool types. Not complete yet.
28146 2001-09-27 Miguel de Icaza <miguel@ximian.com>
28148 * typemanager.cs (TypeManager::CSharpName): support ushort.
28150 * expression.cs (Expression::TryImplicitIntConversion): Attempts
28151 to provide an expression that performsn an implicit constant int
28152 conversion (section 6.1.6).
28153 (Expression::ConvertImplicitRequired): Reworked to include
28154 implicit constant expression conversions.
28156 (Expression::ConvertNumericExplicit): Finished.
28158 (Invocation::Emit): If InstanceExpression is null, then it means
28159 that we perform a call on this.
28161 2001-09-26 Miguel de Icaza <miguel@ximian.com>
28163 * expression.cs (Unary::Emit): Remove some dead code.
28164 (Probe): Implement Resolve and Emit for `is'.
28165 (Expression::ConvertImplicitRequired): Attempt to do constant
28166 expression conversions here. Maybe should be moved to
28167 ConvertImplicit, but I am not sure.
28168 (Expression::ImplicitLongConstantConversionPossible,
28169 Expression::ImplicitIntConstantConversionPossible): New functions
28170 that tell whether is it possible to apply an implicit constant
28171 expression conversion.
28173 (ConvertNumericExplicit): Started work on explicit numeric
28176 * cs-parser.jay: Update operator constants.
28178 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
28179 (Parameters::GetSignature): Hook up VerifyArgs here.
28180 (Parameters::VerifyArgs): Verifies that no two arguments have the
28183 * class.cs (Operator): Update the operator names to reflect the
28184 ones that the spec expects (as we are just stringizing the
28187 * expression.cs (Unary::ResolveOperator): Fix bug: Use
28188 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
28189 previous usage did only work for our methods.
28190 (Expression::ConvertImplicit): Handle decimal implicit numeric
28191 conversions as well.
28192 (Expression::InternalTypeConstructor): Used to invoke constructors
28193 on internal types for default promotions.
28195 (Unary::Emit): Implement special handling for the pre/post
28196 increment/decrement for overloaded operators, as they need to have
28197 the same semantics as the other operators.
28199 (Binary::ResolveOperator): ditto.
28200 (Invocation::ConversionExists): ditto.
28201 (UserImplicitCast::Resolve): ditto.
28203 2001-09-26 Ravi Pratap <ravi@ximian.com>
28205 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
28206 operator, return after emitting body. Regression tests pass again !
28208 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
28209 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
28210 (Invocation::OverloadResolve): Ditto.
28211 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
28213 * everywhere : update calls to the above methods accordingly.
28215 2001-09-26 Miguel de Icaza <miguel@ximian.com>
28217 * assign.cs (Assign): Make it inherit from ExpressionStatement.
28219 * expression.cs (ExpressionStatement): New base class used for
28220 expressions that can appear in statements, so that we can provide
28221 an alternate path to generate expression that do not leave a value
28224 (Expression::Emit, and all the derivatives): We no longer return
28225 whether a value is left on the stack or not. Every expression
28226 after being emitted leaves a single value on the stack.
28228 * codegen.cs (EmitContext::EmitStatementExpression): Use the
28229 facilties of ExpressionStatement if possible.
28231 * cs-parser.jay: Update statement_expression.
28233 2001-09-25 Miguel de Icaza <miguel@ximian.com>
28235 * driver.cs: Change the wording of message
28237 2001-09-25 Ravi Pratap <ravi@ximian.com>
28239 * expression.cs (Binary::ResolveOperator): Had forgottten to set
28240 the type of the expression to the return type of the method if
28241 we have an overloaded operator match ! The regression tests pass again !
28242 (Unary::ResolveOperator): Ditto.
28244 * expression.cs (Invocation::ConversionExists): Correct the member lookup
28245 to find "op_Implicit", not "implicit" ;-)
28246 (UserImplicitCast): New class to take care of user-defined implicit conversions.
28247 (ConvertImplicit, ForceConversion): Take TypeContainer argument
28249 * everywhere : Correct calls to the above accordingly.
28251 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
28252 (ConvertImplicit): Do user-defined conversion if it exists.
28254 2001-09-24 Miguel de Icaza <miguel@ximian.com>
28256 * assign.cs: track location.
28257 (Resolve): Use implicit conversions on assignment.
28259 * literal.cs: Oops. Not good, Emit of short access values should
28260 pass (Bytes) or the wrong argument will be selected.
28262 * expression.cs (Unary::Emit): Emit code for -expr.
28264 (Unary::ResolveOperator): Handle `Substract' for non-constants
28265 (substract from zero from the non-constants).
28266 Deal with Doubles as well.
28268 (Expression::ConvertImplicitRequired): New routine that reports an
28269 error if no implicit conversion exists.
28271 (Invocation::OverloadResolve): Store the converted implicit
28272 expressions if we make them
28274 2001-09-24 Ravi Pratap <ravi@ximian.com>
28276 * class.cs (ConstructorInitializer): Take a Location argument.
28277 (ConstructorBaseInitializer): Same here.
28278 (ConstructorThisInitializer): Same here.
28280 * cs-parser.jay : Update all calls accordingly.
28282 * expression.cs (Unary, Binary, New): Take location argument.
28283 Update accordingly everywhere.
28285 * cs-parser.jay : Update all calls to the above to take a location
28288 * class.cs : Ditto.
28290 2001-09-24 Ravi Pratap <ravi@ximian.com>
28292 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
28293 (Invocation::BetterConversion): Same here
28294 (Invocation::ConversionExists): Ditto.
28296 (Invocation::ConversionExists): Implement.
28298 2001-09-22 Ravi Pratap <ravi@ximian.com>
28300 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
28301 Also take an additional TypeContainer argument.
28303 * All over : Pass in TypeContainer as argument to OverloadResolve.
28305 * typemanager.cs (CSharpName): Update to check for the string type and return
28308 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
28311 2001-09-21 Ravi Pratap <ravi@ximian.com>
28313 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
28314 (Invocation::BetterFunction): Implement.
28315 (Invocation::BetterConversion): Implement.
28316 (Invocation::ConversionExists): Skeleton, no implementation yet.
28318 Okay, things work fine !
28320 2001-09-21 Miguel de Icaza <miguel@ximian.com>
28322 * typemanager.cs: declare and load enum_type, delegate_type and
28325 * expression.cs (Expression::Emit): Now emit returns a value that
28326 tells whether a value is left on the stack or not. This strategy
28327 might be reveted tomorrow with a mechanism that would address
28328 multiple assignments.
28329 (Expression::report118): Utility routine to report mismatches on
28332 (Unary::Report23): Report impossible type/operator combination
28335 (Unary::IsIncrementableNumber): Whether the type can be
28336 incremented or decremented with add.
28337 (Unary::ResolveOperator): Also allow enumerations to be bitwise
28339 (Unary::ResolveOperator): Implement ++, !, ~,
28341 (Invocation::Emit): Deal with new Emit convetion.
28343 * All Expression derivatives: Updated their Emit method to return
28344 whether they leave values on the stack or not.
28346 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
28347 stack for expressions that are statements.
28349 2001-09-20 Miguel de Icaza <miguel@ximian.com>
28351 * expression.cs (LValue): New interface. Must be implemented by
28353 (LocalVariableReference, ParameterReference, FieldExpr): Implement
28356 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
28357 interface for generating code, simplifies the code.
28359 2001-09-20 Ravi Pratap <ravi@ximian.com>
28361 * expression.cs (everywhere): Comment out return statements in ::Resolve
28362 methods to avoid the warnings.
28364 2001-09-20 Miguel de Icaza <miguel@ximian.com>
28366 * driver.cs (parse): Report error 2001 if we can not open the
28369 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
28372 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
28375 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
28376 otherwise nested blocks end up with the same index.
28378 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
28380 * expression.cs: Instead of having FIXMEs in the Resolve
28381 functions, throw exceptions so it is obvious that we are facing a
28384 * cs-parser.jay (invocation_expression): Pass Location information.
28386 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
28387 Use a basename for those routines because .NET does not like paths
28390 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
28393 2001-09-19 Miguel de Icaza <miguel@ximian.com>
28395 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
28396 are loading the correct data types (throws an exception if not).
28397 (TypeManager::InitCoreTypes): Use CoreLookupType
28399 * expression.cs (Unary::ResolveOperator): return the child
28400 expression for expressions which are just +expr.
28401 (Unary::ResolveOperator): Return negative literals for -LITERAL
28402 expressions (otherwise they are Unary {Literal}).
28403 (Invocation::Badness): Take into account `Implicit constant
28404 expression conversions'.
28406 * literal.cs (LongLiteral): Implement long literal class.
28407 (IntLiteral): export the `Value' of the intliteral.
28409 2001-09-19 Ravi Pratap <ravi@ximian.com>
28411 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
28413 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
28414 instead of 'Operator'
28416 * expression.cs (Binary::ResolveOperator): Update accordingly.
28417 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
28420 * cs-parser.jay (unary_expression): Update to use the new names.
28422 * gen-treedump.cs (GetUnary): Same here.
28424 * expression.cs (Unary::Resolve): Implement.
28425 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
28426 operators are found instead of making noise ;-)
28427 (Unary::ResolveOperator): New method to do precisely the same thing which
28428 Binary::ResolveOperator does for Binary expressions.
28429 (Unary.method, .Arguments): Add.
28430 (Unary::OperName): Implement.
28431 (Unary::ForceConversion): Copy and Paste !
28433 * class.cs (Operator::Define): Fix a small bug for the case when we have
28436 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
28437 for the inbuilt operators. Only overloading works for now ;-)
28439 2001-09-18 Miguel de Icaza <miguel@ximian.com>
28441 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
28442 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
28444 * expression.cs (This::Emit): Implement.
28445 (This::Resolve): Implement.
28446 (TypeOf:Resolve): Implement.
28447 (Expression::ResolveSimpleName): Add an implicit this to instance
28449 (MemberAccess::Resolve): Deal with Parameters and Fields.
28450 Bind instance variable to Field expressions.
28451 (FieldExpr::Instance): New field used to track the expression that
28452 represents the object instance.
28453 (FieldExpr::Resolve): Track potential errors from MemberLookup not
28455 (FieldExpr::Emit): Implement.
28457 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
28458 the last instruction contains a return opcode to avoid generating
28459 the last `ret' instruction (this generates correct code, and it is
28460 nice to pass the peverify output).
28462 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
28463 initializer for static and instance variables.
28464 (Constructor::Emit): Allow initializer to be null in the case of
28465 static constructors. Only emit initializer for instance
28468 (TypeContainer::FindMembers): Return a null array if there are no
28471 Also fix the code for the MemberTypes.Method branch, as it was not
28472 scanning that for operators (or tried to access null variables before).
28474 * assign.cs (Assign::Emit): Handle instance and static fields.
28478 * driver.cs: Stop compilation if there are parse errors.
28480 * cs-parser.jay (constructor_declaration): Provide default base
28481 initializer for non-static constructors.
28482 (constructor_declarator): Do not provide a default base
28483 initializers if none was specified.
28484 Catch the fact that constructors should not have parameters.
28486 * class.cs: Do not emit parent class initializers for static
28487 constructors, that should be flagged as an error.
28489 2001-09-18 Ravi Pratap <ravi@ximian.com>
28491 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
28492 Move back code into TypeContainer::Populate.
28494 2001-09-18 Ravi Pratap <ravi@ximian.com>
28496 * class.cs (TypeContainer::AddConstructor): Fix the check to
28497 compare against Name, not Basename.
28498 (Operator::OpType): Change Plus and Minus to Add and Subtract.
28500 * cs-parser.jay : Update accordingly.
28502 * class.cs (TypeContainer::FindMembers): For the case where we are searching
28503 for methods, don't forget to look into the operators too.
28504 (RegisterMethodBuilder): Helper method to take care of this for
28505 methods, constructors and operators.
28506 (Operator::Define): Completely revamp.
28507 (Operator.OperatorMethod, MethodName): New fields.
28508 (TypeContainer::Populate): Move the registering of builders into
28509 RegisterMethodBuilder.
28510 (Operator::Emit): Re-write.
28512 * expression.cs (Binary::Emit): Comment out code path to emit method
28513 invocation stuff for the case when we have a user defined operator. I am
28514 just not able to get it right !
28516 2001-09-17 Miguel de Icaza <miguel@ximian.com>
28518 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
28521 (Expression::MemberLookup): Provide a version that allows to
28522 specify the MemberTypes and BindingFlags.
28524 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
28525 so it was not fetching variable information from outer blocks.
28527 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
28528 Beforefieldinit as it was buggy.
28530 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
28531 that Ravi put here.
28533 * class.cs (Constructor::Emit): Only emit if block is not null.
28534 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
28535 deal with this by semantically definining it as if the user had
28538 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
28539 constructors as we now "emit" them at a higher level.
28541 (TypeContainer::DefineDefaultConstructor): Used to define the
28542 default constructors if none was provided.
28544 (ConstructorInitializer): Add methods Resolve and Emit.
28546 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
28548 2001-09-17 Ravi Pratap <ravi@ximian.com>
28550 * class.cs (TypeContainer::EmitDefaultConstructor): Register
28551 the default constructor builder with our hashtable for methodbuilders
28554 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
28555 and argument_count is 0 in which case we have a match.
28556 (Binary::ResolveOperator): More null checking and miscellaneous coding
28559 2001-09-17 Ravi Pratap <ravi@ximian.com>
28561 * rootcontext.cs (IsNameSpace): Compare against null.
28563 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
28565 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
28566 and Unary::Operator.
28568 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
28571 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
28572 we have overloaded operators.
28573 (Binary::ResolveOperator): Implement the part which does the operator overload
28576 * class.cs (Operator::Emit): Implement.
28577 (TypeContainer::Emit): Emit the operators we have too.
28579 * expression.cs (Binary::Emit): Update to emit the appropriate code for
28580 the case when we have a user-defined operator.
28582 2001-09-17 Miguel de Icaza <miguel@ximian.com>
28584 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
28586 2001-09-16 Ravi Pratap <ravi@ximian.com>
28588 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
28589 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
28590 (Constructor::Emit): Implement.
28591 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
28592 if we have no work to do.
28593 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
28596 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
28597 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
28599 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
28602 2001-09-15 Ravi Pratap <ravi@ximian.com>
28604 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
28606 (Tree::RecordNamespace): Method to do what the name says ;-)
28607 (Tree::Namespaces): Property to get at the namespaces hashtable.
28609 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
28612 * rootcontext.cs (IsNamespace): Fixed it :-)
28614 2001-09-14 Miguel de Icaza <miguel@ximian.com>
28616 * class.cs (TypeContainer::FindMembers): Add support for
28618 (MethodCore): New class that encapsulates both the shared aspects
28619 of a Constructor and a Method.
28620 (Method, Constructor): Factored pieces into MethodCore.
28622 * driver.cs: Added --fatal which makes errors throw exceptions.
28623 Load System assembly as well as part of the standard library.
28625 * report.cs: Allow throwing exceptions on errors for debugging.
28627 * modifiers.cs: Do not use `parent', instead use the real type
28628 container to evaluate permission settings.
28630 * class.cs: Put Ravi's patch back in. He is right, and we will
28631 have to cope with the
28633 2001-09-14 Ravi Pratap <ravi@ximian.com>
28635 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
28636 FamORAssem, not FamANDAssem.
28638 2001-09-14 Miguel de Icaza <miguel@ximian.com>
28640 * driver.cs: Added --parse option that only parses its input files
28643 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
28644 incorrect. IsTopLevel is not used to tell whether an object is
28645 root_types or not (that can be achieved by testing this ==
28646 root_types). But to see if this is a top-level *class* (not
28647 necessarly our "toplevel" container).
28649 2001-09-14 Ravi Pratap <ravi@ximian.com>
28651 * enum.cs (Enum::Define): Modify to call the Lookup method on the
28652 parent instead of a direct call to GetType.
28654 2001-09-14 Ravi Pratap <ravi@ximian.com>
28656 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
28657 Modifiers.TypeAttr. This should just be a call to that method.
28659 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
28660 object so that we can determine if we are top-level or not.
28662 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
28665 * enum.cs (Enum::Define): Ditto.
28667 * modifiers.cs (FieldAttr): Re-write.
28669 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
28670 (TypeContainer::HaveStaticConstructor): New property to provide access
28671 to precisely that info.
28673 * modifiers.cs (MethodAttr): Re-write.
28674 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
28676 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
28677 of top-level types as claimed.
28679 2001-09-13 Miguel de Icaza <miguel@ximian.com>
28681 * expression.cs (MemberLookup): Fruitless attempt to lookup
28682 constructors. Maybe I need to emit default constructors? That
28683 might be it (currently .NET emits this for me automatically).
28684 (Invocation::OverloadResolve): Cope with Arguments == null.
28685 (Invocation::EmitArguments): new function, shared by the new
28686 constructor and us.
28687 (Invocation::Emit): Handle static and instance methods. Emit
28688 proper call instruction for virtual or non-virtual invocations.
28689 (New::Emit): Implement.
28690 (New::Resolve): Implement.
28691 (MemberAccess:Resolve): Implement.
28692 (MethodGroupExpr::InstanceExpression): used conforming to the spec
28693 to track instances.
28694 (FieldExpr::Resolve): Set type.
28696 * support.cs: Handle empty arguments.
28698 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
28699 SimpleLookup): Auxiliary routines to help parse a qualifier
28702 Update qualifier_identifier rule.
28704 * codegen.cs: Removed debugging messages.
28706 * class.cs: Make this a global thing, this acts just as a "key" to
28707 objects that we might have around.
28709 (Populate): Only initialize method_builders_to_methods once.
28711 * expression.cs (PropertyExpr): Initialize type from the
28714 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
28715 Resolve pattern. Attempt to implicitly convert value to boolean.
28718 * expression.cs: Set the type for the int32/int32 argument case.
28719 (Binary::ResolveOperator): Set the return type to boolean for
28720 comparission operators
28722 * typemanager.cs: Remove debugging print code.
28724 (Invocation::Resolve): resolve type.
28726 * class.cs: Allocate a MemberInfo of the correct size, as the code
28727 elsewhere depends on the test to reflect the correct contents.
28729 (Method::) Keep track of parameters, due to System.Reflection holes
28731 (TypeContainer::Populate): Keep track of MethodBuilders to Method
28734 (TypeContainer::FindMembers): Use ArrayList and then copy an array
28735 of the exact size and return that.
28737 (Class::LookupMethodByBuilder): New function that maps
28738 MethodBuilders to its methods. Required to locate the information
28739 on methods because System.Reflection bit us again.
28741 * support.cs: New file, contains an interface ParameterData and
28742 two implementations: ReflectionParameters and InternalParameters
28743 used to access Parameter information. We will need to grow this
28746 * expression.cs (Invocation::GetParameterData): implement a cache
28747 and a wrapper around the ParameterData creation for methods.
28748 (Invocation::OverloadResolve): Use new code.
28750 2001-09-13 Ravi Pratap <ravi@ximian.com>
28752 * class.cs (TypeContainer::EmitField): Remove and move into
28753 (Field::Define): here and modify accordingly.
28754 (Field.FieldBuilder): New member.
28755 (TypeContainer::Populate): Update accordingly.
28756 (TypeContainer::FindMembers): Implement.
28758 2001-09-13 Miguel de Icaza <miguel@ximian.com>
28760 * statement.cs: (VariableInfo::VariableType): New field to be
28761 initialized with the full type once it is resolved.
28763 2001-09-12 Miguel de Icaza <miguel@ximian.com>
28765 * parameter.cs (GetParameterInfo): Use a type cache to compute
28766 things only once, and to reuse this information
28768 * expression.cs (LocalVariableReference::Emit): Implement.
28769 (OpcodeCast::Emit): fix.
28771 (ParameterReference::Resolve): Implement.
28772 (ParameterReference::Emit): Implement.
28774 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
28775 that are expressions need to stay as Expressions.
28777 * typemanager.cs (CSharpName): Returns the C# name of a type if
28780 * expression.cs (Expression::ConvertImplicit): New function that
28781 implements implicit type conversions.
28783 (Expression::ImplicitReferenceConversion): Implements implicit
28784 reference conversions.
28786 (EmptyCast): New type for transparent casts.
28788 (OpcodeCast): New type for casts of types that are performed with
28789 a sequence of bytecodes.
28791 (BoxedCast): New type used for casting value types into reference
28792 types. Emits a box opcode.
28794 (Binary::DoNumericPromotions): Implements numeric promotions of
28795 and computation of the Binary::Type.
28797 (Binary::EmitBranchable): Optimization.
28799 (Binary::Emit): Implement code emission for expressions.
28801 * typemanager.cs (TypeManager): Added two new core types: sbyte
28804 2001-09-12 Ravi Pratap <ravi@ximian.com>
28806 * class.cs (TypeContainer::FindMembers): Method which does exactly
28807 what Type.FindMembers does, only we don't have to use reflection. No
28808 implementation yet.
28810 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
28811 typecontainer objects as we need to get at them.
28812 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
28814 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
28815 typecontainer object.
28817 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
28818 of just a Report object.
28820 2001-09-11 Ravi Pratap <ravi@ximian.com>
28822 * class.cs (Event::Define): Go back to using the prefixes "add_" and
28824 (TypeContainer::Populate): Now define the delegates of the type too.
28825 (TypeContainer.Delegates): Property to access the list of delegates defined
28828 * delegates.cs (Delegate::Define): Implement partially.
28830 * modifiers.cs (TypeAttr): Handle more flags.
28832 2001-09-11 Ravi Pratap <ravi@ximian.com>
28834 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
28836 (Operator::Define): Re-write logic to get types by using the LookupType method
28837 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
28838 (Indexer::Define): Ditto.
28839 (Event::Define): Ditto.
28840 (Property::Define): Ditto.
28842 2001-09-10 Ravi Pratap <ravi@ximian.com>
28844 * class.cs (TypeContainer::Populate): Now define operators too.
28845 (TypeContainer.Operators): New property to access the list of operators
28847 (Operator.OperatorMethodBuilder): New member to hold the method builder
28848 for the operator we are defining.
28849 (Operator::Define): Implement.
28851 2001-09-10 Ravi Pratap <ravi@ximian.com>
28853 * class.cs (Event::Define): Make the prefixes of the accessor methods
28854 addOn_ and removeOn_
28856 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
28857 of the location being passed in too. Ideally, this should go later since all
28858 error reporting should be done through the Report object.
28860 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
28861 (Populate): Iterate thru the indexers we have and define them too.
28862 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
28863 for the get and set accessors.
28864 (Indexer::Define): Implement.
28866 2001-09-09 Miguel de Icaza <miguel@ximian.com>
28868 * expression.cs (Binary::Resolve): Beginning of it. I scratched
28869 my previous implementation, did not work.
28871 * typemanager.cs: Add a couple of missing types (the longs).
28873 * literal.cs: Use TypeManager.bool_type instead of getting it.
28875 * expression.cs (EventExpr): New kind of expressions.
28876 (Expressio::ExprClassFromMemberInfo): finish
28878 2001-09-08 Miguel de Icaza <miguel@ximian.com>
28880 * assign.cs: Emit stores to static fields differently.
28882 2001-09-08 Ravi Pratap <ravi@ximian.com>
28884 * Merge in changes and adjust code to tackle conflicts. Backed out my
28885 code in Assign::Resolve ;-)
28887 2001-09-08 Ravi Pratap <ravi@ximian.com>
28889 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
28890 instead Report.Error and also pass in the location.
28891 (CSharpParser::Lexer): New readonly property to return the reference
28892 to the Tokenizer object.
28893 (declare_local_variables): Use Report.Error with location instead of plain
28897 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
28898 (Operator.CheckBinaryOperator): Ditto.
28900 * cs-parser.jay (operator_declarator): Update accordingly.
28902 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
28903 (CheckBinaryOperator): Same here.
28905 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
28906 on the name without any prefixes of namespace names etc. This is because we
28907 already might have something already fully qualified like
28908 'System.Console.WriteLine'
28910 * assign.cs (Resolve): Begin implementation. Stuck ;-)
28912 2001-09-07 Ravi Pratap <ravi@ximian.com>
28914 * cs-tokenizer.cs (location): Return a string which also contains
28917 * expression.cs (ElementAccess): New class for expressions of the
28918 type 'element access.'
28919 (BaseAccess): New class for expressions of the type 'base access.'
28920 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
28923 * cs-parser.jay (element_access): Implement action.
28924 (base_access): Implement actions.
28925 (checked_expression, unchecked_expression): Implement.
28927 * cs-parser.jay (local_variable_type): Correct and implement.
28928 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
28930 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
28932 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
28933 name and the specifiers.
28935 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
28937 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
28938 making them all public ;-)
28940 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
28943 2001-09-07 Miguel de Icaza <miguel@ximian.com>
28945 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
28947 (FieldExpr, PropertyExprs): New resolved expressions.
28948 (SimpleName::MemberStaticCheck): Perform static checks for access
28949 to non-static fields on static methods. Maybe this should be
28950 generalized for MemberAccesses.
28951 (SimpleName::ResolveSimpleName): More work on simple name
28954 * cs-parser.jay (primary_expression/qualified_identifier): track
28955 the parameter index.
28957 * codegen.cs (CodeGen::Save): Catch save exception, report error.
28958 (EmitContext::EmitBoolExpression): Chain to expression generation
28959 instead of temporary hack.
28960 (::EmitStatementExpression): Put generic expression code generation.
28962 * assign.cs (Assign::Emit): Implement variable assignments to
28963 local variables, parameters and fields.
28965 2001-09-06 Miguel de Icaza <miguel@ximian.com>
28967 * statement.cs (Block::GetVariableInfo): New method, returns the
28968 VariableInfo for a variable name in a block.
28969 (Block::GetVariableType): Implement in terms of GetVariableInfo
28971 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
28972 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
28974 2001-09-06 Ravi Pratap <ravi@ximian.com>
28976 * cs-parser.jay (operator_declaration): Continue on my quest : update
28977 to take attributes argument.
28978 (event_declaration): Ditto.
28979 (enum_declaration): Ditto.
28980 (indexer_declaration): Ditto.
28982 * class.cs (Operator::Operator): Update constructor accordingly.
28983 (Event::Event): Ditto.
28985 * delegate.cs (Delegate::Delegate): Same here.
28987 * enum.cs (Enum::Enum): Same here.
28989 2001-09-05 Ravi Pratap <ravi@ximian.com>
28991 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
28993 * ../tests/cs0658.cs : New file to demonstrate error 0658.
28995 * attribute.cs (Attributes): New class to encapsulate all attributes which were
28996 being passed around as an arraylist.
28997 (Attributes::AddAttribute): Method to add attribute sections.
28999 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
29000 (struct_declaration): Update accordingly.
29001 (constant_declaration): Update.
29002 (field_declaration): Update.
29003 (method_header): Update.
29004 (fixed_parameter): Update.
29005 (parameter_array): Ditto.
29006 (property_declaration): Ditto.
29007 (destructor_declaration): Ditto.
29009 * class.cs (Struct::Struct): Update constructors accordingly.
29010 (Class::Class): Ditto.
29011 (Field::Field): Ditto.
29012 (Method::Method): Ditto.
29013 (Property::Property): Ditto.
29014 (TypeContainer::OptAttribute): update property's return type.
29016 * interface.cs (Interface.opt_attributes): New member.
29017 (Interface::Interface): Update to take the extra Attributes argument.
29019 * parameter.cs (Parameter::Parameter): Ditto.
29021 * constant.cs (Constant::Constant): Ditto.
29023 * interface.cs (InterfaceMemberBase): New OptAttributes field.
29024 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
29025 the attributes as a parameter.
29026 (InterfaceProperty): Update constructor call.
29027 (InterfaceEvent): Ditto.
29028 (InterfaceMethod): Ditto.
29029 (InterfaceIndexer): Ditto.
29031 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
29032 pass the attributes too.
29033 (interface_event_declaration): Ditto.
29034 (interface_property_declaration): Ditto.
29035 (interface_method_declaration): Ditto.
29036 (interface_declaration): Ditto.
29038 2001-09-05 Miguel de Icaza <miguel@ximian.com>
29040 * class.cs (Method::Define): Track the "static Main" definition to
29041 create an entry point.
29043 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
29044 EntryPoint if we find it.
29046 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
29047 (EmitContext::ig): Make this variable public.
29049 * driver.cs: Make the default output file be the first file name
29050 with the .exe extension.
29052 Detect empty compilations
29054 Handle various kinds of output targets. Handle --target and
29055 rename -t to --dumper.
29057 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
29058 methods inherited from Expression return now an Expression. This
29059 will is used during the tree rewriting as we resolve them during
29062 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
29063 the spec. Missing entirely is the information about
29064 accessability of elements of it.
29066 (Expression::ExprClassFromMemberInfo): New constructor for
29067 Expressions that creates a fully initialized Expression based on
29068 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
29071 (Invocation::Resolve): Begin implementing resolution of invocations.
29073 * literal.cs (StringLiteral): Implement Emit.
29075 2001-09-05 Ravi Pratap <ravi@ximian.com>
29077 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
29080 2001-09-04 Ravi Pratap <ravi@ximian.com>
29082 * cs-parser.jay (attribute_arguments): Implement actions.
29083 (attribute): Fix bug in production. Implement action.
29084 (attribute_list): Implement.
29085 (attribute_target): Implement.
29086 (attribute_target_specifier, opt_target_specifier): Implement
29087 (CheckAttributeTarget): New method to check if the attribute target
29089 (attribute_section): Implement.
29090 (opt_attributes): Implement.
29092 * attribute.cs : New file to handle attributes.
29093 (Attribute): Class to hold attribute info.
29095 * cs-parser.jay (opt_attribute_target_specifier): Remove production
29096 (attribute_section): Modify production to use 2 different rules to
29097 achieve the same thing. 1 s/r conflict down !
29098 Clean out commented, useless, non-reducing dimension_separator rules.
29100 * class.cs (TypeContainer.attributes): New member to hold list
29101 of attributes for a type.
29102 (Struct::Struct): Modify to take one more argument, the attribute list.
29103 (Class::Class): Ditto.
29104 (Field::Field): Ditto.
29105 (Method::Method): Ditto.
29106 (Property::Property): Ditto.
29108 * cs-parser.jay (struct_declaration): Update constructor call to
29109 pass in the attributes too.
29110 (class_declaration): Ditto.
29111 (constant_declaration): Ditto.
29112 (field_declaration): Ditto.
29113 (method_header): Ditto.
29114 (fixed_parameter): Ditto.
29115 (parameter_array): Ditto.
29116 (property_declaration): Ditto.
29118 * constant.cs (Constant::Constant): Update constructor similarly.
29119 Use System.Collections.
29121 * parameter.cs (Parameter::Parameter): Update as above.
29123 2001-09-02 Ravi Pratap <ravi@ximian.com>
29125 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
29126 (TypeContainer.delegates): New member to hold list of delegates.
29128 * cs-parser.jay (delegate_declaration): Implement the action correctly
29129 this time as I seem to be on crack ;-)
29131 2001-09-02 Miguel de Icaza <miguel@ximian.com>
29133 * rootcontext.cs (RootContext::IsNamespace): new function, used to
29134 tell whether an identifier represents a namespace.
29136 * expression.cs (NamespaceExpr): A namespace expression, used only
29137 temporarly during expression resolution.
29138 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
29139 utility functions to resolve names on expressions.
29141 2001-09-01 Miguel de Icaza <miguel@ximian.com>
29143 * codegen.cs: Add hook for StatementExpressions.
29145 * class.cs: Fix inverted test for static flag in methods.
29147 2001-09-02 Ravi Pratap <ravi@ximian.com>
29149 * class.cs (Operator::CheckUnaryOperator): Correct error number used
29150 to make it coincide with MS' number.
29151 (Operator::CheckBinaryOperator): Ditto.
29153 * ../errors/errors.txt : Remove error numbers added earlier.
29155 * ../errors/cs1019.cs : Test case for error # 1019
29157 * ../errros/cs1020.cs : Test case for error # 1020
29159 * cs-parser.jay : Clean out commented cruft.
29160 (dimension_separators, dimension_separator): Comment out. Ostensibly not
29161 used anywhere - non-reducing rule.
29162 (namespace_declarations): Non-reducing rule - comment out.
29164 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
29165 with TypeContainer::AddEnum.
29167 * delegate.cs : New file for delegate handling classes.
29168 (Delegate): Class for declaring delegates.
29170 * makefile : Update.
29172 * cs-parser.jay (delegate_declaration): Implement.
29174 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
29176 * class.cs (Event::Define): Implement.
29177 (Event.EventBuilder): New member.
29179 * class.cs (TypeContainer::Populate): Update to define all enums and events
29181 (Events): New property for the events arraylist we hold. Shouldn't we move to using
29182 readonly fields for all these cases ?
29184 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
29186 * class.cs (Property): Revamp to use the convention of making fields readonly.
29187 Accordingly modify code elsewhere.
29189 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
29190 the Define method of the Property class.
29192 * class.cs : Clean up applied patch and update references to variables etc. Fix
29194 (TypeContainer::Populate): Update to define all the properties we have. Also
29195 define all enumerations.
29197 * enum.cs (Define): Implement.
29199 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
29201 * cs-parser.jay (overloadable_operator): The semantic value is an
29202 enum of the Operator class.
29203 (operator_declarator): Implement actions.
29204 (operator_declaration): Implement.
29206 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
29207 validity of definitions.
29208 (Operator::CheckBinaryOperator): Static method to check for binary operators
29209 (TypeContainer::AddOperator): New method to add an operator to a type.
29211 * cs-parser.jay (indexer_declaration): Added line to actually call the
29212 AddIndexer method so it gets added ;-)
29214 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
29215 already taken care of by the MS compiler ?
29217 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
29219 * class.cs (Operator): New class for operator declarations.
29220 (Operator::OpType): Enum for the various operators.
29222 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
29224 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
29225 ostensibly handle this in semantic analysis.
29227 * cs-parser.jay (general_catch_clause): Comment out
29228 (specific_catch_clauses, specific_catch_clause): Ditto.
29229 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
29230 (catch_args, opt_catch_args): New productions.
29231 (catch_clause): Rewrite to use the new productions above
29232 (catch_clauses): Modify accordingly.
29233 (opt_catch_clauses): New production to use in try_statement
29234 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
29235 and re-write the code in the actions to extract the specific and
29236 general catch clauses by being a little smart ;-)
29238 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
29239 Hooray, try and catch statements parse fine !
29241 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
29243 * statement.cs (Block::GetVariableType): Fix logic to extract the type
29244 string from the hashtable of variables.
29246 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
29247 I end up making that mistake ;-)
29248 (catch_clauses): Fixed gross error which made Key and Value of the
29249 DictionaryEntry the same : $1 !!
29251 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
29253 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
29255 * cs-parser.jay (event_declaration): Correct to remove the semicolon
29256 when the add and remove accessors are specified.
29258 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
29260 * cs-parser.jay (IndexerDeclaration): New helper class to hold
29261 information about indexer_declarator.
29262 (indexer_declarator): Implement actions.
29263 (parsing_indexer): New local boolean used to keep track of whether
29264 we are parsing indexers or properties. This is necessary because
29265 implicit_parameters come into picture even for the get accessor in the
29266 case of an indexer.
29267 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
29269 * class.cs (Indexer): New class for indexer declarations.
29270 (TypeContainer::AddIndexer): New method to add an indexer to a type.
29271 (TypeContainer::indexers): New member to hold list of indexers for the
29274 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
29276 * cs-parser.jay (add_accessor_declaration): Implement action.
29277 (remove_accessor_declaration): Implement action.
29278 (event_accessors_declaration): Implement
29279 (variable_declarators): swap statements for first rule - trivial.
29281 * class.cs (Event): New class to hold information about event
29283 (TypeContainer::AddEvent): New method to add an event to a type
29284 (TypeContainer::events): New member to hold list of events.
29286 * cs-parser.jay (event_declaration): Implement actions.
29288 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
29290 * cs-parser.jay (dim_separators): Implement. Make it a string
29291 concatenating all the commas together, just as they appear.
29292 (opt_dim_separators): Modify accordingly
29293 (rank_specifiers): Update accordingly. Basically do the same
29294 thing - instead, collect the brackets here.
29295 (opt_rank_sepcifiers): Modify accordingly.
29296 (array_type): Modify to actually return the complete type string
29297 instead of ignoring the rank_specifiers.
29298 (expression_list): Implement to collect the expressions
29299 (variable_initializer): Implement. We make it a list of expressions
29300 essentially so that we can handle the array_initializer case neatly too.
29301 (variable_initializer_list): Implement.
29302 (array_initializer): Make it a list of variable_initializers
29303 (opt_array_initializer): Modify accordingly.
29305 * expression.cs (New::NType): Add enumeration to help us
29306 keep track of whether we have an object/delegate creation
29307 or an array creation.
29308 (New:NewType, New::Rank, New::Indices, New::Initializers): New
29309 members to hold data about array creation.
29310 (New:New): Modify to update NewType
29311 (New:New): New Overloaded contructor for the array creation
29314 * cs-parser.jay (array_creation_expression): Implement to call
29315 the overloaded New constructor.
29317 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
29319 * class.cs (TypeContainer::Constructors): Return member
29320 constructors instead of returning null.
29322 2001-08-26 Miguel de Icaza <miguel@ximian.com>
29324 * typemanager.cs (InitCoreTypes): Initialize the various core
29325 types after we have populated the type manager with the user
29326 defined types (this distinction will be important later while
29327 compiling corlib.dll)
29329 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
29330 on Expression Classification. Now all expressions have a method
29331 `Resolve' and a method `Emit'.
29333 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
29334 generation from working. Also add some temporary debugging
29337 2001-08-24 Miguel de Icaza <miguel@ximian.com>
29339 * codegen.cs: Lots of code generation pieces. This is only the
29340 beginning, will continue tomorrow with more touches of polish. We
29341 handle the fundamentals of if, while, do, for, return. Others are
29342 trickier and I need to start working on invocations soon.
29344 * gen-treedump.cs: Bug fix, use s.Increment here instead of
29347 * codegen.cs (EmitContext): New struct, used during code
29348 emission to keep a context. Most of the code generation will be
29351 * cs-parser.jay: Add embedded blocks to the list of statements of
29352 this block. So code generation proceeds in a top down fashion.
29354 2001-08-23 Miguel de Icaza <miguel@ximian.com>
29356 * statement.cs: Add support for multiple child blocks.
29358 2001-08-22 Miguel de Icaza <miguel@ximian.com>
29360 * codegen.cs (EmitCode): New function, will emit the code for a
29361 Block of code given a TypeContainer and its ILGenerator.
29363 * statement.cs (Block): Standard public readonly optimization.
29364 (Block::Block constructors): Link children.
29365 (Block::Child): Child Linker.
29366 (Block::EmitVariables): Emits IL variable declarations.
29368 * class.cs: Drop support for MethodGroups here, delay until
29370 (Method::): Applied the same simplification that I did before, and
29371 move from Properties to public readonly fields.
29372 (Method::ParameterTypes): Returns the parameter types for the
29373 function, and implements a cache that will be useful later when I
29374 do error checking and the semantic analysis on the methods is
29376 (Constructor::GetCallingConvention): Renamed from CallingConvetion
29377 and made a method, optional argument tells whether this is a class
29378 or a structure to apply the `has-this' bit.
29379 (Method::GetCallingConvention): Implement, returns the calling
29381 (Method::Define): Defines the type, a second pass is performed
29382 later to populate the methods.
29384 (Constructor::ParameterTypes): implement a cache similar to the
29385 one on Method::ParameterTypes, useful later when we do semantic
29388 (TypeContainer::EmitMethod): New method. Emits methods.
29390 * expression.cs: Removed MethodGroup class from here.
29392 * parameter.cs (Parameters::GetCallingConvention): new method.
29394 2001-08-21 Miguel de Icaza <miguel@ximian.com>
29396 * class.cs (TypeContainer::Populate): Drop RootContext from the
29399 (Constructor::CallingConvention): Returns the calling convention.
29400 (Constructor::ParameterTypes): Returns the constructor parameter
29403 (TypeContainer::AddConstructor): Keep track of default constructor
29404 and the default static constructor.
29406 (Constructor::) Another class that starts using `public readonly'
29407 instead of properties.
29409 (Constructor::IsDefault): Whether this is a default constructor.
29411 (Field::) use readonly public fields instead of properties also.
29413 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
29414 track of static constructors; If none is used, turn on
29415 BeforeFieldInit in the TypeAttributes.
29417 * cs-parser.jay (opt_argument_list): now the return can be null
29418 for the cases where there are no arguments.
29420 (constructor_declarator): If there is no implicit `base' or
29421 `this', then invoke the default parent constructor.
29423 * modifiers.cs (MethodAttr): New static function maps a set of
29424 modifiers flags into a MethodAttributes enum
29425 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
29426 MethodAttr, TypeAttr to represent the various mappings where the
29427 modifiers are used.
29428 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
29430 2001-08-19 Miguel de Icaza <miguel@ximian.com>
29432 * parameter.cs (GetParameterInfo): Fix bug where there would be no
29435 * interface.cs (PopulateIndexer): Implemented the code generator
29436 for interface indexers.
29438 2001-08-17 Miguel de Icaza <miguel@ximian.com>
29440 * interface.cs (InterfaceMemberBase): Now we track the new status
29443 (PopulateProperty): Implement property population. Woohoo! Got
29444 Methods and Properties going today.
29446 Removed all the properties for interfaces, and replaced them with
29447 `public readonly' fields.
29449 2001-08-16 Miguel de Icaza <miguel@ximian.com>
29451 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
29452 initialize their hashtables/arraylists only when they are needed
29453 instead of doing this always.
29455 * parameter.cs: Handle refs and out parameters.
29457 * cs-parser.jay: Use an ArrayList to construct the arguments
29458 instead of the ParameterCollection, and then cast that to a
29461 * parameter.cs: Drop the use of ParameterCollection and use
29462 instead arrays of Parameters.
29464 (GetParameterInfo): Use the Type, not the Name when resolving
29467 2001-08-13 Miguel de Icaza <miguel@ximian.com>
29469 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
29470 and instead use public readonly fields.
29472 * class.cs: Put back walking code for type containers.
29474 2001-08-11 Miguel de Icaza <miguel@ximian.com>
29476 * class.cs (MakeConstant): Code to define constants.
29478 * rootcontext.cs (LookupType): New function. Used to locate types
29481 2001-08-08 Miguel de Icaza <miguel@ximian.com>
29483 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
29484 this System.Reflection code is. Kudos to Microsoft
29486 * typemanager.cs: Implement a type cache and avoid loading all
29487 types at boot time. Wrap in LookupType the internals. This made
29488 the compiler so much faster. Wow. I rule!
29490 * driver.cs: Make sure we always load mscorlib first (for
29491 debugging purposes, nothing really important).
29493 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
29494 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
29496 * rootcontext.cs: Lookup types on their namespace; Lookup types
29497 on namespaces that have been imported using the `using' keyword.
29499 * class.cs (TypeContainer::TypeAttr): Virtualize.
29500 (Class::TypeAttr): Return attributes suitable for this bad boy.
29501 (Struct::TypeAttr): ditto.
29502 Handle nested classes.
29503 (TypeContainer::) Remove all the type visiting code, it is now
29504 replaced with the rootcontext.cs code
29506 * rootcontext.cs (GetClassBases): Added support for structs.
29508 2001-08-06 Miguel de Icaza <miguel@ximian.com>
29510 * interface.cs, statement.cs, class.cs, parameter.cs,
29511 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
29512 Drop use of TypeRefs, and use strings instead.
29514 2001-08-04 Miguel de Icaza <miguel@ximian.com>
29518 * class.cs (Struct::Struct): set the SEALED flags after
29519 checking the modifiers.
29520 (TypeContainer::TypeAttr): new property, returns the
29521 TypeAttributes for a class.
29523 * cs-parser.jay (type_list): Oops, list production was creating a
29524 new list of base types.
29526 * rootcontext.cs (StdLib): New property.
29527 (GetInterfaceTypeByName): returns an interface by type name, and
29528 encapsulates error handling here.
29529 (GetInterfaces): simplified.
29530 (ResolveTree): Encapsulated all the tree resolution here.
29531 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
29534 * driver.cs: Add support for --nostdlib, to avoid loading the
29535 default assemblies.
29536 (Main): Do not put tree resolution here.
29538 * rootcontext.cs: Beginning of the class resolution.
29540 2001-08-03 Miguel de Icaza <miguel@ximian.com>
29542 * rootcontext.cs: Provide better error reporting.
29544 * cs-parser.jay (interface_base): set our $$ to be interfaces.
29546 * rootcontext.cs (CreateInterface): Handle the case where there
29547 are no parent interfaces.
29549 (CloseTypes): Routine to flush types at the end.
29550 (CreateInterface): Track types.
29551 (GetInterfaces): Returns an array of Types from the list of
29552 defined interfaces.
29554 * typemanager.c (AddUserType): Mechanism to track user types (puts
29555 the type on the global type hash, and allows us to close it at the
29558 2001-08-02 Miguel de Icaza <miguel@ximian.com>
29560 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
29561 RecordInterface instead.
29563 * cs-parser.jay: Updated to reflect changes above.
29565 * decl.cs (Definition): Keep track of the TypeBuilder type that
29566 represents this type here. Not sure we will use it in the long
29567 run, but wont hurt for now.
29569 * driver.cs: Smaller changes to accomodate the new code.
29571 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
29574 * rootcontext.cs (CreateInterface): New method, used to create
29575 the System.TypeBuilder type for interfaces.
29576 (ResolveInterfaces): new entry point to resolve the interface
29578 (CodeGen): Property, used to keep track of the code generator.
29580 2001-07-26 Miguel de Icaza <miguel@ximian.com>
29582 * cs-parser.jay: Add a second production for delegate_declaration
29585 (enum_body): Put an opt_comma here instead of putting it on
29586 enum_body or enum_member_declarations so we can handle trailing
29587 commas on enumeration members. Gets rid of a shift/reduce.
29589 (type_list): Need a COMMA in the middle.
29591 (indexer_declaration): Tell tokenizer to recognize get/set
29593 * Remove old targets.
29595 * Re-add the parser target.
29597 2001-07-13 Simon Cozens <simon@simon-cozens.org>
29599 * cs-parser.jay: Add precendence rules for a number of operators
29600 ot reduce the number of shift/reduce conflicts in the grammar.
29602 2001-07-17 Miguel de Icaza <miguel@ximian.com>
29604 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
29607 Get rid of old crufty code.
29609 * rootcontext.cs: Use this to keep track of the parsed
29610 representation and the defined types available to the program.
29612 * gen-treedump.cs: adjust for new convention.
29614 * type.cs: Split out the type manager, and the assembly builder
29617 * typemanager.cs: the type manager will live here now.
29619 * cil-codegen.cs: And the code generator here.
29621 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
29623 * makefile: Fixed up for easy making.
29625 2001-07-13 Simon Cozens <simon@simon-cozens.org>
29627 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
29630 (unary_expression): Expand pre_increment_expression and
29631 post_decrement_expression to reduce a shift/reduce.
29633 2001-07-11 Simon Cozens
29635 * cs-tokenizer.cs: Hex numbers should begin with a 0.
29637 Improve allow_keyword_as_indent name.
29639 2001-06-19 Miguel de Icaza <miguel@ximian.com>
29641 * Adjustments for Beta2.
29643 2001-06-13 Miguel de Icaza <miguel@ximian.com>
29645 * decl.cs: Added `Define' abstract method.
29646 (InTransit): new property, used to catch recursive definitions.
29648 * interface.cs: Implement `Define'.
29650 * modifiers.cs: Map Modifiers.constants to
29651 System.Reflection.TypeAttribute flags.
29653 * class.cs: Keep track of types and user-defined types.
29654 (BuilderInit): New method for creating an assembly
29655 (ResolveType): New function to launch the resolution process, only
29656 used by interfaces for now.
29658 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
29659 that are inserted into the name space.
29661 2001-06-08 Miguel de Icaza <miguel@ximian.com>
29663 * ARGH. I have screwed up my tree so many times due to the use of
29664 rsync rather than using CVS. Going to fix this at once.
29666 * driver.cs: Objetify driver. Load assemblies, use assemblies to
29669 2001-06-07 Miguel de Icaza <miguel@ximian.com>
29671 * Experiment successful: Use System.Type rather that our own
29674 2001-05-25 Miguel de Icaza <miguel@ximian.com>
29676 * cs-parser.jay: Removed nsAliases from here.
29678 Use new namespaces, handle `using XXX;'
29680 * namespace.cs: Reimplemented namespace handling, use a recursive
29681 definition of the class. Now we can keep track of using clauses
29682 and catch invalid using clauses.
29684 2001-05-24 Miguel de Icaza <miguel@ximian.com>
29686 * gen-treedump.cs: Adapted for all the renaming.
29688 * expression.cs (Expression): this class now has a Type property
29689 which returns an expression Type.
29691 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
29692 `Type', as this has a different meaning now in the base
29694 2001-05-22 Miguel de Icaza <miguel@ximian.com>
29696 * interface.cs, class.cs: Removed from all the sources the
29697 references to signature computation, as we can not do method
29698 signature computation during the parsing time, as we are not
29699 trying to solve at that point distinguishing:
29703 void a (NS.Blah x) {}
29706 Which depending on the context might be valid or not, as we do not
29707 know if Blah is the same thing as NS.Blah at that point.
29709 * Redid everything so the code uses TypeRefs now instead of
29710 Types. TypeRefs are just temporary type placeholders, that need
29711 to be resolved. They initially have a pointer to a string and the
29712 current scope in which they are used. This is used later by the
29713 compiler to resolve the reference to an actual Type.
29715 * DeclSpace is no longer a CIR.Type, and neither are
29716 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
29717 are all DeclSpaces, but no Types.
29719 * type.cs (TypeRefManager): This implements the TypeRef manager,
29720 which keeps track of all the types that need to be resolved after
29721 the parsing has finished.
29723 2001-05-13 Miguel de Icaza <miguel@ximian.com>
29725 * ARGH. We are going to have to store `foreach' as a class rather
29726 than resolving it, as we need to verify error 1579 after name
29727 resolution. *OR* we could keep a flag that says `This request to
29728 IEnumerator comes from a foreach statement' which we can then use
29729 to generate the error.
29731 2001-05-10 Miguel de Icaza <miguel@ximian.com>
29733 * class.cs (TypeContainer.AddMethod): we now add methods to the
29734 MethodGroup instead of the method hashtable.
29736 * expression.cs: Add MethodGroup abstraction, which gets us one
29737 step closer to the specification in the way we handle method
29740 * cs-parser.jay (primary_expression): qualified_identifier now
29741 tried to match up an identifier to a local variable reference or
29742 to a parameter reference.
29744 current_local_parameters is now a parser global variable that
29745 points to the current parameters for the block, used during name
29748 (property_declaration): Now creates an implicit `value' argument to
29751 2001-05-09 Miguel de Icaza <miguel@ximian.com>
29753 * parameter.cs: Do not use `param' arguments as part of the
29754 signature, per the spec.
29756 2001-05-08 Miguel de Icaza <miguel@ximian.com>
29758 * decl.cs: Base class for classes, structs and interfaces. This
29759 is the "Declaration Space"
29761 * cs-parser.jay: Use CheckDef for checking declaration errors
29762 instead of having one on each function.
29764 * class.cs: Factor out some code for handling error handling in
29765 accordance to the "Declarations" section in the "Basic Concepts"
29766 chapter in the ECMA C# spec.
29768 * interface.cs: Make all interface member classes derive from
29769 InterfaceMemberBase.
29771 2001-05-07 Miguel de Icaza <miguel@ximian.com>
29773 * Many things: all interfaces are parsed and generated in
29774 gen-treedump. Support for member variables, constructors,
29775 destructors, properties, constants is there.
29777 Beginning of the IL backend, but very little done, just there for
29780 2001-04-29 Miguel de Icaza <miguel@ximian.com>
29782 * cs-parser.jay: Fix labeled statement.
29784 * cs-tokenizer.cs (escape): Escape " and ' always.
29785 ref_line, ref_name: keep track of the line/filename as instructed
29786 by #line by the compiler.
29789 2001-04-27 Miguel de Icaza <miguel@ximian.com>
29791 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
29792 to match the values in System.CodeDOM.
29794 Divid renamed to Divide.
29796 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
29798 (Statements.set): remove.
29800 * System.CodeDOM/CodeCatchClause.cs: always have a valid
29803 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
29804 falseStatements always have valid values.
29806 * cs-parser.jay: Use System.CodeDOM now.