1 2008-07-10 Marek Safar <marek.safar@gmail.com>
3 * report.cs, ecore.cs: Flush recorder only when silent mode is off.
5 2008-07-10 Raja R Harinath <harinath@hurrynot.org>
8 * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
9 only one '>', and finds a '>>', abort the generic lookahead.
11 2008-07-10 Marek Safar <marek.safar@gmail.com>
14 * cs-tokenizer.cs: Always look-ahed for `>=' when tokenizing `>'.
16 2008-07-10 Marek Safar <marek.safar@gmail.com>
19 * statement.cs: Moved EmitSymbolInfo to Block.
21 2008-07-09 Marek Safar <marek.safar@gmail.com>
23 * ecore.cs: Report better error for extension method overload failures.
25 2008-07-09 Marek Safar <marek.safar@gmail.com>
27 * expression.cs (Is): No need to box reference values.
29 2008-07-09 Marek Safar <marek.safar@gmail.com>
31 * class.cs: Use event resolve context when initializing CreateEmitContext.
33 2008-07-09 Marek Safar <marek.safar@gmail.com>
36 * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
37 method used inside expression trees. Added more LINQ to expression tree
40 2008-07-08 Marek Safar <marek.safar@gmail.com>
42 A fix for bug #378189, #370577
43 * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
46 2008-07-08 Marek Safar <marek.safar@gmail.com>
48 * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
51 2008-07-08 Marek Safar <marek.safar@gmail.com>
54 * anonymous.cs: Always park anonymous method in the nearest parent storey.
56 2008-07-07 Marek Safar <marek.safar@gmail.com>
59 * cs-parser.jay: Report nullable use in mcs for some cases.
61 2008-07-07 Marek Safar <marek.safar@gmail.com>
63 * ecore.cs: Improved argument mismatch error messages.
65 2008-07-07 Marek Safar <marek.safar@gmail.com>
67 * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
69 2008-07-07 Marek Safar <marek.safar@gmail.com>
71 * expression.cs (TypeOf): Mutate type argument.
73 2008-07-04 Marek Safar <marek.safar@gmail.com>
75 * class.cs: Report missing partial modifier for correct type.
77 2008-07-04 Marek Safar <marek.safar@gmail.com>
79 * ecore.cs, expression.cs (VariableReference): Variable property is
82 2008-07-04 Marek Safar <marek.safar@gmail.com>
84 * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
86 2008-07-04 Marek Safar <marek.safar@gmail.com>
88 * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
91 2008-07-04 Marek Safar <marek.safar@gmail.com>
93 * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
94 anonymous method storey to an instance method when only "this" is hoisted.
96 2008-07-03 Marek Safar <marek.safar@gmail.com>
99 * expression.cs: Pointer comparisons use unsigned operator.
101 2008-07-03 Marek Safar <marek.safar@gmail.com>
103 * expression.cs: Fixed native pointer conversions. Also fixes #321615.
105 2008-07-02 Marek Safar <marek.safar@gmail.com>
107 A fix for bug #404905
108 * class.cs: Always initialize local unsafe variables.
110 2008-06-30 Marek Safar <marek.safar@gmail.com>
112 A fix for bug #396987
113 * expression.cs (NewInitialize): Clear local temporary variable for next run
115 2008-06-27 Marek Safar <marek.safar@gmail.com>
117 A fix for bug #401020
118 * ecore.cs: Both types and modifiers have to match for ref and out arguments
120 2008-06-27 Marek Safar <marek.safar@gmail.com>
122 A fix for bug #398319
123 * cs-parser.jay: Implemented undocumented base access expression inside
126 2008-06-26 Marek Safar <marek.safar@gmail.com>
128 A fix for bug #404227
129 * cs-parser.jay: Parse namespace declaration using qualified identifier.
131 2008-06-26 Marek Safar <marek.safar@gmail.com>
133 A fix for bug #404227
134 * convert.cs: Fixed explicit array to interface cast.
136 2008-06-26 Marek Safar <marek.safar@gmail.com>
138 A fix for bug #403894
139 * delegate.cs: Mutate DelegateInvocation type.
141 2008-06-26 Marek Safar <marek.safar@gmail.com>
143 A fix for bug #379348
144 * delegate.cs: Box a load of generic parameters.
146 2008-06-26 Marek Safar <marek.safar@gmail.com>
148 * expression.cs: Add an array creation arguments mutate.
150 2008-06-26 Marek Safar <marek.safar@gmail.com>
152 A fix for bug #386068
153 * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
156 2008-06-25 Marek Safar <marek.safar@gmail.com>
158 * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
161 2008-06-25 Marek Safar <marek.safar@gmail.com>
163 A fix for bug #403518
164 * delegate.cs: Type correctly anonymous method new invocation.
166 2008-06-24 Marek Safar <marek.safar@gmail.com>
168 A fix for bug #394826
169 * anonymous.cs: Fully qualify members when resolving anonymous type internal
172 2008-06-24 Marek Safar <marek.safar@gmail.com>
174 A fix for bug #394826
175 * anonymous.cs, iterators.cs: Construct generic storey only when is really
178 2008-06-24 Marek Safar <marek.safar@gmail.com>
180 * class.cs: Clone indexer parameters for localized capturing.
182 2008-06-24 Marek Safar <marek.safar@gmail.com>
184 A fix for bug #402379
185 * expression.cs: Don't crash when an object initializer resolve fails.
187 2008-06-24 Marek Safar <marek.safar@gmail.com>
189 A fix for bug #402888
190 * expression.cs: Mutate conditional expression.
192 2008-06-24 Marek Safar <marek.safar@gmail.com>
194 A fix for bug #401012
195 * class.cs: Keep StructLayout in shared container.
197 2008-06-24 Marek Safar <marek.safar@gmail.com>
199 A fix for bug #400438
200 * decl.cs, class.cs: Only properties can be automatically implemented.
202 2008-06-24 Marek Safar <marek.safar@gmail.com>
204 * statement.cs (ChangeToIterator): Copy also labels.
206 2008-06-23 Marek Safar <marek.safar@gmail.com>
208 * ecore.cs: Pass type argument details to parent extension method.
210 2008-06-23 Marek Safar <marek.safar@gmail.com>
212 A fix for bug #375966
213 * delegate.cs: Fixed IsTypeCovariant generic type conversions.
215 2008-06-23 Raja R Harinath <harinath@hurrynot.org>
217 * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
219 2008-06-22 Marek Safar <marek.safar@gmail.com>
221 A fix for bug #394347
222 * anonymous.cs: Cache compatible delegates as compatibility check produces
223 a new method every time.
225 2008-06-20 Marek Safar <marek.safar@gmail.com>
227 * anonymous.cs: Propagate storey reference for single references.
229 2008-06-20 Marek Safar <marek.safar@gmail.com>
231 A fix for bug #387615
232 * assign.cs, expression.cs: Correctly clone compound assignment.
234 2008-06-19 Marek Safar <marek.safar@gmail.com>
236 A fix for bug #359611, #359604
237 * anonymous.cs: Mutate all types of hoisted parameters.
239 2008-06-19 Marek Safar <marek.safar@gmail.com>
241 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
242 delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
243 expression.cs, codegen.cs, statement.cs
245 Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
246 #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
248 ** Anonymous methods, lambda expressions rewrite **
250 Anonymous expressions are now resolved when an explicit block is resolved
251 and they don't require any registration procedure anymore. Further,
252 anonymous methods are defined when explicit block is emitted which allows
253 better control of whole process and opens possibilities for more
254 optimizations as well as alternative to reverse whole process.
256 A concept of `MutateHoistedGenericType' was introduced to keep the resolve
257 process consistent and to correctly emit hoisted generic methods when they
258 have at least 1 hoisted variable.
260 2008-06-17 Martin Baulig <martin@ximian.com>
262 * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
264 (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
265 virtual property; check it in Emit().
266 (PropertyMethod.IsDebuggerHidden): Override, check whether we're
268 (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
270 (Indexer.Define): Likewise.
272 2008-06-17 Marek Safar <marek.safar@gmail.com>
274 * convert.cs: Don't use IsInterface on type arguments.
276 * delegate.cs: DelegateInvocation uses MethodInfo.
278 * parameter.cs: Removed IsTypeParameter.
280 * generic-mcs.cs: More missing stuff.
282 2008-06-16 Martin Baulig <martin@ximian.com>
285 (Modifiers.DEBUGGER_HIDDEN): New public const.
288 (TypeManager.GetDebuggerHiddenAttribute): New public static method.
291 (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
292 (AbstractPropertyEventMethod): Likewise.
293 (Constructor.Emit): Likewise.
294 (SourceMethod.SetCompilerGenerated): Removed.
296 * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
300 (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
301 if we're an `IteratorHost'.
302 (AnonymousMethodMethod..ctor): Don't set
303 `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
306 2008-06-16 Marek Safar <marek.safar@gmail.com>
308 * statement.cs: Clean-up foreach statements.
310 2008-06-12 Marek Safar <marek.safar@gmail.com>
312 * class.cs: Stop using public method which should not exist.
314 2008-06-11 Martin Baulig <martin@ximian.com>
317 (Location.LookupFile): Add `CompilationUnit' argument; when given
318 a relative file name, make it relative to the directory the .cs
319 file is located in instead of using the current directory.
321 2008-06-11 Martin Baulig <martin@ximian.com>
324 (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
325 (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
326 (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
327 (SourceMethod.SetCompilerGenerated): Likewise.
329 2008-06-11 Marek Safar <marek.safar@gmail.com>
331 * codegen.cs, driver: Only write symbol file when it's asked for.
333 2008-06-11 Marek Safar <marek.safar@gmail.com>
335 * codegen.cs: Don't use assembly writer error handling for symbol writer.
337 2008-06-10 Martin Baulig <martin@ximian.com>
339 * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
341 2008-06-09 Marek Safar <marek.safar@gmail.com>
343 A fix for bug #316290
344 * expression.cs: Include decimal operators in predefined table.
346 * parameters.cs: More readonlyness.
348 2008-06-09 Marek Safar <marek.safar@gmail.com>
350 A fix for bug #397213
351 * cs-parser.jay: One more missing current_local_parameters reset.
353 2008-06-09 Marek Safar <marek.safar@gmail.com>
355 A fix for bug #396633
356 * class.cs: Host backing field in partial container.
358 2008-06-09 Marek Safar <marek.safar@gmail.com>
360 A fix for bug #397068
361 * expression.cs: Check both operand types when predefined operator is used.
363 2008-06-05 Martin Baulig <martin@ximian.com>
365 Merged the `debugger-kahalo' branch.
368 (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
369 we're an iterator method.
370 (SourceMethod): Reflect latest symbol writer changes;
371 SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
372 now `start_row' and `end_row'.
373 (Constructor.Emit): Fix the logic whether to emit symbol information.
375 * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
379 (CompilationUnit): New public class; derives from `SourceFile'.
380 (SourceFileEntry.DefineSymbolInfo): New public method.
381 (SourceFileEntry.SetChecksum): New public method.
382 (Location): Encode hidden line numbers by using `column == 255';
383 the .ctor now accepts `column == -1' to mark a hidden line number.
384 (Location.Hidden): New public property.
385 (Location.CheckPoint): Add `CompilationUnit'.
386 (Location.SourceFiles): Change return type to `CompilationUnit[]'.
387 (Location.Push): Add `CompilationUnit compile_unit' argument.
388 (Location.CompilationUnit): New public property.
391 (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
393 * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
395 * driver.cs: `SourceFile' -> `CompilationUnit'.
397 * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
399 * namespace.cs: `SourceFile' -> `CompilationUnit'.
401 * cs-tokenizer.cs: Add support for `#pragma checksum' and
405 (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
406 new symbol writer API to also pass the file.
408 2008-06-05 Marek Safar <marek.safar@gmail.com>
410 * statement.cs: Emit catch variable assignment using variable expression.
412 2008-06-05 Marek Safar <marek.safar@gmail.com>
414 * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
415 with other variable types.
417 2008-06-04 Marek Safar <marek.safar@gmail.com>
419 * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
420 GetLength method emit, it breaks resolve rules.
422 2008-06-02 Atsushi Enomoto <atsushi@ximian.com>
423 Marek Safar <marek.safar@gmail.com>
425 A fix for bug #395542
426 * cs-parser.jay: The trailing comma is allowed in anonymous type member
429 2008-06-02 Marek Safar <marek.safar@gmail.com>
431 A fix for bug #395287
432 * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
434 2008-05-31 Marek Safar <marek.safar@gmail.com>
436 A fix for bug #395845
437 * class.cs, nullable.cs: User unary operator is allowed to have nullable and
438 non-nullable parameter type.
440 2008-05-31 Marek Safar <marek.safar@gmail.com>
442 * class.cs: Handle contructor initializer as a statement in top-level block.
444 2008-05-30 Marek Safar <marek.safar@gmail.com>
446 * attribute.cs: Don't mix old and new corlib types when emitting corlib
449 2008-05-24 Marek Safar <marek.safar@gmail.com>
451 * ecore.cs, expression.cs: Small IVariable refactoring.
453 2008-05-22 Marek Safar <marek.safar@gmail.com>
455 * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
457 2008-05-21 Marek Safar <marek.safar@gmail.com>
459 * cs-parser.jay: Removed redundant catch type check.
461 2008-05-21 Marek Safar <marek.safar@gmail.com>
463 A fix for bug #390372
464 * nullable.cs: Set correct return type.
466 2008-05-21 Marek Safar <marek.safar@gmail.com>
468 A fix for bug #391062
469 * typemanager.cs: Fixed crash when comparing null types.
471 2008-05-21 Marek Safar <marek.safar@gmail.com>
473 A fix for bug #391871
474 * cs-parser.jay: Better error handling for invalid catch type.
476 2008-05-20 Marek Safar <marek.safar@gmail.com>
478 A fix for bug #392155
479 * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
481 2008-05-15 Marek Safar <marek.safar@gmail.com>
483 A fix for bug #390666
484 * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
487 2008-05-15 Marek Safar <marek.safar@gmail.com>
489 * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
492 2008-05-13 Marek Safar <marek.safar@gmail.com>
494 A fix for bug #389625
495 * delegate.cs, generic.cs: Some progress on method group return type
498 2008-05-13 Marek Safar <marek.safar@gmail.com>
500 A fix for bug #378419
501 * namespace.cs: Inspect also parent namespaces not only namespace entries.
503 2008-05-12 Marek Safar <marek.safar@gmail.com>
505 * class.cs (Constructor): Added IsCompilerGenerated.
507 2008-05-12 Marek Safar <marek.safar@gmail.com>
509 * expression.cs: Enum binary operators can accept non-enum operand only when
510 is implicitly convertible to underlying type.
512 2008-05-12 Marek Safar <marek.safar@gmail.com>
514 A fix for bug #389272
515 * support.cs: Workaround System.InvalidOperationException for enums.
517 2008-05-12 Marek Safar <marek.safar@gmail.com>
519 A fix for bug #389073
520 * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
522 2008-05-10 Marek Safar <marek.safar@gmail.com>
524 * driver.cs: Split Parse.
526 * location.cs (LookupFile): Uses string.Empty.
528 2008-05-07 Marek Safar <marek.safar@gmail.com>
530 * expression.cs, parameter.cs: Small ParameterReference clean up.
532 2008-05-07 Marek Safar <marek.safar@gmail.com>
534 * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
537 2008-05-06 Martin Baulig <martin@ximian.com>
539 * class.cs (Constructor.Emit): Fix the logic whether to emit
542 2008-05-06 Raja R Harinath <harinath@hurrynot.org>
545 * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
546 InvalidOperationException when the iterator is before the start or
549 2008-05-06 Marek Safar <marek.safar@gmail.com>
551 * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
552 when left is nullable type.
554 2008-05-06 Marek Safar <marek.safar@gmail.com>
556 A fix for bug #386628
557 * expression.cs (LocalVariableReference): Continue in resolving when
558 variable is not assigned.
560 2008-05-05 Marek Safar <marek.safar@gmail.com>
562 * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
565 2008-05-04 Marek Safar <marek.safar@gmail.com>
567 * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
568 it saves many redundant temporary variables for nullable operations.
570 2008-05-03 Marek Safar <marek.safar@gmail.com>
572 * assign.cs: EventAddOrRemove is a statement and cannot have a type.
574 * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
577 * nullable.cs: Constant coalescing operator optimizations.
579 2008-05-03 Marek Safar <marek.safar@gmail.com>
581 * constant.cs: Use unsigned conversion for values which are unsigned only.
583 2008-05-03 Marek Safar <marek.safar@gmail.com>
585 * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null
586 coalescing operator as it should be.
588 2008-05-02 Marek Safar <marek.safar@gmail.com>
590 A fix for bug #371016
591 * expression.cs: All predefined delegate operators require implicit method
594 2008-05-02 Marek Safar <marek.safar@gmail.com>
596 * constant.cs: Emit long constant as uint when fits the range.
598 * convert.cs, expression.cs: Fixed few unsafe conversions.
600 2008-05-02 Marek Safar <marek.safar@gmail.com>
602 * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
604 2008-05-02 Raja R Harinath <harinath@hurrynot.org>
607 * convert.cs (ImplicitNumericConversion): Don't modify the type of
609 * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
611 2008-05-01 Marek Safar <marek.safar@gmail.com>
613 * constant.cs, literal.cs: IsLiteral property for error reporting.
615 * ecore.cs, expression.cs: Implemented Property expression.
617 2008-05-01 Marek Safar <marek.safar@gmail.com>
619 * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
621 * nullable.cs: Implemented nullable coalescing null operator.
623 * ecore.cs, expression.cs: Expression trees work.
625 2008-05-01 Marek Safar <marek.safar@gmail.com>
627 * ecore.cs: CreateExpressionTree is finally abstract.
629 * expression.cs, linq.cs: Updated.
631 2008-05-01 Marek Safar <marek.safar@gmail.com>
633 * expression.cs, ecore.cs: Block base access expression inside expression
636 2008-05-01 Marek Safar <marek.safar@gmail.com>
638 A fix for bug #385058
639 * expression.cs: User-defined operator implementations always take
640 precedence over predefined operator implementations.
642 2008-04-30 Marek Safar <marek.safar@gmail.com>
644 * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
645 class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
646 expression tree conversions.
648 2008-04-30 Marek Safar <marek.safar@gmail.com>
650 * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
651 operators method details to Operator class.
653 2008-04-30 Marek Safar <marek.safar@gmail.com>
655 * anonymous.cs: Pass unsafe flags to anonymous container.
657 * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
658 inside expression tree.
660 2008-04-29 Martin Baulig <martin@ximian.com>
662 * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
663 (Tokenizer.PopPosition): Also restore the `line'.
665 2008-04-29 Marek Safar <marek.safar@gmail.com>
667 * delegate.cs: Implemented Invoke expression.
669 2008-04-29 Marek Safar <marek.safar@gmail.com>
671 * expression.cs: Fixed equality reference comparison regression.
673 2008-04-29 Marek Safar <marek.safar@gmail.com>
675 * ecore.cs: Clean up EmptyCast hack.
677 * expression.cs, nullable.cs: Implemented enum binary and unary operations
678 using correct conversion rules. Also fixes #383993.
680 2008-04-28 Martin Baulig <martin@ximian.com>
682 * class.cs (Constructor.Emit): Don't emit debugging information
683 for generated default .ctor's.
685 2008-04-28 Marek Safar <marek.safar@gmail.com>
687 * convert.cs: Empty-cast ushort to int conversion.
689 2008-04-28 Marek Safar <marek.safar@gmail.com>
691 A fix for bug #384191
692 * ecore.cs, expression.cs: Fixed expression cloning.
694 2008-04-28 Marek Safar <marek.safar@gmail.com>
696 * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
698 2008-04-28 Raja R Harinath <harinath@hurrynot.org>
700 Fix #381559, test-638.cs, test-639.cs
701 * assign.cs (CompoundAssign.Helper): New wrapper.
702 (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
704 * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
705 Pass unconverted expressions to the params array creation expression.
706 (FieldExpr.EmitAssign): Don't special-case StringConcat.
707 (PropertyExpr.EmitAssign): Likewise.
708 * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
709 element if it is of kind CompoundAssign.Helper.
710 (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
711 first before anything else.
712 (ArrayAccess.EmitAssign): Don't special-case StringConcat.
713 (ArrayAccess.LoadArrayAndArguments): Simplify.
715 2008-04-27 Marek Safar <marek.safar@gmail.com>
717 * expression.cs: Fixed cloning of typeof(void).
719 2008-04-27 Raja R Harinath <harinath@hurrynot.org>
721 * assign.cs (Assign.DoResolve): Remove support for EventExprs.
722 (Assign.Emit): Likewise. Move it to ...
723 (CompoundAssign.DoResolve): ... here and ...
724 (CompoundAssign.Emit): ... here.
725 (EventAddOrRemove): New helper to handle += and -= on events, and
726 avoid the use of BinaryDelegates.
727 * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
728 (EventExpr.EmitAddOrRemove): Improve.
729 * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
731 * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
732 create VarExprs for 'foo.bar.var'.
733 * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
734 is a highly inappropriate name for its functionality.
736 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
738 Simplify handling of multiple assignments
739 * assign.cs (Assign): Clear out all 'embedded assign' gunk. Make
741 (SimpleAssign): New. Class to be used for normal assignments.
742 * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
743 * expression.cs, parameter.cs, statement.cs: Likewise.
745 2008-04-25 Marek Safar <marek.safar@gmail.com>
747 * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
748 for incompatible underlying types, more to come, uff.
750 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
753 * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
756 2008-04-25 Marek Safar <marek.safar@gmail.com>
758 * expression.cs, nullable.cs: Implemented UnaryPlus expression.
760 2008-04-24 Raja R Harinath <harinath@hurrynot.org>
762 Fix test-636.cs. Sprinkle a few more 'EmitSideEffect's around
763 * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
764 * statement.cs (While, Do, For): Allow test to have side effects.
765 (For.DoEmit): Always emit InitStatement.
768 * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
769 Always create SideEffectConstant.
770 (Binary.EnumLiftUp): Don't assume that the enumeration constant is
771 of type EnumConstant.
773 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
774 Handle 'right' being SideEffectConstant of type 'bool'.
776 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
777 Use left.EmitBranchable instead of open coding it, so as to
778 improve optimization opportunities.
780 * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
782 * ecore.cs (Expression.EmitBranchable): Document some non-obvious
784 (Expression.EmitSideEffect): Document.
786 2008-04-23 Marek Safar <marek.safar@gmail.com>
788 * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
790 2008-04-23 Marek Safar <marek.safar@gmail.com>
792 * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
794 2008-04-23 Marek Safar <marek.safar@gmail.com>
796 * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
797 conversion to expression tree.
799 2008-04-23 Marek Safar <marek.safar@gmail.com>
801 * ecore.cs: Removed unused expression.
803 2008-04-22 Marek Safar <marek.safar@gmail.com>
805 * expression.cs: Implemented NegateChecked and New expressions.
807 2008-04-22 Marek Safar <marek.safar@gmail.com>
809 * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
811 2008-04-22 Raja R Harinath <harinath@hurrynot.org>
814 * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
815 needing final 'ret' instruction.
817 2008-04-22 Marek Safar <marek.safar@gmail.com>
819 * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
821 2008-04-21 Marek Safar <marek.safar@gmail.com>
823 * expression.cs: Emit ldnull and not null expression as an instance argument
824 of static method expression calls.
826 2008-04-21 Marek Safar <marek.safar@gmail.com>
828 A fix for bug #378200
829 * expression.cs: Fixed crash when creating parameterless expression tree
832 2008-04-21 Marek Safar <marek.safar@gmail.com>
834 A fix for bug #375297
835 * anonymous.cs: Fixed crash when inferring from null argument anonymous
838 2008-04-21 Marek Safar <marek.safar@gmail.com>
840 A fix for bug #377596
841 * decl.cs, class.cs: Emit delegate type argument attributes.
843 2008-04-21 Marek Safar <marek.safar@gmail.com>
845 A fix for bug #365314
846 * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
848 2008-04-21 Marek Safar <marek.safar@gmail.com>
850 * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
853 2008-04-21 Marek Safar <marek.safar@gmail.com>
855 * generic.cs (TypeParameter): Removed redundant location.
857 2008-04-19 Marek Safar <marek.safar@gmail.com>
859 * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
860 delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
861 FullNamedExpression in all declaration type expression, statements will come
864 2008-04-18 Marek Safar <marek.safar@gmail.com>
866 * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
867 nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
869 2008-04-18 Marek Safar <marek.safar@gmail.com>
871 * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
874 2008-04-17 Marek Safar <marek.safar@gmail.com>
876 * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
879 2008-04-17 Marek Safar <marek.safar@gmail.com>
881 * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
885 2008-04-17 Raja R Harinath <harinath@hurrynot.org>
887 Hook up 'EmitSideEffect'
888 * constant.cs (Constant.EmitSideEffect): New.
889 (SideEffectConstant.Emit): Simplify. Use EmitSideEffect.
890 (SideEffectConstant.EmitSideEffect): New.
891 * ecore.cs (BoxedCast.EmitBranchable): Remove. We can't use an
892 unconditional branch in EmitBranchable.
893 (FieldExpr.EmitBranchable): New.
894 * expression.cs (Unary.EmitSideEffect): New.
895 (Binary.EmitSideEffect): New.
896 (VariableReference.EmitSideEffect): New. Do nothing.
898 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
900 Introduce 'EmitSideEffect'
901 * ecore.cs (Expression.EmitSideEffect): New.
902 (TypeCast): Rename from EmptyCast.
904 (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
905 (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
906 * convert.cs, nullable.cs: Update to changes.
908 2008-04-16 Marek Safar <marek.safar@gmail.com>
910 * class.cs, cs-parser.jay: Early check for base types expression.
912 2008-04-16 Marek Safar <marek.safar@gmail.com>
914 * decl.cs (MemberName): Declare PrettyName as obsolete.
916 2008-04-16 Marek Safar <marek.safar@gmail.com>
918 * namespace.cs: Use MemberName comparison.
920 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
923 * decl.cs (MemberName.PrettyName): New. Replaces the misnamed
925 (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
926 (MemberName.FullyQualifiedName): New. Provides the functionality
927 that users assume FullName would have.
928 * ecore.cs, namespace.cs: Update to changes.
930 * statement.cs (Using.assign): Make into ExpressionStatement.
931 (Using.EmitPreTryBody): Simplify.
933 2008-04-16 Marek Safar <marek.safar@gmail.com>
935 * report.cs: ColorFormat is protected.
937 * rootcontext.cs: Unused fields clean-up.
939 * namespace.cs: Made UsingEntry name private.
941 2008-04-16 Marek Safar <marek.safar@gmail.com>
943 * cs-tokenizer.cs, location.cs: Removed unused field.
945 2008-04-16 Jan Oravec <jan.oravec@6com.sk>
946 Raja R Harinath <harinath@hurrynot.org>
949 * constant.cs (SideEffectConstant.value): Rename from 'left'.
950 (SideEffectConstant.side_effect): Rename from 'right'.
951 (SideEffectConstant..ctor): Normalize 'side_effect'.
952 (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
953 value of this constant.
954 * cfold.cs: Update to changes.
956 2008-04-15 Marek Safar <marek.safar@gmail.com>
958 * cs-paser.jay: Removed unused variable.
960 * driver.cs: Made Compile instance method.
962 2008-04-15 Raja R Harinath <harinath@hurrynot.org>
964 * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
966 2008-04-15 Marek Safar <marek.safar@gmail.com>
968 * cs-paser.jay, namespace.cs: Simplified handling of namespace imports.
970 2008-04-13 Jb Evain <jbevain@novell.com>
972 * namespace.cs: update the System.Core fullname for 2.1
973 * driver.cs: update the list of required assemblies for 2.1.
974 Merged from the Moonlight 2 branch.
976 2008-04-11 Marek Safar <marek.safar@gmail.com>
978 * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
979 types and user defined operators. User operators arguments has to be checked
980 for null value before invocation, which also means no operator is called
981 when any argument is not convertible to unwrapped nullable type.
983 2008-04-09 Marek Safar <marek.safar@gmail.com>
985 * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
986 of Unary expressions to follow operator overloading rules precisely.
987 Also fixes #321794, #323794
989 2008-04-08 Marek Safar <marek.safar@gmail.com>
991 * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
994 2008-04-08 Marek Safar <marek.safar@gmail.com>
996 * expression.cs, ecore.cs: Implemented MemberInit expression.
998 2008-04-08 Raja R Harinath <harinath@hurrynot.org>
1000 Fix mono/tests/exception4.cs
1001 * statement.cs (ExceptionStatement, TryCatch): Revert to using
1002 ec.NeedReturnLabel () rather emitting a 'nop'.
1004 * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
1006 (TryCatch.SomeCodeFollows): Likewise.
1007 * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
1008 for 'break', 'continue' and 'return' statements inside a try.
1009 We're fairly sure that the generated IL stream will have more
1010 instructions textually following the try.
1011 (FlowBranchingTryCatch): Likewise.
1013 * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
1014 * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
1017 * statement.cs (CollectionForeach.DisposableWrapper): Make a true
1018 wrapper -- forward everything to CollectionForeach.
1019 (CollectionForeach.NonDisposableWrapper): New.
1020 (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
1021 instead of a pop + branch to end.
1023 2008-04-07 Marek Safar <marek.safar@gmail.com>
1025 A fix for bug #377485
1026 * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs:
1027 Propagate location for extension method groups. Report conversion failure at
1030 2008-04-07 Marek Safar <marek.safar@gmail.com>
1032 * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
1033 ListInit and Field expressions.
1035 2008-04-06 Raja R Harinath <harinath@hurrynot.org>
1037 * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
1038 Since $PC is always -1 inside the body of MoveNext, the fault
1040 * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
1041 * statement.cs (ExceptionStatement.emit_finally): Likewise.
1042 (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
1044 The denouement! Fix #324708
1045 * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
1046 (Iterator.EmitYieldBreak): We no longer need to reset $PC.
1047 * statement.cs (ExceptionStatement.DoEmit): Actually emit the
1048 'finally' inside the finally clause.
1050 * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
1051 inside an iterator. Don't emit the body of the 'finally' inside
1052 the finally clause yet.
1054 Use the ResumableStatement infrastructure for MoveNext ()
1055 * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
1056 (Iterator.EmitMoveNext): Use 'resume_points'. Get rid of
1057 'old_resume_points'. Move dispatcher upfront.
1058 (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
1059 * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
1060 in an enumerator. This encodes the main fix in this patch series
1061 -- we can only jump into the first instruction of a try from the
1062 outside, but we want to emit try/finally regions in iterators and
1063 resume in the middle of them.
1065 2008-04-05 Raja R Harinath <harinath@hurrynot.org>
1067 * statement.cs (ExceptionStatement.ResolveFinally): Move setting
1068 of NeedReturnLabel here.
1070 Introduce a common point for emitting try/finally to IL
1071 * statement.cs (ExceptionStatement.DoEmit): New. Combines all the
1072 features of the various subclasses, which are now driven by ...
1073 (ExceptionStatement.EmitPreTryBody): ... this and ...
1074 (ExceptionStatement.EmitTryBody): ... this and the original
1076 (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
1077 Remove DoEmit and update to follow above protocol.
1079 * statement.cs (ExceptionStatement.EmitForDispose): If all labels
1080 of the dispatcher are the same, skip emitting the 'switch'.
1081 * iterator.cs (Iterator.EmitDispose): Update to changes.
1083 Clean up handling of 'using' statement
1084 * statement.cs (UsingTemporary): New. Carved out of ...
1085 (Using): ... this. Simplify drastically. Handle exactly
1087 * cs-parser.jay (using_statement): Split. Create UsingTemporary
1088 or Using as appropriate. If there are multiple variable declared,
1089 create nested Using statements.
1090 (resource_acquisition): Kill.
1092 * statement.cs (ExceptionStatement.EmitForDispose): Use
1093 EmitFinallyBody, not EmitFinally.
1095 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
1096 * iterator.cs: Update to changes.
1098 Start using the ResumableStatement infrastructure
1099 * statement.cs (ResumeableStatement.PrepareForDispose): New.
1100 (ResumableStatement.EmitForDispose): New.
1101 (ExceptionStatement): Override them.
1102 * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
1103 EmitForDispose to create the body of the Dispose method. Don't
1106 * iterator.cs (Iterator.AddResumePoint): Move here from ...
1107 * statement.cs (Toplevel.AddResumePoint): ... here.
1108 (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
1109 * flowanalysis.cs (FlowBranchingIterator): New.
1110 * codegen.cs (EmitContext): Update to changes.
1112 * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
1113 (Iterator.old_resume_points): Rename from 'resume_points'.
1114 (Iterator.MoveNextStatement): Remove unused class.
1116 New infrastructure for try/finally in iterators (still unused)
1117 * flowanalysis.cs (FlowBranching.AddResumePoint): New.
1118 (FlowBranchingToplevel.AddResumePoint): Hook into
1119 ToplevelBlock.AddResumePoint.
1120 (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
1121 (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
1122 * statement.cs (ToplevelBlock.AddResumePoint): New. Collect
1123 resume points and assign program-counter values.
1124 (ExceptionBlock.AddResumePoint): Collect resume points for
1125 de-muxer at the top of try block.
1126 * iterators.cs (Yield.CheckContext): Simplify.
1127 (Yield.Resolve): Use FlowBranching.AddResumePoint.
1129 2008-04-04 Raja R Harinath <harinath@hurrynot.org>
1131 * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
1132 argument to an ExitStatement.
1133 (FlowBranchingException): Refactor saved origins code.
1134 * statement.cs (ExitStatement): Update to cahges.
1135 * iterator.cs (YieldBreak): Likewise.
1137 * statement.cs (ResumableStatement): New. Common base class for
1138 YieldReturn and ExceptionStatement.
1139 (ExitStatement): New. Common base class for Return and YieldBreak.
1140 (Return): Update to changes.
1141 * iterator.cs (YieldBreak): Likewise.
1142 * lambda.cs (ContextualReturn): Likewise.
1145 * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
1146 emit a meaningful error message.
1148 Fix #324765, #319508
1149 * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
1150 (VariableInfo.SetAssigned): Set it.
1151 * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
1152 determine if CS0219 or CS0168 is appropriate. Don't use
1153 flow-analysis information.
1154 (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
1155 * codegen.cs (EmitContext.DoEndFlowBranching): Kill. Inline into ...
1156 (EmitContext.EndFlowBranching): ... this.
1158 2008-04-03 Marek Safar <marek.safar@gmail.com>
1160 * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
1162 2008-04-03 Marek Safar <marek.safar@gmail.com>
1164 A fix for bug #376508
1165 * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
1166 ImplicitConversionExists.
1168 2008-04-03 Marek Safar <marek.safar@gmail.com>
1170 * expression.cs (Binary): Added remaining binary operators to expression
1173 * nullable.cs: Optimize shift with null argument.
1175 2008-04-03 Raja R Harinath <harinath@hurrynot.org>
1177 Fix minor IL regression
1178 * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
1179 (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
1180 * cs-parser.jay (try_statement): Update to changes.
1182 * statement.cs (TryFinally.need_exc_block): Delete.
1183 (TryFinally): Update to changes.
1185 Now all ExceptionStatements are unconditional
1186 * statement.cs (CollectionForeach.DisposableWrapper): New.
1187 Extract out the try/finally code into a new wrapper.
1188 (CollectionForeach.Resolve): Use it to simplify the code.
1190 2008-04-02 Raja R Harinath <harinath@hurrynot.org>
1192 Start at simplifying ExceptionStatement semantics a bit
1193 * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
1194 * cs-parser.jay (try_statement): Update to changes.
1195 (opt_catch_clauses): Remove.
1196 * flowanalysis.cs: Update to changes.
1197 (FlowBranching.BranchingType.TryCatch): New.
1198 (FlowBranchingTryCatch): New.
1200 * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
1201 (FlowBranching.CreateBranching): Update to changes.
1202 (FlowBranchingBlock.AddSibling): Add sanity check.
1203 * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
1206 * iterators.cs (Iterator.MarkFinally): Remove.
1207 * statement.cs (ExceptionStatement): Update to changes.
1209 Add support for skipping over finally blocks at runtime. First
1210 in a series to fix #324708
1211 * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
1212 (Iterator.EmitMoveNext): Initialize it.
1213 * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
1214 branch over the body of the 'finally' clause.
1216 2008-03-31 Raja R Harinath <harinath@hurrynot.org>
1218 Avoid lopsided use of Foo/DoFoo names
1219 * statement.cs (ExpressionStatement.EmitFinallyBody):
1220 Rename from EmitFinally.
1221 (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
1222 * iterator.cs: Update to changes.
1224 2008-04-02 Marek Safar <marek.safar@gmail.com>
1226 * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
1227 based on UserOperatorCall. More binary nullable operators clean up.
1229 2008-04-02 Martin Baulig <martin@ximian.com>
1231 * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
1233 2008-04-02 Marek Safar <marek.safar@gmail.com>
1235 * nullable.cs: Merge user and empty conversions when lifting expression
1238 * expression.cs (StringConcat): Implemented expression tree representation.
1240 2008-04-01 Marek Safar <marek.safar@gmail.com>
1242 * nullable.cs: When lifting null literal and a user operator exists, no call
1245 2008-04-01 Marek Safar <marek.safar@gmail.com>
1247 * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
1250 2008-04-01 Marek Safar <marek.safar@gmail.com>
1252 * nullable.cs, expression.cs: Use namespace instead heavily nested
1253 monster abstract class.
1255 2008-04-01 Marek Safar <marek.safar@gmail.com>
1257 * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
1258 lifting of null literal and user operators. Clean up of some temporary
1261 2008-03-30 Raja R Harinath <harinath@hurrynot.org>
1263 Fix #368224, test-629.cs
1264 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
1265 if it crossed an unwind-protect boundary.
1266 * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
1267 (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
1268 inside an unwind-protected region.
1269 (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
1270 (Iterator.MarkYield): Add 'unwind_protect' parameter. Emit a
1271 'leave' instead of a 'br' if unwind-protected.
1272 (Iterator.EmitYieldBreak): Likewise.
1274 2008-03-29 Gert Driesen <drieseng@users.sourceforge.net>
1276 * driver.cs: Only define versioninfo resources if no win32 resource
1279 2008-03-28 Marek Safar <marek.safar@gmail.com>
1281 A fix for bug #372375
1282 * convert.cs: Fixed boxing of nullable types.
1284 2008-03-28 Marek Safar <marek.safar@gmail.com>
1286 * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
1289 2008-03-28 Marek Safar <marek.safar@gmail.com>
1291 A fix for bug #374619
1292 * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
1294 2008-03-27 Marek Safar <marek.safar@gmail.com>
1296 * lambda.cs: Check return type only for invocation.
1298 2008-03-27 Marek Safar <marek.safar@gmail.com>
1300 A fix for bug #374214
1301 * ecore.cs: Correctly report argument type mismatch.
1303 2008-03-27 Marek Safar <marek.safar@gmail.com>
1305 * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
1306 and not rely on broken IsEnum.
1308 2008-03-27 Marek Safar <marek.safar@gmail.com>
1310 * nullable.cs: New file, extracted from generic.cs.
1312 * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
1314 2008-03-27 Marek Safar <marek.safar@gmail.com>
1316 * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
1317 predefined comparison operators and null literals.
1319 * report.cs: New warning ID.
1321 2008-03-25 Marek Safar <marek.safar@gmail.com>
1323 A fix for bug #370577
1324 * lambda.cs: Check return type too.
1326 2008-03-25 Marek Safar <marek.safar@gmail.com>
1328 A fix for bug #372846
1329 * class.cs: Automatic properties can be declared as unsafe.
1331 2008-03-20 Marek Safar <marek.safar@gmail.com>
1333 * location.cs: Use string based concatenation.
1335 * expression.cs: LiftedBinaryOperator is gmcs only.
1337 2008-03-20 Marek Safar <marek.safar@gmail.com>
1339 * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
1340 conversions rules and expression trees.
1342 2008-03-19 Marek Safar <marek.safar@gmail.com>
1344 * delegate.cs: Use extension method source as delegate target.
1346 2008-03-19 Marek Safar <marek.safar@gmail.com>
1348 * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
1349 binary operations to be purely based on binary operations and optimized
1350 emitted code (30% less in some cases). Introduced ReducedExpression for ETs
1351 and other ET refactoring.
1353 * typemanager.cs: Fixed warning.
1355 2008-03-17 Marek Safar <marek.safar@gmail.com>
1357 * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
1359 * symbolwriter.cs: Fixed.
1361 2008-03-17 Marek Safar <marek.safar@gmail.com>
1363 * anonymous.cs, driver.cs: Reset anonymous types counters.
1365 2008-03-17 Marek Safar <marek.safar@gmail.com>
1367 * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
1369 * class.cs: Use fullname for all type member definitions.
1371 2008-02-19 Martin Baulig <martin@ximian.com>
1374 (IMethodData.EmitExtraSymbolInfo): New interface method.
1375 (MethodData.Emit): Call method.EmitExtraSymbolInfo().
1376 (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
1377 interface method here as an empty public virtual method.
1380 (AnonymousMethodMethod.ctor): Added `string real_name' argument.
1381 (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
1382 CodeGen.SymbolWriter.SetRealMethodName().
1384 2008-02-18 Martin Baulig <martin@ximian.com>
1387 (ScopeInfo.EmitType): Override this and emit debugging
1388 information for captured variables.
1389 (RootScopeInfo.EmitType): Override this and emit symbol
1390 information for a captured `this'.
1392 2008-02-15 Martin Baulig <martin@ximian.com>
1394 * iterators.cs: Emit debugging info.
1397 (EmitContext.Flags): Add `OmitDebuggingInfo'.
1398 (EmitContext.OmitDebuggingInfo): New public property.
1401 (While): Override Emit() and don't emit symbol info there; do it
1402 inside DoEmit() instead.
1403 (Block.Emit): Omit symbol information while emitting the scope
1404 initializers; don't ec.Mark() the `EndLocation'. Fix the lexical
1406 (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
1407 (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
1408 .ctor to make `IsIterator' work.
1410 2008-03-14 Martin Baulig <martin@ximian.com>
1412 * symbolwriter.cs: Added the new symbol writer function from the
1413 debugger's `terrania' branch; temporarily enclose them inside
1414 `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
1417 2008-03-14 Martin Baulig <martin@ximian.com>
1420 (SymbolWriter): Make this a public static class.
1423 (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
1424 class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
1426 2008-03-14 Marek Safar <marek.safar@gmail.com>
1428 A fix for bug #370577
1429 * statement.cs, lambda.cs: Added extra limitations when dealing with void
1432 2008-03-14 Marek Safar <marek.safar@gmail.com>
1434 * typemanager.cs (CSharpName): Made 250 times faster.
1436 2008-03-13 Marek Safar <marek.safar@gmail.com>
1438 * ecore.cs, expression.cs: Emit conversion for ET shift argument.
1440 2008-03-12 Marek Safar <marek.safar@gmail.com>
1442 * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
1443 crash when predefined field does not exist.
1445 2008-03-12 Marek Safar <marek.safar@gmail.com>
1447 * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
1449 2008-03-12 Marek Safar <marek.safar@gmail.com>
1451 * class.cs (FixedField): Don't crash when contructors are missing.
1453 2008-03-11 Marek Safar <marek.safar@gmail.com>
1455 * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
1456 convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
1457 check internal types accessibility for internal and external types.
1458 Replaced EnumToUnderlying by GetEnumUnderlyingType.
1460 2008-03-11 Marek Safar <marek.safar@gmail.com>
1462 * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
1463 convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
1464 attribute.cs, statement: Use corect instance of predefined types (work
1465 related to #364674).
1467 2008-03-07 Marek Safar <marek.safar@gmail.com>
1469 * expression.cs (TypeOfVoid): Fixed predefined method initialization.
1471 2008-03-07 Marek Safar <marek.safar@gmail.com>
1473 * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs,
1474 class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
1475 expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
1476 predefined types clean up, delayed predefined types members initialization
1477 (work related to #364674).
1479 2008-03-05 Marek Safar <marek.safar@gmail.com>
1481 * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
1483 2008-03-05 Marek Safar <marek.safar@gmail.com>
1485 * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
1486 delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
1487 predefined types clean up (work related to #364674).
1489 2008-03-04 Marek Safar <marek.safar@gmail.com>
1491 * ecore.cs: Print an error message instead of throwing exception.
1493 2008-03-04 Marek Safar <marek.safar@gmail.com>
1495 * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
1496 expression.cs, statement.cs: Unififed null literal representation.
1498 2008-03-03 Marek Safar <marek.safar@gmail.com>
1500 * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
1501 expression.cs: Refactored binary operators resolve phase and improved speed.
1502 The nullable code is still missing and won't work correctly, more fixes
1505 It also fixes #323726, #324312, #324248, and many other unreported issues.
1507 2008-02-29 Zoltan Varga <vargaz@gmail.com>
1509 * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs'
1512 2008-02-27 Marek Safar <marek.safar@gmail.com>
1514 * ecore.cs: Clean-up and split BetterConversion.
1516 2008-02-25 Raja R Harinath <harinath@hurrynot.org>
1519 * enum.cs (EnumMember.Value): Only access 'value' if
1520 ResolveValue says it's ok.
1521 (EnumMember.DoResolveValue): Don't set prev_member.value.
1522 (Enum.GetDefinition): Reverse arguments of Equals --
1523 EnumMember.Value can return 'null'.
1525 * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
1527 2008-02-22 Marek Safar <marek.safar@gmail.com>
1529 * generic.cs, expression.cs: More ongoing work on expression trees.
1531 2008-02-21 Marek Safar <marek.safar@gmail.com>
1533 * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
1534 handle missing matches when mutiple operators exist.
1536 2008-02-20 Marek Safar <marek.safar@gmail.com>
1538 A fix for bug #363218
1539 * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
1542 2008-02-20 Marek Safar <marek.safar@gmail.com>
1544 * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
1545 update. This time to deal correctly with SideEffectConstant expression used
1546 as an argument for another constant folding.
1548 2008-02-20 Raja R Harinath <harinath@hurrynot.org>
1550 * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
1553 2008-02-19 Marek Safar <marek.safar@gmail.com>
1555 * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
1557 2008-02-19 Marek Safar <marek.safar@gmail.com>
1559 A fix for bug #328136
1560 * expression.cs: Do not fold immediately LogicalAnd operators when the left
1561 side is a false constant, because we still need to evaluate the right-hand
1564 * statement.cs (If): Emit two types of boolean constants (simple constant,
1565 side-effect constant).
1567 2008-02-19 Marek Safar <marek.safar@gmail.com>
1569 * constant.cs (SideEffectConstant): Don't emit boolean constant.
1571 * expression.cs: Fold immediately LogicalAnd operators when both sides are
1574 2008-02-18 Marek Safar <marek.safar@gmail.com>
1576 A fix for bug #361457
1577 * ecore.cs (IsApplicable): Params methods have lower priority.
1579 * support.cs: Return correct parameter modifier for params types.
1581 2008-02-18 Marek Safar <marek.safar@gmail.com>
1583 * generic.cs (TypeParameter): Cache attribute target name.
1585 * support.cs: Removed unused variable.
1587 * typemanager.cs: Removed debugging leftover.
1589 * ecore.cs: Use local type instead of a property;
1591 * class.cs (VerifyMembers): Consider also parent to test whether type member
1594 * expression.cs (FullMethodDesc): Removed.
1596 * attribute.cs (IsValidArgumentType): Made static.
1598 2008-02-17 Raja R Harinath <harinath@hurrynot.org>
1600 Cleanup to be more readable.
1601 * Makefile (GMCS_PROFILE): Remove.
1602 (COMPILER_NAME): New helper.
1604 2008-02-15 Miguel de Icaza <miguel@novell.com>
1606 * cs-tokenizer.cs: if a conditional expression happens inside a
1607 (...) this also means that we do not need to de-ambiguate between
1608 an parenthesized expression and a cast.
1612 * constant.cs (SideEffectConstant): a constant value that happens
1613 to have a side effect.
1615 Fixes the build regressions introduced by the fix for #359789
1617 2008-02-14 Rodrigo Kumpera <rkumpera@novell.com>
1619 * expression.cs (Conditional.Emit): when emitting the ternary
1620 operator, use local variables to generate code verifiable code.
1622 The verifier cannot infer that the type on stack before the
1623 stloc.0 is executed is of type ParentB. This happens because the
1624 stack merge algorithm uses only parent types when deciding which
1625 is the common type. This is described in Part III 1.8.1.3 of ECMA
1628 This code compiled with mcs is not verifiable under MS. The MS
1629 verifier picks the first common interface of Foo and Bar, which is
1630 wrong, but doesn't use a full join type of the 2 interfaces.
1632 CSC uses a clever hack to compile such code in a verifiable
1633 way. It stores the intermediate values in a local variable with
1638 2008-02-14 Miguel de Icaza <miguel@novell.com>
1640 * expression.cs: Do not fold BitwiseAnd operators when the left
1641 side is a false constant, because we still need to evaluate the
1646 * support.cs: Instead of throwing an InternalErrorException when
1647 the position of the stream is outside the boundary of our buffer,
1648 reset the state of the reader, and restart the reading from the
1649 beginning of the file.
1651 2008-02-14 Marek Safar <marek.safar@gmail.com>
1653 * generic.cs (TypeParameter.GetMembers): Is not supported operation.
1655 2008-02-14 Marek Safar <marek.safar@gmail.com>
1657 A fix for bug #361686
1658 * decl.cs: A protected types used inside a private class which parents
1659 derives from the protected class are accessible.
1661 2008-02-13 Marek Safar <marek.safar@gmail.com>
1663 * generic.cs (ConstraintChecker): Use cached member lookup when looking for
1664 the parameterless constructor.
1666 2008-02-13 Marek Safar <marek.safar@gmail.com>
1668 * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
1669 lookup methods to use standard member cache when doing member lookup.
1671 2008-02-12 Marek Safar <marek.safar@gmail.com>
1673 * driver.cs: Don't report full path for referenced module as assembly error.
1675 2008-02-12 Marek Safar <marek.safar@gmail.com>
1677 * Makefile: Fixed `qh' target to work on all machines.
1679 * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
1680 expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
1681 and HasElementType with TypeManager implementation.
1683 2008-02-08 Marek Safar <marek.safar@gmail.com>
1685 A fix for bugs #325134, #359749
1686 * expression.cs, ecore.cs: Try to resolve an extension method even if the
1687 first binds point to non-method member expression.
1689 2008-02-08 Marek Safar <marek.safar@gmail.com>
1691 * cs-parser.jay: Null coalescing operator is not part of ISO-1.
1693 2008-02-08 Marek Safar <marek.safar@gmail.com>
1695 A fix for bugs #321394, #323028
1696 * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
1697 Reworked naive IsAccessibleAs implementation to handle nested types.
1699 2008-02-05 Jb Evain <jbevain@novell.com>
1701 * class.cs: use generic type comparison for parameters
1704 2008-02-05 Marek Safar <marek.safar@gmail.com>
1706 A fix for bug #325372
1707 * class.cs: Use generic type comparison when testing method signatures.
1709 2008-02-05 Marek Safar <marek.safar@gmail.com>
1711 A fix for bug #357047
1712 * ecore.cs: Applied C# 3.0 changes to better conversion.
1714 2008-02-05 Marek Safar <marek.safar@gmail.com>
1716 A fix for bug #358374
1717 * cs-parser.jay: Correctly set modifiers for all constructor types.
1719 2008-02-04 Marek Safar <marek.safar@gmail.com>
1721 A fix for bug #355251
1722 * generic.cs: Added base class constraint based type inference.
1724 2008-02-01 Marek Safar <marek.safar@gmail.com>
1726 A fix for bug #357255
1727 * decl.cs: One more missing visibility check.
1729 2008-02-01 Marek Safar <marek.safar@gmail.com>
1731 * support.cs: Fixed broken return.
1733 2008-01-25 Marek Safar <marek.safar@gmail.com>
1735 * report.cs: Correctly reset warnings count after probing.
1737 2008-01-25 Martin Baulig <martin@ximian.com>
1740 (NamespaceEntry.SymbolFileID): Make this work again after
1741 MemberName.ToString() is gone.
1743 2008-01-25 Marek Safar <marek.safar@gmail.com>
1745 * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
1748 2008-01-25 Marek Safar <marek.safar@gmail.com>
1750 * generic.cs: Use full implicit conversion for type inference fixing.
1752 2008-01-24 Marek Safar <marek.safar@gmail.com>
1754 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
1755 Fixed user operator conversions.
1757 2008-01-24 Marek Safar <marek.safar@gmail.com>
1759 * generic.cs: Do nullable type to null comparison optimization during
1762 2008-01-24 Marek Safar <marek.safar@gmail.com>
1764 A fix for bug #355163
1765 * generic.cs: Enabled l-value resolve on nullable expressions.
1767 2008-01-24 Marek Safar <marek.safar@gmail.com>
1769 A fix for bug #353986
1770 * class.cs: Ingore static ctors with parameters for any further checks.
1772 2008-01-24 Marek Safar <marek.safar@gmail.com>
1774 A fix for bug #354310
1775 * namespace.cs: Removed redundant check.
1777 2008-01-24 Marek Safar <marek.safar@gmail.com>
1779 A fix for bug #354928
1780 * expression.cs: ElementInitializers can be resolved only once.
1782 2008-01-24 Marek Safar <marek.safar@gmail.com>
1784 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
1785 Condition expressions.
1787 2008-01-23 Marek Safar <marek.safar@gmail.com>
1789 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
1791 2008-01-22 Marek Safar <marek.safar@gmail.com>
1793 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
1796 * generic.cs: Implemented coalesce expression.
1798 2008-01-22 Marek Safar <marek.safar@gmail.com>
1800 A fix for bug #355145
1801 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
1802 expression tree type inference.
1804 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
1807 * expression.cs (Binary.IsUnsignedType): Fix typo.
1809 2008-01-22 Marek Safar <marek.safar@gmail.com>
1811 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
1813 2008-01-22 Marek Safar <marek.safar@gmail.com>
1815 A fix for bug #355161
1816 * ecore.cs, expression.cs: Wider range of extension method supported
1819 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
1821 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
1822 AssemblyBuilder to operate in compiler context. Fixes mcs part of
1825 2008-01-22 Marek Safar <marek.safar@gmail.com>
1827 A fix for bug #355148
1828 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
1830 2008-01-22 Miguel de Icaza <miguel@novell.com>
1832 * expression.cs (CreateExpressionTree): Add support for or and
1833 logical or, and indent following the coding conventions.
1835 * typemanager.cs (LinqExpression): renamed from
1836 ExpressionTreeManager, for a shorter name.
1838 Use TypeManager.CoreLookupType to lookup types from our core
1839 assemblies and turn those into "Type" variables.
1841 Consumers that previously used "Namespace" and "Type" from this
1842 class should instead use the TypeExpression which is a type that
1843 is fully resolved (without involving the regular C# resolution
1846 This typically looks like this:
1848 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
1849 new MemberAccess (texpr, name, type_arguments, loc)
1851 This avoids the problem in: #355178
1853 2008-01-21 Marek Safar <marek.safar@gmail.com>
1855 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
1856 feature in parser only as we do in other cases.
1858 2008-01-21 Marek Safar <marek.safar@gmail.com>
1860 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
1861 typemanager.cs: A refactoring of params arguments to reuse existing
1862 expressions (params -> array initializer) to emit params argument instead
1863 of specialized handling.
1864 It was required by expression tree implementation and it has other benefits
1865 as well, we now apply same optimization for params arguments as we do for
1868 2008-01-18 Marek Safar <marek.safar@gmail.com>
1870 A fix for bug #353526
1871 * generic.cs: A type inference of params arguments may not required any
1872 temporary array creation.
1874 2008-01-18 Marek Safar <marek.safar@gmail.com>
1876 A fix for bug #353534
1877 * generic.cs, ecore.cs, expression.cs: A method group type inference is
1878 supported for delegates only.
1880 2008-01-18 Marek Safar <marek.safar@gmail.com>
1882 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
1883 type for more than 1 candidates.
1885 2008-01-18 Marek Safar <marek.safar@gmail.com>
1887 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
1890 2008-01-16 Marek Safar <marek.safar@gmail.com>
1892 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
1893 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
1894 operator) expressions.
1896 2008-01-16 Zoltan Varga <vargaz@gmail.com>
1898 * statement.cs: Avoid declaring an IL variable for this_variable since it is
1899 not accessed from the generated IL.
1901 2008-01-14 Marek Safar <marek.safar@gmail.com>
1903 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
1904 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
1905 statement.cs: The first expression tree implementation drop, mostly
1906 infrastructure work.
1908 2008-01-14 Marek Safar <marek.safar@gmail.com>
1910 * ecore.cs (IsNestedChild): Refactored.
1912 2008-01-11 Marek Safar <marek.safar@gmail.com>
1914 * lambda.cs: Don't use a cast on unknown expression statement.
1916 2008-01-10 Geoff Norton <gnorton@novell.com>
1918 * cs-tokenizer.cs: One more token to distinguish between method and lambda
1921 2008-01-09 Marek Safar <marek.safar@gmail.com>
1923 * doc.cs: Report better /doc crash details.
1925 2008-01-09 Marek Safar <marek.safar@gmail.com>
1927 A fix for bug #352536
1928 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
1930 2008-01-08 Marek Safar <marek.safar@gmail.com>
1932 A fix for bug #352287
1933 * ecore.cs, expression.cs: Do `this' access checking in all member access
1936 2008-01-08 Marek Safar <marek.safar@gmail.com>
1938 * rootcontext.cs, driver.cs: Switch to linq mode by default.
1940 * report.cs: Reset message stacks.
1942 2008-01-08 Marek Safar <marek.safar@gmail.com>
1944 * generic.cs (InferInPhases): Correctly calculate params position.
1946 2008-01-08 Marek Safar <marek.safar@gmail.com>
1948 * cs-tokenizer.cs: No need to parse full string when parsing lambda
1951 2008-01-07 Marek Safar <marek.safar@gmail.com>
1953 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
1955 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
1957 * driver.cs: Updated --help option.
1959 2008-01-07 Marek Safar <marek.safar@gmail.com>
1961 * generic.cs (InferParamsTypeArguments): Removed.
1962 (InferInPhases): Add params type inference.
1963 (LowerBoundInference): Fixed scoring mechanism.
1965 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
1967 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
1969 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
1970 byte array for unsigned "baked" assemblies.
1972 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
1974 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
1975 array for assemblies that are not strongnamed.
1977 2008-01-04 Marek Safar <marek.safar@gmail.com>
1979 A fix for bug #351481
1980 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
1981 declaring type for nested generic types.
1983 2008-01-04 Marek Safar <marek.safar@gmail.com>
1985 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
1986 instead of ToString.
1988 2008-01-03 Marek Safar <marek.safar@gmail.com>
1990 A fix for bug #351047
1991 * expression.cs (Binary.ResolveOperator): Allow equality operators between
1992 null and structs only when equality and inequality operators are defined
1993 either as an user-operators or predefined operators.
1995 2008-01-03 Marek Safar <marek.safar@gmail.com>
1997 A fix for bug #351047
1998 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
2000 2008-01-03 Marek Safar <marek.safar@gmail.com>
2002 A fix for bug #351257
2003 * cs-tokenizer.cs: Advance line number for '\r' correctly.
2005 2008-01-03 Marek Safar <marek.safar@gmail.com>
2007 A fix for bug #351157
2008 * class.cs (Using): Fixed yet another broken cloning.
2010 (Block): Put back more sensible default value for statements.
2012 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
2014 * codegen.cs: Allow AssemblyVersion with only major version component.
2017 2007-12-29 Marek Safar <marek.safar@gmail.com>
2019 A fix for bug #324654
2020 * class.cs: Use FullName property as member name.
2022 2007-12-28 Marek Safar <marek.safar@gmail.com>
2024 A fix for bug #342117
2025 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
2026 constructor constraint.
2028 2007-12-28 Marek Safar <marek.safar@gmail.com>
2030 A fix for bug #338273
2031 * class.cs (ProbertyBase): Access modifier checks are required for overrides
2034 2007-12-28 Marek Safar <marek.safar@gmail.com>
2036 A fix for bug #350839
2037 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
2039 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
2041 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
2044 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
2046 * statement.cs: Changed some Hashtables to use HybridDictionaries
2047 instead. It was observed that some HashTables only contained a few
2048 items in the vast majority of cases. Since HybridDictionary is
2049 more efficient on small sets (<10 elements), "known_variables"
2050 from class ExplicitBlock as well as "labels" and "constants " from
2051 class Block were changed to HybridDictionaries.
2053 Atsai results: (56216kb->54987kb)
2055 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
2058 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
2060 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
2063 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
2065 * expression.cs: foreach loop to for loop, saved on allocation of
2066 enumerator (59333kb->59141kb)
2068 * statement.cs. Changed foreach loops to for loops, saved on
2069 allocation of enumerator (59141kb->59006kb)
2071 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
2072 when constructed with no specified capacity. This was causing a
2073 few ArrayLists to allocate more memory than they would potentially
2074 need in the Block class and MemberCache class. Setting the
2075 ArrayLists to construct with a capacity of 1 saves some
2076 memory. (56216kb->55585kb)
2078 2007-12-27 Marek Safar <marek.safar@gmail.com>
2080 A fix for bug #347189 (2nd issue)
2081 * expression.cs (MemberAccess): Nested type can be found in base non-generic
2084 2007-12-27 Miguel de Icaza <miguel@novell.com>
2086 * report.cs: Do not use colors if stdout and stderr are not a
2089 2007-12-27 Marek Safar <marek.safar@gmail.com>
2091 A fix for bug #346998
2092 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
2095 2007-12-27 Marek Safar <marek.safar@gmail.com>
2097 A fix for bug #343465
2098 * class.cs: Explicit method name for nested types uses dots only.
2100 2007-12-27 Marek Safar <marek.safar@gmail.com>
2102 A fix for bug #343707
2103 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
2105 2007-12-27 Marek Safar <marek.safar@gmail.com>
2107 * ecore.cs: Report type inference errors only when arguments count matches
2110 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
2112 * expression.cs, report.cs: New warning.
2114 * typemanager.cs: Catch anonymous method type too.
2116 2007-12-23 Marek Safar <marek.safar@gmail.com>
2118 A fix for bug #346379
2119 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
2121 2007-12-23 Marek Safar <marek.safar@gmail.com>
2123 A fix for bug #347359
2124 * expression.cs (Invocation): Don't resolve already resolved expression.
2126 2007-12-23 Marek Safar <marek.safar@gmail.com>
2128 A fix for bug #347189
2129 * class.cs (FixedField): Use non-dependent code only in the define phase.
2131 2007-12-23 Marek Safar <marek.safar@gmail.com>
2133 A fix for bug #348076
2134 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
2136 2007-12-22 Marek Safar <marek.safar@gmail.com>
2138 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
2139 discovered extension methods.
2141 2007-12-22 Marek Safar <marek.safar@gmail.com>
2143 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
2146 2007-12-21 Miguel de Icaza <miguel@novell.com>
2148 * report.cs (ErrorMessage): Add support for using colors on
2149 terminals that support it.
2151 2007-12-21 Marek Safar <marek.safar@gmail.com>
2153 * ecore.cs: Use information about expanded params for error reporting.
2155 2007-12-21 Marek Safar <marek.safar@gmail.com>
2157 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
2158 and logic for params overloads.
2160 2007-12-15 Miguel de Icaza <miguel@novell.com>
2162 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
2163 as this is also created from the parser. Fixes #349034
2165 2007-12-12 Miguel de Icaza <miguel@novell.com>
2167 * statement.cs (Throw.CloneTo): it is valid to have empty
2168 expressions for throw.
2170 2007-12-03 Marek Safar <marek.safar@gmail.com>
2172 * cs-parser.jay: Set delegate constraint parsing region correctly.
2174 2007-12-03 Marek Safar <marek.safar@gmail.com>
2176 A fix for bug #345467
2177 * typemanager.cs (IsEqual): Compare generic parameters position only.
2179 2007-11-28 Marek Safar <marek.safar@gmail.com>
2181 * expression.cs (BaseAccess): Type arguments can be null.
2183 2007-11-27 Raja R Harinath <harinath@gmail.com>
2185 * statement.cs (Block.Resolve): Ensure flow-branching tree is
2186 consistent even when an error has occured.
2187 (Switch.Resolve): Likewise.
2189 2007-11-22 Marek Safar <marek.safar@gmail.com>
2191 A fix for bug #334505
2192 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
2195 2007-11-22 Marek Safar <marek.safar@gmail.com>
2197 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
2198 refactorings required to resolve extension methods correctly when mixing
2199 generics and non-generics members.
2201 2007-11-20 Marek Safar <marek.safar@gmail.com>
2203 A fix for bug #342584
2204 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
2207 2007-11-19 Marek Safar <marek.safar@gmail.com>
2209 A fix for bug #342512
2210 * delegate.cs: Use delegate argument expression when is available. Don't
2211 emit virtual call when class is sealed.
2213 2007-11-16 Marek Safar <marek.safar@gmail.com>
2215 A fix for bug #325423
2216 * assign.cs (FieldInitializer): Use resolved expression for emit.
2218 * class.cs: Print less confusing error message.
2220 2007-11-16 Marek Safar <marek.safar@gmail.com>
2222 * cs-tokenizer.cs: Removed GMCS ifdefs.
2224 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
2227 * cs-parser.jay: Disabled nullable check.
2229 * generic-mcs: Copied more generic stuff.
2231 2007-11-16 Marek Safar <marek.safar@gmail.com>
2233 * gcs-parser.jay: Merged to cs-parser.jay.
2235 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
2236 * *.csproj, *.sources: Updated to use only jay parser file.
2238 2007-11-16 Marek Safar <marek.safar@gmail.com>
2240 * gcs-parser.jay: Added nullable and default expression feature checks.
2242 2007-11-16 Marek Safar <marek.safar@gmail.com>
2244 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
2245 it fixes many TODOs and hidden bugs.
2247 * expression: Removed duplicate error check.
2249 2007-11-15 Marek Safar <marek.safar@gmail.com>
2251 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
2252 implicitly type local variable only when it is used in a declaration.
2254 2007-11-15 Marek Safar <marek.safar@gmail.com>
2256 * attribute.cs: Use CS0612 for empty strings.
2258 2007-11-14 Marek Safar <marek.safar@gmail.com>
2260 * lambda.cs, statement.cs: Contextual return may act as a statement.
2262 2007-11-14 Marek Safar <marek.safar@gmail.com>
2264 A fix for a regression cause by #324222
2265 * class.cs: Don't report unused even when it implements an interface.
2267 2007-11-13 Marek Safar <marek.safar@gmail.com>
2269 A fix for bug #341205
2270 * ecore.cs, expression.cs: Method group expression cannot do static
2271 method access with an instance reference check before overloading takes
2274 2007-11-13 Marek Safar <marek.safar@gmail.com>
2276 A fix for bug #325359
2277 * class.cs: Use predictable name for automatically generated property.
2279 2007-11-12 Marek Safar <marek.safar@gmail.com>
2281 A fix for bug #324996
2282 * expression.cs (Is): Handle case where D is nullable and T is not
2285 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
2287 2007-11-12 Marek Safar <marek.safar@gmail.com>
2289 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
2290 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
2291 Flush small error reporting changes.
2293 2007-11-09 Marek Safar <marek.safar@gmail.com>
2295 A fix for bug #324996
2296 * expression.cs: Rewrote Is expression implementation to work with
2297 generics, nullable types, anonymous method. A const result expression
2298 uses existing infrastructure instead of custom not fully-featured one.
2300 2007-11-08 Marek Safar <marek.safar@gmail.com>
2302 A fix for bug #340202
2303 * class.cs: Consider generics for volatile field.
2305 2007-11-08 Marek Safar <marek.safar@gmail.com>
2307 A fix for bug #335594
2308 * expression.cs: Use conversion rules when handling string addition.
2310 2007-11-07 Marek Safar <marek.safar@gmail.com>
2312 A fix for bug #336651
2313 * expression.cs: Fixed a crash when probing is on.
2315 2007-11-07 Marek Safar <marek.safar@gmail.com>
2317 A fix for bug #324242
2318 * covert.cs: Added a conversion from any nullable-type with an
2319 underlying enum-type to the type System.Enum.
2321 2007-11-07 Marek Safar <marek.safar@gmail.com>
2323 A fix for bug #324222
2324 * class.cs: Report all non-used event fields.
2326 2007-11-07 Marek Safar <marek.safar@gmail.com>
2328 A fix for bug #325161
2329 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
2330 qualifier for generic types.
2332 2007-11-07 Marek Safar <marek.safar@gmail.com>
2334 A fix for bug #322971
2335 * expression.cs, ecore.cs: Added intermediate result value check for
2338 2007-11-07 Marek Safar <marek.safar@gmail.com>
2340 A fix for bug #324754
2341 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
2342 when it was requested.
2344 2007-11-07 Marek Safar <marek.safar@gmail.com>
2346 A fix for bug #325101
2347 * expression.cs: Do type not value comparison for `is' expression.
2349 2007-11-07 Marek Safar <marek.safar@gmail.com>
2351 A fix for bug #320236
2352 * convert.cs: Don't apply user conversion on underlying target type.
2354 2007-11-06 Marek Safar <marek.safar@gmail.com>
2356 * expression.cs: Don't use unresolved expression for error reporting.
2358 2007-11-06 Marek Safar <marek.safar@gmail.com>
2360 A fix for bugs #337712, #324490
2361 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
2362 overloading resolution too.
2364 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
2365 the process consistent and more robust.
2367 * expression.cs, linq.cs, report.cs: Update.
2369 2007-11-02 Marek Safar <marek.safar@gmail.com>
2371 A fix for bug #332909
2372 * attribute.cs: Resolve attributes in correct context using error
2375 * rootcontext.cs: Define Obsolete attribute members as core members.
2377 2007-11-02 Marek Safar <marek.safar@gmail.com>
2379 * statement.cs: Removed unused methods.
2381 2007-10-31 Wade Berrier <wberrier@novell.com>
2383 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
2384 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
2387 2007-10-31 Marek Safar <marek.safar@gmail.com>
2389 A fix for bug #338102
2390 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
2391 methods registered as non-generics.
2393 2007-10-31 Marek Safar <marek.safar@gmail.com>
2395 A fix for bugs #337712, #324490
2396 * delegate.cs: Delegate covariance and contravariance is not allowed for
2399 2007-10-31 Marek Safar <marek.safar@gmail.com>
2401 A fix for bug #337719
2402 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
2405 2007-10-30 Marek Safar <marek.safar@gmail.com>
2407 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
2409 2007-10-29 Marek Safar <marek.safar@gmail.com>
2411 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
2414 2007-10-29 Raja R Harinath <rharinath@novell.com>
2416 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
2418 2007-10-29 Marek Safar <marek.safar@gmail.com>
2420 A fix for bug #334652
2421 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
2422 extension methods when we have not found the best candidate in normal
2425 2007-10-27 Marek Safar <marek.safar@gmail.com>
2427 * AssemblyInfo.cs: Keep up-to-date.
2429 2007-10-27 Marek Safar <marek.safar@gmail.com>
2431 * Makefile: Fixed generics compiler name.
2433 2007-10-27 Marek Safar <marek.safar@gmail.com>
2435 * lambda.test: removed, lambda parsing is done differently.
2437 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
2439 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
2441 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
2443 2007-10-27 Marek Safar <marek.safar@gmail.com>
2445 * Makefile, *.sources : All C# compilers are in mcs folder.
2447 * *.cs: Use existing 2_1 define for smcs.
2449 2007-10-26 Marek Safar <marek.safar@gmail.com>
2451 A fix for bug #335847
2452 * assign.cs, expression.cs: Couple of changes to avoid creating a
2453 temporary variable for each object initializer assignment statement. It
2454 simplifies struct initialization too, otherwise two temporary variables
2456 Implemented optimization of redundant default element initializers.
2458 2007-10-25 Marek Safar <marek.safar@gmail.com>
2460 A fix for bug #336766
2461 * expression.cs (Class.CheckBase): Use generic name when method is
2464 2007-10-25 Marek Safar <marek.safar@gmail.com>
2466 A fix for bug #334737
2467 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
2468 variable and not variable argument for prepared copies.
2470 2007-10-24 Marek Safar <marek.safar@gmail.com>
2472 A fix for bug #325110
2473 * class.cs, expression.cs, attribute.cs: Use open generic method when
2474 checking conditional attribute.
2476 2007-10-24 Marek Safar <marek.safar@gmail.com>
2478 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
2479 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
2480 FeatureIsNotAvailable.
2482 2007-10-24 Marek Safar <marek.safar@gmail.com>
2484 ** C# 3.0 Partial methods
2486 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
2487 methods support. Because of member cache issue with generics only
2488 non-generics partial methods are fully supported.
2490 2007-10-23 Marek Safar <marek.safar@gmail.com>
2492 * class.cs, decl.cs: Rewrote member overloads check to cope with
2493 generics and to use member cache for member checking. It also improves
2494 performance and fixes remaining overloads issues.
2496 2007-10-20 Marek Safar <marek.safar@gmail.com>
2498 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
2499 roottypes.cs, typemanager.cs:
2501 A member cache creation logic changed to add members immediately and
2502 not rely on fallback. The member cache is now only prefered way
2503 how to access and find type declaration members. It saves 5 MB of memory
2504 during MWF compilation and makes code ready for more optimizations and
2505 clean-ups, it's also a pre-requirement for partial methods.
2507 2007-10-18 Raja R Harinath <harinath@gmail.com>
2509 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
2510 handling for generic parameters.
2512 2007-10-15 Marek Safar <marek.safar@gmail.com>
2514 * class.cs (FixedField): Removed redundant volatile check.
2516 2007-10-15 Marek Safar <marek.safar@gmail.com>
2518 * class.cs, decl.cs: Fixed overload members verification to do only one
2519 check per possible collision.
2521 2007-10-13 Marek Safar <marek.safar@gmail.com>
2523 A fix for bug #325478
2524 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
2525 and create only one disposable flags container.
2527 2007-10-12 Marek Safar <marek.safar@gmail.com>
2529 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
2530 * statement.cs (Fixed): Fixed variables cloning.
2532 2007-10-12 Marek Safar <marek.safar@gmail.com>
2534 A fix for bug #333342
2535 * class.cs (EventField): Don't mark value type event as synchronized.
2537 2007-10-12 Marek Safar <marek.safar@gmail.com>
2539 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
2540 inference to identify best candidate method correctly.
2541 (ProperyExpr): A range variable is read only and cannot be modified.
2543 2007-10-11 Marek Safar <marek.safar@gmail.com>
2545 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
2546 logic to identify best candidate method correctly.
2548 2007-10-11 Marek Safar <marek.safar@gmail.com>
2550 * location.cs (Equals, GetHashCode): Removed.
2552 2007-10-11 Marek Safar <marek.safar@gmail.com>
2554 * report.cs: Implemented message recorder. It is used mainly for lambda
2555 expressions to capture otherwise swallowed error messages.
2557 * anonymous.cs, lambda.cs.cs: Do full parameters check.
2559 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
2561 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
2563 * expression.cs (MemberAccess): Always report lookup failure.
2565 * location.cs: Implemented Equals, GetHashCode.
2567 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
2569 2007-10-10 Jb Evain <jbevain@novell.com>
2571 * codegen.cs: re-enable assembly version check.
2573 2007-10-09 Marek Safar <marek.safar@gmail.com>
2575 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
2578 * namespace.cs (UsingAlias): Do correct version check.
2580 2007-10-08 Marek Safar <marek.safar@gmail.com>
2582 * expresison.cs, ecore.cs: Issue extension method error message when
2585 * rootcontext.cs: Added ISO_2 compiler mode option.
2587 2007-10-08 Marek Safar <marek.safar@gmail.com>
2589 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
2592 2007-10-08 Marek Safar <marek.safar@gmail.com>
2594 * attribute.cs (GetString, GetBoolean): Work with both literal and
2597 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
2598 Moved method overload specific methods to MethodGroupExpr.
2600 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
2601 it should be less memory consuming.
2603 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
2605 * codegen.cs: remove the assembly version check until the buildbot is
2608 2007-10-07 Jb Evain <jbevain@novell.com>
2610 * attribute.cs (Attribute.GetString): if the value
2611 expression is a StringConstant, return its string value.
2613 2007-10-07 Jb Evain <jbevain@novell.com>
2615 * typemanager.cs: add `assembly_version_attribute_type`.
2616 * codegen.cs: on attribute emission, check that the
2617 AssemblyVersionAttribute doesn't overflow.
2619 2007-10-05 Marek Safar <marek.safar@gmail.com>
2621 A fix for bug #324677
2622 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
2623 parent container of a scope container with currently resolved one.
2625 2007-10-05 Marek Safar <marek.safar@gmail.com>
2627 A fix for bug #325534
2628 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
2631 2007-10-05 Marek Safar <marek.safar@gmail.com>
2633 A fix for bug #327504
2634 * class.cs (Operator.Define): Refactored implicit and explicit user
2635 operator conversion rules.
2637 2007-10-05 Marek Safar <marek.safar@gmail.com>
2639 A fix for bug #327520
2640 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
2642 2007-10-04 Marek Safar <marek.safar@gmail.com>
2644 A fix for bug #328022
2645 * class.cs (MethodData.Define): Use correct method to check whether
2646 a method implementents an accessor.
2648 2007-10-04 Marek Safar <marek.safar@gmail.com>
2650 A fix for bug #330069
2651 * statement.cs (Fixed.Resolve): Read the first array element only when
2652 an array is instantiated.
2654 2007-10-04 Marek Safar <marek.safar@gmail.com>
2656 * expression.cs, assign.cs, generics.cs: Print correct operator when
2657 compound assignment is used.
2659 2007-10-04 Marek Safar <marek.safar@gmail.com>
2661 A fix for bug #325841
2662 * expression.cs (ArrayAccess): Use full argument cloning only for
2663 string compound concatenation.
2665 2007-10-03 Marek Safar <marek.safar@gmail.com>
2667 A fix for bug #328774
2668 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
2670 (PropertyExpr.EmitAssign): Fixed string concatenation compound
2673 2007-10-03 Raja R Harinath <rharinath@novell.com>
2676 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
2677 Event accessibility checks here. Remove some bogus code that
2678 accidently made GenericMethods work.
2679 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
2681 2007-09-25 Marek Safar <marek.safar@gmail.com>
2683 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
2685 * statement.cs (Block): Refactored AddVariable to allow error handling
2688 * generic.cs: New stub.
2690 2007-09-23 Marek Safar <marek.safar@gmail.com>
2692 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
2695 2007-09-17 Marek Safar <marek.safar@gmail.com>
2697 * class.cs: Use partial container to record whether any partial part
2698 contains static field initializer and therefore default contructor has
2701 2007-09-14 Marek Safar <marek.safar@gmail.com>
2703 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
2704 mono-list when only one of two partial parts has defined accessibility
2707 2007-09-14 Marek Safar <marek.safar@gmail.com>
2709 A fix for bug #82845
2711 * class.cs (TypeContainer): Set correct resolve context for all field
2714 2007-09-13 Marek Safar <marek.safar@gmail.com>
2716 * assign.cs: Fixed a crash when field is resolved twice with an error.
2718 * codegen.cs: Changed InFieldInitializer to be flag.
2720 * anonymous.cs, ecore.cs, expression.cs: Update after
2721 IsInFieldInitializer rename.
2723 * const.cs: Removed unused parameter.
2725 * class.cs: Changed the way how we resolve and emit field initializers.
2726 The field initilizers have to have access to contructor block to emit
2727 compiler generated code.
2729 2007-09-13 Marek Safar <marek.safar@gmail.com>
2731 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
2732 generics use TypeContainer instead.
2734 2007-09-12 Marek Safar <marek.safar@gmail.com>
2736 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
2738 * lambda.cs (ResolveParameters): Use more powerful
2739 InflateGenericArgument.
2741 * parameters.cs: Better exception message.
2743 2007-09-10 Marek Safar <marek.safar@gmail.com>
2745 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
2746 correct expression block type.
2748 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
2750 * expression.cs (Invocation): Extracted method group resolve to
2753 2007-09-07 Marek Safar <marek.safar@gmail.com>
2755 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
2756 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
2758 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
2759 generic extension methods.
2761 2007-09-06 Marek Safar <marek.safar@gmail.com>
2763 A fix for bug #82676 (Do I get it right now?)
2764 * convert.cs (Binary.ResolveOperator): An interface is converted to the
2765 object before a standard conversion is applied.
2767 2007-09-06 Marek Safar <marek.safar@gmail.com>
2769 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
2772 2007-09-05 Marek Safar <marek.safar@gmail.com>
2774 A fix for bug #82676
2775 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
2776 non-generic interface types.
2778 2007-09-05 Marek Safar <marek.safar@gmail.com>
2780 A fix for bug #82690
2781 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
2783 2007-09-05 Marek Safar <marek.safar@gmail.com>
2785 A fix for bug #82571
2786 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
2787 modifier for container based methods.
2789 2007-09-05 Marek Safar <marek.safar@gmail.com>
2791 A fix for bug #82676
2792 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
2793 any interface-type T means to any of interface type T.
2795 2007-09-04 Marek Safar <marek.safar@gmail.com>
2797 * namespace.cs: We have 2 versions of System.Core assembly.
2799 2007-09-04 Marek Safar <marek.safar@gmail.com>
2801 A fix for bug #82652
2802 * class.cs (Class.GetClassBases): Compare types and not expressions.
2804 2007-09-04 Marek Safar <marek.safar@gmail.com>
2806 A fix for bug #82620
2807 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
2808 actually never worked before.
2809 (IndexerAccess): Emit prepared arguments before they are modified.
2811 2007-09-04 Marek Safar <marek.safar@gmail.com>
2813 A fix for bug #82563
2814 * assign.cs: Revert wrong fix.
2816 * expression.cs (VariableReference.EmitAssign): Handle ref reference
2818 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
2819 Instead of ldelema/stdind we have to use temporary variables to handle
2820 cases like String.Concat (params string[]).
2822 2007-08-31 Marek Safar <marek.safar@gmail.com>
2824 * class.cs: EmitAttributes to Emit rename.
2826 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
2828 (MemberCore.HasClsCompliantAttribute): Don't depend on
2829 GetClsCompliantAttributeValue execution.
2831 2007-08-31 Marek Safar <marek.safar@gmail.com>
2833 * anonymous.cs: Use shorter type prefix.
2835 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
2838 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
2839 variables when probing is on.
2841 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
2842 unresolved variables.
2843 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
2844 handle transparent identifiers.
2846 2007-08-26 Marek Safar <marek.safar@gmail.com>
2848 * attribute.cs (IsClsCompliant): Add nullable types test.
2850 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
2852 * doc.cs : catch other types of exception than XmlException to
2853 report CS1570. Fixed bug #82565.
2855 2007-08-23 Marek Safar <marek.safar@gmail.com>
2857 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
2858 The number of delegate parameters has to match.
2859 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
2862 2007-08-21 Marek Safar <marek.safar@gmail.com>
2864 * anonymous.cs (AnonymousMethod): Generate private anonymous method
2865 to fix problem with private arguments.
2867 2007-08-20 Marek Safar <marek.safar@gmail.com>
2869 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
2871 * decl.cs (MemberName): Ignore generic type with no generic arguments.
2873 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
2874 empty. Add cloning suport.
2876 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
2878 2007-08-20 Marek Safar <marek.safar@gmail.com>
2880 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
2881 to create EmptyCast. It handles EmptyConstantCast specialization for
2884 2007-08-18 Marek Safar <marek.safar@gmail.com>
2886 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
2887 (EmitArrayArgument): One routine for array arguments.
2888 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
2890 2007-08-17 Marek Safar <marek.safar@gmail.com>
2892 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
2894 2007-08-17 Marek Safar <marek.safar@gmail.com>
2896 * anonymous.cs: MemberLookupFinal update.
2898 * class.cs (ConstructorInitializer): Is expression based.
2900 * delegate.cs: MethodGroupExpr update.
2902 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
2904 (Error_MemberLookupFailed): Customizable error override.
2905 (MethodGroupExpr): Keep queried type for later usage.
2906 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
2909 * expression.cs: Error_MemberLookupFailed refactoring.
2910 (New.DoResolve): Resolve as much as possible.
2911 (ElementInitializer.Error_MemberLookupFailed): Object initializer
2912 customization for invalid member types.
2914 * statement.cs: MethodGroupExpr update.
2916 2007-08-16 Marek Safar <marek.safar@gmail.com>
2918 * modifier.cs (Check): Check all modifiers and not only accessibility
2921 2007-08-16 Marek Safar <marek.safar@gmail.com>
2923 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
2924 type and not an expression.
2926 2007-08-16 Marek Safar <marek.safar@gmail.com>
2928 * statement.cs (Catch.Clone): Type and variable can be null.
2930 2007-08-16 Marek Safar <marek.safar@gmail.com>
2932 A fix for bug #81979
2933 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
2934 I am really not sure whether this is the best fix.
2936 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
2939 2007-08-14 Marek Safar <marek.safar@gmail.com>
2941 ** C# 3.0 Object and collection initializers (major re-write)
2943 * assign.cs (DoResolve): Initializers are not assign related.
2945 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
2946 used during collection or object initialization.
2948 * expression.cs (Error_InvalidArguments): Add initializers specific
2949 messages. More will come later because it requires some general
2951 (New.DoResolve): Better error handling for unsafe types.
2952 (EmptyExpressionStatement): New class.
2953 (ElementInitializer): An object initializer expression.
2954 (CollectionElementInitializer): A collection initializer expression.
2955 (CollectionOrObjectInitializers): A block of object or collection
2957 (NewInitialize): New expression with element/object initializers.
2959 * statement.cs: Reverted object/collection initializer hacks.
2961 * typemanager.cs (CSharpName): Filter __arglist type.
2963 2007-08-09 Marek Safar <marek.safar@gmail.com>
2965 ** C# 3.0 Anonymous Types (update to the latest standard)
2967 * expression.cs (Binary.ResolveOperator): Threat all null based types
2969 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
2970 (AnonymousTypeParameter): Updated.
2972 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
2973 (AnonymousTypeClass): New anonymous type container.
2975 * class.cs (AddField): Return operation result.
2977 * generic.cs: Another empty TypeArguments overload.
2979 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
2980 are stored at top of normal hierarchy.
2982 * typemanager.cs (CSharpName): Filter anonymous types.
2984 2007-08-09 Marek Safar <marek.safar@gmail.com>
2986 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
2987 as single Concat call. How could we miss that :-(
2989 2007-08-08 Marek Safar <marek.safar@gmail.com>
2991 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
2993 2007-08-07 Miguel de Icaza <miguel@novell.com>
2995 * expression.cs: Fix the previous commit, the creation of the
2996 arguments array list needs also to be conditional on the arguments
2999 * class.cs: Add a little bit of help to help narrow down problems.
3001 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
3002 not try to copy in that case.
3004 * driver.cs: When building SMCS, include a new different set of
3005 default assemblies here. Do this here so we can control whether
3006 to include the default assemblies with /noconfig.
3008 2007-08-03 Marek Safar <marek.safar@gmail.com>
3010 A fix for bug #81979
3011 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
3014 2007-08-03 Marek Safar <marek.safar@gmail.com>
3016 A fix for bug #82300
3018 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
3019 we are in probing scope.
3021 2007-08-03 Marek Safar <marek.safar@gmail.com>
3023 A fix for bug #82301
3025 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
3026 (Statement.CloneTo): Clone and not map children blocks.
3028 2007-08-03 Marek Safar <marek.safar@gmail.com>
3030 A fix for bug #82299
3032 * expression.cs (LocalVariableReference.CloneTo): Remap local info
3035 * statement.cs (Statement.CloneTo): Clone variables before statements
3036 to allow remaping of local variables.
3038 2007-08-03 Marek Safar <marek.safar@gmail.com>
3040 A fix for bug #82296
3043 * report.cs: Log crash details for future clone problems.
3045 * statement.cs (Return.Clone): Don't clone non-existent expression.
3047 2007-08-03 Raja R Harinath <harinath@gmail.com>
3049 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
3050 (Class.AddBasesForPart): Move CS0537 check here from ...
3051 * cs-parser.jay (class_declaration): ... here. Move calling of
3052 'AddBasesForPart' to ...
3053 (class_bases): ... here.
3054 (struct_declaration, interface_declaration): Update to changes.
3056 2007-08-02 Marek Safar <marek.safar@gmail.com>
3058 A fix for bug #81923
3060 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
3061 conversion is allowed.
3063 2007-08-02 Marek Safar <marek.safar@gmail.com>
3065 A fix for bug #81564
3067 * ecore.cs (EventExpr): Add IsBase handling.
3069 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
3072 2007-08-02 Raja R Harinath <harinath@gmail.com>
3074 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
3075 * cs-parser.jay: Some whitespace cleanups.
3076 (current_delegate): New.
3078 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
3079 a dummy code block, and use 'type_name' instead of 'member_name'.
3080 (interface_declaration, class_declaration): Likewise.
3081 (delegate_declaration): Likewise. Rearrange slightly and use
3083 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
3084 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
3086 2007-08-02 Marek Safar <marek.safar@gmail.com>
3088 A fix for bug #82039
3090 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
3093 * typemanager.cs (CSharpName): Split to string overload.
3095 2007-08-02 Marek Safar <marek.safar@gmail.com>
3098 * report.cs: Updated warning CS0472.
3100 2007-08-01 Marek Safar <marek.safar@gmail.com>
3102 A fix for bug #82181
3104 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
3106 2007-08-01 Marek Safar <marek.safar@gmail.com>
3108 A fix for bug #82277
3109 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
3111 2007-08-01 Marek Safar <marek.safar@gmail.com>
3113 ** C# 3.0 Type Inference (major bits are working)
3115 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
3116 (.ImplicitStandardConversionExists): Uses compatible.
3117 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
3118 (.InferReturnType): New method.
3119 (.Compatible): Refactored.
3120 (.ResolveParameters): Uses factory to create resolved parameters.
3121 (.CompatibleMethod): Add probing mode support.
3122 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
3123 clearly distinguish between 2 different operations.
3124 (LambdaMethod): Moved to lambda.cs.
3125 (AnonymousMethod): Removed unused fields and methods.
3126 (AnonymousDelegate): Simplified.
3128 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
3130 * convert. cs (ImplicitConversionStandard): Compatible works differently.
3132 * delegate.cs (Delegate): New mehods to reduce code duplication.
3133 (.GetConstructor): New method.
3134 (.GetInvokeMethod): New method.
3135 (DelegateCreation): Updated.
3137 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
3139 (OverloadResolve): Made probing little bit faster.
3141 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
3144 * generic.cs (TypeInferenceContext): Dummy implementation.
3146 * iterators.cs: Updated after Resolve/Define rename.
3148 * lambda.cs (LambdaExpression)
3149 (.ResolveParameters): Handles both type of arguments and type inference too.
3151 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
3152 (InflateTypes): Updated.
3154 * support.cs (InflateTypes): Changed signature and updated.
3156 * typemanager.cs (LookupMemberCache): Better dynamic type check.
3157 (MemberLookup_FindMembers): More MS tricks.
3158 (GetParameterData): Ditto.
3159 (GetDelegateParameters): Uses quick path for dynamic types.
3161 2007-08-01 Marek Safar <marek.safar@gmail.com>
3163 * class.cs (MethodData.Define): EmitContext is required for generic stuff
3166 2007-07-31 Marek Safar <marek.safar@gmail.com>
3168 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
3171 2007-07-26 Jb Evain <jbevain@novell.com>
3173 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
3174 which takes a boolean 'report_errors', similar to the GetMethod.
3175 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
3176 in .net 2.1, do not report errors here.
3178 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
3179 System.Runtime.CompilerServices.RequiredAttributeAttribute and
3180 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
3183 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
3184 of the type InternalsVisibleToAttribute before the first call
3185 to CoreLookupType which is allowed to fail (third boolean parameter
3186 to true). Because, during the resolution for a type that is not
3187 immediately found, we try to check if the type is not defined in
3188 a friend assembly, and to do so, we need the
3189 InternalVisibleToAttribute.
3191 2007-07-23 Miguel de Icaza <miguel@novell.com>
3193 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
3194 feature that allows structs to be compared against null and inline
3195 the result as true or false.
3197 Notice that the same code is not permitted inside a generic block
3198 of code that would do:
3200 class Foo<T> where T : struct {
3207 It is only allowed if the type of T is not bound (no where
3208 clause). In my opinion, this CSC 2 behavior is broken but people
3209 seem to be using it (IronRuby does, a few bug reports on bugzilla
3210 have it and some people have complained about it).
3212 All of the users that depend on this behavior have code that is
3215 * report.cs (Warning, Error): make these take object arguments,
3216 not strings, as that allows us to take advantage of Format.
3218 2007-07-20 William Holmes <billholmes54@gmail.com>
3220 * decl.cs: Changed MemberName.CountTypeArguments to also check the
3221 Left member variable for the Count.
3222 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
3223 MemberName.CountTypeArguments to avoid a NRE.
3225 This code is contributed under the MIT X11 license
3227 2007-07-18 Marek Safar <marek.safar@gmail.com>
3229 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
3231 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
3233 * doc.cs : generic method arguments are written as ``x while generic
3234 type arguments are `x. Combined with the previous change, fixed bug
3237 2007-07-18 Raja R Harinath <rharinath@novell.com>
3240 * expression.cs (Binary.ResolveOperator): When converting
3241 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
3243 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
3245 * doc.cs : when T: or whatever x: is specified, it does not really
3246 check the doc comment's syntax correctness. Fixed bug #82006.
3248 2007-07-18 Marek Safar <marek.safar@gmail.com>
3250 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
3251 LambdaExpression better.
3253 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
3255 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
3257 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
3258 as it can be generated.
3260 * expression.cs (Invocation.Error_InvalidArguments): Show correct
3263 * lambda.cs (LambdaExpression): Refactored to share same code with
3264 AnonymousMethodExpression.
3266 2007-07-17 Marek Safar <marek.safar@gmail.com>
3268 * anonymous.cs (MakeName): Include host name for easier debugging.
3269 (LambdaMethod): New class for lambda spcecific stuff.
3271 * attribute.cs: Set EmitContext return type.
3273 * class.cs: Set EmitContext return type.
3275 * codegen.cs (EmitContext): Return type cannot be null to stop messing
3276 with null/void meaning.
3278 * iterators.cs (ContainerType): Implemented.
3280 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
3282 * statement.cs (Return): Updated to lambda expressions.
3283 (Block.CloneTo): Parent can be null.
3285 2007-07-13 Marek Safar <marek.safar@gmail.com>
3287 A fix for bug #81917
3288 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
3290 * class.cs (FixedField): Check whether field is in unsafe scope.
3292 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
3293 (FieldExpr.Emit): Fixed buffers cannot be volatile.
3295 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
3298 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
3300 2007-07-13 Marek Safar <marek.safar@gmail.com>
3302 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
3303 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
3306 2007-07-13 Marek Safar <marek.safar@gmail.com>
3308 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
3310 2007-07-13 Marek Safar <marek.safar@gmail.com>
3312 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
3313 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
3315 * codegen.cs(EmitContext): Add ProbingMode flag.
3317 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
3319 * driver.cs: For now set both warning values.
3321 * ecore.cs (SimpleName): Name is readonly.
3322 (MethodGroup.OverloadResolve): One quick path for probing.
3324 * expression.cs (Unary): Set Oper r/o.
3325 (Binary): Set Oper r/o.
3326 (ParameterReference): Set few instance variables as r/o.
3327 (ParameterReference.DoResolveBase): Don't capture aruments when
3329 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
3330 (Arglist): arguments are private.
3331 (SizeOf): type is private and r/o.
3332 (MemberAccess): arguments are private.
3334 * report.cs: Enhanced reporting on/off capabilities.
3336 * lambda.cs: Uses ec.IsInProbingMode.
3337 (ContextualReturn): Derives from return.
3339 * rootcontext.cs: For now set both warning values.
3341 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
3343 (Return.Resolve): Don't die immediately.
3344 (Block.Resolve): Speed-up probing.
3345 (Block.CloneTo): Clone only child blocks.
3347 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
3349 * iterators.cs: reverted Miguel's latest change (r81925) as it
3350 breaks the build in System.
3352 2007-07-13 Miguel de Icaza <miguel@novell.com>
3354 * iterators.cs (Yield.CheckContext): Check for the iterator type
3355 also here as we can call into Yield even in codepaths that are not
3357 (MethodOrOperator is the only path that was checked).
3359 In addition to the standard check, use a more specific check for
3360 constructors to report a more verbose error.
3362 2007-07-12 Miguel de Icaza <miguel@novell.com>
3364 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
3365 report the warning and continue
3367 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
3368 values on the stack on the call to Emit. Use EmitStatement if
3369 possible, or using Emit + Pop if not possible. Fixes #82064
3371 2007-07-12 Raja R Harinath <rharinath@novell.com>
3373 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
3374 avoid try...finally in some cases.
3376 2007-07-10 Marek Safar <marek.safar@gmail.com>
3378 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
3380 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
3381 instead of method. Re-use standard error handling.
3382 (ConstructorInitializer.Emit): Simplified.
3384 * delegate.cs: Updated after Invocation.EmitCall change.
3386 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
3387 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
3388 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
3389 method and don't permanently changing input arguments.
3390 (MethodGroupExpr): Introduced resolved best_candidate, when method group
3391 is resolved it has one of the candidates is the best one which is later
3392 used to emit. Removed a few unused method.
3393 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
3395 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
3396 (Binary.ResolveOperator): Ditto.
3397 (ConditionalLogicalOperator.DoResolve): Ditto.
3398 (Invocation): Uses method group.
3399 (Invocation.DoResolve): Simplified.
3400 (Invocation.EmitCall): Removed useless is_static.
3401 (Invocation.Emit): Delegate to method group.
3402 (Invocation.EmitStatement): Simplified.
3403 (New): Uses method group.
3404 (MemberAccess.DoResolve): Don't destroy original expression.
3406 * statement.cs (ForEach.Resolve): Use null for no method arguments.
3408 2007-07-04 Marek Safar <marek.safar@gmail.com>
3410 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
3413 * lambda.cs: Add custom error message type.
3415 2007-07-03 Marek Safar <marek.safar@gmail.com>
3417 * lambda.cs: Simplified little bit.
3419 * parameter.cs: Introduced ImplicitLambdaParameter.
3420 (Parameters.CreateFullyResolved): New factory instead of ctor.
3424 * delegate.cs: Updated parameter creation.
3426 2007-07-03 Marek Safar <marek.safar@gmail.com>
3428 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
3431 * generic.cs: Synchronized with gmcs.
3433 2007-07-03 Marek Safar <marek.safar@gmail.com>
3435 * class.cs (Indexer): Check return type as soon as possible.
3437 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
3440 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
3442 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
3444 * parameter.cs (Parameter): Use expression type when it is available.
3446 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
3447 method modifier for the first parameter only.
3449 2007-06-24 Marek Safar <marek.safar@gmail.com>
3451 A fix for bug #81938
3452 * typemanager.cs (ChangeType): Fixed couple of char conversions.
3454 * constant.cs: Tide up an exception message.
3456 2007-06-22 Marek Safar <marek.safar@gmail.com>
3458 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
3459 an uninitialized variable is used.
3461 * expression.cs (LocalVariableReference.DoResolve): Ditto.
3463 2007-06-22 Marek Safar <marek.safar@gmail.com>
3465 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
3466 not found error handling.
3468 * expression.cs (ArrayCreation): Removed redundant fields and little bit
3470 (ArrayCreation.ResolveArrayElement): To be ready to customization.
3471 (ArrayCreation.DoResolve): Simplified.
3472 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
3473 its own resolve process.
3474 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
3476 2007-06-20 Marek Safar <marek.safar@gmail.com>
3478 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
3481 2007-06-20 Marek Safar <marek.safar@gmail.com>
3483 * cs-tokenizer.cs: Removed var related stuff.
3485 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
3486 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
3487 a type and a keyword at same time.
3489 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
3492 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
3493 implicitly typed arrays, more changes will follow.
3495 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
3497 2007-06-19 Marek Safar <marek.safar@gmail.com>
3499 * ecore.cs (VarExpr): Removed Handled field.
3501 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
3502 build-in assign functionality.
3503 (ForEach.Resolve): Removed all implicitly typed local variable code and
3505 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
3506 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
3508 2007-06-18 Marek Safar <marek.safar@gmail.com>
3510 * assign.cs: Removed implicitly typed local variable check.
3512 * expression.cs (LocalVariableReference.DoResolve): Add check for self
3513 referencing implicitly typed local variable.
3514 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
3517 * statement.cs (Fixed): Removed unsupported implicitly typed local
3520 2007-06-15 Marek Safar <marek.safar@gmail.com>
3522 * decl.cs (MemberName): Moved all Unbound stuff to parser.
3524 2007-06-14 Marek Safar <marek.safar@gmail.com>
3526 A fix for bugs #81855 and #76274
3527 * attribute.cs (AttachTo): Always set owner for global attributes to
3530 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
3533 * cs-parser.jay: Assembly and module attributes must precede all other
3534 elements except using clauses and extern alias declarations.
3536 2007-06-13 Marek Safar <marek.safar@gmail.com>
3538 A fix for bug #81748
3540 * expression.cs: More checks for non ISO-1 features.
3542 2007-06-12 Marek Safar <marek.safar@gmail.com>
3544 A fix for bug #81807
3545 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
3546 present inside switch statement and it is required by nullable check.
3548 2007-06-12 Marek Safar <marek.safar@gmail.com>
3550 A fix for bug #81840
3551 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
3552 when type matching fails.
3554 * namespace.cs: Tiny error message change.
3556 2007-06-12 Marek Safar <marek.safar@gmail.com>
3558 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
3559 reporting. Added automatic property check.
3561 * class.cs: Updated after CheckAbstractAndExtern relocation.
3562 (AEventPropertyAccessor.GetSignatureForError): Customized.
3564 2007-06-11 Marek Safar <marek.safar@gmail.com>
3566 * class.cs (DefineBaseTypes): Base type can be undefined.
3568 * ecore.cs (TypeLookup): Minor refactoring.
3569 (DoResolveAsTypeStep): Removed redundant check.
3571 * namespace.cs (Lookup): Removed redundant check.
3573 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
3574 ResolveAsTypeTerminal step.
3575 (BootstrapCorlib_*): Simplified.
3576 (PopulateCoreType): Core types can be now external.
3578 2007-06-07 Marek Safar <marek.safar@gmail.com>
3580 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
3582 (InferTypeArguments): Infers anonymous expression type arguments.
3583 (Compatible): Split to Compatible and InferTypeArguments.
3585 * lambda.cs: Updated.
3587 2007-06-08 Marek Safar <marek.safar@gmail.com>
3589 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
3591 2007-06-07 Raja R Harinath <harinath@gmail.com>
3593 Fix #80477, cs0135-2.cs, cs0135-3.cs
3594 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
3595 names to the "known" variables list.
3596 (Block.CheckInvariantMeaningInBlock): Handle the fact the
3597 parameter names are also "known".
3598 (Block.CheckError136): Remove.
3599 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
3602 2007-06-07 Marek Safar <marek.safar@gmail.com>
3604 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
3606 2007-06-06 Marek Safar <marek.safar@gmail.com>
3608 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
3609 internal error not an user error.
3611 * expression.cs (IsApplicable): Refactored to make debugging easier.
3613 * support.cs: More tricks for non-mono runtimes.
3615 * typemanager.cs (CoreLookupType): Made public.
3616 (InitSystemCore): All linq specific stuff moved to linq.cs
3618 2007-06-05 Marek Safar <marek.safar@gmail.com>
3620 * typemanager.cs (CSharpSignature): One more missing build-in types
3622 More tricks for non-mono runtime.
3624 2007-06-05 Raja R Harinath <harinath@gmail.com>
3626 * statement.cs (Block.CheckError136_InParents): Remove.
3627 (Block.AddVariable): Use GetParameterInfo instead.
3628 (ToplevelBlock.ProcessArguments): Likewise.
3630 2007-06-04 Raja R Harinath <rharinath@novell.com>
3632 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
3634 (ToplevelBlock.GetParameterInfo): Split out of ...
3635 (ToplevelBlock.GetParameterRefernce): ... this.
3636 (ToplevelBlock.ParameterMap): Remove.
3637 * expression.cs (ParameterReference): Update to use
3638 ToplevelParameterInfo.
3640 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
3643 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
3644 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
3646 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
3647 (ToplevelBlock.ProcessParameters) ... here.
3648 (ToplevelBlock..ctor): Invoke it.
3650 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
3653 * statement.cs (IKnownVariable): New interface.
3654 (LocalInfo): Implement it.
3655 (ToplevelParameterInfo): New class.
3656 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
3657 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
3658 GetKnownVariableInfo.
3660 2007-06-03 Raja R Harinath <harinath@gmail.com>
3662 Partly speed up CS0136 error checks.
3663 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
3664 'recurse' parameter.
3665 (Block.DoCheckError136): Only check errors in parameters. Move
3666 local variable checks ...
3667 (Block.AddVariable): ... here, and ...
3668 (ToplevelBlock.ResolveMeta): ... here.
3670 2007-06-02 Raja R Harinath <harinath@gmail.com>
3672 * statement.cs (Block.IsChildOf): Remove.
3674 * statement.cs (Statement.Clone): Move special case code ...
3675 (Block.CloneTo): ... here.
3677 2007-05-29 Raja R Harinath <rharinath@novell.com>
3679 * statement.cs (ToplevelBlock.container): Remove field. It's
3680 redundant with 'Parent'.
3681 (ToplevelBlock.ContainerBlock): Remove accessor.
3682 (ToplevelBlock..ctor): Update to changes. Register anonymous
3683 child with parent here, ...
3684 * cs-parser.jay (end_anonymous): ... not here. Don't modify
3686 (start_anonymous): Don't save current_block.
3687 (top_current_block): Remove.
3689 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
3690 (Block.Resolve): Update to changes.
3691 (Block..ctor): Move setting of "correct" 'Toplevel'
3692 and 'Explicit' fields to ...
3693 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
3695 2007-05-27 Raja R Harinath <harinath@gmail.com>
3698 * statement.cs (Block.Implicit): Remove.
3699 (Block): Update to changes.
3700 * flowanalysis.cs: Likewise.
3702 Mildly speed up CheckInvariantMeaningInBlock
3703 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
3704 Recursively call AddKnownVariable to all enclosing blocks.
3705 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
3706 Remove recursive calls.
3707 (Block): Update to changes.
3709 New ExplicitBlock invariants
3710 * statement.cs (Block.Explicit): New field. It points to the
3711 immediately enclosing non-implicit block.
3712 (Block..ctor): Maintain the invariant.
3713 * cs-parser.jay: Take advantage of invariant.
3715 Introduce ExplicitBlock
3716 * statement.cs (ExplicitBlock): New.
3717 (ToplevelBlock): Derive from it.
3718 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
3720 (Block.Implicit): Update to changes.
3721 * cs-parser.jay: Update to changes.
3724 * codegen.cs (EmitContext.IsLastStatement): Remove.
3725 * statement.cs (Block.DoEmit): Update to changes.
3727 2007-05-25 Raja R Harinath <rharinath@novell.com>
3729 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
3730 modifying current_block directly.
3732 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
3734 * class.cs: Implemented automatic properties (C# 3.0)
3735 Thanks to Marek for the help.
3737 2007-05-23 Raja R Harinath <rharinath@novell.com>
3739 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
3740 variable as assigned, note also that all its components are
3742 (MyBitVector.SetRange): New. Function to set multiple bits to true.
3744 2007-05-19 Marek Safar <marek.safar@gmail.com>
3746 * anonymous.cs, class.cs: Emit Compiler generated attribute when
3747 member is marked as compiler generated.
3749 * decl.cs (MemberCore): Refactored ModFlags into property.
3751 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
3752 (Check): Check only accessibility modifiers.
3754 2007-05-18 Raja R Harinath <rharinath@novell.com>
3756 Track all assignable slots in one bit array
3757 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
3758 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
3759 logic from VariableMap constructor here. Use the same 'offset'
3760 variable that's later used for computing offsets of local
3762 * flowanalysis.cs (UsageVector.parameters): Remove.
3763 (UsageVector): Update to changes.
3764 (VariableMap): Remove.
3766 Avoid creating ParameterMap in every block
3767 * statement.cs (Block.ParameterMap): Move ...
3768 (ToplevelBlock.ParameterMap): ... here.
3769 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
3771 * flowanalysis.cs (FlowBranching.param_map): Remove.
3772 (FlowBranching.UsageVector): Update to changes.
3773 (FlowBranchingToplevel.CheckOutParameters): Likewise.
3775 * statement.cs (Block.CloneTo): Clone Toplevel field too.
3777 * expression.cs (ParameterReference): Distinguish between block
3778 where parameter was referenced and declared.
3780 2007-05-18 Marek Safar <marek.safar@gmail.com>
3782 * flowanalysis.cs, statement.cs: Put back improved error handling.
3784 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
3788 Imporved object and collection initialization (C# 3.0).
3790 2007-05-15 Marek Safar <marek.safar@gmail.com>
3792 A fix for bug #81380
3793 * expression.cs (Is.DoResolve): Only value types have constant `is'
3796 2007-05-15 Raja R Harinath <rharinath@novell.com>
3798 * statement.cs (ToplevelBlock.child): Remove.
3800 2007-05-15 Raja R Harinath <harinath@gmail.com>
3802 Rationalize ResolveMeta: refactoring
3803 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
3804 out constant handling code into ...
3805 (Block.DoResolveConstants): ... this.
3807 Rationalize ResolveMeta: kill local_map
3808 * statement.cs (Block.local_map, Block.LocalMap): Remove.
3809 (Block.AssignableSlots): New.
3810 (Block.ResolveMeta): Make protected. Don't create a VariableMap
3811 for locals -- move code from VariableMap here. Avoid unnecessary
3813 * flowanalysis.cs (FlowBranching.local_map): Remove.
3814 (FlowBranching..ctor): Use Block.AssignableSlots.
3815 (VariableMap): Remove unused constructors.
3817 2007-05-11 Raja R Harinath <rharinath@novell.com>
3819 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
3821 2007-05-11 Marek Safar <marek.safar@gmail.com>
3823 * typemanager.cs (IsFriendAssembly): Should not be called for building
3826 2007-05-09 Marek Safar <marek.safar@gmail.com>
3828 * literal.cs (NullConstant): Print null in all cases.
3830 * expression.cs (Binary.ResolveOperator): Implemented delegate
3831 comparison based on C# 2.0 changes.
3833 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
3835 This code is contributed under the MIT X11 license
3837 The following enables support for several C# 3.0 language features:
3839 * cs-tokenizer.cs: Added support for the "var" keyword.
3841 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
3842 Added VarExpr class to facilitate type inferencing.
3844 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
3845 to support anonymous types.
3847 * assign.cs: Added support for type inferencing and initialization.
3849 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
3851 * expression.cs: Added implicit array support to ArrayCreation.
3852 Added 5 types and 1 interface:
3854 IInitializable Implementing classes can inject initializing
3855 statements after object instantiation.
3857 Initializer Stores data for object initialization.
3859 AnonymousType An expression for anonymous types.
3861 AnonymousTypeParameter Stores data about an anonymous type's field.
3863 NewInitialize An expression for object initialization.
3865 CollectionInitialize An expression for collection initialization.
3867 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
3870 2007-05-06 Marek Safar <marek.safar@gmail.com>
3872 A fix for bug #81500
3873 * cs-tokenizer.cs: Add special handling for coalescing operator.
3875 2007-05-06 Marek Safar <marek.safar@gmail.com>
3877 A fix for bug #81529
3878 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
3879 its value from base class until it is redefined.
3881 2007-05-02 Raja R Harinath <rharinath@novell.com>
3883 Fix regression in cs0631-3.cs
3884 * cs-parser.jay (operator_declarator): Add opt_attributes to error
3885 fallback. Make error fallback catch more cases.
3887 2007-05-01 Miguel de Icaza <miguel@novell.com>
3889 * cs-parser.jay: Allow parameters in operator declarations to have
3892 2007-04-27 Miguel de Icaza <miguel@novell.com>
3894 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
3897 * lambda.cs (ContextualReturn.Resolve): An expression is valid
3898 inside the ContextualReturn, it does not have to be an
3899 ExpressionStatement.
3901 2007-04-24 Miguel de Icaza <miguel@novell.com>
3903 * lambda.cs (ContextualReturn.Resolve): if the return type is not
3906 2007-04-23 Miguel de Icaza <miguel@novell.com>
3908 * anonymous.cs (AnonymousContainer): split the virtual Resolve
3909 method in two methods: ResolveNoDefine and Resolve.
3911 ResolveNoDefine will stop just after ResolveTopBlock has been
3914 Resolve will then continue by creating a method and issuing the
3915 call to method.Define ().
3917 (AnonymousMethod): Split and implement the new Resolve and
3918 ResolveNoDefine as well.
3920 * lambda.cs (LambdaExpression): Split the anonymous method
3921 resolution code into a separate routine (CoreCompatibilityTest)
3922 from DoCompatibleTest.
3924 (LambdaExpression.TryBuild): New method, this method tries to
3925 build the LambdaExpression with the given set of types to be used
3926 as the types for the various parameters of the lambda expression.
3928 If the compilation succeed with the given types, the infered type
3929 of the Anonymous method is returned, otherwise null is returned.
3931 2007-04-23 Marek Safar <marek.safar@gmail.com>
3933 A fix for bug #81414
3934 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
3936 2007-04-22 Miguel de Icaza <miguel@novell.com>
3938 * cs-tokenizer.cs: Change various identifiers here from the
3939 camelCasing to the recommended Linux-like style for instance
3940 variables from the Coding Guidelines.
3942 2007-04-19 Martin Baulig <martin@ximian.com>
3945 (Convert.ImplicitReferenceConversionCore): Allow conversions from
3946 System.Enum to System.ValueType.
3948 2007-04-13 Martin Baulig <martin@ximian.com>
3950 Rewrote implicit reference conversions. We need to distinguish
3951 between implicit reference conversions (13.1.4) and implicit
3952 boxing conversions (13.1.5).
3954 According to the spec, there's an an implicit conversion
3955 "From a one-dimensional array-type S[] to IList<T> and base
3956 interfaces of this interface, provided there is an implicit
3957 reference conversion from S to T." Note that this does not
3958 include boxing conversions.
3961 (Convert.ImplicitTypeParameterBoxingConversion): New method.
3962 (Convert.ImplicitReferenceConversion): Split into
3963 ImplicitReferenceConversionCore() and
3964 ImplicitBoxingConversionExist().
3965 (Convert.ImplicitReferenceConversionExists): Use the new
3966 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
3968 2007-04-12 Martin Baulig <martin@ximian.com>
3970 * convert.cs (Convert.ImplicitReferenceConversion): Move the
3971 `TypeManager.null_type' checks up to the top of the method.
3973 2007-04-11 Marek Safar <marek.safar@gmail.com>
3975 A fix for bug #81350
3976 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
3979 2007-04-11 Martin Baulig <martin@ximian.com>
3981 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
3982 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
3983 to make this work for generic classes; fixes #79561.
3985 2007-04-11 Martin Baulig <martin@ximian.com>
3987 * expression.cs (As): Add support for nullable types; fixes #79371.
3989 2007-04-11 Martin Baulig <martin@ximian.com>
3991 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
3992 `type.FullName' is null; fixes #80243.
3994 2007-04-11 Martin Baulig <martin@ximian.com>
3996 * expression.cs (Invocation.IsApplicable): Don't modify the method
3997 if type inference succeeded, but the method was not applicable.
4000 2007-04-10 Marek Safar <marek.safar@gmail.com>
4002 A fix for bug #81324
4003 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
4004 internal and external namespaces containers.
4006 2007-04-10 Martin Baulig <martin@ximian.com>
4008 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
4009 TypeManager.DropGenericMethodArguments() so we also call
4010 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
4012 2007-04-10 Martin Baulig <martin@ximian.com>
4014 * iterators.cs (Iterator.CreateIterator): Don't crash if
4015 `method.ReturnType' is null. This happens if something went wrong
4016 while resolving that typ (we already reported an error in this case).
4018 2007-04-10 Martin Baulig <martin@ximian.com>
4020 * expression.cs (New.DoResolve): Don't call CheckComImport() on
4021 generic interfaces; report the CS0144 directly.
4023 2007-04-10 Martin Baulig <martin@ximian.com>
4025 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
4026 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
4028 2007-04-10 Martin Baulig <martin@ximian.com>
4030 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
4032 2007-04-09 Raja R Harinath <rharinath@novell.com>
4035 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
4036 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
4039 * statement.cs (For.Resolve): If resolution fails, use
4042 2007-04-08 Marek Safar <marek.safar@gmail.com>
4044 * anonymous.cs (MakeName): Make faster and zero-based.
4045 (VerifyExplicitParameterCompatibility): Back to mode where generic
4046 parameter is ignored.
4047 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
4049 * class.cs (EmitType): Method can emit another new method.
4051 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
4053 * driver.cs: Updated.
4055 * lambda.cs: Reuse predefined empty parameters.
4057 * parameter.cs: Updated
4059 * support.cs: Implemented InflateTypes.
4061 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
4062 (InitSystemCore): Introduced to isolate 3.0 dependencies.
4064 2007-04-03 Martin Baulig <martin@ximian.com>
4068 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
4069 version of TypeManager.IsOverride() which also works with generic
4072 2007-04-03 Martin Baulig <martin@ximian.com>
4077 (Convert.ExplicitReferenceConversion): We need to cast when
4078 converting from IList<T> to S[].
4080 2007-04-01 Marek Safar <marek.safar@gmail.com>
4082 * decl.cs (FindExtensionMethods): Consider all candidates with same name
4085 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
4087 2007-03-31 Marek Safar <marek.safar@gmail.com>
4089 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
4090 argument and return type inferring.
4092 * codegen.cs (InferReturnType): Flag whether return can be inferred.
4093 (ReturnType): Turned to property.
4095 * statement.cs (Return): Implemented return type inferring.
4097 * support.cs (ReflectionParameters): Use local types if possible.
4099 2007-03-30 Raja R Harinath <rharinath@novell.com>
4101 * flowanalysis.cs (FlowBranching.Reachability): Remove.
4102 (FlowBranching.UsageVector): Update to changes.
4104 Prepare to kill 'Reachability'
4105 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
4106 argument of constructor.
4108 2007-03-29 Raja R Harinath <rharinath@novell.com>
4110 Prepare to kill 'Reachability'
4111 * flowanalysis.cs (UsageVector.is_unreachable): New.
4112 (UsageVector): Update to maintain 'is_unreachable' in parallel to
4113 'reachability', and verify they're consistent.
4116 * expression.cs (New.EmitStatement): Handle type parameters here too.
4118 2007-03-29 Martin Baulig <martin@ximian.com>
4123 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
4124 CompilerGeneratedClass.
4125 (ScopeInfo.EmitScopeInstance): Make this protected.
4126 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
4127 `ec.CurrentAnonymousMethod.Scope == Scope'.
4129 * statement.cs (Block.ScopeInfo): Make this a property.
4131 2007-03-27 Raja R Harinath <harinath@gmail.com>
4133 Prepare to kill 'Reachability'
4134 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
4135 (FlowBranching.UsageVector.Reachability): Remove property.
4136 (FlowBranching.UsageVector.IsUnreachable): New property.
4137 (FlowBranching.UsageVector.ResetBarrier): New.
4138 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
4139 * codegen.cs, statement.cs: Update to changes.
4141 2007-03-27 Martin Baulig <martin@ximian.com>
4146 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
4149 2007-03-26 Raja R Harinath <rharinath@novell.com>
4151 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
4152 instead of TriState. Remove all mention of TriState.
4154 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
4155 replaced by a boolean. Add boolean 'is_unreachable' field, check
4156 and maintain invariants.
4158 2007-03-25 Marek Safar <marek.safar@gmail.com>
4160 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
4162 2007-03-25 Marek Safar <marek.safar@gmail.com>
4164 * expression.cs: Stop using obsolete 2.0 opcodes.
4166 2007-03-25 Marek Safar <marek.safar@gmail.com>
4168 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
4169 one of the latests Martin's fixes.
4171 2007-03-23 Miguel de Icaza <miguel@novell.com>
4173 * expression.cs: On BigEndian systems, swap the bytes, temporary
4174 solution until we get a new bitconverter class.
4176 2007-03-23 Martin Baulig <martin@ximian.com>
4180 * decl.cs (MemberCache.AddMembers): Add generic methods both as
4181 "Method" and "Method`1". Normally, a cache lookup is done on the
4182 "Method" form (ie. without the generic arity), but this one makes
4183 lookups on the full form work as well.
4185 2007-03-22 Raja R Harinath <rharinath@novell.com>
4187 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
4190 2007-03-20 Bill Holmes <billholmes54@gmail.com>
4192 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
4193 ordered_member_list, to TypeBuilder to store members to be defined
4194 in the order they were parsed in.
4195 - ordered_explicit_member_list contains all properties indexers
4196 and methods that are defined as explicit implementation of an
4197 interface or base class.
4198 - ordered_member_list contains all properties indexers and methods
4199 that are not defined as explicit implementation of an interface
4202 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
4203 functionality in these removed classes has been replaced with
4204 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
4205 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
4207 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
4208 to CheckForDuplications inside GetMethod and SetMethod Define Method
4209 to handle method property and indexer name conflicts.
4213 All code is contributed under the MIT/X11 license.
4215 2007-03-20 Martin Baulig <martin@ximian.com>
4217 * class.cs (TypeContainer.Interfaces): Removed; they're now
4218 included in `TypeContainer.Types'.
4220 2007-03-20 Martin Baulig <martin@ximian.com>
4222 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
4224 * class.cs (TypeContainer.CreateType): New public method. This is
4225 now called before DefineType() to create the TypeBuilders.
4226 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
4227 has already been created by CreateType().
4228 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
4229 don't resolve our base classes here; this has been moved into
4230 DefineBaseTypes(). We're now called from CreateType().
4231 (TypeContainer.DefineBaseTypes): New private method; resolve our
4232 base classes here. We're now called from DefineType().
4235 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
4236 our types first to create all the TypeBuilders. After that, call
4237 TypeContainer.DefineType() on all the types which'll resolve their
4238 base classes and setup the resolve order.
4240 2007-03-20 Martin Baulig <martin@ximian.com>
4242 * class.cs (TypeContainer.Enums): Removed; they're now included in
4243 `TypeContainer.Types'.
4245 2007-03-20 Martin Baulig <martin@ximian.com>
4248 (TypeContainer.DefineType): Don't call ResolveMembers() here.
4249 (TypeContainer.DoResolveMembers): Call DefineType() on our
4250 `compiler_generated' classes; moved here from DefineNestedTypes().
4253 (RootContext.ResolveTree): Call ResolveMembers() on all
4254 TypeContainer's in the `type_container_resolve_order'.
4256 2007-03-19 Marek Safar <marek.safar@gmail.com>
4258 * class.cs: Use corlib to handle InternalMethodImplAttribute.
4260 2007-03-17 Marek Safar <marek.safar@gmail.com>
4262 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
4263 implementation flags.
4265 2007-03-17 Marek Safar <marek.safar@gmail.com>
4267 * class.cs: More optimizations for type parameters.
4269 2007-03-15 Marek Safar <marek.safar@gmail.com>
4271 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
4273 * ecore.cs, parameter.cs: More common code for both corlibs.
4275 * typemanager.cs (IsGenericMethod): Simplified.
4277 2007-03-15 Raja R Harinath <rharinath@novell.com>
4279 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
4281 * statement.cs, iterators.cs, lambda.cs: Update to changes.
4283 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
4284 unconditionally. Simplify explanation.
4285 (Try.Resolve, Using.Resolve): Likewise.
4287 2007-03-15 Martin Baulig <martin@ximian.com>
4291 * decl.cs (DeclSpace): If we're a partial class, use our
4292 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
4294 2007-03-15 Raja R Harinath <rharinath@novell.com>
4296 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
4298 (FlowBranching.UsageVector): Update to changes.
4299 (FlowBranching.MergeSiblings): Likewise.
4300 * statement.cs: Likewise.
4302 2007-03-15 Martin Baulig <martin@ximian.com>
4307 (MemberCache): Added a special .ctor for type parameters.
4310 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
4313 2007-03-09 Martin Baulig <martin@ximian.com>
4315 * enum.cs (Enum): Make this a TypeContainer.
4316 (EnumMember): Derive from `Const'.
4319 (Const.DoResolveValue): New protected virtual method; move most of
4320 the functionality of ResolveValue() here so we can override it in
4322 (Const.CreateConstantReference): Make this virtual.
4324 * class.cs (Kind): Add `Kind.Enum'.
4325 (TypeContainer.Emit): Don't emit the enums here; they're already
4326 in the `RootContext.typecontainer_resolve_order'.
4328 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
4329 here; they're already in the `typecontainer_resolve_order'.
4331 * ecore.cs (EnumConstant.ConvertImplicitly): Add
4332 TypeManager.DropGenericTypeArguments().
4335 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
4336 (TypeManager.IsEnumType): Likewise.
4337 (TypeManager.EnumToUnderlying): Likewise.
4338 (TypeManager.IsEqual): Add support for enums.
4340 2007-03-12 Raja R Harinath <rharinath@novell.com>
4342 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
4343 DefaultParameterValueAttribute to be undefined, say if System.dll
4346 2007-03-11 Marek Safar <marek.safar@gmail.com>
4348 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
4351 2007-03-10 Marek Safar <marek.safar@gmail.com>
4353 * class.cs, parameter.cs: Unified parameters verification.
4355 2007-03-08 Martin Baulig <martin@ximian.com>
4357 * cs-parser.jay (constructor_header): Pass the location to the
4358 newly created TopLevelBlock.
4360 2007-03-07 Martin Baulig <martin@ximian.com>
4362 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
4364 2007-03-06 Miguel de Icaza <miguel@novell.com>
4366 * convert.cs (ExplicitReferenceConversionExists): Sync this method
4367 with the changes from David, fixes the build.
4369 2007-03-05 David Mitchell <dmitchell@logos.com>
4371 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
4372 and its base interfaces to a one-dimensional array type S[],
4373 provided there is an implicit or explicit reference conversion
4376 2007-03-03 Marek Safar <marek.safar@gmail.com>
4378 * cs-tokenizer.cs: Implemented basic linq grammar.
4380 * driver.cs: Set linq lang version on demand.
4382 2007-02-26 Marek Safar <marek.safar@gmail.com>
4384 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
4386 2007-02-25 Marek Safar <marek.safar@gmail.com>
4388 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
4391 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
4393 Check property and event extern attributes.
4395 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
4398 2007-02-24 Marek Safar <marek.safar@gmail.com>
4400 A fix for bug #80407
4401 * ecore.cs: Don't report ambiguity error when methods have same parent.
4403 2007-02-23 Marek Safar <marek.safar@gmail.com>
4405 A fix for bug #80878
4406 * class.cs, cs-parser.jay: Event property can host anonymous methods.
4408 2007-02-22 Marek Safar <marek.safar@gmail.com>
4410 * attribute.cs: Enable ExtensionAttribute presence test.
4412 2007-02-22 Marek Safar <marek.safar@gmail.com>
4414 * class.cs: Warn about missing GetHashCode only when Equals is override.
4416 * decl.cs: Check accessibility of type arguments.
4418 * typemanager.cs: Correctly report nullable array.
4420 2007-02-20 Marek Safar <marek.safar@gmail.com>
4422 * class.cs, report.cs: Capture more details when things go wrong.
4424 2007-02-20 Marek Safar <marek.safar@gmail.com>
4426 A fix for bug #80650
4427 * cs-parser.jay: Anonymous container starts at constructor declaration
4428 and not at block beginning because it has to be usable in constructor
4431 * statement.cs: Use context location and not block one for error reporting.
4433 2007-02-18 Marek Safar <marek.safar@gmail.com>
4435 A fix for bug #78712
4436 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
4439 2007-02-18 Marek Safar <marek.safar@gmail.com>
4441 A fix for bug #80493 by Atsushi Enomoto
4442 * cs-parser.jay: Ignore invalid attribute target.
4444 2007-02-18 Marek Safar <marek.safar@gmail.com>
4446 * cs-tokenizer.cs: Ignore '\0' as white space character.
4448 2007-02-17 Miguel de Icaza <miguel@novell.com>
4450 * cs-parser.jay: Add support for lambda expressions to the mcs
4453 * lambda.cs: Only clone when we are probing, not on the final call
4454 (Compatible is the final call).
4456 * statement.cs (CloneContext): Introduce class to provide block
4457 remapping during clone.
4459 All statements Clone themselves now.
4461 (Clone): special handling for blocks, when we clone a block, we
4462 register the block inside this routine, as children of the block
4463 might trigger a lookup.
4465 * expression.cs: Add support for CloneContext in all expressions.
4467 2007-02-17 Marek Safar <marek.safar@gmail.com>
4469 A fix for bug #80493
4470 * statement.cs: Report ambiguous warning when interfaces are not related.
4472 2007-02-15 Marek Safar <marek.safar@gmail.com>
4474 C# 3.0 extension methods.
4476 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
4477 cannot be used directly.
4479 * class.cs (Class.Emit): Emit extension attribute if any class method
4480 is extension method.
4481 (Method.Define): Add basic extension method validation conditions.
4482 (Method.Emit): Emit extension attribute for method.
4484 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
4485 extension method exists. Currently we follow same approach as Microsoft
4486 does, emit even if a method or a class are private but this can change
4489 * cs-parser.jay: Add handling of `this' keyword in method parameters
4492 * decl.cs (DeclSpace.IsStaticClass): New property.
4493 (MemberCache.FindExtensionMethods): Looks for extension methods with
4494 defined name and extension type.
4496 * doc.cs: Updated after OverloadResolve changes.
4498 * driver.cs: Add new soft reference to System.Core.dll.
4500 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
4501 (ExtensionMethodGroupExpr): Represents group of extension methods.
4503 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
4504 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
4505 to MethodGroupExpr and made non-static for easier customization.
4506 (Invocation.DoResolve): Add extension method lookup when no standard
4508 (MemberAccess.DoResolve): Try extension methods if no member exists.
4510 * modifiers.cs: Add METHOD_EXTENSION modifier.
4512 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
4513 as well as candidate extension type.
4514 (ComputeNamespaces): When assembly constains extension methods registers
4516 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
4517 extension method lookup.
4518 (Namespace.LookupExtensionMethod): Looks for extension method in this
4520 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
4521 find a method which matches name and extensionType.
4523 * parameter.cs (Parameter): Add This modifer.
4524 (HasExtensionMethodModifier): New property.
4525 (Resolve): Add extension parameter check.
4526 (ModFlags): turned to property to exclude this modifier as it is not real
4528 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
4530 * support.cs (ParameterData): Add ExtensionMethodType.
4531 (ReflectionParameters): Implemented ExtensionMethodType interface property.
4533 * typemanager.cs: Add type and ctor extension attribute type.
4535 2007-02-15 Miguel de Icaza <miguel@novell.com>
4537 * report.cs (DisableErrors, EnableErrors): used to prevent error
4538 output when we are "trying" to compile various methods with
4541 * ecore.cs (Expression): Add Clone method that calls the virtual
4542 CloneTo method. The current CloneTo method in Expression throws
4543 an exception so we can track down all the places where this must
4544 be implemented (not using abstract, because that would be a lot of
4545 up-front-work before we can start testing the implementation
4548 Important: we only need Clone capabilities for expressions created
4549 by the parser, as the expressions we will be cloning are
4550 expressions in the pre-resolved state. This vastly simplifies
4553 (SimpleName): Add CloneTo that does nothing.
4554 (EmptyCast): Add CloneTo.
4556 * expression.cs (Binary): Implement CloneTo.
4557 (Invocation.IsApplicable): Store the current ec in
4558 EmitContext.TempEc and restore it on return. This is used so we
4559 do not have to sprinkle hundres of methods with an extra
4560 EmitContext, we know that the only user is the lambda expression
4561 ImplicitConversionExists code.
4563 (Argument): Add Cloning capabilities.
4564 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
4565 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
4566 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
4567 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
4568 IndexerAccess): Add Clone capability.
4570 (LocalVariableReference, This): TODO: needs cloned Block mapping.
4572 (Argument): Add cloning capability.
4574 * assign.cs (Assign): Implement CloneTo.
4576 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
4578 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
4579 version by calling Convert with the EmitContext (that we are
4580 currently storing in ec, this is not great, but will do for now,
4581 to avoid passing EmitContext parameters to hundreds of functions
4582 that do not need them now).
4584 (SetExpression): Remove, it is not needed.
4586 (ContextualReturn): Implement CloneTo.
4588 * statement.cs (Statement): Implement cloning infrastructure,
4589 similar to expressions.
4591 (Block): Partial implementation of Clone for statements.
4593 (Return): Implement clone.
4595 * constant.cs (Constant.CloneTo): New method, does nothing.
4597 * codegen.cs (TempEc): Add a static EmitContext as a temporary
4598 solution, until we decide how to exactly do this.
4600 2007-02-14 Marek Safar <marek.safar@gmail.com>
4602 A fix for bug #80493
4603 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
4604 a property is override we need to use second accessor.
4606 2007-02-13 Marek Safar <marek.safar@gmail.com>
4608 A fix for bug #80418
4609 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
4612 2007-02-13 Marek Safar <marek.safar@gmail.com>
4614 Another fix for bug #80749
4615 * pending.cs: Abstract class has priority over interfaces.
4617 2007-02-13 Marek Safar <marek.safar@gmail.com>
4619 Another fix for bug #80749
4620 * pending.cs: Abstract class has priority over interfaces.
4622 2007-02-13 Marek Safar <marek.safar@gmail.com>
4624 Another fix for bug #80749
4625 * pending.cs: Abstract class has priority over interfaces.
4627 2007-02-13 Marek Safar <marek.safar@gmail.com>
4629 Another fix for bug #80749
4630 * pending.cs: Abstract class has priority over interfaces.
4632 2007-02-13 Marek Safar <marek.safar@gmail.com>
4634 * class.cs Better error message.
4636 * driver.cs: Add shorter versions of -optimize option.
4638 2007-02-13 Martin Baulig <martin@ximian.com>
4640 * class.cs (Constructor.Emit): Check the return value of
4641 ec.ResolveTopBlock() and return on error.
4643 2007-02-13 Raja R Harinath <rharinath@novell.com>
4645 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
4646 message to fix error message regression.
4648 2007-02-12 Marek Safar <marek.safar@gmail.com>
4650 * delegate.cs: Delegate creation expression cannot be of Nullable type.
4652 2007-02-12 Marek Safar <marek.safar@gmail.com>
4654 A fix for bug #80749
4655 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
4656 its parent container.
4658 * class.cs (DefineFieldInitializers): Each initializer can has different
4661 * const.cs: Updated.
4663 2007-02-11 Miguel de Icaza <miguel@novell.com>
4665 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
4666 now all the heavy lifting to check that embedded statements or
4667 expressions have the right form is done in the ContextualReturn.
4669 (ContextualReturn): New class.
4671 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
4672 method that can be invoked to report 201, so we do not replicate
4675 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
4677 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
4678 treating tabs as spaces.
4680 2007-02-09 Marek Safar <marek.safar@gmail.com>
4682 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
4683 * assign.cs: Use full implicit conversion for right side check.
4685 2007-02-09 Marek Safar <marek.safar@gmail.com>
4687 * statement.cs (Switch): Switch over boolean type is not standardized.
4689 2007-02-08 Marek Safar <marek.safar@gmail.com>
4691 A fix for bug #80755
4692 * decl.cs (FindBaseEvent): Don't use method cache for events.
4694 2007-02-07 Marek Safar <marek.safar@gmail.com>
4696 * cs-parser.jay: Better syntax error handling.
4698 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
4699 instead of underlying type value.
4701 2007-02-06 Marek Safar <marek.safar@gmail.com>
4703 * driver.cs: Check define identifier before is registered.
4705 * namespace.cs: Use existing error message.
4707 * report.cs: New warning.
4709 2007-02-06 Marek Safar <marek.safar@gmail.com>
4711 A fix for bug #80742
4712 * expression.cs: Delegate Invoke method can be called directly.
4714 2007-02-06 Marek Safar <marek.safar@gmail.com>
4716 A fix for bug #80676
4717 * class.cs (IsEntryPoint): The Main method can have params modifier.
4719 2007-02-04 Miguel de Icaza <miguel@novell.com>
4721 * parameter.cs (Parameter, Parameters): Add Clone method.
4723 * anonymous.cs (Compatible): Turn method into virtual method, so
4724 LambdaExpression can implement a different behavior.
4726 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
4727 out the basic checking here, so it can be used by
4730 * lambda.cs: Introduce "Compatible" function that will do the
4733 2007-02-02 Marek Safar <marek.safar@gmail.com>
4735 * attribute.cs: Unified one error message.
4737 * class.cs (Class): Use type attributes and not properties to test static
4739 (IsEntryPoint): Don's pass local variable.
4741 * convert.cs: Removed duplicate check.
4743 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
4745 * driver.cs: Don't crash when soft reference does not exist.
4747 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
4748 (UsingEntry): Removed redundant allocation.
4750 * parameter.cs: Add fast path for type parameters.
4752 * support.cs: Don't allocate attribute when it's not used.
4754 2007-01-30 Miguel de Icaza <miguel@novell.com>
4757 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
4758 this into a virtual method, so we can override it in LambdaExpression.
4760 * driver.cs: Improve diagnostics in case of failure.
4762 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
4763 write a function that is slightly more complex and that parses:
4765 type identifier [, type identifier]* )
4767 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
4770 (canEmpty ? i >= 0 : i > 0)
4772 2007-01-30 Raja R Harinath <rharinath@novell.com>
4774 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
4775 exception on possibly valid code.
4777 2007-01-29 Raja R Harinath <rharinath@novell.com>
4779 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
4781 (parse_opt_type_arguments): Remove. It's almost the same as
4783 (parse_namespace_or_typename): Use parse_less_than.
4785 2007-01-28 Miguel de Icaza <miguel@novell.com>
4787 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
4788 this bug took a few hours to find, because the state saved and
4789 restored by PushPosition and PopPosition was ignoring the state of
4790 parse_generic_less_than.
4792 I can also now remove the handling of OP_LT and OP_GT, this solves
4795 * cs-tokenizer.cs: store the location for the ARROW token, we use
4798 (PushPosition, PopPosition): save/restore also `current_token',
4799 restore `parse_generic_less_than' (was missing).
4801 (parse_opt_type_arguments): use parse_type, not
4802 parse_namespace_or_typename to parse types.
4804 * lambda.cs: Empty new file, will eventually have the lambda
4805 expression implementation.
4807 * lambda.test: used to test the internal tokenizer.
4809 * report.cs (FeatureIsNotISO1): Rename from
4810 FeatureIsNotStandardized, because it was about the language level
4811 (1 vs 2) it was not about standarization.
4813 (FeatureRequiresLINQ): New.
4815 * support.cs (SeekableStreamReader): Only require that the reader
4816 is a TextReader, not a StreamReader, so we can plug StringReader.
4818 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
4819 given position in the input stream the following tokens can be
4820 parsed as a type followed by an identifier.
4822 (is_punct): after a '(' if parse_type_and_parameter returns true,
4823 then return a special token OPEN_PARENS_LAMBDA which is used to
4824 avoid reduce/reduce errors in the grammar for the
4825 lambda_expression rules.
4827 (parse_type): implement a type parser inside the
4828 tokenizer, the parser only returns true or false depending on
4829 whether the input at a given position can be parsed as a type.
4831 (peek_token): new method used during type parsing.
4833 2007-01-28 Raja R Harinath <rharinath@novell.com>
4836 * anonymous.cs (ScopeInfo.InflateParameters): New.
4837 (AnonymousContainer.Resolve): Use it to redirect types of
4838 delegate parameters.
4840 2007-01-27 Raja R Harinath <rharinath@novell.com>
4843 * expression.cs (Error_InvalidArguments): Don't use two different
4844 messages for CS1503. Use ExtraInformation and
4845 SymbolRelatedToPreviousError instead.
4848 * decl.cs (DeclSpace.initialize_type_params): Don't access
4849 'type_params' of a partial class directly.
4851 2007-01-26 Miguel de Icaza <miguel@novell.com>
4853 * constant.cs: Removed a handful of out-of-range checks that were
4856 2007-01-25 Marek Safar <marek.safar@gmail.com>
4858 * expression.cs (CheckUselessComparison): Add additional check for char
4861 * namespace.cs: Fixed typo.
4863 2007-01-23 Miguel de Icaza <miguel@novell.com>
4865 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
4866 gone, instead we inline the test, preventing the needless casts to
4867 longs, ulongs and doubles for the parameters, avoiding calls to
4868 methods that overchecked stuff, and instead inlined things
4871 2007-01-20 Marek Safar <marek.safar@gmail.com>
4873 * cs-parser.jay: Better parameter error handling.
4875 2007-01-17 Marek Safar <marek.safar@gmail.com>
4877 A fix for bug #80368, #80522
4878 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
4879 whether array initializer contains constants only.
4880 (ArrayCreation.Emit): Use better formula to decide when
4881 are array initializers for static initialization.
4882 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
4883 have to emit even constants otherwise they are pre-initialized.
4885 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
4886 Raja R Harinath <rharinath@novell.com>
4888 Fix emit order of 'get' vs. 'set'.
4889 * support.cs (Accessors): New.
4890 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
4891 Note the order in which accessors are declared in the source.
4892 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
4893 Refactored from Property.Define and Indexer.Define.
4894 (PropertyBase.DefineAccessors): New helper that calls the above in
4895 appropriate order as noted by the parser.
4896 (Property.Define, Indexer.Define): Update to changes.
4897 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
4899 2007-01-17 Raja R Harinath <rharinath@novell.com>
4901 Fix cs0029-6.cs and gcs0029-2.cs (regression)
4902 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
4903 there's an implicit conversion from the current type to the target
4904 type before converting the underlying constant.
4906 2007-01-16 Marek Safar <marek.safar@gmail.com>
4908 * const.cs (ResolveValue): Updated after constant conversion was made more
4911 * constant.cs (GetAttributableValue): constant to object conversion is
4912 used for attributes only.
4913 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
4914 constant conversions.
4915 (LongConstant.ConvertImplicitly): Ditto.
4917 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
4918 (ImplicitConversionStandard): Handle constant conversion as extra step.
4919 It solves the issue when constant conversion was called indirectly like
4920 inside array initializer and constant folding was skipped.
4922 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
4925 * statement.cs(ImplicitConversionStandard): Updated after constant
4926 conversion was made more generic.
4928 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
4930 * expression.cs (As.DoResolve): Use GenericConstraints instead of
4931 Constraints, solves the problem where the compiler incorrectly
4932 reported that a type parameter was not constrained to a class (Bug
4935 2007-01-14 Marek Habersack <grendello@gmail.com>
4937 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
4939 2007-01-14 Marek Safar <marek.safar@gmail.com>
4941 A fix for bug #80368
4942 * assign.cs (FieldInitializer): New class implements field
4943 initializer statement.
4945 * attribute.cs: Update after FieldMember rename.
4947 * class.cs (PropertyBasedMember): New common class for property based
4949 (InterfaceMemberBase): New base class for all members which can be used as
4950 an interface members.
4951 (MethodCore): Moved really common code to InterfaceMemberBase.
4952 (Method.Define): Equal and GetHasCode detection is relevant for methods
4954 (MethodData.Define): Don't assume that public event implements an
4955 interface automatically.
4956 (MethodData.DefineMethodBuilder): Issue an error even if only extern
4958 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
4959 (FieldMember): Merged with FieldBase.
4960 (EventProperty.AEventPropertyAccessor): New specialization to check whether
4961 event extern modifier can be used.
4962 (EventField.EventFieldAccessor): Moved event field specific code here.
4963 (Event.AllowedModifiers): Even event can be extern.
4964 (Event.FindOutBaseMethod): New override specific to events.
4965 (Indexer.parameters): Reintroduce parameters because base class holds
4966 only properties common data.
4967 (Indexer.CheckForDuplications): Indexers are threated as methods so we
4968 need do extra parameters check.
4970 * const.cs: Update after FieldMember rename.
4972 * decl.cs (MemberCache.FindBaseEvent): New method.
4974 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
4975 to reflect that indexer is now derived from PropertyBased.
4977 * ecore.cs (GetMemberType): Made public.
4978 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
4981 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
4983 * typemanager.cs (CSharpSignature): Correctly print event accessors.
4984 (RegisterEvent): Removed.
4985 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
4986 (GetPrivateFieldOfEvent): Renamed to GetEventField.
4988 2007-01-11 Raja R Harinath <rharinath@novell.com>
4991 * statement.cs (CollectionForeach.TryType): Prefer generic
4992 GetEnumerator over non-generic variant. Fix code to follow comments.
4994 2007-01-09 Raja R Harinath <rharinath@novell.com>
4997 * support.cs (ReflectionParameter): Don't use an invalid index on
4998 the generic parameter data.
5000 2007-01-08 Miguel de Icaza <miguel@novell.com>
5002 * driver.cs: Just add a tiny bit of infrastructure.
5004 2007-01-02 Marek Safar <marek.safar@gmail.com>
5006 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
5007 where field type is struct from current assembly.
5009 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
5012 2007-01-02 Marek Safar <marek.safar@gmail.com>
5014 A fix for bug #80381
5015 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
5018 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
5020 (Namespace.LookupType): Always use core types from corlib when speficied.
5022 * report.cs: A new warning.
5024 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
5025 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
5026 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
5028 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
5029 (InitCoreTypes): Set expression type of object_type and value_type
5030 immediately after lookup.
5032 2007-01-01 Miguel de Icaza <miguel@novell.com>
5034 * cs-tokenizer.cs: Accept Pc class characters (Connector
5035 Punctuation) as valid identifiers. Fixes #78259
5037 * expression.cs (Invocation.DoResolve): Moved the check for the
5038 use of `this' for doing method calls to the Invocation resolution
5039 step, after overload resolution has taken place instead of doing
5040 the check at the low-level `This.DoResolve' level.
5042 The `This.DoResolve'(appens before overload resolution, so it has
5043 no way of knowing if the method that will be called will be
5044 instace or static, triggering an erroneous report for cs0188 (Bug
5047 We now do the check for instance method invocations after we know
5048 what method will be called.
5050 (This.CheckThisUsage): Move the actual use of this structure
5051 checking into its own method and expose it.
5053 * Everywhere that called Error_ValueCannotBeConverted: pass a new
5056 Exceptions: Null.ConvertImplicitly,
5057 Constant.ImplicitConversionRequired as there are too many call
5058 sites for passing the ec.
5060 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
5061 EmitContext, if the value is null, then we do not try to provide
5062 the extra information from the error (If a userdefined conversion
5063 exists, as UserDefinedConversion requires a non null-EmitContext).
5067 2006-12-30 Raja R Harinath <rharinath@novell.com>
5069 * flowanalysis.cs (MyBitVector): Document some invariants.
5070 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
5071 introduced below, and add a couple of others,
5073 2006-12-30 Marek Safar <marek.safar@gmail.com>
5075 * attribute.cs (GetMethodObsoleteAttribute): Uses new
5076 GetPropertyFromAccessor and GetEventFromAccessor.
5078 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
5079 overrides non-obsolete one.
5080 (Indexer.Define): Error message has been moved to the parser.
5082 * cs-parser.jay: Better syntax errors handling.
5084 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
5085 when an invocation has no arguments.
5087 * ecore.cs: Removed not used caching.
5089 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
5092 * report.cs: Add a new warning.
5094 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
5096 * typemanager.cs (enumeration_type): Removed.
5097 (CSharpSignature): Reuses IsSpecialMethod.
5098 (IsEqual): Hack for MS BCL.
5099 (GetPropertyFromAccessor): New method.
5100 (GetEventFromAccessor): New method.
5101 (IsSpecialMethod): Fixed to handle more cases.
5103 2006-12-30 Marek Safar <marek.safar@gmail.com>
5105 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
5106 Made white spaces array static.
5108 * ecore.cs (RemoveGenericArity): Optimized.
5110 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
5112 (MyBitVector.initialize_vector): Simplified.
5114 2006-12-22 Miguel de Icaza <miguel@novell.com>
5116 * ecore.cs: Am not entirely happy with this hack, but it seems to
5117 address the issue in 80257 (a small test case for
5120 I set the MethodGroupExpr.Type to an internal compiler type
5121 (itself in this case) to force the resolution to take place. Why
5122 it does not take place with a null is beyond me.
5124 2006-12-20 Marek Safar <marek.safar@gmail.com>
5126 A fix for bug #80288
5127 * expression.cs (ResolveOperator): Consider user defined conversion for
5128 logical and operator too.
5129 (EmitBranchable): Optimization for logical and when full constant folding
5130 could not be applied but one operand is constant.
5132 2006-12-19 Marek Safar <marek.safar@gmail.com>
5134 * class.cs (GetClassBases): Write 5 times every day, will never use
5135 FullName for error reporting.
5137 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
5139 2006-12-19 Martin Baulig <martin@ximian.com>
5141 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
5142 the symbol file info here.
5144 2006-12-18 Marek Safar <marek.safar@gmail.com>
5146 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
5147 of `elseif' is taking then following sections are not taking.
5148 Fixes an issue reported on mono mailing list.
5150 2006-12-18 Marek Safar <marek.safar@gmail.com>
5152 A fix for bug #80300
5153 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
5154 a caller is not taking.
5156 2006-12-18 Raja R Harinath <rharinath@novell.com>
5158 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
5159 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
5160 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
5161 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
5162 * class.cs: Update to changes.
5164 2006-12-17 Marek Safar <marek.safar@gmail.com>
5166 A fix for bug #79934
5167 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
5170 * class.cs (ResolveMembers): Register an iterator in current container and
5173 2006-12-16 Raja R Harinath <rharinath@novell.com>
5176 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
5177 satisfy a params annotated parameter.
5179 2006-12-16 Marek Safar <marek.safar@gmail.com>
5181 A fix for bug #77014
5182 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
5183 paramters correctly and not rely on hacks in Parameters class.
5184 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
5186 (Invocation.VerifyArgumentsCompat): Ditto.
5187 (Invocation.EmitArguments): Changed to correctly emit params arguments at
5190 * parameter.cs (HasParams): Don't assume that params is the last one.
5192 * support.cs (ReflectionParameters.ctor): Look for params attribute
5194 (ReflectionParameters.ParameterType): Removed hack when we returned last
5195 parameter for out of range parameters.
5196 (ParameterName, ParameterModifier): Ditto.
5198 2006-12-14 Marek Safar <marek.safar@gmail.com>
5200 A fix for bug #79987
5201 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
5202 when assembly is not CLS compliant but type is. I have no idea why is this
5205 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
5207 2006-12-13 Miguel de Icaza <miguel@novell.com>
5209 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
5210 in struct constructors, they are basically no-ops.
5212 2006-12-12 Marek Safar <marek.safar@gmail.com>
5214 * cs-tokenizer.cs (Position): Save preprocessor status too.
5216 2006-12-12 Marek Safar <marek.safar@gmail.com>
5218 A fix for bug #77794
5219 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
5221 2006-12-12 Marek Safar <marek.safar@gmail.com>
5223 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
5225 (pp_expr): Report error for an invalid expression.
5226 (handle_preprocessing_directive): Simplified; add more error checking.
5228 2006-12-11 Marek Safar <marek.safar@gmail.com>
5230 A fix for bug #74939
5231 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
5232 directives handling.
5234 2006-12-10 Marek Safar <marek.safar@gmail.com>
5236 A fix for bugs #80093, and #75984
5237 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
5238 logic, it seems to me as it worked before "by coincidence".
5239 (xtoken): Simplified to use reworked handle_preprocessing_directive.
5240 (cleanup): Enabled endif check.
5242 2006-12-09 Marek Safar <marek.safar@gmail.com>
5244 A fix for bug #80162
5245 * statement.cs (CollectionForeach.TryType): Generics and non-generics
5246 enumerators are never ambiguous.
5248 2006-12-08 Raja R Harinath <rharinath@novell.com>
5251 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
5253 2006-12-06 Marek Safar <marek.safar@gmail.com>
5255 A fix for bug #80144
5256 * class.cs (EventProperty.Define): Explicit implementation means
5257 that an even is used.
5259 2006-12-06 Marek Safar <marek.safar@gmail.com>
5261 Fixes the operators implementation (part II)
5263 * cfold.cs (DoConstantNumericPromotions): Renamed to
5264 DoBinaryNumericPromotions and simplified.
5265 (BinaryFold): Couple of conversion fixes; simplified.
5267 * constant.cs, ecore.cs, literal.cs
5268 (ToType): Renamed to ConvertImplicitly.
5269 (Reduce): Renamed to ConvertExplicitly.
5271 * class.cs, convert.cs: Updated.
5273 * expression.cs: TryReduce doesn't throw an exception.
5275 2006-12-01 Marek Safar <marek.safar@gmail.com>
5277 A fix for bug #80108
5278 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
5281 2006-11-30 Marek Safar <marek.safar@gmail.com>
5283 Fixes unary operators implementation (part I)
5286 * cfold.cs (Error_CompileTimeOverflow): Made internal
5288 * const.cs (IConstant): Changed to use reference to constant and
5289 not constant itself.
5290 Updated IConstant implementations.
5292 * constant.cs (CreateConstant): New factory method.
5293 Updated IConstant implementation.
5295 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
5297 * ecore.cs: Updated to use CreateConstantReference.
5299 * enum.cs: Reflects IConstant changes.
5301 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
5303 * literal.cs (NullConstant): Change to be independently usable.
5305 2006-11-29 Martin Baulig <martin@ximian.com>
5307 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
5308 we need to emit the scope initializer before calling the base .ctor.
5310 * anonymous.cs: Merged back from the new anonymous methods branch.
5311 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
5313 * expression.cs (ParameterReference.DoResolveBase): Create a
5314 "normal" ScopeInfo when capturing parameters rather than using the
5315 root scope; this makes things work with anonymous methods having
5319 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
5321 2006-11-22 Marek Safar <marek.safar@gmail.com>
5323 A fix for bug #79987
5324 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
5325 check to a base class.
5326 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
5327 only when assembly has missing attribute.
5328 * report.cs: Update.
5330 2006-11-21 Marek Safar <marek.safar@gmail.com>
5332 * cs-tokenizer.cs: Merged with gmcs version.
5334 2006-11-20 Marek Safar <marek.safar@gmail.com>
5337 * cs-parser.jay: Better error message when partial keyword is misplaced.
5339 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
5341 A fix for bug #79810
5342 report.cs: CS1058 only applies to 2.0 profile (gmcs).
5343 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
5344 a RuntimeWrappedException by default.
5346 2006-11-18 Marek Safar <marek.safar@gmail.com>
5348 A fix for bug #79843
5349 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
5351 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
5353 2006-11-18 Marek Safar <marek.safar@gmail.com>
5355 * driver.cs, namespace.cs: Uses faster IndexOf version.
5357 2006-11-17 Marek Safar <marek.safar@gmail.com>
5359 A fix for bug #79941
5360 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
5362 (Operator.Define): Implicit/Explicit operator of same type is duplicate
5363 even if internal name is different.
5364 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
5365 (UserDefinedConversion): Simplified as the operators cannot be internal.
5366 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
5368 (MethodLookup): Replaced EmitContext with parentType.
5369 * expression.cs: Updated.
5371 2006-11-09 Raja R Harinath <rharinath@novell.com>
5373 * driver.cs (BadAssembly): Handle all the ugliness of
5374 DefineDynamicAssembly.
5376 2006-11-08 Raja R Harinath <rharinath@novell.com>
5378 Address parts of #58244 -- most of what's left is in the runtime
5379 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
5380 CS1509 error checks, and handle them for all assembly loads, not
5381 just the first invocation.
5382 (LoadModule): Likewise. Move handling of 'adder_method' ...
5383 * codegen.cs (AssemblyClass.AddModule): ... here.
5385 2006-11-02 Marek Safar <marek.safar@gmail.com>
5387 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
5388 IEnumerable<T> is ambiguous.
5390 2006-10-31 Marek Safar <marek.safar@gmail.com>
5392 A fix for bug #67689
5393 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
5394 GetEnumerator is ambiguous.
5396 * report.cs: Add new warning.
5398 2006-10-29 Marek Safar <marek.safar@gmail.com>
5400 A fix for bug #78602
5401 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
5402 to protected member can be nested type.
5404 2006-10-28 Marek Safar <marek.safar@gmail.com>
5406 A fix for bug #78965
5407 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
5408 to protected member must derive from current type.
5410 2006-10-27 Marek Safar <marek.safar@gmail.com>
5412 assign.cs: Reuses error method.
5414 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
5415 instead of type for constants.
5416 (Expression.Error_ValueAssignment): Common error method.
5418 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
5421 2006-10-27 Marek Safar <marek.safar@gmail.com>
5423 A fix for bug #79081
5424 * expression.cs (MemberAccess.DoResolve): Check nested type
5427 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
5429 * doc.cs : nested delegates were not handled. Fixed bug #79754.
5431 2006-10-26 Marek Safar <marek.safar@gmail.com>
5433 A fix for bug #76591
5434 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
5436 2006-10-26 Marek Safar <marek.safar@gmail.com>
5438 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
5439 type forwarder of the same type multiple times.
5441 2006-10-26 Raja R Harinath <rharinath@novell.com>
5444 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
5445 instance as an rvalue, even when we later resolve as an lvalue.
5447 2006-10-25 Martin Baulig <martin@ximian.com>
5449 * anonymous.cs: Fix #79673.
5451 2006-10-24 Marek Safar <marek.safar@seznam.cz>
5453 A fix for bug #79666
5454 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
5455 ignored when is optimized (= default value) as its value is already set.
5457 2006-10-23 Marek Safar <marek.safar@seznam.cz>
5459 A fix for bug #79724
5460 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
5461 TypeContainer for type lookup.
5463 2006-10-23 Marek Safar <marek.safar@seznam.cz>
5465 A fix for bug #79231
5466 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
5467 * expression.cs (OverloadResolve): Always convert type name for
5469 (ResolveNamespaceOrType): Don't confuse a nested type with any
5472 2006-10-18 Martin Baulig <martin@ximian.com>
5474 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
5476 2006-10-17 Miguel de Icaza <miguel@novell.com>
5478 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
5479 an int32, but requesting an int64 from the conversion
5481 2006-10-12 Martin Baulig <martin@ximian.com>
5484 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
5486 2006-10-12 Martin Baulig <martin@ximian.com>
5489 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
5491 2006-10-11 Miguel de Icaza <miguel@novell.com>
5493 * convert.cs: Remove broken code: I was doing the "Existance"
5494 tests for Implicit conversions.
5496 2006-10-10 Miguel de Icaza <miguel@novell.com>
5498 * convert.cs: Added one missing case in
5499 ImplicitStandardConversionExists uint64 to intptr.
5503 * typemanager.cs (uintptr_type): another core known type.
5505 * ecore.cs (OperatorCast): routine used to do cast operations that
5506 depend on op_Explicit. We could change some of the Decimal
5507 conversions to use this.
5509 This one has a probe mechanism that checks both types for an op_
5510 which it coudl be used to eliminate two classes: CastToDecimal
5511 and CastFromDecimal.
5513 * convert.cs: Implement the conversions documented in #59800
5515 2006-10-10 Martin Baulig <martin@ximian.com>
5517 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
5518 before RootScope.ResolveMembers().
5520 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
5521 `CurrentType' if appropriate.
5523 2006-10-09 Marek Safar <marek.safar@seznam.cz>
5525 A fix for bug #78568
5526 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
5527 when contains binary operators.
5528 * cs-parser.jay: Updated.
5530 2006-10-09 Martin Baulig <martin@ximian.com>
5533 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
5534 moved that into Define() and also do the other type parameter
5535 checks there. Fixes #79094. Added gtest-292.cs.
5538 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
5539 since that doesn't include type parameters; don't use `Ldelema'
5540 for type parameters. Fixes #78980. Added gtest-293.cs.
5542 2006-10-08 Marek Safar <marek.safar@seznam.cz>
5545 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
5546 conversion is allowed.
5548 2006-10-06 Marek Safar <marek.safar@seznam.cz>
5550 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
5551 error reporting when no error occurs.
5553 2006-10-06 Marek Safar <marek.safar@seznam.cz>
5555 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
5558 2006-10-06 Raja R Harinath <rharinath@novell.com>
5561 * class.cs (DefineTypeBuilder): Check circular dependencies before
5562 setting the parent of the TypeBuilder.
5563 (CheckRecursiveDefinition): Don't use 'BaseType', since
5564 it may not be valid until after DefineTypeBuilder. Use
5565 'base_type' instead.
5567 2006-10-04 Martin Baulig <martin@ximian.com>
5569 Merged the Anonymous Methods patch.
5571 * anonymous.cs, iterators.cs: The new anonymous methods code.
5573 * statement.cs (Variable): New public abstract class.
5574 (LocalInfo.Variable): New public property.
5575 (LocalInfo.ResolveVariable): New public method.
5576 (Block.Flags): Add `IsIterator'.
5577 (Block.AddVariable): Improved the CS0136 check.
5578 (Block.AnonymousChildren): New public property.
5579 (Block.AddAnonymousChild): New public method.
5580 (ToplevelBlock): Update to use the new anonymous method framework.
5581 (ToplevelBlock.ctor): `container' is now a `Block' and not a
5582 `ToplevelBlock'; this is required to correctly implement the
5584 (Fixed, Using): Use `TemporaryVariable' instead of directly
5585 creating the `LocalBuilder'.
5587 * parameter.cs (Parameter.ResolveVariable): New public method.
5588 (Parameters.ResolveVariable): Likewise.
5590 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
5592 * class.cs (TypeContainer): Replaced the `iterators' list and
5593 corresponding methods with a list of `CompilerGeneratedClass'es.
5594 (TypeContainer.ResolveMembers): New public method.
5595 (Method): `IIteratorContainer' has been replaced by
5598 * expression.cs (VariableReference): New public abstract base
5599 class for `LocalVariableReference', `ParameterReference' and
5602 * codegen.cs (EmitContext): Removed `capture_context',
5603 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
5604 (EmitContext.EmitThis): Removed.
5606 * cs-parser.jay: Replace `iterator_container' with
5609 2006-10-04 Martin Baulig <martin@ximian.com>
5611 * generic.cs (GenericMethod): Don't make this abstract.
5612 (Constraints.Clone): Added dummy implementation.
5614 2006-10-04 Raja R Harinath <harinath@gmail.com>
5617 * namespace.cs (LookForAnyGenericType): Avoid nullref on
5618 'declspaces'. Avoid allocating arrays willy-nilly.
5621 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
5622 cases out of the switch.
5624 2006-09-28 Marek Safar <marek.safar@seznam.cz>
5626 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
5627 message when non-generic type is used with the type arguments.
5628 * expression.cs: Updated.
5630 2006-09-28 Raja R Harinath <rharinath@novell.com>
5633 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
5634 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
5635 Change semantics slightly. Don't insist on having only one
5636 temporary EmptyExpression -- just throttle the creation of new ones.
5639 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
5640 non-interfaces too. If no methods are found, don't try to create
5643 2006-09-28 Marek Safar <marek.safar@seznam.cz>
5645 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
5648 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
5649 us produce better error message.
5651 2006-09-27 Marek Safar <marek.safar@seznam.cz>
5653 * expression.cs (Binary.ResolveOperator): Warn about a side effect
5654 of the `|' operator.
5656 * report.cs: A new warning added.
5658 2006-09-27 Martin Baulig <martin@ximian.com>
5660 * generic.cs (GenericMethod): Don't make this abstract.
5662 2006-09-27 Martin Baulig <martin@ximian.com>
5665 (InternalErrorException): Added overloaded ctor taking a params array.
5667 2006-09-26 Marek Safar <marek.safar@seznam.cz>
5669 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
5670 Fixed the cases when same error was reported twice.
5672 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
5673 now report symbol information.
5675 2006-09-25 Martin Baulig <martin@ximian.com>
5677 * class.cs: Completely unified with the gmcs version.
5679 2006-09-25 Martin Baulig <martin@ximian.com>
5681 * typemanager.cs (TypeManager.IsNullableType): New public function.
5682 (TypeManager.IsNullableTypeOf): Likewise.
5683 (TypeManager.IsNullableValueType): Likewise.
5685 * class.cs (MethodCore): Added the `GenericMethod' argument from
5686 gmcs and also unified all classes derived from `MethodCore' with gmcs.
5688 2006-09-24 Raja R Harinath <harinath@gmail.com>
5690 * convert.cs: Unify with gmcs version.
5692 2006-09-24 Marek Safar <marek.safar@seznam.cz>
5694 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
5695 verify them as well.
5697 * report.cs: New warning.
5699 2006-09-24 Marek Safar <marek.safar@seznam.cz>
5701 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
5702 for anonymous block with out argument.
5704 2006-09-24 Marek Safar <marek.safar@seznam.cz>
5706 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
5707 not used private events only.
5709 2006-09-23 Marek Safar <marek.safar@seznam.cz>
5711 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
5713 * const.cs (Const.Define): Check for constant type.
5714 (Const.IsConstantTypeValid): Looks for valid constant types.
5716 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
5718 * ecore.cs (EmptyConstantCast): New common class for all constant based
5721 * expression.cs (Is.DoResolve): Handle null constant especially.
5722 (New.DoResolve): Check for new void().
5723 (MemberAccess.DoResolve): Cope with all kind of nulls.
5725 * literal.cs (NullConstant): Uses EmptyConstantCast.
5726 (NullDefault): Based on EmptyConstantCast.
5727 (NullLiteral): Uses EmptyConstantCast.
5729 * statement.cs (Block.ResolveMeta): Check for constant type.
5731 2006-09-22 Martin Baulig <martin@ximian.com>
5733 * delegate.cs, attribute.cs: Merged with the gmcs versions.
5735 2006-09-22 Raja R Harinath <rharinath@novell.com>
5737 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
5741 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
5742 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
5745 2006-09-22 Martin Baulig <martin@ximian.com>
5747 * ecore.cs: Merged with the gmcs version.
5749 * generic.cs (ConstructedType): New dummy class.
5750 (TypeArguments): Don't make this abstract.
5753 (TypeManager.IsGenericTypeDefinition): New method.
5754 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
5756 2006-09-22 Raja R Harinath <rharinath@novell.com>
5758 * expression.cs (ComposedCast): Check for arrays of TypedReference
5759 before creating the type, not after.
5761 2006-09-21 Marek Safar <marek.safar@seznam.cz>
5763 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
5764 after ToType change.
5766 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
5767 when constant must be implicitly convertible.
5769 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
5771 * ecore.cs (NullCast): Derives from NullConstant.
5773 * expression.cs (Is.DoResolve): Removed useless variables.
5774 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
5775 (New.Constantify): Add enum support.
5776 (MemberAccess.DoResolve): Add warning when accessing null constant or
5779 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
5782 * literal.cs (NullConstant): New abstract class with common
5783 functionality for all null specializations.
5784 (NullDefault): Represents default(X) when result can be
5786 (NullLiteral): Updated.
5788 * report.cs: Add new warning.
5790 2006-09-21 Martin Baulig <martin@ximian.com>
5792 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
5794 2006-09-21 Martin Baulig <martin@ximian.com>
5796 * generic.cs (GenericConstraints): New dummy class.
5797 (Constraints): Likewise.
5798 (TypeParameter): Likewise.
5799 (TypeParameterName): Likewise.
5800 (GenericMethod): Likewise.
5802 * typemanager.cs (TypeManager.GetGenericArguments): New method.
5804 * decl.cs: Merged with the gmcs version.
5806 2006-09-21 Raja R Harinath <rharinath@novell.com>
5808 * generic.cs (TypeParameter): Implement IMemberContainer.
5809 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
5811 * rootcontext.cs: Unify with gmcs version.
5813 * report.cs: Unify with gmcs version.
5814 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
5815 from gmcs/generics.cs.
5816 * generics.cs (TypeParameter): New dummy class.
5818 * support.cs: Unify with gmcs version.
5820 2006-09-20 Raja R Harinath <rharinath@novell.com>
5822 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
5823 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
5825 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
5826 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
5827 * mcs.exe.sources: Add generic.cs.
5829 * codegen.cs: Unify with gmcs version.
5831 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
5832 (EmitContext): Add GenericDeclContainer implementation.
5833 * decl.cs (MemberCore, DeclSpace): Likewise.
5834 * namespace.cs: Remove #ifdef GMCS_SOURCE.
5836 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
5837 MCS TypeManager has a corresponding dummy method.
5839 2006-09-19 Martin Baulig <martin@ximian.com>
5841 * expression.cs: Completely merged with the gmcs version.
5843 2006-09-19 Martin Baulig <martin@ximian.com>
5845 * expression.cs (Invocation): Merged with the gmcs version.
5846 (ArrayAccess.GetStoreOpcode): Likewise.
5848 2006-09-19 Martin Baulig <martin@ximian.com>
5851 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
5852 (TypeManager.IsGenericMethodDefinition): Likewise.
5854 2006-09-19 Martin Baulig <martin@ximian.com>
5857 (TypeManager.IsEqual): Moved the gmcs implementation here.
5858 (TypeManager.DropGenericTypeArguments): Likewise.
5859 (TypeManager.DropGenericMethodArguments): Likewise.
5860 (TypeManager.GetTypeArguments): Moved here from gmcs.
5861 (TypeManager.HasGenericArguments): Likewise.
5863 2006-09-19 Martin Baulig <martin@ximian.com>
5865 * expression.cs (Binary): Merged with the gmcs version.
5867 2006-09-19 Martin Baulig <martin@ximian.com>
5869 * expression.cs (Probe, As, Is): Merged with the gmcs version.
5871 2006-09-19 Martin Baulig <martin@ximian.com>
5873 * typemanager.cs: Merged with the gmcs version.
5875 2006-09-16 Raja R Harinath <rharinath@novell.com>
5877 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
5878 * driver.cs: Likewise.
5880 2006-09-16 Marek Safar <marek.safar@seznam.cz>
5883 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
5884 only if parent type is class.
5885 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
5888 2006-09-15 Marek Safar <marek.safar@seznam.cz>
5891 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
5893 * typemanager.cs(CSharpName): Converts NullType to null.
5895 2006-09-15 Martin Baulig <martin@ximian.com>
5898 (TypeManager.GetMethodName): Added mcs implementation.
5899 (TypeManager.IsEqual): Likewise.
5902 (SimpleName.RemoveGenericArity): Added dummy implementation.
5904 * pending.cs: Merged with the gmcs version.
5906 2006-09-15 Martin Baulig <martin@ximian.com>
5908 * statement.cs: Merge with the gmcs version.
5910 2006-09-15 Martin Baulig <martin@ximian.com>
5912 * statement.cs (Switch): Merge with the gmcs implementation
5913 (without nullables), which is newer.
5915 2006-09-15 Martin Baulig <martin@ximian.com>
5917 * statement.cs (Block.Variables): Make this public.
5918 (ToplevelBlock.Parameters): Make this a property.
5919 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
5921 2006-09-15 Martin Baulig <martin@ximian.com>
5923 * namespace.cs: Merge with the gmcs version.
5925 2006-09-15 Martin Baulig <martin@ximian.com>
5927 * decl.cs (MemberName): Minor code cleanups.
5929 2006-09-15 Martin Baulig <martin@ximian.com>
5931 * parameter.cs: Merge with the gmcs version.
5933 2006-09-15 Martin Baulig <martin@ximian.com>
5935 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
5936 and an error in mcs.
5938 2006-09-15 Martin Baulig <martin@ximian.com>
5940 * flowanalysis.cs: Merged from GMCS; added the generics code into
5941 a `GMCS_SOURCE' conditional so we can share this file.
5943 2006-09-08 Martin Baulig <martin@ximian.com>
5945 * typemanager.cs (TypeManager.interlocked_type): New public field.
5946 (TypeManager.int_interlocked_compare-exchange): New public field.
5947 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
5948 enumerator types here and call InitGenericCoreTypes().
5949 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
5950 after calling InitEnumUnderlyingTypes().
5953 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
5954 `classes_second_stage'.
5956 2006-09-14 Marek Safar <marek.safar@seznam.cz>
5958 * assign.cs, ecore.cs, expression.cs: Share error message text.
5959 * class.cs (FieldMember.Define): Check for varible of static type.
5960 * driver.cs (LoadAssembly): Uses error output for errors.
5961 * statement.cs: Updated.
5963 2006-09-08 Marek Safar <marek.safar@seznam.cz>
5965 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
5968 2006-09-07 Martin Baulig <martin@ximian.com>
5971 (MainDriver): Revert r62663 from Marek; see #70506 for details.
5973 2006-08-29 Miguel de Icaza <miguel@novell.com>
5975 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
5977 2006-08-17 Miguel de Icaza <miguel@novell.com>
5979 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
5980 #52019 and #79064, the use of the \uXXXX sequence in source code
5981 to represent unicode characters.
5983 2006-08-15 Marek Safar <marek.safar@seznam.cz>
5985 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
5987 * class.cs, ecore.cs, statement.cs: Merged to one error message.
5989 2006-08-13 Miguel de Icaza <miguel@novell.com>
5991 * assign.cs: Catch attempts to assign to a method groups in += and
5994 2006-08-13 Marek Safar <marek.safar@seznam.cz>
5997 * cs-parser.jay: Don't destroy current array type by typeof of array's.
5999 2006-08-12 Marek Safar <marek.safar@seznam.cz>
6001 * class.cs (Method.Define): Issue a warning when generic method looks like
6003 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
6006 2006-08-09 Marek Safar <marek.safar@seznam.cz>
6008 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
6010 * decl.cs (MemberCache.FindMembers): When container is interface we need to
6011 search all base interfaces as a member can be ambiguous.
6012 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
6013 Constructor member type filter.
6014 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
6015 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
6016 reporting for returned memberinfos.
6017 * report.cs: Updated.
6018 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
6019 version to work on all runtimes.
6020 (TypeManager.RealMemberLookup): Removed members filtering.
6022 2006-08-08 Raja R Harinath <rharinath@novell.com>
6024 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
6025 (PropertyExpr.EmitAssign): Likewise.
6026 * expression.cs (Indirection.EmitAssign): Likewise.
6027 (LocalVariableReference.EmitAssign): Likewise.
6028 (ParameterReference.EmitAssign): Likewise.
6029 (Invocation.EmitArguments): Likewise.
6030 (ArrayAccess.EmitAssign): Likewise.
6031 (IndexerAccess.EmitAssign): Likewise.
6032 (This.EmitAssign): Likewise.
6033 (ConditionalLogicalOperator.Emit): Likewise.
6036 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
6037 instead of ArrayList. If the hashtable has a LocalBuilder, don't
6038 leave it in after returning it.
6039 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
6041 2006-08-06 Marek Safar <marek.safar@seznam.cz>
6043 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
6046 2006-08-03 Raja R Harinath <rharinath@novell.com>
6048 Fix cs0146-3.cs and cs0146-4.cs.
6049 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
6050 enclosing types don't depend on the current type.
6052 2006-08-02 Raja R Harinath <rharinath@novell.com>
6055 * class.cs (TypeContainer.DoDefineMembers): Use
6056 FindBaseMemberWithSameName on Parent, since we're interested in
6057 whether we hide inherited members or not.
6058 (FindBaseMemberWithSameName): Make slightly more robust.
6060 Fix the non-generic testcase from #77396
6061 * decl.cs (DeclSpace.DeclContainer): Remove override.
6063 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
6064 declspaces for doppelgangers too.
6065 (UsingEntry): Implement IResolveContext.
6066 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
6067 'this' as the resolve context.
6068 (LocalAliasEntry): Likewise.
6070 Implement parts of #77403
6071 * roottypes.cs (RootDeclSpace): New. Used to represent the
6072 toplevel declaration space. Each namespace declaration introduces
6073 a "partial" root declaretion space.
6074 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
6075 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
6076 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
6077 from 'current_namespace.SlaveDeclSpace'.
6078 (namespace_declaration): Likewise.
6079 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
6080 check. It can't happen now.
6081 * decl.cs (DeclSpace.LookupType): Likewise.
6082 * driver.cs (MainDriver): Sanity check.
6084 2006-08-01 Raja R Harinath <rharinath@novell.com>
6086 * decl.cs (DeclSpace.FindNestedType): Remove.
6087 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
6088 LookupTypeContainer to get the container of the nested type.
6089 * class.cs (TypeContainer.FindNestedType): Make non-override.
6091 2006-07-31 Raja R Harinath <rharinath@novell.com>
6093 * decl.cs (DeclSpace.PartialContainer): Move field from ...
6094 * class.cs (TypeContainer.PartialContainer): ... here.
6095 (TypeContainer.AddBasesForPart): New helper.
6096 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
6098 * cs-parser.jay (current_class): Convert to DeclSpace.
6099 (struct_declaration, interface_declaration, class_declaration):
6100 Use AddBasesForPart instead of .Bases directly.
6101 * const.cs, iterators.cs: Update to changes.
6103 2006-07-28 Raja R Harinath <rharinath@novell.com>
6105 * class.cs (TypeContainer.AddMemberType): Rename from
6107 (TypeContainer.AddMember): Rename from AddToMemberContainer.
6108 (AddTypeContainer): New. Combine AddClassOrStruct and
6110 (AddPartial): Update. Add 'is_partial' argument.
6111 * roottypes.cs: Update to changes.
6112 * cs-parser.jay (push_current_class): New helper for handling
6113 current_container and current_class.
6114 (struct_declaration, interface_declaration, class_declaration):
6117 2006-07-26 Raja R Harinath <rharinath@novell.com>
6119 * roottypes.cs: Rename from tree.cs.
6121 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
6122 * tree.cs (Tree, ITreeDump): Remove types.
6123 * rootcontext.cs (tree, Tree): Remove fields.
6124 (root, ToplevelTypes): New.
6125 * *.cs: Update to rename.
6127 * tree.cs (Tree.RecordDecl): Remove.
6128 (RootTypes.AddToTypeContainer): Record the toplevel type in its
6130 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
6132 2006-07-23 Raja R Harinath <harinath@gmail.com>
6134 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
6135 DoFlowAnalysis and OmitStructFlowAnalysis here.
6136 (ec.With): Rename from WithUnsafe and generalize.
6137 (ec.WithCheckState): Remove. All users can be handled by 'With'.
6138 (ec.WithFlowAnalyis): New.
6139 * ecore.cs, expression.cs, statement.cs: Update.
6141 2006-07-22 Raja R Harinath <harinath@gmail.com>
6143 * statement.cs (Block.ResolveMeta): Simplify slightly.
6145 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
6146 multiple boolean fields. Convert InUnsafe, constant_check_state,
6147 check_state to flags.
6148 (CheckState, ConstantCheckState): Update.
6149 (InUnsafe): New read-only property.
6150 (FlagsHandle): Rename from CheckStateHandle and convert to handle
6152 (WithUnsafe): New helper similar to WithCheckState.
6153 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
6154 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
6156 2006-07-21 Raja R Harinath <rharinath@novell.com>
6158 Make comparisons use the same IL irrespective of whether they're
6159 in a 'checked' or 'unchecked' context: one of the issues in #78899
6160 * codegen.cs (EmitContext.CheckState): Make read-only property.
6161 (EmitContext.ConstantCheckState): Likewise.
6162 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
6163 helper that implement a save/restore stack for CheckState
6164 values. This is the only way to change check-state.
6165 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
6166 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
6167 (CheckedExpr.EmitBranchable): New forwarding method.
6168 (UnCheckedExpr): Likewise.
6169 * statement.cs (Block.ResolveMeta): Use WithCheckState.
6170 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
6171 (Checked.Resolve, checked.DoEmit): Likewise.
6173 2006-07-20 Miguel de Icaza <miguel@novell.com>
6175 * anonymous.cs: Cache the resolved anonymous delegate, and return
6176 this so that the ResolveTopBlock is only triggered once, not
6179 Currently we trigger ResolvetopBlock twice due to a first pass of
6180 argument check compatibility, and a second pass that does the
6183 2006-07-15 Marek Safar <marek.safar@seznam.cz>
6185 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
6187 * rootcontext.cs (Reset): Add helper_classes.
6189 2006-07-15 Marek Safar <marek.safar@seznam.cz>
6192 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
6195 2006-07-13 Miguel de Icaza <miguel@novell.com>
6197 * statement.cs (Lock): Handle expressions of type
6198 TypeManager.null_type specially. Fixes #78770
6200 2006-07-08 Marek Safar <marek.safar@seznam.cz>
6202 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
6205 2006-07-08 Marek Safar <marek.safar@seznam.cz>
6207 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
6208 for accessors as well.
6209 * ecore.cs (EventExpr): Add AccessorTable.
6211 2006-07-01 Marek Safar <marek.safar@seznam.cz>
6214 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
6215 for CS0122 where appropriate.
6216 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
6218 (Filter): Assembly can be null in the case of top level attributes.
6220 2006-06-25 Marek Safar <marek.safar@seznam.cz>
6224 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
6225 is done at global level.
6227 2006-06-24 Marek Safar <marek.safar@seznam.cz>
6229 A fix for #77002, Implemented TypeForwarder support.
6231 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
6232 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
6233 * typemanager.cs (): Add type_forwarder_attr_type.
6235 2006-06-24 Marek Safar <marek.safar@seznam.cz>
6237 * report.cs: Add CS0469 warning.
6239 2006-06-21 Martin Baulig <martin@ximian.com>
6241 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
6242 the `try'-block, so we also report CS0016 etc. there.
6244 2006-06-21 Martin Baulig <martin@ximian.com>
6247 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
6249 2006-06-21 Martin Baulig <martin@ximian.com>
6251 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
6252 also report CS1686 for parameters.
6254 2006-06-21 Martin Baulig <martin@ximian.com>
6256 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
6257 instead of an error if the value is not implicitly convertible to
6258 the switch types; fixes #77964.
6260 2006-06-21 Raja R Harinath <rharinath@novell.com>
6263 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
6264 FieldBuilder is null.
6267 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
6268 'left' and 'right' before error-checking.
6270 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
6272 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
6274 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
6275 (FieldExpr.DoResolve): likewise.
6276 (PropertyExpr.InstanceResolve): likewise.
6277 (EventExpr.InstanceResolve): likewise.
6279 2006-06-04 Marek Safar <marek.safar@seznam.cz>
6281 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
6282 attribute applicable tests for attribute argument.
6284 2006-06-02 Raja R Harinath <rharinath@novell.com>
6287 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
6288 (Binary.OverloadResolve_PredefinedIntegral): New.
6289 (Binary.OverloadResolve_PredefinedFloating): New.
6290 (Binary.OverloadResolve_PredefinedString): New.
6291 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
6292 Follow the standard more closely, and treat numeric promotions in
6293 terms of overload resolution.
6294 (Binary.CheckShiftArguments): Simplify.
6296 2006-06-01 Raja R Harinath <rharinath@novell.com>
6298 * flowanalysis.cs (MyBitVector): Simplify representation.
6299 (MyBitVector.Clone): Avoid allocating BitArray.
6300 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
6301 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
6302 (*): Update. Change all references to MyBitVector.And and
6303 MyBitVector.Or to &= and |=.
6305 2006-05-29 Raja R Harinath <rharinath@novell.com>
6308 * cs-parser.jay (formal_parameter_list): Extend the pattern below
6309 to param arguments too.
6311 2006-05-26 Miguel de Icaza <miguel@novell.com>
6313 * cs-parser.jay: Catch another parsing form for arglist being
6314 followed by other arguments. Fixes #78313.
6316 2006-05-24 Raja R Harinath <rharinath@novell.com>
6318 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
6319 checking of out parameters to ...
6320 (FlowBranchingToplevel.Merge): ... here.
6321 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
6322 set, propagate the origin upward, and only complain if there was
6324 (FlowBranchingException.AddContinueOrigin): Likewise.
6325 (FlowBranchingException.AddReturnOrigin): Likewise.
6326 (FlowBranchingException.AddGotoOrigin): Likewise.
6328 2006-05-23 Raja R Harinath <rharinath@novell.com>
6330 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
6331 unreachable, skip it.
6332 (FlowBranchingException.Merge): Always propagate jumps, even if
6333 the finally block renders subsequent code unreachable.
6335 2006-05-18 Raja R Harinath <rharinath@novell.com>
6338 * statement.cs (Goto.Resolve): Move responsibility for resolving
6339 'goto' to FlowBranching.AddGotoOrigin.
6340 (Goto.SetResolvedTarget): New. Callback to set the
6341 LabeledStatement that's the target of the goto.
6342 (Goto.DoEmit): Use Leave instead of Br when crossing an
6343 unwind-protect boundary.
6344 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
6345 LookupLabel and adjust to new semantics.
6346 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
6347 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
6348 Goto.SetResolvedTarget to update target.
6349 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
6350 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
6351 AddBreakOrigin & co. Delay propagation until ...
6352 (FlowBranchingException.Merge): ... this.
6354 * statement.cs (Block.Resolve): Always depend on flow-branching to
6355 determine unreachability. Kill workaround that originally emitted
6356 only one statement after an "unreachable" label (see infloop in
6359 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
6360 This is still "wrong", but anything better would probably need a
6361 multi-pass algorithm.
6362 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
6363 usage vector. Force current usage vector to be reachable, to
6364 optimistically signify backward jumps.
6365 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
6367 (FlowBranchingLabeled.Merge): New. If no backward jump was
6368 detected, return the original salted-away usage vector instead,
6369 updated with appropriate changes. Print unreachable warning if
6371 * statement.cs (Block.Resolve): Don't print unreachable warning on
6372 a labeled statement.
6374 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
6376 * driver.cs: Pass filename without path to AssemblyBuilder's
6377 AddResourceFile. Fixes bug #78407.
6379 2006-05-17 Raja R Harinath <rharinath@novell.com>
6381 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
6382 * flowanalysis.cs (FlowBranchingLabeled): ... here.
6383 (FlowBranching.MergeChild): Overwrite
6384 reachability information from Labeled branchings too.
6386 2006-05-16 Raja R Harinath <rharinath@novell.com>
6388 * statement.cs (Goto.Resolve): Merge jump origins here ...
6389 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
6391 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
6392 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
6393 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
6394 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
6396 * statement.cs (Goto.Resolve): ... not here.
6397 (Goto.Emit): Remove CS1632 check.
6399 2006-05-14 Marek Safar <marek.safar@seznam.cz>
6401 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
6404 2006-05-11 Raja R Harinath <rharinath@novell.com>
6406 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
6407 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
6408 (FlowBranchingException.Label): Likewise.
6410 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
6412 (MyBitVector.Or): Use it to avoid losing information (Count).
6413 (FlowBranching.MergeOrigins): Likewise.
6415 * flowanalysis.cs (UsageVector.IsDirty): Remove.
6416 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
6417 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
6418 (UsageVector.ToString): Simplify.
6419 (UsageVector.MergeSiblings): Move here from ...
6420 (FlowBranching.Merge): ... here.
6421 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
6424 2006-05-10 Raja R Harinath <rharinath@novell.com>
6426 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
6427 null bitvector is treated as all-true.
6429 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
6430 (MyBitVector): Rationalize invariants. 'vector != null' implies
6431 that we have our own copy of the bitvector. Otherwise,
6432 'InheritsFrom == null' implies all inherited bits are true.
6434 2006-05-09 Marek Safar <marek.safar@seznam.cz>
6436 * statement.cs (LocalInfo): Add IsConstant.
6437 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
6438 local variable for constants.
6440 2006-05-09 Raja R Harinath <rharinath@novell.com>
6442 * flowanalysis.cs (MyBitVector.Empty): New.
6443 (MyBitVector): Don't allow InheritedFrom to be null.
6444 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
6445 (UsageVector, FlowBranching): Update to changes.
6447 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
6448 recursion. The 'Parent == null' condition isn't sufficient for
6450 (FlowBranching.AddBreakOrigin): Likewise.
6451 (FlowBranching.AddContinueOrigin): Likewise.
6452 (FlowBranching.AddReturnOrigin): Likewise.
6453 (FlowBranching.StealFinallyClauses): Likewise.
6454 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
6455 (FlowBranching.CheckOutParameters): Likewise.
6456 (FlowBranchingToplevel): Terminate all the above recursions here.
6457 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
6458 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
6460 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
6462 (FlowBranchingToplevel): New. Empty for now.
6463 (FlowBranching.MergeTopBlock): Update.
6464 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
6465 branching for the anonymous delegate.
6466 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
6468 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
6469 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
6470 information at the start of the merge. Reorganize.
6472 2006-05-07 Marek Safar <marek.safar@seznam.cz>
6474 * class.cs (MethodData.Define): Method cannot implement interface accessor.
6476 2006-05-07 Marek Safar <marek.safar@seznam.cz>
6478 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
6479 to newly introduced ctor.
6481 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
6482 message to one place.
6483 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
6486 2006-05-07 Marek Safar <marek.safar@seznam.cz>
6488 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
6490 * ecore.cs (Expression.ResolveAsConstant): Updated.
6492 * statement.cs (ResolveMeta): Updated.
6494 2006-05-06 Marek Safar <marek.safar@seznam.cz>
6496 * cs-parser.jay: __arglist cannot be used in initializer.
6498 2006-05-06 Marek Safar <marek.safar@seznam.cz>
6501 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
6504 2006-05-05 Raja R Harinath <rharinath@novell.com>
6506 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
6507 (LabeledStatement): Add 'name' parameter.
6508 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
6509 (Block.AddLabel): Update to changes.
6510 * cs-parser.jay (labeled_statement): Likewise.
6512 * flowanalysis.cs (BranchingType.Labeled): New.
6513 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
6514 (FlowBranchingLabeled): New. Does nothing for now, but will
6515 eventually handle 'goto' flows.
6516 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
6517 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
6518 that's terminated ...
6519 (Block.Resolve): ... here.
6521 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
6522 (UsageVector.MergeFinallyOrigins): Likewise.
6523 (FlowBranching.InTryOrCatch): Likewise.
6524 (FlowBranching.AddFinallyVector): Likewise.
6525 (FlowBranchingException): Update to changes.
6528 * statement.cs (Return.Resolve): Move error checking to ...
6529 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
6530 (FlowBranchingException): Handle return origins like break and
6532 (FlowBranching.UsageVector.CheckOutParameters): Remove.
6534 2006-05-04 Marek Safar <marek.safar@seznam.cz>
6537 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
6540 2006-05-04 Marek Safar <marek.safar@seznam.cz>
6543 * class.cs (MethodData.Define): Do public accessor check only when method
6544 implements an interface.
6546 2006-05-04 Raja R Harinath <rharinath@novell.com>
6548 Remove special handling of 'break'
6549 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
6550 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
6551 (UsageVector.Break): Remove.
6552 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
6554 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
6556 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
6557 UsageVector.Breaks (). Don't set NeedsReturnLabel.
6559 2006-05-03 Marek Safar <marek.safar@seznam.cz>
6562 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
6563 be the interface member.
6565 2006-05-03 Marek Safar <marek.safar@seznam.cz>
6568 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
6569 for emitting small (int) values.
6571 2006-05-03 Raja R Harinath <rharinath@novell.com>
6574 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
6575 control-flow passes through the 'finally' after merging-in all the
6576 control-flows from 'try' and the 'catch' clauses.
6578 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
6579 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
6580 always true at the only non-recursive entry point.
6581 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
6582 FlowBranchingBreakable.
6583 (FlowBranchingLoop): Remove.
6584 * statement.cs (Return.DoResolve): Update to changes.
6587 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
6588 (FlowBranching.CreateBranching): Handle it: create a
6589 FlowBranchingContinuable.
6590 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
6591 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
6592 except that it handles the 'continue' command.
6593 (FlowBranching.UsageVector.MergeOrigins): Rename from
6595 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
6596 except that it overrides AddContinueOrigin.
6597 (FlowBranchingException): Override AddContinueOrigin, similar to
6599 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
6600 Create a new branching around the embedded statement.
6601 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
6602 control flow after the embedded statement.
6603 (Continue.Resolve): Move all error checking to AddContinueOrigin.
6605 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
6606 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
6607 FlowBranchingBreakable.
6608 (FlowBranchingSwitch): Remove.
6611 * statement.cs (Break.Resolve): Simplify. Move responsibility for
6612 error reporting to ...
6613 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
6614 Rename from 'AddBreakVector'. Add new location argument. Return
6615 a bool indicating whether the 'break' crosses an unwind-protect.
6616 (FlowBranchingException.AddBreakOrigin): Add.
6617 (FlowBranchingException.Merge): Propagate 'break's to surrounding
6618 flowbranching after updating with the effects of the 'finally'
6620 (FlowBranchingBreakable): New common base class for
6621 FlowBranchingLoop and FlowBranchingSwitch.
6623 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
6625 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
6627 2006-05-02 Raja R Harinath <rharinath@novell.com>
6629 * statement.cs (Do.Resolve): If the loop is infinite, set the
6631 (While.Resolve, For.Resolve): Set a barrier after the embedded
6632 statement. There's no direct control flow that goes from the end
6633 of the embedded statement to the end of the loop.
6634 * flowanalysis.cs (FlowBranching.Infinite): Remove.
6635 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
6636 above ensure that the reachability is correctly computed.
6638 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
6639 (UsageVector.MergeBreakOrigins): If the current path is
6640 unreachable, treat it as if all parameters/locals are initialized.
6641 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
6642 infinite loops before merging-in break origins.
6644 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
6645 (Reachability.Reachable): Split part into ...
6646 (Reachability.Unreachable): ... this. Simplify.
6647 (Reachability.IsUnreachable): Use 'Unreachable' instead.
6649 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
6650 (Reachability.SetThrowsSometimes): Likewise.
6651 (FlowBranchingBlock.MergeTopBlock): Don't compare against
6652 TriState.Always, use corresponding property.
6653 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
6654 (Block.Resolve): Likewise. Remove some redundant checks.
6656 2006-05-02 Raja R Harinath <harinath@gmail.com>
6658 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
6659 (Reachability.Meet): Don't bother checking AlwaysThrows --
6660 barrier is always set.
6661 (FlowBranchingBlock.Merge): Likewise.
6663 2006-05-01 Raja R Harinath <harinath@gmail.com>
6665 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
6666 checks for unreachable.
6668 2006-05-01 Marek Safar <marek.safar@seznam.cz>
6671 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
6673 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
6674 whether field is really assigned.
6676 2006-04-30 Raja R Harinath <harinath@gmail.com>
6678 * flowanalysis.cs (Reachability): Make 4-argument constructor
6680 (Reachability.Meet): Rename from 'And'. Remove static variant.
6681 (Reachability.Always): Rename from the highly misleading
6682 'Reachability.Never'.
6683 (FlowBranching.Merge): Update to changes. Mark an impossible
6684 situation with a 'throw'.
6685 (*): Update to changes.
6687 2006-04-29 Raja R Harinath <harinath@gmail.com>
6689 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
6691 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
6692 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
6693 (*): Update to changes.
6694 * statement.cs: Update to changes.
6696 2006-04-28 Marek Safar <marek.safar@seznam.cz>
6699 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
6701 2006-04-28 Raja R Harinath <harinath@gmail.com>
6703 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
6706 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
6707 argument to two arguments: an usage-vector and a bool. Move call
6708 to FlowBranching.Merge () ...
6709 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
6711 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
6712 handling of loop and switch reachability to ...
6713 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
6715 2006-04-27 Raja R Harinath <harinath@gmail.com>
6717 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
6718 handling to FlowBranchingLoop.InLoop.
6719 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
6721 2006-04-26 Marek Safar <marek.safar@seznam.cz>
6724 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
6725 anonymous method is allowed from AnonymousContainer here.
6727 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
6729 2006-04-24 Raja R Harinath <rharinath@novell.com>
6732 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
6734 2006-04-23 Marek Safar <marek.safar@seznam.cz>
6737 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
6738 (DoubleConstant.Reduce): Ditto.
6740 2006-04-23 Raja R Harinath <rharinath@novell.com>
6742 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
6743 Remove 'lvalue_right_side' argument. Move parts to ...
6744 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
6745 (LocalVariable.DoResolveLValue): ... these.
6747 2006-04-21 Raja R Harinath <rharinath@novell.com>
6750 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
6751 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
6752 (LocalVariableReference.DoResolveBase): Use it to implement new
6754 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
6755 (Argument.Resolve): Simplify. Move CS1510 check ...
6756 * ecore.cs (Expression.ResolveLValue): ... here.
6757 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
6758 (PropertyExpr.DoResolveLValue): Likewise.
6759 (FieldExpr.Report_AssignToReadonly): Likewise.
6760 (FieldExpr.DoResolve): Add 'out_access' argument. Use
6761 LValueMemberAccess or LValueMemberOutAccess on instance depending
6763 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
6764 DoResolve as appropriate.
6766 2006-04-20 Raja R Harinath <rharinath@novell.com>
6769 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
6770 implicit conversions on 'out' and 'ref' arguments.
6772 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
6773 improve clarity. Remove dead code.
6776 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
6777 (Catch.Resolve): Resolve VarBlock if it exists.
6779 2006-04-19 Miguel de Icaza <miguel@novell.com>
6781 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
6782 twice, this was some residual code, the enumerator was emitted
6783 properly in the two branche of if later.
6785 2006-04-19 Raja R Harinath <rharinath@novell.com>
6787 * expression.cs (Cast.ResolveLValue): Remove. The result of a
6788 cast is never an lvalue.
6789 (Cast.DoResolve, Cast.ResolveRest): Combine.
6790 (Argument.Emit): Simplify slightly. Move 'Expr is
6791 IMemoryLocation' check ...
6792 (Argument.Resolve): ... here.
6793 (Argument.Error_LValueRequired): Remove. Inline into only user.
6795 Simplifications. Fix cs0191-2.cs
6796 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
6797 CS1649 and CS1651 to ...
6798 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
6799 the actual selection of the error code and message to a lookup
6800 table. Add a dummy return value to simplify callsites.
6801 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
6802 readonly fields of other instances of the same type. Move CS0197
6804 * expression.cs (Argument.Resolve): ... here. Simplify code.
6805 Ensure that ec.InRefOutArgumentResolving is only set during LValue
6806 resolution of an out or ref argument. The code simplification
6807 above uses this invariant.
6809 2006-04-18 Raja R Harinath <rharinath@novell.com>
6811 Possibly fix #77752. Fix cs1690-[4-7].cs.
6812 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
6813 CheckMarshallByRefAccess. Drop parameter.
6814 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
6816 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
6818 * report.cs (AllWarnings): Add CS1690.
6819 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
6821 (LocalVariableReference.DoResolveBase): Update.
6823 2006-04-09 Marek Safar <marek.safar@seznam.cz>
6825 * class.cs (MethodOrOperator): Moved common parts from method class.
6826 detect obsolete attributes.
6827 (Method.Define): Simplified as it reuses code from base.
6828 (Constructor.ValidAttributeTargets): Fixed issue found during
6830 (Destructor.ValidAttributeTargets): Fixed issue found during
6832 (Operator): Finished refactoring set off by #78020. Operator class is now
6833 ordinary method class.
6835 * anonymous.cs: Updated.
6837 * decl.cs (DeclSpace): Add IsGeneric
6839 2006-04-09 Marek Safar <marek.safar@seznam.cz>
6841 * class.cs (Constructor.Emit): Don't emit the attributes twice.
6843 2006-04-09 Marek Safar <marek.safar@seznam.cz>
6845 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
6846 detect obsolete attributes.
6847 (Method.CreateEmitContext): Moved to MethodOrOperator.
6849 2006-04-09 Marek Safar <marek.safar@seznam.cz>
6852 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
6853 customized exception to make crash detection easier.
6854 (MethodOrOperator): Started to work on new base class for methods and
6856 (Method): Derives from MethodOrOperator.
6857 (Constructor.Emit): Emits its own attributes.
6858 (AbstractPropertyEventMethod.Emit): Ditto.
6859 (Operator): Derives from MethodOrOperator, will refactor fully in extra
6861 (Operator.Emit): It's temporary more tricky than should be.
6863 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
6865 * report.cs (InternalErrorException): Add ctor with inner exception.
6867 2006-04-08 Marek Safar <marek.safar@seznam.cz>
6870 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
6873 2006-04-07 Marek Safar <marek.safar@seznam.cz>
6876 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
6879 2006-04-06 Marek Safar <marek.safar@seznam.cz>
6881 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
6882 attribute is present and Guid not.
6883 (Interface.ApplyAttributeBuilder): Ditto.
6885 * attribute.cs: Add error message.
6887 2006-04-06 Marek Safar <marek.safar@seznam.cz>
6891 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
6892 sources (it's composite) so hold them in extra array as they are used in
6893 Emit phase only. It worked in the previous versions by mistake.
6894 (Attribute.Emit): Emit attribute for more owners when exist.
6896 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
6897 it has now different behaviour.
6899 2006-04-04 Marek Safar <marek.safar@seznam.cz>
6901 * constant.cs (Constant.IsDefaultInitializer): New method.
6903 * class.cs: Updated.
6905 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
6906 re-initialize default values. It saves KBs almost for every assembly.
6907 Thanks Zoltan for the idea.
6908 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
6909 (ArrayCreation.DoResolve): Resolve only once.
6910 (ArrayCreation.Emit): Emit static initializer only when it is faster.
6911 (ArrayCreation.GetAttributableValue): Cope with optimized values.
6913 2006-04-03 Zoltan Varga <vargaz@gmail.com>
6915 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
6918 2006-04-01 Marek Safar <marek.safar@seznam.cz>
6920 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
6921 in an embedded statement too.
6923 2006-04-01 Raja R Harinath <rharinath@novell.com>
6926 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
6928 2006-04-01 Marek Safar <marek.safar@seznam.cz>
6932 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
6935 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
6937 2006-03-31 Marek Safar <marek.safar@seznam.cz>
6939 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
6942 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
6943 LocalTemporary change.
6945 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
6947 (ClassOrStruct.DefineFieldInitializers): Implemented static field
6948 initializers optimization.
6949 (ClassOrStruct.TypeAttr): Moved from modifiers.
6950 (Constructor.CheckBase): Don't crash when static ctor has parameters.
6951 (FieldBase.ResolveInitializer): Resolves initializer.
6952 (FieldBase.HasDefaultInitializer): New property.
6954 * cs-parser.jay: Removed message.
6956 * expression.cs (CompilerGeneratedThis): New specialization.
6958 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
6960 2006-03-28 Marek Safar <marek.safar@seznam.cz>
6962 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
6964 2006-03-27 Marek Safar <marek.safar@seznam.cz>
6966 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
6967 be now EnumConstants only.
6969 2006-03-27 Marek Safar <marek.safar@seznam.cz>
6971 * attribute.cs, driver.cs: Reset more caches.
6973 2006-03-26 Marek Safar <marek.safar@seznam.cz>
6975 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
6977 2006-03-26 Marek Safar <marek.safar@seznam.cz>
6979 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
6980 for easier reuse. Updated all overrides.
6981 (IntegralConstant): New base class for all integral constants.
6982 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
6983 of the constant range, report custom error.
6984 (UIntConstant.Reduce): Fixed uint conversion.
6986 * ecore.cs, literal.cs: Reduce updates.
6988 2006-03-26 Marek Safar <marek.safar@seznam.cz>
6992 * class.cs (Constructor.Define): Removed extra if for default ctors.
6993 A patch from Atsushi Enomoto.
6995 2006-03-26 Marek Safar <marek.safar@seznam.cz>
6997 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
6998 GetAttributableValue.
7000 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
7003 * convert.cs (ImplicitConversionRequired): Error message moved to
7006 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
7007 automatic implicit conversion of an output value.
7008 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
7010 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
7012 (TypeOf.GetAttributableValue): Add extra handling for object type.
7014 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
7015 special error message.
7017 2006-03-25 Marek Safar <marek.safar@seznam.cz>
7019 * class.cs (Constructor.Emit): Don't crash when struct ctor is
7021 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
7022 compatible with MS runtime.
7024 2006-03-23 Marek Safar <marek.safar@seznam.cz>
7026 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
7027 attribute arguments here.
7029 * class.cs (Indexer.Define): The check was moved to attribute class.
7031 2006-03-22 Marek Safar <marek.safar@seznam.cz>
7033 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
7034 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
7037 2006-03-22 Raja R Harinath <rharinath@novell.com>
7039 Support ParameterDefaultValueAttribute in gmcs. Also applied to
7040 mcs to keep code differences small.
7041 * attribute.cs (Attribute.GetParameterDefaultValue): New.
7042 * typemanager.cs (parameter_default_value_attribute_type): New.
7043 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
7046 2006-03-21 Marek Safar <marek.safar@seznam.cz>
7048 * expression.cs (StringConcat.Append): Reverted back to no warning state.
7050 2006-03-21 Marek Safar <marek.safar@seznam.cz>
7052 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
7054 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
7057 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
7059 * doc-bootstrap.cs : fix build.
7061 2006-03-20 Marek Safar <marek.safar@seznam.cz>
7063 * expression.cs (StringConcat.Append): Issue a warning when empty string
7066 2006-03-20 Marek Safar <marek.safar@seznam.cz>
7068 * assign.cs (CompoundAssign.ResolveSource): Removed.
7070 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
7073 * class.cs (TypeContainer.FindMethods): Removed.
7074 (TypeContainer.CheckMemberUsage): Made static.
7076 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
7078 * constant.cs (CheckRange): Removed unused type argument.
7079 (CheckUnsigned): Removed unused type argument.
7081 * cs-parser.jay: Updated after MemberAccess clean up.
7082 Uses Length for empty string test.
7084 * cs-tokenizer.cs: Uses Length for empty string test.
7085 (IsCastToken): Made static.
7086 (is_hex): Made static.
7087 (real_type_suffix): Made static.
7089 * decl.cs (SetupCache): Made static.
7090 (OnGenerateDocComment): Removed unused ds argument.
7092 * delegate.cs (VerifyDelegate): Removed unused argument.
7094 * doc.cs: Uses Length for empty string test.
7096 * driver.cs: Uses Length for empty string test.
7098 * enum.cs (IsValidEnumType): Made static
7100 * expression.cs (EnumLiftUp): Removed unused argument.
7101 (ResolveMethodGroup): Ditto.
7102 (BetterConversion): Ditto.
7103 (GetVarargsTypes): Ditto.
7104 (UpdateIndices): Ditto.
7105 (ValidateInitializers): Ditto.
7106 (MemberAccess.ctor): Ditto.
7107 (GetIndexersForType): Ditto.
7109 * flowanalysis.cs: (MergeFinally): Removed unused argument.
7111 * iterators.cs: Updated after MemberAccess clean up.
7113 * location.cs: Uses Length for empty string test.
7115 * namespace.cs: Uses Length for empty string test.
7117 * report.cs (CheckWarningCode): Made static.
7119 * statement.cs (LabeledStatement): Removed unused argument.
7121 * typemanager.cs (FilterNone): Removed.
7123 2006-03-18 Marek Safar <marek.safar@seznam.cz>
7125 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
7128 * class.cs: Updated.
7130 2006-03-18 Marek Safar <marek.safar@seznam.cz>
7132 * cs-parser.jay.cs: __arglist is not allowed for delegates.
7134 2006-03-18 Marek Safar <marek.safar@seznam.cz>
7138 * expression.cs (VerifyArgumentsCompat): Reverted to double error
7139 reporting, it's more tricky than I thought.
7141 2006-03-18 Marek Safar <marek.safar@seznam.cz>
7145 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
7147 (AnonymousMethod.ImplicitStandardConversionExists): New method.
7148 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
7149 Add more error reporting; Fixed issue with params.
7151 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
7153 * cs-parser.jay: AnonymousMethod requires host container.
7155 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
7157 2006-03-18 Raja R Harinath <harinath@gmail.com>
7159 * class.cs: Change 'TypeContainer ds' constructor argument to
7160 'DeclSpace parent'. Some classes were missed below due to
7161 different naming convention.
7163 * class.cs (MemberCore.Parent): Delete. This makes the
7164 ParentContainer changes below enforceable by the compiler.
7166 Treat pointers to enclosing declaration space as 'DeclSpace', not
7168 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
7169 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
7171 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
7173 (Block.AddThisVariable): Likewise.
7174 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
7175 (AbstractPropertyEventMethod.Emit): Likewise.
7176 (AbstractPropertyEventMethod.EmitMethod): Likewise.
7177 (GetMethod.Define, SetMethod.Define): Likewise.
7178 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
7179 (DelegateMethod.EmitMethod): Likewise.
7181 Fix regression test-partial-13.cs.
7182 Rationalize use of PartialContainer. Ensure that the partial
7183 class semantics can be tied to type-correctness, i.e., any
7184 violation will cause a compile error.
7185 * class.cs, const.cs: Access all fields that belong to class
7186 TypeContainer via ParentContainer. Arguments of EmitContexts and
7187 Resolve()-like functions still use 'Parent'.
7189 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
7190 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
7191 (PropertyMethod.CheckModifiers): Remove unused argument.
7192 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
7195 2006-03-17 Raja R Harinath <harinath@gmail.com>
7197 Make semantics of PartialContainer simpler.
7198 * decl.cs (DeclSpace.IsPartial): Remove.
7199 * class.cs (TypeContainer.IsPartial): Likewise.
7200 (TypeContainer..ctor): Set PartialContainer to point to self.
7201 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
7202 (TypeContainer.FindNestedType): Likewise.
7203 (MemberCore.ParentContainer): Simplify. Remove deprecation.
7205 2006-03-17 Marek Safar <marek.safar@seznam.cz>
7207 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
7209 2006-03-15 Marek Safar <marek.safar@seznam.cz>
7211 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
7214 2006-03-15 Marek Safar <marek.safar@seznam.cz>
7216 * class.cs (Operator.Define): An error for base conversion was not
7219 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
7221 * iterator.cs : yield break is allowed in try statement which has
7222 catch clauses. Fixed bug #77767.
7224 2006-03-13 Marek Safar <marek.safar@seznam.cz>
7226 A fix for #77593, #77574.
7228 * class.cs (MethodCore.CheckBase): Another if for operator.
7230 2006-03-09 Marek Safar <marek.safar@seznam.cz>
7232 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
7235 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
7236 (DelegateCreation.ImplicitStandardConversionExists): New method for just
7239 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
7242 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
7243 Updated after another emitcontext usage was clean up. It should help us to
7244 synchronize with gmcs easier.
7246 2006-03-04 Marek Safar <marek.safar@seznam.cz>
7250 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
7251 (Event.Define): ditto
7252 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
7254 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
7255 Removed redundant code and set NewSlot for Invoke method too.
7257 * parameter.cs (Parameters.ctor): Add custom, type ctor.
7258 (Parameters.MergeGenerated): New method. Use this method when you merge
7259 compiler generated argument with user arguments.
7261 2006-03-03 Marek Safar <marek.safar@seznam.cz>
7263 * attribute.cs (ResolveAsTypeTerminal): Removed.
7265 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
7266 specialization for predefined types; 30% speed up.
7267 Finally placed obsolete check to right place.
7268 (Expression.ResolveType): Removed.
7270 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
7271 Updated after ResolveType was removed.
7273 * expression.cs (Cast.ctor): Check void cast.
7274 (Binary.ResolveAsTypeTerminal): Is never type.
7275 (Conditional.ResolveAsTypeTerminal): Is never type.
7277 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
7279 2006-03-01 Raja R Harinath <rharinath@novell.com>
7282 * expression.cs (ParameterReference.DoResolveBase): Change return
7284 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
7288 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
7291 * typemanager.cs (GetFullNameSignature): Don't nullref on
7292 protected accessors.
7294 2006-02-27 Marek Safar <marek.safar@seznam.cz>
7296 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
7297 these two separated members to simplify the code.
7298 (Attribute.Resolve): Refactored to use new fields and methods.
7299 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
7300 implemented obsolete attribute checking.
7301 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
7302 implemented obsolete checking again. It look line never ending quest ;-)
7303 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
7305 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
7307 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
7309 *class.cs (Property.Define): Add RegisterProperty call.
7311 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
7312 argument groups (only 2).
7314 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
7315 encoding expression to arguments.
7316 (Expression.ExprClassToResolveFlags): Just turned to property.
7318 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
7319 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
7320 optimized as well as implemented support for zero-length attributes.
7322 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
7323 Add caching of PropertyInfo's.
7325 2006-02-25 Marek Safar <marek.safar@seznam.cz>
7327 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
7328 error multiple times.
7330 2006-02-25 Marek Safar <marek.safar@seznam.cz>
7332 New partial class implementation.
7333 A fix for #77027, #77029, #77403
7335 * attribute.cs (Attributable): Made attributes protected.
7337 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
7338 the replacements of ClassPart and PartialContainer.
7339 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
7340 (TypeContainer.AddInterface): Ditto.
7341 (TypeContainer.AddPartial): The main method for partial classes. It checks
7342 for errors and merges ModFlags and attributes. At the end class is added to
7344 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
7346 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
7347 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
7348 from the rest of partial classes.
7349 (TypeContainer.GetClassBases): Simplified.
7350 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
7352 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
7353 (TypeContainer.HasExplicitLayout): Uses Flags now.
7354 (PartialContainer): Removed.
7355 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
7356 (StaticClass): Was merged with Class.
7357 (Class.GetClassBases): class and static class bases are verified here.
7358 (Class.TypeAttr): Added static attributes when class is static.
7359 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
7360 (MemberBase): In some cases we need to call parent container for partial
7361 class. It should be eliminated but it's not easy now.
7363 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
7365 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
7366 partial classed to accumulate class comments.
7367 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
7369 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
7371 * driver.cs (MainDriver): Tree.GetDecl was removed.
7373 * modifiers.cs (Modifiers): Add partial modifier.
7375 * tree.cs (Tree.decl): Removed.
7376 (RootTypes): Started to use this class more often for root types
7379 2006-02-22 Marek Safar <marek.safar@seznam.cz>
7383 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
7384 external interface does not have an attribute.
7386 2006-02-22 Marek Safar <marek.safar@seznam.cz>
7388 Another prerequisites for new partial classs implementation.
7390 * attribute.cs (Attribute.Equal): Implemented.
7391 (Attribute.Emit): Changed as attributes can be applied more than twice.
7392 (Attributes.Emit): Check for duplicate attributes here.
7394 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
7395 as a parameter, clean-up.
7397 2006-02-11 Marek Safar <marek.safar@seznam.cz>
7401 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
7402 contains obsolete attribute check which can in some cases look for base
7403 type of current class which is not initialized yet.
7404 (TypeContainer.BaseType): Replacement of ptype.
7406 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
7408 2006-02-11 Marek Safar <marek.safar@seznam.cz>
7410 First of prerequisites for new partial classs implemention.
7412 * attribute.cs (Attributable): Extended by ResolveContext;
7413 Attributes finally have correct context for resolving in all cases.
7414 (AttachTo): Attribute owner is assigned here.
7416 * codegen.cs (IResolveContext): Introduce new interface to hold
7417 all information needed in resolving phase.
7418 (EmitContext): Implements IResolveContext; more clean-up needed here.
7420 * decl.cs (MemberCore): Implemented IResolveContext.
7422 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
7423 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
7424 parameter.cs, statement.cs, tree.cs, typemanager.cs:
7425 Refactored to use new IResolveContext instead of EmitContext; cleanup
7427 2006-02-06 Miguel de Icaza <miguel@novell.com>
7429 * codegen.cs (EmitScopeInitFromBlock): check here the
7430 capture_context, there is no need to make two calls to the
7433 * anonymous.cs: Add some debugging messages that might help me
7434 track other instances of this problem in the future (the
7435 regression of test 467).
7437 * cs-parser.jay: track the variable block, as we need to initalize
7438 any captured variables declared in this block for the "catch"
7439 portion of the "Try" statement.
7441 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
7442 scope initialization for captured variables.
7444 Also, move the emit for the variables after the block location has
7447 2006-02-06 Marek Safar <marek.safar@seznam.cz>
7449 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
7451 2006-02-02 Miguel de Icaza <miguel@novell.com>
7453 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
7454 commit yesterday, the initialization for the roots is necessary.
7455 What is not necessary is the scope activation.
7457 2006-02-02 Raja R Harinath <rharinath@novell.com>
7459 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
7460 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
7462 (Argument.Resolve): Remove CS0206 checks.
7464 2006-02-01 Miguel de Icaza <miguel@novell.com>
7466 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
7467 scopes for all the roots, the scopes will now be emitted when the
7468 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
7470 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
7471 code. This reduces a lot of existing cruft.
7473 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
7474 that the ScopeInfo is generated as we enter the scope, not at the
7475 time of use, which is what we used to do before.
7477 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
7478 every time a Block is about to be emitted if we have a
7481 2006-02-01 Raja R Harinath <rharinath@novell.com>
7483 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
7485 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
7487 * typemanager.cs (cons_param_array_attribute): Make private.
7488 (Reset): Set it to null.
7489 (InitCoreHelpers): Don't initialize it.
7490 (ConsParamArrayAttribute): New. Initialize it as needed.
7491 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
7493 2006-01-31 Miguel de Icaza <miguel@novell.com>
7495 * expression.cs: There might be errors reported during the
7496 selection of applicable methods. If there are errors, do not
7497 continue execution as it will lead the compiler to crash.
7499 2006-01-30 Miguel de Icaza <miguel@novell.com>
7501 * expression.cs: Member access is not allowed on anonymous
7502 methods. Fixes #77402.
7504 2006-01-30 Raja R Harinath <rharinath@novell.com>
7507 * cs-parser.jay (VariableDeclaration): Don't set
7508 current_array_type to null.
7509 (field_declaration, event_declaration, declaration_statement):
7510 Set it to null here.
7512 2006-01-28 Raja R Harinath <harinath@gmail.com>
7514 * typemanager.cs (GenericParameterPosition): New.
7517 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
7519 * doc.cs : To process "include" elements, first we should create
7520 another list than XmlNodeList, because it could result in node
7521 removal, which could result in that the XmlNodeList gives up
7524 (Also made code identical to gmcs again.)
7526 2006-01-25 Miguel de Icaza <miguel@novell.com>
7528 * ecore.cs: Introduce an error report that we were not catching
7529 before, if not silent, we must report the error. Gonzalo ran into
7532 2006-01-23 Miguel de Icaza <miguel@novell.com>
7534 A fix for bug: #76957
7536 * iterators.cs (MoveNextMethod.CreateMethodHost): call
7537 ComputeMethodHost before creating the method, this is a new
7540 * anonymous.cs (AnonymousContainer): Now we track all the scopes
7541 that this method references (RegisterScope). The actual scope
7542 where the method is hosted is computed with the ComputeMethodHost
7543 before we create the method.
7545 Moved the Deepest routine here.
7547 (AnonymousContainer.ComputeMethodHost): New routine used to
7548 compute the proper ScopeInfo that will host the anonymous method.
7550 (ScopeInfo): Deal with multiple roots. The problem was that we
7551 did not have a unique root where all ScopeInfos could be hanged
7552 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
7555 Remove AdjustMethodScope which is now computed at the end. Remove
7556 LinkScope which did a partial link, instead link all ScopeInfos
7557 before code generation from the new "LinkScopes" routine.
7559 Simplify all the Add* routines as they no longer need to maintain
7560 the tree, they just need to record that they are using variables
7563 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
7564 routines to produce the forest of ScopeInfo trees.
7566 * class.cs (TypeContainer.AppendMethod): This is just like
7567 AddMethod, but ensures that an interface implementation method
7568 (IEnumerable.XXX) is not inserted at the beginning of the queue of
7569 methods, but at the end.
7571 We use this functionality to ensure that the generated MoveNext
7572 method in the iterator class is resolved/emitted before the
7573 enumerator methods created.
7575 This is required because the MoveNext method computes the right
7576 ScopeInfo for the method. And the other methods will eventually
7577 need to resolve and fetch information computed from the anonymous
7580 2006-01-21 Raja R Harinath <harinath@gmail.com>
7581 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7584 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
7586 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
7587 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
7589 2006-01-18 Raja R Harinath <rharinath@novell.com>
7591 Fix #76656, cs0231-2.cs.
7592 * cs-parser.jay (formal_parameter_list): Make error case catch
7594 (parenthesized_expression_0): Add CS1026 check.
7595 (invocation_expression): Remove unused { $$ = lexer.Location }.
7597 2006-01-17 Raja R Harinath <rharinath@novell.com>
7600 * cs-parser.jay (statement_expression): Don't list out the
7601 individual statement-expressions. Convert syntax error into
7604 2006-01-16 Raja R Harinath <rharinath@novell.com>
7607 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
7608 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
7609 CheckIntermediateModification.
7610 (FieldExpr.DoResolve): Add new two-argument version that
7611 allows us to resolve the InstanceExpression as an lvalue.
7612 The one-argument variant is now just a wrapper.
7613 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
7614 Resolve the lhs as an lvalue if the it has a value type.
7615 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
7616 from Assign.DoResolve.
7617 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
7618 resolved as an lvalue.
7619 (PropertyExpr.DoResolve): Update.
7620 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
7621 has a value type. Move CS1612 check here from
7622 CheckIntermediateModification.
7623 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
7624 * expression.cs (EmptyExpression.OutAccess): New. Used as the
7625 'right_side' of a ResolveLValue on an 'out' argument.
7626 (EmptyExpression.LValueMemberAccess): New. Used as the
7627 'right_side' of a propagated ResolveLValue on a value type.
7628 (LocalVariableReference.DoResolveBase): Recognize
7629 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
7631 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
7632 EmptyExpression.Null.
7634 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
7636 * typemanager.cs : added IsGenericParameter(). In mcs it always
7638 * doc.cs : for generic parameters, use GenericParameterPosition,
7641 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
7643 * expression.cs: Fix Console.WriteLine ((this = x).foo);
7645 2006-01-12 Miguel de Icaza <miguel@novell.com>
7647 This fixes the problem where we used ldfld instead of ldflda to
7648 load the "THIS" pointer on captured parameters, when THIS is a
7649 value type. See bug #77205.
7651 * iterators.cs (CapturedThisReference.Emit): Pass false to
7652 EmitThis (we do not need the address).
7654 * codegen.cs (EmitThis): it needs to know whether we need the
7655 address of `this' or not. This is used by value types.
7657 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
7658 every other call passes false.
7660 2006-01-12 Raja R Harinath <rharinath@novell.com>
7663 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
7665 * expression.cs (Invocation.OverloadResolve): Update.
7666 (Invocation.DoResolve): Avoid double resolution of invocation.
7668 2006-01-11 Raja R Harinath <rharinath@novell.com>
7671 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
7672 unary negation of floating point types as 0-expr; negation cannot
7673 overflow in floating point types.
7676 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
7677 on operands of 'void' type.
7680 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
7681 and ExclusiveOr for boolean constants too.
7683 2006-01-09 Raja R Harinath <rharinath@novell.com>
7686 * expression.cs (Invocation.OverloadResolve): Replace reflected
7687 override methods with their base virtual methods, rather than
7689 * typemanager.cs (TypeManager.GetOverride): New.
7691 2006-01-05 Jb Evain <jbevain@gmail.com>
7693 * class.cs (Property.Define, Indexer.Define): do not tag the
7694 properties as SpecialName | RTSpecialName.
7696 2006-01-04 Miguel de Icaza <miguel@novell.com>
7698 * class.cs (MethodCore.IsDuplicateImplementation): This method was
7699 doing a low-level comparission of parameter types. It was lacking
7700 a check for __argslist.
7702 2005-12-30 Miguel de Icaza <miguel@novell.com>
7704 * expression.cs (ParameterReference.DoResolveBase): Allow
7705 reference parameters if they are local to this block.
7707 This allows the ref and out parameters of a delegate to be used in
7708 an anonymous method, for example:
7710 delegate void set (out int x);
7712 set s = delegate (out int x){
7716 This is used by functionality introduced late in the C# language.
7718 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
7719 method that take ref and out parameters.
7721 Fixes #77119 which was a late change in the spec.
7723 2005-12-23 Miguel de Icaza <miguel@novell.com>
7725 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
7726 parent if its the same scope. Fixes #77060.
7728 2005-12-21 Miguel de Icaza <miguel@novell.com>
7730 * driver.cs: Report the case of no source files and no -out:
7733 2005-12-20 Raja R Harinath <rharinath@novell.com>
7736 * expression.cs (ComposedCast.GetSignatureForError): Define.
7738 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7742 * namespace.cs (NamespaceEntry): Add extern_aliases as a
7743 ListDictionary, to contain the ExternAliasEntry entries (in
7744 addition to the NamespaceEntry.aliases hashtable). This field is
7745 shared between the original entry and its doppelganger (bodyless
7747 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
7748 extern_aliases field.
7749 (NamespaceEntry.Lookup): Move the IsImplicit check after the
7750 lookup in extern_aliases.
7752 2005-12-16 Raja R Harinath <rharinath@novell.com>
7755 * class.cs (TypeContainer.Mark_HasEquals): New.
7756 (TypeContainer.Mark_HasGetHashCode): New.
7757 (ClassPart): Override them.
7758 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
7761 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
7762 'parent' argument to the base constructor.
7764 Remove all mention of TypeContainer from decl.cs.
7765 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
7766 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
7767 (DeclSpace.DeclSpace): Likewise.
7768 (DeclSpace.DefineMembers): Remove unused argument.
7769 * cs-parser.jay (pop_current_class): Update to changes. Simplify
7770 debugging check -- we don't care if the debug code throws an
7771 InvalidCastException instead of an InternalErrorException.
7772 * class.cs (TypeContainer.DefineMembers): Update to changes.
7773 (TypeContainer.DoDefineMembers): Likewise.
7774 (TypeContainer.GetMethods): Likewise.
7775 (PropertyMember.Define): Likewise.
7776 (MemberBase.Parent): New property that forwards to
7777 MemberCore.Parent, but ensures that we get a TypeContainer.
7778 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
7779 (RootContext.PopulateTypes): Likewise. Remove special case code
7780 for !RootContext.StdLib: DefineMembers is idempotent.
7782 2005-12-14 Miguel de Icaza <miguel@novell.com>
7784 * convert.cs (ExplicitConversionCore): Check the return value from
7785 ExplicitConversionCore which can return null on failure. Fixes #76914
7787 2005-12-13 Marek Safar <marek.safar@seznam.cz>
7789 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
7791 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
7793 * doc.cs : The search for referenced namespace was insufficient to
7794 get global one as it used to do. Fixed bug #76965.
7796 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
7798 * doc.cs : check name in cref in the last phase that whether it is
7801 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
7803 * cs-tokenizer.cs : reverted the latest change: it somehow broke
7806 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
7808 * doc.cs : so it turned out that we cannot skip override check for
7809 interface members. Fixed bug #76954.
7811 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
7813 * cs-tokenizer.cs : fixed bug #75984:
7814 - #warning and #error should not be handled when the source line
7816 - #line is not checked strictly when the source line is disabled.
7817 - #define and #undef is on the other hand checked strictly at any
7820 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
7822 * cs-tokenizer.cs : missing Location (actually, filename) in one of
7825 2005-12-05 Marek Safar <marek.safar@seznam.cz>
7827 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
7829 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
7831 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
7832 (FieldBase.Initializer): Initializer is now optional.
7833 (EventField.Define): Only event field can have initializer.
7835 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
7837 * const.cs (Const): Reuse initializer.
7839 * cs-parser.jay: Updated after FieldBase changes.
7840 Added current_array_type to simplify array initializers.
7842 * ecore.cs (NullCast.IsDefaultValue): Implemented.
7844 * expression.cs, iterators.cs: Updated.
7846 * namespace.cs (NamespaceEntry): Made UsingFound private.
7848 2005-12-05 Marek Safar <marek.safar@seznam.cz>
7850 * parameterCollection.cs: Obsolete, removed.
7851 * parser.cs: Obsolete, removed.
7853 2005-12-05 Marek Safar <marek.safar@seznam.cz>
7856 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
7858 * enum.cs (Enum.Define): Set obsolete context here.
7860 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
7863 - FindDocumentedMember() now expects 1) paramList as null
7864 when "we don't have to check the number of parameters" and
7865 2) Type.EmptyTypes when "there is no arguments".
7866 - Introduced FoundMember struct to hold the exact type which was
7867 used to find the documented member (the above change broke
7868 test-xml-044; it might be better just to use DeclaringType than
7869 what MS does, like this change does, but it depends on usage.)
7871 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
7873 * doc.cs : documented member might be from DeclaringType for nested
7874 types. Fixed bug #76782.
7876 2005-12-03 Ben Maurer <bmaurer@ximian.com>
7878 * anonymous.cs: Have the param code handle leaving copies on the
7879 stack etc. Allows anonymous params to take part in the assignment
7880 code (++, +=, etc). Fixes bug #76550
7882 * expression.cs: Handle the prepare_for_load/leave_copy by passing
7883 it down to the anon code.
7885 * iterators.cs: Use dummy var here
7887 * codegen.cs: Handle new vars
7889 2005-12-01 Marek Safar <marek.safar@seznam.cz>
7892 * class.cs (MethodData.Define): Set proper Obsolete context.
7894 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
7896 (FieldExpr.DoResolve): Ditto.
7898 2005-12-01 Marek Safar <marek.safar@seznam.cz>
7901 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
7902 parent is not obsolete.
7904 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
7906 * doc.cs : (FindDocumentedMember) find parameterless members first
7907 and get CS0419 in the early stage. Fixed first case of bug #76727.
7909 2005-11-30 Marek Safar <marek.safar@seznam.cz>
7912 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
7913 no error was reported.
7915 *expression.cs (Binary.DoResolve): left can be null.
7917 2005-11-22 Marek Safar <marek.safar@seznam.cz>
7920 * class.cs (MethodData.Emit): Parameters should be labeled first.
7922 2005-11-21 Marek Safar <marek.safar@seznam.cz>
7925 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
7927 2005-11-18 Marek Safar <marek.safar@seznam.cz>
7929 * attribute.cs (AreParametersCompliant): Moved to Parameter.
7931 * class.cs (MethodCore): Parameter clean up.
7932 (IMethodData): Added ParameterInfo.
7933 (MethodData): Parameter clean up.
7934 (Indexer.Define): Parameter clean up.
7946 * typemanager.cs: Parameter clean up.
7948 * delegate.cs (Define): Get rid of duplicated code.
7950 * expression.cs (ParameterReference): Removed useless parameters
7952 (Invocation): Ditto.
7954 * parameter.cs (ParamsParameter): New class, params specialization.
7955 (ArglistParameter): Attemp to separate arglist.
7956 (Parameter): Refactored to be reusable and faster.
7957 (Parameter.Modifier): Made understandable.
7958 (Parameters): Changed to be used as a class for `this' assembly
7959 parameters. Refactored to use new specialized classes.
7961 * support.cs (ParameterData): Added Types property.
7962 (InternalParameters): Deleted.
7964 2005-08-20 Martin Baulig <martin@ximian.com>
7966 Merging this patch from GMCS to fix #75867.
7968 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
7969 scope if we don't already have it.
7971 2005-11-17 Martin Baulig <martin@ximian.com>
7974 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
7975 inherit the scope from our parent. Fixes #76653.
7977 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
7979 * doc.cs : the previous patch does not actually fix the bug.
7980 PropertyInfo override check is now implemented and really fixed it.
7981 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
7983 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
7985 * doc.cs : apply "override filter" also to properties.
7988 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
7990 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
7991 no need to check overrides. For classes, omit those results from
7992 interfaces since they must exist in the class. Fixed bug #76726.
7994 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
7996 * typemanager.cs : (GetFullNameSignature) differentiate indexers
7997 with different parameters. Fixed the second problem in #76685.
7999 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
8001 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
8002 get expected 'protected' access in CheckValidFamilyAccess()).
8005 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
8007 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
8008 Fixed bug #76705. CS1569 was incorrectly commented out.
8010 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
8012 * doc.cs : use Invocation.IsOverride() to do real override check.
8013 * expression.cs : made Invocation.IsOverride() internal.
8015 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
8017 * doc.cs : use TypeManager.FindMembers() instead of (possible)
8018 TypeBuilder.FindMembers() and filter overriden base members out.
8021 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
8023 * doc.cs : ref/out parameters are represented as '@' (instead of
8024 '&' in type FullName). Fixed bug #76630 (additionally crefs).
8026 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
8028 * doc.cs : when there was no '.' in cref to methods in doc comment,
8029 then parameters were missing in the output. Fixed bug #76691.
8031 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
8033 * driver.cs : don't output docs when there is an error.
8036 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
8039 Now it should detect indexers. Fixed primary concern in bug #76685.
8040 Fixed CS0419 message to not show the identical member signature in
8043 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
8045 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
8046 instead of Type.FindMembers() since it does not handle events.
8049 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
8051 * codegen.cs: Fixed typo (speficied -> specified).
8053 2005-11-11 Marek Safar <marek.safar@seznam.cz>
8056 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
8058 2005-11-11 Marek Safar <marek.safar@seznam.cz>
8060 * attribute.cs: Changed error message.
8062 * cs-tokenizer.cs: One more check.
8064 2005-11-10 Marek Safar <marek.safar@seznam.cz>
8066 * statement.cs (Block.Resolve): Ignore empty statement.
8068 2005-11-10 Marek Safar <marek.safar@seznam.cz>
8070 * report.cs: Made error/warning methods more strict to avoid
8073 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
8074 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
8075 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
8076 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
8078 2005-11-08 Marek Safar <marek.safar@seznam.cz>
8080 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
8081 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
8083 * class.cs (TypeContainer.IsComImport): New property.
8084 (Constructor.Define): Create proper ctor for ComImport types.
8086 * expression.cs (New.CheckComImport): Fixed.
8088 2005-11-07 Miguel de Icaza <miguel@novell.com>
8090 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
8091 that a parameter has been captured does not mean that we do not
8092 have to do the rest of the processing. This fixes the second part
8093 of #76592. If there was another anonymous method capturing
8094 values in the past, the Scope would never be set for the second
8095 method that captured the same parameter.
8097 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
8098 properly manipulate the stack. Second part of fix for #76592.
8100 * expression.cs (New): Add support for invoking "new" on
8101 interfaces that have been flagged with the ComImport attribute and
8102 the CoClass. Fixes #76637
8104 * statement.cs (Try.DoEmit): When a variable is captured, do not
8105 try to emit the vi.LocalBuilder variable as it has been captured.
8106 Create a temporary variable and store the results on the
8107 FieldBuilder. Fixes #76642
8109 2005-11-07 Marek Safar <marek.safar@seznam.cz>
8111 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
8113 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
8115 * expression.cs (Binary.DoResolve): Added && optimalization.
8117 * typemanager.cs (AddUserType): Removed useless argument.
8119 2005-11-04 Marek Safar <marek.safar@seznam.cz>
8121 * statement.cs (Block.variables): Uses ListDictionary.
8123 2005-11-03 Marek Safar <marek.safar@seznam.cz>
8126 * class.cs (PartialContainer.EmitType): Customized to emit
8127 security attributes.
8128 (ClassPart.ApplyAttributeBuilder): Transform security attribute
8129 for partial classes.
8131 2005-11-03 Marek Safar <marek.safar@seznam.cz>
8134 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
8135 access has to be fixed.
8137 * typemanager.cs (IsUnmanagedType): Wrong common field type.
8139 2005-11-01 Marek Safar <marek.safar@seznam.cz>
8142 * ecore.cs (NullCast.Reduce): Implemented.
8144 * expression.cs (ArrayCreation.CheckIndices): Correcly check
8147 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
8149 (Foreach.Resolve): Catch null properly.
8151 2005-10-29 Marek Safar <marek.safar@seznam.cz>
8153 * cs-tokenizer.cs: Warning text fix.
8155 * driver.cs: AllWarningNumbers exposed on public interface.
8157 * report.cs (): Reviewed warning numbers.
8158 (IsValidWarning): Use binary search.
8160 2005-10-29 Marek Safar <marek.safar@seznam.cz>
8162 * driver.cs: Implemeted resource visibility.
8163 (Resources): New class for code sharing between /res: and
8166 2005-10-28 Marek Safar <marek.safar@seznam.cz>
8169 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
8172 * convert (Convert.ImplicitReferenceConversion): NullCast holds
8175 * ecore.cs (NullCast): Child is contant only.
8177 * literal.cs (NullLiteral.Reduce): null can be converted to any
8180 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
8182 * driver.cs: Use Encoding.Default as default code page instead
8185 2005-10-27 Raja R Harinath <rharinath@novell.com>
8188 * expression.cs (Invocation.Error_InvalidArguments): Handle
8189 __arglist parameters.
8190 (Invocation.VerifyArgumentsCompat): Likewise.
8191 * support.cs (ReflectionParameters.GetSignatureForError): Print
8192 __arglist parameters.
8193 (InternalParamters.GetSignatureForError): Likewise.
8194 * parameter.cs (Parameters.GetSignatureForError): Likewise.
8196 2005-10-26 Marek Safar <marek.safar@seznam.cz>
8198 * attribute.cs (GetPropertyValue): Made public.
8200 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
8202 Add new property WrapNonExceptionThrows to handle 2.0 assembly
8204 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
8207 * driver.cs: Reflect method name change.
8209 * statement.cs (Try.Resolve): Warn when try has both general
8212 * typemanager.cs: runtime_compatibility_attr_type new predefined
8215 2005-10-26 Raja R Harinath <harinath@gmail.com>
8218 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
8219 treat it as an empty parameter list.
8221 2005-10-26 Raja R Harinath <rharinath@novell.com>
8224 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
8225 ResolveAsTypeStep silent.
8226 * statement.cs (Block.AddConstant): Mark block as used.
8227 (Block.ResolveMeta): Avoid piling on error messages
8228 if a constant initializer resolution fails.
8230 2005-10-25 Raja R Harinath <rharinath@novell.com>
8232 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
8234 (NamespaceEntry.VerifyAllUsing): New.
8235 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
8236 behaviour. Delegates actual resolution of alias to ...
8237 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
8238 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
8240 * driver.cs (Driver.MainDriver): Update.
8242 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
8243 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
8245 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
8247 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
8248 RootNamespace.DefineNamespacesForAll.
8250 2005-10-24 Raja R Harinath <harinath@gmail.com>
8252 * typemanager.cs (assemblies, external_aliases, modules)
8253 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
8254 (ComputeNamespaces, GetRootNamespace): Remove extra staging
8255 overhead. Move resposibility ...
8256 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
8257 * driver.cs, attribute.cs, codegen.cs: Update to changes.
8259 2005-10-23 Raja R Harinath <harinath@gmail.com>
8261 * namespace.cs (RootNamespace.all_namespaces): Renamed from
8262 cached_namespaces. Improve usage.
8263 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
8264 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
8265 Move from GlobalRootNamespace and simplify.
8266 (RootNamespace.Global): Make instance variable.
8267 (RootNamespace.RootNamespace): Add "alias name" parameter.
8268 (GlobalRootNamespace): Simplify drastically.
8269 (Namespace.Lookup): Don't use GetNamespace.
8270 * typemanager.cs (GetRootNamespace): Rename from
8271 ComputeNamespaceForAlias.
8272 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
8274 2005-10-23 Marek Safar <marek.safar@seznam.cz>
8276 * anonymous.cs (AnonymousContainer): Don't crash when container
8279 2005-10-23 Marek Safar <marek.safar@seznam.cz>
8281 * expression.cs (Binary.DoResolve): Warn when comparing same
8284 2005-10-23 Marek Safar <marek.safar@seznam.cz>
8287 * expression.cs (Binary.DoResolve): It looks like there are no
8288 convetsion rules in enum context.
8290 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
8292 Add support for extern alias qualifiers.
8293 * typemanager.cs: Move some LookupTypeReflection code
8294 to namespace.cs, to have cleaner code. Added some methods
8295 to help us keep track of the extern aliased references.
8296 * driver.cs: Add suport for extern alias assemblies on command
8297 line and check for their warnings/errors. Also keep track of the
8298 extern aliased assemblies.
8299 * namespace.cs: Move the global functionality of Namespace
8300 to GlobalRootNamespace/RootNamespace. Now the global namespace
8301 is GlobalRootNamespace.Globa. Also the code moved from
8302 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
8303 Finally added LocalAliasEntry (AliasEntry before) and
8304 ExternAliasEntry, to handle alias statements.
8305 * cs-parser.jay: Add support in the grammar for extern alias
8307 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
8308 Update callings to Namespace (now in GlobalRootNamespace).
8310 2005-10-18 Raja R Harinath <rharinath@novell.com>
8313 * class.cs (TypeContainer.DefineType): Move updating of
8314 topological sort earlier in the code.
8315 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
8317 2005-10-18 Marek Safar <marek.safar@seznam.cz>
8320 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
8322 * constant.cs (Constant.TryReduce): Moved from Cast class.
8323 (Reduce): Made little bit more OO and fixed missing conversions.
8325 * ecore.cs (Reduce): Implemented.
8326 (Binary.EnumLiftUp): New method to upgrade values to enum values.
8328 * literal.cs (Reduce): Implemented.
8330 * class.cs: Reverted Miguel's wrong commit.
8332 2005-10-14 Miguel de Icaza <miguel@novell.com>
8334 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
8336 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
8338 * cs-parser.jay, expression.cs : CS0214 was missing error location
8339 for constants. Fixed bug #76404.
8341 2005-10-11 Marek Safar <marek.safar@seznam.cz>
8344 * convert.cs (ExplicitConversionCore): Fixed object->enum
8347 2005-10-10 Raja R Harinath <rharinath@novell.com>
8349 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
8351 (PropertyExpr.EmitCall): Likewise.
8352 * expression.cs (Invocation.EmitArguments): Handle case where
8354 (Invocation.EmitCall): Avoid allocating temporary variable if
8355 there are no arguments.
8357 2005-10-07 Raja R Harinath <rharinath@novell.com>
8360 * convert.cs (ImplicitConversionStandard): Move conversion of
8361 void* to arbitrary pointer types ...
8362 (ExplicitConversionStandard): .. here.
8363 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
8364 error to always print typenames.
8366 2005-10-07 Raja R Harinath <rharinath@novell.com>
8368 * convert.cs (GetConversionOperator): Rename from
8369 GetConversionOperators. Move operator selection code from ...
8370 (UserDefinedConversion): ... here.
8372 2005-10-06 Marek Safar <marek.safar@seznam.cz>
8374 * convert.cs (ExplicitConversionCore): Removed duplicate enum
8377 2005-10-05 Marek Safar <marek.safar@seznam.cz>
8379 * assign.cs (Assign.DoResolve): Error method changed.
8381 * cfold.cs (DoConstantNumericPromotions): Error method changed.
8383 * const.cs (ResolveValue): Reset in_transit immediately.
8385 * constant.cs: Error method changed.
8387 * convert.cs: Removed useless location parameter.
8388 (ExplicitNumericConversion): Don't do double enum check.
8389 (ExplicitConversionCore): Renamed from ExplicitConversion.
8390 (ExplicitUnsafe): Extracted from ExplicitConversion.
8391 (ExplicitConversion): Uses for error reporting.
8393 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
8395 (ResolveBoolean): Uses common error method.
8396 (CastToDecimal): Get rid of ec.
8397 (CastFromDecimal): Optimized.
8398 (ConvCast): Get rid of ec.
8400 * enum.cs (ResolveValue): Reset in_transit immediately.
8401 (Emit): Return after first error.
8403 * expression.cs: Convert changes.
8405 * literal.cs: Error method changed.
8407 * statement.cs: Error method changed.
8409 2005-10-03 Raja R Harinath <rharinath@novell.com>
8411 * support.cs (SeekableStreamReader.Position): Don't error out when
8412 the requested position is just beyond the end of the current
8415 2005-09-28 Raja R Harinath <rharinath@novell.com>
8417 * support.cs (SeekableStreamReader): Simplify drastically. Don't
8418 try to keep in sync with the byte count of the underlying Stream.
8419 However, this limits us to a window size of 2048 characters: i.e.,
8420 the maximum lookahead of our lexer/parser can be 2048 characters.
8422 2005-09-28 Marek Safar <marek.safar@seznam.cz>
8425 * driver.cs: Fix compilation files with full root path.
8427 2005-09-25 Miguel de Icaza <miguel@novell.com>
8429 * report.cs (SymbolRelatedToPreviousError): Format the output so
8430 it does not use an open parenthesis that is never closed.
8432 * driver.cs: Follow coding guidelines
8434 2005-09-27 Marek Safar <marek.safar@seznam.cz>
8437 * const.cs (Const.ResolveValue): Check for assigning non-null
8438 value to reference type.
8440 2005-09-27 Marek Safar <marek.safar@seznam.cz>
8442 * anonymous.cs: Implemented ExprClassName.
8444 * assign.cs (Assign.DoResolve): Don't chrash when type is not
8447 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
8450 * class.cs (StaticClass.DefineContainerMembers): Report protected
8453 * codegen.cs: if(ed) PRODUCTION.
8455 * convert.cs (Error_CannotImplicitConversion): Better error
8458 * cs-parser.jay: More error checks.
8460 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
8462 * driver.cs (CSCParseOption): Enabled wrong option check.
8464 * ecore.cs (Expression.ExprClassName): Turned to property.
8465 (MemberExpr.CheckIntermediateModification): For checking boxed
8466 value types modification.
8468 * statement.cs (Fixed.Resolve): Expression type must be
8469 convertible to fixed type.
8470 (CollectionForeach.GetEnumeratorFilter,TryType):
8471 Small refactoring for easier error checking.
8473 2005-09-26 Marek Safar <marek.safar@seznam.cz>
8475 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
8478 * class.cs (GeneratedBaseInitializer): New class for customization
8479 compiler generated initializers.
8480 (MemberBase.DoDefine): Check Obsolete attribute here.
8481 (FieldMember.DoDefine): Ditto.
8483 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
8486 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
8487 (MemberCore.GetObsoleteAttribute): Removed argument.
8488 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
8489 (MemberCore.CheckObsoleteType): New helper.
8493 * statement.cs: Updates after MemberCore changes.
8495 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
8496 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
8498 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
8499 obsolete attribute for compiler construct.
8500 (As.DoResolve): Cache result.
8502 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
8504 2005-09-26 Raja R Harinath <rharinath@novell.com>
8507 * expression.cs (This.VerifyFixed): In a value type T, the type of
8508 'this' is T&, iow, 'this' is either an out or ref parameter. In a
8509 value type R, 'this' is treated as a value parameter.
8511 2005-09-22 Miguel de Icaza <miguel@novell.com>
8513 * statement.cs (Lock): Use the TemporaryVariable class instead of
8514 manually using local variables as those do not work when variables
8517 * ecore.cs: Moved the TemporaryVariable class from being a nested
8518 class inside Foreach to be a public class that can be employed in
8521 2005-09-19 Marek Safar <marek.safar@seznam.cz>
8523 * cs-parser.jay: interface_accessors replaced by
8524 accessor_declarations.
8526 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
8529 * statement.cs (GotoCase.Resolve): Convert null constant to
8531 (SwitchLabel.ResolveAndReduce): Ditto.
8532 (SwitchLabel.NullStringCase): Custom null stamp.
8533 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
8535 typemanager.cs (CSharpSignature): Don't skip first argument
8538 2005-09-18 Miguel de Icaza <miguel@novell.com>
8540 * driver.cs: Set InEmacs based on the environment variable EMACS.
8542 * location.cs (InEmacs): in this mode, do not report column
8543 location as it confuses Emacs.
8545 2005-09-16 Marek Safar <marek.safar@seznam.cz>
8547 * cfold.cs, constant.cs, convert.cs, ecore.cs,
8548 expression.cs, iterators.cs, literal.cs: Store constants and
8551 * class.cs (MemberBase.ShortName): Pass location.
8553 * cs-parser.jay: Some location fixes.
8555 * ecore.cs (Expression.Location): Made virtual.
8557 2005-09-05 Miguel de Icaza <miguel@novell.com>
8559 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
8560 if the underlying types are the same, otherwise we need to produce
8561 code that will do the proper cast.
8563 This was exposed by Marek's constant rewrite which produced
8564 invalid code for the call site:
8567 void Method (X v) {}
8571 This fixes test-49.cs
8573 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
8575 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
8576 Type/Object should be allowed as well. Fixed bug #75968.
8578 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
8580 * expression.cs : (Binary.DoResolve): when one is enum constant and
8581 another is constant 0, then return enum one *as enum type*.
8584 2005-09-02 Raja R Harinath <rharinath@novell.com>
8586 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
8590 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
8591 flow-branching for LocalVariableReferences in case we were invoked
8592 from a MemberAccess.
8593 * expression.cs (LocalVariableReference.VerifyAssigned): New.
8595 (LocalVariableReference.DoResolveBase): ... this.
8596 (MemberAccess.Resolve): Do the check that was disabled during
8599 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
8602 (PartialContainer.Create): check abstract/sealed/static strictly
8603 but abstract/sealed can exist only at one side. Fixed bug #75883.
8605 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
8608 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
8609 specified, don't default to UnmanagedType.I4.
8611 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
8613 * expression.cs : conditional operator should check possibly
8614 incorrect assign expression. Fixed bug #75946.
8616 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
8618 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
8619 Reverting the change. gmcs is much complex than mcs on this matter.
8621 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
8623 * cs-tokenizer.cs : To read another token ahead of the actual
8624 consumption, use new SavedToken and cache token instead of moving
8625 back the stream with SeekableStreamReader (it seemed problematic).
8627 driver.cs : Thus use StreamReader directly.
8628 * support.cs : Thus removed SeekableStreamReader.
8630 2005-08-30 Raja R Harinath <rharinath@novell.com>
8633 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
8634 (ScopeInfo.EmitScopeType): Use it to construct field names from
8635 names of captured locals.
8638 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
8639 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
8640 Pass 'target_type' to BoxedCast. Don't default to 'object'.
8641 (ExplicitConversion): Remove enum cases already handled by
8642 implicit conversion. Move implicit conversion check to the beginning.
8643 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
8644 * expression.cs (ArrayCreation.EmitDynamicInitializers):
8645 Don't treat System.Enum as a struct.
8647 2005-08-30 Jb Evain <jbevain@gmail.com>
8649 * attribute.cs: handles as expression in parameters.
8651 2005-08-30 Raja R Harinath <rharinath@novell.com>
8654 * class.cs (TypeContainer.VerifyClsName): Don't use a
8655 PartialContainer when verifying CLS compliance.
8656 (AbstractPropertyEventMethod): Set Parent here, ...
8657 (PropertyMethod): ... not here.
8659 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
8661 * attribute.cs : escaped attribute name should not be allowed to be
8662 resolved (e.g. @class as classAttribute). Fixed bug #75930.
8664 2005-08-29 Raja R Harinath <rharinath@novell.com>
8667 * convert.cs (ImplicitStandardConversionExists): Allow zero also
8668 when converting a long constant to unsigned long.
8669 * expression.cs (Invocation.OverloadResolve): Add sanity check to
8670 detect where IsApplicable and VerifyArgumentsCompat disagree.
8672 2005-08-29 Raja R Harinath <rharinath@novell.com>
8673 and Carlos Alberto Cortez <carlos@unixmexico.org>
8676 * class.cs (TypeContainer.CanElideInitializer): New helper.
8677 (TypeContainer.EmitFieldInitializers): Use it to determine if we
8678 can safely emitting the initializer of a field.
8680 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
8682 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
8683 allowed inside a switch (without loop). Fixed bug #75433.
8685 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
8687 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
8688 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
8690 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
8692 * driver.cs : kinda reverting the default encoding changes (not exact
8693 revert since I noticed that "codepage:reset" might not work fine).
8695 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
8697 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
8698 Location. Now getter and setter store location correctly.
8699 (errors/cs0111-12.cs now reports the expected location.)
8701 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
8703 * driver.cs : Use default encoding on the environment.
8704 Removed (now that) extra parameter for SeekableStreamReader.
8705 * support.cs : (SeekableStreamReader) third .ctor() argument for
8706 StreamReader is not required (always true). preamble size could
8707 be acquired in simpler and safe way.
8709 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
8711 * cs-parser.jay: report CS0642 at warning level 3
8712 and report CS0642 for an if else statement also
8713 fixes bug #74745. Patch by John Luke (and a bit
8715 Removed extra CS0642 warning check for "while",
8717 * statement.cs: In Block.Resolve(), CS0642 check
8718 is reimplemented to check a sequence of an empty
8719 statement and a block.
8721 Both fix bug #66777.
8723 2005-08-24 Marek Safar <marek.safar@seznam.cz>
8725 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
8726 detection until I fix it.
8728 * cs-tokenizer.cs: Changed error message.
8730 * cs-parser.jay: Fixed 2 error locations.
8732 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
8733 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
8736 * enum.cs (GetSignatureForError): Fixed.
8738 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
8742 * typemanager.cs (RegisterProperty): Removed.
8744 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
8746 2005-08-24 Raja R Harinath <rharinath@novell.com>
8749 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
8750 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
8752 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
8754 * expression.cs : tiny fix is required for not warning positive ulong.
8757 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
8759 * expression.cs : add CS0652 check for constant and integral
8760 expression. Fixed bug #53974.
8762 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
8764 * expression.cs : in DoNumericPromotions(), check if there is implicit
8765 conversion overload for string (to check CS0034). Fixed bug #52492.
8767 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
8769 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
8771 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
8773 * ecore.cs : report location when it is *not* Null.
8775 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
8781 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
8782 correctly. Fixed bug #75721.
8784 2005-08-23 Raja R Harinath <rharinath@novell.com>
8786 * support.cs (SeekableStreamReader.Position): Avoid an expensive
8787 loop that performs 'min (pos, char_count)'.
8790 * expression.cs (Unary.ResolveOperator): Don't discard implicit
8791 converted value in Operator.OnesComplement.
8793 2005-08-22 Ben Maurer <bmaurer@ximian.com>
8795 * anonymous.cs: If the anon method is pulled into a helper class,
8796 it needs to be `internal' not `private'. Fixes runtime behavior on
8799 2005-08-20 Martin Baulig <martin@ximian.com>
8801 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
8802 scope if we don't already have it.
8804 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
8805 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
8808 2005-08-17 Marek Safar <marek.safar@seznam.cz>
8811 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
8814 2005-08-16 Marek Safar <marek.safar@seznam.cz>
8816 The big constants rewrite
8817 Fix #75746, #75685 and more
8818 As a side effect saved 1MB for MWF ;-)
8820 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
8821 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
8822 enum based for corlib compilation.
8824 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
8827 * class.cs (FixedField.Define): Use ResolveAsConstant.
8829 * const.cs (IConstant): Interface constants and enums.
8830 (Const.ResolveValue): New method for constant resolvning.
8831 (ExternalConstant): Constants from imported assemblies.
8833 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
8834 conversion; like enums.
8835 (Constant.ToType): Converts this constant to different type.
8836 (Constant.Increment): Adds 1.
8838 * convert.cs (ImplicitConversionRequired): Simplified.
8840 * cs-parser.jay: Create EnumMember directly.
8842 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
8844 * doc.cs (GenerateEnumDocComment): Removed.
8846 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
8847 (ConvertIntLiteral): Removed.
8848 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
8850 * enum.cs (EnumMember): Implement IConstant.
8851 (Enum.IsValidEnumConstant): Removed.
8852 (Enum.GetNextDefaultValue): Removed.
8853 (Enum.FindMembers): Updated.
8854 (Enum.GenerateDocComment): Iterate enum members.
8856 * expression.cs (Cast.TryReduce): Handle enums correctly.
8857 (New.Constantify): Made public.
8858 (MemberAccess.DoResolve): Removed contant specific if(s).
8860 * literal.cs (NullLiteral): Implement new abstract methods.
8862 * statement.cs (GotoCase.Resolve): Use new constant methods.
8863 (SwitchLabel.ResolveAndReduce): Use new constant methods.
8865 * typemanager.cs (LookupEnum): Removed.
8866 (IsEnumType): Fixed to work with corlib.
8867 (RegisterConstant): Removed.
8868 (LookupConstant): Removed.
8869 (GetConstant): Changed to work with IConstant.
8871 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
8873 * location.cs : Fixed overflown (>255) column number.
8875 2005-08-03 Raja R Harinath <rharinath@novell.com>
8877 First cut of the qualified-alias-member feature.
8878 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
8880 * cs-parser.jay (DOUBLE_COLON): New token.
8881 (namespace_or_type_name): Add rule for recognizing
8882 qualified-alias-members.
8883 (primary_expression): Likewise.
8884 (element_access): Allow QualifiedAliasMember as a possible
8885 type-bearing expression.
8886 (local_variable_type, local_variable_pointer_type): Likewise.
8887 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
8888 aliases in the current and enclosing namespace declarations.
8889 (NamespaceEntry.UsingAlias): Add CS0440 warning.
8890 * decl.cs (MemberName.is_double_colon): New.
8891 (MemberName.MemberName): Add new constructor for alias-member.
8892 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
8893 * expression.cs (QualifiedAliasMember): New expression type.
8895 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
8897 * location.cs : it borked when no argument was specified.
8899 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
8901 * location.cs : tiny ToString() format fix.
8903 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
8905 * statement.cs : oops, it was missing.
8907 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
8909 A set of fixes for precise line/column location.
8912 "token" field now holds a file/line "delta", a line number offset
8913 from the segment, and a column number. See also:
8914 http://lists.ximian.com/pipermail/mono-devel-list/2004-
8915 December/009508.html
8916 Removed static IsNull. Use instance IsNull property instead.
8918 For some tokens it stores Location. For Identifier it stores
8919 LocatedToken which is a pair of string name and location.
8920 Column numbers are adjusted only at getChar().
8922 Use Location.ToString() for reporting (it now contains column).
8924 Largely modified to use LocatedToken instead of
8925 string (IDENTIFIER), and to acquire Location from some tokens.
8926 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
8927 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
8929 Now MemberName holds Location. DeclSpace.ctor() receives Location
8930 as a parameter. Removed extra parameters to all derived classes.
8931 Replaced Location.IsNull() with instance property.
8932 * assign.cs, expression.cs :
8933 Added .ctor() overload that omits Location.
8935 Added "nameEscaped" flag that indicates the identifier was escaped
8936 in the source file. This fixes bug #57047.
8938 2005-08-02 Marek Safar <marek.safar@seznam.cz>
8940 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
8941 New method, looking for lo-case imported cls type.
8943 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
8946 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
8948 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
8950 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
8952 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
8954 Optimized to save 3.5 MB for SWF compilation.
8956 2005-08-01 Marek Safar <marek.safar@seznam.cz>
8958 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
8959 (PartialContainer.Create): Moved logic AddToContainer.
8960 (PartialContainer.MarkForDuplicationCheck): Shares name.
8962 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
8965 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
8967 (Namespace.GetSignatureForError): New method.
8969 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
8970 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
8972 2005-08-01 Raja R Harinath <rharinath@novell.com>
8975 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
8976 member lookup rather than qualifier_type, since qualifier_type can
8979 2005-08-01 Marek Safar <marek.safar@seznam.cz>
8981 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
8984 2005-07-31 Miguel de Icaza <miguel@novell.com>
8986 * statement.cs: Copy the local exception into the exception
8987 captured local. Fixes 75674
8989 2005-07-31 Raja R Harinath <harinath@gmail.com>
8992 * expression.cs (Invocation.OverloadResolve): Don't report error
8993 CS1501 if error CS1502 has been reported.
8994 (New.DoResolve): Delegate CS1501 reporting to
8995 Invocation.OverloadResolve.
8998 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
8999 invariant-meaning-in-block property in an enclosing block if
9002 2005-07-29 Marek Safar <marek.safar@seznam.cz>
9004 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
9005 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
9006 (Switch.CheckSwitch): Just save 50kb for SWF.
9008 2005-07-27 Martin Baulig <martin@ximian.com>
9010 * anonymous.cs (CaptureContext.AddField): Added
9011 `AnonymousContainer am' argument; compute its toplevel scope if
9012 it's not already computed. Fixes #75649.
9014 2005-07-26 Raja R Harinath <rharinath@novell.com>
9017 * class.cs (Constructor.Emit): Reset block to null if the block
9020 2005-07-25 Marek Safar <marek.safar@seznam.cz>
9022 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
9024 2005-07-25 Marek Safar <marek.safar@seznam.cz>
9026 * class.cs (MethodData.Define): Check whether accessor implementing
9027 interface is public.
9029 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
9031 2005-07-22 Marek Safar <marek.safar@seznam.cz>
9034 * namespace.cs (LookupType): Moved same type check to...
9036 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
9039 2005-07-21 Raja R Harinath <rharinath@novell.com>
9041 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
9042 already found a typebuilder.
9043 * class.cs (MethodCore.IsDuplicateImplementation): Compare
9044 MemberNames, not strings.
9046 * const.cs (Error_ExpressionMustBeConst):
9047 Rename from Error_EpressionMustBeConst.
9048 * const.cs, class.cs, statement.cd: Update.
9050 2005-07-21 Marek Safar <marek.safar@seznam.cz>
9054 * const.cs (Const.LookupConstantValue): Report missing contant expression
9056 (Error_EpressionMustBeConstant): Only one error method.
9058 * class.cs, statement.c: Updated.
9060 2005-07-20 Raja R Harinath <rharinath@novell.com>
9062 * statement.cs (Block.Flags): Add back HasVarargs.
9063 (Block.flags): Make protected.
9064 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
9066 * typemanager.cs (types, typecontainers, user_types): Remove.
9067 (UserTypes, TypeContainers): Likewise.
9068 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
9069 (CleanUp, Reset): Update.
9070 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
9071 (GetNestedType): Use Type.GetNestedType.
9072 (CoreLookupType): Take two arguments, the namespace and the
9073 basename of the type. Update to use the Namespace.Lookup
9075 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
9076 (RealMemberLookup): Use IsNestedChildOf instead of playing with
9077 string concatenation and substring matches.
9078 * class.cs, enum.cs, delegate.cs: Update to changes.
9080 2005-07-20 Marek Safar <marek.safar@seznam.cz>
9082 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
9083 Expression and made virtual.
9085 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
9086 (ImplicitStandardConversionExists): Fixed `byte' typo ?
9088 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
9090 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
9093 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
9096 2005-07-18 Marek Safar <marek.safar@seznam.cz>
9099 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
9100 AssemblyCultureAttribute is not used on executable.
9103 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
9105 2005-07-16 Raja R Harinath <rharinath@novell.com>
9108 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
9109 New. Reports CS0252/CS0253.
9110 Mostly taken from preliminary patch by Duncak Mak.
9111 (Binary.DoResolveOperator): Store results of operator lookup.
9112 Use them to detect if we need to warn about unintended reference
9115 2005-07-15 Raja R Harinath <rharinath@novell.com>
9118 * namespace.cs (Namespace.Lookup): Add back location parameter.
9119 (Namespace.LookupType): Add CS0436 report. Add location parameter.
9120 * delegate.cs, ecore.cs, expression.cs: Update to changes.
9122 * codegen.cs (EmitContext.DeclSpace): Make readonly.
9123 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
9124 (Namespace.LookupType): ... this.
9125 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
9127 * typemanager.cs (LookupTypeReflection): Remove buggy code that
9128 purported to handle pointers.
9129 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
9132 2005-07-15 Marek Safar <marek.safar@seznam.cz>
9134 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
9137 2005-07-15 Raja R Harinath <rharinath@novell.com>
9139 * namespace.cs (Namespace.Lookup): Drop location parameter.
9140 (NamespaceEntry.LookupAlias): Remove. Merge into ...
9141 (NamespaceEntry.Lookup): ... this.
9142 (NamespaceEntry.Error_AmbiguousTypeReference):
9143 Move here from DeclSpace.
9144 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
9146 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
9147 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
9148 Move to NamespaceEntry.
9149 * delegate.cs, expression.cs: Update to changes.
9151 2005-07-14 Marek Safar <marek.safar@seznam.cz>
9153 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
9154 CheckAttributeType and refactored.
9155 (Attribute.ResolvePossibleAttributeType): Changed to reuse
9156 ResolveAsTypeTerminal error handling.
9157 (ResolveAsTypeTerminal): Introduced because of global attributes extra
9159 (GetSignatureForError): Print errors in same way.
9162 * codegen.cs: Reflect attribute GetSignatureForError change.
9165 * expression.cs: Add silent parameter to ResolveAsTypeStep.
9167 * namespace.cs (UsingEntry): Refactored to make fields private.
9170 statement.cs: Error_UnexpectedKind has extra parameter.
9172 2005-07-14 Raja R Harinath <rharinath@novell.com>
9174 * ecore.cs (IAlias): Remove.
9175 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
9176 that implement the interface.
9177 * namespace.cs (Namespace): Likewise.
9178 (Namespace.declspaces): Renamed from 'defined_names'.
9179 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
9180 DeclSpace instead of an IAlias.
9181 * tree.cs (Tree.AddDecl): Update.
9183 2005-07-12 Raja R Harinath <rharinath@novell.com>
9185 * statement.cs (Block.Flags); Remove HasVarargs.
9186 (Block.HasVarargs): Move to ToplevelBlock.
9187 (Block.ThisVariable, Block.AddThisVariable): Likewise.
9188 (Block.Variables): Make protected. Initialize variable hashtable
9190 (Block.AddVariable): Update.
9191 (Block.Resolve): Update to changes.
9192 (ToplevelBlock.HasVarargs): New boolean.
9193 (ToplevelBlock.ThisVariable): Move here from Block.
9194 (ToplevelBlock.AddThisVariable): Likewise.
9195 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
9196 * expression.cs (This.ResolveBase): Update to changes.
9197 (ArglistAccess.DoResolve): Likewise.
9199 2005-07-11 Marek Safar <marek.safar@seznam.cz>
9202 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
9204 * class.cs (TypeContainer.VerifyMembers): Distinguish between
9205 not used and not used & assigned.
9206 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
9208 2005-07-11 Marek Safar <marek.safar@seznam.cz>
9211 * expression.cs (Is.DoResolve): null is never provided type.
9213 2005-07-08 Marek Safar <marek.safar@seznam.cz>
9216 * cs-parser.jay: Less strict event error rule to catch more errors.
9218 2005-07-08 Martin Baulig <martin@ximian.com>
9220 Fix test-iter-10.cs - distinguish whether we `yield' in a property
9221 gettter (allowed) or setter (not allowed).
9223 * class.cs (Accessor): Implement IIteratorContainer.
9224 (Accessor.Yields): New public field.
9225 (PropertyBase.PropertyMethod.Define): Handle iterators on a
9229 (get_accessor_declaration, set_accessor_declaration): Set the
9230 `yields' flag on the accessor, not the property.
9231 (property_declaration): Do the iterators check on a per-accessor
9232 basis and not for the whole property.
9234 2005-07-08 Martin Baulig <martin@ximian.com>
9236 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
9237 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
9239 2005-07-07 Marek Safar <marek.safar@seznam.cz>
9242 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
9243 (ExtractSecurityPermissionSet): Cope with self referencing security
9244 attributes properly.
9246 * driver.cs (SetOutputFile): Made public property OutputFile.
9248 2005-07-07 Raja R Harinath <rharinath@novell.com>
9251 * class.cs (TypeContainer.first_nonstatic_field): Rename from
9252 has_nonstatic_fields. Make into a FieldBase pointer.
9253 (TypeContainer.AddField): Add CS0282 check.
9254 (TypeContainer.EmitType): Update.
9256 2005-07-06 Miguel de Icaza <miguel@novell.com>
9258 * cs-tokenizer.cs (consume_identifier): Do not create strings to
9259 compare if they start with __.
9261 2005-07-06 Raja R Harinath <rharinath@novell.com>
9263 * statement.cs (Switch.SwitchGoverningType): Only look at
9264 UserCasts that don't need implicit standard conversions to one of
9265 the allowed switch types (Fixes test-322.cs).
9266 (LocalInfo.Resolve): Re-enable sanity-test.
9268 2005-07-06 Marek Safar <marek.safar@seznam.cz>
9270 * cs-tokenizer.cs (consume_identifier): Detect double undescores
9272 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
9274 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
9276 2005-07-06 Raja R Harinath <rharinath@novell.com>
9279 * ecore.cs (SimpleName.GetSignatureForError): Add.
9280 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
9281 (MemberAccess.GetSignatureForError): Add.
9283 2005-07-05 Marek Safar <marek.safar@seznam.cz>
9285 The big error and warning messages review.
9315 * typemanager.cs: Updated.
9317 * class.cs: (MethodCore.SetYields): Moved here to share.
9318 (PropertyMethod.Define): Moved iterator setup here.
9320 * iterators.cs: Add orig_method to have full access to parent
9323 2005-07-05 Raja R Harinath <rharinath@novell.com>
9325 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
9326 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
9327 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
9328 variable of struct type.
9329 * expression.cs (Unary.ResolveOperator): Update to change.
9330 (Indirection.VerifyFixed): Likewise.
9331 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
9332 (ParameterReference.VerifyFixed): Value parameters are fixed.
9333 (This.VerifyFixed): Treat 'this' as a value parameter.
9334 * statement.cs (LocalInfo.IsFixed): Remove.
9336 2005-07-01 Martin Baulig <martin@ximian.com>
9338 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
9339 `ec.EmitThis ()' to get the correct scope.
9341 2005-07-01 Martin Baulig <martin@ximian.com>
9343 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
9344 instance is a ParameterReference; fixes #75299.
9346 2005-07-01 Martin Baulig <martin@ximian.com>
9348 Reverted Marek's latest patch (r46725):
9349 - it contains structural changes which are neither mentioned in
9350 the ChangeLog nor explained anywhere; for example the additional
9351 argument of EmitContext's and Iterator's .ctor's and the
9352 TypeContainer.DefineMembers() change.
9353 - structural changes like this should go in in seperate patches
9354 and not be hidden in a huge patch which just seems to affect
9355 warnings and errors.
9356 a big and hard to understand patch.
9357 - it breaks iterators and causes regressions, for instance in
9360 2005-06-30 Raja R Harinath <rharinath@novell.com>
9363 * expression.cs (Indexers.map): Remove.
9364 (Indexers.Append): Filter out inaccessible setters and getters.
9365 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
9368 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
9370 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
9371 (FieldExpr.Emit, PropertyExpr.Emit): Update.
9372 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
9373 * expression.cs (Invocation.EmitCall): Add CS0120 check.
9375 2005-06-30 Marek Safar <marek.safar@seznam.cz>
9378 * class.cs (FieldBase.GetInitializerExpression): One more field
9381 2005-06-28 Miguel de Icaza <miguel@novell.com>
9383 * pending.cs: Do not define a proxy if the base method is virtual,
9384 it will be picked up by the runtime (bug 75270).
9386 2005-06-08 Martin Baulig <martin@ximian.com>
9388 The big Iterators rewrite :-)
9390 * iterators.cs: Rewrite this to use the anonymous methods framework.
9392 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
9393 before the TypeContainers; see 2test-21.cs.
9396 (TypeContainer.DefineType): Don't create a new EmitContext if we
9397 already have one (this only happens if we're an Iterator).
9398 (TypeContainer.Define): Also call Define() on all our iterators.
9399 (Method.CreateEmitContext): Added support for iterators.
9402 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
9403 (AnonymousContainer.CreateMethodHost): Moved here from
9404 AnonymousMethod and made abstract.
9405 (AnonymousContainer.CreateScopeType): New abstract method.
9406 (AnonymousContainer.IsIterator): New public property.
9407 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
9408 get the ScopeTypeBuilder rather than manually defining it here.
9409 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
9412 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
9413 before RootContext.DefineTypes().
9415 * codegen.cs (EmitContext.RemapToProxy): Removed.
9416 (EmitContext.CurrentAnonymousMethod): Changed type from
9417 AnonymousMethod -> AnonymousContainer.
9418 (EmitContext.ResolveTopBlock): Protect from being called twice.
9419 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
9420 (EmitContext.EmitThis): Removed the iterators hacks; use the
9421 anonymous methods framework for that.
9424 (ToplevelBlock.Container): Make this a property, not a field.
9425 (ToplevelBlock.ReParent): New public method; move the
9426 ToplevelBlock into a new container.
9427 (Foreach.TemporaryVariable): Simplify.
9429 2005-06-05 Martin Baulig <martin@ximian.com>
9431 * statement.cs (LocalInfo.CompilerGenerated): New flag.
9432 (Block.AddTemporaryVariable): New public method; creates a new
9433 `LocalInfo' for a temporary variable.
9434 (Block.EmitMeta): Create the LocalBuilders for all the temporary
9436 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
9437 non-iterator variables.
9439 2005-06-05 Martin Baulig <martin@ximian.com>
9441 * statement.cs (Foreach.TemporaryVariable): Create the
9442 LocalBuilder in the Emit phase and not in Resolve since in some
9443 situations, we don't have an ILGenerator during Resolve; see
9444 2test-19.cs for an example.
9446 2005-06-04 Martin Baulig <martin@ximian.com>
9448 **** Merged r45395 from GCS ****
9450 The big Foreach rewrite - Part II.
9452 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
9453 with `PropertyInfo ienumerator_getcurrent'.
9455 * codegen.cs (VariableStorage): Removed.
9458 (Foreach): Derive from Statement, not ExceptionStatement.
9459 (Foreach.CollectionForeach): New nested class. Moved all the code
9460 dealing with collection foreach here.
9461 (Foreach.ForeachHelperMethods): Removed.
9462 (Foreach.TemporaryVariable): Implement IMemoryLocation.
9464 2005-05-23 Martin Baulig <martin@ximian.com>
9466 * statement.cs (Try.DoResolve): Don't create a `finally' if we
9467 don't need to. Fix #75014.
9469 2005-05-20 Martin Baulig <martin@ximian.com>
9471 Merged r44808 from GMCS.
9473 * class.cs (TypeContainer.CircularDepException): Removed.
9474 (TypeContainer.DefineType): Removed the `InTransit' stuff.
9475 (TypeContainer.CheckRecursiveDefinition): Check for circular class
9476 (CS0146) and interface (CS0529) dependencies here.
9478 2005-06-21 Raja R Harinath <rharinath@novell.com>
9480 * expression.cs (Invocation.EmitCall): Fix initialization
9481 'this_call' to reflect current behaviour. Fix indentation.
9483 * convert.cs (FindMostEncompassedType): Add two trivial special
9484 cases (number_of_types == 0 || number_of_types == 1).
9485 (FindMostEncompasingType): Likewise.
9487 2005-06-17 Raja R Harinath <rharinath@novell.com>
9489 Some cleanups preparing for the fix of #75283.
9490 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
9492 (EventExpr.InstanceResolve): Likewise.
9493 (EventExpr.DoResolve): Remove redundant checks.
9495 2005-06-10 Duncan Mak <duncan@novell.com>
9497 * cs-tokenizer.cs (process_directives): New flag for controlling
9498 the processing of preprocessor directives.
9499 (x_token): After seeing a '#', return Token.NONE instead of going
9500 to handle_preprocessing_directive() when not processing
9501 directives. This avoids unnecessary processing during the token peek in
9506 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
9507 the existing error reporting methods instead of Report.Error.
9509 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
9510 after Raja's rewrite.
9512 2005-06-08 Miguel de Icaza <miguel@novell.com>
9514 * class.cs: Small fix.
9516 2005-06-08 Raja R Harinath <rharinath@novell.com>
9519 * class.cs (GetPartialBases): Fix return value check of
9522 2005-06-07 Raja R Harinath <rharinath@novell.com>
9524 Ensure that partial classes are registered in their enclosing
9525 namespace. Initial part of fix of #75160.
9526 * tree.cs (Tree.RecordDecl): Add new namespace argument.
9527 Register declspace with namespace here, not in
9528 DeclSpace.RecordDecl.
9529 * cs-parser.jay: Pass namespace to RecordDecl.
9530 * class.cs (PartialContainer.Create): Likewise.
9531 (ClassPart.DefineType): New sanity-check. Throws an exception if
9533 * decl.cs (Declspace.RecordDecl): Remove.
9534 * namespace.cs (NamespaceEntry.DefineName): Remove.
9536 2005-06-06 Marek Safar <marek.safar@seznam.cz>
9538 * rootcontext.cs: Reset TargetExt as well.
9540 2005-06-03 Raja R Harinath <rharinath@novell.com>
9542 * ecore.cs (Expression.Resolve): Emit CS0654 error when
9545 2005-06-02 Raja R Harinath <rharinath@novell.com>
9547 Fix #75080, cs0119.cs.
9548 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
9550 (Expression.Resolve): ... this. Use it. Remove bogus code
9551 allowing ExprClass.Type and ExprClass.Namespace for
9552 ResolveFlags.VariableOrValue.
9553 (Expression.Resolve) [1-argument variant]: Change default resolve
9554 flags based on language version.
9555 (Expression.Error_UnexpectedKind): Use a simple string array
9556 rather than an ArrayList.
9557 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
9559 (TypeOfVoid.DoResolve): Likewise.
9560 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
9561 flags argument -- it always has the same value.
9563 2005-05-31 Raja R Harinath <rharinath@novell.com>
9566 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
9567 Use it in the error message.
9568 * assign.cs, expression.cs, statement.cs: Update.
9570 2005-05-30 Raja R Harinath <rharinath@novell.com>
9573 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
9574 the "almostMatchedMember" case too.
9575 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
9576 that failed the accessibility checks to 'almost_match'.
9578 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
9580 * attribute.cs: Use internal MethodBuilder methods to set
9581 ExactSpelling and SetLastError on PInvoke methods, instead
9582 of passing them via charset. Fixes #75060.
9584 2005-05-27 Raja R Harinath <rharinath@novell.com>
9586 * parameter.cs (Parameter): Remove TODO comment.
9587 (Parameter.DefineParameter): Remove Location parameter.
9588 (Parameters.LabelParameters): Likewise.
9589 * class.cs (Constructor.Emit): Update to change.
9590 (MethodData.Emit): Likewise.
9591 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
9592 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
9594 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
9597 Removed Parameters.Location and added Parameter.Location instead.
9598 Removed Location parameter from Emit() and GetSignature().
9605 Modified all related calls.
9607 2005-05-26 Raja R Harinath <rharinath@novell.com>
9609 Improve user-defined conversion handling.
9610 * convert.cs (GetConversionOperators): Rewrite. Return only the
9611 applicable operators.
9612 (AddConversionOperators): New. Helper for GetConversionOperators.
9613 (FindMostEncompassedType, FindMostEncompassingType): Verify that
9614 there is only one most encompassed/encompassing type.
9615 (FindMostSpecificSource, FindMostSpecificTarget): Remove
9616 "applicable operator" handling.
9617 (UserConversion): Move cache here from GetConversionOperators.
9618 Directly cache the chosen operator, rather than the whole
9620 (ExplicitNumericConversion): Fix buggy implementation of Decimal
9621 case. Allow conversion of decimal to sbyte and byte too.
9622 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
9623 New static methods. Used to avoid allocating EmptyExpressions in
9626 2005-05-24 Duncan Mak <duncan@novell.com>
9628 * ecore.cs (CastFromDecimal): New class for casting a decimal to
9629 another class, used in Convert.ExplicitNumericConversion.
9630 (CastToDecimal): New class, similar to above, but casts to
9631 System.Decimal, used in Convert.ImplicitNumericConversion and also
9632 in explicit convesion from double/float to decimal.
9634 * convert.cs (ImplicitNumericConversion): Handle implicit
9635 conversions to System.Decimal.
9636 (ExplicitNumericConversion): handle explicit conversions to
9641 2005-05-20 Miguel de Icaza <miguel@novell.com>
9643 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
9644 know the type at this stage, just break through. Fixes #75008
9646 2005-05-19 Martin Baulig <martin@ximian.com>
9649 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
9650 to disable error reporting.
9652 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
9653 here since we don't want to report an error; see the new test-336.cs.
9655 2005-05-19 Raja R Harinath <rharinath@novell.com>
9657 * statement.cs (ToplevelBlock.GetParameterReference)
9658 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
9659 Move here from class Block.
9660 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
9661 * expression.cs (ParameterReference.DoResolveBase): Likewise.
9663 2005-05-18 Martin Baulig <martin@ximian.com>
9668 (FlowBranching.Reachability): Add non-static public And() and Or()
9670 (FlowBranchingSwitch): New class; do the `break_origins' thing
9671 like in FlowBranchingLoop.
9672 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
9673 reachability, not just locals and parameters.
9674 (FlowBranching.MergeChild): Remove some of the hacks for loop and
9675 switch; MergeBreakOrigins() now takes care of that.
9677 2005-05-18 Martin Baulig <martin@ximian.com>
9679 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9680 a loop and may leave it, reset the barrier; fixes #74974.
9682 2005-05-17 Marek Safar <marek.safar@seznam.cz>
9684 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
9687 * cs-parser.jay: Catch more lexical errors.
9689 * report.cs: Add one more Error method.
9692 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
9694 2005-05-17 Martin Baulig <martin@ximian.com>
9696 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
9699 2005-05-16 Raja R Harinath <rharinath@novell.com>
9701 Fix test-382.cs. Emit values of decimal constants.
9702 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
9704 (TypeContainer.AddField): ... this.
9705 (TypeContainer.EmitFieldInitializers): Allow the list of fields
9706 with initializers to include 'Const's.
9707 (ClassPart.RegisterFieldForInitialization): Forward to
9709 * const.cs (Const.Const): Pass initializer to base class.
9710 (Const.Define): In case of decimal constants, register them for
9711 initialization in a static constructor.
9713 2005-05-14 Martin Baulig <martin@ximian.com>
9715 * statement.cs (Block.Resolve): Correctly handle unreachable code;
9716 do not call ResolveUnreachable() on unreachable statements in
9717 here, see the comment in the source code.
9719 2005-05-13 Raja R Harinath <rharinath@novell.com>
9722 * expression.cs (BinaryResolveOperator): If one of the operands of
9723 an equality comparison is 'null' and the other is a pointer type,
9724 convert the null to a NullPointer.
9725 * convert.cs (ImplicitReferenceConversion): If the expression is a
9726 NullLiteral and the target type is a pointer type, return a
9727 NullPointer instead.
9728 (ImplicitConversionStandard): Likewise.
9730 2005-05-13 Marek Safar <marek.safar@seznam.cz>
9732 * cs-parser.jay: Set readonly context based on special constructs.
9734 * expression.cs (LocalVariableReference.DoResolveBase): Improved
9735 readonly variable error handling.
9737 * rootcontext.cs (EmitCode): Don't verify members when error
9740 * statement.cs (LocalInfo): Add reaodnly context information.
9741 (SetReadOnlyContext, GetReadOnlyContext): New methods.
9743 2005-05-13 Raja R Harinath <rharinath@novell.com>
9745 * statement.cs (Block.Resolve): Revert change below. Modify fix
9746 for #74041 to initialize 'resolved' to false only for explicit
9747 blocks. Fixes #74873.
9749 2005-05-12 Raja R Harinath <harinath@gmail.com>
9752 * typemanager.cs (unmanaged_enclosing_types): New.
9753 (IsUnmanagedType): Avoid infloops by using
9754 'unmanaged_enclosing_types' to talk with recursive invocations.
9756 2005-05-13 Martin Baulig <martin@ximian.com>
9758 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
9759 instance variable, not a local. Fix #74873.
9760 (Block.ResolveUnreachable): Set it to true here.
9762 2005-05-11 Duncan Mak <duncan@novell.com>
9764 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
9765 continuing to process for 'arg'.
9766 (handle_preprocessing_directive): Check the argument of the #endif
9767 directive and report error CS1025 if there are any trailing
9770 According to the C# spec, having even whitespace after the #endif
9771 directive is illegal; however, because we call arg.TrimEnd ()
9772 beforehand, we have the same behavior as csc, allowing whitespace
9773 after the directive.
9777 2005-05-11 Marek Safar <marek.safar@seznam.cz>
9781 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
9782 (Constructor.GetObsoleteAttribute): Implemented correctly.
9784 2005-05-10 Martin Baulig <martin@ximian.com>
9786 * support.cs (ReflectionParameters.ParameterModifier): Use
9787 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
9788 and `ParameterAttributes.In'. Fixes #74884.
9790 2005-05-10 Marek Safar <marek.safar@seznam.cz>
9792 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
9794 * expression.cs (Argument.GetParameterModifier): Turned to property.
9795 (Invocation.Error_InvalidArguments): Add more descriptive errors.
9797 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
9800 2005-05-09 Raja R Harinath <rharinath@novell.com>
9803 * decl.cs (MemberCache.AddMethods): Register override methods,
9804 rather than non-override methods.
9805 * typemanager.cs (RegisterOverride): New.
9806 (IsOverride): Update.
9808 2005-05-09 Marek Safar <marek.safar@seznam.cz>
9812 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
9813 recursive declaration.
9815 * statement.cs (Block.ResolveMeta): Report any error in resolving.
9817 2005-05-06 Marek Safar <marek.safar@seznam.cz>
9819 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
9821 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
9823 2005-05-05 Raja R Harinath <rharinath@novell.com>
9826 * decl.cs (DeclSpace.FamilyAccessible):
9827 Use TypeManager.IsNestedFamilyAccessible.
9829 Fix reopened #64812.
9830 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
9833 2005-05-04 Raja R Harinath <rharinath@novell.com>
9834 Abin Thomas <projectmonokochi@rediffmail.com>
9835 Anoob V E <projectmonokochi@rediffmail.com>
9836 Harilal P R <projectmonokochi@rediffmail.com>
9839 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
9840 allow access to all static members.
9842 2005-05-04 Martin Baulig <martin@ximian.com>
9844 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
9846 2005-05-04 Martin Baulig <martin@ximian.com>
9850 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
9851 section at the end; make things work if `default' is not the last
9854 2005-05-04 Martin Baulig <martin@ximian.com>
9858 * statement.cs (Switch): Replaced the `got_default' field with a
9859 `default_section' one.
9860 (Switch.CheckSwitch): Set `default_section' here.
9861 (Switch.Resolve): If we're a constant switch and the constant is
9862 not found, use the default section.
9864 2005-05-03 Martin Baulig <martin@ximian.com>
9866 * expression.cs (ArrayAccess.EmitGetLength): New public method.
9868 * statement.cs (Foreach.ArrayForeach): New nested class.
9869 (Foreach.TemporaryVariable): New nested class.
9870 (Foreach.EmitArrayForeach): Removed; this is now in the new
9873 2005-05-03 Raja R Harinath <rharinath@novell.com>
9875 * pending.cs (BaseImplements): Move the #74773 fix here. This is
9877 (VerifyPendingMethods): Revert change below.
9879 * typemanager.cs (IsOverride, RegisterNonOverride): New.
9880 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
9881 that used to trigger warning -28. Remove warning -28.
9882 * expression.cs (Invocation.OverloadResolve): Use
9883 TypeManager.IsOverride to distinguish override methods.
9886 * pending.cs (VerifyPendingMethods): If a base type implements the
9887 requested interface, don't bother checking individual methods of
9888 the base type. As a side-effect, this prevents the creation of
9889 unnecessary proxies.
9891 2005-05-02 Martin Baulig <martin@ximian.com>
9895 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9896 Also `And' the locals if the old vector is null.
9897 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
9898 null; in this case we basically reset all the variables.
9900 2005-05-02 Martin Baulig <martin@ximian.com>
9904 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
9905 Added `FlowBranching branching' argument; always `and' the
9906 variables instead of `or'ing them unless we're an infinite loop.
9908 * statement.cs (While.Resolve): Create a new sibling unless we're
9911 2005-05-02 Martin Baulig <martin@ximian.com>
9915 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
9916 arguments; use it instead of creating a new TopLevelBlock.
9917 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
9918 our ConstructorInitializer.
9921 (TopLevelBlock.TopLevelBranching): New public property.
9922 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
9923 and create our `TopLevelBranching'.
9925 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
9926 anonymous method host, use `block.TopLevelBranching' rather than
9927 creating a new branching.
9929 2005-04-20 Miguel de Icaza <miguel@novell.com>
9931 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
9932 a ScopeInfo, if any of the current children is a child of the new
9933 entry, move those children there.
9935 2005-04-30 Martin Baulig <martin@ximian.com>
9937 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
9938 at the beginning of a SwitchSection. Fix #73335.
9940 2005-04-27 Marek Safar <marek.safar@seznam.cz>
9943 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
9945 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
9946 (FieldExpr.DoResolve): Obsolete members are ignored for field
9949 2005-04-26 Marek Safar <marek.safar@seznam.cz>
9951 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
9952 of arrays detection.
9954 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
9956 (Field.VerifyClsCompliance): Volatile fields are not compliant.
9958 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
9961 2005-04-25 Ben Maurer <bmaurer@ximian.com>
9963 * cs-parser.jay: Use the prefered version of -unsafe in error
9966 2005-04-22 Marek Safar <marek.safar@seznam.cz>
9968 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
9971 2005-04-20 John Luke <john.luke@gmail.com>
9973 * driver.cs: fix typo in error message, --outout to --output
9975 2005-04-20 Marek Safar <marek.safar@seznam.cz>
9977 * codegen.cs (InRefOutArgumentResolving): New field.
9979 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
9980 fields outside contructor.
9982 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
9984 2005-04-19 Miguel de Icaza <miguel@novell.com>
9986 * anonymous.cs (CaptureContext.EmitParameterInstance): The
9987 parameter code was not completed ever, so it was not as up-to-date
9988 as local variables. Must finish it.
9990 The bug fix was to compare the Toplevel of the block, not the
9991 current block. Thanks for Ben for pointing this out.
9993 2005-04-19 Raja R Harinath <rharinath@novell.com>
9995 * decl.cs (AddMethods): Use the declaring type of the problem
9996 method to determine if we want to squash a warning.
9998 2005-04-19 Marek Safar <marek.safar@seznam.cz>
10000 * attribute.cs: Removed debug output.
10002 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
10004 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
10007 2005-04-18 Raja R Harinath <rharinath@novell.com>
10010 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
10011 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
10012 all null comparisons against reference types.
10014 2005-04-18 Marek Safar <marek.safar@seznam.cz>
10017 * class.cs (TypeContainer.CircularDepException) New nested
10019 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
10020 (TypeContainer.DefineType): Removed error, reset InTransit before
10022 (Class.DefineType): Throw exception when is in Transit.
10023 Catch exception and report error.
10024 (Struct.DefineType): Throw exception when is in Transit.
10025 Catch exception and report error.
10026 (Interface.DefineType): Throw exception when is in Transit.
10027 Catch exception and report error.
10029 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
10030 handle nested exception handlers.
10032 * flowanalysis.cs (InTryWithCatch): New method, search for try with
10035 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
10036 InFinally and InCatch storage.
10038 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
10039 (Catch.Resolve): Set and Restore ec.InCatch.
10040 (Try.Resolve): Set and Restore ec.InFinally.
10041 (Try.HasCatch): True when try has catch.
10043 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
10045 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
10046 for the same event member, so exclude such cases from warning 419.
10049 2005-04-16 Miguel de Icaza <miguel@novell.com>
10051 * expression.cs (Binary.ResolveOperator): Apply patch from John
10052 Luke to fix bug 59864: operators &, | and ^ on enumerations
10053 require that the same enum type on both sides.
10055 * driver.cs: Add warnings to old flag usage, this is to assist
10056 people who produce Makefiles and hope that the Makefiles will be
10059 * class.cs (TypeContainer.EmitType): Moved the definition of the
10060 special $PRIVATE$ field from the resolve phase to the Emit phase.
10061 During resolve we do not know if we are a struct with
10062 HasExplicitLayout, we know this only after the attributes for the
10065 Set the FieldOffset to zero on the dummy field that we create for
10066 the class. Fixes 74590.
10068 2005-04-16 Raja R Harinath <rharinath@novell.com>
10071 * ecore.cs (PropertyExpr.resolved): New.
10072 (DoResolve): Use it to handle a case of double resolution here.
10073 Handle a case of identical-name-and-type-name.
10074 * expression.cs (ArrayCreation.CheckIndices): Avoid double
10075 resolution by storing the results of expression resolution back
10076 into the "probes" array.
10078 2005-04-15 Raja R Harinath <rharinath@novell.com>
10080 Fix cs0208-7.cs and cs0208-8.cs.
10081 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
10082 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
10083 error reporting to point out the reason a struct is not unmanaged.
10085 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
10087 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
10088 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
10090 2005-04-13 Raja R Harinath <rharinath@novell.com>
10093 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
10094 IdenticalNameAndTypeName here.
10095 (EventExpr.InstanceResolve): Likewise.
10097 2005-04-13 Marek Safar <marek.safar@seznam.cz>
10099 C# 2.0 DefaultCharSetAttribute implementation
10101 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
10102 which allows us to set GlobalNamespace for every resolve.
10103 (Attribute.ResolveArguments): Cut from Resolve.
10104 (Attribute.GetCharSetValue): Returns CharSet named argument.
10105 (Attribute.DefinePInvokeMethod): Gets default charset from
10107 (GlobalAttribute.ResolveAsTypeStep): Override.
10108 (GlobalAttribute.ResolveArguments): Override.
10110 * class.cs (TypeAttr): Is protected.
10112 * codegen.cs (ModuleClass.DefaultCharSet): New member.
10113 (ModuleClass.DefaultCharSetType): New memeber.
10114 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
10116 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
10117 charset from module.
10119 * delegate.cs (TypeAttr): Override.
10120 (Delegate.DefineType): Use this TypeAttr.
10122 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
10123 at very early stage (before types are defined) to resolve model
10124 module attributes. It will probably not work with corlib but it
10127 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
10128 charset from module.
10130 * typemanager.cs (default_charset_type): New type.
10132 2005-04-13 Raja R Harinath <rharinath@novell.com>
10134 * decl.cs (MemberCache.AddMethods): Don't warn if
10135 System.Object.Finalize has buggy MethodAttributes.
10137 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
10140 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
10142 * doc.cs : detect ambiguous reference to overloaded members.
10143 Fixed bug #71603. MS 1.1 csc does not detect it.
10145 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
10147 * doc.cs : delegates must not be referenced with parameters.
10150 2005-04-12 Miguel de Icaza <miguel@novell.com>
10152 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
10154 2005-04-10 Miguel de Icaza <miguel@novell.com>
10156 * driver.cs (MainDriver): Stop processing if the CLS stage found
10159 (CompilerCallableEntryPoint.InvokeCompiler): Always
10160 reset after execution; Take a TextWriter argument for the
10163 * report.cs: Use the error stream instead of hardcoding stderr.
10165 2005-04-09 Miguel de Icaza <miguel@novell.com>
10167 * class.cs: Reduce code paths to test, too small of an
10168 optimization to make it worth the extra testing. Always perform
10171 2005-04-08 Raja R Harinath <rharinath@novell.com>
10174 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
10175 operators that had errors reported on them.
10177 2005-04-08 Marek Safar <marek.safar@seznam.cz>
10179 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
10181 (Attribute.Resolve): Add named argument type checking.
10183 * class.cs (FixedField.Define): Use IsPrimitiveType
10185 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
10187 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
10188 unsafe parameter types.
10190 * statement.cs (Using.ResolveExpression): Add better error description.
10192 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
10194 2005-04-08 Raja R Harinath <rharinath@novell.com>
10197 * attribute.cs (Attribute.GetAttributeUsage): Resolve
10198 AttributeUsageAttribute in the emitcontext of the attribute class,
10199 not in the emitcontext of the attributable entity it was attached to.
10200 * cs-parser.jay: Use 'current_class', not 'current_container',
10201 when creating a GlobalAttribute.
10203 2005-04-08 Alp Toker <alp@atoker.com>
10205 * pending.cs: The fix to #58413 failed to compile methods implementing
10206 interfaces with/without params modifiers and vice versa, even though
10207 params modifiers aren't part of the signature. Make the modifier check
10208 less strict as in csc.
10210 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
10211 Anoob V E <projectmonokochi@rediffmail.com>
10212 Harilal P R <projectmonokochi@rediffmail.com>
10215 * pending.cs (TypeAndMethods.mods): New. Store the parameter
10216 modifiers of pending methods.
10217 (PendingImplementation.PendingImplementation): Initialize it.
10218 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
10219 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
10220 with ParameterData. Add check for modifiers.
10221 * class.cs (MethodData.Define): Update to changes.
10223 2005-04-07 Raja R Harinath <rharinath@novell.com>
10225 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
10227 2005-04-07 Marek Safar <marek.safar@seznam.cz>
10229 * class.cs (PropertyMethod.Define): Check private accessor in abstract
10232 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
10235 * typemanager.cs: Registered RequiredAttributeAttribute.
10237 2005-04-06 Marek Safar <marek.safar@seznam.cz>
10239 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
10240 Warning CS0169 is back at level 3.
10241 (IMethodData.SetMemberIsUsed): New method.
10243 * decl.cs (IsUsed): New value; moved from FieldBase.Status
10244 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
10246 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
10248 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
10250 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
10253 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
10256 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
10257 to avoid the problems with nested types.
10259 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
10260 Anoob V.E <projectmonokochi@rediffmail.com>
10261 Harilal P.R <projectmonokochi@rediffmail.com>
10262 Raja R Harinath <rharinath@novell.com>
10265 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
10267 * typemanager (GetConstructor): Make public.
10269 2005-04-05 John Luke <john.luke@gmail.com>
10270 Raja R Harinath <rharinath@novell.com>
10273 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
10274 struct too. Return false quicker in a few cases.
10275 (VerifyUnManaged): Use it.
10277 2005-04-05 Raja R Harinath <rharinath@novell.com>
10280 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
10281 not 'unreachable_seen'.
10283 2005-04-04 Marek Safar <marek.safar@seznam.cz>
10285 * attribute.cs (Attribute.GetValue): Removed unused.
10287 * codegen.cs (CodeGen.TrimExt): Removed unused.
10289 * cs-parser.jay (output): Removed unused.
10291 * cs-tokenizer.cs (hex_digits): Removed unused.
10293 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
10295 * expression.cs (Indirection.LoadExprValue): Removed unused.
10296 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
10298 * iterators.cs (Iterator.param_types): Removed unused.
10300 * statement.cs (Goto.block): Removed unused.
10301 (ToplevelBlock.did): Removed unused.
10302 (Switch.ResolveConstantSwitch): Removed unused.
10304 2005-04-01 Ben Maurer <bmaurer@ximian.com>
10306 * rootcontext.cs: Allow mcs to bootstrap with the compilation
10309 2005-04-01 Raja R Harinath <rharinath@novell.com>
10311 Fix #74232 and cs0208-3.cs.
10312 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
10313 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
10314 unmanaged type. Don't use FieldBuilders when 't' is a
10315 TypeBuilder. Use ModFlags and MemberType fields.
10316 * class.cs (MemberBase.member_type): Rename from MemberType.
10317 (MemberBase.MemberType): New property. Determines member_type on
10319 (MemberBase.DoDefine): Don't initialize MemberType here.
10320 (FieldMember.Define): Likewise.
10322 2005-04-01 Marek Safar <marek.safar@seznam.cz>
10325 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
10326 Attributes are emitted there.
10328 2005-04-01 Raja R Harinath <rharinath@novell.com>
10330 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
10331 keyword in 'partial enum' too.
10332 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
10334 Report from Kamil Skalski <nazgul@omega.pl>.
10337 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
10338 have partial containers too.
10340 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
10341 in block' checks to Block.CheckInvariantMeaningInBlock.
10342 * statement.cs (Block.GetKnownVariableInfo): Make private.
10343 (Block.IsVariableUsedInChildBlock): Remove.
10344 (Block.IsVariableUsedInBlock): Likewise.
10345 (Block.CheckInvariantMeaningInBlock): New. Show location of
10346 conflicting declaration.
10347 (Block.AddVariable): Make error messages less long-winded and more
10348 specific. Show location of conflicting declaration.
10349 * parameter.cs (Parameters.Location): New readonly property.
10351 2005-03-31 Raja R Harinath <rharinath@novell.com>
10353 Clean up semantics of invoking ResolveMemberAccess.
10354 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
10355 can have an instance, ensure that we pass in a non-TypeExpression
10356 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
10357 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
10358 argument. Update to changes and simplify.
10359 (FieldExpr.Emitinstance): Remove CS0120 check.
10360 (PropertyExpr.EmitInstance): Likewise.
10361 * expression.cs (Argument.Resolve): Likewise.
10362 (Invocation.DoResolve): Update to changes in semantics of
10363 InstanceExpression.
10365 2005-03-31 Marek Safar <marek.safar@seznam.cz>
10368 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
10371 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
10373 2005-03-31 Raja R Harinath <rharinath@novell.com>
10375 Fix difference in behaviour with commandline invocation.
10376 * driver.cs (Driver.Reset): New.
10377 (CompilerCallableEntryPoint): Call it.
10379 * statement.cs (If.Resolve): Avoid spurious "uninitialized
10380 variable" warnings if the boolean expression failed to resolve.
10382 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
10384 * attribute.cs: Fix the union of several permissions when some of them
10385 are unrestricted (so the result isn't an unrestricted permission set).
10388 2005-03-30 Raja R Harinath <rharinath@novell.com>
10390 * ecore.cs (MemberExpr): New class. Convert from interface
10392 (MemberExpr.ResolveMemberAccess): Refactor and move here from
10393 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
10395 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
10396 (MethodGroupExpr.IsExplicitImpl): Remove.
10397 (Expression.GetFieldFromEvent): Remove.
10398 (SimpleName.MemberStaticCheck): Remove.
10399 (SimpleName.DoSimpleNameResolve): Update to changes.
10400 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
10401 (MemberAccess.IdenticalNameAndTypeName): Remove.
10402 (MemberAccess.error176): Move to MemberExpr.
10403 (MemberAccess.DoResolve): Update to changes.
10404 (BaseAccess.DoResolve): Likewise.
10406 2005-03-30 Marek Safar <marek.safar@seznam.cz>
10408 C# 2.0 Conditional attribute class implementation
10410 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
10411 Analyzes class whether it has attribute which has ConditionalAttribute
10412 and its condition is not defined.
10414 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
10415 (Class.IsExcluded): New method. Search for at least one defined
10416 condition in ConditionalAttribute of attribute class.
10418 2005-03-30 Raja R Harinath <rharinath@novell.com>
10420 * ecore.cs (PropertyExpr): Derive from Expression, not
10421 ExpressionStatement.
10422 (PropertyExpr.EmitStatement): Remove.
10424 2005-03-29 Raja R Harinath <rharinath@novell.com>
10427 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
10428 internal field "value__" of an enum be private. The examples for
10429 "value__" that I found on MSDN all used FieldAttributes.Private.
10431 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
10432 Don't mention IL method attribute names.
10434 Fix #47991. Remove a TODO.
10435 * statement.cs (Block.Toplevel): Make into a field.
10436 (Block.Parameters): Move into ToplevelBlock.
10437 (Block.known_variables): Rename from child_variable_names.
10438 (Block.Block): Remove variants that take Parameters. Initialize
10439 'Toplevel' with the immediately surrounding toplevel block.
10440 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
10441 LocalInfo parameter.
10442 (Block.GetKnownVariableInfo): New.
10443 (Block.IsVariableNameUsedInChildBlock): Update.
10444 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
10445 the block, even though it may not be in scope.
10446 (Block.AddVariable): Remove Parameters parameter. Use
10447 Toplevel.Parameters instead.
10448 (Block.AddConstant): Remove Parameters parameter.
10449 (Block.GetParameterReference): Update to use Toplevel.Parameters.
10450 (Block.IsParamaterReference): Likewise.
10451 (Block.IsLocalParameter): Likewise. Simplify a lot.
10452 (ToplevelBlock.Parameters): New. Moved from Block.
10453 (ToplevelBlock.ToplevelBlock): Update to changes. Always
10454 initialize Parameters to a non-null value.
10455 * cs-parser.jay: Update to changes.
10456 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
10457 simple names that mean different things in the same block. Use
10458 Block.IsVariableNameUsedInBlock.
10460 2005-03-28 Raja R Harinath <rharinath@novell.com>
10462 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
10463 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
10464 GetTypeHandle. It is possible for a reflected type to derive from
10465 a TypeBuilder (e.g., int[] derives from the TypeBuilder
10466 System.Array during mscorlib compilation).
10467 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
10468 contain a method_hash, don't create one either. Don't create a
10469 deep copy of the base cache's method_hash.
10470 (MemberCache.SetupCache): Rename back from DeepCopy.
10471 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
10472 already initialized. If we see an override function, add its
10473 underlying base virtual function to the member_hash too.
10475 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
10477 2005-03-26 Raja R Harinath <harinath@acm.org>
10480 * assign.cs (Assign.DoResolve): When the RHS of an assignment
10481 fails to resolve, ensure that the LHS is still resolved as an
10484 2005-03-25 Raja R Harinath <harinath@acm.org>
10486 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
10488 (Enum.current_ec): Remove.
10489 (Enum.LookupEnumValue): Remove EmitContext argument.
10490 Just uses the one created during DefineType.
10491 (Enum.FindMembers): Update.
10492 * expression.cs (MemberAccess.DoResolve): Update.
10494 2005-03-22 Marek Safar <marek.safar@seznam.cz>
10496 * assign.cs (Assign.DoResolve): Check for CS1717 when
10497 source and target are same (uses Equals).
10499 * expression.cs (LocalVariableReference, ParameterReference,
10500 This): Implemented Equals, GetHashCode.
10502 * statement.cs (Block.GetParameterReference): Removed useless
10505 2005-03-22 Raja R Harinath <rharinath@novell.com>
10508 * statement.cs (Block.AddVariable): Ensure that we skip implicit
10509 blocks before deciding whether the error is cs0136 or cs0128.
10511 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
10512 (using_alias_directive, using_namespace_directive): Pass
10513 MemberName, not an expression to Namespace.UsingAlias and
10515 (MakeName): Use the MemberName of the namespace.
10516 * namespace.cs (Namespace.MemberName): New.
10517 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
10518 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
10520 * decl.cs (MemberName.Name): Make readonly.
10521 (MemberName.FromDotted): New "constructor".
10522 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
10523 (MemberCore.Name): Compute from MemberName on demand.
10524 (MemberCore.SetMemberName): Provide a way to change the
10526 (MemberCore.AddToContainer): Don't take a fullname parameter.
10527 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
10528 fully qualified name of the container to the member name.
10529 (TypeContainer.AddToTypeContainer): Use a fully qualified name
10530 only if the type is a member of the root container.
10531 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
10532 MemberName.Left rather than searching for an embedded ".".
10533 (PartialContainer.CreatePart): Update to changes in RootContext.
10534 (MemberBase.ShortName): Turn into a property. Use
10535 MemberCore.SetMemberName.
10536 (MemberBase.ExplicitInterfaceName): Remove.
10537 (MemberBase.UpdateMemberName): Remove.
10538 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
10539 (PropertyBase.SetMemberName): New override.
10540 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
10541 (Tree.GetDecl): New.
10542 (Tree.AllDecls): Rename from Decls.
10543 * attribute.cs, enum.cs, report.cs: Update to changes.
10544 * driver.cs (MainDriver): Use MemberName.FromDotted on
10545 RootContext.MainClass.
10547 2005-03-21 Marek Safar <marek.safar@seznam.cz>
10549 * class.cs (FixedField.Define): Check for CS1664 and more sanity
10552 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
10554 2005-03-18 Marek Safar <marek.safar@seznam.cz>
10556 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
10557 property accessor modifiers.
10559 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
10560 fixed buffer attribute (CS1716).
10561 (PropertyMethod.HasCustomAccessModifier): When property accessor
10562 has custom modifier.
10564 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
10566 (PropertyExpr.DoResolveLValue): Add CS0272.
10568 2005-03-17 Miguel de Icaza <miguel@novell.com>
10570 * convert.cs: When converting to a pointer, use the proper Conv.U
10571 or Conv.I depending on the source data type.
10573 * cs-tokenizer.cs: Make the size for large decimal constants,
10576 2005-03-17 Martin Baulig <martin@ximian.com>
10578 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
10579 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
10581 2005-03-17 Martin Baulig <martin@ximian.com>
10583 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
10584 to bool so we can return an error condition.
10585 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
10588 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
10590 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
10593 2005-03-16 Raja R Harinath <rharinath@novell.com>
10595 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
10596 Refactor to avoid traversing the list of assemblies, and to avoid
10597 string concatenation.
10598 * typemanager.cs (guid_attr_type): Remove.
10599 (negative_hits, pointers, references): Remove hashes.
10601 (GetConstructedType): New. Uses type_hash to handle constructed
10602 types (arrays, references, pointers).
10603 (GetReferenceType, GetPointerType): Use it.
10604 (GetNestedType): New. Uses type_hash to handle nested types of
10606 (LookupType, LookupTypeDirect): Remove.
10607 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
10608 'types' hash and LookupTypeReflection directly.
10609 (params_string, params_object): Use GetConstructedType.
10610 * namespace.cs (Namespace.cached_types): New. Cache of reflected
10612 (Namespace.Lookup): Use cached_types.
10613 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
10614 provided by old TypeManager.LookupType.
10615 * rootcontext.cs (MakeFQN): Remove.
10616 * decl.cs (DeclSpace.MakeFQN): Likewise.
10617 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
10618 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
10619 TypeManager.GetConstructedType.
10620 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
10622 2005-03-15 Marek Safar <marek.safar@seznam.cz>
10624 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
10627 * cs-parser.jay: Reports CS1527 for any namespace element.
10629 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
10632 * expression.cs (ParameterReference.IsAssigned): Changed error to
10634 (Error_WrongNumArguments): Moved CS0245 detection here.
10636 * statement.cs (Return.Resolve): Add CS1622 report.
10638 2005-03-11 Marek Safar <marek.safar@seznam.cz>
10640 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
10642 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
10644 * attribute.cs expression.cs: Get rid of some allocations.
10646 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
10648 * doc.cs : just eliminate the latest change.
10650 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
10652 * doc.cs : commented out the latest change. It breaks xml-030.cs
10654 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
10656 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
10657 fail. So invoke CreateType() in FindDocumentedType().
10659 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
10661 * cs-tokenizer.cs : added IsKeyword().
10662 * doc.cs : Detect keyword incorrectly used as identifier.
10663 Allow identifiers prefixed by @.
10665 2005-03-10 Marek Safar <marek.safar@seznam.cz>
10667 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
10668 It caused exception in namespace resolving (again!).
10670 * class.cs (Class.ctor): Removed exit.
10671 (PropertyMethod.ctor): ditto.
10673 * codegen.cs (Codegen.Reset): Reset static data.
10674 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
10676 * cs-tokenizer.cs (Cleanup): Removed.
10678 * driver.cs (GetSystemDir): Rewrote to one line command.
10679 It caused problem with unloaded dynamic modules.
10680 (UnixParseOption): Removed Exit.
10681 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
10682 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
10683 Now can be mcs used as library.
10685 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
10688 * location.cs (Reset): Reset static data.
10690 * namespace.cs (Reset): Reset static data.
10692 * report.cs (Report.Reset): Reset static data.
10694 * rootcontext.cs (RootContext.Reset): Reset static data.
10696 * tree.cs (RootTypes.ctor): Use Location.Null
10698 * typemanager.cs (TypeManager.Reset): Reset static data.
10699 (CoreLookupType): Removed Exit.
10700 (TypeHandle.Reset): Reset static data.
10702 2005-03-10 Raja R Harinath <rharinath@novell.com>
10705 * typemanager.cs (ComputeNamespaces): Import namespaces from
10706 referenced modules too.
10708 2005-03-09 Raja R Harinath <rharinath@novell.com>
10710 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
10713 2005-03-09 Raja R Harinath <rharinath@novell.com>
10715 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
10716 enclosing DeclSpace. This ensures that a name-lookup populates
10717 more caches and there are fewer 'TypeExpression's. Carve out
10718 nested type lookup into ...
10719 (LookupNestedTypeInHierarchy): ... this.
10721 2005-03-09 Raja R Harinath <rharinath@novell.com>
10723 Clean up a few partial-class semantics.
10724 Fixes test-357.cs and cs1618-2.cs.
10725 * cs-parser.jay (struct_declaration): Use 'current_class' as
10726 parent of newly-created struct. Remove call to Register ().
10727 Use 'pop_current_class' to complete handing the current struct.
10728 (interface_declaration): Likewise.
10729 (class_declaration): Likewise.
10730 (enum_declaration): Use 'current_class' as parent of newly created
10732 (delegate_declaration): Likewise.
10733 (pop_current_class): New function. This is used to handle closing
10734 up the 'current_class' and 'current_container', and pointing them
10735 to the enclosing class/container.
10736 (CSharpParser): Initialize 'current_class' too.
10737 * decl.cs (MemberCore): Add check for invariant: a partial
10738 container is not a parsed entity, and thus does not enclose any
10740 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
10741 (DeclSpace.BaseTypeExpr): Use it.
10742 (DeclSpace.LookupType): Add check for invariant.
10743 * class.cs (TypeContainer): Add check for invariant: a nested
10744 class should have the same NamespaceEntry as its enclosing class.
10745 (TypeContainer.EmitFieldInitializers): Make virtual.
10746 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
10748 (TypeContainer.Register): Remove.
10749 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
10750 null. Use TypeResolveEmitContext for resolving base types and
10751 interfaces. Move initialization of Parts.TypeBuilder here from
10753 (TypeContainer.DefineNestedTypes): ... here.
10754 (PartialContainer): Take a Namespace not a NamespaceEntry.
10755 (PartialContainer.Create): Don't use Register. Call the
10756 appropriate Add... function directly.
10757 (ClassPart): Take both the PartialContainer and the enclosing
10758 class as constructor arguments.
10759 (ClassPart.EmitFieldInitializers): Override.
10760 (ClassPart.PartFindNestedTypes): Remove.
10761 (FieldBase.GetInitializerExpression): Resolve the initializer
10762 expression in the emit context of the enclosing class.
10763 * tree.cs (RootTypes): Remove Register ().
10765 2005-03-08 Marek Safar <marek.safar@seznam.cz>
10767 * cs-parser.jay: Removed CS0134.
10769 * driver.cs: Removed CS1901.
10771 * expression.cs (SizeOf.DoResolve): Don't report CS0233
10772 for predefined types.
10774 2005-03-07 Duncan Mak <duncan@novell.com>
10776 * codegen.cs (Save): Catch UnauthorizedAccessException as
10777 well. Fixes bug #73454.
10779 2005-03-07 Marek Safar <marek.safar@seznam.cz>
10781 * cs-tokenizer.cs (xtoken): Add CS1035.
10783 * class.cs (MethodData.Define): Add CS0683.
10784 (FieldMember.ctor): Add CS0681.
10786 2005-03-07 Raja R Harinath <rharinath@novell.com>
10788 * ecore.cs (SimpleName.DoResolve): Rename from
10789 SimpleName.DoResolveAllowStatic.
10790 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
10791 Pass 'intermediate' flag to MemberStaticCheck.
10792 (SimpleName.MemberStaticCheck): Skip "static check" only in case
10793 of "intermediate" lookups via MemberAccess.
10794 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
10795 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
10797 2005-03-07 Raja R Harinath <rharinath@novell.com>
10800 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
10801 slipped in because of variable names that are identical to a
10802 builtin type's BCL equivalent ('string String;', 'int Int32;').
10803 (PropertyExpr.EmitInstance): Likewise.
10805 2005-03-04 Marek Safar <marek.safar@seznam.cz>
10807 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
10809 * report.cs (warning_ignore_table): Made public.
10811 2005-03-04 Raja R Harinath <rharinath@novell.com>
10814 * class.cs (MethodData.Emit): Pass 'container' to
10815 container.GetObsoleteAttribute instead of 'container.Parent'.
10817 2005-03-03 Marek Safar <marek.safar@seznam.cz>
10819 * cs-parser.jay: Add 1534 error test.
10821 * iterators.cs (Yield.CheckContext): Add error 1629.
10822 (Iterator.ctor): Save unsafe modifier.
10823 (MoveNextMethod.DoEmit): Restore unsafe context.
10825 * namespace.cs (UsingAlias): Better error message.
10827 2005-03-03 Dan Winship <danw@novell.com>
10829 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
10830 the warning message [#73219]
10832 2005-03-03 Raja R Harinath <rharinath@novell.com>
10834 Fix compile with MCS 1.0.0.0.
10835 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
10836 w_restore to not depend on string constant folding.
10838 2005-03-03 Raja R Harinath <rharinath@novell.com>
10840 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
10841 CS0246 check to users who passed 'silent = false'.
10842 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
10844 (SimpleName.SimpleNameResolve): Update.
10845 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
10846 (MemberAccess.IdenticalNameAndTypeName): Update.
10847 * doc.cs (FindDocumentedTypeNonArray): Update.
10849 2005-03-03 Raja R Harinath <rharinath@novell.com>
10851 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
10852 * parameters.cs (ComputeAndDefineParameters): Remove.
10853 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
10854 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
10855 Use GetParameterInfo.
10857 2005-03-02 Marek Safar <marek.safar@seznam.cz>
10859 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
10861 2005-03-02 Raja R Harinath <rharinath@novell.com>
10863 Unify DeclSpace.LookupType and DeclSpace.FindType.
10864 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
10865 is in charge of defining nested types on demand.
10866 (DeclSpace.LookupType): Use it when the current_type is a
10867 TypeBuilder. Use LookupTypeDirect for reflected types.
10868 (DeclSpace.FindType): Remove.
10869 (DeclSpace.LookupInterfaceOrClass): Likewise.
10870 (DeclSpace.DefineTypeAndParents): Likewise.
10871 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
10872 DeclSpace.LookupType.
10873 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
10874 * typemanager.cs (LookupType): Simplify.
10875 (AddUserType): Remove type from negative_hits.
10876 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
10877 * class.cs (TypeContainer.FindMembers): Move handling of nested
10879 (TypeContainer.FindMembers_NestedTypes): ... here.
10880 (TypeContainer.FindNestedType): Implement override.
10881 (ClassPart.FindNestedType): Delegate to PartialContainer.
10882 (ClassPart.PartFindNestedType): Looks up the nested types of the
10885 2005-03-02 Martin Baulig <martin@ximian.com>
10887 * class.cs (TypeContainer.DoDefineMembers): We also need a default
10888 static constructor in static classes.
10890 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
10892 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
10893 sizeParamIndex is not specified.
10895 2005-03-01 Marek Safar <marek.safar@seznam.cz>
10898 * report.cs (WarningMessage.IsEnabled): Missing null check.
10900 2005-02-28 Marek Safar <marek.safar@seznam.cz>
10902 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
10903 in the fields and not in the properties.
10905 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
10907 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
10910 2005-02-28 Marek Safar <marek.safar@seznam.cz>
10912 * attribute.cs: Small refactoring (improved robustness).
10913 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
10914 (ValidateGuid): Removed.
10915 (Resolve): Removed referenced to above mentioned.
10916 (GetAttributeUsage): Made private and changed to work without
10918 (GetIndexerAttributeValue): Don't crash.
10919 (GetConditionalAttributeValue): Ditto.
10920 (GetClsCompliantAttributeValue): Ditto.
10921 (ExtractSecurityPermissionSet): All attributes exceptions are
10923 (GetPropertyValue): New helper.
10924 (GetMethodImplOptions): New method.
10925 (DefinePInvokeMethod): Reuse common code. Implemented handling of
10926 some missing properties.
10928 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
10929 (Method.ApplyAttributeBuilder): Updated.
10931 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
10934 2005-02-28 Raja R Harinath <rharinath@novell.com>
10937 * report.cs (Report.SymbolRelatedToPreviousError): Handle
10938 non-simple types (array, pointer, reference).
10940 2005-02-28 Marek Safar <marek.safar@seznam.cz>
10942 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
10944 * class.cs (MethodCore.IsDuplicateImplementation): Special error
10946 (Method.CheckBase): Catch wrong destructor here.
10947 (MethodData.Define): Add errors 550, 668.
10949 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
10951 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
10953 * pending.cs (VerifyPendingMethods): Add error 551.
10955 * typemanager.cs (CSharpName): Next error report helper.
10957 2005-02-25 Marek Safar <marek.safar@seznam.cz>
10959 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
10960 attributes. Removed useless attribute double check.
10961 It saves almost 2MBs for corlib.
10963 2005-02-25 Raja R Harinath <rharinath@novell.com>
10966 * statement.cs (ExpressionStatement.Resolve): Make robust to being
10967 called twice in case of error.
10969 2005-02-23 Chris Toshok <toshok@ximian.com>
10971 Fix compiler portions of #72827.
10972 * statement.cs (Block.Emit): call Begin/EndScope on the
10973 EmitContext instead of the ILGenerator.
10975 * codegen.cs (EmitContext.BeginScope): new method, call
10976 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
10978 (EmitContext.BeginScope): same, but EndScope and CloseScope
10980 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
10981 offset and call the superclass's OpenScope(int) with it.
10982 (SymbolWriter.CloseScope): get the current il
10983 offset and call superclass's CloseScope(int) with it.
10985 2005-02-23 Marek Safar <marek.safar@seznam.cz>
10987 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
10988 CS1677 for out and ref as well.
10990 * class.cs (Method.Define): Add error CS1599 detection.
10992 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
10994 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
10996 * delegate.cs (Delegate.Define): Add error CS1599 detection.
10998 * support.cs.cs (ModifierDesc): New helper method.
11000 2005-02-23 Raja R Harinath <rharinath@novell.com>
11001 Abin Thomas <projectmonokochi@rediffmail.com>
11002 Anoob V E <projectmonokochi@rediffmail.com>
11003 Harilal P R <projectmonokochi@rediffmail.com>
11005 Fix #57851, #72718.
11006 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
11007 MemberLookup (used for error reporting) actually returns a result.
11008 Fix error report number (122, not 112).
11010 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
11011 Anoob V E <projectmonokochi@rediffmail.com>
11012 Harilal P R <projectmonokochi@rediffmail.com>
11015 * pending.cs (PendingImplementation.GetAbstractMethods):
11016 Find NonPublic members too.
11018 2005-02-22 Marek Safar <marek.safar@seznam.cz>
11020 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
11023 * class.cs (MethodCore.CheckMethodAgainstBase):
11024 Add error 239 report.
11026 2005-02-21 Raja R Harinath <rharinath@novell.com>
11029 * expression.cs (Invocation.IsApplicable): Make public.
11030 (Invocation.IsParamsMethodApplicable): Likewise.
11031 * delegate.cs (Delegate.VerifyApplicability): Don't use
11032 Invocation.VerifyArgumentCompat for parameter applicability
11033 testing. Use Invocation.IsApplicable and
11034 Invocation.IsParamsMethodApplicable.
11036 2005-02-21 Marek Safar <marek.safar@seznam.cz>
11038 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
11040 * class.cs (Operator.Define): Add error 217 report.
11042 2005-02-21 Raja R Harinath <rharinath@novell.com>
11044 * namespace.cs (UsingEntry.Resolve): Undo change below.
11046 2005-02-21 Raja R Harinath <rharinath@novell.com>
11049 * ecore.cs (Expression.MemberLookupFailed): Add argument to
11050 disable the error message when the extended MemberLookup also
11052 (Expression.MemberLookupFinal): Update.
11053 (SimpleName.DoSimpleNameResolve): Update.
11054 * expression.cs (MemberAccess.ResolveNamespaceOrType):
11055 Don't use MemberLookupFinal.
11056 (New.DoResolve): Update.
11057 (BaseAccess.CommonResolve): Update.
11059 2005-02-21 Raja R Harinath <rharinath@novell.com>
11062 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
11063 occured previously, don't resolve again.
11065 2005-02-21 Marek Safar <marek.safar@seznam.cz>
11068 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
11069 argument. Call ResolveAttributeUsage for unresolved.
11070 when types doesn't match ctor arguments.
11072 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
11073 for nested attribute classes.
11074 (Class.attribute_usage): Removed.
11075 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
11076 for attribute class.
11078 * ecore.cs (IsAttribute): Removed.
11080 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
11082 * rootcontext.cs (RegisterAttribute): Removed, attributes are
11084 (attribute_types): Removed.
11085 (EmitCode): Global attributes are emited as the latest.
11087 2005-02-18 Marek Safar <marek.safar@seznam.cz>
11089 * class.cs (EmitFieldInitializers): Don't emit field initializer
11090 for default values when optimilization is on.
11092 * constant.cs (Constant.IsDefaultValue): New property.
11094 * driver.cs: Add /optimize handling.
11098 * literal.cs: Implement new IsDefaultValue property.
11100 * rootcontext.cs (Optimize): New field, holds /optimize option.
11102 2005-02-18 Raja R Harinath <rharinath@novell.com>
11104 Fix crasher in re-opened #72347.
11105 * namespace.cs (Namespace.Lookup): Return null if
11106 DeclSpace.DefineType returns null.
11109 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
11111 2005-02-18 Raja R Harinath <rharinath@novell.com>
11113 Fix remainder of #63202. Change semantics of DoResolveLValue: it
11114 now returns null if it cannot resolve to an lvalue.
11115 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
11116 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
11117 returned null. Remove check for SimpleName.
11118 (EventExpr.DoResolveLValue): New.
11119 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
11120 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
11122 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
11123 avoid CS0131 error.
11124 (Unary.ResolveOperator): Move CS0211 check ...
11125 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
11127 (Unary.DoResolveLValue): Simplify.
11128 (AddressOf.DoResolveLValue): New.
11129 (ArrayAccess.DoResolveLValue): New.
11131 2005-02-16 Marek Safar <marek.safar@seznam.cz>
11133 * attribute.cs (Attribute.Resolve): Add arguments casting for
11134 when types doesn't match ctor arguments.
11136 2005-02-16 Raja R Harinath <rharinath@novell.com>
11138 Fix parts of #63202.
11139 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
11140 lookup of operator in base type. Ensure that all checks happen
11141 when the operator resolves to an "op_..." method.
11143 2005-02-15 Raja R Harinath <rharinath@novell.com>
11146 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
11147 'ignore_cs0104' parameter. Pass it to ...
11148 (NamespaceEntry.Lookup): ... this.
11149 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
11150 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
11151 (TypeLookupExpression.DoResolveAsTypeStep): Update.
11152 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
11153 Update. Request that cs0104 errors be ignored.
11154 (ComposedCast.ResolveAsTypeStep): Update.
11156 2005-02-14 Raja R Harinath <rharinath@novell.com>
11159 * expression.cs (Invocation.BetterFunction): Remove support for
11160 comparing virtual functions and their overrides.
11161 (Invocation.IsOverride): New.
11162 (Invocation.OverloadResolve): Don't consider 'override' functions
11163 during candidate selection. Store them in a lookaside list.
11164 If the selected method is a 'virtual' function, use the list to
11165 find any overrides that are closer to the LHS type.
11167 2005-02-14 Marek Safar <marek.safar@seznam.cz>
11169 * expression.cs (New.DoResolve): Add complex core type reduction.
11170 (New.Constantify): Converts complex core type syntax like 'new int ()'
11171 to simple constant.
11173 2005-02-14 Raja R Harinath <rharinath@novell.com>
11175 * decl.cs (EntryType.EntryType): New constructor to create an
11176 updated copy of a cache entry.
11177 (MemberCache.AddMethods): Use it.
11178 (MemberCache.ClearDeclaredOnly): Remove.
11179 (MemberCache.MemberCache): Update.
11181 2005-02-11 Miguel de Icaza <miguel@novell.com>
11183 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
11184 variable. This one is represents the actual low-level declaration
11185 of the method, as opposed to the semantic level `IsStatic'.
11187 An anonymous method which is hosted into a static method might be
11188 actually an instance method. IsStatic would reflect the
11189 container, while MethodIsStatic represents the actual code
11192 * expression.cs (ParameterReference): Use the new MethodIsStatic
11193 instead of IsStatic.
11195 * anonymous.cs (AnonymousMethod.Compatible): Pass the
11196 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
11197 set on the current EmitContext.
11199 * expression.cs (Cast): Overload DoResolveLValue so we can pass
11200 resolve our casted expression as an LValue. This triggers the
11201 proper LValue processing that is later required by Assign.
11205 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
11207 2005-02-11 Marek Safar <marek.safar@seznam.cz>
11209 C# 2.0 Fixed buffer implementation
11211 * anonymous.cs: Update after RegisterHelperClass renaming.
11213 * attribute.cs (AttributeTester.fixed_buffer_cache):
11214 Cache of external fixed buffers.
11215 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
11216 implementation if field is fixed buffer else null.
11219 (TypeContainer.AddField): Accept FieldMember instead of Field.
11220 (FieldBase.IsFieldClsCompliant): Extracted code from
11221 VerifyClsCompliance descendant customization.
11222 (FixedField): New class handles fixed buffer fields.
11223 (FixedFieldExternal): Keeps information about imported fixed
11225 (IFixedField): Make access to internal or external fixed buffer
11228 * cs-parser.jay: Add fixed buffer parsing.
11230 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
11233 * expression.cs (Indirection): Extended implementation to accept
11234 fixed buffer field.
11235 (PointerArithmetic.Emit): Get element from fixed buffer as well.
11236 (ElementAccess.MakePointerAccess): Get type as parameter.
11237 (DoResolve): Add fixed buffer field expression conversion.
11238 (DoResolveLValue): Ditto.
11239 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
11240 (ArrayPtr): Derives from FixedBufferPtr.
11241 (ArrayPtr.Emit): Add extra emit for array elements.
11243 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
11245 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
11246 for compiler generated types.
11247 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
11249 * statement.cs (Fixed): Refactored to be easier add fixed buffer
11250 and consume less memory.
11251 (Fixed.Resolve): Add fixed buffer case.
11253 * typemanager.cs (compiler_generated_attr_ctor,
11254 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
11255 (HasElementType): Add our own implementation to work on every
11258 2005-02-11 Miguel de Icaza <miguel@novell.com>
11260 * anonymous.cs (CaptureContext): Track whether `this' has been
11263 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
11264 only captured `this' if it was implicitly done (instance
11265 methods/variables were used).
11267 * codegen.cs (EmitContext.CaptureThis): New method to flag that
11268 `this' must be captured.
11270 2005-01-30 Miguel de Icaza <miguel@novell.com>
11272 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
11273 is null it means that there has been no need to capture anything,
11274 so we just create a sibling.
11276 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
11278 Just a partial fix. The other half is fairly elusive.
11280 2005-02-10 Raja R Harinath <rharinath@novell.com>
11282 Fix #52586, cs0121-4.cs.
11283 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
11284 and return a hashtable.
11285 (MemberCache.ClearDeclaredOnly): New.
11286 (MemberCache.MemberCache): Update to change. Make a deep copy of
11287 the method_hash of a base type too.
11288 (MemberCache.AddMethods): Adapt to having a deep copy of the base
11289 type methods. Overwrite entries with the same MethodHandle so
11290 that the ReflectedType is correct. The process leaves in base
11291 virtual functions and their overrides as distinct entries.
11292 (CacheEntry): Now a class instead of a struct. It shouldn't alter
11293 matters since it was boxed in a ArrayList before.
11294 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
11296 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
11297 case of a virtual function and its override (choose the overload
11299 (Invocation.OverloadResolve): Avoid 'override' members during
11300 'applicable_type' calculation.
11302 2005-02-09 Raja R Harinath <rharinath@novell.com>
11304 Combine two near-redundant caches.
11305 * typemanager.cs (method_params): Rename from method_internal_params.
11306 (TypeManager.GetParameterData): New. Replace
11307 Invocation.GetParameterData.
11308 (TypeManager.LookupParametersByBuilder): Remove.
11309 * expression.cs (Invocation.method_parameter_cache): Remove.
11310 (Invocation.GetParameterData): Remove.
11312 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
11315 2005-02-08 Raja R Harinath <rharinath@novell.com>
11318 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
11319 TypeManager.multicast_delegate_type is null, resolve it by looking
11320 up "System.MulticastDelegate".
11321 * rootcontext.cs (RootContext.ResolveCore): Simplify.
11323 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
11324 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
11325 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
11328 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
11329 (LabeledStatement.AddReference): New. Set 'referenced'.
11330 (Goto.Resolve): Use it.
11332 2005-02-05 John Luke <john.luke@gmail.com>
11334 * driver.cs: remove duplicate -doc line in Usage ()
11336 2005-02-04 Raja R Harinath <rharinath@novell.com>
11338 * location.cs (Location.AddFile): Fix CS2002 error report.
11340 2005-02-02 Martin Baulig <martin@ximian.com>
11342 * delegate.cs (Delegate.DefineType): Report an internal error if
11343 TypeManager.multicast_delegate_type is null. See bug #72015 for
11346 2005-02-02 Raja R Harinath <rharinath@novell.com>
11348 Fix a crasher in a variant of #31984.
11349 * const.cs (Constant.CheckBase): New override that defers the
11350 new-or-override check in case the base type hasn't been populated
11352 (Constant.Define): Ensure the new-or-override check is performed.
11354 2005-02-01 Duncan Mak <duncan@ximian.com>
11356 * const.cs (LookupConstantValue): Check that `ce' is not null
11357 before calling GetValue ().
11359 2005-02-01 Raja R Harinath <rharinath@novell.com>
11361 Fix test-334.cs (#69519).
11362 * cs-parser.jay (using_alias_directive): Pass in an expression to
11363 NamespaceEntry.UsingAlias.
11364 (using_namespace_directive): Pass in an expression to
11365 NamespaceEntry.Using.
11366 (namespace_name): Don't flatten to a string.
11367 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
11368 (NamespaceEntry.AliasEntry.Resolve): Lookup using
11370 (NamespaceEntry.UsingEntry): Likewise.
11371 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
11373 (NamespaceEntry.LookupForUsing): Remove.
11374 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
11376 (NamespaceEntry.Lookup): Remove support for dotted names.
11378 2005-02-01 Raja R Harinath <rharinath@novell.com>
11380 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
11382 (NamespaceEntry.ImplicitParent): Compute on demand.
11383 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
11384 parallels the current.
11385 (NamespaceEntry.LookupForUsing): Use it.
11386 (NamespaceEntry.Lookup): If the current namespace-entry is
11387 implicit, don't search aliases and using tables.
11389 2005-02-01 Raja R Harinath <rharinath@novell.com>
11392 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
11394 (TypeContainer.BaseCache): Compute on demand.
11395 (TypeContainer.FindMembers): Define constants and types if they're
11396 not already created.
11397 (FieldMember.Define): Move resetting of ec.InUnsafe before error
11399 * const.cs (Constant.Define): Make idempotent.
11401 2005-01-29 Miguel de Icaza <miguel@novell.com>
11403 * pending.cs: Produce better code (no nops produced by using Ldarg
11406 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
11407 i - 1' it should be arg + 1.
11411 2005-01-28 Raja R Harinath <rharinath@novell.com>
11413 * attribute.cs (Attribute.CheckAttributeType): Make private
11415 (Attribute.ResolveType): Make virtual.
11416 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
11417 handling of RootContext.Tree.Types.
11419 2005-01-27 Raja R Harinath <rharinath@novell.com>
11421 Update attribute-handling to use the SimpleName/MemberAccess
11423 * cs-parser.jay (attribute): Pass in an expression to the
11424 constructors of Attribute and GlobalAttribute.
11425 * attribute.cs (Attribute): Take an expression for the name.
11426 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
11427 passed in attribute name expression.
11428 (Attribute.CheckAttributeType): Use it.
11429 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
11430 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
11431 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
11432 argument to prevent error messages if the lookup fails.
11434 2005-01-27 Marek Safar <marek.safar@seznam.cz>
11436 * expression.cs (Indirection): Implemented IVariable interface
11437 to support indirection in AddressOf operator.
11438 (PointerArithmetic.Emit): Add optimalization for case where
11439 result can be precomputed.
11441 2005-01-26 Martin Baulig <martin@ximian.com>
11443 * class.cs (TypeContainer.AttributeTargets): Return the correct
11444 AttributeTargets depending on our `Kind' instead of throwing an
11445 exception; fixes #71632.
11447 2005-01-26 Marek Safar <marek.safar@seznam.cz>
11450 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
11453 2005-01-25 Raja R Harinath <rharinath@novell.com>
11456 * expression.cs (MemberAccess.DoResolve): Don't complain with
11457 cs0572 when the LHS of a member access has identical name and type
11460 2005-01-25 Marek Safar <marek.safar@seznam.cz>
11463 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
11465 Create custom PermissionSet only for PermissionSetAttribute.
11467 2005-01-24 Marek Safar <marek.safar@seznam.cz>
11470 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
11471 delegates in static class.
11473 2005-01-24 Martin Baulig <martin@ximian.com>
11475 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11476 merging an implicit block, just use its reachability.
11478 * statement.cs (Block.Resolve): Make the unreachable code check
11479 work wrt. implicit blocks; see test-337 from #63842.
11481 2005-01-21 Alp Toker <alp@atoker.com>
11483 * cs-parser.jay: destructor_declaration's container is PartialContainer
11484 not Class when partial types are used, so use Kind prop instead of
11487 2005-01-22 Miguel de Icaza <miguel@ximian.com>
11489 * cs-parser.jay: Improve error reporting when an interface
11490 declares new types.
11492 2005-01-20 Dick Porter <dick@ximian.com>
11494 * support.cs: SeekableStreamReader fix from Sandor Dobos
11495 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
11496 chars are read. Fixes bug 70369.
11498 2005-01-20 Raja R Harinath <rharinath@novell.com>
11500 * cs-parser.jay (catch_clause): Simplify current_block handling
11503 2005-01-17 Miguel de Icaza <miguel@ximian.com>
11505 * convert.cs (ImplicitStandardConversionExists): Synchronize the
11506 code with ImplicitStandardConversion to handle the implicit
11507 conversion of method groups into valid delegate invocations.
11509 The problem is that in parameter handling we were using this code
11510 path. Fixes bug #64698
11512 2005-01-19 Raja R Harinath <rharinath@novell.com>
11514 * cs-parser.jay: Fix several infelicities.
11515 - Avoid assigning to the parser value stack. Code like
11516 '$3 = null' is unclean. Synthesize a value for the code block
11518 - Avoid using oob_stack for storing location information. Use ...
11519 (_mark_): ... this. New (empty) rule. Saves the current location
11521 (foreach_statement): Avoid using oob_stack for current_block
11522 handling. Use technique used in for_statement and
11523 using_statement. Synthesize a value for the code block to store
11524 additional intermediate information.
11526 2005-01-13 Miguel de Icaza <miguel@ximian.com>
11528 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
11529 of a different type is only allowed to private fields of a
11530 containing type, not on fields of a base class.
11532 See test-174.cs and error cs0122-9.cs
11534 2005-01-13 Raja R Harinath <rharinath@novell.com>
11536 Fix test-335.cs (bug #58126).
11537 * cs-parser.jay (argument): Split out non-expression parts of the
11538 rule into 'non_simple_argument'.
11539 (invocation_expression): Support parenthesized invocations with
11540 multiple arguments, and with single non-simple arguments.
11542 2005-01-13 Raja R Harinath <rharinath@novell.com>
11544 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
11547 2005-01-12 Raja R Harinath <rharinath@novell.com>
11549 Fix cs0038-1.cs, cs1640-6.cs.
11550 * ecore.cs (Expression.Resolve): Remove special-case for
11551 SimpleName in error-handling.
11552 (Expression.almostMatchedMembers): Relax access permission to
11554 (Expression.MemberLookupFailed): Handle duplicates in
11555 almostMatchedMembers list.
11556 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
11557 * expression.cs (New.DoResolve): Report CS1540 for more cases.
11558 * typemanager.cs (GetFullNameSignature): Use the MethodBase
11559 overload if the passed in MemberInfo is a MethodBase.
11561 2005-01-12 Marek Safar <marek.safar@seznam.cz>
11564 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
11565 for non-CAS & merge permission sets properly.
11567 2005-01-11 Raja R Harinath <rharinath@novell.com>
11569 Improve standard-compliance of simple name and member access
11570 resolution. Fixes bugs #52697, #57200, #67520, #69519.
11571 * ecore.cs (FullNamedExpression): New abstract base class
11572 for Namespaces and TypeExpressions.
11573 (ResolveFlags.SimpleName): Remove.
11574 (SimpleName): Remove support for dotted names.
11575 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
11576 DeclSpace.FindType and DeclSpace.LookupType.
11577 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
11578 (Expression.ExprClassName): Make member function.
11579 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
11580 a namespace. Remove creation of dotted "SimpleName"s.
11581 (MemberAccess.DoResolve): Likewise.
11582 * decl.cs (DeclSpace.Cache): Make private.
11583 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
11584 (DeclSpace.FindType): Update.
11585 (DeclSpace.LookupType): Move here from RootContext. Return a
11586 FullNamedExpression.
11587 * namespace.cs (Namespace): Derive from FullNamedExpression
11588 so that it can be part of expression resolution.
11589 (Namespace.Lookup): Return an FullNamedExpression.
11590 (NamespaceEntry.LookupAlias): Lookup aliases only in current
11592 * rootcontext.cs (NamespaceLookup): Remove.
11593 (LookupType): Move to DeclSpace.
11594 * attribute.cs (CheckAttributeType): Update.
11595 * doc.cs (FindDocumentedType): Remove allowAlias argument.
11596 (FindDocumentedTypeNonArray): Likewise.
11598 2005-01-11 Raja R Harinath <rharinath@novell.com>
11600 Fix cs0509.cs, cs1632.cs.
11601 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
11602 is the same as IsInterface.
11603 (TypeContainer.GetClassBases): Likewise.
11604 * statement.cs (LabeledStatement.ig): New field.
11605 (LabeledStatement.LabelTarget): Save ILGenerator which created the
11607 (LabeledStatement.DoEmit): Check that the label was created with
11608 the same ILGenerator.
11610 2005-01-10 Marek Safar <marek.safar@seznam.cz>
11613 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
11614 accessors to its properties.
11616 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
11617 from accessors to property.
11619 2005-01-10 Marek Safar <marek.safar@seznam.cz>
11622 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
11623 only for overrides.
11625 2005-01-08 Miguel de Icaza <miguel@ximian.com>
11627 * attribute.cs: Check for null and empty strings.
11629 I have lost another battle to Paolo.
11631 2005-01-07 Marek Safar <marek.safar@seznam.cz>
11634 * class.cs (PropertyMethod): Set Parent field in ctors.
11635 (SetMethod.InternalParameters): Add unsafe switch hack.
11636 Override MarkForDuplicationCheck where it is appropriate.
11638 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
11639 It says whether container allows members with the same name.
11640 Base default is no.
11641 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
11642 Removed is_method parameter.
11644 2005-01-06 Duncan Mak <duncan@ximian.com>
11646 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
11647 because the previous change led to incorrect reporting of CS1032
11648 ("Cannot define/undefine preprocessor symbols after first token in
11649 file"). Instead of using `tokens_seen' as the only flag that
11650 triggers CS1040, introduce `comments_seen'. This new flag is used
11651 to signify having seen comments on the current line, so it is
11652 unset after a newline.
11654 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
11656 * doc.cs : When searching for a type, find nested type too.
11657 This fixes bug #71040.
11659 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
11662 - Warn missing member comment on those classes which also does not
11663 have doc comments. Fixed bug #71041.
11664 - Don't warn missing doc comment on default constructor.
11667 2005-01-06 Duncan Mak <duncan@ximian.com>
11669 * cs-tokenizer.cs (xtoken): After handling traditional C-style
11670 comments, set `tokens_seen' to true. This allows us to detect
11671 misplaced preprocessor directives (i.e. not at the beginning of
11672 the a line, nor after whitespaces). In that case, report error
11673 CS1040. This fixes bug #56460.
11675 * cs-parser.jay (interface_member_declaration): Add checks for
11676 IsExplicitImpl, and report CS0541 error if an interface member is
11677 defined as an explicit interface declaration.
11679 2005-01-06 Marek Safar <marek.safar@seznam.cz>
11682 * class.cs (PropertyMethod): Set Parent field in ctors.
11683 (SetMethod.InternalParameters): Add unsafe switch hack.
11685 * decl.cs (MemberCore.Parent): Cannot be readonly.
11687 2005-01-06 Raja R Harinath <rharinath@novell.com>
11689 * decl.cs (DeclSpace.ResolveType): Remove.
11690 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
11691 Merge in code from ...
11692 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
11693 * class.cs, enum.cs: Update to changes.
11695 2005-01-06 Miguel de Icaza <miguel@ximian.com>
11697 * anonymous.cs: Ensure that we init the scope of our parent if it
11698 has not been initialized yet.
11700 2004-12-30 Duncan Mak <duncan@ximian.com>
11702 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
11703 if field.FieldBuilder is null. Fixes #70758.
11705 * convert.cs: Fixed some typos and updated some of the comments.
11706 (ImplicitStandardConversionExists):
11707 (TryImplicitIntConversion): If `target_type' is an interface and
11708 the type of `ic' implements this interface, return true or a new
11709 BoxedCast instead of null. This fixes #70468.
11711 2004-12-29 Duncan Mak <duncan@ximian.com>
11713 * expression.cs (Argument.Emit): Check that Expr is
11714 IMemoryLocation before casting to it, and report CS1510 otherwise.
11718 2004-12-21 Ben Maurer <bmaurer@ximian.com>
11720 * statement.cs (Block.ThisVariable): remove the recursion here, to
11721 make the --profile more sane.
11723 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
11725 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
11726 assembly, by JB Evain.
11728 2004-12-17 Raja R Harinath <rharinath@novell.com>
11730 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
11731 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
11732 "parent" refers to enclosing type/class. "base" refers to superclass.
11734 2004-12-17 Raja R Harinath <rharinath@novell.com>
11736 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11737 Ensure that we only have GlobalAttributes.
11738 * attribute.cs (Attribute.Emit): Make non-virtual.
11739 (GlobalAttribute.Emit): Remove.
11740 (Attribute.Resolve): Make virtual.
11741 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
11742 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
11743 the argument. Don't create one.
11744 (Attribute.GetObsoleteAttribute): Likewise.
11745 (Attribute.GetClsCompliantAttributeValue): Likewise.
11746 * class.cs, decl.cs: Update to changes.
11748 2004-12-17 Marek Safar <marek.safar@seznam.cz>
11750 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
11752 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
11754 * statement.cs (Foreach.Resolve): Add error 186 report.
11756 2004-12-16 Marek Safar <marek.safar@seznam.cz>
11758 * expression.cs (Conditional.DoResolve): Add warning 429.
11760 * statement.cs (If.Resolve): Add warning 665.
11762 2004-12-16 Raja R Harinath <rharinath@novell.com>
11764 New invariant: RootContext.Tree.Types.NamespaceEntry == null
11765 except when in the parser, and in GlobalAttribute.
11766 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
11767 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
11768 RootContext.Tree.Types.NamespaceEntry once work is done.
11769 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
11770 and resets RootContext.Tree.Types.NamespaceEntry.
11772 2004-12-15 Marek Safar <marek.safar@seznam.cz>
11774 * cs-parser.jay: Don't create a block for every variable.
11776 2004-12-14 Miguel de Icaza <miguel@ximian.com>
11778 * location.cs: Provide extra information.
11780 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
11781 variables from the captured environment, it is the ldarg_0.
11783 2004-12-14 Marek Safar <marek.safar@seznam.cz>
11785 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
11788 * class.cs: Changed warning level for 169 to avoid developer
11789 displeasure from warning flooding. It will be changed back when they
11790 fix most of current BCL warnings.
11792 * RootContext.cs: Pushed default WarningLevel to 3.
11794 * statement.cs: Removed unused variable.
11796 2004-12-14 Marek Safar <marek.safar@seznam.cz>
11798 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
11799 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
11800 Add error 502 report.
11801 (StaticClass.DefineType): Add error 441 report.
11802 (Class.AllowedModifiersProp): New virtual property as temporary
11803 extension to AllowedModifiers.
11804 (Class.DefineType): Add error 418 report. Moved ModFlags check here
11805 to share implementation with StaticClass and don't call virtual
11808 * driver.cs (MainDriver): Add error 1558 test.
11810 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
11811 report. Moved error 36 test here.
11813 * statement.cs (Throw.Resolve): Add error 724 report.
11815 * typemanager.cs: Add out_attribute_type core type.
11817 2004-12-13 Marek Safar <marek.safar@seznam.cz>
11819 * class.cs (TypeContainer.VerifyClsCompliance): Add error
11821 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
11823 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
11826 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
11828 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
11829 Add error 3023 report.
11830 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
11832 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
11835 2004-12-12 John Luke <john.luke@gmail.com>
11837 * driver.cs (AddArgs): take -- into account when
11838 adding arguments, fixes bug 65710
11840 2004-12-12 Martin Baulig <martin@ximian.com>
11842 * expression.cs (Unary.TryReduceNegative): Added support for
11843 SByteConstant and ByteConstant.
11844 (Unary.Reduce): Check error values from TryReduceNegative().
11846 2004-12-10 Marek Safar <marek.safar@seznam.cz>
11848 * attributes.cs (Attribute.Resolve): Avoid multiple error report
11849 and report exception as error 182.
11851 2004-12-10 Raja R Harinath <rharinath@novell.com>
11853 * driver.cs (Main): Fix message when there are warnings.
11855 2004-12-09 Miguel de Icaza <miguel@ximian.com>
11857 * delegate.cs: Fixed my fix from yesterday, sorry about that.
11859 2004-12-09 Marek Safar <marek.safar@seznam.cz>
11861 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
11862 Reduced number of warnings.
11864 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
11866 2004-12-08 Miguel de Icaza <miguel@ximian.com>
11868 * driver.cs: Removed message.
11870 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
11872 2004-12-08 <vargaz@freemail.hu>
11874 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
11876 2004-12-08 Martin Baulig <martin@ximian.com>
11878 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
11879 instead of a CS3002 for properties and indexer.
11881 2004-12-08 Martin Baulig <martin@ximian.com>
11883 * decl.cs (MemberName.ToString): Make this work again.
11885 2004-12-08 Marek Safar <marek.safar@seznam.cz>
11887 * attribute.cs (Resolve): Add error 591 detection.
11889 * class.cs (FieldMember.Define): Add error 1547 detection.
11890 (Indexer.Define): Add error 620 detection.
11891 (Operator.Define): Add error 590 detection.
11893 * ecore.cs: Missing argument for error 79.
11895 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
11898 2004-12-07 Marek Safar <marek.safar@seznam.cz>
11901 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
11904 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
11906 * cs-parser.jay : handle doc comments on implicit/explicit operators.
11907 Some operator comments were suppressed.
11908 * doc.cs : Implicit/explicit operator name in doc comments are like
11909 "op_Explicit(type)~returnType", so added suffix handling.
11911 2004-12-07 Martin Baulig <martin@ximian.com>
11914 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
11915 (MemberCore.GetClsCompliantAttributeValue): Likewise.
11916 (DeclSpace.ec): New protected field; store the EmitContext here.
11917 (DeclSpace.EmitContext): New public property; moved here from
11919 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
11922 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
11923 (Enum.Emit): Don't create a new EmitContext.
11925 * delegate.cs (Delegate.DefineType): Always create the
11928 * iterators.cs (Iterators.DefineIterator): Create a new
11929 EmitContext and store it in `ec'.
11931 2004-08-24 Martin Baulig <martin@ximian.com>
11934 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
11935 this for accessibility checks.
11936 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
11937 IsNestedFamilyAccessible.
11938 (TypeManager.IsSubclassOf): New method, do what the name actually
11941 2004-12-06 Raja R Harinath <rharinath@novell.com>
11943 Fix crash on cs0657-17.cs.
11944 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11945 Use RootContext.Tree.Types, not 'new RootTypes ()'.
11946 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
11947 the case where the NamespaceEntry gets overwritten.
11949 2004-12-06 Marek Safar <marek.safar@seznam.cz>
11951 Fixed #69195, #56821
11952 * ecore.cs (ResolveBoolean): Tiny refactoring.
11954 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
11955 of right expression resolving when left is false constant and
11956 operator is LogicalAnd OR true constant and operator is LogicalOr.
11958 * statement.cs (ResolveUnreachable): Always reports warning.
11960 2004-12-05 Miguel de Icaza <miguel@ximian.com>
11962 * class.cs: Distinguish between 1721 and 1722 (just a little help
11963 for the programmer).
11965 2004-12-03 Miguel de Icaza <miguel@ximian.com>
11967 * delegate.cs: Only allow this on new versions of the language.
11969 2004-12-02 Duncan Mak <duncan@ximian.com>
11971 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
11973 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
11974 here as a static method. Take an additional bool out parameter
11975 `must_do_cs1540_check' for signaling to InstanceResolve.
11976 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
11977 member field from PropertyExpr class and made it an argument of
11978 the method instead.
11979 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
11980 check for MarshalByRefObject, and report CS0122 instead of CS1540.
11981 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
11982 and `remove_accessor' as well as InstanceResolve: report CS0122
11987 2004-12-03 Raja R Harinath <rharinath@novell.com>
11989 Fix test-327.cs, test-328.cs, and put in early infrastructure
11990 for eventually fixing #52697.
11991 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
11992 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
11993 from other methods.
11994 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
11995 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
11996 (VerifyUsing, error246): Update.
11997 * rootcontext.cs (RootContext.NamespaceLookup): Just use
11998 'NamespaceEntry.LookupNamespaceOrType'.
12000 2004-12-03 Martin Baulig <martin@ximian.com>
12002 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
12003 method as our child, call AnonymousMethod.Compatible() on it.
12005 2004-12-03 Raja R Harinath <rharinath@novell.com>
12007 Disable XML documentation support in 'basic' profile.
12008 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
12009 Redirect XmlElement to System.Object.
12010 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
12011 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
12012 * mcs.exe.sources: Add doc-bootstrap.cs.
12013 * doc-bootstrap.cs: New file. Contains empty stub implementation
12016 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
12018 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
12019 comments are allowed.
12021 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
12023 * delegate.cs: Add checks for subtypes in paramaters and return values
12024 in VerifyMethod () to add support for Covariance/Contravariance
12027 2004-12-02 Miguel de Icaza <miguel@ximian.com>
12029 * report.cs: Remove extra closing parenthesis.
12031 * convert.cs (Error_CannotImplicitConversion): If the name of the
12032 types are the same, provide some extra information.
12034 * class.cs (FieldBase): Use an unused bit field from the field to
12035 encode the `has_offset' property from the FieldMember. This saves
12036 a couple of Ks on bootstrap compilation.
12038 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
12039 method as our child, return the AnonymousMethod resolved
12042 * expression.cs (New.DoResolve): Allow return values from
12043 NewDelegate to also include AnonymousMethods.
12047 2004-12-02 Marek Safar <marek.safar@seznam.cz>
12050 * attribute.cs (Resolve): Improved implementation of params
12051 attribute arguments.
12053 * support.cs (ParameterData): Add HasParams to be faster.
12055 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
12057 all things are for /doc support:
12059 * doc.cs: new file that supports XML documentation generation.
12060 * mcs.exe.sources: added doc.cs.
12062 Handle /doc command line option.
12063 Report error 2006 instead of 5 for missing file name for /doc.
12064 Generate XML documentation when required, after type resolution.
12066 Added support for picking up documentation (/// and /** ... */),
12067 including a new XmlCommentState enumeration.
12069 Added lines to fill Documentation element for field, constant,
12070 property, indexer, method, constructor, destructor, operator, event
12071 and class, struct, interface, delegate, enum.
12072 Added lines to warn incorrect comment.
12074 Added Documentation field (passed only when /doc was specified).
12076 Added DocComment, DocCommentHeader, GenerateDocComment() and
12077 OnGenerateDocComment() and some supporting private members for
12078 /doc feature to MemberCore.
12080 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
12082 Added overriden DocCommentHeader.
12084 Added overriden DocCommentHeader and GenerateDocComment().
12086 2004-12-01 Miguel de Icaza <miguel@ximian.com>
12088 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
12089 unwrapping the enumeration values, chain to
12090 DoConstantNumericPromotions again, so we can promote things to the
12091 fundamental types (takes care of enums that are bytes, sbytes).
12095 2004-12-01 Raja R Harinath <rharinath@novell.com>
12097 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
12098 Fix long-standing bug in type-lookup. Use FindType instead of
12099 LookupType when ec.ResolvingTypeTree.
12100 (Attribute.ResolveType, Attribute.Resolve)
12101 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
12103 (Attributes.Search): Remove internal version. Update.
12104 (Attributes.SearchMulti): Update.
12105 (Attributes.GetClsCompliantAttribute): Remove.
12106 (Attributes.GetIndexerNameAttribute): Remove.
12107 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
12108 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
12109 * class.cs (Indexer.Define): Likewise.
12111 2004-12-01 Marek Safar <marek.safar@seznam.cz>
12114 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
12115 MarshallByReference members access.
12117 * expression.cs: Use CheckMarshallByRefAccess;
12118 Better error CS0197 message.
12120 * report.cs: Print whole related error message.
12122 2004-11-30 Raja R Harinath <rharinath@novell.com>
12124 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
12125 the current directory to help debugging.
12127 2004-11-29 Marek Safar <marek.safar@seznam.cz>
12129 * class (GetClassBases): Better error 60 report.
12130 (EventProperty): Disabled warning 67 detection.
12132 2004-11-29 Marek Safar <marek.safar@seznam.cz>
12135 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
12137 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
12140 2004-11-29 Marek Safar <marek.safar@seznam.cz>
12143 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
12145 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
12147 2004-11-26 Miguel de Icaza <miguel@ximian.com>
12149 * attribute.cs (Attribute.Resolve): Refine error reporting and
12150 report a cs0117 if the identifier does not exist, to distinguish
12151 from 0617 which is a miss-use of the actual identifier.
12153 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
12154 between cs0070 and cs0079.
12156 * class.cs (MemberBase.DoDefine): When reporting a wrong
12157 accessibility level, we use MethodCore to compare instead of
12158 Method (this was a regression in some refactoring effort).
12160 So now we correctly report cs0056 again.
12162 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
12163 testing the target_type (which was known to be object_type) and
12164 not the source type (which is anonymous_method).
12166 Fixed reporting of error cs1660.
12168 * expression.cs (UserCast.Source): Expose the underlying cast.
12170 * statement.cs (Switch.SwitchGoverningType): Sort the list of
12171 allowed types to find a match to int32 first (most common).
12173 In addition, it ignores any ImplicitUserConversions that did an
12174 internal implicit conversion (as the switch statement allows only
12175 one integral conversion to exist).
12177 * class.cs (PartialContainer.Create): rename `name' to
12178 `member_name' for clarity. Then replace the string calls with a
12179 call to MemberName.GetPartialName, as now using
12180 MemberName.ToString is an error (this is due to the side effects
12181 it had, that were fixed in the past).
12183 This will restore the error reporting on a number of partial class
12184 errors that were missusing this (and getting an exception as a
12185 results, which is now just a plain textual warning, because
12186 yyparse debug output would crash otherwise).
12188 2004-11-26 Raja R Harinath <rharinath@novell.com>
12190 * Makefile (PROGRAM_INSTALL_DIR): Remove.
12192 2004-11-25 Ben Maurer <bmaurer@ximian.com>
12194 * rootcontext.cs (LookupType): Make sure to cache lookups that
12195 don't give us a negative result. This saves about 5% of corlib
12198 2004-11-25 Miguel de Icaza <miguel@ximian.com>
12200 * report.cs (AbstractMessage.Print): messages are sent to stderr
12202 * class.cs (TypeContainer.GetClassBases): It is an error to have a
12203 non-interface in the list of interfaces (at this point, either
12204 parent was properly set, or a base class is being listed in the
12205 interfaces section).
12207 This flags error 1722, and resolves the crash from bug 69259.
12209 2004-11-25 Ben Maurer <bmaurer@ximian.com>
12211 * statement.cs (Using.EmitExpressionFinally): make this work right
12212 for valuetypes. Fixes 69926.
12214 2004-11-25 Miguel de Icaza <miguel@ximian.com>
12216 * const.cs (Const.ChangeType): Cope with the "0 literal can be
12217 converted to an enum" here, before we try to change the underlying
12218 type. This code exists, but it is a different code path than the
12219 one used while encoding constants.
12221 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
12222 old bug: when converting from the null literal to a pointer,
12223 return an EmptyCast, not the NullLiteral.
12225 This fixes #69921, the recent null_type changes probably made this
12226 bug more prominent.
12228 (ImplicitReferenceConversionExists): In addition, resynchronized
12229 the code here, so it matches the same code in
12230 ImplicitReferenceConversionExists for the `from any class-type S
12231 to any interface-type T'.
12234 2004-11-25 Marek Safar <marek.safar@seznam.cz>
12236 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
12238 2004-11-24 Miguel de Icaza <miguel@ximian.com>
12240 * cs-parser.jay: Use verbosity accordingly.
12242 2004-11-24 Marek Safar <marek.safar@seznam.cz>
12244 * expression.cs (Unary.ResolveOperator): Do not report warning;
12245 AddressOf reads from variable.
12247 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
12249 2004-11-24 Marek Safar <marek.safar@seznam.cz>
12253 * attribute.cs (Attributable): Removed CheckTargets.
12254 (Attributes.Emit): Explicit attribute targets are tested here.
12256 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
12257 not enabled for interfaces.
12259 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
12260 (GetAssemblyName): Ouch next bug there.
12262 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
12264 * expression.cs: Error 275 added.
12266 2004-11-23 Marek Safar <marek.safar@seznam.cz>
12268 Fix bug #69177 (Implemented decimal constant support)
12270 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
12271 (BinaryFold): Add DecimalConstant.
12273 * const.cs (Define): Decimal constant
12275 (ChangeType): Add decimal type handling.
12276 (LookupConstantValue): Don't set value for decimal type but
12277 emit DecimalConstantAttribute. Needed for constant optimization.
12279 * constant.cs (ToDecimal): New method.
12280 (ConvertToDecimal): New method.
12281 (IntConstant): Implemented ConvertToDecimal.
12282 (DecimalConstant.Emit): Emit optimized version for decimals in
12285 * expression.cs (ResolveOperator): Changed order of constant
12286 reduction to work correctly with native types which have
12287 overloaded operators.
12288 (ResolveMemberAccess): Extract constant value from attribute
12291 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
12293 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
12294 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
12295 (ChangeType): Decimal is special.
12296 (TypeToCoreType): Add decimal type.
12298 2004-11-22 Marek Safar <marek.safar@seznam.cz>
12300 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
12303 2004-11-22 Marek Safar <marek.safar@seznam.cz>
12305 * class.cs (EventField.ApplyAttributeBuilder): Fix error
12308 2004-11-19 Marek Safar <marek.safar@seznam.cz>
12310 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
12312 * pending.cs (PendingImplementation): Grab only interfaces.
12314 2004-11-19 Marek Safar <marek.safar@seznam.cz>
12316 * statement.cs (ForeachHelperMethods): Add location member and
12317 error 202 detection.
12319 2004-11-19 Raja R Harinath <rharinath@novell.com>
12321 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
12322 automatically handled by executable.make.
12323 (PROGRAM): Make profile-specific.
12325 2004-11-18 Marek Safar <marek.safar@seznam.cz>
12327 * expression.cs (DoResolveBase): Fixed wrong warning for out
12330 2004-11-18 Martin Baulig <martin@ximian.com>
12332 Merged latest changes into gmcs. Please keep this comment in
12333 here, it makes it easier for me to see what changed in MCS since
12334 the last time I merged.
12336 2004-11-17 Raja R Harinath <rharinath@novell.com>
12338 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
12339 (TypeHandle.GetMemberCache): New.
12340 (TypeHandle.TypeHandle): Update.
12341 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
12342 (TypeManager.LookupParentInterfacesCache):
12343 Rename from LookupInterfaceCache. Optimize slightly.
12344 (TypeManager.MemberLookup_FindMembers): Update.
12345 * decl.cs (MemberCache.MemberCache): Set Container to null in the
12346 multi-type variant.
12347 (AddCacheContents): Rename from AddHashtable.
12348 * class.cs (TypeContainer.parent_container): Remove.
12349 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
12350 (TypeContainer.DoDefineMembers): Don't initialize it.
12351 Update to name changes.
12353 2004-11-17 Miguel de Icaza <miguel@ximian.com>
12355 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
12356 that factors the code to check access modifiers on override.
12358 (PropertyBase): Use the code here.
12360 Patch from Lluis S'anchez, fixes bug #69361.
12362 2004-11-15 Miguel de Icaza <miguel@ximian.com>
12364 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
12365 routine that is used to report the use of a captured variable
12366 whose address has been taken.
12368 There are two checks: one when variables are being captured and
12369 the other check is when the address of a variable is taken.
12371 (because an anonymous methods might be resolved before *or* after
12372 the address has been taken) and
12374 * expression.cs (Conditional.DoResolve): Remove the special
12375 casing that Martin added to trueExpr and falseExpr being both
12376 NullLiteral. We get the right behavior now just by introducing
12377 the null_type into the compiler.
12379 * convert.cs (ExplicitConversion): Change the code to use
12380 null_type instead of testing `expr is NullLiteral'.
12381 (ImplicitConversionStandard): use null_type too.
12382 (ImplicitReferenceConversionExists): use null_type too.
12383 (ImplicitReferenceConversion): use null_type too.
12385 * literal.cs: The type of `NullLiteral' is now null_type instead
12387 (Resolve): Set the type here.
12389 * typemanager.cs: Introduce null_type.
12391 2004-11-17 Martin Baulig <martin@ximian.com>
12393 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
12394 direction, like FindMembers() does. Fixes #69546, testcase is in
12397 2004-11-16 Martin Baulig <martin@ximian.com>
12399 This is based on a patch from Marek Safar, see bug #69082.
12400 Fixes bugs #63705 and #67130.
12402 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
12403 method; create a MemberCache for an interface type and cache the
12406 * decl.cs (IMemberContainer.ParentContainer): Removed.
12407 (IMemberContainer.ParentCache): New property.
12408 (MemberCache.SetupCacheForInterface): Removed.
12409 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
12410 to create a cache for an interface's "parent".
12412 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
12415 2004-11-16 Martin Baulig <martin@ximian.com>
12417 Merged back from gmcs; these changes already went into gmcs a
12418 couple of weeks ago.
12421 (TypeManager.AddUserType): Removed the `ifaces' argument.
12422 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
12424 (TypeManager.AddUserInterface): Removed.
12425 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
12427 (TypeManager.GetInterfaces): Likewise.
12428 (TypeManager.GetExplicitInterfaces): Likewise.
12430 * ecore.cs (TypeExpr.GetInterfaces): Removed.
12432 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
12433 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
12435 2004-11-14 Ben Maurer <bmaurer@ximian.com>
12437 * statement.cs: Avoid adding bools to a hashtable.
12439 2004-11-07 Miguel de Icaza <miguel@ximian.com>
12441 * expression.cs (Invocation.OverloadResolve): Flag error if we are
12442 calling an unsafe method from a safe location.
12444 2004-11-06 Marek Safar <marek.safar@seznam.cz>
12447 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
12449 2004-11-06 Miguel de Icaza <miguel@ximian.com>
12451 * namespace.cs (VerifyUsing): use GetPartialName instead of
12454 2004-11-05 Miguel de Icaza <miguel@ximian.com>
12456 * statement.cs (Return.Resolve): Fix regression in typo: if
12457 `in_exc', we have to request a NeedReturnLabel, this was a typo
12458 introduced in the anonymous method check-in. Fixes #69131.
12460 * Indexers were using the ShortName when defining themselves,
12461 causing a regression in the compiler bootstrap when applying the
12462 patch from 2004-11-02 (first part), now they use their full name
12463 and the bug is gone.
12465 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
12467 * driver.cs: Strip the path from the names of embedded resources. Fixes
12470 2004-11-04 Raja R Harinath <rharinath@novell.com>
12472 Fix error message regression: cs0104-2.cs.
12473 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
12474 (AliasEntry.Resolve): Update.
12475 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
12477 (RootContext.LookupType): Update.
12479 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
12481 * cs-parser.jay: Add support for handling accessor modifiers
12482 * class: Add support port accessor modifiers and error checking,
12483 define PropertyMethod.Define as virtual (not abstract anymore)
12484 * ecore.cs: Add checking for proeprties access with access modifiers
12485 * iterators.cs: Modify Accessor constructor call based in the modified
12487 2004-11-02 Ben Maurer <bmaurer@ximian.com>
12489 * expression.cs (StringConcat): Handle being called twice,
12490 as when we have a concat in a field init with more than two
12493 2004-11-02 Miguel de Icaza <miguel@ximian.com>
12495 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
12496 special case explicit implementations, we should always produce
12497 the .property or .event declaration.
12499 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
12500 since it will not return correct data if people use this
12501 unresolved in the presence of using statements (see test-313).
12503 * class.cs (MethodData.Define): If we are an explicit interface
12504 implementation, set the method name to the full name of the
12505 interface plus the name of the method.
12507 Notice that using the method.MethodName.GetFullName() does not
12508 work, as it will only contain the name as declared on the source
12509 file (it can be a shorthand in the presence of using statements)
12510 and not the fully qualifed type name, for example:
12514 class D : ICloneable {
12515 object ICloneable.Clone () {
12519 Would produce a method called `ICloneable.Clone' instead of
12520 `System.ICloneable.Clone'.
12522 * namespace.cs (Alias.Resolve): Use GetPartialName.
12524 2004-11-01 Marek Safar <marek.safar@seznam.cz>
12526 * cs-parser.jay: Add error 1055 report.
12528 2004-11-01 Miguel de Icaza <miguel@ximian.com>
12530 * assign.cs (Assign.DoResolve): Only do the transform of
12531 assignment into a New if the types are compatible, if not, fall
12532 through and let the implicit code deal with the errors and with
12533 the necessary conversions.
12535 2004-11-01 Marek Safar <marek.safar@seznam.cz>
12537 * cs-parser.jay: Add error 1031 report.
12539 * cs-tokenizer.cs: Add location for error 1038.
12541 2004-10-31 Marek Safar <marek.safar@seznam.cz>
12543 * cs-parser.jay: Add error 1016 report.
12545 2004-10-31 Marek Safar <marek.safar@seznam.cz>
12547 * cs-parser.jay: Add errors 1575,1611 report.
12549 2004-10-31 Marek Safar <marek.safar@seznam.cz>
12551 * cs-parser.jay: Add error 1001 report.
12553 2004-10-31 Marek Safar <marek.safar@seznam.cz>
12556 * attribute.cs (GetMarshal): Add method argument for
12557 caller identification.
12559 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
12560 agument for GetMarshal and RuntimeMissingSupport.
12562 2004-10-31 Marek Safar <marek.safar@seznam.cz>
12564 * attribute.cs (ExtractSecurityPermissionSet): Removed
12565 TypeManager.code_access_permission_type.
12567 * typemanager.cs: Removed TypeManager.code_access_permission_type.
12569 2004-10-27 Miguel de Icaza <miguel@ximian.com>
12571 * expression.cs (LocalVariableReference.DoResolveLValue): Check
12572 for obsolete use of a variable here. Fixes regression on errors
12573 cs0619-25 and cs0619-26.
12575 2004-10-27 Marek Safar <marek.safar@seznam.cz>
12577 Fix #62358, implemented security attribute encoding.
12579 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
12580 Tests permitted SecurityAction for assembly or other types.
12581 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
12582 data from SecurityPermissionAttribute to PermisionSet class.
12584 * class.cs (ApplyAttributeBuilder): Added special handling
12585 for System.Security.Permissions.SecurityAttribute based types.
12587 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
12588 special handling for System.Security.Permissions.SecurityAttribute
12591 * enum.cs (ApplyAttributeBuilder): Added special handling
12592 for System.Security.Permissions.SecurityAttribute based types.
12594 * parameter.cs (ApplyAttributeBuilder): Added special handling
12595 for System.Security.Permissions.SecurityAttribute based types.
12597 * rootcontext.cs: Next 2 core types.
12599 * typemanager.cs (TypeManager.security_permission_attr_type):
12600 Built in type for the SecurityPermission Attribute.
12601 (code_access_permission_type): Build in type.
12603 2004-10-17 Miguel de Icaza <miguel@ximian.com>
12605 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
12606 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
12607 all of this information into
12608 EmitContext.EmitCapturedVariableInstance.
12610 * codegen.cs (EmitCapturedVariableInstance): move here the
12611 funcionality of emitting an ldarg.0 in the presence of a
12612 remapping. This centralizes the instance emit code.
12614 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
12615 then emit a load of this: it means that we have reached the
12616 topmost ScopeInfo: the one that contains the pointer to the
12617 instance of the class hosting the anonymous method.
12619 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
12620 captures to the topmost CaptureContext.
12622 2004-10-12 Miguel de Icaza <miguel@ximian.com>
12624 * expression.cs (LocalVariableReference): Move the knowledge about
12625 the iterators into codegen's EmitCapturedVariableInstance.
12627 2004-10-11 Miguel de Icaza <miguel@ximian.com>
12629 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
12630 all code paths return a value from an anonymous method (it is the
12631 same as the 161 error, but for anonymous methods).
12633 2004-10-08 Miguel de Icaza <miguel@ximian.com>
12635 The introduction of anonymous methods in the compiler changed
12636 various ways of doing things in the compiler. The most
12637 significant one is the hard split between the resolution phase
12638 and the emission phases of the compiler.
12640 For instance, routines that referenced local variables no
12641 longer can safely create temporary variables during the
12642 resolution phase: they must do so from the emission phase,
12643 since the variable might have been "captured", hence access to
12644 it can not be done with the local-variable operations from the runtime.
12648 (Block.Flags): New flag `IsTopLevel' to indicate that this block
12649 is a toplevel block.
12651 (ToplevelBlock): A new kind of Block, these are the blocks that
12652 are created by the parser for all toplevel method bodies. These
12653 include methods, accessors and anonymous methods.
12655 These contain some extra information not found in regular blocks:
12656 A pointer to an optional CaptureContext (for tracking captured
12657 local variables and parameters). A pointer to the parent
12660 (Return.Resolve): Catch missmatches when returning a value from an
12661 anonymous method (error 1662).
12662 Invoke NeedReturnLabel from the Resolve phase instead of the emit
12665 (Break.Resolve): ditto.
12667 (SwitchLabel): instead of defining the labels during the
12668 resolution phase, we now turned the public ILLabel and ILLabelCode
12669 labels into methods called GetILLabelCode() and GetILLabel() that
12670 only define the label during the Emit phase.
12672 (GotoCase): Track the SwitchLabel instead of the computed label
12673 (its contained therein). Emit the code by using
12674 SwitchLabel.GetILLabelCode ().
12676 (LocalInfo.Flags.Captured): A new flag has been introduce to track
12677 whether the Local has been captured or not.
12679 (LocalInfo.IsCaptured): New property, used to tell whether the
12680 local has been captured.
12682 * anonymous.cs: Vastly updated to contain the anonymous method
12685 The main classes here are: CaptureContext which tracks any
12686 captured information for a toplevel block and ScopeInfo used to
12687 track the activation frames for various local variables.
12689 Each toplevel block has an optional capture context associated
12690 with it. When a method contains an anonymous method both the
12691 toplevel method and the anonymous method will create a capture
12692 context. When variables or parameters are captured, they are
12693 recorded on the CaptureContext that owns them, for example:
12697 MyDelegate d = delegate {
12702 Here `a' will be recorded as captured on the toplevel
12703 CapturedContext, the inner captured context will not have anything
12704 (it will only have data if local variables or parameters from it
12705 are captured in a nested anonymous method.
12707 The ScopeInfo is used to track the activation frames for local
12708 variables, for example:
12710 for (int i = 0; i < 10; i++)
12711 for (int j = 0; j < 10; j++){
12712 MyDelegate d = delegate {
12717 At runtime this captures a single captured variable `i', but it
12718 captures 10 different versions of the variable `j'. The variable
12719 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
12720 recorded on a child.
12722 The toplevel ScopeInfo will also track information like the `this'
12723 pointer if instance variables were referenced (this is necessary
12724 as the anonymous method lives inside a nested class in the host
12725 type of the method).
12727 (AnonymousMethod): Expanded to track the Toplevel, implement
12728 `AnonymousMethod.Compatible' to tell whether an anonymous method
12729 can be converted to a target delegate type.
12731 The routine now also produces the anonymous method content
12733 (AnonymousDelegate): A helper class that derives from
12734 DelegateCreation, this is used to generate the code necessary to
12735 produce the delegate for the anonymous method that was created.
12737 * assign.cs: API adjustments for new changes in
12738 Convert.ImplicitStandardConversionExists.
12740 * class.cs: Adjustments to cope with the fact that now toplevel
12741 blocks are of type `ToplevelBlock'.
12743 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
12744 insteda of standard blocks.
12746 Flag errors if params arguments are passed to anonymous methods.
12748 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
12749 `CurrentAnonymousMethod' which points to the current Anonymous
12750 Method. The variable points to the AnonymousMethod class that
12751 holds the code being compiled. It is set in the new EmitContext
12752 created for the anonymous method.
12754 (EmitContext.Phase): Introduce a variable and an enumeration to
12755 assist in enforcing some rules about when and where we are allowed
12756 to invoke certain methods (EmitContext.NeedsReturnLabel is the
12757 only one that enfonces this right now).
12759 (EmitContext.HaveCaptureInfo): new helper method that returns
12760 whether we have a CapturedContext initialized.
12762 (EmitContext.CaptureVariable): New method used to register that a
12763 LocalInfo must be flagged for capturing.
12765 (EmitContext.CapturedParameter): New method used to register that a
12766 parameters must be flagged for capturing.
12768 (EmitContext.CapturedField): New method used to register that a
12769 field must be flagged for capturing.
12771 (EmitContext.HaveCapturedVariables,
12772 EmitContext.HaveCapturedFields): Return whether there are captured
12773 variables or fields.
12775 (EmitContext.EmitMethodHostInstance): This is used to emit the
12776 instance for the anonymous method. The instance might be null
12777 (static methods), this (for anonymous methods that capture nothing
12778 and happen to live side-by-side with the current method body) or a
12779 more complicated expression if the method has a CaptureContext.
12781 (EmitContext.EmitTopBlock): Routine that drives the emission of
12782 code: it will first resolve the top block, then emit any metadata
12783 and then emit the code. The split is done so that we can extract
12784 any anonymous methods and flag any captured variables/parameters.
12786 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
12787 during this phase, the ILGenerator should not be used as labels
12788 and local variables declared here might not be accessible to any
12789 code that is part of an anonymous method.
12791 Exceptions to this include the temporary variables that are
12792 created by some statements internally for holding temporary
12795 (EmitContext.EmitMeta): New routine, in charge of emitting all the
12798 (EmitContext.TemporaryReturn): This method is typically called
12799 from the Emit phase, and its the only place where we allow the
12800 ReturnLabel to be defined other than the EmitMeta. The reason is
12801 that otherwise we would have to duplicate a lot of logic in the
12802 Resolve phases of various methods that today is on the Emit
12805 (EmitContext.NeedReturnLabel): This no longer creates the label,
12806 as the ILGenerator is not valid during the resolve phase.
12808 (EmitContext.EmitThis): Extended the knowledge in this class to
12809 work in anonymous methods in addition to iterators.
12811 (EmitContext.EmitCapturedVariableInstance): This emits whatever
12812 code is necessary on the stack to access the instance to a local
12813 variable (the variable will be accessed as a field).
12815 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
12816 EmitContext.EmitAddressOfParameter): Routines to support
12817 parameters (not completed at this point).
12819 Removals: Removed RemapLocal and RemapLocalLValue. We probably
12820 will also remove the parameters.
12822 * convert.cs (Convert): Define a `ConstantEC' which points to a
12823 null. This is just to prefity some code that uses
12824 ImplicitStandardConversion code and do not have an EmitContext
12827 The idea is to flag explicitly that at that point in time, it is
12828 known that the conversion will not trigger the delegate checking
12829 code in implicit conversions (which requires a valid
12832 Everywhere: pass new EmitContext parameter since
12833 ImplicitStandardConversionExists now requires it to check for
12834 anonymous method conversions.
12836 (Convert.ImplicitStandardConversionExists): If the type of an
12837 expression is the anonymous_method_type, and the type is a
12838 delegate, we invoke the AnonymousMethod.Compatible method to check
12839 whether an implicit conversion is possible.
12841 (Convert.ImplicitConversionStandard): Only do implicit method
12842 group conversions if the language level is not ISO_1.
12844 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
12845 MethodInfo for the Invoke method. used by Delegate and
12848 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
12849 method conversions if the target type is a delegate.
12851 Removed extra debugging nops.
12853 (LocalVariableReference): Turn the `local_info' into a public
12856 Add `prepared' field, the same hack used for FieldExprs to cope
12857 with composed assignments, as Local variables do not necessarily
12858 operate purely on the stack as they used to: they can be captured
12861 Add `temp' for a temporary result, like fields.
12863 Refactor DoResolve and DoResolveLValue into DoResolveBase.
12865 It now copes with Local variables that are captured and emits the
12866 proper instance variable to load it from a field in the captured
12869 (ParameterReference.DoResolveBase): During the resolve phase,
12870 capture parameters if we are in an anonymous method.
12872 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
12873 anonymous method, use the EmitContext helper routines to emit the
12874 parameter reference.
12876 * iterators.cs: Set RemapToProxy to true/false during the
12879 * parameters.cs (GetParameterByName): New helper method.
12881 * typemanager.cs (anonymous_method_type) a new type that
12882 represents an anonyous method. This is always an internal type,
12883 used as a fencepost to test against the anonymous-methodness of an
12886 2004-10-20 Marek Safar <marek.safar@seznam.cz>
12888 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
12890 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
12892 2004-10-18 Martin Baulig <martin@ximian.com>
12894 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
12895 `Type' directly, but call ResolveType() on it.
12896 (Catch.Resolve): Likewise.
12897 (Foreach.Resolve): Likewise.
12899 2004-10-18 Martin Baulig <martin@ximian.com>
12901 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
12902 `Type' directly, but call ResolveType() on it.
12903 (Probe.DoResolve): Likewise.
12904 (ArrayCreation.LookupType): Likewise.
12905 (TypeOf.DoResolve): Likewise.
12906 (SizeOf.DoResolve): Likewise.
12908 2004-10-18 Martin Baulig <martin@ximian.com>
12910 * expression.cs (Invocation.BetterFunction): Put back
12911 TypeManager.TypeToCoreType().
12913 2004-10-18 Raja R Harinath <rharinath@novell.com>
12915 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
12918 2004-10-18 Martin Baulig <martin@ximian.com>
12920 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
12921 `Type' directly, but call ResolveType() on it.
12923 2004-10-18 Martin Baulig <martin@ximian.com>
12925 * class.cs (FieldMember.Define): Don't access the TypeExpr's
12926 `Type' directly, but call ResolveType() on it.
12927 (MemberBase.DoDefine): Likewise.
12929 * expression.cs (New.DoResolve): Don't access the TypeExpr's
12930 `Type' directly, but call ResolveType() on it.
12931 (ComposedCast.DoResolveAsTypeStep): Likewise.
12933 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
12934 `Type' directly, but call ResolveType() on it.
12936 2004-10-17 John Luke <john.luke@gmail.com>
12938 * class.cs (Operator.GetSignatureForError): use CSharpName
12940 * parameter.cs (Parameter.GetSignatureForError): Returns
12941 correct name even if was not defined.
12943 2004-10-13 Raja R Harinath <rharinath@novell.com>
12946 * class.cs (TypeContainer.EmitContext): New property.
12947 (DefineNestedTypes): Create an emitcontext for each part.
12948 (MethodCore.DoDefineParameters): Use container's emitcontext.
12949 Pass type array to InternalParameters.
12950 (MemberBase.DoDefine): Use container's emitcontext.
12951 (FieldMember.Define): Likewise.
12952 (Event.Define): Likewise.
12953 (SetMethod.GetParameterInfo): Change argument to EmitContext.
12954 Pass type array to InternalParameters.
12955 (SetIndexerMethod.GetParameterInfo): Likewise.
12956 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
12957 * delegate.cs (Define): Pass emitcontext to
12958 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
12959 array to InternalParameters.
12960 * expression.cs (ParameterReference.DoResolveBase): Pass
12961 emitcontext to GetParameterInfo.
12962 (ComposedCast.DoResolveAsTypeStep): Remove check on
12963 ec.ResolvingTypeTree.
12964 * parameter.cs (Parameter.Resolve): Change argument to
12965 EmitContext. Use ResolveAsTypeTerminal.
12966 (Parameter.GetSignature): Change argument to EmitContext.
12967 (Parameters.ComputeSignature): Likewise.
12968 (Parameters.ComputeParameterTypes): Likewise.
12969 (Parameters.GetParameterInfo): Likewise.
12970 (Parameters.ComputeAndDefineParameterTypes): Likewise.
12971 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
12972 * support.cs (InternalParameters..ctor): Remove variant that takes
12974 * typemanager.cs (system_intptr_expr): New.
12975 (InitExpressionTypes): Initialize it.
12977 2004-10-12 Chris Toshok <toshok@ximian.com>
12979 * cs-parser.jay: fix location for try_statement and catch_clause.
12981 2004-10-11 Martin Baulig <martin@ximian.com>
12983 * report.cs: Don't make --fatal abort on warnings, we have
12984 -warnaserror for that.
12986 2004-10-07 Raja R Harinath <rharinath@novell.com>
12988 More DeclSpace.ResolveType avoidance.
12989 * decl.cs (MemberCore.InUnsafe): New property.
12990 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
12991 with newly created EmitContext.
12992 (FieldMember.Define): Likewise.
12993 * delegate.cs (Delegate.Define): Likewise.
12994 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
12995 only if normal name-lookup fails.
12996 (TypeExpr.DoResolve): Enable error-checking.
12997 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
12998 (SizeOf.DoResolve): Likewise.
12999 (ComposedCast.DoResolveAsTypeStep): Likewise.
13000 (StackAlloc.DoResolve): Likewise.
13001 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
13002 (Block.Unsafe): New property.
13003 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
13004 (Unsafe): Set 'unsafe' flag of contained block.
13005 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
13006 (Fixed.Resolve): Likewise.
13007 (Catch.Resolve): Likewise.
13008 (Using.ResolveLocalVariableDecls): Likewise.
13009 (Foreach.Resolve): Likewise.
13011 2004-10-05 John Luke <john.luke@gmail.com>
13013 * cs-parser.jay: add location to error CS0175
13015 2004-10-04 Miguel de Icaza <miguel@ximian.com>
13017 * ecore.cs (Expression.Constantity): Add support for turning null
13020 * const.cs (Const.Define): Allow constants to be reference types
13021 as long as the value is Null.
13023 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
13025 * namespace.cs (NamespaceEntry.Using): No matter which warning
13026 level is set, check if this namespace name has already been added.
13028 2004-10-03 Ben Maurer <bmaurer@ximian.com>
13030 * expression.cs: reftype [!=]= null should always use br[true,false].
13033 2004-10-03 Marek Safar <marek.safar@seznam.cz>
13036 * attribute.cs: Enum conversion moved to
13037 GetAttributeArgumentExpression to be applied to the all
13040 2004-10-01 Raja R Harinath <rharinath@novell.com>
13042 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
13043 * class.c (TypeContainer.DefineType): Flag error if
13044 base types aren't accessible due to access permissions.
13045 * decl.cs (DeclSpace.ResolveType): Move logic to
13046 Expression.ResolveAsTypeTerminal.
13047 (DeclSpace.ResolveTypeExpr): Thin layer over
13048 Expression.ResolveAsTypeTerminal.
13049 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
13050 Refactor code into NestedAccess. Use it.
13051 (DeclSpace.NestedAccess): New.
13052 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
13053 argument to silence errors. Check access permissions.
13054 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
13055 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
13056 (Cast.DoResolve): Likewise.
13057 (New.DoResolve): Likewise.
13058 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
13059 (TypeOf.DoResolve): Likewise.
13061 * expression.cs (Invocation.BetterConversion): Return the Type of
13062 the better conversion. Implement section 14.4.2.3 more faithfully.
13063 (Invocation.BetterFunction): Make boolean. Make correspondence to
13064 section 14.4.2.2 explicit.
13065 (Invocation.OverloadResolve): Update.
13066 (Invocation): Remove is_base field.
13067 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
13068 (Invocation.Emit): Likewise.
13070 2004-09-27 Raja R Harinath <rharinath@novell.com>
13072 * README: Update to changes.
13074 2004-09-24 Marek Safar <marek.safar@seznam.cz>
13076 * cs-parser.jay: Reverted 642 warning fix.
13078 2004-09-23 Marek Safar <marek.safar@seznam.cz>
13081 * decl.cs (FindMemberWithSameName): Indexer can have more than
13084 2004-09-23 Marek Safar <marek.safar@seznam.cz>
13086 * expression.cs (LocalVariableReference.DoResolveLValue):
13087 Do not report warning 219 for out values.
13088 (EmptyExpression.Null): New member to avoid extra allocations.
13090 2004-09-23 Marek Safar <marek.safar@seznam.cz>
13092 * cs-parser.jay: Fix wrong warning 642 report.
13094 * cs-tokenizer.cs (CheckNextToken): New helper;
13095 Inspect next character if is same as expected.
13097 2004-09-23 Martin Baulig <martin@ximian.com>
13099 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
13100 (Convert.ImplicitReferenceConversionExists): Likewise.
13102 2004-09-23 Marek Safar <marek.safar@seznam.cz>
13104 * class.cs (Operator.Define): Add error 448 and 559 report.
13106 2004-09-22 Marek Safar <marek.safar@seznam.cz>
13108 * class.cs (MemberBase.IsTypePermitted): New protected
13109 method for checking error CS0610.
13111 2004-09-22 Marek Safar <marek.safar@seznam.cz>
13113 * class.cs (TypeContainer.HasExplicitLayout): New property
13114 Returns whether container has StructLayout attribute set Explicit.
13115 (FieldMember): New abstract class for consts and fields.
13116 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
13117 (Field): Reuse FieldMember.
13119 * const.cs (Const): Reuse FieldMember.
13121 * rootcontext.cs: EmitConstants call moved to class.
13123 2004-09-22 Martin Baulig <martin@ximian.com>
13125 Thanks to Peter Sestoft for this bug report.
13127 * expression.cs (Conditional): If both the `trueExpr' and the
13128 `falseExpr' is a NullLiteral, return a NullLiteral.
13130 2004-09-22 Martin Baulig <martin@ximian.com>
13132 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
13133 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
13134 for the "get_Current" call.
13136 2004-09-22 Martin Baulig <martin@ximian.com>
13138 Marek and me just fixed one of our oldest bugs: #28562 :-)
13140 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
13142 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
13143 we're an EnumConstant, just return that.
13144 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
13145 an EnumConstant. In this case, we need to use GetValueAsEnumType()
13146 to get the value which'll actually be written into the attribute.
13147 However, we have to use GetValue() to access the attribute's value
13150 2004-09-22 Marek Safar <marek.safar@seznam.cz>
13152 * constant.cs (Constant.IsNegative): New abstract property
13155 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
13156 (StackAlloc.DoResolve): Reused IsNegative.
13158 2004-09-21 Martin Baulig <martin@ximian.com>
13160 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
13161 if we're used in an iterator, we may be called from different
13164 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
13165 we actually have an exception block.
13167 2004-09-20 John Luke <jluke@cfl.rr.com>
13169 * class.cs, cs-parser.jay: Improve the error report for 1520:
13170 report the actual line where the error happens, not where the
13171 class was declared.
13173 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
13174 Pass location information that was available elsewhere.
13176 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
13178 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
13179 runtime to delay sign assemblies.
13181 2004-09-19 Miguel de Icaza <miguel@ximian.com>
13183 * cs-parser.jay: Do not report the stack trace, this is barely
13186 2004-08-22 John Luke <john.luke@gmail.com>
13188 * driver.cs : check that a resource id is not already used
13189 before adding it, report CS1508 if it is, bug #63637
13191 2004-09-19 Miguel de Icaza <miguel@ximian.com>
13193 * ecore.cs: Removed dead code.
13195 2004-09-18 Marek Safar <marek.safar@seznam.cz>
13197 * class.cs: Do not report warning CS0067 on the interfaces.
13199 2004-09-16 Marek Safar <marek.safar@seznam.cz>
13201 * cs-parser.jay: Add error 504 report.
13203 2004-09-16 Marek Safar <marek.safar@seznam.cz>
13205 * rootcontext.cs: WarningLevel is 4 by default now.
13207 * statement.cs (Fixed.Resolve): Do not null
13210 2004-09-16 Marek Safar <marek.safar@seznam.cz>
13213 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
13214 deep search when property is not virtual.
13215 (PropertyExpr.ResolveAccessors): Make one call for both
13218 2004-09-15 Marek Safar <marek.safar@seznam.cz>
13221 * statement.cs: Error 152 report constains also location.
13223 2004-09-15 Marek Safar <marek.safar@seznam.cz>
13226 * const.cs: Explicitly set constant as static.
13228 2004-09-15 Marek Safar <marek.safar@seznam.cz>
13231 * cs-parser.jay: Add error 1017 report.
13233 2004-09-15 Marek Safar <marek.safar@seznam.cz>
13235 Fixed bug #59980, #64224
13236 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
13238 * typemanager.cs (IsSpecialMethod): Simplified
13240 2004-09-14 Marek Safar <marek.safar@seznam.cz>
13242 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
13243 condition with better params.
13245 2004-09-14 Marek Safar <marek.safar@seznam.cz>
13248 * attribute.cs (Resolve): Property has to have both
13251 2004-09-14 Martin Baulig <martin@ximian.com>
13253 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
13255 2004-09-14 Marek Safar <marek.safar@seznam.cz>
13258 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
13259 called and is obsolete then this member suppress message
13260 when call is inside next [Obsolete] method or type.
13262 * expression.cs: Use TestObsoleteMethodUsage member.
13264 2004-09-14 Martin Baulig <martin@ximian.com>
13266 * cs-parser.jay: Sync a bit with the GMCS version.
13268 2004-09-14 Martin Baulig <martin@ximian.com>
13270 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
13271 (CSharpParser.yacc_verbose_flag): New public field.
13273 * genericparser.cs: Removed.
13275 2004-09-14 Raja R Harinath <rharinath@novell.com>
13277 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
13279 2004-09-13 Marek Safar <marek.safar@seznam.cz>
13281 * class.cs (MethodCore.CheckBase): Fix bug #65757.
13283 2004-09-10 Martin Baulig <martin@ximian.com>
13285 Backported my MemberName changes from GMCS into MCS.
13287 - we are now using a special `MemberName' class instead of using
13288 strings; in GMCS, the `MemberName' also contains the type
13291 - changed the grammar rules a bit:
13292 * the old `member_name' is now a `namespace_or_type_name':
13293 The rule is that we use `namespace_or_type_name' everywhere
13294 where we expect either a "member name" (GetEnumerator) or a
13295 "member name" with an explicit interface name
13296 (IEnumerable.GetEnumerator).
13297 In GMCS, the explicit interface name may include type arguments
13298 (IEnumerable<T>.GetEnumerator).
13299 * we use `member_name' instead of just `IDENTIFIER' for
13301 The rule is that we use `member_name' wherever a member may
13302 have type parameters in GMCS.
13304 * decl.cs (MemberName): New public class.
13305 (MemberCore.MemberName): New public readonly field.
13306 (MemberCore.ctor): Take a `MemberName' argument, not a string.
13307 (DeclSpace): Likewise.
13309 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
13310 * enum.cs (Enum.ctor): Likewise.
13312 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
13314 (AliasEntry.ctor): Take a MemberName, not an Expression.
13315 (AliasEntry.UsingAlias): Likewise.
13317 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
13318 (IMethodData.MemberName): Changed type from string to MemberName.
13319 (MemberBase.ExplicitInterfaceName): Likewise.
13320 (AbstractPropertyEventMethod.SetupName): Make this private.
13321 (AbstractPropertyEventMethod.ctor): Added `string prefix'
13322 argument; compute the member name here.
13323 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
13324 on the `member.MemberName' and the `prefix'.
13326 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
13328 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
13329 thus, we get a `MemberName' instead of a `string'. These
13330 declarations may have type parameters in GMCS.
13331 (interface_method_declaration, delegate_declaration): Likewise.
13332 (class_declaration, interface_declaration): Likewise.
13333 (method_header): Use `namespace_or_type_name' instead of
13334 `member_name'. We may be an explicit interface implementation.
13335 (property_declaration, event_declaration): Likewise.
13336 (member_name): This is now just an `IDENTIFIER', not a
13337 `namespace_or_type_name'.
13338 (type_name, interface_type): Removed.
13339 (namespace_or_type_name): Return a MemberName, not an Expression.
13340 (primary_expression): Use `member_name' instead of `IDENTIFIER';
13341 call GetTypeExpression() on the MemberName to get an expression.
13342 (IndexerDeclaration.interface_type): Changed type from string to
13344 (MakeName): Operate on MemberName's instead of string's.
13346 2004-09-13 Raja R Harinath <rharinath@novell.com>
13349 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
13350 (NamespaceEntry.Lookup): Add new argument to flag if we want the
13351 lookup to avoid symbols introduced by 'using'.
13352 * rootcontext.cs (NamespaceLookup): Update.
13354 2004-09-12 Marek Safar <marek.safar@seznam.cz>
13356 * class.cs (TypeContainer.DoDefineMembers): Do not call
13357 DefineDefaultConstructor for static classes.
13359 2004-09-12 Marek Safar <marek.safar@seznam.cz>
13361 * attribute.cs (Attribute.Resolve): Add error 653 report.
13363 * class.cs (Class.ApplyAttributeBuilder): Add error 641
13365 (Method.ApplyAttributeBuilder): Add error 685 report.
13366 (Operator.Define): Add error 564 report.
13368 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
13370 * expression.cs (Invocation.DoResolve): Add error
13371 245 and 250 report.
13373 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
13376 2004-09-11 Marek Safar <marek.safar@seznam.cz>
13378 * class.cs (ConstructorInitializer.Resolve):
13379 Wrong error number (515->516).
13381 2004-09-11 Marek Safar <marek.safar@seznam.cz>
13383 * class.cs (Indexer.Define): Add error 631 report.
13385 2004-09-11 Marek Safar <marek.safar@seznam.cz>
13387 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
13389 2004-09-11 Marek Safar <marek.safar@seznam.cz>
13391 * expression.cs (Probe.DoResolve): Add error CS0241 report.
13393 2004-09-10 Marek Safar <marek.safar@seznam.cz>
13395 * cs-parser.jay: Added error CS0241 report.
13397 2004-09-10 Raja R Harinath <rharinath@novell.com>
13399 * cs-parser.jay (fixed_statement): Introduce a scope for the
13400 declaration in the 'fixed' statement.
13402 2004-09-09 Marek Safar <marek.safar@seznam.cz>
13404 * cs-parser.jay: Added CS0230 error report.
13406 2004-09-09 Marek Safar <marek.safar@seznam.cz>
13408 * cs-parser.jay: Added errors CS0231 and CS0257 report.
13410 2004-09-09 Marek Safar <marek.safar@seznam.cz>
13412 * expression.cs (Argument.Resolve): Added error CS0192 and
13415 2004-09-09 Marek Safar <marek.safar@seznam.cz>
13417 C# 2.0 #pragma warning feature
13419 * cs-tokenizer.cs (PreProcessPragma): New method;
13420 Handles #pragma directive.
13422 * report.cs (WarningRegions): New class; Support
13423 class for #pragma warning directive. It tests whether
13424 warning is enabled for a given line.
13426 2004-09-08 Miguel de Icaza <miguel@ximian.com>
13428 * const.cs: Add more descriptive error report, tahnks to
13431 2004-09-08 Marek Safar <marek.safar@seznam.cz>
13433 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
13435 2004-09-07 Miguel de Icaza <miguel@ximian.com>
13437 * expression.cs: Apply patch from Ben: Remove dead code from
13438 ArrayCreation, and remove the TurnintoConstant call in const.cs,
13439 as that code just threw an exception anwyays.
13441 * const.cs: Remove the call to the turnintoconstant, for details
13444 * literal.cs: The type of the null-literal is the null type; So
13445 we use a placeholder type (literal.cs:System.Null, defined here)
13448 * expression.cs (Conditional.DoResolve): Remove some old code that
13449 is no longer needed, conversions have been fixed.
13451 (ArrayCreationExpression.DoResolve): Return false if we fail to
13452 resolve the inner expression.
13454 2004-09-07 Raja R Harinath <rharinath@novell.com>
13457 * cs-parser.jay (delegate_declaration): Record a delegate
13458 declaration as a type declaration.
13459 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
13461 2004-09-06 Miguel de Icaza <miguel@ximian.com>
13463 * parameter.cs: Do not crash if the type can not be resolved.
13465 * expression.cs: Report errors with unsafe pointers, fixes #64896
13467 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
13469 * expression.cs: Pointer arith always needs to do a conv.i
13470 if the operand is a long. fix 65320
13472 2004-09-04 Marek Safar <marek.safar@seznam.cz>
13474 Fixed cs0619-37.cs, cs0619-38.cs
13476 * enum.cs (GetObsoleteAttribute): Removed.
13478 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
13479 on Enum member is double staged. The first is tested member
13482 2004-09-04 Marek Safar <marek.safar@seznam.cz>
13484 Fixed #56986, #63631, #65231
13486 * class.cs: (TypeContainer.AddToMemberContainer): New method,
13487 adds member to name container.
13488 (TypeContainer.AddToTypeContainer): New method, adds type to
13490 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
13491 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
13492 AddOperator): Simplified by reusing AddToMemberContainer.
13493 (TypeContainer.UserDefinedStaticConstructor): Changed to property
13495 (Method.CheckForDuplications): Fixed implementation to test all
13497 (MemberBase): Detection whether member is explicit interface
13498 implementation is now in constructor.
13499 (MemberBase.UpdateMemberName): Handles IndexerName.
13500 (Accessor): Changed to keep also location information.
13501 (AbstractPropertyEventMethod): Is derived from MemberCore.
13502 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
13503 will be emited or not.
13504 (PropertyBase.AreAccessorsDuplicateImplementation):
13505 Tests whether accessors are not in collision with some method.
13506 (Operator): Is derived from MethodCore to simplify common
13509 * decl.cs (Flags.TestMethodDuplication): Test for duplication
13511 (DeclSpace.AddToContainer): Adds the member to defined_names
13512 table. It tests for duplications and enclosing name conflicts.
13514 * enum.cs (EnumMember): Clean up to reuse the base structures
13516 2004-09-03 Martin Baulig <martin@ximian.com>
13518 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
13519 into TypeContainer, to make partial classes work again.
13521 2004-09-03 Martin Baulig <martin@ximian.com>
13523 * rootcontext.cs (RootContext.V2): Removed.
13525 2004-03-23 Martin Baulig <martin@ximian.com>
13527 * expression.cs (Invocation.OverloadResolve): Added `bool
13528 may_fail' argument and use it instead of the Location.IsNull() hack.
13530 2004-09-03 Martin Baulig <martin@ximian.com>
13532 Merged latest changes into gmcs. Please keep this comment in
13533 here, it makes it easier for me to see what changed in MCS since
13534 the last time I merged.
13536 2004-09-03 Raja R Harinath <rharinath@novell.com>
13539 * expression.cs (BetterConversion): Don't allow either conversion
13540 to be null. Remove redundant implicit conversion test when 'q ==
13541 null' -- when this function is invoked, we already know that the
13542 implicit conversion exists.
13543 (BetterFunction): Assume that 'best' is non-null. Remove
13544 redundant reimplementation of IsApplicable when 'best' is null.
13545 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
13546 number of arguments.
13547 (IsAncestralType): Extract from OverloadResolve.
13548 (OverloadResolve): Make robust to the MethodGroupExpr being
13549 unsorted. Implement all the logic of Section 14.5.5.1, and
13550 support overloading of methods from multiple applicable types.
13551 Clean up logic somewhat. Don't pass null methods to BetterFunction.
13553 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
13554 (RealError, Warning): Append type of report to related symbol.
13556 2004-09-03 Marek Safar <marek.safar@seznam.cz>
13558 * enum.cs: Fixed CLS-Compliance checks for enum members.
13559 Error tests cs3008-8.cs, cs3014-8.cs
13561 2004-09-02 Marek Safar <marek.safar@seznam.cz>
13563 Fixed bug #62342, #63102
13564 * class.cs: ImplementIndexer uses member.IsExplicitImpl
13565 like ImplementMethod.
13567 2004-09-02 Marek Safar <marek.safar@seznam.cz>
13569 * attribute.cs (Attribute.GetAttributeArgumentExpression):
13572 2004-09-02 Martin Baulig <martin@ximian.com>
13574 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
13575 TypeManager.GetArgumentTypes() rather than calling GetParameters()
13578 2004-09-01 Marek Safar <marek.safar@seznam.cz>
13580 C# 2.0 Static classes implemented
13582 * class.cs (TypeContainer): instance_constructors,
13583 initialized_fields, initialized_static_fields,
13584 default_constructor, base_inteface_types are protected to be
13585 accessible from StaticClass.
13586 (TypeContainer.DefineDefaultConstructor): New virtual method
13587 for custom default constructor generating
13588 (StaticClass): New class to handle "Static classes" feature.
13590 * cs-parser.jay: Handle static keyword on class like instance
13593 * driver.cs: Added "/langversion" command line switch with two
13594 options (iso-1, default).
13596 2004-08-31 Marek Safar <marek.safar@seznam.cz>
13598 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
13600 2004-08-31 Miguel de Icaza <miguel@ximian.com>
13602 * delegate.cs: Style.
13604 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
13606 * delegate.cs: Add seperate instance expr field for miguel.
13608 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
13610 * PointerArithmetic (Resolve): make sure we are not doing
13611 pointer arith on void*. Also, make sure we are resolved
13612 by not setting eclass until resolve.
13614 All callers: Make sure that PointerArithmetic gets resolved.
13616 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
13618 * ArrayCreation (LookupType): If the type does not resolve
13619 to an array, give an error.
13621 2004-08-27 Marek Safar <marek.safar@seznam.cz>
13623 * statement.cs (Try.Resolve): Fixed bug #64222
13625 2004-08-27 Martin Baulig <martin@ximian.com>
13628 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
13631 2004-08-26 Marek Safar <marek.safar@seznam.cz>
13633 * ecore.cs (Constantify): Get underlying type via
13634 System.Enum.GetUnderlyingType to avoid StackOverflow on the
13635 Windows in special cases.
13637 2004-08-26 Marek Safar <marek.safar@seznam.cz>
13639 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
13640 for obtaining also private methods.
13641 (GetRemoveMethod): Used GetRemoveMethod (true)
13642 for obtaining also private methods.
13644 2004-08-24 Martin Baulig <martin@ximian.com>
13646 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
13647 MethodAttributes.HideBySig for operators.
13649 2004-08-23 Martin Baulig <martin@ximian.com>
13651 Back to the old error reporting system :-)
13653 * report.cs (Message): Removed.
13654 (Report.MessageData, ErrorData, WarningData): Removed.
13655 (Report.Error, Warning): Back to the old system.
13657 2004-08-23 Martin Baulig <martin@ximian.com>
13659 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
13661 * class.cs (TypeContainer.ParentContainer): New public virtual
13662 method; replaces the explicit interface implementation.
13663 (ClassPart.ParentContainer): Override.
13665 2004-08-23 Martin Baulig <martin@ximian.com>
13667 * statement.cs (Switch): Added support for constant switches; see
13668 #59428 or test-285.cs.
13670 2004-08-22 Marek Safar <marek.safar@seznam.cz>
13673 * statement.cs (GetEnumeratorFilter): Removed useless
13674 logic because C# specs is strict. GetEnumerator must be
13677 2004-08-22 Martin Baulig <martin@ximian.com>
13679 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13680 a switch and may break, reset the barrier. Fixes #59867.
13682 2004-08-22 Marek Safar <marek.safar@seznam.cz>
13684 CLS-Compliance speed up (~5% for corlib)
13686 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
13687 New method. Tests container for CLS-Compliant names
13689 * class.cs (TypeContainer.VerifyClsName): New method.
13690 Checks whether container name is CLS Compliant.
13691 (Constructor): Implements IMethodData.
13693 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
13694 low-case table for CLS Compliance test.
13695 (MemberCache.VerifyClsParameterConflict): New method.
13696 Checks method parameters for CS3006 error.
13698 * enum.cs (EnumMember): Is derived from MemberCore.
13699 (Enum.VerifyClsName): Optimized for better performance.
13701 2004-08-06 Marek Safar <marek.safar@seznam.cz>
13703 * report.cs: Renamed Error_T to Error and changed all
13706 2004-08-06 Marek Safar <marek.safar@seznam.cz>
13708 * class.cs (TypeContainer.IndexerArrayList): New inner class
13709 container for indexers.
13710 (TypeContainer.DefaultIndexerName): New constant for default
13711 indexer name. Replaced all "Item" with this constant.
13712 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
13714 * typemanager.cs (TypeManager.default_member_ctor): Cache here
13715 DefaultMemberAttribute constructor.
13717 2004-08-05 Martin Baulig <martin@ximian.com>
13719 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
13722 2004-08-05 Marek Safar <marek.safar@seznam.cz>
13724 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
13725 multi platforms problem.
13727 * compiler.csproj: Included shared files.
13729 2004-08-04 Marek Safar <marek.safar@seznam.cz>
13731 Fix bug 60333, 55971 in the more general way
13732 * attribute.cs (Attribute.GetAttributeArgumentExpression):
13733 Added arg_type argument for constant conversion.
13734 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
13736 2004-08-04 Marek Safar <marek.safar@seznam.cz>
13739 * class.cs (TypeContainer ): New inner classes MethodArrayList,
13740 OperatorArrayList, MethodCoreArrayList for typecontainer
13741 containers. Changed class member types to these new types.
13742 (MethodArrayList.DefineMembers): Added test for CS0659.
13744 2004-08-04 Miguel de Icaza <miguel@ximian.com>
13746 * cfold.cs: Synchronize the folding with the code in expression.cs
13747 Binary.DoNumericPromotions for uint operands.
13749 * attribute.cs: Revert patch from Raja, it introduced a regression
13750 while building Blam-1.2.1 (hard to isolate a test case).
13752 2004-08-04 Marek Safar <marek.safar@seznam.cz>
13756 (TypeContainer.Define): Renamed to DefineContainerMembers because of
13758 (MethodCore.parent_method): New member. The method we're overriding
13759 if this is an override method.
13760 (MethodCore.CheckBase): Moved from Method class and made common.
13761 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
13763 (MethodCore.CheckForDuplications): New abstract method. For custom
13764 member duplication search in a container
13765 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
13766 method and its return type.
13767 (Event.conflict_symbol): New member. Symbol with same name in the
13771 (MemberCache.FindMemberWithSameName): New method. The method
13772 is looking for conflict with inherited symbols.
13774 2004-08-04 Martin Baulig <martin@ximian.com>
13776 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
13778 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
13780 2004-08-03 Marek Safar <marek.safar@seznam.cz>
13782 * report.cs (Message): New enum for better error, warning reference in
13784 (MessageData): New inner abstract class. It generally handles printing of
13785 error and warning messages.
13786 Removed unused Error, Warning, Message methods.
13788 2004-08-03 Marek Safar <marek.safar@seznam.cz>
13790 Fix for cs0592-8.cs test
13792 (Attributable.ValidAttributeTargets): Made public.
13793 (Attribute.ExplicitTarget): New member for explicit target value.
13794 (Attribute.CheckTargets): Now we translate explicit attribute
13795 target to Target here.
13797 2004-08-03 Ben Maurer <bmaurer@ximian.com>
13799 * ecore.cs (MethodGroupExpr): new IsBase property.
13801 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
13803 * delegate.cs (DelegateCreation): store a MethodGroupExpr
13804 rather than an instance expr.
13806 (DelegateCreation.Emit): Use the method group rather than
13807 the instance expression. Also, if you have base.Foo as the
13808 method for a delegate, make sure to emit ldftn, not ldftnvirt.
13810 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
13812 (NewDelegate.DoResolve): Only check for the existance of Invoke
13813 if the method is going to be needed. Use MethodGroupExpr.
13815 (NewDelegate.Emit): Remove, DelegateCreation implements this.
13817 * expression.cs: For pointer arith., make sure to use
13818 the size of the type, not the size of the pointer to
13821 2004-08-03 Marek Safar <marek.safar@seznam.cz>
13824 * class.cs (Class): Added error CS0502 test.
13826 2004-08-03 John Luke <jluke@cfl.rr.com>
13827 Raja R Harinath <rharinath@novell.com>
13830 * attribute.cs (Attribute.complained_before): New flag.
13831 (Attribute.ResolveType, Attribute.Resolve),
13832 (Attribute.DefinePInvokeMethod): Set it.
13833 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
13835 2004-08-03 Martin Baulig <martin@ximian.com>
13837 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
13838 use a user-defined operator; we still need to do numeric
13839 promotions in case one argument is a builtin type and the other
13840 one has an implicit conversion to that type. Fixes #62322.
13842 2004-08-02 Martin Baulig <martin@ximian.com>
13844 * statement.cs (LocalInfo.Flags): Added `IsThis'.
13845 (LocalInfo.IsThis): New public property.
13846 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
13848 2004-08-01 Martin Baulig <martin@ximian.com>
13850 * class.cs (TypeContainer.GetClassBases): Don't set the default
13851 here since we may get called from GetPartialBases().
13852 (TypeContainer.DefineType): If GetClassBases() didn't return a
13853 parent, use the default one.
13855 2004-07-30 Duncan Mak <duncan@ximian.com>
13857 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
13859 2004-07-30 Martin Baulig <martin@ximian.com>
13861 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
13863 * class.cs (SourceMethod): New public class, derive from the
13864 symbol writer's ISourceMethod.
13865 (Method): Use the new symbol writer API.
13867 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
13868 as argument and use the new symbol writer.
13871 (SourceFile): Implement the symbol writer's ISourceFile.
13872 (Location.SymbolDocument): Removed.
13873 (Location.SourceFile): New public property.
13875 * symbolwriter.cs: Use the new symbol writer API.
13877 2004-07-30 Raja R Harinath <rharinath@novell.com>
13879 * Makefile (install-local): Remove. Functionality moved to
13882 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
13884 * Makefile: Install mcs.exe.config file together with mcs.exe.
13885 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
13886 correct runtime version.
13888 2004-07-25 Martin Baulig <martin@ximian.com>
13891 (TypeContainer.RegisterOrder): Removed, this was unused.
13892 (TypeContainer, interface_order): Removed.
13893 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
13894 TypeContainer as argument since we can also be called with a
13895 `PartialContainer' for a partial class/struct/interface.
13896 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
13897 of checking whether we're an `Interface' - we could be a
13898 `PartialContainer'.
13899 (PartialContainer.Register): Override; call
13900 AddClass()/AddStruct()/AddInterface() on our parent.
13902 * cs-parser.jay (interface_member_declaration): Add things to the
13903 `current_container', not the `current_class'.
13905 * rootcontext.cs (RegisterOrder): The overloaded version which
13906 takes an `Interface' was unused, removed.
13908 * typemanager.cs (TypeManager.LookupInterface): Return a
13909 `TypeContainer', not an `Interface'.
13910 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
13911 contain a `PartialContainer' for an interface, so check it's
13912 `Kind' to figure out what it is.
13914 2004-07-25 Martin Baulig <martin@ximian.com>
13916 * class.cs (Class.DefaultTypeAttributes): New public constant.
13917 (Struct.DefaultTypeAttributes): Likewise.
13918 (Interface.DefaultTypeAttributes): Likewise.
13919 (PartialContainer.TypeAttr): Override this and add the
13920 DefaultTypeAttributes.
13922 2004-07-25 Martin Baulig <martin@ximian.com>
13924 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
13925 we can just use the `Parent' field instead.
13927 2004-07-25 Martin Baulig <martin@ximian.com>
13929 * class.cs (TypeContainer.Emit): Renamed to EmitType().
13931 2004-07-25 Martin Baulig <martin@ximian.com>
13933 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
13934 our parts before defining any methods.
13935 (TypeContainer.VerifyImplements): Make this virtual.
13936 (ClassPart.VerifyImplements): Override and call VerifyImplements()
13937 on our PartialContainer.
13939 2004-07-25 Martin Baulig <martin@ximian.com>
13941 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
13943 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
13944 argument, we can just use the `Parent' field instead.
13947 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
13948 (MemberBase.DoDefine): Likewise.
13950 2004-07-24 Martin Baulig <martin@ximian.com>
13952 * decl.cs (MemberCore.Parent): New public field.
13953 (DeclSpace.Parent): Moved to MemberCore.
13955 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
13956 (MemberBase.ctor): Added TypeContainer argument, pass it to our
13958 (FieldBase, Field, Operator): Likewise.
13959 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
13960 (EventField, Event): Likewise.
13962 2004-07-23 Martin Baulig <martin@ximian.com>
13964 * class.cs (PartialContainer): New public class.
13965 (ClassPart): New public class.
13966 (TypeContainer): Added support for partial classes.
13967 (TypeContainer.GetClassBases): Splitted some of the functionality
13968 out into GetNormalBases() and GetPartialBases().
13970 * cs-tokenizer.cs (Token.PARTIAL): New token.
13971 (Tokenizer.consume_identifier): Added some hacks to recognize
13972 `partial', but only if it's immediately followed by `class',
13973 `struct' or `interface'.
13975 * cs-parser.jay: Added support for partial clases.
13977 2004-07-23 Martin Baulig <martin@ximian.com>
13979 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
13980 a `DeclSpace' and also made it readonly.
13981 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
13982 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
13983 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
13985 * cs-parser.jay: Pass the `current_class', not the
13986 `current_container' (at the moment, this is still the same thing)
13987 to a new Method, Property, Event, Indexer or Constructor.
13989 2004-07-23 Martin Baulig <martin@ximian.com>
13991 * cs-parser.jay (CSharpParser): Added a new `current_class' field
13992 and removed the `current_interface' one.
13993 (struct_declaration, class_declaration, interface_declaration):
13994 Set `current_class' to the newly created class/struct/interface;
13995 set their `Bases' and call Register() before parsing their body.
13997 2004-07-23 Martin Baulig <martin@ximian.com>
13999 * class.cs (Kind): New public enum.
14000 (TypeContainer): Made this class abstract.
14001 (TypeContainer.Kind): New public readonly field.
14002 (TypeContainer.CheckDef): New public method; moved here from
14004 (TypeContainer.Register): New public abstract method.
14005 (TypeContainer.GetPendingImplementations): New public abstract
14007 (TypeContainer.GetClassBases): Removed the `is_class' and
14008 `is_iface' parameters.
14009 (TypeContainer.DefineNestedTypes): Formerly known as
14011 (ClassOrStruct): Made this class abstract.
14013 * tree.cs (RootTypes): New public type.
14015 2004-07-20 Martin Baulig <martin@ximian.com>
14017 * tree.cs (Tree.RecordNamespace): Removed.
14018 (Tree.Namespaces): Removed.
14020 * rootcontext.cs (RootContext.IsNamespace): Removed.
14022 * cs-parser.jay (namespace_declaration): Just create a new
14023 NamespaceEntry here.
14025 2004-07-20 Martin Baulig <martin@ximian.com>
14027 * statement.cs (ExceptionStatement): New abstract class. This is
14028 now used as a base class for everyone who's using `finally'.
14029 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
14030 our local variables before using them.
14032 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
14033 virtual method. This is used by Yield.Resolve() to "steal" an
14034 outer block's `finally' clauses.
14035 (FlowBranchingException): The .ctor now takes an ExceptionStatement
14038 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
14039 version which takes an ExceptionStatement. This version must be
14040 used to create exception branchings.
14043 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
14044 (Iterator.EmitMoveNext): Added exception support; protect the
14045 block with a `fault' clause, properly handle 'finally' clauses.
14046 (Iterator.EmitDispose): Run all the `finally' clauses here.
14048 2004-07-20 Martin Baulig <martin@ximian.com>
14050 * iterator.cs: This is the first of a set of changes in the
14051 iterator code. Match the spec more closely: if we're an
14052 IEnumerable, then GetEnumerator() must be called. The first time
14053 GetEnumerator() is called, it returns the current instance; all
14054 subsequent invocations (if any) must create a copy.
14056 2004-07-19 Miguel de Icaza <miguel@ximian.com>
14058 * expression.cs: Resolve the constant expression before returning
14061 2004-07-19 Martin Baulig <martin@ximian.com>
14063 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
14064 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
14065 the return type of the new EmitContext.
14067 2004-07-18 Martin Baulig <martin@ximian.com>
14069 * class.cs (Property.Define): Fix iterators.
14071 * iterators.cs (Iterator.Define): Moved the
14072 `container.AddInterator (this)' call here from the .ctor; only do
14073 it if we resolved successfully.
14075 2004-07-17 Miguel de Icaza <miguel@ximian.com>
14077 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
14078 `true' for preprocessing directives that we parse. The return
14079 value indicates whether we should return to regular tokenizing or
14080 not, not whether it was parsed successfully.
14082 In the past if we were in: #if false ... #line #endif, we would
14083 resume parsing after `#line'. See bug 61604.
14085 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
14086 building: IsEnumType should return true only for enums, not for
14087 enums or System.Enum itself. This fixes #61593.
14089 Likely what happened is that corlib was wrong: mcs depended on
14090 this bug in some places. The bug got fixed, we had to add the
14091 hack, which caused bug 61593.
14093 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
14094 that was a workaround for the older conditions.
14096 2004-07-16 Ben Maurer <bmaurer@ximian.com>
14098 * assign.cs: IAssignMethod has a new interface, as documented
14099 inline. All assignment code now uses this new api.
14101 * ecore.cs, expression.cs: All classes which implement
14102 IAssignMethod now use the new interface.
14104 * expression.cs (Invocation): add a hack to EmitCall so that
14105 IndexerAccess can be the target of a compound assignment without
14106 evaluating its arguments twice.
14108 * statement.cs: Handle changes in Invocation api.
14110 2004-07-16 Martin Baulig <martin@ximian.com>
14112 * iterators.cs: Rewrote this. We're now using one single Proxy
14113 class for both the IEnumerable and the IEnumerator interface and
14114 `Iterator' derives from Class so we can use the high-level API.
14116 * class.cs (TypeContainer.AddIterator): New method.
14117 (TypeContainer.DoDefineType): New protected virtual method, which
14118 is called from DefineType().
14119 (TypeContainer.DoDefineMembers): Call DefineType() and
14120 DefineMembers() on all our iterators.
14121 (TypeContainer.Emit): Call Emit() on all our iterators.
14122 (TypeContainer.CloseType): Call CloseType() on all our iterators.
14124 * codegen.cs (EmitContext.CurrentIterator): New public field.
14126 2004-07-15 Martin Baulig <martin@ximian.com>
14129 (TypeManager.not_supported_exception_type): New type.
14131 2004-07-14 Martin Baulig <martin@ximian.com>
14133 * iterators.cs: Use real error numbers.
14135 2004-07-14 Martin Baulig <martin@ximian.com>
14137 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
14138 requires this to be a System.Collection.IEnumerable and not a
14139 class implementing that interface.
14140 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
14142 2004-07-13 Marek Safar <marek.safar@seznam.cz>
14144 * class.cs: Fixed previous fix, it broke some error tests.
14146 2004-07-12 Martin Baulig <martin@ximian.com>
14148 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
14151 2004-07-09 Miguel de Icaza <miguel@ximian.com>
14153 * assign.cs (LocalTemporary): Add new argument: is_address,If
14154 `is_address' is true, then the value that we store is the address
14155 to the real value, and not the value itself.
14157 * ecore.cs (PropertyExpr): use the new local temporary
14158 stuff to allow us to handle X.Y += z (where X is a struct)
14160 2004-07-08 Martin Baulig <martin@ximian.com>
14162 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
14163 not always return, just like we're doing in Using.Resolve().
14165 2004-07-07 Miguel de Icaza <miguel@ximian.com>
14167 * cs-parser.jay (fixed_statement): flag this as Pinned.
14169 2004-07-06 Miguel de Icaza <miguel@ximian.com>
14171 * typemanager.cs (TypeManager): Removed MakePinned method, this
14172 mechanism is replaced with the .NET 2.x compatible mechanism of
14173 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
14175 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
14176 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
14177 `IsFixed' property which has a different meaning.
14179 2004-07-02 Raja R Harinath <rharinath@novell.com>
14181 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
14182 visible from inside a nested class, not just the names of the
14183 immediately enclosing class.
14184 Fix for bug #60730.
14186 2004-06-24 Raja R Harinath <rharinath@novell.com>
14188 * expression.cs (BetterConversion): Remove buggy special-case
14189 handling of "implicit constant expression conversions". At this
14190 point, we already know that the conversion is possible -- we're
14191 only checking to see which is better.
14193 2004-06-24 Marek Safar <marek.safar@seznam.cz>
14195 * cs-parser.jay: Added error CS0210 test.
14197 2004-06-24 Marek Safar <marek.safar@seznam.cz>
14199 * cs-parser.jay: Added error CS0134 test.
14201 2004-06-24 Marek Safar <marek.safar@seznam.cz>
14204 * cs-parser.jay: Added error CS0145 test.
14206 2004-06-24 Marek Safar <marek.safar@seznam.cz>
14208 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
14210 2004-06-23 Ben Maurer <bmaurer@ximian.com>
14212 * expression.cs (StackAlloc.Resolve): The argument may not
14213 be a constant; deal with this case.
14215 2004-06-23 Marek Safar <marek.safar@seznam.cz>
14217 * attribute.cs (IndexerName_GetIndexerName): Renamed to
14218 GetIndexerAttributeValue.
14219 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
14221 * class.cs (Indexer.Define): Added error tests for CS0415,
14224 2004-06-23 Miguel de Icaza <miguel@ximian.com>
14226 * attribute.cs (Attribute.Resolve): Keep field code in sync with
14229 2004-06-23 Martin Baulig <martin@ximian.com>
14231 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
14232 neither return nor throw, reset the barrier as well. Fixes #60457.
14234 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
14236 * class.cs : EventAttributes is now set to None by default.
14237 This fixes bug #60459.
14239 2004-06-18 Marek Safar <marek.safar@seznam.cz>
14242 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
14243 Don't throw exception but return null (it's sufficient now).
14245 2004-06-18 Marek Safar <marek.safar@seznam.cz>
14247 * typemanager.cs (GetArgumentTypes): Faster implementation.
14249 2004-06-18 Martin Baulig <martin@ximian.com>
14251 * attribute.cs (Attribute.Resolve): Check whether we're an
14252 EmptyCast which a Constant child. Fixes #60333.
14254 2004-06-17 Ben Maurer <bmaurer@ximian.com>
14256 * statement.cs (EmitCollectionForeach): Account for the fact that
14257 not all valuetypes are in areas which we can take the address of.
14258 For these variables, we store to a temporary variable. Also, make
14259 sure that we dont emit a `callvirt' on a valuetype method.
14261 2004-06-15 Marek Safar <marek.safar@seznam.cz>
14263 * expression.cs (StackAlloc.DoReSolve): Added test for
14264 negative parameter (CS0247).
14266 2004-06-15 Marek Safar <marek.safar@seznam.cz>
14269 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
14271 2004-06-15 Marek Safar <marek.safar@seznam.cz>
14274 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
14277 2004-06-14 Marek Safar <marek.safar@seznam.cz>
14279 Fix bug #58254 & cs1555.cs, cs1556.cs
14280 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
14282 2004-06-14 Marek Safar <marek.safar@seznam.cz>
14284 * cs-parser.jay: Added error CS1669 test for indexers.
14286 2004-06-11 Martin Baulig <martin@ximian.com>
14288 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
14289 call this twice: for params and varargs methods.
14291 2004-06-11 Marek Safar <marek.safar@seznam.cz>
14294 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
14296 2004-06-11 Marek Safar <marek.safar@seznam.cz>
14298 * attribute.cs (Attribute.GetValidTargets): Made public.
14301 (AbstractPropertyEventMethod): New class for better code sharing.
14302 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
14304 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
14306 2004-06-11 Raja R Harinath <rharinath@novell.com>
14309 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
14310 that the call to Resolve is part of a MemberAccess.
14311 (Expression.Resolve): Use it for SimpleName resolution.
14312 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
14313 Add 'intermediate' boolean argument.
14314 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
14315 error message when the SimpleName can be resolved ambiguously
14316 between an expression and a type.
14317 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
14319 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
14320 call on the left-side.
14322 2004-06-11 Marek Safar <marek.safar@seznam.cz>
14325 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
14327 2004-06-11 Marek Safar <marek.safar@seznam.cz>
14329 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
14331 2004-06-11 Martin Baulig <martin@ximian.com>
14333 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
14334 varargs methods if applicable.
14336 2004-06-11 Martin Baulig <martin@ximian.com>
14338 * expression.cs (Invocation.EmitCall): Don't use
14339 `method.CallingConvention == CallingConventions.VarArgs' since the
14340 method could also have `CallingConventions.HasThis'.
14342 2004-06-11 Marek Safar <marek.safar@seznam.cz>
14344 * class.cs (Event.GetSignatureForError): Implemented.
14345 Fixed crash in error test cs3010.cs
14347 2004-06-10 Miguel de Icaza <miguel@ximian.com>
14349 * cs-tokenizer.cs: Change the way we track __arglist to be
14350 consistent with the other keywords.
14352 2004-06-09 Miguel de Icaza <miguel@ximian.com>
14354 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
14357 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
14359 * codegen.cs: Check that all referenced assemblies have a strongname
14360 before strongnaming the compiled assembly. If not report error CS1577.
14361 Fix bug #56563. Patch by Jackson Harper.
14362 * typemanager.cs: Added a method to return all referenced assemblies.
14363 Fix bug #56563. Patch by Jackson Harper.
14365 2004-06-08 Marek Safar <marek.safar@seznam.cz>
14368 (Method.ApplyAttributeBuilder): Moved and added conditional
14369 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
14372 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
14374 2004-06-08 Marek Safar <marek.safar@seznam.cz>
14377 * class.cs: (EventField.attribute_targets): Changed default target.
14379 2004-06-08 Martin Baulig <martin@ximian.com>
14381 * expression.cs (Invocation.EmitCall): Enable varargs methods.
14383 2004-06-08 Martin Baulig <martin@ximian.com>
14385 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
14387 2004-06-07 Martin Baulig <martin@ximian.com>
14389 Added support for varargs methods.
14391 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
14394 * cs-parser.jay: Added support for `__arglist'.
14396 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
14398 * expression.cs (Argument.AType): Added `ArgList'.
14399 (Invocation): Added support for varargs methods.
14400 (ArglistAccess): New public class.
14401 (Arglist): New public class.
14403 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
14405 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
14406 a method's top-level block if the method has varargs.
14408 * support.cs (ReflectionParameters, InternalParameters): Added
14409 support for varargs methods.
14411 2004-06-07 Miguel de Icaza <miguel@ximian.com>
14413 * class.cs: Provide location in indexer error report.
14415 * driver.cs: Use standard names.
14417 * namespace.cs: Catch the use of using after a namespace has been
14418 declared also on using aliases.
14420 2004-06-03 Raja R Harinath <rharinath@novell.com>
14423 * typemanager.cs (closure_private_ok, closure_invocation_type)
14424 (closure_qualifier_type, closure_invocation_assembly)
14425 (FilterWithClosure): Move to ...
14426 (Closure): New internal nested class.
14427 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
14428 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
14429 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
14430 (MemberLookup, MemberLookupFailed): Use it.
14431 * expression.cs (New.DoResolve): Treat the lookup for the
14432 constructor as being qualified by the 'new'ed type.
14433 (Indexers.GetIndexersForTypeOrInterface): Update.
14435 2004-06-03 Marek Safar <marek.safar@seznam.cz>
14438 (GetConditionalAttributeValue): New method. Returns
14439 condition of ConditionalAttribute.
14440 (SearchMulti): New method. Returns all attributes of type 't'.
14441 Use it when attribute is AllowMultiple = true.
14442 (IsConditionalMethodExcluded): New method.
14445 (Method.IsExcluded): Implemented. Returns true if method has conditional
14446 attribute and the conditions is not defined (method is excluded).
14447 (IMethodData): Extended interface for ConditionalAttribute support.
14448 (PropertyMethod.IsExcluded): Implemented.
14451 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
14454 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
14457 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
14459 * expression.cs (ArrayCreationExpression): Make this just an
14460 `expression'. It can't be a statement, so the code here was
14463 2004-06-02 Marek Safar <marek.safar@seznam.cz>
14466 * typemanager.cs (GetFullNameSignature): New method for
14469 2004-06-02 Marek Safar <marek.safar@seznam.cz>
14472 * class.cs (MemberBase.GetSignatureForError): New virtual method.
14473 Use this method when MethodBuilder is null.
14474 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
14475 Added test for error CS0626 (MONO reports error for this situation).
14476 (IMethodData.GetSignatureForError): Extended interface.
14478 2004-06-01 Marek Safar <marek.safar@seznam.cz>
14481 (AttributeTester.GetObsoleteAttribute): Returns instance of
14482 ObsoleteAttribute when type is obsolete.
14485 (TypeContainer.VerifyObsoleteAttribute): Override.
14486 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
14487 (MethodCode.VerifyObsoleteAttribute): Override.
14488 (MemberBase.VerifyObsoleteAttribute): Override.
14491 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
14492 and report proper error.
14495 Delegate.VerifyObsoleteAttribute): Override.
14498 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
14499 and report proper error.
14500 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
14503 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
14507 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
14508 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
14509 Added test for ObsoleteAttribute.
14512 (Catch): Derived from Statement.
14514 2004-06-01 Marek Safar <marek.safar@seznam.cz>
14516 Fixed bug #59071 & cs0160.cs
14518 * statement.cs (Try.Resolve): Check here whether order of catch
14519 clauses matches their dependencies.
14521 2004-05-31 Miguel de Icaza <miguel@ximian.com>
14523 * Reverted patch to namespace.cs (Use lookuptypedirect). This
14524 caused a regression: #59343. Referencing nested classes from an
14525 assembly stopped working.
14527 2004-05-31 Martin Baulig <martin@ximian.com>
14529 MCS is now frozen for beta 2.
14531 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
14533 * convert.cs: add a trivial cache for overload operator resolution.
14535 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
14537 * decl.cs: If possible, use lookuptypedirect here. We can only do
14538 this if there is no `.' after the namespace. Avoids using
14539 LookupType, which does lots of slow processing.
14540 (FindNestedType) New method, does what it says :-).
14541 * namespace.cs: use LookupTypeDirect.
14542 * rootcontext.cs: use membercache, if possible.
14543 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
14545 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
14548 According to the spec,
14550 In a member access of the form E.I, if E is a single identifier,
14551 and if the meaning of E as a simple-name (§7.5.2) is a constant,
14552 field, property, localvariable, or parameter with the same type as
14553 the meaning of E as a type-name (§3.8), then both possible
14554 meanings of E are permitted.
14556 We did not check that E as a simple-name had the same type as E as
14559 This trivial check gives us 5-7% on bootstrap time.
14561 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
14563 * expression.cs (Invocation.OverloadResolve): Avoid the
14564 use of hashtables and boxing here by allocating on demand.
14566 2004-05-30 Martin Baulig <martin@ximian.com>
14568 * rootcontext.cs (RootContext.LookupType): Don't cache things if
14569 we're doing a silent lookup. Don't try to lookup nested types in
14570 TypeManager.object_type (thanks to Ben Maurer).
14572 2004-05-30 Martin Baulig <martin@ximian.com>
14574 Committing a patch from Ben Maurer.
14576 * rootcontext.cs (RootContext.LookupType): Cache negative results.
14578 2004-05-29 Martin Baulig <martin@ximian.com>
14580 * class.cs (IMethodData.ShouldIgnore): New method.
14582 * typemanager.cs (TypeManager.MethodFlags): Don't take a
14583 `Location' argument, we don't need it anywhere. Use
14584 `IMethodData.ShouldIgnore ()' instead of
14585 `MethodData.GetMethodFlags ()'.
14586 (TypeManager.AddMethod): Removed.
14587 (TypeManager.AddMethod2): Renamed to AddMethod.
14589 2004-05-29 Martin Baulig <martin@ximian.com>
14591 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
14593 * convert.cs (Convert.ImplicitReferenceConversion): If we're
14594 converting from a class type S to an interface type and we already
14595 have an object on the stack, don't box it again. Fixes #52578.
14597 2004-05-29 Martin Baulig <martin@ximian.com>
14599 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
14600 Added support for `params' parameters. Fixes #59267.
14602 2004-05-29 Martin Baulig <martin@ximian.com>
14604 * literal.cs (NullPointer): Provide a private .ctor which sets
14605 `type' to TypeManager.object_type. Fixes #59048.
14607 2004-05-29 Martin Baulig <martin@ximian.com>
14609 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
14610 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
14612 * ecore.cs (EventExpr.instance_expr): Make the field private.
14614 2004-05-26 Marek Safar <marek.safar@seznam.cz>
14616 Fixed bug #50080 & cs0214-2.cs
14617 * expression.cs (Cast.DoResolve): Check unsafe context here.
14619 * statement.cs (Resolve.DoResolve): Likewise.
14621 2004-05-26 Martin Baulig <martin@ximian.com>
14623 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
14625 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
14626 (RootContext.LookupType): Pass down the `silent' flag.
14628 2004-05-25 Martin Baulig <martin@ximian.com>
14631 (MethodGroupExpr.IdenticalTypeName): New public property.
14632 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
14633 expression actually refers to a type.
14635 2004-05-25 Martin Baulig <martin@ximian.com>
14637 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
14638 for #56176 and made it actually work.
14640 2004-05-25 Martin Baulig <martin@ximian.com>
14642 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
14643 (FieldExpr, PropertyExpr): Override and implement
14644 CacheTemporaries. Fixes #52279.
14646 2004-05-25 Miguel de Icaza <miguel@ximian.com>
14648 * location.cs: In the new compiler listing a file twice is a
14649 warning, not an error.
14651 2004-05-24 Martin Baulig <martin@ximian.com>
14653 * enum.cs (Enum.DefineType): For the `BaseType' to be a
14654 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
14656 2004-05-24 Martin Baulig <martin@ximian.com>
14658 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
14659 walking the `using' list. Fixes #53921.
14661 2004-05-24 Martin Baulig <martin@ximian.com>
14663 * const.cs (Const.LookupConstantValue): Added support for
14664 EmptyCast's; fixes #55251.
14666 2004-05-24 Martin Baulig <martin@ximian.com>
14668 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
14669 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
14670 which does the CS0135 check. The reason is that we first need to
14671 check whether the variable actually exists.
14673 2004-05-24 Martin Baulig <martin@ximian.com>
14675 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
14676 than RootContext.LookupType() to find the explicit interface
14677 type. Fixes #58584.
14679 2004-05-24 Raja R Harinath <rharinath@novell.com>
14681 * Makefile: Simplify. Use executable.make.
14682 * mcs.exe.sources: New file. List of sources of mcs.exe.
14684 2004-05-24 Anders Carlsson <andersca@gnome.org>
14688 Use the invariant culture when doing String.Compare for CLS case
14691 2004-05-23 Martin Baulig <martin@ximian.com>
14693 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
14694 don't have any dots. Fixes #52622, added cs0246-8.cs.
14696 * namespace.cs (NamespaceEntry.Lookup): Likewise.
14698 2004-05-23 Marek Safar <marek.safar@seznam.cz>
14700 * class.cs (MemberBase.Define): Reuse MemberType member for
14701 resolved type. Other methods can use it too.
14703 2004-05-23 Martin Baulig <martin@ximian.com>
14705 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
14706 the variable also exists in the current block (otherwise, we need
14707 to report a CS0103). Fixes #58670.
14709 2004-05-23 Martin Baulig <martin@ximian.com>
14711 * flowanalysis.cs (Reachability.Reachable): Compute this
14712 on-the-fly rather than storing it as a field.
14714 2004-05-23 Martin Baulig <martin@ximian.com>
14716 * flowanalysis.cs (Reachability.And): Manually compute the
14717 resulting `barrier' from the reachability.
14719 2004-05-23 Marek Safar <marek.safar@seznam.cz>
14722 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
14723 instance of ObsoleteAttribute when symbol is obsolete.
14726 (IMethodData): Extended interface for ObsoleteAttribute support.
14728 2004-05-22 Marek Safar <marek.safar@seznam.cz>
14730 * attribute.cs: Fix bug #55970
14732 2004-05-22 Marek Safar <marek.safar@seznam.cz>
14736 (GetObsoleteAttribute): New method. Creates the instance of
14738 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
14739 ObsoleteAttribute when member is obsolete.
14740 (AttributeTester.Report_ObsoleteMessage): Common method for
14741 Obsolete error/warning reporting.
14744 (TypeContainer.base_classs_type): New member for storing parent type.
14747 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
14748 for this MemberCore.
14750 2004-05-21 Marek Safar <marek.safar@seznam.cz>
14752 * attribute.cs, const.cs: Fix bug #58590
14754 2004-05-21 Martin Baulig <martin@ximian.com>
14756 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
14757 out parameters if the end of the method is unreachable. Fixes
14760 2004-05-21 Marek Safar <marek.safar@seznam.cz>
14762 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
14763 Hari was right, why extra method.
14765 2004-05-21 Marek Safar <marek.safar@seznam.cz>
14767 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
14769 2004-05-20 Martin Baulig <martin@ximian.com>
14771 Merged this back from gmcs to keep the differences to a minumum.
14773 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
14774 instead of a Declspace.
14775 (Attribute.ResolveType): Likewise.
14776 (Attributes.Search): Likewise.
14777 (Attributes.Contains): Likewise.
14778 (Attributes.GetClsCompliantAttribute): Likewise.
14780 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
14782 (MethodData.ApplyAttributes): Take an EmitContext instead of a
14785 2004-05-19 Marek Safar <marek.safar@seznam.cz>
14787 Fix bug #58688 (MCS does not report error when the same attribute
14790 * attribute.cs (Attribute.Emit): Distinction between null and default.
14792 2004-05-19 Raja R Harinath <rharinath@novell.com>
14794 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
14795 of a top-level attribute without an attribute target.
14796 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
14798 (Attribute.Conditional_GetConditionName),
14799 (Attribute.Obsolete_GetObsoleteMessage): Update.
14800 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
14801 part of ScanForIndexerName.
14802 (Attribute.CanIgnoreInvalidAttribute): New function.
14803 (Attribute.ScanForIndexerName): Move to ...
14804 (Attributes.ScanForIndexerName): ... here.
14805 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
14806 (Attributes.Search): New internal variant that can choose not to
14807 complain if types aren't resolved. The original signature now
14809 (Attributes.GetClsCompliantAttribute): Use internal variant, with
14810 complaints suppressed.
14811 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
14812 only if it not useful.
14813 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
14814 top-level for attributes that are shared between the assembly
14815 and a top-level class.
14816 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
14817 * class.cs: Update to reflect changes.
14818 (DefineIndexers): Fuse loops.
14819 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
14820 a couple more variants of attribute names.
14822 2004-05-18 Marek Safar <marek.safar@seznam.cz>
14824 Fix bug #52585 (Implemented explicit attribute declaration)
14827 (Attributable.ValidAttributeTargets): New abstract method. It gets
14828 list of valid attribute targets for explicit target declaration.
14829 (Attribute.Target): It holds target itself.
14830 (AttributeSection): Removed.
14831 (Attribute.CheckTargets): New method. It checks whether attribute
14832 target is valid for the current element.
14835 (EventProperty): New class. For events that are declared like
14836 property (with add and remove accessors).
14837 (EventField): New class. For events that are declared like field.
14840 * cs-parser.jay: Implemented explicit attribute target declaration.
14842 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
14843 Override ValidAttributeTargets.
14846 (ReturnParameter): Class for applying custom attributes on
14848 (ParameterAtribute): New class. Class for applying custom
14849 attributes on the parameter type.
14851 2004-05-17 Miguel de Icaza <miguel@ximian.com>
14853 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
14856 (Method): Allow UNSAFE here.
14858 * modifiers.cs: Support unsafe reporting.
14860 2004-05-17 Marek Safar <marek.safar@seznam.cz>
14862 * decl.cs: Fix bug #58478.
14864 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14866 * statement.cs: When checking for unreachable code on an EmptyStatement,
14867 set the location. Fixes bug #58488.
14869 2004-05-13 Miguel de Icaza <miguel@ximian.com>
14871 * driver.cs: Add -pkg handling.
14873 From Gonzalo: UseShelLExecute=false
14875 2004-05-12 Marek Safar <marek.safar@seznam.cz>
14878 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
14880 (Attribute.IsClsCompliaceRequired): Moved to base for better
14882 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
14883 when attribute is AttributeUsageAttribute.
14884 (Attribute.GetValidTargets): Simplified.
14885 (Attribute.GetAttributeUsage): New method returns AttributeUsage
14886 attribute for this type.
14887 (Attribute.ApplyAttributes): Method renamed to Emit and make
14889 (GlobalAttributeSection): New class for special handling of global
14890 attributes (assembly, module).
14891 (AttributeSection.Emit): New method.
14893 * class.cs: Implemented Attributable abstract methods.
14894 (MethodCore.LabelParameters): Moved to Parameter class.
14895 (Accessor): Is back simple class.
14896 (PropertyMethod): Implemented Attributable abstract class.
14897 (DelegateMethod): Implemented Attributable abstract class.
14898 (Event): New constructor for disctintion between normal Event
14899 and Event with accessors.
14901 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
14903 * codegen.cs, const.cs, decl.cs, delegate.cs:
14904 (CommonAssemblyModulClass): Implemented Attributable abstract class
14907 * enum.cs: Implement IAttributeSupport interface.
14908 (EnumMember): New class for emum members. Implemented Attributable
14912 (ParameterBase): Is abstract.
14913 (ReturnParameter): New class for easier [return:] attribute handling.
14915 * typemanager.cs: Removed builder_to_attr.
14917 2004-05-11 Raja R Harinath <rharinath@novell.com>
14920 * attribute.cs (Attribute.GetPositionalValue): New function.
14921 * class.cs (TypeContainer.VerifyMembers): New function.
14922 (TypeContainer.Emit): Use it.
14923 (ClassOrStruct): New base class for Class and Struct.
14924 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
14925 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
14927 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
14928 then each non-static field should have a FieldOffset attribute.
14929 Otherwise, none of the fields should have a FieldOffset attribute.
14930 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
14931 and FieldOffset attributes.
14932 * typemanager.cs (TypeManager.struct_layout_attribute_type)
14933 (TypeManager.field_offset_attribute_type): New core types.
14934 (TypeManager.InitCoreTypes): Initialize them.
14936 2004-05-11 Michal Moskal <malekith@pld-linux.org>
14938 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
14939 Return correct type.
14942 2004-05-09 Miguel de Icaza <miguel@ximian.com>
14944 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
14945 be implicitly converted to ulong.
14947 * expression.cs: The logic for allowing operator &, | and ^ worked
14948 was wrong, it worked before because we did not report an error in
14949 an else branch. Fixes 57895.
14951 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
14952 allow volatile fields to be reference types.
14954 2004-05-07 Miguel de Icaza <miguel@ximian.com>
14956 * driver.cs: Add support for /debug-
14958 2004-05-07 Raja R Harinath <rharinath@novell.com>
14960 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
14961 Add a 'complain' parameter to silence errors.
14962 (Attribute.Resolve): Update to changes. Put in sanity check to catch
14963 silently overlooked type-resolutions.
14964 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
14965 to reflect changes.
14966 (Attributes.Search): New function.
14967 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
14968 (Attributes.GetAttributeFullName): Remove hack.
14969 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
14970 Update to reflect changes.
14971 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
14972 Use Attributes.Search instead of nested loops.
14974 2004-05-07 Marek Safar <marek.safar@seznam.cz>
14977 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
14978 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
14979 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
14981 * report.cs: (Report.Warning): Renamed to Warning_T because of
14982 parameter collision.
14984 2004-05-05 Raja R Harinath <rharinath@novell.com>
14986 * expression.cs (MemberAccess.ResolveMemberAccess):
14987 Exit with non-zero status after Report.Error.
14988 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
14990 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
14992 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
14994 * support.cs: Don't hang when the file is empty.
14996 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
14998 * support.cs: In SeekableStreamReader, compute the preamble size of the
14999 underlying stream. Position changes should take into account that initial
15002 2004-05-03 Todd Berman <tberman@sevenl.net>
15004 * driver.cs: remove unused GetSysVersion function.
15006 2004-05-03 Todd Berman <tberman@sevenl.net>
15008 * driver.cs: Remove the hack from saturday, as well as the hack
15009 from jackson (LoadAssemblyFromGac), also adds the CWD to the
15010 link_paths to get that bit proper.
15012 2004-05-01 Todd Berman <tberman@sevenl.net>
15014 * driver.cs: Try a LoadFrom before a Load, this checks the current
15015 path. This is currently a bug in mono that is be fixed, however, this
15016 provides a workaround for now. This will be removed when the bug
15019 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
15021 * CryptoConvert.cs: Updated to latest version. Fix issue with
15022 incomplete key pairs (#57941).
15024 2004-05-01 Todd Berman <tberman@sevenl.net>
15026 * driver.cs: Remove '.' from path_chars, now System.* loads properly
15029 2004-04-30 Jackson Harper <jackson@ximian.com>
15031 * codegen.cs: Open keys readonly.
15033 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15035 * typemanager.cs: don't report cyclic struct layout when a struct
15036 contains 2 or more fields of the same type. Failed for Pango.AttrShape
15037 which has 2 Pango.Rectangle fields.
15039 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
15041 * expression.cs: Handle IntPtr comparisons with IL code
15042 rather than a method call.
15044 2004-04-29 Martin Baulig <martin@ximian.com>
15046 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
15047 the list of PropertyInfo's in class hierarchy and find the
15048 accessor. Fixes #56013.
15050 2004-04-29 Martin Baulig <martin@ximian.com>
15052 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
15054 2004-04-29 Martin Baulig <martin@ximian.com>
15056 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
15058 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
15060 2004-04-29 Martin Baulig <martin@ximian.com>
15062 * class.cs (ConstructorInitializer.Resolve): Check whether the
15063 parent .ctor is accessible. Fixes #52146.
15065 2004-04-29 Martin Baulig <martin@ximian.com>
15067 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
15069 * statement.cs (Using.EmitLocalVariableDecls): Use
15070 TypeManager.idisposable_type, not typeof (IDisposable).
15071 (Foreach.EmitCollectionForeach): Added support for valuetypes.
15073 2004-04-29 Martin Baulig <martin@ximian.com>
15075 * class.cs (Event.Define): Don't emit the field and don't set
15076 RTSpecialName and SpecialName for events on interfaces. Fixes
15079 2004-04-29 Raja R Harinath <rharinath@novell.com>
15081 Refactor Attribute.ApplyAttributes.
15082 * attribute.cs (Attributable): New base class for objects that can
15083 have Attributes applied on them.
15084 (Attribute): Make AttributeUsage fields public.
15085 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
15086 (Attribute.IsInternalCall): New property.
15087 (Attribute.UsageAttr): Convert to a public read-only property.
15088 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
15089 (Attribute.ResolveType, Attribute.Resolve)
15090 (Attribute.ScanForIndexerName): Update to reflect changes.
15091 (Attribute.CheckAttributeTarget): Re-format.
15092 (Attribute.ApplyAttributes): Refactor, to various
15093 Attributable.ApplyAttributeBuilder methods.
15094 * decl.cs (MemberCore): Make Attributable.
15095 * class.cs (Accessor): Make Attributable.
15096 (MethodData.ApplyAttributes): Use proper attribute types, not
15098 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
15099 (TypeContainer.ApplyAttributeBuilder)
15100 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
15101 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
15102 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
15103 (Operator.ApplyAttributeBuilder): New factored-out methods.
15104 * const.cs (Const.ApplyAttributeBuilder): Likewise.
15105 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
15106 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
15107 * parameter.cs (ParameterBase): New Attributable base class
15108 that can also represent Return types.
15109 (Parameter): Update to the changes.
15111 2004-04-29 Jackson Harper <jackson@ximian.com>
15113 * driver.cs: Prefer the corlib system version when looking for
15114 assemblies in the GAC. This is still a hack, but its a better hack
15117 2004-04-29 Marek Safar <marek.safar@seznam.cz>
15119 * decl.cs, enum.cs: Improved error 3005 reporting.
15121 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
15122 (related_symbols): New private member for list of symbols
15123 related to reported error/warning.
15125 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
15127 2004-04-29 Martin Baulig <martin@ximian.com>
15129 * ecore.cs (Expression.Constantify): If we're an enum and
15130 TypeManager.TypeToCoreType() doesn't give us another type, use
15131 t.UnderlyingSystemType. Fixes #56178.
15133 2004-04-29 Martin Baulig <martin@ximian.com>
15135 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
15136 interfaces and for each interface, only add members directly
15137 declared in that interface. Fixes #53255.
15139 2004-04-28 Martin Baulig <martin@ximian.com>
15141 * expression.cs (ConditionalLogicalOperator): Use a temporary
15142 variable for `left' to avoid that we evaluate it more than once;
15145 2004-04-28 Martin Baulig <martin@ximian.com>
15147 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
15150 2004-04-28 Martin Baulig <martin@ximian.com>
15152 * statement.cs (LocalInfo.Resolve): Check whether the type is not
15155 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
15156 whether the type is not void (CS1547).
15158 2004-04-28 Martin Baulig <martin@ximian.com>
15160 * expression.cs (Unary.DoResolveLValue): Override this and report
15161 CS0131 for anything but Operator.Indirection.
15163 2004-04-28 Martin Baulig <martin@ximian.com>
15165 Committing a patch from Ben Maurer; see bug #50820.
15167 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
15170 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
15173 2004-04-28 Martin Baulig <martin@ximian.com>
15175 Committing a patch from Ben Maurer; see bug #50820.
15177 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
15180 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
15183 2004-04-28 Martin Baulig <martin@ximian.com>
15185 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
15186 (Block.AddLabel): Call DoLookupLabel() to only search in the
15189 2004-04-28 Martin Baulig <martin@ximian.com>
15191 * cfold.cs (ConstantFold.BinaryFold): Added special support for
15192 comparing StringConstants and NullLiterals in Equality and Inequality.
15194 2004-04-28 Jackson Harper <jackson@ximian.com>
15196 * driver.cs: Attempt to load referenced assemblies from the
15197 GAC. This is the quick and dirty version of this method that
15198 doesnt take into account versions and just takes the first
15199 canidate found. Will be good enough for now as we will not have more
15200 then one version installed into the GAC until I update this method.
15202 2004-04-28 Martin Baulig <martin@ximian.com>
15204 * typemanager.cs (TypeManager.CheckStructCycles): New public
15205 static method to check for cycles in the struct layout.
15207 * rootcontext.cs (RootContext.PopulateTypes): Call
15208 TypeManager.CheckStructCycles() for each TypeContainer.
15209 [Note: We only need to visit each type once.]
15211 2004-04-28 Martin Baulig <martin@ximian.com>
15213 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
15215 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
15216 success and added `out object value'. Use a `bool resolved' field
15217 to check whether we've already been called rather than
15218 `ConstantValue != null' since this breaks for NullLiterals.
15220 2004-04-28 Raja R Harinath <rharinath@novell.com>
15222 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
15223 setting of this flag, since the 'set' method may be non-public.
15225 2004-04-28 Raja R Harinath <rharinath@novell.com>
15227 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
15228 check on current_vector.Block.
15230 2004-04-27 Martin Baulig <martin@ximian.com>
15232 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
15233 a field initializer. Fixes #56459.
15235 2004-04-27 Martin Baulig <martin@ximian.com>
15237 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
15238 we're not attempting to use an indexer. Fixes #52154.
15240 2004-04-27 Martin Baulig <martin@ximian.com>
15242 * statement.cs (Return): Don't create a return label if we don't
15243 need it; reverts my change from January 20th. Thanks to Ben
15246 2004-04-27 Martin Baulig <martin@ximian.com>
15248 According to the spec, `goto' can only leave a nested scope, but
15251 * statement.cs (Block.LookupLabel): Only lookup in the current
15252 block, don't recurse into parent or child blocks.
15253 (Block.AddLabel): Check in parent and child blocks, report
15254 CS0140/CS0158 if we find a duplicate.
15255 (Block): Removed this indexer for label lookups.
15256 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
15257 this already does the error reporting for us.
15260 (FlowBranching.UsageVector.Block): New public variable; may be null.
15261 (FlowBranching.CreateSibling): Added `Block' argument.
15262 (FlowBranching.LookupLabel): New public virtual method. Lookup a
15263 label for the target of a `goto' and check whether we're not
15264 leaving a `finally'.
15266 2004-04-27 Martin Baulig <martin@ximian.com>
15268 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
15269 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
15272 2004-04-27 Martin Baulig <martin@ximian.com>
15274 * statement.cs (Block.AddLabel): Also check for implicit blocks
15275 and added a CS0158 check.
15277 2004-04-27 Martin Baulig <martin@ximian.com>
15279 * flowanalysis.cs (FlowBranchingLoop): New class.
15280 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
15281 UsageVector's instead of an ArrayList.
15282 (FlowBranching.Label): Likewise.
15283 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
15284 (FlowBranching.AddBreakVector): New method.
15286 2004-04-27 Miguel de Icaza <miguel@ximian.com>
15288 * attribute.cs: Small regression fix: only convert the type if we
15289 the type is different, fixes System.Drawing build.
15291 2004-04-27 Martin Baulig <martin@ximian.com>
15293 * attribute.cs (Attribute.Resolve): If we have a constant value
15294 for a named field or property, implicity convert it to the correct
15297 2004-04-27 Raja R Harinath <rharinath@novell.com>
15299 * statement.cs (Block.Block): Implicit blocks share
15300 'child_variable_names' fields with parent blocks.
15301 (Block.AddChildVariableNames): Remove.
15302 (Block.AddVariable): Mark variable as "used by a child block" in
15303 every surrounding block.
15304 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
15305 been used in a child block, complain about violation of "Invariant
15306 meaning in blocks" rule.
15307 * cs-parser.jay (declare_local_variables): Don't use
15308 AddChildVariableNames.
15309 (foreach_statement): Don't create an implicit block: 'foreach'
15310 introduces a scope.
15312 2004-04-23 Miguel de Icaza <miguel@ximian.com>
15314 * convert.cs (ImplicitNumericConversion): 0 is also positive when
15315 converting from 0L to ulong. Fixes 57522.
15317 2004-04-22 Marek Safar <marek.safar@seznam.cz>
15319 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
15320 derived class hides via 'new' keyword field from base class (test-242.cs).
15321 TODO: Handle this in the more general way.
15323 * class.cs (CheckBase): Ditto.
15325 2004-04-22 Marek Safar <marek.safar@seznam.cz>
15327 * decl.cs (caching_flags): New member for storing cached values
15329 (MemberCore.Flags): New enum where bit flags for caching_flags
15331 (MemberCore.cls_compliance): Moved to caching_flags.
15332 (DeclSpace.Created): Moved to caching_flags.
15334 * class.cs: Use caching_flags instead of DeclSpace.Created
15336 2004-04-21 Miguel de Icaza <miguel@ximian.com>
15338 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
15339 if we are only a derived class, not a nested class.
15341 * typemanager.cs: Same as above, but do this at the MemberLookup
15342 level (used by field and methods, properties are handled in
15343 PropertyExpr). Allow for the qualified access if we are a nested
15346 2004-04-21 Marek Safar <marek.safar@seznam.cz>
15348 * class.cs: Refactoring.
15349 (IMethodData): New inteface; Holds links to parent members
15350 to avoid member duplication (reduced memory allocation).
15351 (Method): Implemented IMethodData interface.
15352 (PropertyBase): New inner classes for get/set methods.
15353 (PropertyBase.PropertyMethod): Implemented IMethodData interface
15354 (Event): New inner classes for add/remove methods.
15355 (Event.DelegateMethod): Implemented IMethodData interface.
15357 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
15358 EmitContext (related to class.cs refactoring).
15360 2004-04-21 Raja R Harinath <rharinath@novell.com>
15362 * delegate.cs (Delegate.VerifyApplicability): If the number of
15363 arguments are the same as the number of parameters, first try to
15364 verify applicability ignoring any 'params' modifier on the last
15368 2004-04-16 Raja R Harinath <rharinath@novell.com>
15370 * class.cs (TypeContainer.AddIndexer): Use
15371 'ExplicitInterfaceName' to determine if interface name was
15372 explicitly specified. 'InterfaceType' is not initialized at this time.
15373 (TypeContainer.DefineIndexers): Remove use of temporary list. The
15374 Indexers array is already in the required order. Initialize
15375 'IndexerName' only if there are normal indexers.
15376 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
15377 (TypeContainer.Emit): Emit DefaultMember attribute only if
15378 IndexerName is initialized.
15381 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
15383 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
15386 2004-04-15 Raja R Harinath <rharinath@novell.com>
15388 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
15392 * attribute.cs (Attribute.Resolve): Check for duplicate named
15396 2004-04-15 Miguel de Icaza <miguel@ximian.com>
15398 * iterators.cs (MarkYield): track whether we are in an exception,
15399 and generate code accordingly. Use a temporary value to store the
15400 result for our state.
15402 I had ignored a bit the interaction of try/catch with iterators
15403 since their behavior was not entirely obvious, but now it is
15404 possible to verify that our behavior is the same as MS .NET 2.0
15408 2004-04-14 Miguel de Icaza <miguel@ximian.com>
15410 * iterators.cs: Avoid creating temporaries if there is no work to
15413 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
15414 Enumerations, use TypeManager.EnumToUnderlying and call
15417 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
15420 (This.Emit): Use EmitContext.EmitThis to emit our
15423 (This.EmitAssign): Ditto.
15425 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
15426 codepaths, we will move all the functionality into
15429 (FieldExpr.EmitAssign): Ditto.
15431 This fixes several hidden bugs that I uncovered while doing a code
15432 review of this today.
15434 * codegen.cs (EmitThis): reworked so the semantics are more clear
15435 and also support value types "this" instances.
15437 * iterators.cs: Changed so that for iterators in value types, we
15438 do not pass the value type as a parameter.
15440 Initialization of the enumerator helpers is now done in the caller
15441 instead of passing the parameters to the constructors and having
15442 the constructor set the fields.
15444 The fields have now `assembly' visibility instead of private.
15446 2004-04-11 Miguel de Icaza <miguel@ximian.com>
15448 * expression.cs (Argument.Resolve): Check if fields passed as ref
15449 or out are contained in a MarshalByRefObject.
15451 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
15452 another compiler type.
15454 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
15456 * class.cs (Indexer.Define): use the new name checking method.
15457 Also, return false on an error.
15458 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
15459 (is_identifier_[start/part]_character): make static.
15461 2004-04-10 Miguel de Icaza <miguel@ximian.com>
15463 * expression.cs (Binary.ResolveOperator): Do no append strings
15464 twice: since we can be invoked more than once (array evaluation)
15465 on the same concatenation, take care of this here. Based on a fix
15466 from Ben (bug #56454)
15468 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
15470 * codegen.cs: Fix another case where CS1548 must be reported (when
15471 delay-sign isn't specified and no private is available #56564). Fix
15472 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
15473 error when MCS is used on the MS runtime and we need to delay-sign
15474 (which seems unsupported by AssemblyBuilder - see #56621).
15476 2004-04-08 Marek Safar <marek.safar@seznam.cz>
15478 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
15479 (TypeManager.ComputeNamespaces): Faster implementation for
15482 * compiler.csproj: Updated AssemblyName to mcs.
15484 2004-04-07 Miguel de Icaza <miguel@ximian.com>
15486 * rootcontext.cs: Add new types to the boot resolution.
15488 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
15489 MulticastDelegate is not allowed.
15491 * typemanager.cs: Add new types to lookup: System.TypedReference
15494 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
15495 check for TypedReference or ArgIterator, they are not allowed.
15497 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
15498 makes us properly catch 1510 in some conditions (see bug 56016 for
15501 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
15503 * CryptoConvert.cs: update from corlib version
15506 2004-04-05 Miguel de Icaza <miguel@ximian.com>
15508 * class.cs (Indexer.Define): Check indexername declaration
15510 2004-04-05 Marek Safar <marek.safar@seznam.cz>
15512 * attribute.cs (IsClsCompliant): Fixed problem with handling
15513 all three states (compliant, not-compliant, undetected).
15515 2004-03-30 Marek Safar <marek.safar@seznam.cz>
15517 * attribute.cs (Attribute): Location is now public.
15518 (Resolve): Store resolved arguments (pos_values) in attribute class.
15519 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
15520 (GetClsCompliantAttributeValue): New method that gets
15521 CLSCompliantAttribute value.
15522 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
15523 if exists else null.
15524 (AttributeTester): New class for CLS-Compliant verification routines.
15526 * class.cs (Emit): Add CLS-Compliant verification.
15527 (Method.GetSignatureForError): Implemented.
15528 (Constructor.GetSignatureForError): Implemented
15529 (Constructor.HasCompliantArgs): Returns if constructor has
15530 CLS-Compliant arguments.
15531 (Constructor.Emit): Override.
15532 (Construcor.IsIdentifierClsCompliant): New method; For constructors
15533 is needed to test only parameters.
15534 (FieldBase.GetSignatureForError): Implemented.
15535 (TypeContainer): New member for storing base interfaces.
15536 (TypeContainer.FindMembers): Search in base interfaces too.
15538 * codegen.cs (GetClsComplianceAttribute): New method that gets
15539 assembly or module CLSCompliantAttribute value.
15540 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
15542 (ModuleClass.Emit): Add error 3012 test.
15544 * const.cs (Emit): Override and call base for CLS-Compliant tests.
15546 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
15547 state for all decl types.
15548 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
15549 if CLS-Compliant tests are required.
15550 (IsClsCompliaceRequired): New method. Analyze whether code
15551 must be CLS-Compliant.
15552 (IsExposedFromAssembly): New method. Returns true when MemberCore
15553 is exposed from assembly.
15554 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
15555 value or gets cached value.
15556 (HasClsCompliantAttribute): New method. Returns true if MemberCore
15557 is explicitly marked with CLSCompliantAttribute.
15558 (IsIdentifierClsCompliant): New abstract method. This method is
15559 used to testing error 3005.
15560 (IsIdentifierAndParamClsCompliant): New method. Common helper method
15561 for identifier and parameters CLS-Compliant testing.
15562 (VerifyClsCompliance): New method. The main virtual method for
15563 CLS-Compliant verifications.
15564 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
15565 null. I don't know why is null (too many public members !).
15566 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
15567 and get value of first CLSCompliantAttribute that found.
15569 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
15570 (VerifyClsCompliance): Override and add extra tests.
15572 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
15573 clscheck- disable CLS-Compliant verification event if assembly is has
15574 CLSCompliantAttribute(true).
15576 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
15577 ApllyAttribute is now called in emit section as in the other cases.
15578 Possible future Emit integration.
15579 (IsIdentifierClsCompliant): New override.
15580 (VerifyClsCompliance): New override.
15581 (GetEnumeratorName): Returns full enum name.
15583 * parameter.cs (GetSignatureForError): Implemented.
15585 * report.cs (WarningData): New struct for Warning message information.
15586 (LocationOfPreviousError): New method.
15587 (Warning): New method. Reports warning based on the warning table.
15588 (Error_T): New method. Reports error based on the error table.
15590 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
15591 verifications are done here.
15593 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
15595 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
15596 CLSCompliantAttribute.
15597 (all_imported_types): New member holds all imported types from other
15599 (LoadAllImportedTypes): New method fills static table with exported types
15600 from all referenced assemblies.
15601 (Modules): New property returns all assembly modules.
15603 2004-03-30 Miguel de Icaza <miguel@ximian.com>
15605 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
15606 throwing a parser error.
15608 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
15609 which removes the hardcoded get_/set_ prefixes for properties, as
15610 IL allows for the properties to be named something else.
15614 * expression.cs: Do not override operand before we know if it is
15615 non-null. Fix 56207
15617 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
15619 * typemanager.cs: support for pinned variables.
15621 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
15623 * decl.cs, typemanager.cs: Avoid using an arraylist
15624 as a buffer if there is only one result set.
15626 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
15628 * expression.cs: Make sure you cant call a static method
15629 with an instance expression, bug #56174.
15631 2004-03-29 Miguel de Icaza <miguel@ximian.com>
15633 * class.cs (IsDuplicateImplementation): Improve error reporting to
15634 flag 663 (method only differs in parameter modifier).
15636 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
15637 in preprocessor directives.
15639 * location.cs (LookupFile): Allow for the empty path.
15641 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
15642 better approach for some of that patch, but its failing with the
15643 CharSet enumeration. For now try/catch will do.
15645 * typemanager.cs: Do not crash if a struct does not have fields.
15648 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
15650 * expression.cs: cs0213, cant fix a fixed expression.
15653 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
15655 * cs-parser.jay: detect invalid embeded statements gracefully.
15658 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
15660 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
15663 the invocation type may not be a subclass of the tye of the item/
15664 The type of the item must be a subclass of the invocation item.
15669 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
15671 * attribute.cs: Added methods to get a string and a bool from an
15672 attribute. Required to information from AssemblyKeyFileAttribute,
15673 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
15674 * codegen.cs: Modified AssemblyName creation to include support for
15675 strongnames. Catch additional exceptions to report them as CS1548.
15676 * compiler.csproj: Updated include CryptoConvert.cs.
15677 * compiler.csproj.user: Removed file - user specific configuration.
15678 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
15679 Mono.Security assembly. The original class is maintained and tested in
15680 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
15681 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
15682 like CSC 8.0 (C# v2) supports.
15683 * Makefile: Added CryptoConvert.cs to mcs sources.
15684 * rootcontext.cs: Added new options for strongnames.
15686 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
15688 * driver.cs: For --expect-error, report error code `2'
15689 if the program compiled with no errors, error code `1' if
15690 it compiled with an error other than the one expected.
15692 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
15694 * compiler.csproj: Updated for Visual Studio .NET 2003.
15695 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
15696 * compiler.sln: Updated for Visual Studio .NET 2003.
15698 2004-03-24 Ravi Pratap M <ravi@ximian.com>
15700 * expression.cs: Fix bug #47234. We basically need to apply the
15701 rule that we prefer the conversion of null to a reference type
15702 when faced with a conversion to 'object' (csc behaviour).
15704 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
15706 * statement.cs: Shorter form for foreach, eliminates
15707 a local variable. r=Martin.
15709 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
15711 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
15712 checks if we can use brtrue/brfalse to test for 0.
15713 * expression.cs: use the above in the test for using brtrue/brfalse.
15714 cleanup code a bit.
15716 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
15718 * expression.cs: Rewrite string concat stuff. Benefits:
15720 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
15721 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
15722 rather than a concat chain.
15724 * typemanager.cs: Add lookups for more concat overloads.
15726 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
15728 * expression.cs: Emit shorter il code for array init.
15745 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
15747 * statement.cs: Before, two switch blocks would be merged if the
15748 total size of the blocks (end_item - begin_item + 1) was less than
15749 two times the combined sizes of the blocks.
15751 Now, it will only merge if after the merge at least half of the
15756 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
15758 * class.cs : csc build fix for GetMethods(). See bug #52503.
15760 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
15762 * expression.cs: Make sure fp comparisons work with NaN.
15763 This fixes bug #54303. Mig approved this patch a long
15764 time ago, but we were not able to test b/c the runtime
15767 2004-03-19 Miguel de Icaza <miguel@ximian.com>
15769 * ecore.cs (TypExpr.GetHashCode): implement this overload.
15771 2004-03-19 Martin Baulig <martin@ximian.com>
15773 * class.cs (MemberCore.IsDuplicateImplementation): Report the
15774 error here and not in our caller.
15776 2004-03-19 Martin Baulig <martin@ximian.com>
15778 * interface.cs: Completely killed this file.
15779 (Interface): We're now a TypeContainer and live in class.cs.
15781 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
15782 argument; we're now also called for interfaces.
15783 (TypeContainer.DefineMembers): Allow this method being called
15785 (TypeContainer.GetMethods): New public method; formerly known as
15786 Interface.GetMethod(). This is used by PendingImplementation.
15787 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
15788 it's now private and non-static.
15789 (Interface): Moved this here; it's now implemented similar to
15791 (Method, Property, Event, Indexer): Added `bool is_interface'
15792 argument to their .ctor's.
15793 (MemberBase.IsInterface): New public field.
15795 * cs-parser.jay: Create normal Method, Property, Event, Indexer
15796 instances instead of InterfaceMethod, InterfaceProperty, etc.
15797 (opt_interface_base): Removed; we now use `opt_class_base' instead.
15798 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
15800 2004-03-19 Martin Baulig <martin@ximian.com>
15802 * class.cs (MethodCore.IsDuplicateImplementation): New private
15803 method which does the CS0111 checking.
15804 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
15805 Use IsDuplicateImplementation().
15807 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
15809 * decl.cs (FindMemberToOverride): New method to find the correct
15810 method or property to override in the base class.
15812 - Make Method/Property use the above method to find the
15813 version in the base class.
15814 - Remove the InheritableMemberSignatureCompare as it is now
15817 This patch makes large code bases much faster to compile, as it is
15818 O(n) rather than O(n^2) to do this validation.
15820 Also, it fixes bug 52458 which is that nested classes are not
15821 taken into account when finding the base class member.
15823 Reviewed/Approved by Martin.
15825 2004-03-17 Marek Safar <marek.safar@seznam.cz>
15827 * interface.cs: In all interface classes removed redundant
15828 member initialization.
15830 2004-03-16 Martin Baulig <martin@ximian.com>
15832 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
15834 2004-03-15 Miguel de Icaza <miguel@ximian.com>
15836 * decl.cs (DefineTypeAndParents): New helper method to define a
15837 type's containers before the type itself is defined; This is a
15838 bug exposed by the recent changes to Windows.Forms when an
15839 implemented interface was defined inside a class that had not been
15842 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
15844 (Check): Loop correctly to report errors modifiers
15845 (UNSAFE was not in the loop, since it was the same as TOP).
15847 * interface.cs: Every interface member now takes a ModFlags,
15848 instead of a "is_new" bool, which we set on the base MemberCore.
15850 Every place where we called "UnsafeOk" in the interface, now we
15851 call the proper member (InterfaceMethod.UnsafeOK) instead to get
15852 the unsafe settings from the member declaration instead of the
15853 container interface.
15855 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
15857 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
15858 `set_indexer_name' to the pending bits (one per type).
15860 We fixed a bug today that was picking the wrong method to
15861 override, since for properties the existing InterfaceMethod code
15862 basically ignored the method name. Now we make sure that the
15863 method name is one of the valid indexer names.
15865 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
15867 * support.cs (SeekableStreamReader): Keep track of stream byte
15868 positions and don't mix them with character offsets to the buffer.
15870 Patch from Gustavo Giráldez
15872 2004-03-15 Marek Safar <marek.safar@seznam.cz>
15874 * interface.cs (InterfaceSetGetBase): Removed double member
15875 initialization, base class does it as well.
15877 2004-03-13 Martin Baulig <martin@ximian.com>
15879 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
15880 when compiling corlib.
15882 2004-03-13 Miguel de Icaza <miguel@ximian.com>
15884 * convert.cs (ExplicitConversion): We were reporting an error on
15885 certain conversions (object_type source to a value type, when the
15886 expression was `null') before we had a chance to pass it through
15887 the user defined conversions.
15889 * driver.cs: Replace / and \ in resource specifications to dots.
15892 * class.cs: Add check for duplicate operators. Fixes 52477
15894 2004-03-11 Miguel de Icaza <miguel@ximian.com>
15896 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
15897 that are in the middle of the statements, not only at the end.
15900 * class.cs (TypeContainer.AddField): No longer set the
15901 `HaveStaticConstructor' flag, now we call it
15902 `UserDefineStaticConstructor' to diferentiate the slightly
15903 semantic difference.
15905 The situation is that we were not adding BeforeFieldInit (from
15906 Modifiers.TypeAttr) to classes that could have it.
15907 BeforeFieldInit should be set to classes that have no static
15912 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
15914 And most importantly Zoltan's comment:
15916 http://bugzilla.ximian.com/show_bug.cgi?id=44229
15918 "I think beforefieldinit means 'it's ok to initialize the type sometime
15919 before its static fields are used', i.e. initialization does not need
15920 to be triggered by the first access to the type. Setting this flag
15921 helps the JIT to compile better code, since it can run the static
15922 constructor at JIT time, and does not need to generate code to call it
15923 (possibly lots of times) at runtime. Unfortunately, mcs does not set
15924 this flag for lots of classes like String.
15926 csc sets this flag if the type does not have an explicit static
15927 constructor. The reasoning seems to be that if there are only static
15928 initalizers for a type, and no static constructor, then the programmer
15929 does not care when this initialization happens, so beforefieldinit
15932 This bug prevents the AOT compiler from being usable, since it
15933 generates so many calls to mono_runtime_class_init that the AOT code
15934 is much slower than the JITted code. The JITted code is faster,
15935 because it does not generate these calls if the vtable is type is
15936 already initialized, which is true in the majority of cases. But the
15937 AOT compiler can't do this."
15939 2004-03-10 Miguel de Icaza <miguel@ximian.com>
15941 * class.cs (MethodData.Emit): Refactor the code so symbolic
15942 information is generated for destructors; For some reasons we
15943 were taking a code path that did not generate symbolic information
15946 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
15948 * class.cs: Create a Constructor.CheckBase method that
15949 takes care of all validation type code. The method
15950 contains some code that was moved from Define.
15952 It also includes new code that checks for duplicate ctors.
15953 This fixes bug #55148.
15955 2004-03-09 Joshua Tauberer <tauberer@for.net>
15957 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
15958 a { ... }-style array creation invokes EmitStaticInitializers
15959 which is not good for reference-type arrays. String, decimal
15960 and now null constants (NullCast) are not counted toward
15961 static initializers.
15963 2004-03-05 Martin Baulig <martin@ximian.com>
15965 * location.cs (SourceFile.HasLineDirective): New public field;
15966 specifies whether the file contains or is referenced by a "#line"
15968 (Location.DefineSymbolDocuments): Ignore source files which
15969 either contain or are referenced by a "#line" directive.
15971 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
15973 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
15974 direct access to our parent, so check the method inline there.
15976 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
15978 * expression.cs (Invocation.EmitCall): Miguel's last commit
15979 caused a regression. If you had:
15984 In Foo the implict this would be null.
15986 2004-02-27 Miguel de Icaza <miguel@ximian.com>
15988 * expression.cs (Invocation.EmitCall): If the method is not
15989 virtual, do not emit a CallVirt to it, use Call.
15991 * typemanager.cs (GetFullNameSignature): Improve the method to
15992 cope with ".ctor" and replace it with the type name.
15994 * class.cs (ConstructorInitializer.Resolve): Now the method takes
15995 as an argument the ConstructorBuilder where it is being defined,
15996 to catch the recursive constructor invocations.
15998 2004-02-26 Miguel de Icaza <miguel@ximian.com>
16000 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
16001 routines to check if a type is an enumerable/enumerator allow
16002 classes that implement the IEnumerable or IEnumerator interfaces.
16004 * class.cs (Property, Operator): Implement IIteratorContainer, and
16005 implement SetYields.
16007 (Property.Define): Do the block swapping for get_methods in the
16008 context of iterators. We need to check if Properties also
16009 include indexers or not.
16011 (Operator): Assign the Block before invoking the
16012 OperatorMethod.Define, so we can trigger the Iterator code
16015 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
16016 Property and Operator classes are not created when we parse the
16017 declarator but until we have the block completed, so we use a
16018 singleton SimpleIteratorContainer.Simple to flag whether the
16019 SetYields has been invoked.
16021 We propagate this setting then to the Property or the Operator to
16022 allow the `yield' to function.
16024 2004-02-25 Marek Safar <marek.safar@seznam.cz>
16026 * codegen.cs: Implemented attribute support for modules.
16027 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
16028 Assembly/Module functionality.
16030 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
16031 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
16032 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
16034 2004-02-16 Marek Safar <marek.safar@seznam.cz>
16036 * interface.cs (FindMembers): The operation is performed on all base
16037 interfaces and not only on the first. It is required for future CLS Compliance patch.
16039 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
16041 * statement.cs, codegen.cs:
16042 This patch deals with patterns such as:
16044 public class List : IEnumerable {
16046 public MyEnumerator GetEnumerator () {
16047 return new MyEnumerator(this);
16050 IEnumerator IEnumerable.GetEnumerator () {
16054 public struct MyEnumerator : IEnumerator {
16059 Before, there were a few things we did wrong:
16060 1) we would emit callvirt on a struct, which is illegal
16061 2) we emited ldarg when we needed to emit ldarga
16062 3) we would mistakenly call the interface methods on an enumerator
16063 type that derived from IEnumerator and was in another assembly. For example:
16065 public class MyEnumerator : IEnumerator
16067 Would have the interface methods called, even if there were public impls of the
16068 method. In a struct, this lead to invalid IL code.
16070 2004-02-11 Marek Safar <marek.safar@seznam.cz>
16072 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
16075 * delegate.cs (Define): Fixed crash when delegate type is undefined.
16077 2004-02-11 Miguel de Icaza <miguel@ximian.com>
16079 * cs-parser.jay: Fix small regression: we were not testing V2
16080 compiler features correctly.
16082 * interface.cs: If the emit context is null, then create one
16084 2004-02-09 Marek Safar <marek.safar@seznam.cz>
16086 * decl.cs (GetSignatureForError): New virtual method to get full name
16087 for error messages.
16089 * attribute.cs (IAttributeSupport): New interface for attribute setting.
16090 Now it is possible to rewrite ApplyAttributes method to be less if/else.
16092 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
16093 Duplicated members and code in these classes has been removed.
16094 Better encapsulation in these classes.
16096 2004-02-07 Miguel de Icaza <miguel@ximian.com>
16098 * assign.cs (Assign.DoResolve): When dealing with compound
16099 assignments, there is a new rule in ECMA C# 2.4 (might have been
16100 there before, but it is documented here) that states that in:
16104 If b is of type int, and the `op' is a shift-operator, then the
16105 above is evaluated as:
16109 * expression.cs (Binary.ResolveOperator): Instead of testing for
16110 int/uint/long/ulong, try to implicitly convert to any of those
16111 types and use that in pointer arithmetic.
16113 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
16114 method to print information for from the type, not from the
16115 null-method we were given.
16117 2004-02-01 Duncan Mak <duncan@ximian.com>
16119 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
16120 parsing for cmd, fixes bug #53694.
16122 2004-02-04 Marek Safar <marek.safar@seznam.cz>
16124 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
16125 in the member name duplication tests. Property and operator name duplication
16126 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
16128 2004-02-03 Marek Safar <marek.safar@seznam.cz>
16130 * interface.cs (PopulateMethod): Fixed crash when interface method
16131 returns not existing type (error test cs0246-3.cs).
16133 2004-02-02 Ravi Pratap M <ravi@ximian.com>
16135 * cs-parser.jay (interface_accessors): Re-write actions to also
16136 store attributes attached to get and set methods. Fix spelling
16139 (inteface_property_declaration): Modify accordingly.
16141 (InterfaceAccessorInfo): New helper class to store information to pass
16142 around between rules that use interface_accessors.
16144 * interface.cs (Emit): Apply attributes on the get and set
16145 accessors of properties and indexers too.
16147 * attribute.cs (ApplyAttributes): Modify accordingly to use the
16148 right MethodBuilder when applying attributes to the get and set accessors.
16150 2004-01-31 Miguel de Icaza <miguel@ximian.com>
16152 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
16154 2004-01-26 Miguel de Icaza <miguel@ximian.com>
16156 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
16158 2004-01-25 Miguel de Icaza <miguel@ximian.com>
16160 * cs-parser.jay: Remove YIELD token, instead use the new grammar
16161 changes that treat `yield' specially when present before `break'
16162 or `return' tokens.
16164 * cs-tokenizer.cs: yield is no longer a keyword.
16166 2004-01-23 Marek Safar <marek.safar@seznam.cz>
16168 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
16169 setting for default constructors.
16170 For default constructors are almost every time set wrong Modifier. The
16171 generated IL code has been alright. But inside mcs this values was
16172 wrong and this was reason why several of my CLS Compliance tests
16175 2004-01-22 Martin Baulig <martin@ximian.com>
16177 * cs-parser.jay (namespace_or_type_name): Return an Expression,
16178 not a QualifiedIdentifier. This is what `type_name_expression'
16179 was previously doing.
16180 (type_name_expression): Removed; the code is now in
16181 `namespace_or_type_name'.
16182 (qualified_identifier): Removed, use `namespace_or_type_name'
16184 (QualifiedIdentifier): Removed this class.
16186 2004-01-22 Martin Baulig <martin@ximian.com>
16188 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
16189 not a string as alias name.
16191 2004-01-21 Miguel de Icaza <miguel@ximian.com>
16193 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
16194 #52730 bug, and instead compute correctly the need to use a
16195 temporary variable when requesting an address based on the
16196 static/instace modified of the field and the constructor.
16198 2004-01-21 Martin Baulig <martin@ximian.com>
16200 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
16201 class and namespace before looking up aliases. Fixes #52517.
16203 2004-01-21 Martin Baulig <martin@ximian.com>
16205 * flowanalysis.cs (UsageVector.Merge): Allow variables being
16206 assinged in a 'try'; fixes exception4.cs.
16208 2004-01-21 Marek Safar <marek.safar@seznam.cz>
16209 * class.cs : Implemented parameter-less constructor for TypeContainer
16211 * decl.cs: Attributes are now stored here. New property OptAttributes
16213 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
16215 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
16217 2004-01-21 Marek Safar <marek.safar@seznam.cz>
16219 * typemanager.cs (CSharpSignature): Now reports also inner class name.
16220 (CSharpSignature): New method for indexer and property signature.
16222 2004-01-21 Marek Safar <marek.safar@seznam.cz>
16224 * pending.cs (IsVirtualFilter): Faster implementation.
16226 2004-01-21 Marek Safar <marek.safar@seznam.cz>
16228 * typemanager.cs: Avoid inclusion of same assembly more than once.
16230 2004-01-21 Marek Safar <marek.safar@seznam.cz>
16232 * cs-parser.jay: Fixed problem where the last assembly attribute
16233 has been applied also to following declaration (class, struct, etc.)
16235 2004-01-21 Marek Safar <marek.safar@seznam.cz>
16237 * class.cs: Added error CS0538, CS0539 reporting.
16238 Fixed crash on Microsoft runtime when field type is void.
16240 * cs-parser.jay: Added error CS0537 reporting.
16242 * pending.cs: Added error CS0535 reporting.
16243 Improved error report for errors CS0536, CS0534.
16245 2004-01-20 Miguel de Icaza <miguel@ximian.com>
16247 Merge a few bits from the Anonymous Method MCS tree.
16249 * statement.cs (ToplevelBlock): New class for toplevel methods,
16250 will hold anonymous methods, lifted variables.
16252 * cs-parser.jay: Create toplevel blocks for delegates and for
16253 regular blocks of code.
16255 2004-01-20 Martin Baulig <martin@ximian.com>
16257 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
16258 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
16259 and `NeedExplicitReturn'; added `IsLastStatement'.
16260 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
16261 have a `ReturnLabel' or we're not unreachable.
16263 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
16264 child's reachability; don't just override ours with it. Fixes
16265 #58058 (lluis's example).
16266 (FlowBranching): Added public InTryOrCatch(), InCatch(),
16267 InFinally(), InLoop(), InSwitch() and
16268 BreakCrossesTryCatchBoundary() methods.
16270 * statement.cs (Return): Do all error checking in Resolve().
16271 Unless we are the last statement in a top-level block, always
16272 create a return label and jump to it.
16273 (Break, Continue): Do all error checking in Resolve(); also make
16274 sure we aren't leaving a `finally'.
16275 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
16276 statement in a top-level block.
16277 (Block.Flags): Added `IsDestructor'.
16278 (Block.IsDestructor): New public property.
16280 2004-01-20 Martin Baulig <martin@ximian.com>
16282 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
16284 2004-01-20 Martin Baulig <martin@ximian.com>
16286 * statement.cs (Statement.ResolveUnreachable): New public method.
16287 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
16288 (Block.Resolve): Resolve unreachable statements.
16290 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
16292 * expression.cs: We need to fix the case where we do
16293 not have a temp variable here.
16295 * assign.cs: Only expression compound assignments need
16296 temporary variables.
16298 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
16300 * flowanalysis.cs: Reduce memory allocation in a few ways:
16301 - A block with no variables should not allocate a bit
16303 - A method with no out parameters does not need any tracking
16304 for assignment of the parameters, so we need not allocate
16307 public readonly Type[] VariableTypes;
16308 public readonly string[] VariableNames;
16309 Are redundant. The data is already stored in the variable
16310 map, so we need not allocate another array for it.
16311 - We need to add alot of checks for if (params | locals) == null
16312 due to the first two changes.
16314 2004-01-18 Miguel de Icaza <miguel@ximian.com>
16316 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
16317 implement IMemoryLocation, we store a copy on a local variable and
16318 take the address of it. Patch from Benjamin Jemlich
16320 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
16321 to use a special "type_name_expression" rule which reduces the
16322 number of "QualifiedIdentifier" classes created, and instead
16323 directly creates MemberAccess expressions.
16325 2004-01-17 Miguel de Icaza <miguel@ximian.com>
16327 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
16328 that fixes #52853. Null literal assignment to ValueType
16330 * class.cs (MethodData.Emit): Instead of checking the name of the
16331 method to determine if its a destructor, create a new derived
16332 class from Method called Destructor, and test for that.
16334 * cs-parser.jay: Create a Destructor object instead of a Method.
16336 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
16340 2004-01-16 Miguel de Icaza <miguel@ximian.com>
16342 * expression.cs (Binary.ResolveOperator): Perform an implicit
16343 conversion from MethodGroups to their delegate types on the
16344 Addition operation.
16346 * delegate.cs: Introduce a new class DelegateCreation that is the
16347 base class for `NewDelegate' and `ImplicitDelegateCreation',
16348 factor some code in here.
16350 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
16351 conversion from MethodGroups to compatible delegate types.
16353 * ecore.cs (Expression.Resolve): Do not flag error 654
16354 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
16355 we allow conversions from MethodGroups to delegate types now.
16357 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
16358 assignments in v2 either.
16360 2004-01-10 Miguel de Icaza <miguel@ximian.com>
16362 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
16363 static read-only fields in ctors.
16365 Applied patch from Benjamin Jemlich
16367 * expression.cs (UnaryMutator): Avoid leaking local variables.
16369 2004-01-09 Miguel de Icaza <miguel@ximian.com>
16371 * cs-tokenizer.cs (IsCastToken): Allow the various native types
16372 here to return true, as they can be used like this:
16374 (XXX) int.MEMBER ()
16376 Fixed 49836 and all the other dups
16378 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
16380 * driver.cs: Implement /win32res and /win32icon.
16382 2004-01-08 Miguel de Icaza <miguel@ximian.com>
16384 * cs-parser.jay: Add a rule to improve error handling for the
16385 common mistake of placing modifiers after the type.
16387 2004-01-07 Miguel de Icaza <miguel@ximian.com>
16389 * cs-parser.jay (interface_event_declaration): Catch
16390 initialization of events on interfaces, and report cs0068
16392 * cs-parser.jay (interface_event_declaration): Catch
16393 initialization of events.
16395 * ecore.cs: Better report missing constructors.
16397 * expression.cs (Binary.ResolveOperator): My previous bug fix had
16398 the error reporting done in the wrong place. Fix.
16400 * expression.cs (Binary.ResolveOperator): Catch the
16401 operator + (E x, E y) error earlier, and later allow for implicit
16402 conversions in operator +/- (E e, U x) from U to the underlying
16405 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
16406 52596, if the container class is abstract, the default constructor
16407 is protected otherwise its public (before, we were always public).
16409 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
16412 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
16413 Jemlich that fixes bug #52597, MCS was generating invalid code for
16414 idisposable structs. Thanks to Ben for following up with this
16417 2004-01-06 Miguel de Icaza <miguel@ximian.com>
16419 * driver.cs: Allow assemblies without code to be generated, fixes
16422 2004-01-07 Nick Drochak <ndrochak@gol.com>
16424 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
16426 2004-01-05 Miguel de Icaza <miguel@ximian.com>
16428 * cs-parser.jay: Add rules to improve error reporting if fields or
16429 methods are declared at the namespace level (error 116)
16431 * Add rules to catch event add/remove
16433 2004-01-04 David Sheldon <dave-mono@earth.li>
16435 * expression.cs: Added matching ")" to error message for
16438 2004-01-03 Todd Berman <tberman@gentoo.org>
16440 * ecore.cs, attribute.cs:
16441 Applying fix from #52429.
16443 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
16445 * ecore.cs, expression.cs, statement.cs:
16446 Total rewrite of how we handle branching. We
16447 now handle complex boolean expressions with fewer
16448 jumps. As well if (x == 0) no longer emits a ceq.
16450 if (x is Foo) is much faster now, because we generate
16453 Overall, we get a pretty big improvement on our benchmark
16454 tests. The code we generate is smaller and more readable.
16456 I did a full two-stage bootstrap. The patch was reviewed
16457 by Martin and Miguel.
16459 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
16461 * cs-parser.jay: Make primary_expression not take a QI.
16462 we dont need this because the member_access rule covers
16463 us here. So we replace the rule with just IDENTIFIER.
16465 This has two good effects. First, we remove a s/r conflict.
16466 Second, we allocate many fewer QualifiedIdentifier objects.
16468 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
16470 * attribute.cs: Handle MarshalAs attributes as pseudo, and
16471 set the correct information via SRE. This prevents
16472 hanging on the MS runtime. Fixes #29374.
16474 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
16476 * convert.cs: correctly handle conversions to value types
16477 from Enum and ValueType as unboxing conversions.
16479 Fixes bug #52569. Patch by Benjamin Jemlich.
16481 2004-01-02 Ravi Pratap <ravi@ximian.com>
16483 * expression.cs (BetterConversion): Prefer int -> uint
16484 over int -> ulong (csc's behaviour). This fixed bug #52046.
16486 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
16488 * decl.cs (MemberCache.FindMembers): now returns a
16491 * typemanager.cs: In general, go with with ^^.
16492 (CopyNewMethods): take an IList.
16493 (RealMemberLookup): Only allocate an arraylist
16494 if we copy from two sets of methods.
16496 This change basically does two things:
16497 1) Fewer array lists allocated due to CopyNewMethods.
16498 2) the explicit cast in MemberList costed ALOT.
16500 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
16502 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
16503 a hashtable to avoid needless string allocations when an identifier is
16504 used more than once (the common case).
16506 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
16508 * pending.cs: MS's TypeBuilder.GetInterfaces ()
16509 is broken, it will not return anything. So, we
16510 have to use the information we have in mcs to
16513 * typemanager.cs: Add a cache for GetInterfaces,
16514 since this will now be used more often (due to ^^)
16516 (GetExplicitInterfaces) New method that gets the
16517 declared, not effective, interfaces on a type
16518 builder (eg, if you have interface IFoo, interface
16519 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
16522 This patch makes MCS able to bootstrap itself on
16525 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
16527 * expression.cs: Remove the Nop's that Miguel put
16530 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
16532 * report.cs, codegen.cs: Give the real stack trace to
16533 the error when an exception is thrown.
16535 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
16537 * decl.cs: only allocate hashtables for ifaces if
16540 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
16542 * expression.cs: fix the error from cs0121-2.cs
16543 (a parent interface has two child interfaces that
16544 have a function with the same name and 0 params
16545 and the function is called through the parent).
16547 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
16549 * class.cs, rootcontext.cs, typmanager.cs: do not
16552 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
16554 * codegen.cs: remove stack for the ec flow branching.
16555 It is already a linked list, so no need.
16557 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
16559 * Makefile: Allow custom profiler here.
16561 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
16563 * typemanager.cs (LookupType):
16564 - Use a static char [], because split takes
16565 a param array for args, so it was allocating
16567 - Do not store true in a hashtable, it boxes.
16569 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
16571 * flowanalysis.cs: bytify common enums.
16573 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
16575 * modifiers.cs: Add a new set of flags for the
16576 flags allowed on explicit interface impls.
16577 * cs-parser.jay: catch the use of modifiers in
16578 interfaces correctly.
16579 * class.cs: catch private void IFoo.Blah ().
16581 All related to bug #50572.
16583 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
16585 * decl.cs: Rewrite the consistant accessability checking.
16586 Accessability is not linear, it must be implemented in
16587 a tableish way. Fixes #49704.
16589 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
16591 * expression.cs: Handle negation in a checked context.
16592 We must use subtraction from zero. Fixes #38674.
16594 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
16596 * class.cs: Ignore static void main in DLLs.
16597 * rootcontext.cs: Handle the target type here,
16598 since we are have to access it from class.cs
16599 * driver.cs: account for the above.
16601 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
16603 * report.cs: Give line numbers and files if available.
16605 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
16607 * driver.cs: Implement /addmodule.
16609 * typemanager.cs: Change 'modules' field so it now contains Modules not
16612 2003-12-20 Martin Baulig <martin@ximian.com>
16614 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
16615 (FieldBase.IsAssigned): Removed this field.
16616 (FieldBase.SetAssigned): New public method.
16617 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
16619 2003-12-20 Martin Baulig <martin@ximian.com>
16621 * expression.cs (LocalVariableReference.DoResolve): Don't set
16622 `vi.Used' if we're called from DoResolveLValue().
16624 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
16625 returns the usage vector it just merged into the current one -
16626 pass this one to UsageWarning().
16627 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
16628 of the `EmitContext', don't call this recursively on our children.
16630 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
16632 * driver.cs: Implement /target:module.
16634 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
16636 * support.cs (CharArrayHashtable): New helper class.
16638 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
16639 char arrays, not strings, so we can avoid creating a string in
16640 consume_identifier if the identifier is a keyword.
16642 2003-12-16 Martin Baulig <martin@ximian.com>
16644 * statement.cs (LocalInfo.Assigned): Removed this property.
16645 (LocalInfo.Flags): Removed `Assigned'.
16646 (LocalInfo.IsAssigned): New public method; takes the EmitContext
16647 and uses flow analysis.
16648 (Block.UsageWarning): Made this method private.
16649 (Block.Resolve): Call UsageWarning() if appropriate.
16651 * expression.cs (LocalVariableReference.DoResolve): Always set
16652 LocalInfo.Used here.
16654 2003-12-13 Martin Baulig <martin@ximian.com>
16656 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
16657 any value here; we're now using flow analysis to figure out
16658 whether a statement/block returns a value.
16660 2003-12-13 Martin Baulig <martin@ximian.com>
16662 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
16664 (FlowBranching.MergeFinally): Don't call
16665 `branching.CheckOutParameters()' here, this is called in
16667 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
16668 when adding the `finally' vector.
16670 2003-12-13 Martin Baulig <martin@ximian.com>
16673 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
16674 actually work and also fix #48962.
16676 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
16678 * decl.cs: Do not check System.Object for nested types,
16679 since we know it does not have any. Big bang for buck:
16682 Run 1: 8.35 seconds
16683 Run 2: 8.32 seconds
16684 corlib: 17.99 seconds
16686 Run 1: 8.17 seconds
16687 Run 2: 8.17 seconds
16688 corlib: 17.39 seconds
16690 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
16692 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
16693 time we are returning 0 members, so we save alot here.
16695 2003-12-11 Martin Baulig <martin@ximian.com>
16697 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
16698 `MergeChild()', also just take the `FlowBranching' as argument;
16699 call Merge() on it and return the result.
16700 (FlowBranching.Merge): We don't need to do anything if we just
16703 2003-12-11 Martin Baulig <martin@ximian.com>
16705 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
16706 them in an `ArrayList' to reduce memory usage. Thanks to Ben
16707 Maurer for this idea.
16709 2003-12-11 Martin Baulig <martin@ximian.com>
16711 * flowanalysis.cs (MergeResult): This class is now gone; we now
16712 use the `UsageVector' for this. The reason for this is that if a
16713 branching just has one sibling, we don't need to "merge" them at
16714 all - that's the next step to do.
16715 (FlowBranching.Merge): We now return a `UsageVector' instead of a
16718 2003-12-11 Martin Baulig <martin@ximian.com>
16720 Reworked flow analyis and made it more precise and bug-free. The
16721 most important change is that we're now using a special `Reachability'
16722 class instead of having "magic" meanings of `FlowReturns'. I'll
16723 do some more cleanups and optimizations and also add some more
16724 documentation this week.
16726 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
16727 largely reworked this class.
16728 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
16729 the new `Reachability' class instead of having "magic" values here.
16730 (FlowBranching): We're now using an instance of `Reachability'
16731 instead of having separate `Returns', `Breaks' etc. fields.
16733 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
16734 based on flow analysis; ignore the return value of block.Emit ().
16736 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
16738 * driver.cs typemanager.cs: Find the mono extensions to corlib even
16739 if they are private.
16741 2003-12-09 Martin Baulig <martin@ximian.com>
16743 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
16744 call them directly on the UsageVector.
16746 2003-12-09 Martin Baulig <martin@ximian.com>
16748 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
16749 Changed return type from `FlowReturns' to `Reachability'.
16751 2003-12-09 Martin Baulig <martin@ximian.com>
16753 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
16754 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
16755 `Reachable' fields with a single `Reachability' one.
16757 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
16759 * class.cs (FindMembers): Remove foreach's.
16764 Run 1: 8.74 seconds
16765 Run 2: 8.71 seconds
16768 Run 1: 8.64 seconds
16769 Run 2: 8.58 seconds
16772 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
16777 This patch does a few things:
16778 1. EmptyStatement is now a singleton, so it is never reallocated.
16779 2. All blah is EmptyStatement constructs have been changed to
16780 blah == EmptyStatement.Value, which is much faster and valid
16781 now that EmptyStatement is a singleton.
16782 3. When resolving a block, rather than allocating a new array for
16783 the non-empty statements, empty statements are replaced with
16784 EmptyStatement.Value
16785 4. Some recursive functions have been made non-recursive.
16786 Mainly the performance impact is from (3), however (1) and (2) are needed for
16787 this to work. (4) does not make a big difference in normal situations, however
16788 it makes the profile look saner.
16793 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
16794 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
16795 Total memory allocated: 56397 KB
16798 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
16799 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
16800 Total memory allocated: 55666 KB
16802 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
16804 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
16805 than the hashtable in a hashtable version
16807 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
16808 we always end up concating a string. This results in a huge perf
16809 loss, because many strings have to be tracked by the GC. In this
16810 patch, we first use a hashtable that works with two keys, so that
16811 the strings do not need to be concat'ed.
16815 Run 1: 8.74 seconds
16816 Run 2: 8.71 seconds
16819 Run 1: 8.65 seconds
16820 Run 2: 8.56 seconds
16822 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
16824 * Makefile: Add a new target `do-time' that does a quick and simple
16825 profile, leaving easy to parse output.
16827 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
16829 * codegen.cs (Init): Create the dynamic assembly with
16830 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
16832 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
16834 * support.cs: Make the PtrHashtable use only one
16835 instance of its comparer.
16837 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
16839 * typemanager.cs: Fix lookup of GetNamespaces.
16841 2003-11-29 Miguel de Icaza <miguel@ximian.com>
16843 * expression.cs: Removed redundant line.
16845 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
16846 ArrayLists, use for loops with bounds.
16848 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
16851 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
16852 arraylists, use for loop with bounds.
16854 The above three changes give us a 0.071 second performance
16855 improvement out of 3.294 seconds down to 3.223. On my machine
16856 the above changes reduced the memory usage by 1,387 KB during
16857 compiler bootstrap.
16859 * cs-parser.jay (QualifiedIdentifier): New class used to represent
16860 QualifiedIdentifiers. Before we created a new string through
16861 concatenation, and mostly later on, the result would be
16862 manipulated by DecomposeQI through string manipulation.
16864 This reduced the compiler memory usage for bootstrapping from
16865 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
16866 compile times in 0.05 seconds.
16868 2003-11-28 Dick Porter <dick@ximian.com>
16870 * support.cs: Do string compares with the Invariant culture.
16878 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
16879 the comparison is done with the Invariant culture.
16881 2003-11-27 Miguel de Icaza <miguel@ximian.com>
16883 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
16884 GetEnumerator method.
16886 (ProbeCollectionType): Iterate starting at the most specific type
16887 upwards looking for a GetEnumerator
16889 * expression.cs: Shift count can be up to 31 for int/uint and 63
16892 2003-11-26 Miguel de Icaza <miguel@ximian.com>
16894 * statement.cs (Block.LookupLabel): Also look for the label on the
16895 children blocks. Use a hash table to keep track of visited
16898 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
16899 we actually did transform the other operand, otherwise fall back
16900 to the common codepath that casts to long.
16902 * cs-tokenizer.cs: Use the same code pattern as the int case.
16903 Maybe I should do the parsing myself, and avoid depending on the
16904 Parse routines to get this done.
16906 2003-11-25 Miguel de Icaza <miguel@ximian.com>
16908 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
16909 which fixes bug 51347. This time test it.
16911 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
16912 attributes for example can not tell the difference between these.
16913 The difference was only a syntax feature of the language.
16915 * attribute.cs: Apply attributes to delegates.
16917 * delegate.cs: Call the apply attributes method.
16919 2003-11-24 Miguel de Icaza <miguel@ximian.com>
16921 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
16922 comparing 0 vs Byte.MinValue, not the value
16924 (ImplicitConversionRequired): When reporting a conversion error,
16925 use error 31 to print out the constant error instead of the
16928 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
16929 which fixes bug 51347.
16931 2003-11-22 Miguel de Icaza <miguel@ximian.com>
16933 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
16934 which fixes the -warnaserror command line option.
16936 2003-11-21 Miguel de Icaza <miguel@ximian.com>
16938 * cfold.cs (DoNumericPromotions): During constant folding of
16939 additions on UIntConstant, special case intconstants with
16940 IntConstants like we do on the expression binary operator.
16942 2003-11-12 Miguel de Icaza <miguel@ximian.com>
16944 * convert.cs (ImplicitReferenceConversion): We were missing a case
16945 (System.Enum are not value types or class types, so we need to
16946 classify them separatedly).
16948 * driver.cs: We do not support error 2007.
16950 2003-11-12 Jackson Harper <jackson@ximian.com>
16952 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
16953 system directory. Also use the full file name so users can
16954 libraries names mscorlib-o-tron.dll in a non system dir.
16956 2003-11-10 Martin Baulig <martin@ximian.com>
16958 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
16959 (TypeManager.InitCoreTypes): Initialize them here, but instead of
16960 calling `ResolveType()' on them, directly assign their `Type'.
16962 2003-11-08 Martin Baulig <martin@ximian.com>
16964 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
16965 return value and the `out parent' parameter.
16966 (TypeContainer.DefineType): Moved the CS0644 check into
16967 GetClassBases(). Don't pass the interface types to the
16968 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
16969 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
16971 * ecore.cs (TypeExpr.IsAttribute): New property.
16972 (TypeExpr.GetInterfaces): New method.
16974 * interface.cs (Interface.GetInterfaceTypeByName): Return a
16975 TypeExpr instead of a Type.
16976 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
16977 (Interface.DefineType): Don't pass the interface types to the
16978 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
16979 them later and then call `TypeBulider.AddInterfaceImplementation()'.
16981 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
16982 instead of a `Type[]'.
16983 (TypeManager.RegisterBuilder): Likewise.
16984 (TypeManager.AddUserInterface): Likewise.
16985 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
16986 `Type[]' and also return a `TypeExpr[]'.
16987 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
16989 2003-11-08 Martin Baulig <martin@ximian.com>
16991 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
16994 2003-11-08 Martin Baulig <martin@ximian.com>
16996 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
16997 TypeManager.ResolveExpressionTypes().
16999 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
17000 instead of an Expression.
17001 (TypeExpr): This is now an abstract base class for `TypeExpression'.
17002 (TypeExpression): New public class; formerly known as `TypeExpr'.
17004 * expression.cs (ComposedCast): Derive from TypeExpr.
17006 * typemanager.cs (TypeManager.system_*_expr): These are now
17007 TypExpr's instead of Expression's.
17008 (TypeManager.ResolveExpressionTypes): New public static function;
17009 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
17012 2003-11-06 Miguel de Icaza <miguel@ximian.com>
17014 * expression.cs (New.DoResolve): Do not dereference value that
17015 might be a null return.
17017 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
17018 sure that the constant value has the right type. Fixes an
17019 unreported bug, similar to 50425.
17021 * const.cs (Const.LookupConstantValue): Call
17022 ImplicitStandardConversionExists before doing a conversion to
17023 avoid havng the TypeManager.ChangeType do conversions.
17025 Reduced the number of casts used
17027 (Const.ChangeType): New routine to enable reuse of the constant
17028 type changing code from statement.
17030 * typemanager.cs (ChangeType): Move common initialization to
17031 static global variables.
17035 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
17036 every value type to go through, even if it was void. Fix that.
17038 * cs-tokenizer.cs: Use is_identifier_start_character on the start
17039 character of the define, and the is_identifier_part_character for
17040 the rest of the string.
17042 2003-11-05 Miguel de Icaza <miguel@ximian.com>
17044 * expression.cs (UnaryMutator.EmitCode): When I updated
17045 LocalVariableReference.DoResolve, I overdid it, and dropped an
17046 optimization done on local variable references.
17048 2003-11-04 Miguel de Icaza <miguel@ximian.com>
17050 * ecore.cs: Convert the return from Ldlen into an int.
17052 2003-10-20 Miguel de Icaza <miguel@ximian.com>
17054 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
17055 the accessibility, this is a special case for toplevel non-public
17056 classes (internal for instance).
17058 2003-10-20 Nick Drochak <ndrochak@gol.com>
17060 * ecore.cs: Fix typo and build. Needed another right paren.
17062 2003-10-19 Miguel de Icaza <miguel@ximian.com>
17064 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
17065 `internal' case regular and protected, but not allowing protected
17066 to be evaluated later. Bug 49840
17068 2003-10-15 Miguel de Icaza <miguel@ximian.com>
17070 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
17071 to kb.Nlast, and not the kb.nFirst to isolate the switch
17074 Extract the underlying type, so enumerations of long/ulong are
17075 treated like long/ulong.
17077 2003-10-14 Miguel de Icaza <miguel@ximian.com>
17079 * expression.cs (New): Overload the meaning of RequestedType to
17080 track the possible creation of the NewDelegate type, since
17081 DoResolve is invoked more than once for new constructors on field
17084 See bugs: #48800 and #37014
17086 * cs-parser.jay (declare_local_constants): Take an arraylist
17087 instead of a single constant.
17089 (local_constant_declaration): It should take a
17090 constant_declarators, not a constant_declarator. Fixes 49487
17092 * convert.cs: Fix error report.
17094 2003-10-13 Jackson Harper <jackson@ximian.com>
17096 * typemanager.cs (TypeToCoreType): Add float and double this fixes
17099 2003-10-09 Martin Baulig <martin@ximian.com>
17101 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
17103 (MethodCore.DoDefineParameters): Removed the TypeContainer
17104 argument; use the DeclSpace which was passed to the .ctor instead.
17105 (MethodCore.CheckParameter): Take a DeclSpace instead of a
17106 TypeContainer; we only need a DeclSpace here.
17108 2003-10-09 Martin Baulig <martin@ximian.com>
17110 * class.cs (MethodData): Added additional `DeclSpace ds' argument
17112 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
17113 EmitContext's .ctor.
17115 2003-10-09 Martin Baulig <martin@ximian.com>
17117 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
17118 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
17119 AsAccessible(), moved them as well.
17121 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
17123 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
17125 * cs-parser.jay : Renamed yyName to yyNames related to jay.
17127 2003-10-07 Miguel de Icaza <miguel@ximian.com>
17129 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
17130 generation for >=, as spotted by Paolo, bug 48679.
17131 Patch from David Waite.
17133 * cs-tokenizer.cs: Add handling for #pragma.
17135 * cs-parser.jay: Allow for both yield and yield return in the
17136 syntax. The anti-cobolization of C# fight will go on!
17138 * class.cs (TypeBuilder.DefineType): Catch error condition here
17139 (Parent.DefineType erroring out and returning null).
17141 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
17142 coping with enumerations variables, we were mistakenly processing
17143 them as a regular value type instead of built-in types. Fixes the
17146 * typemanager.cs (IsBuiltinOrEnum): New method.
17148 2003-09-30 Miguel de Icaza <miguel@ximian.com>
17150 * cs-parser.jay: Upgrade: yield now needs the return clause.
17152 2003-09-19 Martin Baulig <martin@ximian.com>
17154 * decl.cs (MemberCache.SetupCacheForInterface): Take a
17155 `MemberCache parent' argument. Normally, an interface doesn't
17156 have a parent type except System.Object, but we use this in gmcs
17157 for generic type parameters.
17159 2003-09-18 Martin Baulig <martin@ximian.com>
17161 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
17162 on `type.IsInterface'; don't check whether the type has a parent
17163 to determine whether it's an interface.
17165 2003-09-15 Martin Baulig <martin@ximian.com>
17167 * class.cs (TypeContainer.DefineType): Added an error flag to
17168 avoid reporting duplicate CS0146's ("class definition is
17171 * driver.cs (Driver.MainDriver): Abort if
17172 RootContext.ResolveTree() reported any errors.
17174 2003-09-07 Martin Baulig <martin@ximian.com>
17176 * report.cs (Error, Warning): Added overloaded versions which take
17177 a `params object[] args' and call String.Format().
17179 2003-09-07 Martin Baulig <martin@ximian.com>
17181 * decl.cs (DeclSpace..ctor): Don't call
17182 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
17183 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
17184 (DeclSpace.RecordDecl): New method.
17186 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
17188 2003-09-02 Ravi Pratap <ravi@ximian.com>
17190 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
17191 value attributes to be applied to ParameterBuilders.
17193 * class.cs (MethodCore.LabelParameters): Make static and more
17194 generic so that it can be used from other places - like interface
17195 methods, for instance.
17197 * interface.cs (Interface.Emit): Call LabelParameters before
17198 emitting attributes on the InterfaceMethod.
17200 2003-08-26 Martin Baulig <martin@ximian.com>
17202 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
17203 resolving aliases; fixes #47927.
17205 2003-08-26 Martin Baulig <martin@ximian.com>
17207 * statement.cs (Using.DoResolve): This is internally emitting a
17208 try/finally clause, so we need to set ec.NeedExplicitReturn if we
17209 do not always return. Fixes #47681.
17211 2003-08-26 Martin Baulig <martin@ximian.com>
17213 * decl.cs (MemberCore): Moved WarningNotHiding(),
17214 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
17216 (AdditionResult): Make this nested in DeclSpace.
17217 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
17218 argument; call NamespaceEntry.Define() unless we're nested in a
17221 * namespace.cs (Namespace.DefineName): New public function. This
17222 is called from DeclSpace's .ctor to add
17223 (Namespace.Lookup): Include DeclSpaces in the lookup.
17225 * class.cs (Operator): Derive from MemberBase, not MemberCore.
17227 * const.cs (Const): Derive from MemberBase, not MemberCore.
17229 2003-08-25 Martin Baulig <martin@ximian.com>
17231 * convert.cs (Convert.ExplicitReferenceConversion): When
17232 converting from an interface type to a class, unbox if the target
17233 type is a struct type. Fixes #47822.
17235 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17237 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
17240 2003-08-22 Martin Baulig <martin@ximian.com>
17242 * class.cs (TypeManager.DefineType): When defining a nested type,
17243 call DefineType() on our parent; fixes #47801.
17245 2003-08-22 Martin Baulig <martin@ximian.com>
17247 * class.cs (MethodData.Define): While checking if a method is an
17248 interface implementation, improve the test a bit more to fix #47654.
17250 2003-08-22 Martin Baulig <martin@ximian.com>
17252 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
17253 correctly; fixes #47722.
17255 2003-08-22 Martin Baulig <martin@ximian.com>
17257 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
17258 LocalVariableReference, ensure it's not read-only. Fixes #47536.
17260 * statement.cs (Fixed.DoResolve): Make all variables read-only.
17262 2003-08-22 Martin Baulig <martin@ximian.com>
17264 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
17265 can only be assigned in static constructors. Fixes #47161.
17267 2003-08-22 Martin Baulig <martin@ximian.com>
17269 Rewrote and improved the flow analysis code.
17271 * flowbranching.cs (FlowBranching): Make this class abstract.
17272 (FlowBranching.CreateBranching): New static function to create a
17273 new flow branching.
17274 (FlowBranchingBlock, FlowBranchingException): New classes.
17275 (FlowBranching.UsageVector.Type): New public readonly field.
17276 (FlowBranching.UsageVector.Breaks): Removed the setter.
17277 (FlowBranching.UsageVector.Returns): Removed the setter.
17278 (FlowBranching.UsageVector): Added Break(), Return(),
17279 NeverReachable() and Throw() methods to modify the reachability.
17280 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
17281 done by FlowBranching.Merge().
17282 (FlowBranching.UsageVector.MergeChild): New method; merges the
17283 merge result into the current vector.
17284 (FlowBranching.Merge): New abstract method to merge a branching.
17286 2003-08-12 Martin Baulig <martin@ximian.com>
17288 * expression.cs (Indirection.CacheTemporaries): Create the
17289 LocalTemporary with the pointer type, not its element type.
17291 2003-08-10 Miguel de Icaza <miguel@ximian.com>
17293 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
17294 token was a keyword or not.
17296 Add `error' options where an IDENTIFIER was expected; Provide
17297 CheckToken and CheckIdentifierToken convenience error reporting
17300 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
17302 * decl.cs: Rename `NamespaceEntry Namespace' public field into
17303 NameSpaceEntry NameSpaceEntry.
17305 (LookupInterfaceOrClass): Avoid creating a full qualified name
17306 from namespace and name: avoid doing lookups when we know the
17307 namespace is non-existant. Use new Tree.LookupByNamespace which
17308 looks up DeclSpaces based on their namespace, name pair.
17310 * driver.cs: Provide a new `parser verbose' to display the
17311 exception thrown during parsing. This is turned off by default
17312 now, so the output of a failure from mcs is more graceful.
17314 * namespace.cs: Track all the namespaces defined in a hashtable
17317 (IsNamespace): New method
17319 2003-08-09 Miguel de Icaza <miguel@ximian.com>
17321 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
17322 we know that we need to concatenate (full typename can never be
17327 * statement.cs: Use a bitfield; Do not initialize to null things
17328 which are done by the constructor by default.
17330 * cs-parser.jay: bug fix, parameter was 4, not 3.
17332 * expression.cs: Just use the property;
17334 * statement.cs: No need for GetVariableInfo method.
17336 2003-08-08 Martin Baulig <martin@ximian.com>
17338 * flowanalysis.cs (FlowReturns): This is now nested in the
17339 `FlowBranching' class.
17340 (MyBitVector): Moved this here from statement.cs.
17341 (FlowBranching.SiblingType): New enum type.
17342 (FlowBranching.CreateSibling): Added `SiblingType' argument.
17344 2003-08-07 Martin Baulig <martin@ximian.com>
17346 * flowanalysis.cs (FlowBranchingType): This is now nested in the
17347 `FlowBranching' class and called `BranchingType'.
17349 2003-08-07 Martin Baulig <martin@ximian.com>
17351 * flowanalysis.cs: Moved all the control flow analysis code into
17354 2003-08-07 Martin Baulig <martin@ximian.com>
17356 * assign.cs (Assign.DoResolve): `target' must either be an
17357 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
17360 2003-08-07 Miguel de Icaza <miguel@ximian.com>
17362 * expression.cs (BinaryMethod): This kind of expression is created by the
17363 Binary class if it determines that the operator has to be handled
17366 (BinaryDelegate): This kind of expression is created if we are
17367 dealing with a + or - operator on delegates.
17369 (Binary): remove method, argumetns, and DelegateOperator: when
17370 dealing with methods,
17372 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
17374 * statement.cs (Block): use bitfields for the three extra booleans
17375 we had in use. Remove unused topblock parameter.
17377 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
17379 * assign.cs: Drop extra unneeded tests.
17381 2003-08-06 Miguel de Icaza <miguel@ximian.com>
17383 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
17385 * statement.cs (Foreach): Use VariableStorage instead of
17388 * codegen.cs (VariableStorage): New class used by clients that
17389 require a variable stored: locals or fields for variables that
17390 need to live across yield.
17392 Maybe provide a convenience api for EmitThis+EmitLoad?
17394 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
17397 2003-08-05 Miguel de Icaza <miguel@ximian.com>
17399 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
17400 RemapParameterLValue): New methods that are used to turn a
17401 precomputed FieldInfo into an expression like this:
17405 The idea is to use this instead of making LocalVariableReference
17406 have more than one meaning.
17408 * cs-parser.jay: Add error production to BASE.
17410 * ecore.cs: Deal with TypeManager.GetField returning null, which
17411 is now a valid return value.
17413 (FieldExprNoAddress): New expression for Fields whose address can
17416 * expression.cs (LocalVariableReference): During the resolve
17417 phases, create new expressions if we are in a remapping context.
17418 Remove code that dealt with remapping here.
17420 (ParameterReference): same.
17422 (ProxyInstance): New expression, like the `This' expression, but
17423 it is born fully resolved. We know what we are doing, so remove
17424 the errors that are targeted to user-provided uses of `this'.
17426 * statement.cs (Foreach): our variable is now stored as an
17427 Expression; During resolution, follow the protocol, dont just
17428 assume it will return this.
17430 2003-08-06 Martin Baulig <martin@ximian.com>
17432 * support.cs (SeekableStreamReader.cs): New public class.
17434 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
17435 SeekableStreamReader instead of the normal StreamReader.
17437 2003-08-04 Martin Baulig <martin@ximian.com>
17439 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
17440 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
17441 deambiguate casts and delegate invocations.
17442 (parenthesized_expression): Use the new tokens to ensure this is
17443 not a cast of method invocation.
17445 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
17446 when reading a `)' and Deambiguate_CloseParens () was previously
17449 * expression.cs (ParenthesizedExpression): New class. This is
17450 just used for the CS0075 test.
17451 (Binary.DoResolve): Check for CS0075.
17453 2003-07-29 Ravi Pratap <ravi@ximian.com>
17455 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
17456 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
17457 reference comparison.
17459 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
17460 examine the ReturnType for equality - this is necessary in the
17461 cases of implicit and explicit operators whose signature also
17462 includes the return type.
17464 2003-07-26 Miguel de Icaza <miguel@ximian.com>
17466 * namespace.cs: Cache the result of the namespace computation,
17467 instead of computing it every time.
17469 2003-07-24 Miguel de Icaza <miguel@ximian.com>
17471 * decl.cs: Use a global arraylist that we reuse over invocations
17472 to avoid excesive memory consumption. Reduces memory usage on an
17473 mcs compile by one meg (45 average).
17475 * typemanager.cs (LookupTypeReflection): In .NET pointers are
17476 private, work around that.
17478 2003-07-23 Miguel de Icaza <miguel@ximian.com>
17480 * literal.cs (IntLiteral): Define Zero and One static literals.
17482 * cs-parser.jay (integer_literal): use static literals to reduce
17483 memory usage for the most used literals (0, 1 and -1). 211kb
17484 reduced in memory usage.
17486 Replace all calls to `new ArrayList' with `new
17487 ArrayList(4)' which is a good average number for most allocations,
17488 and also requires only 16 bytes of memory for its buffer by
17491 This reduced MCS memory usage in seven megabytes for the RSS after
17494 2003-07-28 Ravi Pratap <ravi@ximian.com>
17496 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
17497 handle params methods the correct way by forming only one
17498 applicable set with params and normal methods in them. Earlier we
17499 were looking at params methods only if we found no normal methods
17500 which was not the correct thing to do.
17502 (Invocation.BetterFunction): Take separate arguments indicating
17503 when candidate and the best method are params methods in their
17506 This fixes bugs #43367 and #46199.
17508 * attribute.cs: Documentation updates.
17510 (CheckAttribute): Rename to CheckAttributeTarget.
17511 (GetValidPlaces): Rename to GetValidTargets.
17513 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
17514 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
17518 2003-07-28 Martin Baulig <martin@ximian.com>
17520 * class.cs (TypeContainer.DefineMembers): Use the base type's full
17521 name when looking up the base class of a nested class. Fixes #46977.
17523 2003-07-26 Martin Baulig <martin@ximian.com>
17525 * expression.cs (Indexers.Indexer): New nested struct; contains
17526 getter, setter and the indexer's type.
17527 (Indexers.Properties): This is now an ArrayList of
17528 Indexers.Indexer's.
17529 (IndexerAccess.DoResolveLValue): Correctly set the type if the
17530 indexer doesn't have any getters.
17532 * assign.cs (Assign.DoResolve): Also do the implicit conversions
17533 for embedded property and indexer assignments.
17535 2003-07-26 Martin Baulig <martin@ximian.com>
17537 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
17538 preprocessor directive is not the first non-whitespace character
17541 2003-07-26 Martin Baulig <martin@ximian.com>
17543 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
17544 namespace parsing, follow the spec more closely.
17546 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
17547 NamespaceEntry.Lookup().
17549 2003-07-25 Martin Baulig <martin@ximian.com>
17551 * MethodCore.cs (OverridesSomething): New public field; it's set
17552 from TypeContainer.DefineMembers if this method overrides
17553 something (which doesn't need to be a method). Fix #39462.
17555 2003-07-25 Ravi Pratap <ravi@ximian.com>
17557 * typemanager.cs (GetMembers): Ensure that the list of members is
17558 reversed. This keeps things in sync.
17560 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
17561 find an AttributeUsage attribute.
17563 * expression.cs (Invocation.OverloadResolve): Perform the check
17564 which disallows Invoke to be directly called on a Delegate.
17566 (Error_InvokeOnDelegate): Report error cs1533.
17568 2003-07-25 Martin Baulig <martin@ximian.com>
17570 * expression.cs (Indexers.GetIndexersForType): Only look in the
17571 interface hierarchy if the requested type is already an
17572 interface. Fixes #46788 while keeping #46502 fixed.
17574 2003-07-25 Martin Baulig <martin@ximian.com>
17576 * class.cs (TypeContainer.DefineMembers): Check whether all
17577 readonly fields have been assigned and report warning CS0649 if
17580 * statement.cs (LocalInfo.IsFixed): Always return true if this is
17583 2003-07-24 Ravi Pratap <ravi@ximian.com>
17585 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
17586 returned from GetMethods to make things consistent with the
17587 assumptions MCS makes about ordering of methods.
17589 This should comprehensively fix bug #45127 and it does :-)
17591 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
17592 ordering is actually reverse.
17594 * Clean up some debug messages I left lying around.
17596 * interface.cs (Populate*): Get rid of code which emits attributes
17597 since the stage in which we emit attributes is the 'Emit' stage,
17598 not the define stage.
17600 (Emit): Move attribute emission for interface members here.
17602 2003-07-22 Ravi Pratap <ravi@ximian.com>
17604 * expression.cs (Invocation.OverloadResolve): Follow the spec more
17605 closely: we eliminate methods in base types when we have an
17606 applicable method in a top-level type.
17608 Please see section 14.5.5.1 for an exact description of what goes
17611 This fixes bug #45127 and a host of other related to corlib compilation.
17613 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
17614 array is the method corresponding to the top-level type (this is
17615 because of the changes made to icall.c) so we change this
17618 (MethodGroupExpr.Name): This too.
17620 * typemanager.cs (GetElementType): New method which does the right
17621 thing when compiling corlib.
17623 * everywhere: Make use of the above in the relevant places.
17625 2003-07-22 Martin Baulig <martin@ximian.com>
17627 * cs-parser.jay (invocation_expression): Moved
17628 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
17629 `cast_expression', but create a InvocationOrCast which later
17630 resolves to either an Invocation or a Cast.
17632 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
17633 method; call this before EmitStatement() to make sure that this
17634 expression can be used as a statement.
17636 * expression.cs (InvocationOrCast): New class; resolves to either
17637 an Invocation or a Cast.
17639 * statement.cs (StatementExpression): Call ResolveStatement() on
17640 the ExpressionStatement before emitting it.
17642 2003-07-21 Martin Baulig <martin@ximian.com>
17644 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
17645 `ref' and `out' attributes match; fixes #46220.
17646 (MemberAccess.ResolveMemberAccess): You can't reference a type
17647 through an expression; fixes #33180.
17648 (Indexers.GetIndexersForType): Don't return the indexers from
17649 interfaces the class implements; fixes #46502.
17651 2003-07-21 Martin Baulig <martin@ximian.com>
17653 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
17654 CS0661 checks; fixes bug #30442.
17656 2003-07-21 Martin Baulig <martin@ximian.com>
17658 * decl.cs (AdditionResult): Added `Error'.
17660 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
17662 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
17663 makes cs0031.cs actually work.
17665 2003-07-20 Martin Baulig <martin@ximian.com>
17667 * namespace.cs: Fixed that bug which caused a crash when compiling
17668 the debugger's GUI.
17670 2003-07-20 Miguel de Icaza <miguel@ximian.com>
17672 * typemanager.cs (LookupTypeReflection): Never expose types which
17673 are NotPublic, NestedPrivate, NestedAssembly, or
17674 NestedFamANDAssem. We used to return these, and later do a check
17675 that would report a meaningful error, but the problem is that we
17676 would not get the real match, if there was a name override.
17678 2003-07-18 Miguel de Icaza <miguel@ximian.com>
17680 * namespace.cs (Namespace, Name): Do not compute the namespace
17681 name dynamically, compute it in the constructor. This reduced
17682 memory usage by 1697 KB.
17684 * driver.cs: Use --pause to pause at the end.
17686 2003-07-17 Peter Williams <peter@newton.cx>
17688 * Makefile: Change the name of the test target so that it doesn't
17689 conflict with the recursive test target.
17691 2003-07-17 Miguel de Icaza <miguel@ximian.com>
17693 * expression.cs (LocalVariableReference.Emit, EmitAssign,
17694 AddressOf): Do not use EmitThis, that was wrong, use the actual
17697 2003-07-15 Miguel de Icaza <miguel@ximian.com>
17699 * class.cs (MethodData.Define): While checking if a method is an
17700 interface implementation, improve the test: If we are not public
17701 (use new test here: use the computed MethodAttributes directly,
17702 instead of the parsed modifier flags) check if the `implementing'
17703 method comes from an interface or not.
17705 * pending.cs (VerifyPendingMethods): Slightly better error
17708 * makefile: add test target that does the mcs bootstrap.
17710 2003-07-16 Ravi Pratap <ravi@ximian.com>
17712 * interface.cs (Define): Do nothing here since there are no
17713 members to populate etc. Move the attribute emission out of here
17714 since this was just totally the wrong place to put it. Attribute
17715 application happens during the 'Emit' phase, not in the 'Define'
17718 (Emit): Add this method and move the attribute emission here
17720 * rootcontext.cs (EmitCode): Call the Emit method on interface
17723 2003-07-14 Ravi Pratap M <ravi@ximian.com>
17725 * expression.cs (OverloadResolve): Report error only if Location
17726 is not 'Null' which means that there was a probe going on.
17728 2003-07-14 Martin Baulig <martin@ximian.com>
17730 * expression.cs (ConditionalLogicalOperator): New public class to
17731 implement user defined conditional logical operators.
17732 This is section 14.11.2 in the spec and bug #40505.
17734 2003-07-14 Martin Baulig <martin@ximian.com>
17736 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
17738 2003-07-14 Martin Baulig <martin@ximian.com>
17740 * codegen.cs (EmitContext.InFixedInitializer): New public field.
17742 * ecore.cs (IVariable.VerifyFixed): New interface method.
17744 * expression.cs (Unary.ResolveOperator): When resolving the `&'
17745 operator, check whether the variable is actually fixed. Fixes bug
17746 #36055. Set a variable definitely assigned when taking its
17747 address as required by the spec.
17749 * statement.cs (LocalInfo.IsFixed): New field.
17750 (LocalInfo.MakePinned): Set `IsFixed' to true.
17752 2003-07-14 Ravi Pratap M <ravi@ximian.com>
17754 * attribute.cs (Attribute.Resolve): While doing a Member lookup
17755 for .ctors, ensure that we only ask for members declared in the
17756 attribute type (BindingFlags.DeclaredOnly).
17760 * expression.cs (Error_WrongNumArguments): Report error 1501
17761 correctly the way CSC does.
17763 2003-07-13 Martin Baulig <martin@ximian.com>
17765 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
17766 lookup on the fully qualified name, to make things like "X.X" work
17767 where "X.X" is a fully qualified type name, but we also have a
17768 namespace "X" in the using list. Fixes #41975.
17770 2003-07-13 Martin Baulig <martin@ximian.com>
17772 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
17773 function. If we're a CompoundAssign, we need to create an embedded
17774 CompoundAssign, not an embedded Assign.
17775 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
17778 2003-07-13 Martin Baulig <martin@ximian.com>
17780 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
17781 work to fix bug #46088.
17783 2003-07-13 Ravi Pratap <ravi@ximian.com>
17785 * class.cs (Operator.Emit): Do not emit attributes here - it is
17786 taken care of by the Method class that we delegate too. This takes
17787 care of bug #45876.
17789 2003-07-10 Martin Baulig <martin@ximian.com>
17791 * expression.cs (TypeOfVoid): New class.
17792 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
17794 2003-07-10 Martin Baulig <martin@ximian.com>
17796 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
17799 2003-07-10 Martin Baulig <martin@ximian.com>
17801 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
17802 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
17804 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
17806 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
17808 2003-07-10 Martin Baulig <martin@ximian.com>
17810 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
17811 of decimal. Fixes #42850.
17813 NOTE: I also fixed the created byte blob, but this doesn't work on
17814 the MS runtime and csc never produces any byte blobs for decimal
17817 2003-07-10 Martin Baulig <martin@ximian.com>
17819 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
17820 structs; fixes #32068.
17821 (Block.AddChildVariableNames): Fixed #44302.
17823 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17825 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
17827 2003-07-07 Miguel de Icaza <miguel@ximian.com>
17829 * attribute.cs: And this test is onger needed.
17831 2003-07-08 Martin Baulig <martin@ximian.com>
17833 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
17834 inaccessible types. Fixes #36313.
17836 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
17838 * namespace.cs (NamespaceEntry): Create implicit entries for all
17839 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
17840 implicit entries for N1.N2 and N1.
17842 2003-07-08 Martin Baulig <martin@ximian.com>
17844 Rewrote the handling of namespaces to fix a lot of the issues
17845 wrt. `using' aliases etc.
17847 * namespace.cs (Namespace): Splitted this class into a
17848 per-assembly `Namespace' and a per-file `NamespaceEntry'.
17850 * typemanager.cs (TypeManager.IsNamespace): Removed.
17851 (TypeManager.ComputeNamespaces): Only compute namespaces from
17852 loaded assemblies here, not the namespaces from the assembly we're
17853 currently compiling.
17855 2003-07-08 Martin Baulig <martin@ximian.com>
17857 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
17859 2003-07-07 Miguel de Icaza <miguel@ximian.com>
17861 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
17864 I thought about the memory savings here, but LookupTypeReflection
17865 is used under already very constrained scenarios. Compiling
17866 corlib or mcs only exposes one hit, so it would not really reduce
17867 any memory consumption.
17869 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17871 * typemanager.cs: fixes bug #45889 by only adding public types from
17872 other assemblies to the list of known types.
17874 2003-07-07 Miguel de Icaza <miguel@ximian.com>
17876 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
17877 on the type we resolved.
17879 2003-07-05 Martin Baulig <martin@ximian.com>
17881 * pending.cs (PendingImplementation.ParentImplements): Don't
17882 create the proxy if the parent is abstract.
17884 * class.cs (TypeContainer.DefineIndexers): Process explicit
17885 interface implementations first. Fixes #37714.
17887 2003-07-04 Miguel de Icaza <miguel@ximian.com>
17889 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
17890 defined recursively; but since we modify the input parameters
17891 (left is set to `this' temporarily), we reset this value if the
17892 left_is_explicit is false, which gives the original semantics to
17895 * literal.cs (NullPointer): new class used to represent a null
17896 literal in a pointer context.
17898 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
17899 type is a pointer, use a NullPointer object instead of a
17900 NullLiteral. Closes 43687
17902 (ExplicitConversion): Convert pointer values using
17903 the conv opcode to the proper type.
17905 * ecore.cs (New): change ValueTypeVariable property into a method,
17906 that returns whether the valuetype is suitable for being used.
17908 * expression.cs (Binary.DoNumericPromotions): Only return if we
17909 the int constant was a valid uint, and we can return both left and
17910 right as uints. If not, we continue processing, to trigger the
17911 type conversion. This fixes 39018.
17913 * statement.cs (Block.EmitMeta): During constant resolution, set
17914 the CurrentBlock property on the emitcontext, so that we resolve
17915 constants propertly.
17917 2003-07-02 Martin Baulig <martin@ximian.com>
17919 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
17920 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
17922 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
17923 than emitting it here.
17925 * statement.cs: Fixed some more flow analysis bugs.
17927 2003-07-02 Martin Baulig <martin@ximian.com>
17929 * class.cs (MethodData.Define): When implementing interface
17930 methods, set Final unless we're Virtual.
17932 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
17933 check work for interface methods.
17935 2003-07-01 Martin Baulig <martin@ximian.com>
17937 * ecore.cs (EmitContext.This): Replaced this property with a
17938 GetThis() method which takes a Location argument. This ensures
17939 that we get the correct error location for a CS0188.
17941 2003-07-01 Miguel de Icaza <miguel@ximian.com>
17943 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
17944 ImplicitStandardConversion.
17946 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
17948 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
17950 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
17953 2003-06-30 Miguel de Icaza <miguel@ximian.com>
17955 * class.cs (Constructor.Define): Turn off initlocals for unsafe
17958 (MethodData.Define): Turn off initlocals for unsafe methods.
17960 2003-06-29 Miguel de Icaza <miguel@ximian.com>
17962 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
17963 complete; Fixes #37521.
17965 * delegate.cs: Use Modifiers.TypeAttr to compute the
17966 TypeAttributes, instead of rolling our own. This makes the flags
17967 correct for the delegates.
17969 2003-06-28 Miguel de Icaza <miguel@ximian.com>
17971 * class.cs (Constructor.Define): Set the private flag for static
17972 constructors as well.
17974 * cs-parser.jay (statement_expression): Set the return value to
17975 null, to avoid a crash when we catch an error.
17977 2003-06-24 Miguel de Icaza <miguel@ximian.com>
17979 * cs-parser.jay: Applied patch from Jackson that adds support for
17980 extern and unsafe modifiers to destructor declarations.
17982 * expression.cs: Report error 21 if the user is trying to index a
17985 * driver.cs: Add an error message, suggested by the bug report.
17987 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
17988 if we do not have a ": this ()" constructor initializer. Fixes 45149
17990 2003-06-14 Miguel de Icaza <miguel@ximian.com>
17992 * namespace.cs: Add some information to reduce FAQs.
17994 2003-06-13 Miguel de Icaza <miguel@ximian.com>
17996 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
17997 underlying enumeration types. Fixes #43915.
17999 * expression.cs: Treat ushort/short as legal values to be used in
18000 bitwise operations.
18002 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
18004 * delegate.cs: transfer custom attributes for paramenters from
18005 the delegate declaration to Invoke and BeginInvoke.
18007 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
18009 * attribute.cs: handle custom marshalers and emit marshal info
18012 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
18014 * makefile.gnu: Added anonymous.cs to the compiler sources.
18016 2003-05-28 Miguel de Icaza <miguel@ximian.com>
18018 * iterators.cs: Change the name of the proxy class to include two
18021 * cs-parser.jay: Update grammar to include anonymous methods.
18023 * anonymous.cs: new file.
18025 2003-05-27 Miguel de Icaza <miguel@ximian.com>
18027 * class.cs (Field.Define): Add missing test for pointers and
18030 2003-05-27 Ravi Pratap <ravi@ximian.com>
18032 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
18033 we use the stobj opcode.
18035 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
18036 since it wasn't the correct fix.
18038 It still is puzzling that we are required to use stobj for IntPtr
18039 which seems to be a ValueType.
18041 2003-05-26 Miguel de Icaza <miguel@ximian.com>
18043 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
18044 during regular simple name resolution. Now, the trick is that
18045 instead of returning for processing the simplename, we do a
18046 TypeManager.LookupType (ie, a rooted lookup as opposed to a
18047 contextual lookup type). If a match is found, return that, if
18048 not, return for further composition.
18050 This fixes long-standing 30485.
18052 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
18053 using the address to initialize an object, do an Stobj instead of
18054 using the regular Stelem.
18056 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
18057 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
18058 Because if we are a BaseIndexerAccess that value will be true.
18061 * statement.cs (GotoCase.Resolve): Return after reporting an
18062 error, do not attempt to continue.
18064 * expression.cs (PointerArithmetic.Emit): If our operand is a
18065 long, convert our constants to match the operand before
18066 multiplying. Convert to I type before adding. Fixes 43670.
18068 2003-05-14 Ravi Pratap <ravi@ximian.com>
18070 * enum.cs (ImplicitConversionExists) : Rename to
18071 ImplicitEnumConversionExists to remove ambiguity.
18073 * ecore.cs (NullCast): New type of cast expression class which
18074 basically is very similar to EmptyCast with the difference being
18075 it still is a constant since it is used only to cast a null to
18077 (eg. (string) null)
18079 * convert.cs (ImplicitReferenceConversion): When casting a null
18080 literal, we return a NullCast.
18082 * literal.cs (NullLiteralTyped): Remove - I don't see why this
18083 should be around anymore.
18085 The renaming (reported was slightly wrong). Corrections:
18087 ConvertImplicitStandard -> ImplicitConversionStandard
18088 ConvertExplicitStandard -> ExplicitConversionStandard
18090 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
18091 before passing them in !
18093 * convert.cs (ImplicitConversionStandard): When comparing for
18094 equal expr and target types, ensure that expr is not a
18097 In general, we must not be checking (expr_type ==
18098 target_type) in the top level conversion methods
18099 (ImplicitConversion, ExplicitConversion etc). This checking is
18100 done in the methods that they delegate to.
18102 2003-05-20 Miguel de Icaza <miguel@ximian.com>
18104 * convert.cs: Move Error_CannotConvertType,
18105 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
18106 ImplicitNumericConversion, ImplicitConversionExists,
18107 ImplicitUserConversionExists, StandardConversionExists,
18108 FindMostEncompassedType, FindMostSpecificSource,
18109 FindMostSpecificTarget, ImplicitUserConversion,
18110 ExplicitUserConversion, GetConversionOperators,
18111 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
18112 TryImplicitIntConversion, Error_CannotConvertImplicit,
18113 ConvertImplicitRequired, ConvertNumericExplicit,
18114 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
18115 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
18118 Perform the following renames:
18120 StandardConversionExists -> ImplicitStandardConversionExists
18121 ConvertImplicit -> ImplicitConversion
18122 ConvertImplicitStandard -> ImplicitStandardConversion
18123 TryImplicitIntConversion -> ImplicitIntConversion
18124 ConvertImplicitRequired -> ImplicitConversionRequired
18125 ConvertNumericExplicit -> ExplicitNumericConversion
18126 ConvertReferenceExplicit -> ExplicitReferenceConversion
18127 ConvertExplicit -> ExplicitConversion
18128 ConvertExplicitStandard -> ExplicitStandardConversion
18130 2003-05-19 Martin Baulig <martin@ximian.com>
18132 * statement.cs (TypeInfo.StructInfo): Made this type protected.
18133 (TypeInfo): Added support for structs having structs as fields.
18135 * ecore.cs (FieldExpr): Implement IVariable.
18136 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
18137 VariableInfo for the field.
18139 2003-05-18 Martin Baulig <martin@ximian.com>
18141 * expression.cs (This.DoResolve): Report a CS0027 if we're
18142 emitting a field initializer.
18144 2003-05-18 Martin Baulig <martin@ximian.com>
18146 * expression.cs (This.ResolveBase): New public function.
18147 (This.DoResolve): Check for CS0188.
18149 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
18152 * ecore.cs (MethodGroupExpr.DoResolve): Set the
18153 `instance_expression' to null if we don't have any non-static
18156 2003-05-18 Martin Baulig <martin@ximian.com>
18158 Reworked the way how local variables and parameters are handled by
18159 the flow analysis code.
18161 * statement.cs (TypeInfo, VariableMap): New public classes.
18162 (VariableInfo): New public class. This is now responsible for
18163 checking whether a variable has been assigned. It is used for
18164 parameters and local variables.
18165 (Block.EmitMeta): Take the InternalParameters as argument; compute
18166 the layout of the flow vectors here.
18167 (Block.LocalMap, Block.ParameterMap): New public properties.
18168 (FlowBranching): The .ctor doesn't get the InternalParameters
18169 anymore since Block.EmitMeta() now computes the layout of the flow
18171 (MyStructInfo): This class is now known as `StructInfo' and nested
18172 in `TypeInfo'; we don't access this directly anymore.
18174 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
18175 property and removed IsAssigned(), IsFieldAssigned(),
18176 SetAssigned() and SetFieldAssigned(); we now call them on the
18177 VariableInfo so we don't need to duplicate this code everywhere.
18179 * expression.cs (ParameterReference): Added `Block block' argument
18181 (LocalVariableReference, ParameterReference, This): The new
18182 VariableInfo class is now responsible for all the definite
18185 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
18186 IsParameterAssigned, SetParameterAssigned): Removed.
18188 2003-05-18 Martin Baulig <martin@ximian.com>
18190 * typemanager.cs (InitCoreTypes): Try calling
18191 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
18192 the 3-args-version. Corlib now also needs our `void_type'.
18193 (GetMethod): Added overloaded version which takes an optional
18194 `bool report_errors' to allow lookups of optional methods.
18196 2003-05-12 Martin Baulig <martin@ximian.com>
18198 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
18199 only used for locals and not for parameters.
18201 2003-05-12 Miguel de Icaza <miguel@ximian.com>
18203 * support.cs (InternalParameters.ParameterType): Return the
18204 ExternalType of the parameter.
18206 * parameter.cs (Parameter.ExternalType): drop the two arguments,
18209 2003-05-11 Miguel de Icaza <miguel@ximian.com>
18211 * class.cs (MethodData.Define): Do not set the `newslot' on
18212 interface members, if they are also flagged as "override".
18214 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
18215 better code for ++i and i++. This only works for static fields
18216 and local variables.
18218 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
18219 want to pull the DeclSpace out of the builder_to_declspace instead
18220 of the TypeBuilder (like in TypeContainer.FindMembers).
18222 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
18223 instead of LookupTypeContainer. Fixes the crash on .NET for
18224 looking up interface members.
18226 * const.cs: Create our own emit context during the Definition
18227 stage, so that constants are evaluated in the proper context, when
18228 a recursive definition happens.
18230 2003-05-11 Martin Baulig <martin@ximian.com>
18232 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
18233 new block for a switch section.
18234 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
18235 the adding/lookup in the switch block. Fixes #39828.
18237 2003-05-09 Miguel de Icaza <miguel@ximian.com>
18239 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
18240 functionality: I needed to convert the data after I had performed
18241 the add/sub operation into the operands type size.
18243 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
18244 pass the type for the box operation, otherwise the resulting
18245 object would have been of type object.
18247 (BoxedCast): Add constructor to specify the type to box as.
18249 2003-05-07 Miguel de Icaza <miguel@ximian.com>
18251 * iterators.cs: I was reusing the `count' variable inadvertently,
18252 take steps to not allow this to happen.
18254 2003-05-06 Miguel de Icaza <miguel@ximian.com>
18256 * attribute.cs (Attribute.Resolve): Params attributes are encoded
18257 by creating an array at the point where the params starts and
18258 putting all those arguments there, then adjusting the size of the
18261 2003-05-05 Miguel de Icaza <miguel@ximian.com>
18263 * expression.cs (New.AddressOf): Implement interface
18264 IMemoryLocation. This is used when the `new' operator is used in
18265 the context of an invocation to a method on a value type.
18267 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
18270 * namespace.cs: Also check the using aliases here.
18272 * driver.cs: Move the test for using validity after the types have
18273 been entered, so we do a single pass that also includes the using
18276 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
18277 in the regular case. CreateSiblingForFinally is doing extra
18280 * attribute.cs (GetAttributeArgumentExpression): Store the result
18281 on an out value, and use the return value to indicate failure
18282 instead of using null (which is a valid return for Constant.GetValue).
18284 * statement.cs: Perform the analysis flow for the increment
18285 portion after the statement, because this will be the real flow of
18286 execution. Fixes #42385
18288 * codegen.cs (EmitContext.EmitArgument,
18289 EmitContext.EmitStoreArgument): New helper functions when the
18290 RemapToProxy flag is set.
18292 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
18295 Add support for remapping parameters.
18297 * iterators.cs: Propagate parameter values; Store parameter
18298 values in the proxy classes.
18300 2003-05-04 Miguel de Icaza <miguel@ximian.com>
18302 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
18303 need a proxy reference; I do not know what I was thinking
18305 * cs-parser.jay (constructor_initializer): catch another error,
18306 and display nice message.
18308 (field_declaration): catch void field declaration
18309 to flag a better error.
18311 * class.cs (MemberBase.CheckBase): Report an error instead of a
18312 warning if a new protected member is declared in a struct.
18313 (Field.Define): catch the error of readonly/volatile.
18315 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
18317 (FieldExpr.AddressOf): ditto. Catch error where the address of a
18318 volatile variable is taken
18320 2003-05-02 Miguel de Icaza <miguel@ximian.com>
18322 * statement.cs (Fixed.Resolve): Report an error if we are not in
18325 2003-05-01 Miguel de Icaza <miguel@ximian.com>
18327 * typemanager.cs: reuse the code that handles type clashes for
18328 delegates and enumerations.
18330 * class.cs (Report28): Always report.
18332 * expression.cs (EncodeAsAttribute): Allow nulls here.
18334 2003-04-28 Miguel de Icaza <miguel@ximian.com>
18336 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
18337 the functionality for testing whether an expression is valid for
18338 an attribute here. Also handle the case of arrays of elements
18341 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
18342 encoding a linear array into an array of objects that are suitable
18343 to be passed to an CustomAttributeBuilder.
18345 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
18347 * ecore.cs: (FieldExpr): Handle field remapping here.
18349 * iteratators.cs: Pass the instance variable (if the method is an
18350 instance method) to the constructors, so we can access the field
18351 variables on the class.
18353 TODO: Test this with structs. I think the THIS variable on
18354 structs might have to be a pointer, and not a refenrece
18356 2003-04-27 Miguel de Icaza <miguel@ximian.com>
18358 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
18359 local variables to fields in a proxy class.
18361 * iterators.cs (PopulateProxy): Rename our internal fields to
18363 Create a <THIS> field if we are an instance method, so we can
18364 reference our parent container variables.
18365 (MapVariable): Called back from the EmitContext code to enter a
18366 new variable to field mapping into the proxy class (we just create
18370 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
18371 for using the remapped locals to fields.
18373 I placed the code here, because that gives the same semantics to
18374 local variables, and only changes the Emit code.
18376 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
18377 statements inside iterators.
18378 (VariableInfo): Add a FieldBuilder for the cases when we are
18379 remapping local variables to fields in a proxy class
18381 * ecore.cs (SimpleNameResolve): Avoid testing two times for
18382 current_block != null.
18384 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
18385 not cope with strings, as it has been moved to the
18386 TableSwitchEmit. Fixed bug in switch generation.
18388 * expression.cs (New.DoResolve): Provide more context for the user
18389 when reporting an error.
18391 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
18394 * expression.cs (MemberAccess.DoResolve): When we get a type back,
18395 check the permissions for it. Note than in a type-resolution
18396 context the check was already present in DeclSpace.ResolveType,
18397 but was missing from the MemberAccess.
18399 (ArrayCreation.CheckIndices): warn if the user has
18400 more nested levels of expressions, but there are no more
18401 dimensions specified. Avoids crash on bug 41906.
18403 2003-04-26 Miguel de Icaza <miguel@ximian.com>
18405 * statement.cs (Block): replace Implicit bool, for a generic
18407 New flag: `Unchecked'. This is used during the EmitMeta phase
18408 (which is out-of-line with the regular Resolve/Emit process for a
18409 statement, as this is done ahead of time, but still gets a chance
18410 to call constant resolve).
18412 (Block.Flags): new enum for adding a new flag.
18414 (Block.EmitMeta): track the state of unchecked.
18416 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
18417 to enable constant resolution to work there as well.
18419 2003-04-22 Miguel de Icaza <miguel@ximian.com>
18421 * typemanager.cs (ienumerable_type): Also look up
18422 System.Collections.IEnumerable.
18424 2003-04-21 Miguel de Icaza <miguel@ximian.com>
18426 TODO: Test more than one conditional per method.
18428 * class.cs (Indexer.Define): Report the location where the user is
18429 referencing the unsupported feature.
18431 (MethodData): Overload the use of `conditionals' to
18432 minimize the creation of needless ArrayLists. This saves roughly
18433 212kb on my machine.
18435 (Method): Implement the new IIteratorContainer interface.
18436 (Method.SetYields): Implement the method by setting the ModFlags
18437 to contain METHOD_YIELDS.
18439 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
18440 which just got set to null.
18442 * iterators.cs: New file.
18444 (Yield, YieldBreak): New statements.
18446 * statement.cs (Return.Resolve): Flag an error if we are used in
18447 an iterator method.
18449 * codegen.cs (InIterator): New flag set if the code is being
18450 compiled in an iterator method.
18452 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
18453 internal modifier, and we just use it to avoid adding extra
18454 fields, as this is seldom used.
18456 * cs-parser.jay: Add yield_statement (yield and yield break).
18458 * driver.cs: New flag -v2 to turn on version 2 features.
18460 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
18461 hashtable when v2 is enabled.
18463 2003-04-20 Miguel de Icaza <miguel@ximian.com>
18465 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
18466 there is already a namespace defined with this name.
18468 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
18469 people upgraded their corlibs.
18471 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
18472 always use fully qualified types, no need to use the compiler
18475 (TypeManager.IsNamespace): Use binarysearch.
18477 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
18478 AddDelegate): I did not quite use the new IsValid API properly: I
18479 have to pass the short-name and the fullname. I was passing only
18480 the basename instead of the fullname sometimes.
18482 (TypeContainer.DefineType): call NamespaceClash.
18484 * interface.cs (Interface.DefineType): use NamespaceClash before
18487 * delegate.cs (Delegate.DefineType): use NamespaceClash before
18490 * enum.cs: (Enum.DefineType): use NamespaceClash before
18493 * typemanager.cs (: 3-line patch that gives us some tasty 11%
18494 speed increase. First, use the negative_hits cache when we get a
18495 negative. Second, add the type with its full original name
18496 instead of the new . and + encoded name (reflection uses + to
18497 separate type from a nested type). Use LookupTypeReflection
18498 directly which bypasses the type->name hashtable (that we already
18499 know does not contain the type.
18501 * decl.cs (DeclSpace.ResolveTypeExpr): track the
18502 location/container type.
18504 * driver.cs: When passing utf8, use directly the UTF8Encoding.
18506 2003-04-19 Miguel de Icaza <miguel@ximian.com>
18508 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
18510 * delegate.cs (NewDelegate.Resolve): Test whether an instance
18511 method is being referenced in the method group from a static
18512 context, and report error 120 if so.
18514 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
18517 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
18518 is created, we create the A namespace).
18520 * cs-parser.jay: A namespace also introduces a DeclarationFound.
18523 2003-04-18 Miguel de Icaza <miguel@ximian.com>
18525 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
18526 invocation to ModuleBuilder.GetType with the same values will
18527 return a new type instance, so we need to cache its return
18530 * expression.cs (Binary.ResolveOperator): Only allow the compare
18531 operators on enums if they are of the same type.
18533 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
18534 types of ValueType on their own case. Before we were giving them
18535 the same treatment as objects.
18537 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
18538 fullname. Short name is used to compare against container name.
18539 Fullname is used to check against defined namespace names.
18541 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
18542 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
18544 (Method.CheckBase): Call parent.
18545 (MemberBase.CheckBase): Check for protected members on sealed
18547 (PropertyBase.CheckBase): Call parent.
18548 (Field.Define): Call parent.
18550 * report.cs: Negative error codes are now mapped to 8000 - code,
18551 so that the display is render more nicely.
18553 * typemanager.cs: Do not use try/catch, instead report a regular
18556 (GetPointerType, GetReferenceType): These methods provide
18557 mechanisms to obtain the T* and T& from a T. We had the code
18558 previously scattered around the code base, and it also used
18559 TypeManager.LookupType that would go through plenty of caches.
18560 This one goes directly to the type source.
18562 In some places we did the Type.GetType followed by
18563 ModuleBuilder.GetType, but not in others, so this unifies the
18564 processing as well.
18566 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
18567 statements now that we have namespace information.
18569 * typemanager.cs (IsNamespace): New method, returns whether the
18570 string presented is a namespace or not.
18572 (ComputeNamespaces): New public entry point, computes the list of
18573 available namespaces, using the GetNamespaces API call in Mono, or
18574 the slower version in MS.NET.
18576 Now before we start the semantic analysis phase, we have a
18577 complete list of namespaces including everything that the user has
18580 Deleted old code to cache namespaces in .nsc files.
18582 2003-04-17 Miguel de Icaza <miguel@ximian.com>
18584 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
18585 class/struct location definition Location for the implicit
18586 constructor location.
18588 (Operator.Define): Use the location of the operator for the
18589 implicit Method definition.
18591 (Constructor.Emit): use the constructor location for the implicit
18592 base initializer constructor.
18594 * ecore.cs: Remove ITypeExpression. This interface is now gone,
18595 and the Expression class now contains two new methods:
18597 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
18598 isolate type lookup from the rest of the resolution process.
18600 Since we use Expressions to hold type definitions due to the way
18601 we parse the input we have historically overloaded Resolve to
18602 perform the Type lookups if a special flag is passed. Now this is
18603 eliminated and two methods take their place.
18605 The differences in the two methods between xStep and xTerminal is
18606 that xStep is involved in our current lookup system that uses
18607 SimpleNames to compose a name, while xTerminal is used just to
18608 catch the case where the simplename lookup failed.
18610 2003-04-16 Miguel de Icaza <miguel@ximian.com>
18612 * expression.cs (ResolveMemberAccess): Remove redundant code.
18613 TypeExpr expressions are always born fully resolved.
18615 * interface.cs (PopulateMethod): Do not lookup the types twice.
18616 We were doing it once during SemanticAnalysis and once during
18619 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
18620 in local variable type definitions, were being returned as a
18621 SimpleName (we decomposed everything into a string), that is
18622 because primary_expression was being used instead of a type in the
18623 grammar (reduce/reduce conflicts).
18625 The part that was wrong is that we converted the expression into a
18626 string (an oversimplification in one hand, compounded with primary
18627 expressions doing string concatenation).
18633 Would return "A.B.C[]" as a SimpleName. This stopped things like
18634 using clauses from working on this particular context. And a type
18635 was being matched directly against "A.B.C[]".
18637 We now use the correct approach, and allow for ComposedCast to be
18638 part of the unary expression. So the "A.B.C []" become a composed
18639 cast of "A.B.C" (as a nested group of MemberAccess with a
18640 SimpleName at the end) plus the rank composition "[]".
18644 2003-04-10 Miguel de Icaza <miguel@ximian.com>
18646 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
18647 for the access level checking.
18649 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
18650 `TypeContainer container', because I kept getting confused when I
18651 was debugging this code.
18653 * expression.cs (Indexers): Instead of tracking getters/setters,
18654 we now track them in parallel. We create one arraylist less, but
18655 most importantly it is possible now for the LValue code to find a
18656 matching get for a set.
18658 (IndexerAccess.DoResolveLValue): Update the code.
18659 GetIndexersForType has been modified already to extract all the
18660 indexers from a type. The code assumed it did not.
18662 Also make the code set the correct return type for the indexer.
18663 This was fixed a long time ago for properties, but was missing for
18664 indexers. It used to be void_type.
18666 (Binary.Emit): Test first for doubles instead of
18667 floats, as they are more common.
18669 (Binary.EmitBranchable): Use the .un version of the branch opcodes
18670 when dealing with floats and the <=, >= operators. This fixes bug
18673 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
18674 to load the array value by emitting a load on the foreach variable
18675 type. This was incorrect.
18677 We now emit the code to load an element using the the array
18678 variable type, and then we emit the conversion operator.
18682 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
18684 * attribute.cs: Avoid allocation of ArrayLists in the common case.
18686 2003-04-09 Miguel de Icaza <miguel@ximian.com>
18688 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
18689 test for protection before we test for signatures.
18691 (MethodSignature.ToString): implement.
18693 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
18694 to the case where we reduced into a LongConstant.
18696 * decl.cs (CheckAccessLevel): If the type is an array, we can not
18697 depend on whether the information is acurrate, because the
18698 Microsoft runtime will always claim that the array type is public,
18699 regardless of the real state.
18701 If the type is a pointer, another problem happens: the type is
18702 reported as non-public in Microsoft.
18704 In both cases we have to call CheckAccessLevel recursively with
18705 the underlying type as the argument to be tested.
18707 2003-04-08 Miguel de Icaza <miguel@ximian.com>
18709 * assign.cs (Assign.Emit): If we are dealing with a compound
18710 assignment expression, we should use the code path that stores the
18711 intermediate result in a temporary value. This fixes #40903.
18713 *expression.cs (Indirection.ToString): Provide ToString method for
18716 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
18718 * class.cs: Null out fields holding references to Block objects so
18719 they can be garbage collected.
18721 * expression.cs (OverloadResolve): Remove unused local.
18723 2003-04-07 Martin Baulig <martin@ximian.com>
18725 * codegen.cs (EmitContext.CurrentFile): New public field.
18726 (EmitContext.Mark): Use the CurrentFile to check whether the
18727 location is in the correct file.
18728 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
18730 2003-04-07 Martin Baulig <martin@ximian.com>
18732 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
18734 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
18735 location. [FIXME: The location argument which gets passed to this
18736 method is sometimes wrong!]
18738 2003-04-07 Nick Drochak <ndrochak@gol.com>
18740 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
18742 2003-04-07 Miguel de Icaza <miguel@ximian.com>
18744 * expression.cs (Indirection.EmitAssign): We were using the
18745 temporary, but returning immediately instead of continuing the
18748 2003-04-06 Martin Baulig <martin@ximian.com>
18750 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
18751 if it's a nested child, but also deriving from the outer class.
18754 * typemanager.cs (IsNestedChildOf): Make this work if it's a
18755 nested child, but also deriving from the outer class. See
18757 (FilterWithClosure): We may access private members of the outer
18758 class if we're a nested child and deriving from the outer class.
18759 (RealMemberLookup): Only set `closure_private_ok' if the
18760 `original_bf' contained BindingFlags.NonPublic.
18762 2003-04-05 Martin Baulig <martin@ximian.com>
18764 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
18766 2003-04-02 Miguel de Icaza <miguel@ximian.com>
18768 * class.cs (Event.Define): Do not allow abstract events to have
18771 2003-04-01 Miguel de Icaza <miguel@ximian.com>
18773 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
18774 block in event declarations.
18776 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
18777 value type, get its address.
18779 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
18780 leaving a class on the stack instead of a boolean value (int
18781 0/1). Change the code so we compare against null, and then the
18782 result against zero.
18784 * class.cs (TypeContainer.GetClassBases): We were checking for the
18785 parent class being sealed too late.
18787 * expression.cs (Binary.Emit): For <= and >= when dealing with
18788 floating point values, use cgt.un and clt.un instead of cgt and
18791 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
18793 * statement.cs: Apply the same optimization as MS: skip the
18794 GetEnumerator returning an IEnumerator, and use the one returning a
18795 CharEnumerator instead. This allows us to avoid the try-finally block
18798 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
18800 * cs-parser.jay: Attributes cannot be applied to
18801 namespaces. Fixes #40473
18803 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18806 (Add*): check if the name is valid using the full name for constants,
18807 fields, properties and events.
18809 2003-03-28 Miguel de Icaza <miguel@ximian.com>
18811 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
18812 char constants to be part of the enumeration.
18814 * expression.cs (Conditional.DoResolve): Add support for operator
18815 true. Implements the missing functionality from 14.12
18817 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
18818 operator true/false as required by the spec.
18820 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
18821 implicit conversion to boolean.
18823 * statement.cs (Statement.ResolveBoolean): A boolean expression is
18824 also one where the type implements `operator true'.
18826 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
18827 get an expression that will invoke operator true based on an
18830 (GetConversionOperators): Removed the hack that called op_True
18833 (Expression.ResolveBoolean): Move this from Statement.
18835 2003-03-17 Miguel de Icaza <miguel@ximian.com>
18837 * ecore.cs (FieldExpr): do not allow initialization of initonly
18838 fields on derived classes
18840 2003-03-13 Martin Baulig <martin@ximian.com>
18842 * statement.cs (Block.Emit): Call ig.BeginScope() and
18843 ig.EndScope() when compiling with debugging info; call
18844 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
18846 2003-03-08 Miguel de Icaza <miguel@ximian.com>
18848 * expression.cs (Indexers): Do not construct immediately, allow
18849 for new members to be appended as we go. Fixes 38143
18851 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18853 * expression.cs: save/restore context when resolving an unchecked
18856 2003-03-05 Miguel de Icaza <miguel@ximian.com>
18858 * cfold.cs: Catch division by zero in modulus operator during
18861 2003-03-03 Miguel de Icaza <miguel@ximian.com>
18863 * interface.cs (Interface.DefineMembers): Avoid defining members
18866 2003-02-27 Miguel de Icaza <miguel@ximian.com>
18868 * driver.cs: handle the +/- options for -noconfig
18870 * statement.cs (Unckeched.Resolve): Also track the state of
18871 unchecked in the Resolve phase.
18873 2003-02-27 Martin Baulig <martin@ximian.com>
18875 * ecore.cs (Expression.MemberLookup): Don't create a
18876 MethodGroupExpr for something which is not a method. Fixes #38291.
18878 2003-02-25 Miguel de Icaza <miguel@ximian.com>
18880 * class.cs (MemberBase.CheckParameters): Also check that the type
18881 is unmanaged if it is a pointer.
18883 * expression.cs (SizeOf.Resolve): Add location information.
18885 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
18886 a managed type is declared.
18888 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
18889 parameter modifiers as well. Fixes bug 38606
18891 * class.cs: Very sad. Am backing out the speed up changes
18892 introduced by the ArrayList -> Array in the TypeContainer, as they
18893 were not actually that much faster, and introduced a bug (no error
18894 reports on duplicated methods).
18896 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
18897 source first, this will guarantee that we have a valid expression
18898 before calling in lower levels functions that will require a
18899 resolved object. Then use this original_source in the
18900 target.ResolveLValue instead of the original source that was
18903 Another change. Use target.Resolve instead of LValueResolve.
18904 Although we are resolving for LValues, we will let the Assign code
18905 take care of that (it will be called again from Resolve). This
18906 basically allows code like this:
18908 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
18909 class Y { void A (X x) { x [0] += o; }
18911 The problem was that the indexer was trying to resolve for
18912 set_Item (idx, object o) and never finding one. The real set_Item
18913 was set_Item (idx, X). By delaying the process we get the right
18918 2003-02-23 Martin Baulig <martin@ximian.com>
18920 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
18921 while calling DoEmit ().
18923 * codegen.cs (EmitContext.Mark): Don't mark locations in other
18924 source files; if you use the #line directive inside a method, the
18925 compiler stops emitting line numbers for the debugger until it
18926 reaches the end of the method or another #line directive which
18927 restores the original file.
18929 2003-02-23 Martin Baulig <martin@ximian.com>
18931 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
18933 2003-02-23 Martin Baulig <martin@ximian.com>
18935 * statement.cs (Block.AddChildVariableNames): We need to call this
18936 recursively, not just for our immediate children.
18938 2003-02-23 Martin Baulig <martin@ximian.com>
18940 * class.cs (Event.Define): Always make the field private, like csc does.
18942 * typemanager.cs (TypeManager.RealMemberLookup): Make events
18943 actually work, fixes bug #37521.
18945 2003-02-23 Miguel de Icaza <miguel@ximian.com>
18947 * delegate.cs: When creating the various temporary "Parameters"
18948 classes, make sure that we call the ComputeAndDefineParameterTypes
18949 on those new parameters (just like we do with the formal ones), to
18950 allow them to be resolved in the context of the DeclSpace.
18952 This fixes the bug that Dick observed in Bugzilla #38530.
18954 2003-02-22 Miguel de Icaza <miguel@ximian.com>
18956 * expression.cs (ResolveMemberAccess): When resolving a constant,
18957 do not attempt to pull a constant if the value was not able to
18958 generate a valid constant.
18960 * const.cs (LookupConstantValue): Do not report more errors than required.
18962 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18964 * expression.cs: fixes bug #38328.
18966 2003-02-18 Miguel de Icaza <miguel@ximian.com>
18968 * class.cs: Changed all the various members that can be part of a
18969 class from being an ArrayList to be an Array of the right type.
18970 During the DefineType type_list, interface_list, delegate_list and
18971 enum_list are turned into types, interfaces, delegates and enums
18974 And during the member population, indexer_list, event_list,
18975 constant_list, field_list, instance_constructor_list, method_list,
18976 operator_list and property_list are turned into their real arrays.
18978 Although we could probably perform this operation earlier, for
18979 good error reporting we need to keep the lists and remove the
18980 lists for longer than required.
18982 This optimization was triggered by Paolo profiling the compiler
18983 speed on the output of `gen-sample-program.pl' perl script.
18985 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
18986 not crash in methods like MemberLookupFailed that use this field.
18988 This problem arises when the compiler fails to resolve a type
18989 during interface type definition for example.
18991 2003-02-18 Miguel de Icaza <miguel@ximian.com>
18993 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
18994 inherit from System.Object, so we have to stop at null, not only
18995 when reaching System.Object.
18997 2003-02-17 Miguel de Icaza <miguel@ximian.com>
18999 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
19000 DeclaredOnly because the parent indexer might have had a different
19001 name, but did not loop until the top of the hierarchy was reached.
19003 The problem this one fixes is 35492: when a class implemented an
19004 indexer from an interface, we were getting the interface method
19005 (which was abstract) and we were flagging an error (can not invoke
19008 This also keeps bug 33089 functioning, and test-148 functioning.
19010 * typemanager.cs (IsSpecialMethod): The correct way of figuring
19011 out if a method is special is to see if it is declared in a
19012 property or event, or whether it is one of the predefined operator
19013 names. This should fix correctly #36804.
19015 2003-02-15 Miguel de Icaza <miguel@ximian.com>
19017 The goal here is to remove the dependency on EmptyCast.Peel ().
19018 Killing it completely.
19020 The problem is that currently in a number of places where
19021 constants are expected, we have to "probe" for an EmptyCast, and
19022 Peel, which is not the correct thing to do, as this will be
19023 repetitive and will likely lead to errors.
19025 The idea is to remove any EmptyCasts that are used in casts that
19026 can be reduced to constants, so we only have to cope with
19029 This bug hunt was triggered by Bug 37363 and the desire to remove
19030 the duplicate pattern where we were "peeling" emptycasts to check
19031 whether they were constants. Now constants will always be
19034 * ecore.cs: Use an enumconstant here instead of wrapping with
19037 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
19038 throwing me off. By handling this we can get rid of a few hacks.
19040 * statement.cs (Switch): Removed Peel() code.
19042 2003-02-14 Miguel de Icaza <miguel@ximian.com>
19044 * class.cs: Location information for error 508
19046 * expression.cs (New.DoResolve): Add a guard against double
19047 resolution of an expression.
19049 The New DoResolve might be called twice when initializing field
19050 expressions (see EmitFieldInitializers, the call to
19051 GetInitializerExpression will perform a resolve on the expression,
19052 and later the assign will trigger another resolution
19054 This leads to bugs (#37014)
19056 * delegate.cs: The signature for EndInvoke should contain any ref
19057 or out parameters as well. We were not doing this in the past.
19059 * class.cs (Field.Define): Do not overwrite the type definition
19060 inside the `volatile' group. Turns out that volatile enumerations
19061 were changing the type here to perform a validity test, which
19064 2003-02-12 Miguel de Icaza <miguel@ximian.com>
19066 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
19067 and structs, we do not want to load the instance variable
19069 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
19070 enum_type has to be handled like an object reference (implicit
19071 conversions exists from this to object), but the regular IsClass
19072 and IsValueType tests will never return true for this one.
19074 Also we use TypeManager.IsValueType instead of type.IsValueType,
19075 just for consistency with the rest of the code (this is only
19076 needed if we ever use the construct exposed by test-180.cs inside
19077 corlib, which we dont today).
19079 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
19081 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
19084 2003-02-09 Martin Baulig <martin@ximian.com>
19086 * namespace.cs (Namespace..ctor): Added SourceFile argument.
19087 (Namespace.DefineNamespaces): New static public method; this is
19088 called when we're compiling with debugging to add all namespaces
19089 to the symbol file.
19091 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
19092 pass it to the Namespace's .ctor.
19094 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
19095 and MethodBase arguments; pass the namespace ID to the symwriter;
19096 pass the MethodBase instead of the token to the symwriter.
19097 (SymbolWriter.DefineNamespace): New method to add a namespace to
19100 2003-02-09 Martin Baulig <martin@ximian.com>
19102 * symbolwriter.cs: New file. This is a wrapper around
19103 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
19104 methods here in near future.
19106 2003-02-09 Martin Baulig <martin@ximian.com>
19108 * codegen.cs (EmitContext.Mark): Just pass the arguments to
19109 ILGenerator.MarkSequencePoint() which are actually used by the
19112 2003-02-09 Martin Baulig <martin@ximian.com>
19114 * location.cs (SourceFile): New public sealed class. This
19115 contains the name and an index which is used in the location's token.
19116 (Location): Reserve an appropriate number of bits in the token for
19117 the source file instead of walking over that list, this gives us a
19118 really huge performance improvement when compiling with debugging.
19120 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
19121 `SourceFile' argument instead of a string.
19122 (Driver.ProcessFile): Add all the files via Location.AddFile(),
19123 but don't parse/tokenize here, we need to generate the list of all
19124 source files before we do that.
19125 (Driver.ProcessFiles): New static function. Parses/tokenizes all
19128 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
19129 instead of a string.
19131 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
19134 2003-02-09 Martin Baulig <martin@ximian.com>
19136 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
19137 filename on `#line default'.
19139 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
19141 * statement.cs: don't clear the pinned var when the fixed statement
19142 returns from the method (fixes bug#37752).
19144 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
19146 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
19149 2003-02-07 Martin Baulig <martin@ximian.com>
19151 * driver.cs: Removed the `--debug-args' command line argument.
19153 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
19154 automatically by the AsssemblyBuilder.
19155 (CodeGen.InitializeSymbolWriter): We don't need to call any
19156 initialization function on the symbol writer anymore. This method
19157 doesn't take any arguments.
19159 2003-02-03 Miguel de Icaza <miguel@ximian.com>
19161 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
19162 from referenced assemblies as well.
19164 2003-02-02 Martin Baulig <martin@ximian.com>
19166 * class.cs (MethodData.Emit): Generate debugging info for external methods.
19168 2003-02-02 Martin Baulig <martin@ximian.com>
19170 * class.cs (Constructor.Emit): Open the symbol writer before
19171 emitting the constructor initializer.
19172 (ConstructorInitializer.Emit): Call ec.Mark() to allow
19173 single-stepping through constructor initializers.
19175 2003-01-30 Miguel de Icaza <miguel@ximian.com>
19177 * class.cs: Handle error 549: do not allow virtual methods in
19180 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
19182 * decl.cs: Check access levels when resolving types
19184 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
19186 * statement.cs: Add parameters and locals set in catch blocks that might
19187 return to set vector
19189 2003-01-29 Miguel de Icaza <miguel@ximian.com>
19191 * class.cs (Operator): Set the SpecialName flags for operators.
19193 * expression.cs (Invocation.DoResolve): Only block calls to
19194 accessors and operators on SpecialName methods.
19196 (Cast.TryReduce): Handle conversions from char constants.
19199 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
19201 * statement.cs: small memory and time optimization in FlowBranching.
19203 2003-01-28 Pedro Mart <yoros@wanadoo.es>
19205 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
19206 problem that the last fix but in the other sid (Set).
19208 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
19209 access when there is no indexer in the hierarchy.
19211 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
19213 * class.cs: Combine some if statements.
19215 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19217 * driver.cs: fixed bug #37187.
19219 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
19221 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
19222 any indexer, it's needed to build a list with all the indexers in the
19223 hierarchy (AllGetters), else we have problems. Fixes #35653.
19225 2003-01-23 Miguel de Icaza <miguel@ximian.com>
19227 * class.cs (MethodData.Define): It is wrong for an interface
19228 implementation to be static in both cases: explicit and implicit.
19229 We were only handling this in one case.
19231 Improve the if situation there to not have negations.
19233 * class.cs (Field.Define): Turns out that we do not need to check
19234 the unsafe bit on field definition, only on usage. Remove the test.
19236 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19238 * driver.cs: use assembly.Location instead of Codebase (the latest
19239 patch made mcs fail when using MS assemblies).
19241 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
19243 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
19244 get the path to *corlib.dll.
19246 2003-01-21 Nick Drochak <ndrochak@gol.com>
19250 * typemanager.cs: Remove compiler warnings
19252 2003-01-20 Duncan Mak <duncan@ximian.com>
19254 * AssemblyInfo.cs: Bump the version number to 0.19.
19256 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19258 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
19260 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
19262 * class.cs (Constructor::Emit): Emit debugging info for constructors.
19264 2003-01-17 Miguel de Icaza <miguel@ximian.com>
19266 * cs-parser.jay: Small fix: we were not comparing the constructor
19267 name correctly. Thanks to Zoltan for the initial pointer.
19269 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
19271 * cs-tokenizer.cs: Set file name when specified with #line
19273 2003-01-15 Miguel de Icaza <miguel@ximian.com>
19275 * cs-parser.jay: Only perform the constructor checks here if we
19276 are named like the class; This will help provider a better
19277 error. The constructor path is taken when a type definition is
19278 not found, but most likely the user forgot to add the type, so
19279 report that rather than the constructor error.
19281 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
19283 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
19286 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
19288 * cs-parser.jay: Add cleanup call.
19290 2003-01-13 Duncan Mak <duncan@ximian.com>
19292 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
19293 consistent with other methods.
19295 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
19297 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
19299 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
19301 * attribute.cs: only set GuidAttr to true when we have a
19304 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19308 * typemanager.cs: fixes to allow mcs compile corlib with the new
19309 Type.IsSubclassOf fix.
19311 2003-01-08 Miguel de Icaza <miguel@ximian.com>
19313 * expression.cs (LocalVariableReference.DoResolve): Classify a
19314 constant as a value, not as a variable. Also, set the type for
19317 * cs-parser.jay (fixed_statement): take a type instead of a
19318 pointer_type, so we can produce a better error message later.
19320 * statement.cs (Fixed.Resolve): Flag types that are not pointers
19323 (For.DoEmit): Make inifinite loops have a
19324 non-conditional branch back.
19326 (Fixed.DoEmit): First populate the pinned variables, then emit the
19327 statement, then clear the variables. Before I was emitting the
19328 code once for each fixed piece.
19331 2003-01-08 Martin Baulig <martin@ximian.com>
19333 * statement.cs (FlowBranching.MergeChild): A break in a
19334 SWITCH_SECTION does not leave a loop. Fixes #36155.
19336 2003-01-08 Martin Baulig <martin@ximian.com>
19338 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
19339 lives in the same number space than `param_map'. Fixes #36154.
19341 2003-01-07 Miguel de Icaza <miguel@ximian.com>
19343 * cs-parser.jay (constructor_declaration): Set the
19344 Constructor.ModFlags before probing for it. This makes the
19345 compiler report 514, 515 and 132 (the code was there, but got
19348 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
19349 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
19350 (GotoCase.Resolve): Set `Returns' to ALWAYS.
19352 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
19354 * enum.cs: create the enum static fields using the enum type.
19356 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
19358 * class.cs: don't try to create the ParamBuilder for the return
19359 type if it's not needed (and handle it breaking for the ms runtime
19362 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
19364 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
19366 2002-12-29 Miguel de Icaza <miguel@ximian.com>
19368 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
19369 the command. This showed up while compiling the JANET source
19370 code, which used \r as its only newline separator.
19372 2002-12-28 Miguel de Icaza <miguel@ximian.com>
19374 * class.cs (Method.Define): If we are an operator (because it
19375 reuses our code), then set the SpecialName and HideBySig. #36128
19377 2002-12-22 Miguel de Icaza <miguel@ximian.com>
19379 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
19380 exception, report error 120 `object reference required'.
19382 * driver.cs: Add --pause option, used during to measure the size
19383 of the process as it goes with --timestamp.
19385 * expression.cs (Invocation.DoResolve): Do not allow methods with
19386 SpecialName to be invoked.
19388 2002-12-21 Miguel de Icaza <miguel@ximian.com>
19390 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
19391 number before adding it.
19393 2002-12-21 Ravi Pratap <ravi@ximian.com>
19395 * ecore.cs (StandardImplicitConversion): When in an unsafe
19396 context, we allow conversion between void * to any other pointer
19397 type. This fixes bug #35973.
19399 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
19401 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
19402 is not thrown when extensionless outputs are used
19404 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19406 * rootcontext.cs: fixed compilation of corlib.
19408 2002-12-19 Miguel de Icaza <miguel@ximian.com>
19410 * attribute.cs (Attributes.Contains): Add new method.
19412 * class.cs (MethodCore.LabelParameters): if the parameter is an
19413 `out' parameter, check that no attribute `[In]' has been passed.
19415 * enum.cs: Handle the `value__' name in an enumeration.
19417 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
19419 * decl.cs: Added special case to allow overrides on "protected
19422 2002-12-18 Ravi Pratap <ravi@ximian.com>
19424 * attribute.cs (Attributes.AddAttributeSection): Rename to this
19425 since it makes much more sense.
19427 (Attributes.ctor): Don't require a Location parameter.
19429 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
19431 * attribute.cs (ApplyAttributes): Remove extra Location parameters
19432 since we already have that information per attribute.
19434 * everywhere : make appropriate changes.
19436 * class.cs (LabelParameters): Write the code which actually
19437 applies attributes to the return type. We can't do this on the MS
19438 .NET runtime so we flag a warning in the case an exception is
19441 2002-12-18 Miguel de Icaza <miguel@ximian.com>
19443 * const.cs: Handle implicit null conversions here too.
19445 2002-12-17 Ravi Pratap <ravi@ximian.com>
19447 * class.cs (MethodCore.LabelParameters): Remove the extra
19448 Type [] parameter since it is completely unnecessary. Instead
19449 pass in the method's attributes so that we can extract
19450 the "return" attribute.
19452 2002-12-17 Miguel de Icaza <miguel@ximian.com>
19454 * cs-parser.jay (parse): Use Report.Error to flag errors instead
19455 of ignoring it and letting the compile continue.
19457 * typemanager.cs (ChangeType): use an extra argument to return an
19458 error condition instead of throwing an exception.
19460 2002-12-15 Miguel de Icaza <miguel@ximian.com>
19462 * expression.cs (Unary.TryReduce): mimic the code for the regular
19463 code path. Perform an implicit cast in the cases where we can
19464 implicitly convert to one of the integral types, and then reduce
19465 based on that constant. This fixes bug #35483.
19467 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19469 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
19471 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19473 * namespace.cs: fixed bug #35489.
19475 2002-12-12 Miguel de Icaza <miguel@ximian.com>
19477 * class.cs: Remove some dead code.
19479 * cs-parser.jay: Estimate the number of methods needed
19480 (RootContext.MethodCount);
19482 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
19483 numbers instead of StringBuilders.
19485 * support.cs (PtrHashtable): Add constructor with initial size;
19486 We can now reduce reallocations of the method table.
19488 2002-12-10 Ravi Pratap <ravi@ximian.com>
19490 * attribute.cs (ApplyAttributes): Keep track of the emitted
19491 attributes on a per-target basis. This fixes bug #35413.
19493 2002-12-10 Miguel de Icaza <miguel@ximian.com>
19495 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
19496 default to the Windows 1252 encoding.
19498 (UnixParseOption): Support version, thanks to Alp for the missing
19501 * AssemblyInfo.cs: Add nice assembly information.
19503 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
19506 * cs-parser.jay: Allow a trailing comma before the close bracked
19507 in the attribute_section production.
19509 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
19510 address of the instance was being taken, I will take this out,
19511 because we take the address of the object immediately here.
19513 2002-12-09 Ravi Pratap <ravi@ximian.com>
19515 * typemanager.cs (AreMultipleAllowed): Take care of the most
19516 obvious case where attribute type is not in the current assembly -
19519 2002-12-08 Miguel de Icaza <miguel@ximian.com>
19521 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
19522 definitions, instead of doing that afterwards.
19524 Also we use a nice little hack, depending on the constructor, we
19525 know if we are a "composed" name or a simple name. Hence, we
19526 avoid the IndexOf test, and we avoid
19528 * codegen.cs: Add code to assist in a bug reporter to track down
19529 the source of a compiler crash.
19531 2002-12-07 Ravi Pratap <ravi@ximian.com>
19533 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
19534 types have been emitted for a given element and flag an error
19535 if something which does not have AllowMultiple set is used more
19538 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
19539 attribute types and their corresponding AllowMultiple properties
19541 (AreMultipleAllowed): Check the property for a given type.
19543 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
19544 property in the case we have a TypeContainer.
19546 (Attributes.AddAttribute): Detect duplicates and just skip on
19547 adding them. This trivial fix catches a pretty gross error in our
19548 attribute emission - global attributes were being emitted twice!
19550 Bugzilla bug #33187 is now fixed.
19552 2002-12-06 Miguel de Icaza <miguel@ximian.com>
19554 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
19555 instead of pp_and).
19557 * expression.cs (Binary.ResolveOperator): I can only use the
19558 Concat (string, string, string) and Concat (string, string,
19559 string, string) if the child is actually a concatenation of
19562 2002-12-04 Miguel de Icaza <miguel@ximian.com>
19564 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
19565 context where we need a 2-character lookahead.
19567 * pending.cs (PendingImplementation): Rework so we can keep track
19568 of interface types all the time, and flag those which were
19569 implemented by parents as optional.
19571 2002-12-03 Miguel de Icaza <miguel@ximian.com>
19573 * expression.cs (Binary.ResolveOperator): Use
19574 String.Concat(string,string,string) or
19575 String.Concat(string,string,string,string) when possible.
19577 * typemanager: More helper methods.
19580 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
19582 * pending.cs: remove the bogus return from GetMissingInterfaces()
19583 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
19585 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19587 * namespace.cs: avoid duplicated 'using xxx' being added to
19588 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
19589 when we get more than one 'using' statement for the same namespace.
19590 Report a CS0105 warning for it.
19592 2002-11-30 Miguel de Icaza <miguel@ximian.com>
19594 * cs-tokenizer.cs (consume_identifier): use read directly, instead
19595 of calling getChar/putback, uses internal knowledge of it.
19597 (xtoken): Reorder tokenizer so most common patterns are checked
19598 first. This reduces the compilation time in another 5% (from 8.11s
19599 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
19601 The parsing time is 22% of the compilation in mcs, and from that
19602 64% is spent on the tokenization process.
19604 I tried using a binary search for keywords, but this is slower
19605 than the hashtable. Another option would be to do a couple of
19608 * Not use a StringBuilder, instead use an array of chars,
19609 with a set value. Notice that this way we could catch
19610 the 645 error without having to do it *afterwards*.
19612 * We could write a hand-parser to avoid the hashtable
19613 compares altogether.
19615 The identifier consumption process takes 37% of the tokenization
19616 time. Another 15% is spent on is_number. 56% of the time spent
19617 on is_number is spent on Int64.Parse:
19619 * We could probably choose based on the string length to
19620 use Int32.Parse or Int64.Parse and avoid all the 64-bit
19623 Another 3% is spend on wrapping `xtoken' in the `token' function.
19625 Handle 0xa0 as whitespace (#34752)
19627 2002-11-26 Miguel de Icaza <miguel@ximian.com>
19629 * typemanager.cs (IsCLRType): New routine to tell whether a type
19630 is one of the builtin types.
19632 Maybe it needs to use TypeCodes to be faster. Maybe we could use
19633 typecode in more places instead of doing pointer comparissions.
19634 We could leverage some knowledge about the way the typecodes are
19637 New code to cache namespaces in assemblies, it is currently not
19638 invoked, to be used soon.
19640 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
19642 * expression.cs (Binary.ResolveOperator): specially handle
19643 strings, and do not perform user-defined operator overloading for
19646 2002-11-24 Miguel de Icaza <miguel@ximian.com>
19648 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
19649 internalcall as it is a pretty simple operation; Avoid whenever
19650 possible to call Char.IsLetter.
19652 (consume_identifier): Cut by half the number of
19653 hashtable calls by merging the is_keyword and GetKeyword behavior.
19655 Do not short-circuit, because if we do, we
19656 report errors (ie, #if false && true would produce an invalid
19660 2002-11-24 Martin Baulig <martin@ximian.com>
19662 * expression.cs (Cast.TryReduce): If we're in checked syntax,
19663 check constant ranges and report a CS0221. Fixes #33186.
19665 2002-11-24 Martin Baulig <martin@ximian.com>
19667 * cs-parser.jay: Make this work for uninitialized variable
19668 declarations in the `for' initializer. Fixes #32416.
19670 2002-11-24 Martin Baulig <martin@ximian.com>
19672 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
19673 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
19675 2002-11-24 Martin Baulig <martin@ximian.com>
19677 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
19678 argument; if true, we also check for user-defined conversions.
19679 This is only needed if both arguments are of a user-defined type.
19680 Fixes #30443, added test-175.cs.
19681 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
19683 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
19685 2002-11-24 Martin Baulig <martin@ximian.com>
19687 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
19688 function to get the store opcode.
19689 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
19690 only emit the Ldelema if the store opcode is Stobj. You must run
19691 both test-34 and test-167 to test this. Fixes #34529.
19693 2002-11-23 Martin Baulig <martin@ximian.com>
19695 * ecore.cs (Expression.MemberLookup): Added additional
19696 `qualifier_type' argument which is used when we're being called
19697 from MemberAccess.DoResolve() and null if we're called from a
19699 (Expression.MemberLookupFailed): New method to report errors; this
19700 does the CS1540 check and reports the correct error message.
19702 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
19703 argument for the CS1540 check and redone the way how we're dealing
19704 with private members. See the comment in the source code for details.
19705 (FilterWithClosure): Reverted this back to revision 1.197; renamed
19706 `closure_start_type' to `closure_qualifier_type' and check whether
19707 it's not null. It was not this filter being broken, it was just
19708 being called with the wrong arguments.
19710 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
19711 and pass it the correct `qualifier_type'; this also does the error
19714 2002-11-22 Miguel de Icaza <miguel@ximian.com>
19716 * expression.cs (Invocation.EmitParams): If the we are dealing
19717 with a non-built-in value type, load its address as well.
19719 (ArrayCreation): Use a a pretty constant instead
19720 of the hardcoded value 2. Use 6 instead of 2 for the number of
19721 static initializers.
19723 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
19724 because they are not really value types, just glorified integers.
19726 * driver.cs: Do not append .exe, the CSC compiler does not do it.
19728 * ecore.cs: Remove redundant code for enumerations, make them use
19729 the same code path as everything else, fixes the casting issue
19730 with enumerations in Windows.Forms.
19732 * attribute.cs: Do only cast to string if it is a string, the
19733 validation happens later.
19735 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
19736 people upgrade their corlibs.
19738 * ecore.cs: Oops, enumerations were not following the entire code path
19740 2002-11-21 Miguel de Icaza <miguel@ximian.com>
19742 * typemanager.cs (FilterWithClosure): Commented out the test for
19743 1540 in typemanager.cs, as it has problems when accessing
19744 protected methods from a parent class (see test-174.cs).
19746 * attribute.cs (Attribute.ValidateGuid): new method.
19747 (Attribute.Resolve): Use above.
19749 2002-11-19 Miguel de Icaza <miguel@ximian.com>
19751 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
19753 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
19754 handling for enumerations, as we only needed the TypeContainer
19755 functionality to begin with (this is required for the fix below to
19756 work for enums that reference constants in a container class for
19759 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
19761 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
19762 a valid TypeBuilder to perform lookups on.o
19764 * class.cs (InheritableMemberSignatureCompare): Use true in the
19765 call to GetGetMethod and GetSetMethod, because we are comparing
19766 the signature, and we need to get the methods *even* if they are
19769 (PropertyBase.CheckBase): ditto.
19771 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
19772 GotoCase.Resolve): Use Peel on EmpytCasts.
19774 * ecore.cs (EmptyCast): drop child, add Peel method.
19776 2002-11-17 Martin Baulig <martin@ximian.com>
19778 * ecore.cs (EmptyCast.Child): New public property.
19780 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
19781 label resolved to an EmptyCast. Fixes #34162.
19782 (GotoCase.Resolve): Likewise.
19783 (Block.EmitMeta): Likewise.
19785 2002-11-17 Martin Baulig <martin@ximian.com>
19787 * expression.cs (Invocation.BetterConversion): Prefer int over
19788 uint; short over ushort; long over ulong for integer literals.
19789 Use ImplicitConversionExists instead of StandardConversionExists
19790 since we also need to check for user-defined implicit conversions.
19791 Fixes #34165. Added test-173.cs.
19793 2002-11-16 Martin Baulig <martin@ximian.com>
19795 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
19796 with the `true' and `false' literals. Fixes #33151.
19798 2002-11-16 Martin Baulig <martin@ximian.com>
19800 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
19801 October 22nd; don't do the cs1540 check for static members.
19803 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
19804 now using our own filter here and doing the cs1540 check again.
19806 2002-11-16 Martin Baulig <martin@ximian.com>
19808 * support.cs (InternalParameters): Don't crash if we don't have
19809 any fixed parameters. Fixes #33532.
19811 2002-11-16 Martin Baulig <martin@ximian.com>
19813 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
19814 when looking up static methods to make this work on Windows.
19817 2002-11-16 Martin Baulig <martin@ximian.com>
19819 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
19820 a setter rather than using PropertyInfo.CanWrite.
19822 2002-11-15 Nick Drochak <ndrochak@gol.com>
19824 * class.cs: Allow acces to block member by subclasses. Fixes build
19827 2002-11-14 Martin Baulig <martin@ximian.com>
19829 * class.cs (Constructor.Emit): Added the extern/block check.
19832 2002-11-14 Martin Baulig <martin@ximian.com>
19834 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
19835 iteration while looking for indexers, this is needed because the
19836 indexer may have a different name in our base classes. Fixed the
19837 error reporting (no indexers at all, not get accessor, no
19838 overloaded match). Fixes bug #33089.
19839 (IndexerAccess.DoResolveLValue): Likewise.
19841 2002-11-14 Martin Baulig <martin@ximian.com>
19843 * class.cs (PropertyBase.CheckBase): Make this work for multiple
19844 indexers. Fixes the first part of bug #33089.
19845 (MethodSignature.InheritableMemberSignatureCompare): Added support
19848 2002-11-13 Ravi Pratap <ravi@ximian.com>
19850 * attribute.cs (Attribute.Resolve): Catch the
19851 NullReferenceException and report it since it isn't supposed to
19854 2002-11-12 Miguel de Icaza <miguel@ximian.com>
19856 * expression.cs (Binary.EmitBranchable): Also handle the cases for
19857 LogicalOr and LogicalAnd that can benefit from recursively
19858 handling EmitBranchable. The code now should be nice for Paolo.
19860 2002-11-08 Miguel de Icaza <miguel@ximian.com>
19862 * typemanager.cs (LookupType): Added a negative-hit hashtable for
19863 the Type lookups, as we perform quite a number of lookups on
19864 non-Types. This can be removed once we can deterministically tell
19865 whether we have a type or a namespace in advance.
19867 But this might require special hacks from our corlib.
19871 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
19872 and double which avoids a conversion from an integer to a double.
19874 * expression.cs: tiny optimization, avoid calling IsConstant,
19875 because it effectively performs the lookup twice.
19877 2002-11-06 Miguel de Icaza <miguel@ximian.com>
19879 But a bogus return here to keep the semantics of the old code
19880 until the Mono runtime is fixed.
19882 * pending.cs (GetMissingInterfaces): New method used to remove all
19883 the interfaces that are already implemented by our parent
19884 classes from the list of pending methods.
19886 * interface.cs: Add checks for calls after ResolveTypeExpr.
19888 2002-11-05 Miguel de Icaza <miguel@ximian.com>
19890 * class.cs (Class.Emit): Report warning 67: event not used if the
19891 warning level is beyond 3.
19893 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
19894 being a NullLiteral.
19896 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
19899 * class.cs (TypeContainer.GetClassBases): Cover a missing code
19900 path that might fail if a type can not be resolved.
19902 * expression.cs (Binary.Emit): Emit unsigned versions of the
19905 * driver.cs: use error 5.
19907 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
19909 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
19911 2002-11-01 Miguel de Icaza <miguel@ximian.com>
19913 * cs-parser.jay (switch_section): A beautiful patch from Martin
19914 Baulig that fixed 33094.
19916 2002-10-31 Miguel de Icaza <miguel@ximian.com>
19918 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
19919 Check whether the base is abstract and report an error if so.
19921 * expression.cs (IndexerAccess.DoResolveLValue,
19922 IndexerAccess.DoResolve): ditto.
19924 (Invocation.DoResolve): ditto.
19926 (Invocation.FullMethodDesc): Improve the report string.
19928 * statement.cs (Block): Eliminate IsVariableDefined as it is
19929 basically just a wrapper for GetVariableInfo.
19931 * ecore.cs (SimpleName): Use new
19933 * support.cs (ReflectionParamter.ParameterType): We unwrap the
19934 type, as we return the actual parameter ref/unref state on a
19937 2002-10-30 Miguel de Icaza <miguel@ximian.com>
19939 * support.cs: Return proper flags REF/OUT fixing the previous
19942 * expression.cs: Reverted last patch, that was wrong. Is_ref is
19943 not used to mean `ref' but `ref or out' in ParameterReference
19945 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
19946 full type signature instead of calling TypeManger.CSharpName
19949 * support.cs (InternalParameters.ParameterDesc): Do not compare
19950 directly to the modflags, because REF/OUT will actually be bitsets
19953 * delegate.cs (VerifyMethod): Check also the modifiers.
19955 * cs-tokenizer.cs: Fix bug where floating point values with an
19956 exponent where a sign was missing was ignored.
19958 * driver.cs: Allow multiple assemblies to be specified in a single
19961 2002-10-28 Miguel de Icaza <miguel@ximian.com>
19963 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
19964 because identifiers after a parenthesis would end up in this kind
19965 of production, and we needed to desamiguate it for having casts
19968 (UserDefinedType *) xxx
19970 2002-10-24 Miguel de Icaza <miguel@ximian.com>
19972 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
19973 we should set on the Bindingflags.NonPublic, but not turn on
19974 private_ok. private_ok controls whether a Private member is
19975 returned (this is chekced on the filter routine), while the
19976 BindingFlags.NonPublic just controls whether private/protected
19977 will be allowed. This fixes the problem part of the problem of
19978 private properties being allowed to be used in derived classes.
19980 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
19981 so we can call the children DoResolveLValue method (this will
19982 properly signal errors on lvalue assignments to base properties)
19984 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
19985 getter are null, and we have a property info, we know that this
19986 happened because the lookup failed, so we report an error 122 for
19987 protection level violation.
19989 We also silently return if setter and getter are null in the
19990 resolve functions, this condition only happens if we have flagged
19991 the error before. This is the other half of the problem.
19993 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
19994 not have accessibility information, that is why we were returning
19995 true in the filter function in typemanager.cs.
19997 To properly report 122 (property is inaccessible because of its
19998 protection level) correctly, we report this error in ResolveAccess
19999 by failing if both the setter and the getter are lacking (ie, the
20002 DoResolve and DoLResolve have been modified to check for both
20003 setter/getter being null and returning silently, the reason being
20004 that I did not want to put the knowledge about this error in upper
20007 int old = Report.Errors;
20008 x = new PropertyExpr (...);
20009 if (old != Report.Errors)
20014 So the property expr is returned, but it is invalid, so the error
20015 will be flagged during the resolve process.
20017 * class.cs: Remove InheritablePropertySignatureCompare from the
20018 class, as we no longer depend on the property signature to compute
20019 whether it is possible to implement a method or not.
20021 The reason is that calling PropertyInfo.GetGetMethod will return
20022 null (in .NET, in Mono it works, and we should change this), in
20023 cases where the Get Method does not exist in that particular
20028 class X { public virtual int A { get { return 1; } } }
20030 class Z : Y { public override int A { get { return 2; } } }
20032 Would fail in Z because the parent (Y) would not have the property
20033 defined. So we avoid this completely now (because the alternative
20034 fix was ugly and slow), and we now depend exclusively on the
20037 (PropertyBase.CheckBase): Use a method-base mechanism to find our
20038 reference method, instead of using the property.
20040 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
20041 routines are gone now.
20043 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
20044 names, they were incorrectly named.
20046 * cs-tokenizer.cs: Return are more gentle token on failure.
20048 * pending.cs (PendingImplementation.InterfaceMethod): This routine
20049 had an out-of-sync index variable, which caused it to remove from
20050 the list of pending methods the wrong method sometimes.
20052 2002-10-22 Miguel de Icaza <miguel@ximian.com>
20054 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
20055 CanWrite, because those refer to this particular instance of the
20056 property, and do not take into account the fact that we can
20057 override single members of a property.
20059 Constructor requires an EmitContext. The resolution process does
20060 not happen here, but we need to compute the accessors before,
20061 because the resolution does not always happen for properties.
20063 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
20064 subclass, before we did not update this flag, but we did update
20067 (GetAccessors): Drop this routine, as it did not work in the
20068 presence of partially overwritten set/get methods.
20070 Notice that this broke the cs1540 detection, but that will require
20073 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20077 * driver.cs: issue a warning instead of an error if we don't support
20078 debugging for the platform. Also ignore a couple of errors that may
20079 arise when trying to write the symbols. Undo my previous patch.
20081 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20083 * driver.cs: ignore /debug switch except for Unix platforms.
20085 2002-10-23 Nick Drochak <ndrochak@gol.com>
20087 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
20089 2002-10-21 Miguel de Icaza <miguel@ximian.com>
20091 * driver.cs: Do not make mcs-debug conditional, so we do not break
20092 builds that use it.
20094 * statement.cs (UsageVector.MergeChildren): I would like Martin to
20095 review this patch. But basically after all the children variables
20096 have been merged, the value of "Breaks" was not being set to
20097 new_breaks for Switch blocks. I think that it should be set after
20098 it has executed. Currently I set this to the value of new_breaks,
20099 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
20100 conservative, but I do not understand this code very well.
20102 I did not break anything in the build, so that is good ;-)
20104 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
20106 2002-10-20 Mark Crichton <crichton@gimp.org>
20108 * cfold.cs: Fixed compile blocker. Really fixed it this time.
20110 2002-10-20 Nick Drochak <ndrochak@gol.com>
20112 * cfold.cs: Fixed compile blocker.
20114 2002-10-20 Miguel de Icaza <miguel@ximian.com>
20116 * driver.cs: I was chekcing the key, not the file.
20118 2002-10-19 Ravi Pratap <ravi@ximian.com>
20120 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
20121 message that we were generating - we just need to silently return
20124 2002-10-19 Miguel de Icaza <miguel@ximian.com>
20126 * class.cs (Event.Define): Change my previous commit, as this
20127 breaks the debugger. This is a temporary hack, as it seems like
20128 the compiler is generating events incorrectly to begin with.
20130 * expression.cs (Binary.ResolveOperator): Added support for
20131 "U operator - (E x, E y)"
20133 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
20136 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
20137 init-only variables, but this path did not take into account that
20138 there might be also instance readonly variables. Correct this
20141 This fixes bug 32253
20143 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
20146 * driver.cs: Change the extension for modules to `netmodule'
20148 * cs-parser.jay: Improved slightly the location tracking for
20149 the debugger symbols.
20151 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
20152 modifiers that were specified instead of the hardcoded value
20153 (FamAndAssem). This was basically ignoring the static modifier,
20154 and others. Fixes 32429.
20156 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
20157 fixed a bug in the process (32476)
20159 * expression.cs (ArrayAccess.EmitAssign): Patch from
20160 hwang_rob@yahoo.ca that fixes bug 31834.3
20162 2002-10-18 Miguel de Icaza <miguel@ximian.com>
20164 * driver.cs: Make the module extension .netmodule.
20166 2002-10-16 Miguel de Icaza <miguel@ximian.com>
20168 * driver.cs: Report an error if the resource file is not found
20169 instead of crashing.
20171 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
20172 false, like Emit does.
20174 2002-10-16 Nick Drochak <ndrochak@gol.com>
20176 * typemanager.cs: Remove unused private member. Also reported mcs
20177 bug to report this as a warning like csc.
20179 2002-10-15 Martin Baulig <martin@gnome.org>
20181 * statement.cs (Statement.Emit): Made this a virtual method; emits
20182 the line number info and calls DoEmit().
20183 (Statement.DoEmit): New protected abstract method, formerly knows
20184 as Statement.Emit().
20186 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
20188 2002-10-11 Miguel de Icaza <miguel@ximian.com>
20190 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
20191 have fixed a remaining problem: not every AddXXXX was adding a
20192 fully qualified name.
20194 Now everyone registers a fully qualified name in the DeclSpace as
20195 being defined instead of the partial name.
20197 Downsides: we are slower than we need to be due to the excess
20198 copies and the names being registered this way.
20200 The reason for this is that we currently depend (on the corlib
20201 bootstrap for instance) that types are fully qualified, because
20202 we dump all the types in the namespace, and we should really have
20203 types inserted into the proper namespace, so we can only store the
20204 basenames in the defined_names array.
20206 2002-10-10 Martin Baulig <martin@gnome.org>
20208 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
20209 from bug #31834, see the bug report for a testcase which is
20212 2002-10-10 Martin Baulig <martin@gnome.org>
20214 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
20215 flow analysis code for this.
20217 * statement.cs (Do, While, For): Tell the flow analysis code about
20219 (FlowBranching.UsageVector): Added support for infinite loops.
20220 (Block.Resolve): Moved the dead code elimination here and use flow
20223 2002-10-09 Miguel de Icaza <miguel@ximian.com>
20225 * class.cs (Field.Define): Catch cycles on struct type
20228 * typemanager.cs (IsUnmanagedtype): Do not recursively check
20229 fields if the fields are static. We only need to check instance
20232 * expression.cs (As.DoResolve): Test for reference type.
20234 * statement.cs (Using.ResolveExpression): Use
20235 ConvertImplicitRequired, not ConvertImplicit which reports an
20237 (Using.ResolveLocalVariableDecls): ditto.
20239 * expression.cs (Binary.ResolveOperator): Report errors in a few
20240 places where we had to.
20242 * typemanager.cs (IsUnmanagedtype): Finish implementation.
20244 2002-10-08 Miguel de Icaza <miguel@ximian.com>
20246 * expression.cs: Use StoreFromPtr instead of extracting the type
20247 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
20249 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
20250 an enumeration value to a System.Enum, but System.Enum is not a
20251 value type, but an class type, so we need to box.
20253 (Expression.ConvertExplicit): One codepath could return
20254 errors but not flag them. Fix this. Fixes #31853
20256 * parameter.cs (Resolve): Do not allow void as a parameter type.
20258 2002-10-06 Martin Baulig <martin@gnome.org>
20260 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
20261 if it's a class type and not a struct. Fixes #31815.
20263 2002-10-06 Martin Baulig <martin@gnome.org>
20265 * statement.cs: Reworked the flow analysis code a bit to make it
20266 usable for dead code elimination.
20268 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20270 * cs-parser.jay: allow empty source files. Fixes bug #31781.
20272 2002-10-04 Miguel de Icaza <miguel@ximian.com>
20274 * expression.cs (ComposedCast.DoResolveType): A quick workaround
20275 to fix the test 165, will investigate deeper.
20277 2002-10-04 Martin Baulig <martin@gnome.org>
20279 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
20280 finally blocks actually work.
20281 (Try.Resolve): We don't need to create a sibling for `finally' if
20282 there is no finally block.
20284 2002-10-04 Martin Baulig <martin@gnome.org>
20286 * class.cs (Constructor.Define): The default accessibility for a
20287 non-default constructor is private, not public.
20289 2002-10-04 Miguel de Icaza <miguel@ximian.com>
20291 * class.cs (Constructor): Make AllowedModifiers public, add
20294 * cs-parser.jay: Perform the modifiers test here, as the
20295 constructor for the Constructor class usually receives a zero
20296 because of the way we create it (first we create, later we
20297 customize, and we were never checking the modifiers).
20299 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
20300 is a version of LookupTypeReflection that includes the type-name
20301 cache. This can be used as a fast path for functions that know
20302 the fully qualified name and are only calling into *.GetType() to
20303 obtain a composed type.
20305 This is also used by TypeManager.LookupType during its type
20308 (LookupType): We now also track the real type name, as sometimes
20309 we can get a quey for the real type name from things like
20310 ComposedCast. This fixes bug 31422.
20312 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
20313 complete type fullname, it does not have to go through the type
20314 resolution system to obtain the composed version of the type (for
20315 obtaining arrays or pointers).
20317 (Conditional.Emit): Use the EmitBoolExpression to
20318 generate nicer code, as requested by Paolo.
20320 (ArrayCreation.CheckIndices): Use the patch from
20321 hwang_rob@yahoo.ca to validate the array initializers.
20323 2002-10-03 Miguel de Icaza <miguel@ximian.com>
20325 * class.cs (ConstructorInitializer.Emit): simplify code by using
20326 Invocation.EmitCall, and at the same time, fix the bugs in calling
20327 parent constructors that took variable arguments.
20329 * ecore.cs (Expression.ConvertNumericExplicit,
20330 Expression.ImplicitNumericConversion): Remove the code that
20331 manually wrapped decimal (InternalTypeConstructor call is now gone
20334 * expression.cs (Cast.TryReduce): Also handle decimal types when
20335 trying to perform a constant fold on the type.
20337 * typemanager.cs (IsUnmanagedtype): Partially implemented.
20339 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
20340 that only turned off an error report, and did nothing else.
20342 2002-10-02 Miguel de Icaza <miguel@ximian.com>
20344 * driver.cs: Handle and ignore /fullpaths
20346 2002-10-01 Miguel de Icaza <miguel@ximian.com>
20348 * expression.cs (Binary.ResolveOperator): Catch the case where
20349 DoNumericPromotions returns true,
20351 (Binary.DoNumericPromotions): Simplify the code, and the tests.
20353 2002-09-27 Miguel de Icaza <miguel@ximian.com>
20355 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
20358 2002-09-26 Miguel de Icaza <miguel@ximian.com>
20360 * ecore.cs (ConvertNumericExplicit): It is not enough that the
20361 conversion exists, but it is also required that the conversion be
20362 performed. This manifested in "(Type64Enum) 2".
20364 * class.cs (TypeManager.AddMethod): The fix is not to change
20365 AddEnum, because that one was using a fully qualified name (every
20366 DeclSpace derivative does), but to change the AddMethod routine
20367 that was using an un-namespaced name. This now correctly reports
20368 the duplicated name.
20370 Revert patch until I can properly fix it. The issue
20371 is that we have a shared Type space across all namespaces
20372 currently, which is wrong.
20374 Options include making the Namespace a DeclSpace, and merge
20375 current_namespace/current_container in the parser.
20377 2002-09-25 Miguel de Icaza <miguel@ximian.com>
20379 * cs-parser.jay: Improve error reporting when we get a different
20380 kind of expression in local_variable_type and
20381 local_variable_pointer_type.
20383 Propagate this to avoid missleading errors being reported.
20385 * ecore.cs (ImplicitReferenceConversion): treat
20386 TypeManager.value_type as a target just like object_type. As
20391 Is valid, and needs to result in the int 1 being boxed before it
20392 is assigned to the value type v.
20394 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
20395 to validate the enumeration name.
20397 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
20398 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
20399 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
20401 * ecore.cs (TryImplicitIntConversion): When doing an
20402 implicit-enumeration-conversion, check if the type is 64-bits and
20403 perform a conversion before passing to EnumConstant.
20405 2002-09-23 Miguel de Icaza <miguel@ximian.com>
20407 * decl.cs (Error_AmbiguousTypeReference); New routine used to
20408 report ambiguous type references. Unlike the MS version, we
20409 report what the ambiguity is. Innovation at work ;-)
20411 (DeclSpace.FindType): Require a location argument to
20412 display when we display an ambiguous error.
20414 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
20416 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
20418 * expression.cs (EmitDynamicInitializers): Apply patch from
20419 hwang_rob@yahoo.ca that fixes the order in which we emit our
20422 2002-09-21 Martin Baulig <martin@gnome.org>
20424 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
20425 delegate takes no arguments.
20427 2002-09-20 Miguel de Icaza <miguel@ximian.com>
20429 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
20432 * expression.cs: Extract the underlying type.
20434 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
20436 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
20438 2002-09-19 Miguel de Icaza <miguel@ximian.com>
20440 * class.cs (TypeContainer.DefineType): We can not use the nice
20441 PackingSize with the size set to 1 DefineType method, because it
20442 will not allow us to define the interfaces that the struct
20445 This completes the fixing of bug 27287
20447 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
20448 means also structs. This fixes part of the problem.
20449 (Expresion.ImplicitReferenceConversionExists): ditto.
20451 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
20452 error if there were no errors reported during the type lookup
20453 process, to avoid duplicates or redundant errors. Without this
20454 you would get an ambiguous errors plus a type not found. We have
20455 beaten the user enough with the first error.
20457 (DeclSparce.FindType): Emit a warning if we have an ambiguous
20460 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
20461 during the resolution process, stop the lookup, this avoids
20462 repeated error reports (same error twice).
20464 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
20466 * typemanager.cs (LookupType): Redo the type lookup code to match
20467 the needs of System.Reflection.
20469 The issue is that System.Reflection requires references to nested
20470 types to begin with a "+" sign instead of a dot. So toplevel
20471 types look like: "NameSpace.TopLevelClass", and nested ones look
20472 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
20475 2002-09-19 Martin Baulig <martin@gnome.org>
20477 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
20478 says that a method always returns or always throws an exception,
20479 don't report the CS0161.
20481 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
20482 set `Returns = new_returns'.
20484 2002-09-19 Martin Baulig <martin@gnome.org>
20486 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
20487 to an enum constant, check for a CS0176.
20489 2002-09-18 Miguel de Icaza <miguel@ximian.com>
20491 * class.cs (TypeContainer.CheckPairedOperators): Now we check
20492 for operators that must be in pairs and report errors.
20494 * ecore.cs (SimpleName.DoResolveType): During the initial type
20495 resolution process, when we define types recursively, we must
20496 check first for types in our current scope before we perform
20497 lookups in the enclosing scopes.
20499 * expression.cs (MakeByteBlob): Handle Decimal blobs.
20501 (Invocation.VerifyArgumentsCompat): Call
20502 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
20503 I thought we were supposed to always call this, but there are a
20504 few places in the code where we dont do it.
20506 2002-09-17 Miguel de Icaza <miguel@ximian.com>
20508 * driver.cs: Add support in -linkres and -resource to specify the
20509 name of the identifier.
20511 2002-09-16 Miguel de Icaza <miguel@ximian.com>
20513 * ecore.cs (StandardConversionExists): Sync with the conversion
20514 code: allow anything-* to void* conversions.
20516 (FindMostSpecificSource): Use an Expression argument
20517 instead of a Type, because we might be handed over a Literal which
20518 gets a few more implicit conversions that plain types do not. So
20519 this information was being lost.
20521 Also, we drop the temporary type-holder expression when not
20524 2002-09-17 Martin Baulig <martin@gnome.org>
20526 * class.cs (PropertyBase.CheckBase): Don't check the base class if
20527 this is an explicit interface implementation.
20529 2002-09-17 Martin Baulig <martin@gnome.org>
20531 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
20532 different `IndexerName' attributes.
20534 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
20535 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
20536 virtual CommonResolve().
20538 2002-09-16 Miguel de Icaza <miguel@ximian.com>
20540 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
20541 and convert that to the UnderlyingType.
20543 * statement.cs (Foreach.Resolve): Indexers are just like variables
20544 or PropertyAccesses.
20546 * cs-tokenizer.cs (consume_string): Track line numbers and columns
20547 inside quoted strings, we were not doing this before.
20549 2002-09-16 Martin Baulig <martin@gnome.org>
20551 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
20552 resolve it. This is needed for the definite assignment check of the
20553 instance expression, fixes bug #29846.
20554 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
20556 2002-09-16 Nick Drochak <ndrochak@gol.com>
20558 * parameter.cs: Fix compile error. Cannot reference static member
20559 from an instance object. Is this an mcs bug?
20561 2002-09-14 Martin Baulig <martin@gnome.org>
20563 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
20564 multiple times. Fixes bug #30295, added test-166.cs.
20566 2002-09-14 Martin Baulig <martin@gnome.org>
20568 * statement.cs (Block.Emit): Don't emit unreachable code.
20569 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
20570 `break' statements.
20571 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
20573 2002-09-14 Martin Baulig <martin@gnome.org>
20575 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
20578 2002-09-14 Martin Baulig <martin@gnome.org>
20580 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
20581 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
20582 be false on the ms runtime.
20584 2002-09-13 Martin Baulig <martin@gnome.org>
20586 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
20587 the CS0038 error message.
20589 2002-09-12 Miguel de Icaza <miguel@ximian.com>
20591 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
20592 constant inside, return it.
20594 2002-09-12 Martin Baulig <martin@gnome.org>
20596 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
20597 implicit conversion can be done between enum types.
20599 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
20600 check whether an implicit conversion to the current enum's UnderlyingType
20601 exists and report an error if not.
20603 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
20604 without debugging support.
20606 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
20607 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
20609 2002-09-12 Martin Baulig <martin@gnome.org>
20611 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
20613 * ecore.cs (IMemberExpr.DeclaringType): New property.
20614 (SimpleName.SimpleNameResolve): Check whether we're accessing a
20615 nonstatic member of an outer type (CS0038).
20617 2002-09-11 Miguel de Icaza <miguel@ximian.com>
20619 * driver.cs: Activate the using-error detector at warning level
20620 4 (at least for MS-compatible APIs).
20622 * namespace.cs (VerifyUsing): Small buglett fix.
20624 * pending.cs (PendingImplementation): pass the container pointer.
20626 * interface.cs (GetMethods): Allow for recursive definition. Long
20627 term, I would like to move every type to support recursive
20628 definitions, not the current ordering mechanism that we have right
20631 The situation is this: Attributes are handled before interfaces,
20632 so we can apply attributes to interfaces. But some attributes
20633 implement interfaces, we will now handle the simple cases
20634 (recursive definitions will just get an error).
20636 * parameter.cs: Only invalidate types at the end if we fail to
20639 2002-09-09 Martin Baulig <martin@gnome.org>
20641 * ecore.cs (PropertyExpr.Emit): Also check for
20642 TypeManager.system_int_array_get_length so this'll also work when
20643 compiling corlib. Fixes #30003.
20645 2002-09-09 Martin Baulig <martin@gnome.org>
20647 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
20648 and throw an exception if we can't get the type's size. Fixed #30040,
20651 2002-09-09 Martin Baulig <martin@gnome.org>
20653 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
20655 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
20656 context. Fixes bug #30027.
20658 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
20659 virtual functions. Fixes bug #30043, added test-164.cs.
20661 2002-09-08 Ravi Pratap <ravi@ximian.com>
20663 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
20665 2002-09-08 Nick Drochak <ndrochak@gol.com>
20667 * driver.cs: Use an object to get the windows codepage since it's not a
20670 2002-09-08 Miguel de Icaza <miguel@ximian.com>
20672 * statement.cs (For.Emit): for infinite loops (test == null)
20673 return whether there is a break inside, not always "true".
20675 * namespace.cs (UsingEntry): New struct to hold the name of the
20676 using definition, the location where it is defined, and whether it
20677 has been used in a successful type lookup.
20679 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
20684 2002-09-06 Ravi Pratap <ravi@ximian.com>
20686 * attribute.cs : Fix incorrect code which relied on catching
20687 a NullReferenceException to detect a null being passed in
20688 where an object was expected.
20690 2002-09-06 Miguel de Icaza <miguel@ximian.com>
20692 * statement.cs (Try): flag the catch variable as assigned
20694 * expression.cs (Cast): Simplified by using ResolveType instead of
20695 manually resolving.
20697 * statement.cs (Catch): Fix bug by using ResolveType.
20699 2002-09-06 Ravi Pratap <ravi@ximian.com>
20701 * expression.cs (BetterConversion): Special case for when we have
20702 a NullLiteral as the argument and we have to choose between string
20703 and object types - we choose string the way csc does.
20705 * attribute.cs (Attribute.Resolve): Catch the
20706 NullReferenceException and report error #182 since the Mono
20707 runtime no more has the bug and having this exception raised means
20708 we tried to select a constructor which takes an object and is
20711 2002-09-05 Ravi Pratap <ravi@ximian.com>
20713 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
20714 message (1502, 1503) when we can't locate a method after overload
20715 resolution. This is much more informative and closes the bug
20718 * interface.cs (PopulateMethod): Return if there are no argument
20719 types. Fixes a NullReferenceException bug.
20721 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
20722 expressions too. Previously we were checking only in one place for
20723 positional arguments leaving out named arguments.
20725 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
20726 type to the enum type is not allowed. Remove code corresponding to
20729 (ConvertNumericExplicit): Allow explicit conversions from
20730 the underlying type to enum type. This precisely follows the spec
20731 and closes a bug filed by Gonzalo.
20733 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20736 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
20738 2002-09-03 Miguel de Icaza <miguel@ximian.com>
20740 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
20741 it was important that we stored the right value after the
20742 reduction in `converted'.
20744 2002-09-04 Martin Baulig <martin@gnome.org>
20746 * location.cs (Location.SymbolDocument): Use full pathnames for the
20749 2002-08-30 Miguel de Icaza <miguel@ximian.com>
20751 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
20752 of the expression resolve mechanism, because that will catch the
20753 SimpleName error failures.
20755 (Conditional): If we can not resolve the
20756 expression, return, do not crash.
20758 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20761 (location): display token name instead of its number.
20763 2002-08-28 Martin Baulig <martin@gnome.org>
20765 * expression.cs (Binary.ResolveOperator): Don't silently return
20766 but return an error if an operator cannot be applied between two
20769 2002-08-28 Martin Baulig <martin@gnome.org>
20771 * class.cs (Constructor.Define): Set the permission attributes
20772 correctly instead of making all constructors public.
20774 2002-08-28 Martin Baulig <martin@gnome.org>
20776 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
20777 for private members before reporting a CS0103; if we find anything,
20780 2002-08-28 Martin Baulig <martin@gnome.org>
20782 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
20783 to check whether `closure_start_type == closure_invocation_type',
20784 we also need to check whether `m.DeclaringType == closure_invocation_type'
20785 before bypassing the permission checks. We might be accessing
20786 protected/private members from the base class.
20787 (TypeManager.RealMemberLookup): Only set private_ok if private
20788 members were requested via BindingFlags.NonPublic.
20790 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
20792 * expression.cs (MemberAccess.ResolveMemberAccess): Set
20793 MethodGroupExpr.IsExplicitImpl if appropriate.
20794 (Invocation.DoResolve): Don't report the CS0120 for explicit
20795 interface implementations.
20797 2002-08-27 Martin Baulig <martin@gnome.org>
20799 * expression.cs (Invocation.DoResolve): If this is a static
20800 method and we don't have an InstanceExpression, we must report
20803 2002-08-25 Martin Baulig <martin@gnome.org>
20805 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
20806 `==' between a valuetype and an object.
20808 2002-08-25 Miguel de Icaza <miguel@ximian.com>
20810 * ecore.cs (TypeExpr): Provide a ToString method.
20812 2002-08-24 Martin Baulig <martin@gnome.org>
20814 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
20815 now called proggie.dbg and it's a binary file.
20817 2002-08-23 Martin Baulig <martin@gnome.org>
20819 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
20821 2002-08-23 Martin Baulig <martin@gnome.org>
20823 * struct.cs (MyStructInfo.ctor): Make this work with empty
20824 structs; it's not allowed to use foreach() on null.
20826 2002-08-23 Martin Baulig <martin@gnome.org>
20828 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
20829 writer the full pathname of the generated assembly.
20831 2002-08-23 Martin Baulig <martin@gnome.org>
20833 * statements.cs (FlowBranching.UsageVector.MergeChildren):
20834 A `finally' block never returns or breaks; improved handling of
20837 2002-08-23 Martin Baulig <martin@gnome.org>
20839 * statement.cs (Throw.Resolve): Allow `throw null'.
20841 2002-08-23 Martin Baulig <martin@gnome.org>
20843 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
20844 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
20845 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
20846 MemberLookup would return a wrong event if this is an explicit
20847 interface implementation and the class has an event with the same
20850 2002-08-23 Martin Baulig <martin@gnome.org>
20852 * statement.cs (Block.AddChildVariableNames): New public method.
20853 (Block.AddChildVariableName): Likewise.
20854 (Block.IsVariableNameUsedInChildBlock): Likewise.
20855 (Block.AddVariable): Check whether a variable name has already
20856 been used in a child block.
20858 * cs-parser.jay (declare_local_variables): Mark all variable names
20859 from the current block as being used in a child block in the
20862 2002-08-23 Martin Baulig <martin@gnome.org>
20864 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
20865 find the symbol writer.
20867 * driver.cs: csc also allows the arguments to /define being
20868 separated by commas, not only by semicolons.
20870 2002-08-23 Martin Baulig <martin@gnome.org>
20872 * interface.cs (Interface.GetMembers): Added static check for events.
20874 2002-08-15 Martin Baulig <martin@gnome.org>
20876 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
20877 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
20879 * ecore.cs (Expression.MemberLookup): Added documentation and explained
20880 why the MethodData.EmitDestructor() change was necessary.
20882 2002-08-20 Martin Baulig <martin@gnome.org>
20884 * class.cs (TypeContainer.FindMembers): Added static check for events.
20886 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
20888 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
20889 use Type.GetEvents(), not Type.FindMembers().
20891 2002-08-20 Martin Baulig <martin@gnome.org>
20893 * decl.cs (MemberCache): Added a special method cache which will
20894 be used for method-only searched. This ensures that a method
20895 search will return a MethodInfo with the correct ReflectedType for
20898 2002-08-20 Martin Baulig <martin@gnome.org>
20900 * decl.cs (DeclSpace.FindMembers): Made this public.
20902 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20904 * delegate.cs: fixed build on windows.
20905 [FIXME: Filed as bug #29150: MCS must report these errors.]
20907 2002-08-19 Ravi Pratap <ravi@ximian.com>
20909 * ecore.cs (StandardConversionExists): Return a false
20910 if we are trying to convert the void type to anything else
20911 since that is not allowed.
20913 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
20914 we flag error 70 in the event an event is trying to be accessed
20915 directly from outside the declaring type.
20917 2002-08-20 Martin Baulig <martin@gnome.org>
20919 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
20920 MemberCache from typemanager.cs to decl.cs.
20922 2002-08-19 Martin Baulig <martin@gnome.org>
20924 * class.cs (TypeContainer): Implement IMemberContainer.
20925 (TypeContainer.DefineMembers): Create the MemberCache.
20926 (TypeContainer.FindMembers): Do better BindingFlags checking; only
20927 return public members if BindingFlags.Public was given, check
20928 whether members are static.
20930 2002-08-16 Martin Baulig <martin@gnome.org>
20932 * decl.cs (DeclSpace.Define): Splitted this in Define and
20933 DefineMembers. DefineMembers is called first and initializes the
20936 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
20937 DefineMembers() on all our DeclSpaces.
20939 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
20940 but call DefineMembers() on all nested interfaces. We call their
20941 Define() in our new Define() function.
20943 * interface.cs (Interface): Implement IMemberContainer.
20944 (Interface.Define): Moved all code except the attribute stuf to
20946 (Interface.DefineMembers): Initialize the member cache.
20948 * typemanager.cs (IMemberFinder): Removed this interface, we don't
20949 need this anymore since we can use MemberCache.FindMembers directly.
20951 2002-08-19 Martin Baulig <martin@gnome.org>
20953 * typemanager.cs (MemberCache): When creating the cache for an
20954 interface type, add all inherited members.
20955 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
20956 to `out bool used_cache' and documented it.
20957 (TypeManager.MemberLookup): If we already used the cache in the first
20958 iteration, we don't need to do the interfaces check.
20960 2002-08-19 Martin Baulig <martin@gnome.org>
20962 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
20963 here from IMemberFinder and don't implement this interface anymore.
20964 (DeclSpace.MemberCache): Moved here from IMemberFinder.
20966 * typemanager.cs (IMemberFinder): This interface is now only used by
20967 classes which actually support the member cache.
20968 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
20969 since we only put DeclSpaces into this Hashtable.
20970 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
20971 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
20973 2002-08-16 Martin Baulig <martin@gnome.org>
20975 * typemanager.cs (ICachingMemberFinder): Removed.
20976 (IMemberFinder.MemberCache): New property.
20977 (TypeManager.FindMembers): Merged this with RealFindMembers().
20978 This function will never be called from TypeManager.MemberLookup()
20979 so we can't use the cache here, just the IMemberFinder.
20980 (TypeManager.MemberLookup_FindMembers): Check whether the
20981 IMemberFinder has a MemberCache and call the cache's FindMembers
20983 (MemberCache): Rewrote larger parts of this yet another time and
20984 cleaned it up a bit.
20986 2002-08-15 Miguel de Icaza <miguel@ximian.com>
20988 * driver.cs (LoadArgs): Support quoting.
20990 (Usage): Show the CSC-like command line arguments.
20992 Improved a few error messages.
20994 2002-08-15 Martin Baulig <martin@gnome.org>
20996 * typemanager.cs (IMemberContainer.Type): New property.
20997 (IMemberContainer.IsInterface): New property.
20999 The following changes are conditional to BROKEN_RUNTIME, which is
21000 defined at the top of the file.
21002 * typemanager.cs (MemberCache.MemberCache): Don't add the base
21003 class'es members, but add all members from TypeHandle.ObjectType
21004 if we're an interface.
21005 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
21006 is the current type.
21007 (MemberCache.CacheEntry.Container): Removed this field.
21008 (TypeHandle.GetMembers): Include inherited members.
21010 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21012 * typemanager.cs: fixed compilation and added a comment on a field that
21015 2002-08-15 Martin Baulig <martin@gnome.org>
21017 * class.cs (ConstructorInitializer.Resolve): In the
21018 Expression.MemberLookup call, use the queried_type as
21021 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
21022 declared' attribute, it's always true.
21023 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
21024 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
21025 temporary wrapper for FindMembers which tells MemberLookup whether
21026 members from the base classes are included in the return value.
21027 This will go away soon.
21028 (TypeManager.MemberLookup): Use this temporary hack here; once the
21029 new MemberCache is completed, we don't need to do the DeclaredOnly
21030 looping here anymore since the MemberCache will take care of this.
21031 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
21032 (MemberCache): When creating the MemberCache for a class, get
21033 members from the current class and all its base classes.
21034 (MemberCache.CacheEntry.Container): New field. This is a
21035 temporary hack until the Mono runtime is fixed to distinguish
21036 between ReflectedType and DeclaringType. It allows us to use MCS
21037 with both the MS runtime and the unfixed Mono runtime without
21038 problems and without accecting performance.
21039 (MemberCache.SearchMembers): The DeclaredOnly looping from
21040 TypeManager.MemberLookup is now done here.
21042 2002-08-14 Martin Baulig <martin@gnome.org>
21044 * statement.cs (MyStructInfo.MyStructInfo): Don't call
21045 Type.GetFields on dynamic types but get the fields from the
21046 corresponding TypeContainer.
21047 (MyStructInfo.GetStructInfo): Added check for enum types.
21049 * typemanager.cs (MemberList.IsSynchronized): Implemented.
21050 (MemberList.SyncRoot): Implemented.
21051 (TypeManager.FilterWithClosure): No need to check permissions if
21052 closure_start_type == closure_invocation_type, don't crash if
21053 closure_invocation_type is null.
21055 2002-08-13 Martin Baulig <martin@gnome.org>
21057 Rewrote TypeContainer.FindMembers to use a member cache. This
21058 gives us a speed increase of about 35% for the self-hosting MCS
21059 build and of about 15-20% for the class libs (both on GNU/Linux).
21061 * report.cs (Timer): New class to get enhanced profiling. This
21062 whole class is "TIMER" conditional since it remarkably slows down
21065 * class.cs (MemberList): New class. This is an IList wrapper
21066 which we're now using instead of passing MemberInfo[]'s around to
21067 avoid copying this array unnecessarily.
21068 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
21069 (ICachingMemberFinder, IMemberContainer): New interface.
21070 (TypeManager.FilterWithClosure): If `criteria' is null, the name
21071 has already been checked, otherwise use it for the name comparision.
21072 (TypeManager.FindMembers): Renamed to RealMemberFinder and
21073 provided wrapper which tries to use ICachingMemberFinder.FindMembers
21074 if possible. Returns a MemberList, not a MemberInfo [].
21075 (TypeHandle): New class, implements IMemberContainer. We create
21076 one instance of this class per type, it contains a MemberCache
21077 which is used to do the member lookups.
21078 (MemberCache): New class. Each instance of this class contains
21079 all members of a type and a name-based hash table.
21080 (MemberCache.FindMembers): This is our new member lookup
21081 function. First, it looks up all members of the requested name in
21082 the hash table. Then, it walks this list and sorts out all
21083 applicable members and returns them.
21085 2002-08-13 Martin Baulig <martin@gnome.org>
21087 In addition to a nice code cleanup, this gives us a performance
21088 increase of about 1.4% on GNU/Linux - not much, but it's already
21089 half a second for the self-hosting MCS compilation.
21091 * typemanager.cs (IMemberFinder): New interface. It is used by
21092 TypeManager.FindMembers to call FindMembers on a TypeContainer,
21093 Enum, Delegate or Interface.
21094 (TypeManager.finder_to_member_finder): New PtrHashtable.
21095 (TypeManager.finder_to_container): Removed.
21096 (TypeManager.finder_to_delegate): Removed.
21097 (TypeManager.finder_to_interface): Removed.
21098 (TypeManager.finder_to_enum): Removed.
21100 * interface.cs (Interface): Implement IMemberFinder.
21102 * delegate.cs (Delegate): Implement IMemberFinder.
21104 * enum.cs (Enum): Implement IMemberFinder.
21106 * class.cs (TypeContainer): Implement IMemberFinder.
21108 2002-08-12 Martin Baulig <martin@gnome.org>
21110 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
21112 2002-08-12 Martin Baulig <martin@gnome.org>
21114 * ecore.cs (ITypeExpression): New interface for expressions which
21116 (TypeExpression): Renamed to TypeLookupExpression.
21117 (Expression.DoResolve): If we're doing a types-only lookup, the
21118 expression must implement the ITypeExpression interface and we
21119 call DoResolveType() on it.
21120 (SimpleName): Implement the new ITypeExpression interface.
21121 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
21122 hack, the situation that we're only looking up types can't happen
21123 anymore when this method is called. Moved the type lookup code to
21124 DoResolveType() and call it.
21125 (SimpleName.DoResolveType): This ITypeExpression interface method
21126 is now doing the types-only lookup.
21127 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
21128 (ResolveFlags): Added MaskExprClass.
21130 * expression.cs (MemberAccess): Implement the ITypeExpression
21132 (MemberAccess.DoResolve): Added support for a types-only lookup
21133 when we're called via ITypeExpression.DoResolveType().
21134 (ComposedCast): Implement the ITypeExpression interface.
21136 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
21137 Expression.Resolve() with ResolveFlags.Type instead.
21139 2002-08-12 Martin Baulig <martin@gnome.org>
21141 * interface.cs (Interface.Define): Apply attributes.
21143 * attribute.cs (Attribute.ApplyAttributes): Added support for
21144 interface attributes.
21146 2002-08-11 Martin Baulig <martin@gnome.org>
21148 * statement.cs (Block.Emit): Only check the "this" variable if we
21149 do not always throw an exception.
21151 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
21152 whether the property has a set accessor.
21154 2002-08-11 Martin Baulig <martin@gnome.org>
21156 Added control flow analysis support for structs.
21158 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
21159 with control flow analysis turned off.
21160 (IVariable): New interface.
21161 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
21162 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
21163 (FieldExpr.DoResolve): Resolve the instance expression with flow
21164 analysis turned off and do the definite assignment check after the
21165 resolving when we know what the expression will resolve to.
21167 * expression.cs (LocalVariableReference, ParameterReference):
21168 Implement the new IVariable interface, only call the flow analysis
21169 code if ec.DoFlowAnalysis is true.
21170 (This): Added constructor which takes a Block argument. Implement
21171 the new IVariable interface.
21172 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
21173 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
21174 This does the definite assignment checks for struct members.
21176 * class.cs (Constructor.Emit): If this is a non-static `struct'
21177 constructor which doesn't have any initializer, call
21178 Block.AddThisVariable() to tell the flow analysis code that all
21179 struct elements must be initialized before control returns from
21182 * statement.cs (MyStructInfo): New public class.
21183 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
21184 argument to this indexer. If non-zero, check an individual struct
21185 member, not the whole struct.
21186 (FlowBranching.CheckOutParameters): Check struct members.
21187 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
21188 overloaded versions of these methods which take an additional
21189 `int field_idx' argument to check struct members.
21190 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
21191 overloaded versions of these methods which take an additional
21192 `string field_name' argument to check struct member.s
21193 (VariableInfo): Implement the IVariable interface.
21194 (VariableInfo.StructInfo): New public property. Returns the
21195 MyStructInfo instance of the variable if it's a struct or null.
21196 (Block.AddThisVariable): New public method. This is called from
21197 Constructor.Emit() for non-static `struct' constructor which do
21198 not have any initializer. It creates a special variable for the
21199 "this" instance variable which will be checked by the flow
21200 analysis code to ensure that all of the struct's fields are
21201 initialized before control returns from the constructor.
21202 (UsageVector): Added support for struct members. If a
21203 variable/parameter is a struct with N members, we reserve a slot
21204 in the usage vector for each member. A struct is considered fully
21205 initialized if either the struct itself (slot 0) or all its
21206 members are initialized.
21208 2002-08-08 Martin Baulig <martin@gnome.org>
21210 * driver.cs (Driver.MainDriver): Only report an error CS5001
21211 if there were no compilation errors.
21213 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
21214 `UnsafeContext' property to determine whether the parent is in
21215 unsafe context rather than checking the parent's ModFlags:
21216 classes nested in an unsafe class are unsafe as well.
21218 2002-08-08 Martin Baulig <martin@gnome.org>
21220 * statement.cs (UsageVector.MergeChildren): Distinguish between
21221 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
21222 we return. Added test17() and test18() to test-154.cs.
21224 2002-08-08 Martin Baulig <martin@gnome.org>
21226 * typemanager.cs (TypeManager.FilterWithClosure): If we have
21227 Family access, make sure the invoking type isn't a subclass of the
21228 queried type (that'd be a CS1540).
21230 * ecore.cs (Expression.MemberLookup): Added overloaded version of
21231 this method which takes an additional `Type invocation_type'.
21233 * expression.cs (BaseAccess.DoResolve): Use the base type as
21234 invocation and query type.
21235 (MemberAccess.DoResolve): If the lookup failed and we're about to
21236 report a CS0122, try a lookup with the ec.ContainerType - if this
21237 succeeds, we must report a CS1540.
21239 2002-08-08 Martin Baulig <martin@gnome.org>
21241 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
21242 (MethodGroupExpr): Implement the IMemberExpr interface.
21244 * expression (MemberAccess.ResolveMemberAccess): No need to have
21245 any special code for MethodGroupExprs anymore, they're now
21248 2002-08-08 Martin Baulig <martin@gnome.org>
21250 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
21251 Family, FamANDAssem and FamORAssem permissions.
21252 (TypeManager.IsSubclassOrNestedChildOf): New public method.
21254 2002-08-08 Martin Baulig <martin@gnome.org>
21256 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
21257 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
21260 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
21262 * driver.cs: implemented /resource option to embed managed resources.
21264 2002-08-07 Martin Baulig <martin@gnome.org>
21266 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
21267 (FieldBase.HasFieldInitializer): New public property.
21268 (FieldBase.GetInitializerExpression): New public method. Resolves and
21269 returns the field initializer and makes sure it is only resolved once.
21270 (TypeContainer.EmitFieldInitializers): Call
21271 FieldBase.GetInitializerExpression to get the initializer, this ensures
21272 that it isn't resolved multiple times.
21274 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
21275 the resolving process (SimpleName/MemberLookup) that we're currently
21276 emitting a field initializer (which must not access any instance members,
21277 this is an error CS0236).
21279 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
21280 argument, if the `IsFieldInitializer' flag is set, we must report and
21281 error CS0236 and not an error CS0120.
21283 2002-08-07 Martin Baulig <martin@gnome.org>
21285 * ecore.cs (IMemberExpr): New public interface.
21286 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
21287 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
21288 if the expression is an IMemberExpr.
21290 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
21291 to be null, implicitly default to `this' if we're non-static in
21292 this case. Simplified the code a lot by using the new IMemberExpr
21293 interface. Also fixed bug #28176 here.
21295 2002-08-06 Martin Baulig <martin@gnome.org>
21297 * cs-parser.jay (SimpleLookup): Removed. We need to create
21298 ParameterReferences during semantic analysis so that we can do a
21299 type-only search when resolving Cast, TypeOf and SizeOf.
21300 (block): Pass the `current_local_parameters' to the Block's
21303 * class.cs (ConstructorInitializer): Added `Parameters parameters'
21304 argument to the constructor.
21305 (ConstructorInitializer.Resolve): Create a temporary implicit
21306 block with the parameters.
21308 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
21309 references here if we aren't doing a type-only search.
21311 * statement.cs (Block): Added constructor which takes a
21312 `Parameters parameters' argument.
21313 (Block.Parameters): New public property.
21315 * support.cs (InternalParameters.Parameters): Renamed `parameters'
21316 to `Parameters' and made it public readonly.
21318 2002-08-06 Martin Baulig <martin@gnome.org>
21320 * ecore.cs (Expression.Warning): Made this public as well.
21322 * report.cs (Report.Debug): Print the contents of collections.
21324 2002-08-06 Martin Baulig <martin@gnome.org>
21326 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
21327 used to tell Resolve() which kinds of expressions it may return.
21328 (Expression.Resolve): Added overloaded version of this method which
21329 takes a `ResolveFlags flags' argument. This can be used to tell
21330 Resolve() which kinds of expressions it may return. Reports a
21332 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
21333 ResolveFlags.SimpleName.
21334 (Expression.Error118): Added overloaded version of this method which
21335 takes a `ResolveFlags flags' argument. It uses the flags to determine
21336 which kinds of expressions are allowed.
21338 * expression.cs (Argument.ResolveMethodGroup): New public method.
21339 Resolves an argument, but allows a MethodGroup to be returned.
21340 This is used when invoking a delegate.
21342 * TODO: Updated a bit.
21344 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21346 Fixed compilation with csc.
21348 * ecore.cs: Expression.Error made public. Is this correct? Should
21349 Warning be made public too?
21351 * expression.cs: use ea.Location instead of ea.loc.
21352 [FIXME: Filed as bug #28607: MCS must report these errors.]
21354 2002-08-06 Martin Baulig <martin@gnome.org>
21356 * ecore.cs (Expression.loc): Moved the location here instead of
21357 duplicating it in all derived classes.
21358 (Expression.Location): New public property.
21359 (Expression.Error, Expression.Warning): Made them non-static and
21360 removed the location argument.
21361 (Expression.Warning): Added overloaded version which takes an
21362 `int level' argument.
21363 (Expression.Error118): Make this non-static and removed the
21364 expression and location arguments.
21365 (TypeExpr): Added location argument to the constructor.
21367 * expression.cs (StaticCallExpr): Added location argument to
21369 (Indirection, PointerArithmetic): Likewise.
21370 (CheckedExpr, UnCheckedExpr): Likewise.
21371 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
21372 (StringPtr): Likewise.
21375 2002-08-05 Martin Baulig <martin@gnome.org>
21377 * expression.cs (BaseAccess.DoResolve): Actually report errors.
21379 * assign.cs (Assign.DoResolve): Check whether the source
21380 expression is a value or variable.
21382 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
21383 while resolving the corresponding blocks.
21385 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
21386 an error, don't silently return null.
21388 * statement.cs (Block.AddVariable): Do the error reporting here
21389 and distinguish between CS0128 and CS0136.
21390 (Block.DoResolve): Report all unused labels (warning CS0164).
21391 (LabeledStatement): Pass the location to the constructor.
21392 (LabeledStatement.HasBeenReferenced): New property.
21393 (LabeledStatement.Resolve): Set it to true here.
21395 * statement.cs (Return.Emit): Return success even after reporting
21396 a type mismatch error (CS0126 or CS0127), this is what csc does and
21397 it avoids confusing the users with any consecutive errors.
21399 2002-08-05 Martin Baulig <martin@gnome.org>
21401 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
21403 * const.cs (Const.LookupConstantValue): Catch circular definitions.
21405 * expression.cs (MemberAccess.DoResolve): Silently return if an
21406 error has already been reported.
21408 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
21409 error has already been reported.
21411 2002-08-05 Martin Baulig <martin@gnome.org>
21413 * statement.cs (UsageVector): Only initialize the `parameters'
21414 vector if we actually have any "out" parameters.
21416 2002-08-05 Martin Baulig <martin@gnome.org>
21418 * expression.cs (Binary.ResolveOperator): When combining delegates,
21419 they must have the same type.
21421 2002-08-05 Martin Baulig <martin@gnome.org>
21423 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
21424 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
21425 work with the ms runtime and we also don't need it: if we're a
21426 PropertyBuilder and not in the `indexer_arguments' hash, then we
21427 are a property and not an indexer.
21429 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
21430 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
21431 since the latter one doesn't work with the ms runtime.
21433 2002-08-03 Martin Baulig <martin@gnome.org>
21435 Fixed bugs #27998 and #22735.
21437 * class.cs (Method.IsOperator): New public field.
21438 (Method.CheckBase): Report CS0111 if there's already a method
21439 with the same parameters in the current class. Report CS0508 when
21440 attempting to change the return type of an inherited method.
21441 (MethodData.Emit): Report CS0179 if a method doesn't have a body
21442 and it's not marked abstract or extern.
21443 (PropertyBase): New abstract base class for Property and Indexer.
21444 (PropertyBase.CheckBase): Moved here from Property and made it work
21446 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
21447 the same so we can reuse it there.
21448 (Property, Indexer): Derive from PropertyBase.
21449 (MethodSignature.inheritable_property_signature_filter): New delegate
21450 to find properties and indexers.
21452 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
21453 argument and improved error reporting.
21455 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
21456 EmptyReadOnlyParameters and made it a property.
21458 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
21459 version of this method which takes a `PropertyInfo indexer'.
21460 (TypeManager.RegisterIndexer): New method.
21462 * class.cs: Added myself as author of this file :-)
21464 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21466 * class.cs: fixed compilation on windoze.
21468 2002-08-03 Martin Baulig <martin@gnome.org>
21470 * interface.cs (Interface.GetInterfaceBases): Check whether all
21471 base interfaces are at least as accessible than the current one.
21473 * class.cs (TypeContainer.GetClassBases): Check whether base types
21474 are at least as accessible than the current type.
21475 (TypeContainer.AsAccessible): Implemented and made non-static.
21476 (MemberBase.CheckParameters): Report errors if the accessibility
21479 * delegate.cs (Delegate.Delegate): The default visibility is
21480 internal for top-level types and private for nested types.
21481 (Delegate.Define): Report errors if the accessibility checks fail.
21483 * enum.cs (Enum.Enum): The default visibility is internal for
21484 top-level types and private for nested types.
21485 (Enum.DefineType): Compute the correct visibility.
21487 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
21488 function which takes a `bool is_toplevel' instead of a TypeContainer.
21490 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
21493 2002-08-02 Martin Baulig <martin@gnome.org>
21495 * expression.cs (LocalVariableReferenc): Added constructor which
21496 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
21497 (LocalVariableReference.IsReadOnly): New property.
21498 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
21499 variable is readonly, use our own readonly flag to do this; you can
21500 use the new constructor to get a writable reference to a read-only
21503 * cs-parser.jay (foreach_statement, using_statement): Get a writable
21504 reference to the local variable.
21506 2002-08-01 Miguel de Icaza <miguel@ximian.com>
21508 * rootcontext.cs (ResolveCore): Also include System.Exception
21510 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
21511 we reach an EmptyStatement.
21513 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
21516 * expression.cs (Binary.ResolveOperator): Check error result in
21519 use brtrue/brfalse directly and avoid compares to null.
21521 2002-08-02 Martin Baulig <martin@gnome.org>
21523 * class.cs (TypeContainer.Define): Define all nested interfaces here.
21524 Fixes bug #28407, added test-155.cs.
21526 2002-08-01 Martin Baulig <martin@gnome.org>
21528 * class.cs (Event.EmitDefaultMethod): Make this work with static
21529 events. Fixes #28311, added verify-3.cs.
21531 2002-08-01 Martin Baulig <martin@gnome.org>
21533 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
21534 `is_disposable' fields.
21535 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
21536 `hm.is_disposable' if we're using the collection pattern.
21537 (Foreach.EmitCollectionForeach): Use the correct type for the
21538 enumerator's local variable, only emit the try/finally block if
21539 necessary (fixes #27713).
21541 2002-08-01 Martin Baulig <martin@gnome.org>
21543 * ecore.cs (Expression.report118): Renamed to Error118 and made
21546 * statement.cs (Throw.Resolve): Check whether the expression is of
21547 the correct type (CS0118) and whether the type derives from
21548 System.Exception (CS0155).
21549 (Catch.Resolve): New method. Do the type lookup here and check
21550 whether it derives from System.Exception (CS0155).
21551 (Catch.CatchType, Catch.IsGeneral): New public properties.
21553 * typemanager.cs (TypeManager.exception_type): Added.
21555 2002-07-31 Miguel de Icaza <miguel@ximian.com>
21557 * driver.cs: Updated About function.
21559 2002-07-31 Martin Baulig <martin@gnome.org>
21561 Implemented Control Flow Analysis.
21563 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
21564 (EmitContext.CurrentBranching): Added.
21565 (EmitContext.StartFlowBranching): Added.
21566 (EmitContext.EndFlowBranching): Added.
21567 (EmitContext.KillFlowBranching): Added.
21568 (EmitContext.IsVariableAssigned): Added.
21569 (EmitContext.SetVariableAssigned): Added.
21570 (EmitContext.IsParameterAssigned): Added.
21571 (EmitContext.SetParameterAssigned): Added.
21572 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
21573 Added control flow analysis stuff here.
21575 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
21576 resolve the expression as lvalue.
21577 (LocalVariableReference.DoResolve): Check whether the variable has
21578 already been assigned.
21579 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
21580 the parameter as assigned here.
21581 (ParameterReference.DoResolve): Check whether the parameter has already
21583 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
21584 expression as lvalue.
21586 * statement.cs (FlowBranching): New class for the flow analysis code.
21587 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
21588 (LabeledStatement.IsDefined): New public property.
21589 (LabeledStatement.AddUsageVector): New public method to tell flow
21590 analyis that the label may be reached via a forward jump.
21591 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
21593 (VariableInfo.Number): New public field. This is used by flow analysis
21594 to number all locals of a block.
21595 (Block.CountVariables): New public property. This is the number of
21596 local variables in this block (including the locals from all parent
21598 (Block.EmitMeta): Number all the variables.
21600 * statement.cs: Added flow analysis support to all classes.
21602 2002-07-31 Martin Baulig <martin@gnome.org>
21604 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
21605 To get debugging messages, compile mcs with /define:MCS_DEBUG and
21606 then use this argument.
21608 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
21610 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
21611 use this to specify /define options.
21613 2002-07-29 Martin Baulig <martin@gnome.org>
21615 * statement.cs (Fixed): Moved all code that does variable lookups
21616 and resolvings from Emit to Resolve.
21618 * statement.cs (For): Moved all code that does variable lookups
21619 and resolvings from Emit to Resolve.
21621 * statement.cs (Using): Moved all code that does variable lookups
21622 and resolvings from Emit to Resolve.
21624 2002-07-29 Martin Baulig <martin@gnome.org>
21626 * attribute.cs (Attribute.Resolve): Explicitly catch a
21627 System.NullReferenceException when creating the
21628 CustromAttributeBuilder and report a different warning message.
21630 2002-07-29 Martin Baulig <martin@gnome.org>
21632 * support.cs (ParameterData.ParameterName): Added method to
21633 get the name of a parameter.
21635 * typemanager.cs (TypeManager.IsValueType): New public method.
21637 2002-07-29 Martin Baulig <martin@gnome.org>
21639 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
21640 is a flag which specifies that it's either ref or out.
21641 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
21642 the out parameter to `out Parameter.Modifier mod', also set the
21643 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
21645 * support.cs (InternalParameters.ParameterModifier): Distinguish
21646 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
21647 Parameter.Modifier.ISBYREF flag if it's either ref or out.
21649 * expression.cs (Argument.GetParameterModifier): Distinguish
21650 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
21651 Parameter.Modifier.ISBYREF flag if it's either ref or out.
21653 2002-07-29 Martin Baulig <martin@gnome.org>
21655 * expression.cs (ParameterReference.ParameterReference): Added
21656 `Location loc' argument to the constructor.
21658 * cs-parser.jay: Pass location to ParameterReference.
21660 2002-07-28 Miguel de Icaza <miguel@ximian.com>
21662 * statement.cs (Try): Initialize the location.
21664 * cs-parser.jay: pass location to Try.
21666 * expression.cs (Unary.Reduce): Change the prototype to return
21667 whether a constant fold could be performed or not. The result is
21668 returned in an out parameters. In the case of Indirection and
21669 AddressOf, we want to perform the full tests.
21671 2002-07-26 Miguel de Icaza <miguel@ximian.com>
21673 * statement.cs (Statement.Emit): Flag dead code.
21675 2002-07-27 Andrew Birkett <andy@nobugs.org>
21677 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
21679 2002-07-27 Martin Baulig <martin@gnome.org>
21681 * class.cs (MethodData.Define): Put back call to
21682 TypeManager.AddMethod(), accidentally commented this out.
21684 * report.cs (Debug): New public method to print debugging information,
21685 this is `[Conditional ("DEBUG")]'.
21687 2002-07-26 Martin Baulig <martin@gnome.org>
21689 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
21690 (switch_statement): Push the current_block to the switch_stack and
21691 pop it again when we're done with the switch.
21692 (switch_section): The new block is a child of the current_block.
21693 Fixes bug #24007, added test-152.cs.
21695 2002-07-27 Martin Baulig <martin@gnome.org>
21697 * expression.cs (Invocation.EmitArguments): When calling a varargs
21698 function with only its fixed arguments, we need to pass an empty
21701 2002-07-27 Martin Baulig <martin@gnome.org>
21703 Mono 0.13 has been released.
21705 2002-07-25 Miguel de Icaza <miguel@ximian.com>
21707 * driver.cs: Rename --resource to --linkres, because that is what
21708 we do currently, we dont support --resource yet.
21710 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
21712 2002-07-25 Martin Baulig <martin@gnome.org>
21714 * class.cs (MethodData): New public class. This is a `method builder'
21715 class for a method or one accessor of a Property/Indexer/Event.
21716 (MethodData.GetMethodFlags): Moved here from MemberBase.
21717 (MethodData.ApplyAttributes): Likewise.
21718 (MethodData.ApplyObsoleteAttribute): Likewise.
21719 (MethodData.ApplyConditionalAttribute): Likewise.
21720 (MethodData.ApplyDllImportAttribute): Likewise.
21721 (MethodData.CheckAbstractAndExternal): Likewise.
21722 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
21723 (MethodData.Emit): Formerly known as Method.Emit().
21724 (MemberBase): Moved everything which was specific to a single
21725 accessor/method to MethodData.
21726 (Method): Create a new MethodData and call Define() and Emit() on it.
21727 (Property, Indexer, Event): Create a new MethodData objects for each
21728 accessor and call Define() and Emit() on them.
21730 2002-07-25 Martin Baulig <martin@gnome.org>
21732 Made MethodCore derive from MemberBase to reuse the code from there.
21733 MemberBase now also checks for attributes.
21735 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
21736 (MemberBase.GetMethodFlags): Moved here from class Method and marked
21738 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
21739 `CallingConventions cc' and `Attributes opt_attrs' arguments.
21740 (MemberBase.ApplyAttributes): New virtual method; applies the
21741 attributes to a method or accessor.
21742 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
21743 (MemberBase.ApplyConditionalAttribute): Likewise.
21744 (MemberBase.ApplyDllImportAttribute): Likewise.
21745 (MemberBase.CheckAbstractAndExternal): Likewise.
21746 (MethodCore.ParameterTypes): This is now a property instead of a
21747 method, it's initialized from DoDefineParameters().
21748 (MethodCore.ParameterInfo): Removed the set accessor.
21749 (MethodCore.DoDefineParameters): New protected virtual method to
21750 initialize ParameterTypes and ParameterInfo.
21751 (Method.GetReturnType): We can now simply return the MemberType.
21752 (Method.GetMethodFlags): Override the MemberBase version and add
21753 the conditional flags.
21754 (Method.CheckBase): Moved some code from Define() here, call
21755 DoDefineParameters() here.
21756 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
21757 here to avoid some larger code duplication.
21758 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
21759 ensure that abstract and external accessors don't declare a body.
21761 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
21762 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
21763 lookup in the attribute's parent classes, so we need to abort as soon
21764 as we found the first match.
21765 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
21766 the attribute has no arguments.
21768 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
21771 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21773 * cs-parser.jay: reverted previous patch.
21775 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21777 * cs-parser.jay: fixed bug #22119.
21779 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21781 * attribute.cs: fixed compilation. The error was:
21782 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
21783 be assigned to before control leaves the current method."
21784 [FIXME: Filed as bug #28186: MCS must report this error.]
21786 2002-07-25 Martin Baulig <martin@gnome.org>
21788 * attribute.cs (Attribute.Conditional_GetConditionName): New static
21789 method to pull the condition name ouf of a Conditional attribute.
21790 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
21791 the obsolete message and error flag out of an Obsolete attribute.
21793 * class.cs (Method.GetMethodFlags): New public method to get the
21794 TypeManager.MethodFlags for this method.
21795 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
21797 (Method.Define): Get and apply the Obsolete and Conditional attributes;
21798 if we're overriding a virtual function, set the new private variable
21799 `parent_method'; call the new TypeManager.AddMethod().
21801 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
21802 the MethodBuilder and the Method in a PtrHashtable.
21803 (TypeManager.builder_to_method): Added for this purpose.
21804 (TypeManager.MethodFlags): Added IsObsoleteError.
21805 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
21806 Obsolete and Conditional arguments in MethodBuilders. If we discover
21807 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
21808 the message from the attribute.
21810 2002-07-24 Martin Baulig <martin@gnome.org>
21812 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
21813 preprocessor directives, ensure that the argument to #define/#undef is
21814 exactly one identifier and that it's actually an identifier.
21816 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
21819 2002-07-24 Martin Baulig <martin@gnome.org>
21821 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
21822 initialize it to TypeManager.object_type in the constructor.
21823 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
21824 of the `hm.get_current' method if we're using the collection pattern.
21825 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
21826 for the explicit conversion to make it work when we're using the collection
21827 pattern and the `Current' property has a different return type than `object'.
21830 2002-07-24 Martin Baulig <martin@gnome.org>
21832 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
21833 does not match, but don't report any errors. This method is called in
21834 order for all methods in a MethodGroupExpr until a matching method is
21835 found, so we don't want to bail out if the first method doesn't match.
21836 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
21837 matches, report the 123. Fixes #28070.
21839 2002-07-24 Martin Baulig <martin@gnome.org>
21841 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
21842 TypeManager.TypeToCoreType() to the top of the method so the
21843 following equality checks will work. Fixes #28107.
21845 2002-07-24 Martin Baulig <martin@gnome.org>
21847 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
21848 operand is of type uint, and the other operand is of type sbyte,
21849 short or int, the operands are converted to type long." -
21850 Actually do what this comment already told us. Fixes bug #28106,
21853 2002-07-24 Martin Baulig <martin@gnome.org>
21855 * class.cs (MethodBase): New abstract class. This is now a base
21856 class for Property, Indexer and Event to avoid some code duplication
21857 in their Define() and DefineMethods() methods.
21858 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
21859 generic methods for Define() and DefineMethods().
21860 (FieldBase): Derive from MemberBase, not MemberCore.
21861 (Property): Derive from MemberBase, not MemberCore.
21862 (Property.DefineMethod): Moved all the code from this method to the
21863 new MethodBase.DefineAccessor(), just call it with appropriate
21865 (Property.Define): Call the new Property.DoDefine(), this does some
21866 sanity checks and we don't need to duplicate the code everywhere.
21867 (Event): Derive from MemberBase, not MemberCore.
21868 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
21869 accessors, this will also make them work with interface events.
21870 (Indexer): Derive from MemberBase, not MemberCore.
21871 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
21872 (Indexer.Define): Use the new MethodBase functions.
21874 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
21875 argument to the constructor.
21876 (Interface.FindMembers): Added support for interface events.
21877 (Interface.PopluateEvent): Implemented.
21879 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
21881 2002-07-22 Miguel de Icaza <miguel@ximian.com>
21883 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
21884 but this is required to check for a method name being the same as
21885 the containing class.
21889 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21891 * interface.cs: initialize variable.
21893 2002-07-23 Martin Baulig <martin@gnome.org>
21895 Implemented the IndexerName attribute in interfaces.
21897 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
21898 name if this is an explicit interface implementation.
21899 (Indexer.InterfaceIndexerName): New public variable. If we're
21900 implementing an interface indexer, this is the IndexerName in that
21901 interface. Otherwise, it's the IndexerName.
21902 (Indexer.DefineMethod): If we're implementing interface indexer,
21903 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
21904 and Pending.ImplementIndexer methods.
21905 (Indexer.Define): Also define the PropertyBuilder if we're
21906 implementing an interface indexer and this is neither an explicit
21907 interface implementation nor do the IndexerName match the one in
21910 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
21911 If a method is defined here, then we always need to create a proxy
21912 for it. This is used when implementing interface indexers.
21913 (Pending.IsInterfaceIndexer): New public method.
21914 (Pending.ImplementIndexer): New public method.
21915 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
21916 This is used when implementing interface indexers to define a proxy
21918 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
21919 define a proxy if necessary.
21921 * interface.cs (Interface.IndexerName): New public variable.
21922 (Interface.PopulateIndexer): Set the IndexerName.
21923 (Interface.DefineIndexers): New private method. Populate all the
21924 indexers and make sure their IndexerNames match.
21926 * typemanager.cs (IndexerPropertyName): Added support for interface
21929 2002-07-22 Martin Baulig <martin@gnome.org>
21931 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
21932 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
21933 ret if HasReturnLabel.
21934 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
21937 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
21938 and set the ec.LoopBeginTryCatchLevel.
21939 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
21940 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
21941 the current ec.TryCatchLevel, the branch goes out of an exception
21942 block. In this case, we need to use Leave and not Br.
21944 2002-07-22 Martin Baulig <martin@gnome.org>
21946 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
21947 block unless the block does not always return or it is contained in
21948 another try { ... } catch { ... } block. Fixes bug #26506.
21949 Added verify-1.cs to the test suite.
21951 2002-07-22 Martin Baulig <martin@gnome.org>
21953 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
21954 then we do not always return. Fixes bug #24985.
21956 2002-07-22 Martin Baulig <martin@gnome.org>
21958 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
21959 lookup on a per-class level; ie. walk up the class hierarchy until we
21960 found at least one applicable method, then choose the best among them.
21961 Fixes bug #24463 and test-29.cs.
21963 2002-07-22 Martin Baulig <martin@gnome.org>
21965 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
21966 return types of the methods. The return type is not part of the
21967 signature and we must not check it to make the `new' modifier work.
21968 Fixes bug #27999, also added test-147.cs.
21969 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
21971 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
21972 on the method's return type.
21974 2002-07-21 Martin Baulig <martin@gnome.org>
21976 * assign.cs: Make this work if the rightmost source is a constant and
21977 we need to do an implicit type conversion. Also adding a few more tests
21978 to test-38.cs which should have caught this.
21980 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
21981 target in the makefile for this. The makefile.gnu is primarily intended
21982 for end-users who don't want to debug the compiler.
21984 2002-07-21 Martin Baulig <martin@gnome.org>
21986 * assign.cs: Improved the Assign class so it can now handle embedded
21987 assignments (X = Y = Z = something). As a side-effect this'll now also
21988 consume less local variables. test-38.cs now passes with MCS, added
21989 a few new test cases to that test.
21991 2002-07-20 Martin Baulig <martin@gnome.org>
21993 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
21994 instructions. Fixes bug #27977, also added test-146.cs.
21996 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21998 * cs-tokenizer.cs: fixed getHex ().
22000 2002-07-19 Martin Baulig <martin@gnome.org>
22002 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
22003 not Type.GetType() to lookup the array type. This is needed when
22004 we're constructing an array of a user-defined type.
22005 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
22006 single-dimensional arrays, but also for single-dimensial arrays of
22009 2002-07-19 Martin Baulig <martin@gnome.org>
22011 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
22012 this function is called, it's not allowed to share LocalBuilders
22013 among ILGenerators.
22015 2002-07-19 Martin Baulig <martin@gnome.org>
22017 * expression.cs (Argument.Resolve): Report an error 118 when trying
22018 to pass a type as argument.
22020 2002-07-18 Martin Baulig <martin@gnome.org>
22022 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
22023 Conv_R_Un for the signed `long' type.
22025 2002-07-15 Miguel de Icaza <miguel@ximian.com>
22027 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
22028 `expr' for the temporary result, as that will fail if we do
22029 multiple resolves on the same expression.
22031 2002-07-05 Miguel de Icaza <miguel@ximian.com>
22033 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
22034 ec.TypeContainer for looking up aliases.
22036 * class.cs (TypeContainer): Remove LookupAlias from here.
22038 * decl.cs (DeclSpace); Move here.
22040 2002-07-01 Miguel de Icaza <miguel@ximian.com>
22042 * class.cs (FindMembers): Only call filter if the constructor
22043 bulider is not null.
22045 Also handle delegates in `NestedTypes' now. Now we will perform
22046 type lookups using the standard resolution process. This also
22049 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
22050 This uses Expressions (the limited kind that can be parsed by the
22051 tree) instead of strings.
22053 * expression.cs (ComposedCast.ToString): Implement, used to flag
22054 errors since now we have to render expressions.
22056 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
22059 * ecore.cs (SimpleName.ToString): ditto.
22061 * cs-parser.jay: Instead of using strings to assemble types, use
22062 Expressions to assemble the type (using SimpleName, ComposedCast,
22063 MemberAccess). This should fix the type lookups in declarations,
22064 because we were using a different code path for this.
22066 * statement.cs (Block.Resolve): Continue processing statements
22067 even when there is an error.
22069 2002-07-17 Miguel de Icaza <miguel@ximian.com>
22071 * class.cs (Event.Define): Also remove the `remove' method from
22072 the list of pending items.
22074 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
22075 generate more compact code.
22077 2002-07-17 Martin Baulig <martin@gnome.org>
22079 * const.cs (Const.LookupConstantValue): Add support for constant
22080 `unchecked' and `checked' expressions.
22081 Also adding test case test-140.cs for this.
22083 2002-07-17 Martin Baulig <martin@gnome.org>
22085 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
22086 check whether mi.ReturnType implements the IEnumerator interface; the
22087 `==' and the IsAssignableFrom() will fail in this situation.
22089 2002-07-16 Ravi Pratap <ravi@ximian.com>
22091 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
22094 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22096 * expression.cs: fixed bug #27811.
22098 2002-07-14 Miguel de Icaza <miguel@ximian.com>
22100 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
22101 Molaro: when we are a ref, the value already contains a pointer
22102 value, do not take the address of it.
22104 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
22105 * removed mb-parser.jay and mb-tokenizer.cs
22107 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
22109 * expression.cs: check against the building corlib void type.
22111 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
22113 * ecore.cs: fix for valuetype static readonly fields: when
22114 initializing them, we need their address, not the address of a copy.
22116 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
22118 * typemanager.cs: register also enum_type in corlib.
22120 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
22122 * class.cs: allow calling this (but not base) initializers in structs.
22124 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
22126 * ecore.cs: make sure we compare against the building base types
22129 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
22131 * typemanager.cs: fix TypeToCoreType() to handle void and object
22132 (corlib gets no more typerefs after this change).
22134 2002-07-12 Miguel de Icaza <miguel@ximian.com>
22136 * expression.cs (ArrayCreation.EmitArrayArguments): use
22137 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
22139 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
22140 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
22141 array indexes, the runtime actually forbids them.
22143 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
22144 for array arguments here.
22146 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
22147 instead of the default for ValueTypes.
22149 (New.DoEmit): Use IsValueType instead of
22150 IsSubclassOf (value_type)
22151 (New.DoResolve): ditto.
22152 (Invocation.EmitCall): ditto.
22154 * assign.cs (Assign): ditto.
22156 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
22157 Statements *are* currently doing part of their resolution during
22160 Expressions do always resolve during resolve, but statements are
22161 only required to propagate resolution to their children.
22163 2002-07-11 Miguel de Icaza <miguel@ximian.com>
22165 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
22167 (LoadAssembly): Do not add the dll if it is already specified
22169 (MainDriver): Add the System directory to the link path at the end,
22170 after all the other -L arguments.
22172 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
22173 wrong opcode for loading bytes and bools (ldelem.i1 instead of
22174 ldelem.u1) and using the opposite for sbytes.
22176 This fixes Digger, and we can finally run it.
22178 * driver.cs (UnixParseOption): Move the option parsing here.
22179 (CSCParseOption): Implement CSC-like parsing of options.
22181 We now support both modes of operation, the old Unix way, and the
22182 new CSC-like way. This should help those who wanted to make cross
22183 platform makefiles.
22185 The only thing broken is that /r:, /reference: and /lib: are not
22186 implemented, because I want to make those have the same semantics
22187 as the CSC compiler has, and kill once and for all the confussion
22188 around this. Will be doing this tomorrow.
22190 * statement.cs (Unsafe.Resolve): The state is checked during
22191 resolve, not emit, so we have to set the flags for IsUnsfe here.
22193 2002-07-10 Miguel de Icaza <miguel@ximian.com>
22195 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
22196 not catch the Error_ObjectRefRequired in SimpleName (as it is
22197 possible to have a class/instance variable name that later gets
22198 deambiguated), we have to check this here.
22200 2002-07-10 Ravi Pratap <ravi@ximian.com>
22202 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
22203 make static and put into Expression.
22205 (Event.Define): Register the private field of the event with the
22206 TypeManager so that GetFieldFromEvent can get at it.
22208 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
22209 keep track of the private field associated with an event which
22212 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
22215 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
22217 2002-07-10 Miguel de Icaza <miguel@ximian.com>
22219 * expression.cs (Binary.EmitBranchable): this routine emits the
22220 Binary expression in a branchable context. This basically means:
22221 we need to branch somewhere, not just get the value on the stack.
22223 This works together with Statement.EmitBoolExpression.
22225 * statement.cs (Statement.EmitBoolExpression): Use
22228 2002-07-09 Miguel de Icaza <miguel@ximian.com>
22230 * statement.cs (For): Reduce the number of jumps in loops.
22232 (For): Implement loop inversion for the For statement.
22234 (Break): We can be breaking out of a Try/Catch controlled section
22235 (foreach might have an implicit try/catch clause), so we need to
22236 use Leave instead of Br.
22238 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
22239 now). If the instace expression supports IMemoryLocation, we use
22240 the AddressOf method from the IMemoryLocation to extract the
22241 address instead of emitting the instance.
22243 This showed up with `This', as we were emitting the instance
22244 always (Emit) instead of the Address of This. Particularly
22245 interesting when This is a value type, as we dont want the Emit
22246 effect (which was to load the object).
22248 2002-07-08 Miguel de Icaza <miguel@ximian.com>
22250 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
22252 * statement.cs (Checked): Set the CheckedState during the resolve
22253 process too, as the ConvCast operations track the checked state on
22254 the resolve process, and not emit.
22256 * cs-parser.jay (namespace_member_declaration): Flag that we have
22257 found a declaration when we do. This is used to flag error 1529
22259 * driver.cs: Report ok when we display the help only.
22261 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
22263 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
22265 2002-07-04 Miguel de Icaza <miguel@ximian.com>
22267 * cs-tokenizer.cs (define): We also have to track locally the
22268 defines. AllDefines is just used for the Conditional Attribute,
22269 but we also need the local defines for the current source code.
22271 2002-07-03 Miguel de Icaza <miguel@ximian.com>
22273 * statement.cs (While, For, Do): These loops can exit through a
22274 Break statement, use this information to tell whether the
22275 statement is the last piece of code.
22277 (Break): Flag that we break.
22279 * codegen.cs (EmitContexts): New `Breaks' state variable.
22281 2002-07-03 Martin Baulig <martin@gnome.org>
22283 * class.cs (TypeContainer.MethodModifiersValid): Allow override
22284 modifiers in method declarations in structs. Otherwise, you won't
22285 be able to override things like Object.Equals().
22287 2002-07-02 Miguel de Icaza <miguel@ximian.com>
22289 * class.cs (Method, Property, Indexer): Do not allow the public
22290 modifier to be used in explicit interface implementations.
22292 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
22293 override modifiers in method declarations in structs
22295 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
22297 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
22298 integer or real overflow, report an error
22300 2002-07-02 Martin Baulig <martin@gnome.org>
22302 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
22303 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
22304 to tell the runtime about our newly created System.Object and
22305 System.ValueType types.
22307 2002-07-02 Miguel de Icaza <miguel@ximian.com>
22309 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
22310 struct instead of Ldarg/Starg.
22312 2002-07-02 Martin Baulig <martin@gnome.org>
22314 * expression.cs (Indirection.Indirection): Call
22315 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
22317 2002-07-02 Martin Baulig <martin@gnome.org>
22319 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
22320 ValueType, call TypeManager.TypeToCoreType() on it.
22321 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
22322 the OpCodes.Newarr argument.
22324 2002-07-02 Martin Baulig <martin@gnome.org>
22326 * expression.cs (Invocation.EmitCall): When compiling corlib,
22327 replace all calls to the system's System.Array type to calls to
22328 the newly created one.
22330 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
22331 System.Array methods.
22332 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
22333 from the system's System.Array type which must be replaced.
22335 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
22337 * typemanager.cs: load unverifiable_code_ctor so we can build
22338 corlib using the correct type. Avoid using GetTypeCode() with
22340 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
22341 TypeManager.object_type to allow building corlib.
22343 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
22345 * ecore.cs: handle System.Enum separately in LoadFromPtr().
22347 2002-07-01 Martin Baulig <martin@gnome.org>
22349 * class.cs: Make the last change actually work, we need to check
22350 whether `ifaces != null' to avoid a crash.
22352 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
22354 * class.cs: when we build structs without fields that implement
22355 interfaces, we need to add the interfaces separately, since there is
22356 no API to both set the size and add the interfaces at type creation
22359 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
22361 * expression.cs: the dimension arguments to the array constructors
22362 need to be converted if they are a long.
22364 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
22366 * class.cs: don't emit ldarg.0 if there is no parent constructor
22367 (fixes showstopper for corlib).
22369 2002-06-29 Martin Baulig <martin@gnome.org>
22371 MCS now compiles corlib on GNU/Linux :-)
22373 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
22374 ie. check for MethodImplOptions.InternalCall.
22376 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
22377 and TypeManager.attribute_type are null, so we must explicitly check
22378 whether parent is not null to find out whether it's an attribute type.
22379 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
22380 and SetBuilder, not only if the property is neither abstract nor external.
22381 This is necessary to set the MethodImplOptions on the accessor methods.
22382 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
22383 SetBuilder, see Property.Emit().
22385 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
22386 populate "System.Object", "System.ValueType" and "System.Attribute" since
22387 they've already been populated from BootCorlib_PopulateCoreTypes().
22389 2002-06-29 Martin Baulig <martin@gnome.org>
22391 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
22392 is the NullLiteral, we also need to make sure that target_type is not
22395 2002-06-29 Martin Baulig <martin@gnome.org>
22397 * rootcontext.cs (RootContext.ResolveCore): We must initialize
22398 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
22399 before calling BootstrapCorlib_ResolveDelegate ().
22401 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22403 * statement.cs: fixed build-breaker. All tests passed ok.
22405 2002-06-27 Martin Baulig <martin@gnome.org>
22407 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
22408 for System.Decimal when compiling corlib.
22410 2002-06-27 Martin Baulig <martin@gnome.org>
22412 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
22413 switch blocks which contain nothing but a default clause.
22415 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
22417 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
22419 2002-06-27 Martin Baulig <martin@gnome.org>
22421 * ecore.cs (PropertyExpr.PropertyExpr): Call
22422 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
22424 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
22425 is already a TypeBuilder.
22427 2002-06-27 Martin Baulig <martin@gnome.org>
22429 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
22430 `target_type == TypeManager.array_type', not IsAssignableFrom() in
22431 the "from an array-type to System.Array" case. This makes it work
22432 when compiling corlib.
22434 2002-06-27 Martin Baulig <martin@gnome.org>
22436 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
22437 non-static PropertyExpr, set its InstanceExpression. This makes
22438 the `ICollection.Count' property work in System/Array.cs.
22440 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
22442 * driver.cs: Made error handling more consistent. Errors now
22443 tracked by Report class, so many methods which used to return int
22444 now return void. Main() now prints success/failure and
22445 errors/warnings message.
22447 Renamed '--probe' compiler argument to '--expect-error'. Removed
22448 the magic number return values (123 and 124). Now, if the
22449 expected error occurs, the compiler exits with success (exit value
22450 0). If the compilation completes without seeing that particular
22451 error, the compiler exits with failure (exit value 1). The
22452 makefile in mcs/errors has been changed to handle the new behaviour.
22454 * report.cs: Made 'expected error' number a property and renamed
22455 it from 'Probe' to 'ExpectedError'.
22457 * genericparser.cs: Removed error handling support, since it is
22458 now all done by Report class.
22460 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
22461 class, so parse() no longer returns an int.
22463 * namespace.cs: Use Report.Error instead of GenericParser.error
22465 2002-06-22 Miguel de Icaza <miguel@ximian.com>
22467 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
22468 TypeContainer.AddOperator): At the front of the list put the
22469 explicit implementations, so they get resolved/defined first.
22471 2002-06-21 Miguel de Icaza <miguel@ximian.com>
22473 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
22474 interface type is implemented by this TypeContainer. Used during
22475 explicit interface implementation.
22477 (Property.Define, Indexer.Define, Method.Define): Validate that
22478 the given interface in the explicit implementation is one of the
22479 base classes for the containing type.
22481 Also if we are explicitly implementing an interface, but there is
22482 no match in the pending implementation table, report an error.
22484 (Property.Define): Only define the property if we are
22485 not explicitly implementing a property from an interface. Use the
22486 correct name also for those properties (the same CSC uses,
22487 although that is really not needed).
22489 (Property.Emit): Do not emit attributes for explicitly implemented
22490 properties, as there is no TypeBuilder.
22492 (Indexer.Emit): ditto.
22494 Hiding then means that we do not really *implement* a pending
22495 implementation, which makes code fail.
22497 2002-06-22 Martin Baulig <martin@gnome.org>
22499 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
22500 the return value of Object.GetType(). [FIXME: we need to do this whenever
22501 we get a type back from the reflection library].
22503 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
22505 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
22507 2002-06-20 Miguel de Icaza <miguel@ximian.com>
22509 * attribute.cs: Return null if we can not look up the type.
22511 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
22512 the interface types found.
22514 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
22515 interface types found.
22517 * typemanager.cs (GetInterfaces): Make this routine returns alll
22518 the interfaces and work around the lame differences between
22519 System.Type and System.Reflection.Emit.TypeBuilder in the results
22520 result for GetInterfaces.
22522 (ExpandInterfaces): Given an array of interface types, expand and
22523 eliminate repeated ocurrences of an interface. This expands in
22524 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
22527 2002-06-21 Martin Baulig <martin@gnome.org>
22529 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
22532 2002-06-21 Martin Baulig <martin@gnome.org>
22534 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
22535 and called with one of the core types, return the corresponding typebuilder for
22538 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
22541 2002-06-21 Martin Baulig <martin@gnome.org>
22543 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
22544 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
22545 (Expression.ConvertReferenceExplicit): Likewise.
22547 * expression.cs (ElementAccess.DoResolve): Likewise.
22548 (ElementAccess.DoResolveLValue): Likewise.
22550 2002-06-10 Martin Baulig <martin@gnome.org>
22552 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
22553 add the "value" parameter to the parameter list.
22555 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
22558 2002-06-19 Miguel de Icaza <miguel@ximian.com>
22560 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
22561 the argument to an int, uint, long or ulong, per the spec. Also
22562 catch negative constants in array creation.
22564 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
22566 * class.cs: do not allow the same interface to appear twice in
22567 the definition list.
22569 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
22571 * ecore.cs: don't use ldlen with System.Array.
22573 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
22575 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
22577 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
22579 * modifiers.cs: produce correct field attributes for protected
22580 internal. Easy fix so miguel can work on ther harder stuff:-)
22582 2002-06-18 Miguel de Icaza <miguel@ximian.com>
22584 * pending.cs: New file. Move the code from class.cs here.
22585 Support clearning the pending flag for all methods (when not doing
22586 explicit interface implementation).
22588 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
22590 * rootcontext.cs: added a couple more types needed to bootstrap.
22592 2002-06-17 Miguel de Icaza <miguel@ximian.com>
22594 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
22595 constructor in the type, instead of any constructor in the type
22596 hierarchy. Thanks to Paolo for finding this bug (it showed up as
22597 a bug in the Mono runtime when applying the params attribute).
22599 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
22600 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
22602 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
22604 * expression.cs (Unary.ResolveOperator): Use TypeManager
22605 to resolve the type.
22607 2002-06-13 Ravi Pratap <ravi@ximian.com>
22609 * cs-parser.jay (enum_member_declaration): Pass in the attributes
22612 * enum.cs (AddEnumMember): Add support to store the attributes associated
22613 with each member too.
22615 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
22616 field builders too - this takes care of the enum member case.
22618 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
22620 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
22621 address-of operator on both value types and pointers.
22623 2002-06-10 Martin Baulig <martin@gnome.org>
22625 * interface.cs (Interface.PopulateIndexer): Add the indexer's
22626 PropertyBuilder to the `property_builders' list.
22628 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
22629 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
22630 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
22631 find any indexers which are inherited from an interface.
22633 2002-06-09 Martin Baulig <martin@gnome.org>
22635 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
22636 the same type as the constant if necessary. There's also a test-130.cs
22639 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
22641 * typemanager.cs (TypeManager.ChangeType): Previously known as
22642 Enum.ChangeEnumType().
22644 2002-06-09 Martin Baulig <martin@gnome.org>
22646 * expression.cs (Cast.TryReduce): Added support for consts.
22648 2002-06-08 Ravi Pratap <ravi@ximian.com>
22650 * class.cs (Accessor): Hold attributes information so we can pass
22653 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
22654 Modify to pass in attributes attached to the methods.
22656 (add_accessor_declaration, remove_accessor_declaration): Ditto.
22658 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
22659 to handle the Accessor kind :-)
22661 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
22663 2002-06-08 Martin Baulig <martin@gnome.org>
22665 * expression.cs (Unary.TryReduceNegative): Added support for
22668 2002-06-08 Martin Baulig <martin@gnome.org>
22670 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
22671 name can't be found in the `defined_names' - the caller will do a
22672 MemberLookup in this case and thus find methods in System.Enum
22673 such as Enum.IsDefined().
22675 2002-06-08 Martin Baulig <martin@gnome.org>
22677 * enum.cs (Enum.ChangeEnumType): This is a custom version of
22678 Convert.ChangeType() which works with TypeBuilder created types.
22679 (Enum.LookupEnumValue, Enum.Define): Use it here.
22681 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
22682 `TypeBuilder.BaseType != null' check.
22683 (TypeContainer.FindMembers): Only lookup parent members if we
22684 actually have a parent.
22685 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
22686 (ConstructorInitializer.Resolve): Likewise.
22688 * interface.cs (Interface.FindMembers): Added
22689 `TypeBuilder.BaseType != null' check.
22691 * rootcontext.cs (RootContext.ResolveCore): Added
22692 "System.Runtime.CompilerServices.IndexerNameAttribute" to
22693 classes_second_stage.
22695 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
22696 debug_type and trace_type when compiling with --nostdlib.
22698 2002-06-07 Martin Baulig <martin@gnome.org>
22700 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
22701 (AddField): Set it to true when adding a non-static field.
22702 (DefineType): Use `have_nonstatic_fields' to find out whether we
22703 have non-static fields, not `Fields != null'.
22705 2002-06-02 Miguel de Icaza <miguel@ximian.com>
22707 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
22708 dereferencing a null on the static-field code path)
22710 2002-05-30 Martin Baulig <martin@gnome.org>
22712 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
22713 to take command line arguments. Use reflection to call the new
22714 custom `Initialize' function on the symbol writer and pass it the
22715 command line arguments.
22717 * driver.cs (--debug-args): New command line argument to pass command
22718 line arguments to the symbol writer.
22720 2002-05-28 Miguel de Icaza <miguel@ximian.com>
22722 * assign.cs (DoResolve): Forgot to do the implicit conversion to
22723 the target type for indexers and properties. Thanks to Joe for
22726 2002-05-27 Miguel de Icaza <miguel@ximian.com>
22728 * typemanager.cs (MethodFlags): returns the method flags
22729 (Obsolete/ShouldIgnore) that control warning emission and whether
22730 the invocation should be made, or ignored.
22732 * expression.cs (Invocation.Emit): Remove previous hack, we should
22733 not do this on matching a base type, we should do this based on an attribute
22735 Only emit calls to System.Diagnostics.Debug and
22736 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
22737 on the command line.
22739 * rootcontext.cs: Global settings for tracing and debugging.
22741 * cs-tokenizer.cs (define): New utility function to track
22742 defines. Set the global settings for TRACE and DEBUG if found.
22744 2002-05-25 Ravi Pratap <ravi@ximian.com>
22746 * interface.cs (Populate*): Pass in the TypeContainer as well as
22747 the DeclSpace as parameters so that we can create EmitContexts and
22748 then use that to apply attributes etc.
22750 (PopulateMethod, PopulateEvent, PopulateProperty)
22751 (PopulateIndexer): Apply attributes everywhere.
22753 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
22756 (ApplyAttributes): Update accordingly.
22758 We now apply interface attributes for all members too.
22760 2002-05-26 Miguel de Icaza <miguel@ximian.com>
22762 * class.cs (Indexer.Define); Correctly check if we are explicit
22763 implementation (instead of checking the Name for a ".", we
22764 directly look up if the InterfaceType was specified).
22766 Delay the creation of the PropertyBuilder.
22768 Only create the PropertyBuilder if we are not an explicit
22769 interface implementation. This means that explicit interface
22770 implementation members do not participate in regular function
22771 lookups, and hence fixes another major ambiguity problem in
22772 overload resolution (that was the visible effect).
22774 (DefineMethod): Return whether we are doing an interface
22777 * typemanager.cs: Temporary hack until we get attributes in
22778 interfaces (Ravi is working on that) and we get IndexerName
22779 support in interfaces.
22781 * interface.cs: Register the indexers as properties.
22783 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
22784 warning, I have verified that this is a bug in the .NET runtime
22785 (JavaScript suffers of the same problem).
22787 * typemanager.cs (MemberLookup): When looking up members for
22788 interfaces, the parent of an interface is the implicit
22789 System.Object (so we succeed in searches of Object methods in an
22790 interface method invocation. Example: IEnumerable x; x.ToString
22793 2002-05-25 Miguel de Icaza <miguel@ximian.com>
22795 * class.cs (Event): Events should also register if they do
22796 implement the methods that an interface requires.
22798 * typemanager.cs (MemberLookup); use the new GetInterfaces
22801 (GetInterfaces): The code used to lookup interfaces for a type is
22802 used in more than one place, factor it here.
22804 * driver.cs: Track the errors at the bottom of the file, we kept
22807 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
22808 instance if the method we are calling is static!
22810 2002-05-24 Miguel de Icaza <miguel@ximian.com>
22812 * attribute.cs (ApplyAttributes): Make this function filter out
22813 the IndexerName attribute (as that attribute in reality is never
22814 applied) and return the string constant for the IndexerName
22817 * class.cs (TypeContainer.Emit): Validate that all the indexers
22818 have the same IndexerName attribute, and if so, set the
22819 DefaultName attribute on the class.
22821 * typemanager.cs: The return value might contain other stuff (not
22822 only methods). For instance, consider a method with an "Item"
22823 property and an Item method.
22825 * class.cs: If there is a problem with the parameter types,
22828 2002-05-24 Ravi Pratap <ravi@ximian.com>
22830 * ecore.cs (ImplicitConversionExists): Wrapper function which also
22831 looks at user defined conversion after making a call to
22832 StandardConversionExists - we need this for overload resolution.
22834 * expression.cs : Update accordingly the various method calls.
22836 This fixes 2 bugs filed against implicit user defined conversions
22838 2002-05-22 Miguel de Icaza <miguel@ximian.com>
22840 * statement.cs: Track the result of the assignment.
22842 2002-05-21 Miguel de Icaza <miguel@ximian.com>
22844 * expression.cs (MemberAccess): Improved error reporting for
22845 inaccessible members.
22847 2002-05-22 Martin Baulig <martin@gnome.org>
22849 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
22850 itself with debugging support.
22852 2002-05-22 Martin Baulig <martin@gnome.org>
22854 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
22855 Removed, this isn't needed anymore.
22857 2002-05-20 Martin Baulig <martin@gnome.org>
22859 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
22860 be underlying type for an enum.
22862 2002-05-20 Miguel de Icaza <miguel@ximian.com>
22864 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
22865 that splits out the loading of just the core types.
22867 * rootcontext.cs (ResolveCore): Split the struct resolution in
22868 two, so we can load the enumeration underlying types before any
22871 * expression.cs (Is): Bandaid until we fix properly Switch (see
22872 bug #24985 for details).
22874 * typemanager.cs (ImplementsInterface): The hashtable will contain
22875 a null if there are no interfaces implemented.
22877 2002-05-18 Miguel de Icaza <miguel@ximian.com>
22879 * cs-parser.jay (indexer_declarator): It is fine to have array
22882 2002-05-17 Miguel de Icaza <miguel@ximian.com>
22884 * typemanager.cs: (RegisterBuilder): New function used to register
22885 TypeBuilders that implement interfaces. Since
22886 TypeBuilder.GetInterfaces (as usual) does not work with lame
22888 (AddUserType): register interfaces.
22890 (ImplementsInterface): Use the builder_to_ifaces hash if we are
22891 dealing with TypeBuilder. Also, arrays are showing up as
22892 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
22893 methods can not be invoked on them!
22895 * ecore.cs (ExplicitReferenceConversionExists): Made public.
22896 (ImplicitReferenceConversionExists): Split out from
22897 StandardConversionExists.
22899 * expression.cs (As): We were only implementing one of the three
22900 cases for the as operator. We now implement them all.
22901 (Is): Implement the various other cases for Is as well.
22903 * typemanager.cs (CACHE): New define used to control if we want or
22904 not the FindMembers cache. Seems to have a negative impact on
22905 performance currently
22907 (MemberLookup): Nested types have full acess to
22908 enclosing type members
22910 Remove code that coped with instance/static returns for events, we
22911 now catch this in RealFindMembers.
22913 (RealFindMembers): only perform static lookup if the instance
22914 lookup did not return a type or an event.
22916 2002-05-17 Miguel de Icaza <miguel@ximian.com>
22918 * assign.cs (CompoundAssign): We pass more semantic information
22919 now to Compound Assignments than we did before: now we have all
22920 the information at hand, and now we resolve the target *before* we
22921 do the expression expansion, which allows the "CacheValue" method
22922 to have the effect we intended (before, a [x] += 1 would generate
22923 two differen ArrayAccess expressions from the ElementAccess,
22924 during the resolution process).
22926 (CompoundAssign.DoResolve): Resolve target and original_source here.
22928 2002-05-16 Miguel de Icaza <miguel@ximian.com>
22930 * expression.cs (ArrayAccess): dropped debugging information.
22932 * typemanager.cs: Small bug fix: I was always returning i_members,
22933 instead of one of i_members or s_members (depending on which had
22936 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
22937 method is invoked before any code generation takes place, and it
22938 is a mechanism to inform that the expression will be invoked more
22939 than once, and that the method should use temporary values to
22940 avoid having side effects
22942 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
22944 * ecore.cs (Expression.CacheTemporaries): Provide empty default
22947 * expression.cs (Indirection, ArrayAccess): Add support for
22948 CacheTemporaries in these two bad boys.
22950 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
22951 ldobj or ldind_ref.
22952 (StoreFromPtr): Handle stobj as well.
22954 * expression.cs (UnaryMutator): Share more code.
22956 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
22957 down: I was not tracking the Filter function as well, which
22958 was affecting the results of the cache.
22960 2002-05-15 Miguel de Icaza <miguel@ximian.com>
22962 * attribute.cs: Remove the hack to handle the CharSet property on
22965 2002-05-14 Miguel de Icaza <miguel@ximian.com>
22967 * attribute.cs (DoResolve): More uglyness, we now only try to
22968 resolve the attribute partially, to extract the CharSet
22969 information (only if we are a StructLayout attribute). Otherwise
22971 (GetExtraTypeInfo): Add some code to conditionally kill in the
22972 future this. I am more and more convinced that the .NET
22973 framework has special code to handle the attribute setting on
22976 * expression.cs (IsParamsMethodApplicable): Revert my previous
22977 foreach change here, it was wrong.
22979 2002-05-13 Miguel de Icaza <miguel@ximian.com>
22981 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
22982 (pp_expr): do not abort on unknown input, just return.
22983 (eval): abort if there are pending chars.
22985 * attribute.cs (Attribute.Resolve): Positional parameters are
22986 optional. Deal with that case.
22988 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
22989 the Ansi/Unicode/Auto information for the type.
22991 (TypeContainer.DefineType): instantiate the EmitContext here, as
22992 we will be using it during the type definition (to resolve
22993 attributes) and during the emit phase.
22995 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
22996 to pull type information out of the attributes
22998 (Attribute.Resolve): track the constructor builder, and allow for
22999 multiple invocations (structs and classes will use this).
23001 * ecore.cs (MemberLookupFinal): new version with all the
23002 parameters customizable.
23004 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
23005 constructors. Return if the result value is null (as the error
23006 would have been flagged already by MemberLookupFinal)
23008 Do not allow instances of abstract classes or interfaces to be
23011 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
23012 We have to compare the assembly property here when dealing with
23013 FamANDAssem and Assembly access modifiers, because we might be
23014 creating an assembly from *modules* (that means that we are not
23015 getting TypeBuilders for types defined in other modules that are
23016 part of this assembly).
23018 (Method.Emit): If the method is marked abstract and has a body,
23021 (TypeContainer.DefineMembers): If both the defined member and the
23022 parent name match are methods, then do not emit any warnings: let
23023 the Method.Define routine take care of flagging warnings. But if
23024 there is a mismatch (method overrides something else, or method is
23025 overriwritten by something, then emit warning).
23027 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
23028 set to null, this means `do not check for the return type on the
23031 (Method.Define): set the return type for the method signature to
23032 null, so that we get methods with the same name and parameters and
23033 different return types. This is used to flag warning 114 (you are
23034 hiding a method, and you probably want to use the new/override
23037 * typemanager.cs (MemberLookup): Implemented proper access
23038 control, closing a long standing set of bug reports. The problem
23039 was that the Framework only has two bits: Public and NonPublic,
23040 and NonPublic includes private and protected methods, but we need
23041 to enforce the FamANDAssem, FamOrAssem and Family.
23043 2002-05-11 Miguel de Icaza <miguel@ximian.com>
23045 * statement.cs (GotoCase): Return true: Ammounts to giving up
23046 knowledge on whether we return or not, and letting the other case
23047 be responsible for it.
23049 2002-05-10 Miguel de Icaza <miguel@ximian.com>
23051 * driver.cs: Do not load directories for each file processed, only
23052 do it if there is a pattern.
23054 * ecore.cs: Report readonly assigns here as well, as we might have
23055 been resolved only by MemberAccess.
23057 (SimpleName.SimpleNameResolve): Also be useful for LValue
23058 resolution. We need this to propagate assign to local readonly variables
23060 * typemanager.cs: Use a ptrhashtable for the criteria, because we
23061 do not want to reuse potential criteria memory.
23063 * class.cs (MyEventBuilder): Set reflected_type;
23065 * ecore.cs (Constantify): Added support for constifying bools.
23067 (RootContext.LookupType): Added a cache for values looked up in
23068 the declaration space.
23070 * typemanager.cs (FindMembers): Now is a front-end to
23071 RealFindMembers, and provides a two-level hashtable-based cache to
23074 15% performance improvement: from 22.5 to 19.2 seconds.
23076 * expression.cs (IsParamsMethodApplicable): use foreach.
23077 (Invocation.DoResolve): ditto.
23078 (New.DoResolve): ditto.
23079 (ArrayCreation.DoResolve): ditto.
23081 * ecore.cs (FindMostEncompassingType): use foreach.
23083 * delegate.cs (NewDelegate.DoResolve): Use foreach
23085 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
23086 (RemoveMethods): use foreach.
23088 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
23089 nested foreach statements instead of for, and also break out of
23090 the inner loop once a match is found.
23092 (Invocation.OverloadResolve): Use foreach, simplify the code.
23094 2002-05-08 Miguel de Icaza <miguel@ximian.com>
23096 * cfold.cs (BinaryFold): During an enumeration evaluation context,
23097 we actually unwrap the expression to allow for extra information
23100 * expression.cs: Use Shr_Un on unsigned operations.
23102 2002-05-08 Ravi Pratap <ravi@ximian.com>
23104 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
23105 applicable operators was not being considered correctly. This closes
23106 the bug Miguel reported.
23108 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
23110 * attribute.cs: check that the type derives from System.Attribute
23111 and report the correct error in that case (moved the duplicate code to
23112 its own method, too).
23114 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
23116 * attribute.cs: lookup attribute type name as the spec says: first the
23117 bare attribute name and then name + "Attribute" (nant compiles with
23118 mcs after this fix).
23120 2002-05-07 Miguel de Icaza <miguel@ximian.com>
23122 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
23123 Because of the way we parse things, we should try to see if a
23124 UIntConstant can fit in an integer.
23126 2002-05-07 Ravi Pratap <ravi@ximian.com>
23128 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
23129 when we are in an explicit context.
23131 (ConvertReferenceExplicit): When converting from Iface type S to Class
23132 T make sure the rules are implemented as an OR.
23134 * parameter.cs (ParameterType): Make it a property for now although the
23135 purpose really isn't anything immediate.
23137 * expression.cs (Is*Applicable): Do better checking on the parameter type
23138 of a ref/out parameter. The ones from the system assemblies are already
23139 marked with the correct type so we don't need to do any correction.
23141 * ecore.cs (StandardConversionExists): Conversion from Interface types to
23142 the object type is standard too so include that.
23144 2002-05-06 Miguel de Icaza <miguel@ximian.com>
23146 * ecore.cs (StandardConversionExists): Augment with missing code:
23147 deal with IntConstant, LongConstants and Enumerations.
23149 * assign.cs: Report the error, instead of failing silently
23151 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
23152 typecontainer that they are declared, because the
23153 typecontainer/namespace will have the list of using clauses that
23154 need to be applied.
23156 Assembly Attributes were escaping the normal registration
23159 (EmitCode): Apply attributes within an EmitContext that represents
23160 the container they were declared on.
23162 * cs-parser.jay: Track bases for structs. How did I get this wrong?
23164 2002-05-06 Ravi Pratap <ravi@ximian.com>
23166 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
23167 Revamp completely - make much cleaner as we now operate only
23170 (FindMostSpecificSource, FindMostSpecificTarget): New methods
23171 to implement the logic detailed in the spec more correctly.
23173 (UserDefinedConversion): Update accordingly.
23175 2002-05-06 Miguel de Icaza <miguel@ximian.com>
23177 * statement.cs: Return flow analysis information up.
23179 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
23182 (token): Do not consume an extra character before calling
23185 2002-05-06 Piers Haken <piersh@friskit.com>
23187 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
23189 2002-05-06 Miguel de Icaza <miguel@ximian.com>
23191 * class.cs (Constructor.Emit): Set the IsStatic flag in the
23192 EmitContext during the instance constructor initializer
23193 resolution, to stop access to instance variables.
23195 This is mandated by the spec, last paragraph of the `constructor
23196 initializers' section.
23198 2002-05-05 Miguel de Icaza <miguel@ximian.com>
23200 * cs-parser.jay, class.cs (Accessor): new class used to represent
23201 an accessor (get or set). In the past we used `null' to represent
23202 a missing accessor. But this is ambiguous because there was no
23203 way to tell in abstract indexers/properties if one of them was
23206 Now there is a way of addressing that.
23208 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
23209 instead of FindMembers.
23211 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
23212 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
23214 * attribute.cs: Treat indexers and properties as the same in terms
23215 of applying attributes
23217 * ecore.cs (FindMostEncompassedType): Use statically initialized
23218 EmptyExpressions()s like we do elsewhere to avoid creating useless
23219 objects (and we take this out of the tight loop).
23221 (GetConversionOperators): Move the code to extract the actual
23222 operators to a separate routine to clean things up.
23224 2002-05-04 Miguel de Icaza <miguel@ximian.com>
23226 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
23227 events are always registered FieldBuilders.
23229 * class.cs (FieldBase): New class shared by Fields
23231 * delegate.cs: If we are a toplevel delegate, use our full name.
23232 If we are a nested delegate, then only use our tail name.
23234 2002-05-02 Ravi Pratap <ravi@ximian.com>
23236 * expression.cs (IsApplicable): Ensure that we add the "&" to
23237 ref/out types before comparing it with the type of the argument.
23239 (IsParamsMethodApplicable): Ditto.
23241 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
23244 * delegate.cs : Handle the case when we have more than one applicable
23245 method. Flag an error only when we finish checking all.
23247 2002-05-02 Miguel de Icaza <miguel@ximian.com>
23249 * expression.cs: Add support for boolean static initializers.
23251 2002-05-01 Miguel de Icaza <miguel@ximian.com>
23253 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
23255 * parameter.cs (ComputeParameterTypes,
23256 ComputeAndDefineParameterTypes): Better error handling: now we
23257 clear the `types' cache if we fail during any of the type lookups.
23258 We also return the status code correctly to our caller
23260 * delegate.cs: If we fail to define a delegate, abort the extra
23263 * expression.cs (Binary.ResolveOperator): for
23264 operator==(object,object) and operator !=(object, object) we also
23265 have to verify that there is an implicit conversion from one to
23268 (ArrayAccess.DoResolve): Array Access can operate on
23271 2002-04-30 Miguel de Icaza <miguel@ximian.com>
23273 * assign.cs (CompoundAssign): A new class used as a "flag" that
23274 the assignment actually is happening as part of a compound
23275 assignment operator.
23277 During compound assignment, a few new rules exist to enable things
23284 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
23285 to the type of x) if y is implicitly convertible to the type of x,
23286 and the operator is a builtin operator and the return type of the
23287 operator is explicitly convertible to the type of x.
23289 * rootcontext.cs: Reset warning level to 2. 4 catches various
23290 "interesting" features in mcs, we must clean this up at some
23291 point, but currently am trying to kill other bugs ;-)
23293 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
23294 in container classes as well.
23296 * expression.cs (Binary.ResolveOperator): Handle string case
23297 before anything else (as operator overloading does emit an error
23298 before doing anything else).
23300 This code could go away when we move to a table driven model, but
23301 i could not come up with a good plan last night.
23303 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
23305 * typemanager.cs (CSharpName): reimplementation using regex.
23306 * class.cs: added null check for fields in Emit
23307 * rootcontext.cs: set warninglevel to 4
23309 2002-04-29 Miguel de Icaza <miguel@ximian.com>
23311 * typemanager.cs (CSharpName): reimplemented with Lupus
23314 2002-04-28 Miguel de Icaza <miguel@ximian.com>
23316 * statement.cs (If): correclty implement Resolve, because we were
23317 not catching sem errors in there. The same process is needed
23319 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
23322 (Statement.Warning_DeadCodeFound): Factorize code.
23323 (While): Report dead code here too.
23325 (Statement): Added Resolve virtual method to allow
23326 for resolution split from the emit code.
23328 2002-04-26 Miguel de Icaza <miguel@ximian.com>
23330 * statement.cs (EmitBoolExpression): No longer try to resolve the
23332 (MakeBoolean): New utility function that resolve, implicitly
23333 converts to boolean and tags the expression.
23336 (If, Do): Implement dead code elimination.
23337 (While): Implement loop inversion
23339 (Do, While, For, If): Resolve the expression prior to calling our
23342 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
23345 - added method Report28 (warning: program has more than one entry point)
23346 - added method IsEntryPoint, implements paragraph 10.1 of the spec
23347 - modified method Method.Define, the part at the end of the method
23349 * rootcontext.cs: added static public Location EntryPointLocation;
23351 * ../errors/cs0028.cs : Add test case for the above warning.
23354 - modified method CSharpName to allow arrays of primitive type to
23355 be printed nicely (e.g. instead of System.Int32[][] it now prints
23357 - added method CSharpSignature: returns the signature of a method
23358 in string format to be used in reporting errors, warnings, etc.
23360 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
23363 2002-04-26 Ravi Pratap <ravi@ximian.com>
23365 * delegate.cs (Define): Fix extremely silly bug where I was
23366 setting the type of the 'object' parameter of the BeginInvoke
23367 method to System.IAsyncResult instead of System.Object ;-)
23369 2002-04-26 Miguel de Icaza <miguel@ximian.com>
23371 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
23374 (Constructor.Emit): return if we fail to initialize the
23375 constructor. Another door closed!
23377 * expression.cs (New.DoResolve): Improve error message (from -6 to
23378 1501). Use DeclaredOnly lookup to find the exact constructor.
23380 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
23381 loop. This is useful.
23383 * cs-parser.jay: Adjust the default parameters so that destructors
23384 have the proper signature.
23386 2002-04-26 Martin Baulig <martin@gnome.org>
23388 * driver.cs (LoadAssembly): If `assembly' contains any characters
23389 which are only valid in path names and not in assembly names
23390 (currently slash, backslash and point), use Assembly.LoadFrom ()
23391 instead of Assembly.Load () on the `assembly' (before iteration
23392 over the link_paths).
23394 2002-04-26 Martin Baulig <martin@gnome.org>
23396 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
23398 2002-04-25 Miguel de Icaza <miguel@ximian.com>
23400 * class.cs (Property): use the new typemanager.MemberLookup
23402 (TypeContainer.MemberLookup): Implement using the
23403 TypeManager.MemberLookup now.
23405 * typemanager.cs: Make MemberLookup a function of the TypeManager,
23406 and return MemberInfos, so that these can be used without an
23407 EmitContext (what we had before).
23409 2002-04-24 Miguel de Icaza <miguel@ximian.com>
23411 * expression.cs: Fix the case where the argument to params if the
23412 type of the params. I omitted handling this before. Fixed
23414 2002-04-22 Miguel de Icaza <miguel@ximian.com>
23416 * driver.cs: Call BootCorlib_PopulateCoreType
23418 * class.cs (Property.CheckBase): Check for properties only, not
23421 * interface.cs: Temporary hack: try/catch around the
23422 CustomAttributeBuilder, because I am getting an exception that I
23425 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
23426 types whose definitions are required to be there (attributes are
23427 defined before standard types).
23429 Compute definitions as we boot the various types, as they are used
23430 immediately (value_type class will need object_type, but if we do
23431 not initialize object_type, we will pass a null, which will let
23432 the runtime pick the System.Object from the existing corlib, which
23433 is not what we want).
23435 2002-04-22 Patrik Torstensson <totte@labs2.com>
23437 * cs-tokenizer.cs: fixed a number of trim() issues.
23439 2002-04-22 Ravi Pratap <ravi@ximian.com>
23441 * expression.cs (Argument.Type): Ensure that we return the correct
23442 type when we have out or ref parameters [in which case we
23445 2002-04-22 Miguel de Icaza <miguel@ximian.com>
23447 * class.cs (Property, Indexer): Allow extern modifier in there.
23449 * typemanager.cs (InitBaseTypes): Initializes object_type and
23450 value_type, since those will be used early on during the bootstrap
23451 process to compile corlib.
23453 (InitCoreTypes): Move code from here to InitBaseTypes.
23455 2002-04-21 Miguel de Icaza <miguel@ximian.com>
23457 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
23458 single-dimension arrays as using the ldlen opcode.
23460 Daniel Lewis discovered this optimization.
23462 * typemanager.cs: Add signature for System.Array::get_Length
23464 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23466 * statement.cs: report the error when the foreach does not apply to an
23467 array nor a collection.
23469 2002-04-19 Miguel de Icaza <miguel@ximian.com>
23471 * expression.cs: Add implicit conversions to the operator ~.
23473 * constant.cs (DecimalConstant.Emit): Emit decimal value.
23475 * typemanager.cs: Locate the decimal constructor.
23477 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23479 * attribute.cs: use the new property of TypeOf.
23480 * expression.cs: added 'get' property around typearg.
23482 These changes fix a build breaker reported by NickD. Is this the
23483 correct way to fix? If not, please, revert my changes and make it
23486 2002-04-17 Miguel de Icaza <miguel@ximian.com>
23488 * attribute.cs: Add support for typeof in attribute invocations.
23489 I am not sure that this is right though.
23491 2002-04-14 Duncan Mak <duncan@ximian.com>
23493 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
23494 Binary.Operator.Division case.
23496 2002-04-13 Ravi Pratap <ravi@ximian.com>
23498 * class.cs (DefineType): Ensure that we do a proper check on
23499 attribute types and also register it with the TypeManager.
23501 (TypeContainer.Targets): The default for attribute types is
23502 AttributeTargets.All.
23504 * attribute.cs (ApplyAttributes): Registering the attribute type
23505 is done elsewhere, not when we discover we have a Usage attribute.
23507 2002-04-12 Ravi Pratap <ravi@ximian.com>
23509 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
23510 and get rid of is_delegate parameter.
23512 * everywhere : update.
23514 2002-04-12 Ravi Pratap <ravi@ximian.com>
23516 * cs-parser.jay (compilation_unit): Revamp completely to use
23517 some new ideas that I got from Rhys' grammar to solve the problems
23518 with assembly level attributes.
23520 (outer_declaration): New grammar production.
23522 (attribute_sections): Add.
23524 (opt_attributes): Base on attribute_sections
23526 (namespace_declaration): Allow opt_attributes to tackle the case
23527 when we have assembly level attributes - we are clever in this
23530 * attribute.cs (ApplyAttributes): Do not worry about assembly
23531 attributes in the non-global context.
23533 * rootcontext.cs (AddGlobalAttributes): Go back to using this
23534 instead of SetGlobalAttributes.
23536 * class.cs, rootcontext.cs : Ensure we define and generate
23537 attribute types before anything else.
23539 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
23540 and flag the new error -20 for the case when the attribute type
23541 does not have valid targets specified. csc does not catch this.
23543 * ../errors/errors.txt : update for error # -20
23545 2002-04-11 Ravi Pratap <ravi@ximian.com>
23547 * support.cs (InternalParameters.ParameterModifier): Do some null
23548 checking and return sane values.
23550 * class.cs (Method.Define): If we are a PInvoke method, ensure
23551 that we are static and extern. Report error # 601
23553 * ../errors/cs0601.cs : Add test case for the above error.
23555 2002-04-07 Ravi Pratap <ravi@ximian.com>
23557 * rootcontext.cs (attribute_types): We need to keep type of
23558 all attribute types separately and emit code for them first.
23560 (RegisterAttribute) : Implement.
23562 * class.cs (DefineType): Check if the current Type is a custom
23563 attribute type and register it accordingly.
23565 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
23566 adding the first attribute twice and rename to
23568 (SetGlobalAttributes): this.
23570 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
23573 * attribute.cs (ApplyAttributes): Take an additional argument telling us
23574 if we are processing global arguments. Hmm, I am unsure of this.
23576 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23578 * expression.cs: added static array of strings to avoid calling
23579 Enum.ToString () for Operator in Binary. Significant recover of
23582 2002-04-10 Miguel de Icaza <miguel@ximian.com>
23584 * class.cs (FindMembers): Allow the Builders of the various
23585 members to be null. If they are skip them. This only happens
23586 during the PInvoke declaration.
23588 2002-04-09 Miguel de Icaza <miguel@ximian.com>
23590 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
23591 failure, so we do not keep going afterwards.
23593 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
23594 wanted to pass `false' as the `is_delegate' argument. If this is
23595 the case, why not use delegate_type == null to mean `is_delegate =
23596 false' and anything else as is_delegate = true.
23598 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
23600 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
23601 code for the section, not the beginning of the tests.
23603 2002-04-08 Miguel de Icaza <miguel@ximian.com>
23605 * cfold.cs: Handle operator + (Enum x, Underlying x)
23607 * expression.cs (Binary): same. Warn about errors where we have
23608 Enum/Enum in operator + as well.
23610 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
23613 - added support for switch(bool)
23614 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
23615 - add TableSwitchEmit() to handle table-based switch statements
23617 2002-04-05 Ravi Pratap <ravi@ximian.com>
23619 * expression.cs (Invocation.OverloadResolve): Factor out code which
23620 does parameter compatibility checking with arguments so that we can
23621 re-use the code even from Delegate.VerifyApplicability
23623 (VerifyArgumentsCompat): Move above code here.
23625 * delegate.cs (VerifyApplicability): Get rid of duplicate code
23626 and instead make a call to the above method.
23628 2002-03-31 Ravi Pratap <ravi@ximian.com>
23630 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
23631 We use it to keep track of classes which are attribute types.
23633 2002-04-02 Miguel de Icaza <miguel@ximian.com>
23635 * delegate.cs (Delegate.Define): Correctly define the types in the
23636 presence of fixed and array parameters.
23638 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
23641 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
23642 include NonPublic after the first iteration.
23644 * class.cs (Indexer.CheckBase): Only check if both parents are
23647 * cs-parser.jay (accessor_body): If empty, set to null.
23649 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
23650 same code path here to resolve constants names that we did have in
23651 MemberAccess.DoResolve. There is too much code duplicated here.
23653 2002-04-01 Miguel de Icaza <miguel@ximian.com>
23655 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
23657 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
23660 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
23661 tokens, numbers and strings.
23663 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
23666 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
23667 asyncronous parameters and the regular parameters.
23669 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
23670 specify the target directory.
23672 * expression.cs: (This.DoResolve): Simplify
23673 (As.Emit): Optimize, do not generate IsInst if the expression is
23674 always of the given type.
23676 (Is.DoResolve): Bug fix, we were reporting both always/never for
23679 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
23680 creating too many unnecessary arrays.
23682 2002-03-31 Miguel de Icaza <miguel@ximian.com>
23684 * class.cs (EmitFieldInitializer): Use Assign expression to assign
23685 fields instead of rolling our own initializer. Takes care of all
23686 implicit conversions, and drops unnecessary static checks/argument.
23688 2002-03-31 Dick Porter <dick@ximian.com>
23690 * driver.cs: use the GetDirectories() return values properly, and
23691 use "/" as path separator.
23693 2002-03-30 Miguel de Icaza <miguel@ximian.com>
23695 * expression.cs (Unary): Optimize - - expr into expr.
23696 (Binary): Optimize a + (-b) into a -b.
23698 * codegen.cs (CodeGen): Made all methods static.
23700 2002-03-29 Miguel de Icaza <miguel@ximian.com>
23704 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
23705 TypeBuilder property.
23707 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
23710 * tree.cs: Removed the various RecordXXXX, and replaced with a
23711 single RecordDecl. Removed all the accessor methods, and just
23712 left a single access point Type
23714 * enum.cs: Rename DefineEnum to DefineType.
23716 * decl.cs: New abstract method `DefineType' used to unify the
23717 Defines for Enumerations, Interfaces, TypeContainers and
23720 (FindType): Moved LookupInterfaceOrClass here. Moved the
23721 LookupBaseClasses method that used to live in class.cs and
23722 interface.cs here, and renamed to FindType.
23724 * delegate.cs: Implement DefineType. Take advantage of the
23725 refactored pattern for locating the parent builder without taking
23726 the parent_builder argument (which we know does not work if we are
23727 nested, and triggering a toplevel definition).
23729 2002-03-28 Miguel de Icaza <miguel@ximian.com>
23731 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
23732 accessibility of a member has changed during override and report
23735 * class.cs (Method.Define, Property.Define): Only complain on
23736 overrides if the method is private, any other accessibility is
23737 fine (and since we just checked the permission is the same, we are
23740 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
23741 and elif are processed always. The other pre-processing
23742 directives are only processed if we are "taking" the path
23744 2002-03-29 Martin Baulig <martin@gnome.org>
23746 * class.cs (Method.Emit): Only emit symbolic debugging info if the
23747 current location is not Null.
23749 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
23750 a separate method so we can profile it.
23752 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
23753 `span.Seconds' are just seconds, but no minutes or hours.
23754 (MainDriver): Profile the CodeGen.SaveSymbols calls.
23756 2002-03-28 Miguel de Icaza <miguel@ximian.com>
23758 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
23759 Remove the gratuitous set of Final:
23761 // If an interface implementation, then we can set Final.
23762 if (((flags & MethodAttributes.Abstract) == 0) &&
23763 implementing.DeclaringType.IsInterface)
23764 flags |= MethodAttributes.Final;
23766 I do not know what I was smoking when I used that.
23769 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
23770 step into fixing the name resolution issues for delegates and
23771 unifying the toplevel name resolution.
23773 2002-03-28 Martin Baulig <martin@gnome.org>
23775 * class.cs (Method.Emit): If we have a symbol writer, call its
23776 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
23777 tell it about the current method.
23779 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
23780 writer that we're going to emit the first byte of IL code for a new
23781 statement (a new source line).
23782 (EmitContext.EmitTopBlock): If we have a symbol writer, call
23783 EmitContext.Mark() before emitting any code.
23785 * location.cs (SymbolDocument): Return null when we're Null.
23787 * statement.cs (Statement): Moved the `Location loc' variable here.
23788 (Statement.EmitBoolExpression): If we have a symbol writer, call
23789 ec.Mark() before emitting any code to tell it that we're at the
23790 beginning of a new statement.
23791 (StatementExpression): Added `Location' argument to the constructor.
23792 (Block): Added public readonly variable `StartLocation' and public
23793 variable `EndLocation'. The latter is to be set using SetEndLocation().
23794 (Block): Added constructor which takes a start and end location.
23795 (Block.SetEndLocation): New method. This sets the end location.
23796 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
23797 local variables we create.
23798 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
23799 each statement and do also mark the begin and end of the block.
23801 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
23802 tell it the current lexer.Location, use Location.Null for the end of the
23804 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
23805 current block, set its end location using SetEndLocation().
23806 (statement_expression): StatementExpression constructor now takes the
23807 lexer.Location as additional argument.
23808 (for_statement, declare_local_variables): Likewise.
23809 (declare_local_variables): When creating a new implicit block, use the
23810 new Block constructor and pass it the lexer.Location.
23812 2002-03-28 Miguel de Icaza <miguel@ximian.com>
23814 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
23815 members also on the parent interfaces recursively.
23817 2002-03-27 Miguel de Icaza <miguel@ximian.com>
23819 * report.cs: Use new formats, since Gonzalo finished the missing
23822 * expression.cs (Binary.ResolveOperator): added missing operator|
23823 operator& and operator^ for bool/bool.
23825 * cs-parser.jay: CheckDef now takes a Location argument that is
23826 used to report errors more precisly (instead of reporting the end
23827 of a definition, we try to track something which is a lot closer
23828 to the source of the problem).
23830 * cs-tokenizer.cs: Track global token use, so we can properly flag
23831 the use of #define/#undef after the first token has been seen.
23833 Also, rename the reportXXXX to Error_DescriptiveName
23835 * decl.cs (DeclSpace.IsTopLevel): Move property here from
23836 TypeContainer, so that Enum and Interface can use this too.
23838 * class.cs (TypeContainer.LookupInterfaceOrClass,
23839 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
23840 `builder' argument. Typically this was used to pass the parent
23841 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
23844 The problem is that a nested class could trigger the definition of
23845 a toplevel class, and the builder would be obviously wrong in that
23848 So we drop this argument, and we compute dynamically the
23849 TypeBuilder/ModuleBuilder (the correct information was available
23850 to us anyways from DeclSpace.Parent)
23852 * interface.cs (Interface.DefineInterface): Drop builder
23853 parameter cleanup like class.cs
23855 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
23858 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
23861 (Try.Emit): Propagate the returns value from the statement.
23863 (Return.Emit): Even if we are leavning
23865 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
23867 * modifiers.cs: Fix the computation of MethodAttributes flags.
23869 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
23871 * driver.cs: allow compilation of files that start with '/'.
23872 Add a default case when checking the argument of --target.
23874 2002-03-25 Miguel de Icaza <miguel@ximian.com>
23876 * interface.cs: Implement the same search algorithm for types in
23877 the interface code.
23879 * delegate.cs: Do not allow multiple definition.
23881 * Recovered ChangeLog that got accidentally amputated
23883 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
23885 * rootcontext.cs: Load manually enum to allow core classes to
23886 contain enumerations.
23888 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
23889 Update to new static methods in TypeManager.
23891 * typemanager.cs (GetMethod, GetConstructor): Use our
23892 implementation of FindMembers to find the members, since during
23893 corlib compilation, the types are TypeBuilders and GetMethod and
23894 GetConstructor do not work.
23896 Make all methods in TypeManager static.
23898 (InitCodeHelpers): Split the functionality from
23899 the InitCodeTypes function.
23901 * driver.cs: Call InitCodeHelpers after we have populated the
23904 * cs-parser.jay (delegate_declaration): we did not used to compute
23905 the delegate name correctly for void delegates.
23907 2002-03-24 Miguel de Icaza <miguel@ximian.com>
23909 * rootcontext.cs (RootContext): Init the interface_resolve_order
23910 and type_container_resolve_order always.
23912 (ResolveCore, BootstrapCorlib_ResolveClass,
23913 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
23914 compiler when compiling with --nostdlib
23916 * class.cs (TypeContainer.DefineType): Check that our parent is
23917 not null. This test is most important when we are bootstraping
23920 * codegen.cs: Split out the symbol writing code.
23922 2002-03-25 Martin Baulig <martin@gnome.org>
23924 * driver.cs (-g): Made -g an alias for --debug.
23926 2002-03-24 Martin Baulig <martin@gnome.org>
23928 * codegen.cs (SymbolWriter): New public variable. Returns the
23929 current symbol writer.
23930 (CodeGen): Added `bool want_debugging_support' argument to the
23931 constructor. If true, tell the ModuleBuild that we want debugging
23932 support and ask it for the ISymbolWriter.
23933 (Save): If we have a symbol writer, call it's Close() method after
23934 saving the assembly.
23936 * driver.c (--debug): New command line argument to create a
23937 debugger information file.
23939 * location.cs (SymbolDocument): New public property. Returns an
23940 ISymbolDocumentWriter object for the current source file or null
23941 if we don't have a symbol writer.
23943 2002-03-21 Miguel de Icaza <miguel@ximian.com>
23945 * driver.cs (LoadAssembly): Correctly return when all the paths
23946 have been tried and not before.
23948 * statement.cs (Switch.Emit): return the actual coverage for this
23949 statement (returns/not-returns)
23951 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
23952 switch of the statement if we are the last switch section. That
23953 kills two problems: try/catch problems (we used to emit an empty
23954 nop at the end) and switch statements where all branches would
23957 2002-03-19 Miguel de Icaza <miguel@ximian.com>
23959 * driver.cs: Add default assemblies (the equivalent to the
23960 Microsoft CSC.RSP file)
23962 * cs-tokenizer.cs: When updating `cols and setting it to zero,
23963 also update tokens_seen and set it to false.
23965 * driver.cs: Implement --recurse for Mike.
23967 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
23968 correctly splitting out the paths.
23970 2002-03-18 Miguel de Icaza <miguel@ximian.com>
23972 * interface.cs (Interface.PopulateProperty): Instead of using
23973 `parent' as the declaration space for the set parameters, use
23976 * support.cs (InternalParameters): InternalParameters constructor
23977 takes a DeclSpace instead of a TypeContainer.
23979 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
23980 types are being initialized, load the address of it before calling
23983 (New): Provide a mechanism to disable the generation of local
23984 value type temporaries when the caller will be providing us with
23985 an address to store it.
23987 (ArrayCreation.EmitDynamicInitializers): Use it.
23989 2002-03-17 Miguel de Icaza <miguel@ximian.com>
23991 * expression.cs (Invocation.EmitArguments): Only probe for array
23992 property if there is more than one argument. Sorry about that.
23994 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
23995 empty param arrays.
23997 * class.cs (Method.LabelParameters): Fix incorrect code path that
23998 prevented the `ParamArrayAttribute' from being applied to the
24001 2002-03-16 Miguel de Icaza <miguel@ximian.com>
24003 * support.cs (ReflectionParameters): Correctly compute whether the
24004 last argument is a params array. Fixes the problem with
24007 * typemanager.cs: Make the assemblies array always be non-null
24008 (empty, but non-null)
24010 * tree.cs (RecordDecl): New function that abstracts the recording
24011 of names. This reports error 101, and provides a pointer to the
24012 previous declaration. Fixes a crash in the compiler.
24014 * cs-parser.jay (constructor_declaration): Update to new grammar,
24015 and provide a constructor_body that can be empty.
24017 2002-03-15 Miguel de Icaza <miguel@ximian.com>
24019 * driver.cs: Add support for --resources.
24021 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
24022 Make all types for the various array helper methods be integer.
24024 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
24025 CheckState to ConvCast.
24027 (ConvCast): Now it takes a `checked' state argument, to avoid
24028 depending on the emit context for the conversion, and just using
24029 the resolve time setting.
24031 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
24032 instead of Invocation.EmitArguments. We do not emit the original
24033 arguments, instead we emit those which have been converted to
24034 unsigned int expressions.
24036 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
24038 * codegen.cs: ditto.
24040 * expression.cs (LocalVariableReference): Drop the use of the
24041 Store function that depended on the variable index.
24043 * statement.cs (VariableInfo): Drop the `Idx' property from this
24044 class, as this is not taking into account the indexes for
24045 temporaries tat we generate during the execution, getting the
24048 * class.cs: First emit class initializers, then call the parent
24051 * expression.cs (Binary): Fix opcode emision.
24052 (UnaryMutator.EmitCode): Support checked code generation
24054 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
24055 matches for events for both the Static and Instance scans,
24056 pointing to the same element. Fix that.
24058 2002-03-14 Miguel de Icaza <miguel@ximian.com>
24060 * rootcontext.cs (ResolveTree): Always set the
24061 interface_resolve_order, because nested interfaces will be calling
24064 * class.cs (GetInterfaceOrClass): Track the same resolution
24065 process used by TypeManager.LookupType. This fixes the nested
24066 type lookups in class declarations (separate path from
24069 (TypeContainer.DefineType): Also define nested interfaces.
24070 (TypeContainer.RegisterOrder): New public function used to
24071 register the order in which child interfaces need to be closed.
24073 Nested interfaces need to be closed after their parents have been
24076 * interface.cs (InterfaceAttr): Put all the logic for computing
24077 the interface attribute here.
24079 (DefineInterface): Register our interface order with the
24080 RootContext or with the TypeContainer depending on the case.
24082 2002-03-12 Miguel de Icaza <miguel@ximian.com>
24084 * cs-parser.jay: rework foreach statement to work with the new
24085 changes to the policy on SimpleNames.
24087 * report.cs: support Stacktrace on warnings as well.
24089 * makefile: drop --unsafe and /unsafe from the compile.
24091 2002-03-13 Ravi Pratap <ravi@ximian.com>
24093 * ecore.cs (StandardConversionExists): Modify to take an Expression
24094 as the first parameter. Ensure we do null -> reference type conversion
24097 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
24098 temporary Expression objects.
24100 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
24102 * interface.cs: workaround bug in method overloading resolution
24103 (there is already a bugzilla bug for it).
24105 2002-03-12 Miguel de Icaza <miguel@ximian.com>
24107 We could also solve this problem by having a separate path for
24108 performing type lookups, instead of DoResolve, we could have a
24109 ResolveType entry point, and only participating pieces of the
24110 production (simplename, deref, array) would implement this.
24112 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
24113 signal SimpleName to only resolve type names and not attempt to
24114 resolve anything else.
24116 * expression.cs (Cast): Set the flag.
24118 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
24120 * class.cs: Only report 108 if there is no `new' modifier.
24122 * cs-parser.jay: rework foreach statement to work with the new
24123 changes to the policy on SimpleNames.
24125 * report.cs: support Stacktrace on warnings as well.
24127 * makefile: drop --unsafe and /unsafe from the compile.
24129 2002-03-11 Miguel de Icaza <miguel@ximian.com>
24131 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
24132 lookups here, instead of doing that at parse time. This means
24133 that our grammar will not introduce `LocalVariableReferences' as
24134 expressions at this point. That solves the problem of code like
24138 static void Main ()
24142 This is only half the fix. The full fix requires parameters to
24143 also be handled in this way.
24145 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
24146 makes the use more obvious of the DeclSpace. The
24147 ec.TypeContainer.TypeBuilder is now only used to pull the
24148 TypeBuilder for it.
24150 My theory is that I can get rid of the TypeBuilder completely from
24151 the EmitContext, and have typecasts where it is used (from
24152 DeclSpace to where it matters).
24154 The only pending problem is that the code that implements Aliases
24155 is on TypeContainer, and probably should go in DeclSpace.
24157 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
24158 lookups here, instead of doing that at parse time. This means
24159 that our grammar will not introduce `LocalVariableReferences' as
24160 expressions at this point. That solves the problem of code like
24164 static void Main ()
24168 This is only half the fix. The full fix requires parameters to
24169 also be handled in this way.
24171 * class.cs (Property.DefineMethod): When implementing an interface
24172 method, set newslot, when implementing an abstract method, do not
24173 set the flag (before we tried never setting it, or always setting
24174 it, which is the difference).
24175 (Indexer.DefineMethod): same.
24176 (Method.DefineMethod): same.
24178 * ecore.cs: Only set the status used flag if we get back a Field.
24180 * attribute.cs: Temporary hack, so Paolo can keep working.
24182 2002-03-08 Ravi Pratap <ravi@ximian.com>
24184 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
24185 the unmanaged type in the case we have a MarshalAs attribute.
24187 (Resolve): Handle the case when we are parsing the special MarshalAs
24188 attribute [we need to store the unmanaged type to use later]
24190 * typemanager.cs (marshal_as_attr_type): Built in type for the
24191 MarshalAs Attribute.
24193 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
24194 on parameters and accordingly set the marshalling info.
24196 2002-03-09 Miguel de Icaza <miguel@ximian.com>
24198 * class.cs: Optimizing slightly by removing redundant code after
24199 we switched to the `NoTypes' return value.
24200 (Property.DefineMethod): use NoTypes here too.
24202 This fixes the bug I introduced in my last batch of changes.
24204 2002-03-05 Ravi Pratap <ravi@ximian.com>
24206 * tree.cs (RecordEnum): Add. We now keep track of enums too.
24208 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
24209 Enums since those are types too.
24211 * cs-parser.jay (enum_declaration): Record enums as we parse them.
24213 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
24214 thanks to a call during the lookup process.
24216 2002-03-07 Miguel de Icaza <miguel@ximian.com>
24218 * statement.cs (Foreach): Lots of work to accomodate a particular
24219 kind of foreach statement that I had not kept in mind. It is
24220 possible to have foreachs on classes that provide a GetEnumerator
24221 method that return objects that implement the "pattern" for using
24222 a foreach, there is no need to support GetEnumerator
24225 This is needed to compile nant.
24227 * decl.cs: Only report 114 if the member is not `Finalize' and if
24228 the warning level is at least 2.
24230 * class.cs: Moved the compare function from Method to
24233 (MethodSignature.InheritableMemberSignatureCompare): Add new
24234 filter function that is used to extract inheritable methods from a
24237 (Method.Define): Use the new `inheritable_method_signature_filter'
24240 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
24243 2002-03-06 Miguel de Icaza <miguel@ximian.com>
24245 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
24247 * cs-parser.jay: Add opt_semicolon to the interface declaration.
24249 * expression.cs: Pass location information to
24250 ConvertImplicitStandard.
24252 * class.cs: Added debugging code to track return values from
24255 2002-03-05 Miguel de Icaza <miguel@ximian.com>
24257 * expression.cs (Is.DoResolve): If either side of the `is' is an
24258 interface, do not flag the warning.
24260 * ecore.cs (ImplicitReferenceConversion): We need a separate test
24263 * report.cs: Allow for --fatal to be used with --probe.
24265 * typemanager.cs (NoTypes): Move the definition for the empty Type
24268 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
24270 (TypeContainer.DefineProxy): New function used to proxy to parent
24271 implementations when implementing interfaces.
24272 (TypeContainer.ParentImplements): used to lookup if our parent
24273 implements a public function that is required by an interface.
24274 (TypeContainer.VerifyPendingMethods): Hook this up.
24276 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
24277 `modules' and `assemblies' arraylists into arrays. We only grow
24278 these are the very early start up of the program, so this improves
24279 the speedof LookupType (nicely measured).
24281 * expression.cs (MakeByteBlob): Replaced unsafe code with
24282 BitConverter, as suggested by Paolo.
24284 * cfold.cs (ConstantFold.Binary): Special case: perform constant
24285 folding of string concatenation, but if either side is a string,
24286 and the other is not, then return null, and let the runtime use
24287 the concatenation on the string plus the object (using
24288 `Object.ToString').
24290 2002-03-04 Miguel de Icaza <miguel@ximian.com>
24292 Constant Folding has been implemented now.
24294 * expression.cs (Unary.Reduce): Do not throw an exception, catch
24295 the error instead on types that are not supported in one's
24298 * constant.cs (Constant and all children): New set of functions to
24299 perform implict and explicit conversions.
24301 * ecore.cs (EnumConstant): Implement the new functions to perform
24302 conversion by proxying to the child expression.
24304 * codegen.cs: (ConstantCheckState): Constant evaluation has its
24305 own separate setting that can not be turned off from the command
24306 line using --unchecked or --checked and is only controlled using
24307 the checked/unchecked statements and expressions. This setting is
24308 used by the constant folder to flag errors.
24310 * expression.cs (CheckedExpr, UncheckedExpr): Set the
24311 ConstantCheckState as well.
24313 During Resolve, they also have to flag the state, because the
24314 constant folder runs completely in the Resolve phase.
24316 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
24319 2002-03-01 Miguel de Icaza <miguel@ximian.com>
24321 * cfold.cs: New file, this file contains the constant folder.
24323 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
24324 argument to track whether we are using the resulting address to
24325 load or store a value and provide better error messages.
24327 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
24328 new AddressOf arguments.
24330 * statement.cs (Foreach.EmitCollectionForeach): Update
24332 * expression.cs (Argument.Emit): Call AddressOf with proper
24333 arguments to track usage.
24335 (New.DoEmit): Call AddressOf with new arguments.
24337 (Unary.Emit): Adjust AddressOf call.
24339 2002-03-01 Ravi Pratap <ravi@ximian.com>
24341 * cs-parser.jay (member_access): Change the case for pre-defined types
24342 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
24345 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
24348 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
24349 essentially like methods and apply attributes like MethodImplOptions to them too.
24351 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
24354 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
24355 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
24358 * Update code everywhere accordingly.
24360 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
24362 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
24364 2002-02-28 Ravi Pratap <ravi@ximian.com>
24366 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
24367 try performing lookups against those instead of jumping straight into using
24368 the 'using' clauses.
24370 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
24372 (LookupType): Perform lookups in implicit parents too.
24374 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
24375 sequence as RootContext.LookupType.
24377 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
24378 the various cases of namespace lookups into this method.
24380 2002-03-01 Miguel de Icaza <miguel@ximian.com>
24382 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
24383 in positional arguments)
24385 * class.cs (Operator): Update the AllowedModifiers to contain
24388 * cs-parser.jay: Update operator declaration to allow for the
24389 operator body to be empty.
24391 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
24394 2002-02-27 Miguel de Icaza <miguel@ximian.com>
24396 * class.cs (Method.Emit): Label parameters.
24398 * driver.cs: Return 1 or 0 as the program exit code.
24400 2002-02-26 Miguel de Icaza <miguel@ximian.com>
24402 * expression.cs: Special case the `null' object when trying to
24403 auto-compute the type, as anything can be explicitly converted to
24406 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
24407 spotting this Paolo.
24409 (Expression.ImplicitNumericConversion): Perform comparissions of
24410 the type using the underlying type in the case of an enumeration
24411 rather than using the enumeration type for the compare.
24413 Cope with the underlying == type case, which is not possible to
24416 (Expression.ConvertNumericExplicit): Perform comparissions of
24417 the type using the underlying type in the case of an enumeration
24418 rather than using the enumeration type for the compare.
24420 * driver.cs: If the user does not supply an extension, assume .exe
24422 * cs-parser.jay (if_statement): Rewrote so that we can track the
24423 location for the if statement.
24425 * expression.cs (Binary.ConstantFold): Only concat strings when
24426 the operation is "+", not everything ;-)
24428 * statement.cs (Statement.EmitBoolExpression): Take a location
24430 (If, While, Do): Track location.
24432 * expression.cs (Binary.ResolveOperator): In the object + string
24433 case, I was missing a call to ConvertImplicit
24435 2002-02-25 Ravi Pratap <ravi@ximian.com>
24437 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
24438 Location arguments. Ensure we use RootContext.LookupType to do our work
24439 and not try to do a direct Type.GetType and ModuleBuilder.GetType
24441 * interface.cs (PopulateMethod): Handle the type of the parameter being
24444 * expression.cs (Invocation.BetterFunction): Handle the case when we
24445 have a params method with no fixed arguments and a call is made with no
24448 2002-02-25 Miguel de Icaza <miguel@ximian.com>
24450 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
24451 the verbatim-string-literal
24453 * support.cs (InternalParameters.ParameterModifier): handle null
24455 (InternalParameters.ParameterType): ditto.
24457 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
24458 duplicating the name of the variable parameter.
24459 (GetParameterByName): Fix bug where we were not looking up array
24460 paramters if they were the only present (thanks Paolo!).
24461 (GetParameterInfo): We only have an empty set of types if both
24462 fixed and array are set to null.
24463 (GetParameterInfo-idx): Handle FixedParameter == null
24465 * cs-parser.jay: Handle the case where there is no catch
24466 statements (missing null test).
24468 2002-02-22 Miguel de Icaza <miguel@ximian.com>
24470 * driver.cs (MainDriver): Be conservative on our command line
24473 Catch DirectoryNotFoundException when calling GetFiles.
24475 (SplitPathAndPattern): Used to split the input specification into
24476 a path and a pattern that we can feed to Directory.GetFiles.
24478 2002-02-21 Miguel de Icaza <miguel@ximian.com>
24480 * statement.cs (Fixed): Implement the last case of the Fixed
24481 statement (string handling).
24483 * expression.cs (StringPtr): New class used to return a char * to
24484 a string; Used by the Fixed statement.
24486 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
24488 * expression.cs (Binary.ResolveOperator): Remove redundant
24489 MemberLookup pn parent type.
24490 Optimize union call, we do not need a union if the types are the same.
24491 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
24494 Specialize the use of MemberLookup everywhere, instead of using
24495 the default settings.
24497 (StackAlloc): Implement stackalloc keyword.
24499 * cs-parser.jay: Add rule to parse stackalloc.
24501 * driver.cs: Handle /h, /help, /?
24503 * expression.cs (MakeByteBlob): Removed the hacks we had in place
24504 before we supported unsafe code.
24506 * makefile: add --unsafe to the self compilation of mcs.
24508 2002-02-20 Miguel de Icaza <miguel@ximian.com>
24510 * expression.cs (PointerArithmetic): New class that is used to
24511 perform pointer arithmetic.
24512 (Binary.Resolve): Handle pointer arithmetic
24513 Handle pointer comparission.
24514 (ArrayPtr): Utility expression class that is used to take the
24515 address of an array.
24517 (ElementAccess): Implement array access for pointers
24519 * statement.cs (Fixed): Implement fixed statement for arrays, we
24520 are missing one more case before we are done.
24522 * expression.cs (Indirection): Implement EmitAssign and set the
24523 ExprClass to Variable. This allows pointer dereferences to be
24524 treated as variables, and to have values assigned to them.
24526 * ecore.cs (Expression.StoreFromPtr): New utility function to
24527 store values dereferencing.
24529 2002-02-20 Ravi Pratap <ravi@ximian.com>
24531 * expression.cs (Binary.ResolveOperator): Ensure that we are
24532 not trying to operate on a void type - this fixes the reported
24535 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
24536 the parent implementation is sealed.
24538 * ../errors/cs0239.cs : Add.
24540 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
24542 * typemanager.cs (unverifiable_code_type): Corresponds to
24543 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
24544 which have unsafe code in them.
24546 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
24549 2002-02-19 Miguel de Icaza <miguel@ximian.com>
24551 * cs-tokenizer.cs: Add support for @"litreal strings"
24553 Make tokenizer accept pre-processor directives
24554 on any column (remove the old C-like limitation).
24556 * rootcontext.cs (EmitCode): Emit any global attributes.
24557 (AddGlobalAttributes): Used to keep track of assembly attributes.
24559 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
24561 * cs-parser.jay: Add support for global attributes.
24563 2002-02-17 Miguel de Icaza <miguel@ximian.com>
24565 * expression.cs (Indirection): New helper class. Unary will
24566 create Indirection classes to be able to implement the
24567 IMemoryLocation interface on it.
24569 2002-02-16 Miguel de Icaza <miguel@ximian.com>
24571 * cs-parser.jay (fixed_statement): reference the right statement.
24573 * statement.cs (Fixed.Emit): Finish implementing the fixed
24574 statement for the &x case.
24576 2002-02-14 Miguel de Icaza <miguel@ximian.com>
24578 * class.cs (Property.Define, Method.Define): Remove newslot when
24581 * modifiers.cs: My use of NewSlot when `Abstract' was set was
24582 wrong. NewSlot should only be used if the `new' keyword is present.
24584 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
24585 locating our system dir. Sorry about this.
24587 2002-02-13 Miguel de Icaza <miguel@ximian.com>
24589 * driver.cs (GetSystemDir): Compute correctly the location of our
24590 system assemblies. I was using the compiler directory instead of
24591 the library directory.
24593 2002-02-13 Ravi Pratap <ravi@ximian.com>
24595 * expression.cs (BetterFunction): Put back in what Miguel commented out
24596 since it is the correct fix. The problem is elsewhere ;-)
24598 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
24599 parameters of the parms method are themselves compatible or not !
24601 (StandardConversionExists): Fix very dangerous bug where we were forgetting
24602 to check that a class implements an interface before saying that an implicit
24603 conversion was allowed. Use ImplementsInterface to do the checking.
24605 2002-02-13 Miguel de Icaza <miguel@ximian.com>
24607 * class.cs (Method.Define): Track whether we are an explicit
24608 implementation or not. And only call DefineMethodOverride if we
24609 are an explicit implementation.
24611 (Property.DefineMethod): Ditto.
24613 2002-02-11 Ravi Pratap <ravi@ximian.com>
24615 * expression.cs (BetterFunction): Catch hideous bug which was
24616 preventing us from detecting ambiguous calls due to implicit casts i.e
24619 2002-01-29 Miguel de Icaza <miguel@ximian.com>
24621 * support.cs (Pair): Remove un-needed method. I figured why I was
24622 getting the error in cs-parser.jay, the variable in a foreach loop
24623 is readonly, and the compiler does not really treat this as a variable.
24625 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
24626 instead of EQUALS in grammar.
24628 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
24630 * expression.cs (Unary.DoResolve): Check whether the argument is
24633 2002-01-28 Miguel de Icaza <miguel@ximian.com>
24635 * support.cs: Api for Pair to set a value. Despite the fact that
24636 the variables are public the MS C# compiler refuses to compile
24637 code that accesses the field if the variable is part of a foreach
24640 * statement.cs (Fixed): Begin implementation of the fixed
24643 (Block.AddVariable): Return the VariableInfo on success and null
24644 on failure instead of true/false.
24646 * cs-parser.jay (foreach): Catch errors on variables already
24647 defined (we were ignoring this value before) and properly unwind
24648 the block hierarchy
24650 (fixed_statement): grammar for the fixed statement.
24652 2002-01-25 Miguel de Icaza <miguel@ximian.com>
24654 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
24655 pointer types to be incretemented.
24657 (SizeOf): Implement.
24659 * cs-parser.jay (pointer_member_access): Implement
24660 expr->IDENTIFIER production.
24662 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
24663 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
24666 (Unary): Implement indirection.
24668 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
24669 use in non-unsafe context).
24671 (SimpleName.DoResolve): Check for pointers in field access on safe
24674 (Expression.LoadFromPtr): Factor the load-indirect code in this
24675 function. This was duplicated in UnboxCast and ParameterReference
24677 2002-01-24 Miguel de Icaza <miguel@ximian.com>
24679 * expression.cs (ComposedCast): report an error if a pointer cast
24680 is used in a safe region.
24682 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
24683 pointer type casts in unsafe context.
24685 * codegen.cs (EmitContext): Set up IsUnsafe.
24687 * cs-parser.jay (non_expression_type): Add productions for pointer
24690 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
24691 code. We should not use force into static mode if the method is
24692 not virtual. Fixes bug in MIS
24694 * statement.cs (Do.Emit, While.Emit, For.Emit,
24695 Statement.EmitBoolExpression): Add support to Do and While to
24696 propagate infinite loop as `I do return' semantics.
24698 Improve the For case to also test for boolean constants.
24700 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
24701 to the list of attributes we can add.
24703 Remove `EmitContext' argument.
24705 * class.cs (Method.Define): Apply parameter attributes.
24706 (Constructor.Define): Apply parameter attributes.
24707 (MethodCore.LabelParameters): Move here the core of labeling
24710 * support.cs (ReflectionParameters.ParameterModifier,
24711 InternalParameters.ParameterModifier): Use IsByRef on the type and
24712 only return the OUT bit for these parameters instead of in/out/ref
24715 This is because I miss-understood things. The ParameterInfo.IsIn
24716 and IsOut represent whether the parameter has the [In] and [Out]
24719 2002-01-22 Miguel de Icaza <miguel@ximian.com>
24721 * ecore.cs (FieldExpr.Emit): Release temporaries.
24723 * assign.cs (LocalTemporary.Release): new function.
24725 * codegen.cs (EmitContext.GetTemporaryStorage,
24726 EmitContext.FreeTemporaryStorage): Rework the way we deal with
24727 temporary storage. Now we can "put back" localbuilders when we
24730 2002-01-21 Miguel de Icaza <miguel@ximian.com>
24732 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
24733 need to make a copy of the variable to generate verifiable code.
24735 2002-01-19 Miguel de Icaza <miguel@ximian.com>
24737 * driver.cs: Compute dynamically the system directory.
24739 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
24740 Slower, but more generally useful. Used by the abstract
24741 registering implementation.
24743 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
24744 the rules for the special rule on Type/instances. First check if
24745 we have the same name, and if so, try that special static path
24746 rather than the instance path.
24748 2002-01-18 Miguel de Icaza <miguel@ximian.com>
24750 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
24753 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
24754 Enum, ValueType, Delegate or Array for non-corlib compiles.
24756 * cs-tokenizer.cs: Catch long identifiers (645)
24758 * typemanager.cs (IndexerPropetyName): Ravi never tested this
24761 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
24762 fix, we were returning too early, so we were not registering
24763 pending methods from abstract classes.
24765 Do not register pending methods if the class is abstract.
24767 * expression.cs (Conditional.DoResolve): Report circular implicit
24768 conversions when we neecd to compute it for conditional
24771 (Is.DoResolve): If the expression is always of the provided type,
24772 flag warning 183. If the expression can not ever be of the
24773 provided type flag warning 184.
24775 * class.cs: Catch 169 as well.
24777 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
24780 2002-01-18 Nick Drochak <ndrochak@gol.com>
24782 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
24784 2002-01-17 Miguel de Icaza <miguel@ximian.com>
24786 * interface.cs: (PopulateMethod): Check for pointers being defined
24787 only if the unsafe context is active.
24788 (PopulateProperty): ditto.
24789 (PopulateIndexer): ditto.
24791 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
24792 specified. If pointers are present, make sure that they are
24793 present in an unsafe context.
24794 (Constructor, Constructor.Define): ditto.
24795 (Field, Field.Define): ditto.
24796 (Property, Property.Define): ditto.
24797 (Event, Event.Define): ditto.
24799 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
24800 hashtable if there are classes or structs defined.
24802 * expression.cs (LocalVariableReference.DoResolve): Simplify this
24803 code, as the constant resolution moved.
24805 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
24806 the metadata, so we can flag error 133.
24808 * decl.cs (MemberCore.UnsafeOK): New function to test that a
24809 pointer is being declared in an unsafe context.
24811 2002-01-16 Miguel de Icaza <miguel@ximian.com>
24813 * modifiers.cs (Modifiers.Check): Require a Location argument.
24814 Report error 227 for Unsafe use.
24816 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
24818 * statement.cs (For.Emit): If the test is null, then report that
24819 we do `return', as we wont reach anything afterwards.
24821 (Switch.SwitchGoverningType): Track the expression that matched
24824 * driver.cs: Allow negative numbers as an error code to flag.
24826 * cs-parser.jay: Handle 1551.
24828 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
24830 2002-01-15 Miguel de Icaza <miguel@ximian.com>
24832 * cs-parser.jay: Report 1518 (type declaration can only contain
24833 class, struct, interface, enum or delegate)
24835 (switch_label): Report 1523 (keywords `case' or `default' must
24838 (opt_switch_sections): Report 1522 (empty switch)
24840 * driver.cs: Report 1515 (response file specified multiple times)
24841 Report 1516 (Source file specified multiple times).
24843 * expression.cs (Argument.Resolve): Signal 1510
24845 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
24846 access not allowed in static code)
24848 2002-01-11 Ravi Pratap <ravi@ximian.com>
24850 * typemanager.cs (IsPointerType): Utility method which we are going
24853 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
24854 the object type, so we take care of that.
24856 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
24858 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
24859 added to non-params parameters :-)
24861 * typemanager.cs (CSharpName): Include 'void' type too.
24863 (void_ptr_type): Include in the set of core types.
24865 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
24868 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
24871 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
24872 completely forgotten about it.
24874 2002-01-10 Ravi Pratap <ravi@ximian.com>
24876 * cs-parser.jay (pointer_type): Add. This begins our implementation
24877 of parsing rules for unsafe code.
24879 (unsafe_statement): Implement.
24881 (embedded_statement): Modify to include the above.
24883 * statement.cs (Unsafe): Implement new class for unsafe blocks.
24885 * codegen.cs (EmitContext.InUnsafe): Add. This determines
24886 if the current context is an unsafe one.
24888 * cs-parser.jay (local_variable_pointer_type): Since local variable types
24889 are handled differently, we need separate rules for them.
24891 (local_variable_declaration): Update to use local_variable_pointer_type
24892 to allow variable declarations of unmanaged pointer types.
24894 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
24895 in unsafe contexts.
24897 * ../errors/cs0214.cs : Add.
24899 2002-01-16 Nick Drochak <ndrochak@gol.com>
24901 * makefile: remove 'response' file when cleaning.
24903 2002-01-15 Miguel de Icaza <miguel@ximian.com>
24905 * cs-parser.jay: Report 1524.
24907 2002-01-14 Miguel de Icaza <miguel@ximian.com>
24909 * typemanager.cs (RegisterMethod): drop checking if we have
24910 registered this from here
24912 2002-01-12 Miguel de Icaza <miguel@ximian.com>
24914 * class.cs (Method.EmitDestructor): Implement calling our base
24917 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
24918 value of InFinally.
24920 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
24921 this routine and will wrap the call in a try/catch block. Deal
24924 2002-01-11 Miguel de Icaza <miguel@ximian.com>
24926 * ecore.cs (Expression.MemberLookup): instead of taking a
24927 parameter `same_type' that was used to tell whether we could
24928 access private members we compute our containing type from the
24931 (FieldExpr): Added partial support for volatile fields. This does
24932 not work for volatile fields exposed from assemblies, as I can not
24933 figure out how to extract the modreq from it.
24935 Updated all the source files to use this.
24937 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
24938 because it is referenced by MemberLookup very often.
24940 2002-01-09 Ravi Pratap <ravi@ximian.com>
24942 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
24943 TypeBuilder.GetCustomAttributes to retrieve what we need.
24945 Get rid of redundant default_member_attr_type as this is the same as
24946 default_member_type which already exists.
24948 * interface.cs, attribute.cs : Update accordingly.
24950 2002-01-08 Miguel de Icaza <miguel@ximian.com>
24952 * typemanager.cs: Enable IndexerPropertyName again. It does not
24953 work for TYpeBuilders though. Ravi, can you please fix this?
24955 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
24957 * expression.cs (Argument.Emit): Handle the case of ref objects
24958 being passed to ref functions;
24960 (ParameterReference.EmitLoad): Loads the content of the pointer
24961 without dereferencing.
24963 2002-01-07 Miguel de Icaza <miguel@ximian.com>
24965 * cs-tokenizer.cs: Implemented the pre-processing expressions.
24967 2002-01-08 Ravi Pratap <ravi@ximian.com>
24969 * class.cs (Indexer.DefineMethod): Incorporate the interface
24970 type in the name of the method if we are doing explicit interface
24973 * expression.cs (ConversionExists): Remove as it is completely obsolete.
24975 (BetterConversion): Fix extremely trivial bug where we were referring to
24976 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
24979 * ../errors/bug16.cs : Add although we have fixed it.
24981 2002-01-07 Miguel de Icaza <miguel@ximian.com>
24983 * expression.cs (BaseIndexer): Begin implementation.
24985 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
24987 * cs-parser.jay (indexer_declarator): Use qualified_identifier
24988 production directly to remove a shift/reduce, and implement
24989 explicit interface implementation.
24991 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
24992 after a floating point suffix.
24994 * expression.cs (DoNumericPromotions): Improved the conversion for
24995 uint/uint. If we have a constant, we avoid doing a typecast to a
24998 * class.cs (Indexer): Implement explicit interface implementation
25001 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
25003 * class.cs: make the default instance constructor public and hidebysig.
25005 2001-01-03 Ravi Pratap <ravi@ximian.com>
25007 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
25008 so we can call it from elsewhere.
25010 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
25011 we emit it internally if the class has a defined indexer; otherwise the user
25012 emits it by decorating the class definition with the DefaultMemberAttribute.
25014 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
25015 attribute is not used on a type which defines an indexer.
25017 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
25018 character when we skip whitespace.
25020 * ../errors/cs0646.cs : Add.
25022 2002-01-03 Miguel de Icaza <miguel@ximian.com>
25024 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
25027 * makefile: Add practical target `mcs3.exe' which builds the third
25028 generation compiler.
25030 * expression.cs (New): Fix structures constructor calling.
25032 * class.cs (Property, Method, Indexer): Emit Final flag on the
25033 method if we are an interface implementation and we are not
25036 * ecore.cs (PropertyExpr): New public field `IsBase', tells
25037 whether this property is referencing a `base' method.
25039 * expression.cs (Invocation.EmitCall): take an extra argument:
25040 is_base, this is used to determine whether the `call' or
25041 `callvirt' opcode should be used.
25044 * delegate.cs: update EmitCall.
25046 * class.cs (Method.Define): Set NewSlot for the cases where we are
25047 not implementing an interface method.
25049 (Property.Define): ditto.
25051 2002-01-02 Miguel de Icaza <miguel@ximian.com>
25053 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
25054 'r'. Allows mcs to parse itself fully.
25056 2002-01-02 Ravi Pratap <ravi@ximian.com>
25058 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
25059 of the number of initializers that require the InitializeArray method.
25061 (CheckIndices): Store the Expression in all cases - not the plain value. Also
25062 update the above field where necessary.
25064 (MakeByteBlob): Update accordingly.
25066 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
25069 (EmitDynamicInitializers): Update in accordance with the new optimization.
25071 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
25072 same OpCode applies.
25074 * cs-parser.jay : Fix some glaring errors I introduced.
25076 2002-01-01 Ravi Pratap <ravi@ximian.com>
25078 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
25079 so that we can check for name clashes there too.
25081 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
25082 for interface indexers.
25084 * interfaces.cs (Define): Emit the default member attribute.
25086 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
25087 variable was being referred to while setting the value ;-)
25089 2002-01-01 Miguel de Icaza <miguel@ximian.com>
25091 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
25092 byte-by-byte information when we know the data is zero.
25094 Make the block always a multiple of 4, because
25095 DefineInitializedData has a bug.
25097 * assign.cs: Fix, we should assign from the temporary, not from
25100 * expression.cs (MakeByteBlob): Fix my incorrect code.
25102 2001-12-31 Miguel de Icaza <miguel@ximian.com>
25104 * typemanager.cs (EnumToUnderlying): This function is used to get
25105 the underlying type from an enumeration, because it does not
25108 * constant.cs: Use the I4_S form for values between -128 and 127.
25110 * statement.cs (Block.LookupLabel): Looks up a label.
25111 (Block): Drop support for labeled blocks.
25113 (LabeledStatement): New kind of statement that represents a label
25116 (Goto): Finally implement this bad boy.
25118 * cs-parser.jay: Update to reflect new mechanism to implement
25121 2001-12-30 Miguel de Icaza <miguel@ximian.com>
25123 * codegen.cs (EmitContext.This): a codegen property that keeps the
25124 a single instance of this instead of creating many different this
25127 * delegate.cs (Delegate.DoResolve): Update to use the property;
25129 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
25131 * expression.cs (BaseAccess.DoResolve): Ditto.
25133 2001-12-29 Ravi Pratap <ravi@ximian.com>
25135 * typemanager.cs (methodimpl_attr_type): Add to hold the type
25136 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
25138 (InitCoreTypes): Update accordingly.
25140 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
25141 so we can quickly store the state.
25143 (ApplyAttributes): Set the correct implementation flags
25144 for InternalCall methods.
25146 2001-12-29 Miguel de Icaza <miguel@ximian.com>
25148 * expression.cs (EmitCall): if a method is not virtual, then do
25149 not use callvirt on it.
25151 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
25152 user defined stuff) requires the use of stobj, which takes an
25153 address on the stack instead of an array and an index. So emit
25154 the Ldelema operation for it.
25156 (EmitStoreOpcode): Use stobj for valuetypes.
25158 (UnaryMutator.EmitCode): Use the right 1 value depending on
25159 whether we are dealing with int64/uint64, float or doubles.
25161 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
25162 constructors that I implemented last night.
25164 (Constructor.IsDefault): Fix to work properly for static
25167 * cs-parser.jay (CheckDef): report method signature errors.
25168 Update error number 103 to be 132.
25170 * decl.cs: New AdditionResult enumeration value: MethodExists.
25171 Although we do this check for methods later on in the semantic
25172 analysis, catching repeated default constructors is so easy that
25173 we catch these here.
25175 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
25178 (ParameterReference.EmitAssign, Emit): handle
25181 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
25182 (ArrayAccess.EmitStoreOpcode): ditto.
25184 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
25186 * expression.cs (MakeByteBlob): Complete all the missing types
25187 (uint, short, ushort, byte, sbyte)
25189 * class.cs: Only init instance field initializers on instance
25192 Rename `constructors' to instance_constructors.
25194 (TypeContainer.AddConstructor): Only add constructors to the list
25195 if it is not static.
25197 Make sure that we handle default_static_constructor independently
25198 everywhere where we handle instance_constructors
25200 2001-12-28 Miguel de Icaza <miguel@ximian.com>
25202 * class.cs: Do not lookup or create a base initializer for a
25203 static constructor.
25205 (ConstructorInitializer.Resolve): use the proper type to lookup
25208 * cs-parser.jay: Report error 1585 (modifiers between type and name).
25210 * enum.cs, interface.cs: Remove CloseType, this is taken care by
25213 * decl.cs: CloseType is now an virtual method, the default
25214 implementation just closes this type.
25216 2001-12-28 Ravi Pratap <ravi@ximian.com>
25218 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
25219 to PreserveSig by default. Also emit HideBySig on such methods.
25221 Basically, set the defaults to standard values.
25223 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
25224 argument, if candidate is better, it can't be worse than the best !
25226 (Invocation): Re-write bits to differentiate between methods being
25227 applicable in their expanded form and their normal form - for params
25230 Get rid of use_standard everywhere as only standard conversions are allowed
25231 in overload resolution.
25233 More spec conformance.
25235 2001-12-27 Miguel de Icaza <miguel@ximian.com>
25237 * driver.cs: Add --timestamp, to see where the compiler spends
25240 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
25241 `this' in static code.
25243 (SimpleName.DoResolve): Implement in terms of a helper function
25244 that allows static-references to be passed upstream to
25247 (Expression.ResolveWithSimpleName): Resolve specially simple
25248 names when called by MemberAccess to implement the special
25251 (Expression.ImplicitReferenceConversion): Handle conversions from
25252 Null to reference types before others, as Null's type is
25255 * expression.cs (Invocation.EmitCall): Handle the special case of
25256 calling methods declared on a reference type from a ValueType
25257 (Base classes System.Object and System.Enum)
25259 (MemberAccess.Resolve): Only perform lookups on Enumerations if
25260 the left hand side is a TypeExpr, not on every enumeration.
25262 (Binary.Resolve): If types are reference types, then do a cast to
25263 object on operators != and == of both arguments.
25265 * typemanager.cs (FindMembers): Extract instance and static
25266 members if requested.
25268 * interface.cs (PopulateProperty): Use void_type instead of null
25269 as the return type for the setter method.
25271 (PopulateIndexer): ditto.
25273 2001-12-27 Ravi Pratap <ravi@ximian.com>
25275 * support.cs (ReflectionParameters): Fix minor bug where we
25276 were examining the wrong parameter for the ParamArray attribute.
25278 Cope with requests for the type of the parameter at position
25279 greater than the params parameter's. We now return the element
25280 type of the params array as that makes more sense.
25282 * expression.cs (Invocation.IsParamsMethodApplicable): Update
25283 accordingly as we no longer have to extract the element type
25286 (Invocation.OverloadResolve): Update.
25288 2001-12-27 Miguel de Icaza <miguel@ximian.com>
25290 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
25291 against IEnumerator, test whether the return value is a descendant
25292 of the IEnumerator interface.
25294 * class.cs (Indexer.Define): Use an auxiliary method to implement
25295 the other bits of the method definition. Begin support for
25296 explicit interface implementation.
25298 (Property.DefineMethod): Use TypeManager.void_type instead of null
25299 for an empty return value.
25301 2001-12-26 Miguel de Icaza <miguel@ximian.com>
25303 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
25304 dealing with a FieldExpr which is composed of a FieldBuilder, in
25305 the code path we did extract the constant, but we should have
25306 obtained the underlying value to be able to cast it (otherwise we
25307 end up in an infinite loop, this is what Ravi was running into).
25309 (ArrayCreation.UpdateIndices): Arrays might be empty.
25311 (MemberAccess.ResolveMemberAccess): Add support for section
25312 14.5.4.1 that deals with the special case of E.I when E is a type
25313 and something else, that I can be a reference to a static member.
25315 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
25316 handle a particular array type to create byte blobs, it is just
25317 something we dont generate byteblobs for.
25319 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
25322 * location.cs (Push): remove the key from the hashtable that we
25323 are about to add. This happens for empty files.
25325 * driver.cs: Dispose files after we have parsed them.
25327 (tokenize): new function that only runs the tokenizer on its
25328 input, for speed testing.
25330 2001-12-26 Ravi Pratap <ravi@ximian.com>
25332 * class.cs (Event.Define): Define the private field only if there
25333 are no accessors defined.
25335 * expression.cs (ResolveMemberAccess): If there is no associated
25336 field with the event, that means we have an event defined with its
25337 own accessors and we should flag error cs0070 since transforming
25338 ourselves into a field is not valid in that case.
25340 * ecore.cs (SimpleName.DoResolve): Same as above.
25342 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
25343 and charset to sane values.
25345 2001-12-25 Ravi Pratap <ravi@ximian.com>
25347 * assign.cs (DoResolve): Perform check on events only if they
25348 are being accessed outside the declaring type.
25350 * cs-parser.jay (event_declarations): Update rules to correctly
25351 set the type of the implicit parameter etc.
25353 (add_accessor, remove_accessor): Set current local parameters.
25355 * expression.cs (Binary): For delegate addition and subtraction,
25356 cast the return value from the method into the appropriate delegate
25359 2001-12-24 Ravi Pratap <ravi@ximian.com>
25361 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
25362 of these as the workaround is unnecessary.
25364 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
25365 delegate data - none of that is needed at all.
25367 Re-write bits to extract the instance expression and the delegate method
25370 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
25373 * attribute.cs (ApplyAttributes): New method to take care of common tasks
25374 of attaching attributes instead of duplicating code everywhere.
25376 * everywhere : Update code to do attribute emission using the above method.
25378 2001-12-23 Miguel de Icaza <miguel@ximian.com>
25380 * expression.cs (IsParamsMethodApplicable): if there are not
25381 parameters, return immediately.
25383 * ecore.cs: The 0 literal can be implicity converted to an enum
25386 (SimpleName.DoResolve): First lookup the type, then lookup the
25389 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
25390 want to get its address. If the InstanceExpression is not
25391 addressable, store the result in a temporary variable, then get
25394 * codegen.cs: Only display 219 errors on warning level or above.
25396 * expression.cs (ArrayAccess): Make it implement the
25397 IMemoryLocation interface.
25399 (Binary.DoResolve): handle the operator == (object a, object b)
25400 and operator != (object a, object b) without incurring into a
25401 BoxedCast (because 5 != o should never be performed).
25403 Handle binary enumerator operators.
25405 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
25406 value type, otherwise use Ldelem_ref.
25408 Use precomputed names;
25410 (AddressOf): Implement address of
25412 * cs-parser.jay (labeled_statement): Fix recursive block
25413 addition by reworking the production.
25415 * expression.cs (New.DoEmit): New has a special case:
25417 If we are dealing with a ValueType, we have a few
25418 situations to deal with:
25420 * The target of New is a ValueType variable, that is
25421 easy, we just pass this as the variable reference
25423 * The target of New is being passed as an argument,
25424 to a boxing operation or a function that takes a
25427 In this case, we need to create a temporary variable
25428 that is the argument of New.
25431 2001-12-23 Ravi Pratap <ravi@ximian.com>
25433 * rootcontext.cs (LookupType): Check that current_type is not null before
25434 going about looking at nested types.
25436 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
25437 not implement the IAssignMethod interface any more.
25439 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
25440 where we tranform them into FieldExprs if they are being resolved from within
25441 the declaring type.
25443 * ecore.cs (SimpleName.DoResolve): Do the same here.
25445 * assign.cs (DoResolve, Emit): Clean up code considerably.
25447 * ../errors/bug10.cs : Add.
25449 * ../errors/cs0070.cs : Add.
25451 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
25453 * assign.cs : Get rid of EventIsLocal everywhere.
25455 2001-12-23 Miguel de Icaza <miguel@ximian.com>
25457 * ecore.cs (ConvertIntLiteral): finished the implementation.
25459 * statement.cs (SwitchLabel): Convert the value we are using as a
25460 key before looking up the table.
25462 2001-12-22 Miguel de Icaza <miguel@ximian.com>
25464 * codegen.cs (EmitTopBlock): Require a Location argument now.
25466 * cs-parser.jay (constructor_declarator): We need to setup
25467 current_local_parameters before we parse the
25468 opt_constructor_initializer, to allow the variables to be bound
25469 to the constructor arguments.
25471 * rootcontext.cs (LookupType): First lookup nested classes in our
25472 class and our parents before we go looking outside our class.
25474 * expression.cs (ConstantFold): Extract/debox the values at the
25477 * rootcontext.cs (EmitCode): Resolve the constants first before we
25478 resolve the types. This is not really needed, but it helps debugging.
25480 * statement.cs: report location.
25482 * cs-parser.jay: pass location to throw statement.
25484 * driver.cs: Small bug fix.
25486 * report.cs: Updated format to be 4-zero filled digits.
25488 2001-12-22 Ravi Pratap <ravi@ximian.com>
25490 * expression.cs (CheckIndices): Fix minor bug where the wrong
25491 variable was being referred to ;-)
25493 (DoEmit): Do not call EmitStaticInitializers when the
25494 underlying type is System.Object.
25496 2001-12-21 Ravi Pratap <ravi@ximian.com>
25498 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
25499 and do the usual workaround for SRE.
25501 * class.cs (MyEventBuilder.EventType): New member to get at the type
25502 of the event, quickly.
25504 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
25506 * assign.cs (Assign.DoResolve): Handle the case when the target
25507 is an EventExpr and perform the necessary checks.
25509 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
25512 (SimpleName.MemberStaticCheck): Include check for EventExpr.
25514 (EventExpr): Set the type in the constructor itself since we
25515 are meant to be born fully resolved.
25517 (EventExpr.Define): Revert code I wrote earlier.
25519 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
25520 instance expression is null. The instance expression is a This in that case
25521 or a null, depending on whether it is a static method or not.
25523 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
25524 refers to more than one method.
25526 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
25527 and accordingly flag errors.
25529 2001-12-21 Miguel de Icaza <miguel@ximian.com>
25531 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
25533 2001-12-22 Miguel de Icaza <miguel@ximian.com>
25535 * location.cs (ToString): Provide useful rutine.
25537 2001-12-21 Miguel de Icaza <miguel@ximian.com>
25539 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
25540 objects, return the actual integral boxed.
25542 * statement.cs (SwitchLabel): define an ILLabel for each
25545 (Switch.CheckSwitch): If the value is a Literal, extract
25546 the underlying literal.
25548 Also in the unused hashtable we had, add the SwitchLabel so we can
25549 quickly look this value up.
25551 * constant.cs: Implement a bunch of new constants. Rewrite
25552 Literal based on this. Made changes everywhere to adapt to this.
25554 * expression.cs (Expression.MakeByteBlob): Optimize routine by
25555 dereferencing array only once, and also copes with enumrations.
25557 bytes are two bytes wide, not one.
25559 (Cast): Perform constant conversions.
25561 * ecore.cs (TryImplicitIntConversion): Return literals instead of
25562 wrappers to the literals here.
25564 * expression.cs (DoNumericPromotions): long literals can converted
25565 to ulong implicity (this is taken care of elsewhere, but I was
25566 missing this spot).
25568 * ecore.cs (Expression.Literalize): Make the return type Literal,
25569 to improve type checking.
25571 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
25573 2001-12-20 Miguel de Icaza <miguel@ximian.com>
25575 * literal.cs: Revert code from ravi that checked the bounds. The
25576 bounds are sane by the definition of the type itself.
25578 * typemanager.cs: Fix implementation of ImplementsInterface. We
25579 need to actually look up in our parent hierarchy for interfaces
25582 * const.cs: Use the underlying type for enumerations
25584 * delegate.cs: Compute the basename for the delegate creation,
25585 that should fix the delegate test case, and restore the correct
25586 Type Lookup semantics in rootcontext
25588 * rootcontext.cs: Revert Ravi's last patch. The correct way of
25589 referencing a nested type with the Reflection API is using the "+"
25592 * cs-parser.jay: Do not require EOF token at the end.
25594 2001-12-20 Ravi Pratap <ravi@ximian.com>
25596 * rootcontext.cs (LookupType): Concatenate type names with
25597 a '.' instead of a '+' The test suite passes again.
25599 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
25600 field of the enumeration.
25602 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
25603 the case when the member is an EventExpr.
25605 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
25606 static has an associated instance expression.
25608 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
25610 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
25612 * class.cs (Event.Define): Register event and perform appropriate checks
25615 We define the Add and Remove methods even if the use provides none because
25616 in that case, we provide default implementations ourselves.
25618 Define a private field of the type of the event. This is done by the CSC compiler
25619 and we should be doing it too ;-)
25621 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
25622 More methods we use in code we generate.
25624 (multicast_delegate_type, delegate_type): Two separate types since the distinction
25627 (InitCoreTypes): Update accordingly for the above.
25629 * class.cs (Event.Emit): Generate code for default accessors that we provide
25631 (EmitDefaultMethod): Do the job in the above.
25633 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
25636 2001-12-20 Miguel de Icaza <miguel@ximian.com>
25638 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
25639 builders even if we were missing one.
25641 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
25642 pass the Basename as our class name instead of the Name. The
25643 basename will be correctly composed for us.
25645 * parameter.cs (Paramters): Now takes a Location argument.
25647 * decl.cs (DeclSpace.LookupType): Removed convenience function and
25648 make all the code call directly LookupType in RootContext and take
25649 this chance to pass the Location information everywhere.
25651 * Everywhere: pass Location information.
25653 2001-12-19 Miguel de Icaza <miguel@ximian.com>
25655 * class.cs (Constructor.Define): Updated way of detecting the
25656 length of the parameters.
25658 (TypeContainer.DefineType): Use basename as the type name for
25661 (TypeContainer.Define): Do not recursively define types here, as
25662 definition is taken care in order by the RootContext.
25664 * tree.cs: Keep track of namespaces in a per-file basis.
25666 * parameter.cs (Parameter.ComputeSignature): Update to use
25669 (Parameters.GetSignature): ditto.
25671 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
25672 instead of a TypeContainer.
25674 (Interface.SemanticAnalysis): Use `this' instead of our parent to
25675 resolve names. Because we need to be resolve in our context, not
25678 * driver.cs: Implement response files.
25680 * class.cs (TypeContainer.DefineType): If we are defined, do not
25681 redefine ourselves.
25683 (Event.Emit): Emit the code for add/remove handlers.
25684 (Event.Define): Save the MethodBuilders for add/remove.
25686 * typemanager.cs: Use pair here too.
25688 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
25689 DictionaryEntry requires the first argument to be non-null.
25691 (enum_declaration): Compute full name for registering the
25694 (delegate_declaration): Instead of using
25695 formal_parameter_list, use opt_formal_parameter_list as the list
25698 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
25699 (EventParsing): New property that controls whether `add' and
25700 `remove' are returned as tokens or identifiers (for events);
25702 2001-12-19 Ravi Pratap <ravi@ximian.com>
25704 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
25705 use MyEventBuilder only and let it wrap the real builder for us.
25707 (MyEventBuilder): Revamp constructor etc.
25709 Implement all operations that we perform on EventBuilder in precisely the same
25712 (FindMembers): Update to use the EventBuilder member.
25714 (Event.Emit): Update accordingly.
25716 2001-12-18 Ravi Pratap <ravi@ximian.com>
25718 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
25719 by calling the appropriate methods.
25721 (GetCustomAttributes): Make stubs as they cannot possibly do anything
25724 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
25726 2001-12-17 Ravi Pratap <ravi@ximian.com>
25728 * delegate.cs (Delegate.Populate): Check that the return type
25729 and various parameters types are indeed accessible.
25731 * class.cs (Constructor.Define): Same here.
25733 (Field.Define): Ditto.
25735 (Event.Define): Ditto.
25737 (Operator.Define): Check that the underlying Method defined itself
25738 correctly - so it's MethodBuilder should not be null.
25740 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
25741 expression happens to be null.
25743 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
25744 members but as of now we don't seem to be able to do anything really useful with it.
25746 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
25747 not the EventBuilder.
25749 2001-12-18 Miguel de Icaza <miguel@ximian.com>
25751 * cs-tokenizer.cs: Add support for defines.
25752 Add support for #if, #elif, #else, #endif
25754 (eval_var): evaluates a variable.
25755 (eval): stubbed for evaluating functions.
25757 * cs-parser.jay: Pass the defines information
25759 * driver.cs: Add --define command line option.
25761 * decl.cs: Move MemberCore here.
25763 Make it the base class for DeclSpace. This allows us to catch and
25764 report 108 and 109 for everything now.
25766 * class.cs (TypeContainer.Define): Extract all the members
25767 before populating and emit the warning 108 (new keyword required
25768 to override) instead of having each member implement this.
25770 (MemberCore.Define): New abstract method, we will be using this in
25771 the warning reporting engine in Populate.
25773 (Operator.Define): Adjust to new MemberCore protocol.
25775 * const.cs (Const): This does not derive from Expression, it is a
25776 temporary object we use to create fields, it is a MemberCore.
25778 * class.cs (Method.Define): Allow the entry point to be in a
25781 * driver.cs: Rewrite the argument handler to clean it up a bit.
25783 * rootcontext.cs: Made it just an auxiliary namespace feature by
25784 making everything static.
25786 * driver.cs: Adapt code to use RootContext type name instead of
25789 * delegate.cs: Remove RootContext argument.
25791 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
25794 * class.cs (Event.Define): The lookup can fail.
25796 * cs-tokenizer.cs: Begin implementation of pre-procesor.
25798 * expression.cs: Resolve the this instance before invoking the code.
25800 2001-12-17 Miguel de Icaza <miguel@ximian.com>
25802 * cs-parser.jay: Add a production in element_access that allows
25803 the thing to become a "type" reference. This way we can parse
25804 things like "(string [])" as a type.
25806 Note that this still does not handle the more complex rules of
25810 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
25812 * ecore.cs: (CopyNewMethods): new utility function used to
25813 assemble the list of methods from running FindMembers.
25815 (MemberLookup): Rework FindMembers so that
25817 2001-12-16 Miguel de Icaza <miguel@ximian.com>
25819 * class.cs (TypeContainer): Remove Delegates who fail to be
25822 * delegate.cs (Populate): Verify that we dont get null return
25823 values. TODO: Check for AsAccessible.
25825 * cs-parser.jay: Use basename to emit error 574 (destructor should
25826 have the same name as container class), not the full name.
25828 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
25829 possible representation.
25831 Also implements integer type suffixes U and L.
25833 2001-12-15 Miguel de Icaza <miguel@ximian.com>
25835 * expression.cs (ArrayCreation.DoResolve): We need to do the
25836 argument resolution *always*.
25838 * decl.cs: Make this hold the namespace. Hold the root context as
25840 (LookupType): Move here.
25842 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
25844 * location.cs (Row, Name): Fixed the code, it was always returning
25845 references to the first file.
25847 * interface.cs: Register properties defined through interfaces.
25849 * driver.cs: Add support for globbing on the command line
25851 * class.cs (Field): Make it derive from MemberCore as well.
25854 2001-12-15 Ravi Pratap <ravi@ximian.com>
25856 * class.cs (Event::Define): Check that the type of the event is a delegate
25857 type else flag error #66.
25859 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
25862 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
25863 values of EntryPoint, CharSet etc etc.
25865 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
25867 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
25868 be null and we should ignore this. I am not sure if this is really clean. Apparently,
25869 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
25870 which needs this to do its work.
25872 * ../errors/cs0066.cs : Add.
25874 2001-12-14 Miguel de Icaza <miguel@ximian.com>
25876 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
25879 * class.cs: (MethodSignature.MethodSignature): Removed hack that
25880 clears out the parameters field.
25881 (MemberSignatureCompare): Cleanup
25883 (MemberCore): New base class used to share code between MethodCore
25886 (RegisterRequiredImplementations) BindingFlags.Public requires
25887 either BindingFlags.Instace or Static. Use instance here.
25889 (Property): Refactored code to cope better with the full spec.
25891 * parameter.cs (GetParameterInfo): Return an empty array instead
25894 * class.cs (Property): Abstract or extern properties have no bodies.
25896 * parameter.cs (GetParameterInfo): return a zero-sized array.
25898 * class.cs (TypeContainer.MethodModifiersValid): Move all the
25899 method modifier validation to the typecontainer so we can reuse
25900 this on properties.
25902 (MethodCore.ParameterTypes): return an empty sized array of types.
25904 (Property.Define): Test property modifier validity.
25906 Add tests for sealed/override too.
25908 (Method.Emit): abstract or extern methods have no bodies.
25910 2001-12-14 Ravi Pratap <ravi@ximian.com>
25912 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
25915 (Method::Define, ::Emit): Modify accordingly.
25917 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
25919 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
25921 * makefile: Pass in /unsafe.
25923 2001-12-13 Miguel de Icaza <miguel@ximian.com>
25925 * class.cs (MakeKey): Kill routine.
25927 * class.cs (TypeContainer.Define): Correctly define explicit
25928 method implementations (they require the full interface name plus
25931 * typemanager.cs: Deply the PtrHashtable here and stop using the
25932 lame keys. Things work so much better.
25934 This of course broke everyone who depended on `RegisterMethod' to
25935 do the `test for existance' test. This has to be done elsewhere.
25937 * support.cs (PtrHashtable): A hashtable that avoid comparing with
25938 the object stupid Equals method (because, that like fails all over
25939 the place). We still do not use it.
25941 * class.cs (TypeContainer.SetRequiredInterface,
25942 TypeContainer.RequireMethods): Killed these two routines and moved
25943 all the functionality to RegisterRequiredImplementations.
25945 (TypeContainer.RegisterRequiredImplementations): This routine now
25946 registers all the implementations required in an array for the
25947 interfaces and abstract methods. We use an array of structures
25948 which can be computed ahead of time to reduce memory usage and we
25949 also assume that lookups are cheap as most classes will not
25950 implement too many interfaces.
25952 We also avoid creating too many MethodSignatures.
25954 (TypeContainer.IsInterfaceMethod): Update and optionally does not
25955 clear the "pending" bit if we find that there are problems with
25958 (TypeContainer.VerifyPendingMethods): Update to report errors of
25959 methods that look like implementations but are not.
25961 (TypeContainer.Define): Add support for explicit interface method
25964 2001-12-12 Miguel de Icaza <miguel@ximian.com>
25966 * typemanager.cs: Keep track of the parameters here instead of
25967 being a feature of the TypeContainer.
25969 * class.cs: Drop the registration of parameters here, as
25970 InterfaceMethods are also interface declarations.
25972 * delegate.cs: Register methods with the TypeManager not only with
25973 the TypeContainer. This code was buggy.
25975 * interface.cs: Full registation here.
25977 2001-12-11 Miguel de Icaza <miguel@ximian.com>
25979 * expression.cs: Remove reducer for binary expressions, it can not
25982 * const.cs: Put here the code that used to go into constant.cs
25984 * constant.cs: Put here the code for constants, this is a new base
25985 class for Literals.
25987 * literal.cs: Make Literal derive from Constant.
25989 2001-12-09 Miguel de Icaza <miguel@ximian.com>
25991 * statement.cs (Return.Emit): Report error 157 if the user
25992 attempts to return from a finally block.
25994 (Return.Emit): Instead of emitting a return, jump to the end of
25997 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
25998 LocalBuilder to store the result of the function. ReturnLabel is
25999 the target where we jump.
26002 2001-12-09 Radek Doulik <rodo@ximian.com>
26004 * cs-parser.jay: remember alias in current namespace
26006 * ecore.cs (SimpleName::DoResolve): use aliases for types or
26009 * class.cs (LookupAlias): lookup alias in my_namespace
26011 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
26013 (LookupAlias): lookup alias in this and if needed in parent
26016 2001-12-08 Miguel de Icaza <miguel@ximian.com>
26020 * rootcontext.cs: (ModuleBuilder) Made static, first step into
26021 making things static. I need this to avoid passing the
26022 TypeContainer when calling ParameterType.
26024 * support.cs (InternalParameters.ParameterType): Remove ugly hack
26025 that did string manipulation to compute the type and then call
26026 GetType. Use Parameter.ParameterType instead.
26028 * cs-tokenizer.cs: Consume the suffix for floating values.
26030 * expression.cs (ParameterReference): figure out whether this is a
26031 reference parameter or not. Kill an extra variable by computing
26032 the arg_idx during emission.
26034 * parameter.cs (Parameters.GetParameterInfo): New overloaded
26035 function that returns whether a parameter is an out/ref value or not.
26037 (Parameter.ParameterType): The type of the parameter (base,
26038 without ref/out applied).
26040 (Parameter.Resolve): Perform resolution here.
26041 (Parameter.ExternalType): The full type (with ref/out applied).
26043 * statement.cs (Using.Emit, Using.EmitExpression): Implement
26044 support for expressions on the using statement.
26046 2001-12-07 Miguel de Icaza <miguel@ximian.com>
26048 * statement.cs (Using.EmitLocalVariableDecls): Split the
26049 localvariable handling of the using statement.
26051 (Block.EmitMeta): Keep track of variable count across blocks. We
26052 were reusing slots on separate branches of blocks.
26054 (Try.Emit): Emit the general code block, we were not emitting it.
26056 Check the type of the declaration to be an IDisposable or
26057 something that can be implicity converted to it.
26059 Emit conversions if required.
26061 * ecore.cs (EmptyExpression): New utility class.
26062 (Expression.ImplicitConversionExists): New utility function.
26064 2001-12-06 Miguel de Icaza <miguel@ximian.com>
26066 * statement.cs (Using): Implement.
26068 * expression.cs (LocalVariableReference): Support read only variables.
26070 * statement.cs: Remove the explicit emit for the Leave opcode.
26071 (VariableInfo): Add a readonly field.
26073 2001-12-05 Miguel de Icaza <miguel@ximian.com>
26075 * ecore.cs (ConvCast): new class used to encapsulate the various
26076 explicit integer conversions that works in both checked and
26077 unchecked contexts.
26079 (Expression.ConvertNumericExplicit): Use new ConvCast class to
26080 properly generate the overflow opcodes.
26082 2001-12-04 Miguel de Icaza <miguel@ximian.com>
26084 * statement.cs: The correct type for the EmptyExpression is the
26085 element_type, not the variable type. Ravi pointed this out.
26087 2001-12-04 Ravi Pratap <ravi@ximian.com>
26089 * class.cs (Method::Define): Handle PInvoke methods specially
26090 by using DefinePInvokeMethod instead of the usual one.
26092 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
26093 above to do the task of extracting information and defining the method.
26095 2001-12-04 Ravi Pratap <ravi@ximian.com>
26097 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
26098 of the condition for string type.
26100 (Emit): Move that here.
26102 (ArrayCreation::CheckIndices): Keep string literals in their expression
26105 (EmitDynamicInitializers): Handle strings appropriately.
26107 2001-12-04 Miguel de Icaza <miguel@ximian.com>
26109 * codegen.cs (EmitContext): Replace multiple variables with a
26110 single pointer to the current Switch statement.
26112 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
26115 2001-12-03 Miguel de Icaza <miguel@ximian.com>
26119 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
26122 (Foreach.Emit): Foreach on arrays was not setting
26123 up the loop variables (for break/continue).
26125 (GotoCase): Semi-implented.
26127 2001-12-03 Ravi Pratap <ravi@ximian.com>
26129 * attribute.cs (CheckAttribute): Handle system attributes by using
26130 Attribute.GetAttributes to examine information we need.
26132 (GetValidPlaces): Same here.
26134 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
26136 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
26138 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
26140 (Method::Define): Set appropriate flags if we have a DllImport attribute.
26142 (Method::Emit): Handle the case when we are a PInvoke method.
26144 2001-12-03 Miguel de Icaza <miguel@ximian.com>
26146 * expression.cs: Use ResolveWithSimpleName on compound names.
26148 2001-12-02 Ravi Pratap <ravi@ximian.com>
26150 * constant.cs (EmitConstant): Make sure we resolve the associated expression
26151 before trying to reduce it.
26153 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
26155 * constant.cs (LookupConstantValue): Implement.
26157 (EmitConstant): Use the above in emitting the constant.
26159 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
26160 that are user-defined by doing a LookupConstantValue on them.
26162 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
26165 2001-11-29 Miguel de Icaza <miguel@ximian.com>
26167 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
26169 (BaseAccess.DoResolve): Implement.
26171 (MemberAccess.DoResolve): Split this routine into a
26172 ResolveMemberAccess routine that can be used independently
26174 2001-11-28 Miguel de Icaza <miguel@ximian.com>
26176 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
26177 As that share bits of the implementation. Is returns a boolean,
26178 while As returns the Type that is being probed.
26180 2001-12-01 Ravi Pratap <ravi@ximian.com>
26182 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
26183 instead of a Literal - much easier.
26185 (EnumInTransit): Remove - utterly useless :-)
26187 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
26189 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
26191 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
26192 chain when we have no associated expression.
26194 2001-11-30 Ravi Pratap <ravi@ximian.com>
26196 * constant.cs (Define): Use Location while reporting the errror.
26198 Also emit a warning when 'new' is used and there is no inherited
26201 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
26204 (LookupEnumValue): Implement to lookup an enum member's value and define it
26207 (Populate): Re-write accordingly to use the above routine.
26209 2001-11-27 Miguel de Icaza <miguel@ximian.com>
26211 * expression.cs (This): Fix prototype for DoResolveLValue to
26212 override the base class DoResolveLValue.
26214 * cs-parser.cs: Report errors cs574 and cs575 (destructor
26217 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
26218 (we need to load the address of the field here). This fixes
26221 (FieldExpr.DoResolveLValue): Call the DoResolve
26222 function to initialize the Instance expression.
26224 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
26225 correctly the GetEnumerator operation on a value type.
26227 * cs-parser.jay: Add more simple parsing error catches.
26229 * statement.cs (Switch): Add support for string switches.
26230 Handle null specially.
26232 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
26234 2001-11-28 Ravi Pratap <ravi@ximian.com>
26236 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
26238 (declare_local_constant): New helper function.
26240 * statement.cs (AddConstant): Keep a separate record of constants
26242 (IsConstant): Implement to determine if a variable is a constant.
26244 (GetConstantExpression): Implement.
26246 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
26248 * statement.cs (IsVariableDefined): Re-write.
26250 2001-11-27 Ravi Pratap <ravi@ximian.com>
26252 * class.cs (TypeContainer::FindMembers): Look for constants
26253 in the case when we are looking for MemberTypes.Field
26255 * expression.cs (MemberAccess::DoResolve): Check that in the
26256 case we are a FieldExpr and a Literal, we are not being accessed
26257 by an instance reference.
26259 * cs-parser.jay (local_constant_declaration): Implement.
26261 (declaration_statement): Implement for constant declarations.
26263 2001-11-26 Miguel de Icaza <miguel@ximian.com>
26265 * statement.cs (Switch): Catch double defaults.
26267 (Switch): More work on the switch() statement
26268 implementation. It works for integral values now, need to finish
26272 2001-11-24 Miguel de Icaza <miguel@ximian.com>
26274 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
26275 integer literals into other integer literals. To be used by
26278 2001-11-24 Ravi Pratap <ravi@ximian.com>
26280 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
26283 (EmitDynamicInitializers): Cope with the above since we extract data
26284 directly from ArrayData now.
26286 (ExpectInitializers): Keep track of whether initializers are mandatory
26289 (Bounds): Make it a hashtable to prevent the same dimension being
26290 recorded for every element in that dimension.
26292 (EmitDynamicInitializers): Fix bug which prevented the Set array method
26295 Also fix bug which was causing the indices to be emitted in the reverse
26298 2001-11-24 Miguel de Icaza <miguel@ximian.com>
26300 * expression.cs (ArrayCreation): Implement the bits that Ravi left
26301 unfinished. They do not work, because the underlying code is
26304 2001-11-22 Miguel de Icaza <miguel@ximian.com>
26306 * cs-parser.jay: Remove bogus fixme.
26308 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
26309 on Switch statement.
26311 2001-11-23 Ravi Pratap <ravi@ximian.com>
26313 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
26316 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
26317 parameter. Apparently, any expression is allowed.
26319 (ValidateInitializers): Update accordingly.
26321 (CheckIndices): Fix some tricky bugs thanks to recursion.
26323 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
26324 I was being completely brain-dead.
26326 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
26327 and re-write acordingly.
26329 (DelegateInvocation): Re-write accordingly.
26331 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
26333 (MakeByteBlob): Handle types more correctly.
26335 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
26336 initialization from expressions but it is incomplete because I am a complete
26339 2001-11-22 Miguel de Icaza <miguel@ximian.com>
26341 * statement.cs (If.Emit): Fix a bug that generated incorrect code
26342 on If. Basically, we have to return `true' (ie, we do return to
26343 our caller) only if both branches of the if return.
26345 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
26346 short-circuit operators, handle them as short circuit operators.
26348 (Cast.DoResolve): Resolve type.
26349 (Cast.Cast): Take an expression as the target type.
26351 * cs-parser.jay (cast_expression): Remove old hack that only
26352 allowed a limited set of types to be handled. Now we take a
26353 unary_expression and we resolve to a type during semantic
26356 Use the grammar productions from Rhys to handle casts (this is
26357 not complete like Rhys syntax yet, we fail to handle that corner
26358 case that C# has regarding (-x), but we will get there.
26360 2001-11-22 Ravi Pratap <ravi@ximian.com>
26362 * class.cs (EmitFieldInitializer): Take care of the case when we have a
26363 field which is an array type.
26365 * cs-parser.jay (declare_local_variables): Support array initialization too.
26367 * typemanager.cs (MakeKey): Implement.
26369 (everywhere): Use the above appropriately.
26371 * cs-parser.jay (for_statement): Update for array initialization while
26372 declaring variables.
26374 * ecore.cs : The error message was correct, it's the variable's names that
26375 were misleading ;-) Make the code more readable.
26377 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
26378 the correct type etc.
26380 (ConvertExplicit): Handle Enum types by examining the underlying type.
26382 2001-11-21 Ravi Pratap <ravi@ximian.com>
26384 * parameter.cs (GetCallingConvention): Always return
26385 CallingConventions.Standard for now.
26387 2001-11-22 Miguel de Icaza <miguel@ximian.com>
26389 * expression.cs (Binary.ResolveOperator): Update the values of `l'
26390 and `r' after calling DoNumericPromotions.
26392 * ecore.cs: Fix error message (the types were in the wrong order).
26394 * statement.cs (Foreach.ProbeCollectionType): Need to pass
26395 BindingFlags.Instance as well
26397 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
26398 implicit int literal conversion in an empty cast so that we
26399 propagate the right type upstream.
26401 (UnboxCast): new class used to unbox value types.
26402 (Expression.ConvertExplicit): Add explicit type conversions done
26405 (Expression.ImplicitNumericConversion): Oops, forgot to test for
26406 the target type before applying the implicit LongLiterals to ULong
26409 2001-11-21 Miguel de Icaza <miguel@ximian.com>
26411 * cs-parser.jay (for_statement): Reworked the way For works: now
26412 we declare manually any variables that are introduced in
26413 for_initializer to solve the problem of having out-of-band code
26414 emition (that is what got for broken).
26416 (declaration_statement): Perform the actual variable declaration
26417 that used to be done in local_variable_declaration here.
26419 (local_variable_declaration): Do not declare anything, just pass
26420 the information on a DictionaryEntry
26422 2001-11-20 Ravi Pratap <ravi@ximian.com>
26424 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
26425 re-write of the logic to now make it recursive.
26427 (UpdateIndices): Re-write accordingly.
26429 Store element data in a separate ArrayData list in the above methods.
26431 (MakeByteBlob): Implement to dump the array data into a byte array.
26433 2001-11-19 Ravi Pratap <ravi@ximian.com>
26435 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
26438 * constant.cs (Define): Implement.
26440 (EmitConstant): Re-write fully.
26442 Pass in location info.
26444 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
26447 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
26448 DictionaryEntry since we need location info too.
26450 (constant_declaration): Update accordingly.
26452 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
26453 code into another method : UpdateIndices.
26455 2001-11-18 Ravi Pratap <ravi@ximian.com>
26457 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
26458 some type checking etc.
26460 2001-11-17 Ravi Pratap <ravi@ximian.com>
26462 * expression.cs (ArrayCreation::ValidateInitializers): Implement
26463 bits to provide dimension info if the user skips doing that.
26465 Update second constructor to store the rank correctly.
26467 2001-11-16 Ravi Pratap <ravi@ximian.com>
26469 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
26470 and try to implement.
26472 * ../errors/cs0150.cs : Add.
26474 * ../errors/cs0178.cs : Add.
26476 2001-11-16 Miguel de Icaza <miguel@ximian.com>
26478 * statement.cs: Implement foreach on multi-dimensional arrays.
26480 * parameter.cs (Parameters.GetParameterByName): Also lookup the
26481 name of the params argument.
26483 * expression.cs: Use EmitStoreOpcode to get the right opcode while
26484 initializing the array.
26486 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
26487 we can use this elsewhere.
26489 * statement.cs: Finish implementation of foreach for single
26492 * cs-parser.jay: Use an out-of-band stack to pass information
26493 around, I wonder why I need this.
26495 foreach_block: Make the new foreach_block the current_block.
26497 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
26498 function used to return a static Parameters structure. Used for
26499 empty parameters, as those are created very frequently.
26501 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
26503 2001-11-15 Ravi Pratap <ravi@ximian.com>
26505 * interface.cs : Default modifier is private, not public. The
26506 make verify test passes again.
26508 2001-11-15 Ravi Pratap <ravi@ximian.com>
26510 * support.cs (ReflectionParameters): Fix logic to determine
26511 whether the last parameter is a params one. Test 9 passes again.
26513 * delegate.cs (Populate): Register the builders we define with
26514 RegisterParameterForBuilder. Test 19 passes again.
26516 * cs-parser.jay (property_declaration): Reference $6 instead
26517 of $$ to get at the location.
26519 (indexer_declaration): Similar stuff.
26521 (attribute): Ditto.
26523 * class.cs (Property): Register parameters for the Get and Set methods
26524 if they exist. Test 23 passes again.
26526 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
26527 call to EmitArguments as we are sure there aren't any params arguments.
26528 Test 32 passes again.
26530 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
26531 IndexOutOfRangeException.
26533 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
26534 Test 33 now passes again.
26536 2001-11-15 Miguel de Icaza <miguel@ximian.com>
26538 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
26539 broke a bunch of things. Will have to come up with a better way
26540 of tracking locations.
26542 * statement.cs: Implemented foreach for single dimension arrays.
26544 2001-11-09 Miguel de Icaza <miguel@ximian.com>
26546 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
26547 an error. This removes the lookup from the critical path.
26549 * cs-parser.jay: Removed use of temporary_loc, which is completely
26552 2001-11-14 Miguel de Icaza <miguel@ximian.com>
26554 * support.cs (ReflectionParameters.ParameterModifier): Report
26555 whether the argument is a PARAMS argument or not.
26557 * class.cs: Set the attribute `ParamArrayAttribute' on the
26558 parameter argument.
26560 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
26561 and cons_param_array_attribute (ConstructorInfo for
26562 ParamArrayAttribute).,
26564 * codegen.cs: Emit the return using the `Return' statement, that
26565 way we can report the error correctly for missing return values.
26567 * class.cs (Method.Emit): Clean up.
26569 * expression.cs (Argument.Resolve): Take another argument: the
26570 location where this argument is used. Notice that this is not
26571 part of the "Argument" class as to reduce the size of the
26572 structure (we know the approximate location anyways).
26574 Test if the argument is a variable-reference, if not, then
26575 complain with a 206.
26577 (Argument.Emit): Emit addresses of variables.
26579 (Argument.FullDesc): Simplify.
26581 (Invocation.DoResolve): Update for Argument.Resolve.
26583 (ElementAccess.DoResolve): ditto.
26585 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
26586 method should be virtual, as this method is always virtual.
26588 (NewDelegate.DoResolve): Update for Argument.Resolve.
26590 * class.cs (ConstructorInitializer.DoResolve): ditto.
26592 * attribute.cs (Attribute.Resolve): ditto.
26594 2001-11-13 Miguel de Icaza <miguel@ximian.com>
26596 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
26598 * expression.cs (ParameterReference): Drop IStackStorage and implement
26599 IAssignMethod instead.
26601 (LocalVariableReference): ditto.
26603 * ecore.cs (FieldExpr): Drop IStackStorage and implement
26604 IAssignMethod instead.
26606 2001-11-13 Miguel de Icaza <miguel@ximian.com>
26608 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
26609 enumerations that are used in heavily used structures derive from
26610 byte in a laughable and pathetic attempt to reduce memory usage.
26611 This is the kind of pre-optimzations that you should not do at
26612 home without adult supervision.
26614 * expression.cs (UnaryMutator): New class, used to handle ++ and
26615 -- separatedly from the other unary operators. Cleans up the
26616 code, and kills the ExpressionStatement dependency in Unary.
26618 (Unary): Removed `method' and `Arguments' from this class, making
26619 it smaller, and moving it all to SimpleCall, so I can reuse this
26620 code in other locations and avoid creating a lot of transient data
26621 strucutres when not required.
26623 * cs-parser.jay: Adjust for new changes.
26625 2001-11-11 Miguel de Icaza <miguel@ximian.com>
26627 * enum.cs (Enum.Populate): If there is a failure during
26630 * cs-parser.jay (opt_enum_base): we used to catch type errors
26631 here, but this is really incorrect. The type error should be
26632 catched during semantic analysis.
26634 2001-12-11 Ravi Pratap <ravi@ximian.com>
26636 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
26637 current_local_parameters as expected since I, in my stupidity, had forgotten
26640 * attribute.cs (GetValidPlaces): Fix stupid bug.
26642 * class.cs (Method::Emit): Perform check on applicability of attributes.
26644 (Constructor::Emit): Ditto.
26646 (Field::Emit): Ditto.
26648 (Field.Location): Store location information.
26650 (Property, Event, Indexer, Operator): Ditto.
26652 * cs-parser.jay (field_declaration): Pass in location for each field.
26654 * ../errors/cs0592.cs : Add.
26656 2001-11-12 Ravi Pratap <ravi@ximian.com>
26658 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
26660 (InitCoreTypes): Update accordingly.
26662 (RegisterAttrType, LookupAttr): Implement.
26664 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
26665 info about the same.
26667 (Resolve): Update to populate the above as necessary.
26669 (Error592): Helper.
26671 (GetValidPlaces): Helper to the above.
26673 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
26675 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
26677 2001-11-12 Ravi Pratap <ravi@ximian.com>
26679 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
26681 * ../errors/cs0617.cs : Add.
26683 2001-11-11 Ravi Pratap <ravi@ximian.com>
26685 * enum.cs (Emit): Rename to Populate to be more consistent with what
26686 we expect it to do and when exactly it is called.
26688 * class.cs, rootcontext.cs : Update accordingly.
26690 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
26691 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
26693 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
26695 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
26696 of a fieldinfo using the above, when dealing with a FieldBuilder.
26698 2001-11-10 Ravi Pratap <ravi@ximian.com>
26700 * ../errors/cs0031.cs : Add.
26702 * ../errors/cs1008.cs : Add.
26704 * ../errrors/cs0543.cs : Add.
26706 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
26709 (FindMembers): Implement.
26711 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
26712 enums and delegates too.
26714 (enum_types): Rename to builder_to_enum.
26716 (delegate_types): Rename to builder_to_delegate.
26718 * delegate.cs (FindMembers): Implement.
26720 2001-11-09 Ravi Pratap <ravi@ximian.com>
26722 * typemanager.cs (IsEnumType): Implement.
26724 * enum.cs (Emit): Re-write parts to account for the underlying type
26725 better and perform checking etc.
26727 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
26728 of the underlying type.
26730 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
26733 * enum.cs (error31): Helper to report error #31.
26735 * cs-parser.jay (enum_declaration): Store location of each member too.
26737 * enum.cs (member_to_location): New hashtable.
26739 (AddEnumMember): Update location hashtable.
26741 (Emit): Use the location of each member while reporting errors.
26743 2001-11-09 Miguel de Icaza <miguel@ximian.com>
26745 * cs-parser.jay: A for_initializer if is a
26746 local_variable_declaration really ammount to have an implicit
26747 block with the variable declaration and no initializer for for.
26749 * statement.cs (For.Emit): Cope with null initializers.
26751 This fixes the infinite loop on for initializers.
26753 2001-11-08 Miguel de Icaza <miguel@ximian.com>
26755 * enum.cs: More cleanup.
26757 * ecore.cs: Remove dead code.
26759 * class.cs (Property.Emit): More simplification.
26760 (Event.Emit): ditto.
26762 Reworked to have less levels of indentation.
26764 2001-11-08 Ravi Pratap <ravi@ximian.com>
26766 * class.cs (Property): Emit attributes.
26776 * enum.cs (Emit): Ditto.
26778 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
26781 * class.cs (Field, Event, etc.): Move attribute generation into the
26782 Emit method everywhere.
26784 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
26785 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
26786 as we had no way of defining nested enums !
26788 * rootcontext.cs : Adjust code accordingly.
26790 * typemanager.cs (AddEnumType): To keep track of enum types separately.
26792 2001-11-07 Ravi Pratap <ravi@ximian.com>
26794 * expression.cs (EvalConstantExpression): Move into ecore.cs
26796 * enum.cs (Enum): Rename some members and make them public and readonly
26797 according to our convention.
26799 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
26802 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
26804 (Enum::Emit): Write a simple version for now which doesn't try to compute
26805 expressions. I shall modify this to be more robust in just a while.
26807 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
26809 (TypeContainer::CloseType): Create the Enum types too.
26811 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
26813 * expression.cs (EvalConstantExpression): Get rid of completely.
26815 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
26816 user-defined values and other cases.
26818 (IsValidEnumLiteral): Helper function.
26820 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
26821 out there in the case we had a literal FieldExpr.
26823 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
26825 (Literalize): Revamp a bit to take two arguments.
26827 (EnumLiteral): New class which derives from Literal to wrap enum literals.
26829 2001-11-06 Ravi Pratap <ravi@ximian.com>
26831 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
26833 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
26835 (Resolve): Use the above to ensure we have proper initializers.
26837 2001-11-05 Ravi Pratap <ravi@ximian.com>
26839 * expression.cs (Expression::EvalConstantExpression): New method to
26840 evaluate constant expressions.
26842 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
26844 2001-11-07 Miguel de Icaza <miguel@ximian.com>
26846 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
26849 (Binary.ResolveOperator): Handle operator != (object a, object b)
26850 and operator == (object a, object b);
26852 (Binary.DoNumericPromotions): Indicate whether the numeric
26853 promotion was possible.
26855 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
26858 Made the ArrayAccess implement interface IAssignMethod instead of
26859 IStackStore as the order in which arguments are passed reflects
26862 * assign.cs: Instead of using expr.ExprClass to select the way of
26863 assinging, probe for the IStackStore/IAssignMethod interfaces.
26865 * typemanager.cs: Load InitializeArray definition.
26867 * rootcontext.cs (RootContext.MakeStaticData): Used to define
26868 static data that can be used to initialize arrays.
26870 2001-11-05 Miguel de Icaza <miguel@ximian.com>
26872 * expression.cs: Handle operator== and operator!= for booleans.
26874 (Conditioal.Reduce): Implement reducer for the ?: operator.
26876 (Conditional.Resolve): Implement dead code elimination.
26878 (Binary.Resolve): Catch string literals and return a new
26879 concatenated string.
26881 (Unary.Reduce): Implement reduction of unary expressions.
26883 * ecore.cs: Split out the expression core handling here.
26885 (Expression.Reduce): New method used to perform constant folding
26886 and CSE. This is needed to support constant-expressions.
26888 * statement.cs (Statement.EmitBoolExpression): Pass true and false
26889 targets, and optimize for !x.
26891 2001-11-04 Ravi Pratap <ravi@ximian.com>
26893 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
26894 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
26895 set custom atttributes.
26897 * literal.cs (Literal::GetValue): New abstract method to return the actual
26898 value of the literal, cast as an object.
26900 (*Literal): Implement GetValue method.
26902 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
26903 expressions to the arraylist but objects of type Argument.
26905 * class.cs (TypeContainer::Emit): Emit our attributes too.
26907 (Method::Emit, Constructor::Emit): Ditto.
26909 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
26910 to be ignoring earlier.
26912 2001-11-03 Ravi Pratap <ravi@ximian.com>
26914 * attribute.cs (AttributeSection::Define): Implement to do the business
26915 of constructing a CustomAttributeBuilder.
26917 (Attribute): New trivial class. Increases readability of code.
26919 * cs-parser.jay : Update accordingly.
26921 (positional_argument_list, named_argument_list, named_argument): New rules
26923 (attribute_arguments): Use the above so that we are more correct.
26925 2001-11-02 Ravi Pratap <ravi@ximian.com>
26927 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
26928 to perform all checks for a method with a params parameter.
26930 (Invocation::OverloadResolve): Update to use the above method and therefore
26931 cope correctly with params method invocations.
26933 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
26936 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
26937 constructors in our parent too because we can't afford to miss out on
26940 * attribute.cs (AttributeSection): New name for the class Attribute
26942 Other trivial changes to improve readability.
26944 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
26945 use the new class names.
26947 2001-11-01 Ravi Pratap <ravi@ximian.com>
26949 * class.cs (Method::Define): Complete definition for params types too
26951 (Indexer::Define): Ditto.
26953 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
26954 Cope everywhere with a request for info about the array parameter.
26956 2001-11-01 Ravi Pratap <ravi@ximian.com>
26958 * tree.cs (RecordNamespace): Fix up to check for the correct key.
26960 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
26961 local_variable_type to extract the string corresponding to the type.
26963 (local_variable_type): Fixup the action to use the new helper method.
26965 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
26968 * expression.cs : Clean out code which uses the above.
26970 2001-10-31 Ravi Pratap <ravi@ximian.com>
26972 * typemanager.cs (RegisterMethod): Check if we already have an existing key
26973 and bale out if necessary by returning a false.
26975 (RegisterProperty): Ditto.
26977 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
26978 and print out appropriate error messages.
26980 * interface.cs (everywhere): Ditto.
26982 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
26983 location to constructor.
26985 * class.cs (Property, Event, Indexer): Update accordingly.
26987 * ../errors/cs111.cs : Added.
26989 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
26990 of a method, as laid down by the spec.
26992 (Invocation::OverloadResolve): Use the above method.
26994 2001-10-31 Ravi Pratap <ravi@ximian.com>
26996 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
26997 now take a TypeContainer and a Parameters object.
26999 (ParameterData): Modify return type of ParameterModifier method to be
27000 Parameter.Modifier and not a string.
27002 (ReflectionParameters, InternalParameters): Update accordingly.
27004 * expression.cs (Argument::GetParameterModifier): Same here.
27006 * support.cs (InternalParameters::ParameterType): Find a better way of determining
27007 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
27008 symbol in it at all so maybe this is only for now.
27010 2001-10-30 Ravi Pratap <ravi@ximian.com>
27012 * support.cs (InternalParameters): Constructor now takes an extra argument
27013 which is the actual Parameters class.
27015 (ParameterDesc): Update to provide info on ref/out modifiers.
27017 * class.cs (everywhere): Update call to InternalParameters to pass in
27018 the second argument too.
27020 * support.cs (ParameterData): Add ParameterModifier, which is a method
27021 to return the modifier info [ref/out etc]
27023 (InternalParameters, ReflectionParameters): Implement the above.
27025 * expression.cs (Argument::ParameterModifier): Similar function to return
27026 info about the argument's modifiers.
27028 (Invocation::OverloadResolve): Update to take into account matching modifiers
27031 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
27032 a new SetFormalParameters object which we pass to InternalParameters.
27034 2001-10-30 Ravi Pratap <ravi@ximian.com>
27036 * expression.cs (NewArray): Merge into the ArrayCreation class.
27038 2001-10-29 Ravi Pratap <ravi@ximian.com>
27040 * expression.cs (NewArray): Merge classes NewBuiltinArray and
27041 NewUserdefinedArray into one as there wasn't much of a use in having
27044 * expression.cs (Argument): Change field's name to ArgType from Type.
27046 (Type): New readonly property which returns the proper type, taking into
27047 account ref/out modifiers.
27049 (everywhere): Adjust code accordingly for the above.
27051 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
27052 whether we are emitting for a ref or out parameter.
27054 * expression.cs (Argument::Emit): Use the above field to set the state.
27056 (LocalVariableReference::Emit): Update to honour the flag and emit the
27059 * parameter.cs (Attributes): Set the correct flags for ref parameters.
27061 * expression.cs (Argument::FullDesc): New function to provide a full desc.
27063 * support.cs (ParameterData): Add method ParameterDesc to the interface.
27065 (ReflectionParameters, InternalParameters): Implement the above method.
27067 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
27070 (Invocation::FullMethodDesc): Ditto.
27072 2001-10-29 Miguel de Icaza <miguel@ximian.com>
27074 * cs-parser.jay: Add extra production for the second form of array
27077 * expression.cs (ArrayCreation): Update to reflect the above
27080 * Small changes to prepare for Array initialization.
27082 2001-10-28 Miguel de Icaza <miguel@ximian.com>
27084 * typemanager.cs (ImplementsInterface): interface might be null;
27085 Deal with this problem;
27087 Also, we do store negative hits on the cache (null values), so use
27088 this instead of calling t.GetInterfaces on the type everytime.
27090 2001-10-28 Ravi Pratap <ravi@ximian.com>
27092 * typemanager.cs (IsBuiltinType): New method to help determine the same.
27094 * expression.cs (New::DoResolve): Get rid of array creation code and instead
27095 split functionality out into different classes.
27097 (New::FormArrayType): Move into NewBuiltinArray.
27099 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
27102 (NewBuiltinArray): New class to handle creation of built-in arrays.
27104 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
27105 account creation of one-dimensional arrays.
27107 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
27109 (NewUserdefinedArray::DoResolve): Implement.
27111 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
27113 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
27114 we maintain inside the TypeManager. This is necessary to perform lookups on the
27117 (LookupType): Update to perform GetType on the module builders too.
27119 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
27121 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
27123 2001-10-23 Ravi Pratap <ravi@ximian.com>
27125 * expression.cs (New::DoResolve): Implement guts of array creation.
27127 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
27129 2001-10-27 Miguel de Icaza <miguel@ximian.com>
27131 * expression.cs: Fix bug I introduced lsat night that broke
27134 (Expression.Resolve): Report a 246 error (can not resolve name)
27135 if we find a SimpleName in the stream.
27137 (Expression.ResolveLValue): Ditto.
27139 (Expression.ResolveWithSimpleName): This function is a variant of
27140 ResolveName, this one allows SimpleNames to be returned without a
27141 warning. The only consumer of SimpleNames is MemberAccess
27143 2001-10-26 Miguel de Icaza <miguel@ximian.com>
27145 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
27146 might arrive here. I have my doubts that this is correct.
27148 * statement.cs (Lock): Implement lock statement.
27150 * cs-parser.jay: Small fixes to support `lock' and `using'
27152 * cs-tokenizer.cs: Remove extra space
27154 * driver.cs: New flag --checked, allows to turn on integer math
27157 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
27158 Threading.Monitor.Exit
27160 2001-10-23 Miguel de Icaza <miguel@ximian.com>
27162 * expression.cs (IndexerAccess::DoResolveLValue): Set the
27163 Expression Class to be IndexerAccess.
27165 Notice that Indexer::DoResolve sets the eclass to Value.
27167 2001-10-22 Miguel de Icaza <miguel@ximian.com>
27169 * class.cs (TypeContainer::Emit): Emit code for indexers.
27171 * assign.cs (IAssignMethod): New interface implemented by Indexers
27172 and Properties for handling assignment.
27174 (Assign::Emit): Simplify and reuse code.
27176 * expression.cs (IndexerAccess, PropertyExpr): Implement
27177 IAssignMethod, clean up old code.
27179 2001-10-22 Ravi Pratap <ravi@ximian.com>
27181 * typemanager.cs (ImplementsInterface): New method to determine if a type
27182 implements a given interface. Provides a nice cache too.
27184 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
27187 (ConvertReferenceExplicit): Ditto.
27189 * delegate.cs (Delegate::Populate): Update to define the parameters on the
27190 various methods, with correct names etc.
27192 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
27193 Operator.UnaryNegation.
27195 * cs-parser.jay (operator_declarator): Be a little clever in the case where
27196 we have a unary plus or minus operator.
27198 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
27201 * everywhere : update accordingly.
27203 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
27206 * class.cs (Method::Define): For the case where we are implementing a method
27207 inherited from an interface, we need to set the MethodAttributes.Final flag too.
27208 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
27210 2001-10-21 Ravi Pratap <ravi@ximian.com>
27212 * interface.cs (FindMembers): Implement to work around S.R.E
27215 * typemanager.cs (IsInterfaceType): Implement.
27217 (FindMembers): Update to handle interface types too.
27219 * expression.cs (ImplicitReferenceConversion): Re-write bits which
27220 use IsAssignableFrom as that is not correct - it doesn't work.
27222 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
27223 and accordingly override EmitStatement.
27225 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
27226 using the correct logic :-)
27228 2001-10-19 Ravi Pratap <ravi@ximian.com>
27230 * ../errors/cs-11.cs : Add to demonstrate error -11
27232 2001-10-17 Miguel de Icaza <miguel@ximian.com>
27234 * assign.cs (Assign::Resolve): Resolve right hand side first, and
27235 then pass this as a hint to ResolveLValue.
27237 * expression.cs (FieldExpr): Add Location information
27239 (FieldExpr::LValueResolve): Report assignment to readonly
27242 (Expression::ExprClassFromMemberInfo): Pass location information.
27244 (Expression::ResolveLValue): Add new method that resolves an
27247 (Expression::DoResolveLValue): Default invocation calls
27250 (Indexers): New class used to keep track of indexers in a given
27253 (IStackStore): Renamed from LValue, as it did not really describe
27254 what this did. Also ResolveLValue is gone from this interface and
27255 now is part of Expression.
27257 (ElementAccess): Depending on the element access type
27259 * typemanager.cs: Add `indexer_name_type' as a Core type
27260 (System.Runtime.CompilerServices.IndexerNameAttribute)
27262 * statement.cs (Goto): Take a location.
27264 2001-10-18 Ravi Pratap <ravi@ximian.com>
27266 * delegate.cs (Delegate::VerifyDelegate): New method to verify
27267 if two delegates are compatible.
27269 (NewDelegate::DoResolve): Update to take care of the case when
27270 we instantiate a delegate from another delegate.
27272 * typemanager.cs (FindMembers): Don't even try to look up members
27273 of Delegate types for now.
27275 2001-10-18 Ravi Pratap <ravi@ximian.com>
27277 * delegate.cs (NewDelegate): New class to take care of delegate
27280 * expression.cs (New): Split the delegate related code out into
27281 the NewDelegate class.
27283 * delegate.cs (DelegateInvocation): New class to handle delegate
27286 * expression.cs (Invocation): Split out delegate related code into
27287 the DelegateInvocation class.
27289 2001-10-17 Ravi Pratap <ravi@ximian.com>
27291 * expression.cs (New::DoResolve): Implement delegate creation fully
27292 and according to the spec.
27294 (New::DoEmit): Update to handle delegates differently.
27296 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
27297 because of which we were printing out arguments in reverse order !
27299 * delegate.cs (VerifyMethod): Implement to check if the given method
27300 matches the delegate.
27302 (FullDelegateDesc): Implement.
27304 (VerifyApplicability): Implement.
27306 * expression.cs (Invocation::DoResolve): Update to accordingly handle
27307 delegate invocations too.
27309 (Invocation::Emit): Ditto.
27311 * ../errors/cs1593.cs : Added.
27313 * ../errors/cs1594.cs : Added.
27315 * delegate.cs (InstanceExpression, TargetMethod): New properties.
27317 2001-10-16 Ravi Pratap <ravi@ximian.com>
27319 * typemanager.cs (intptr_type): Core type for System.IntPtr
27321 (InitCoreTypes): Update for the same.
27323 (iasyncresult_type, asynccallback_type): Ditto.
27325 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
27328 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
27331 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
27332 the builders for the 4 members of a delegate type :-)
27334 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
27337 * expression.cs (New::DoResolve): Implement guts for delegate creation.
27339 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
27341 2001-10-15 Miguel de Icaza <miguel@ximian.com>
27343 * statement.cs (Break::Emit): Implement.
27344 (Continue::Emit): Implement.
27346 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
27347 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
27348 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
27349 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
27352 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
27353 properties that track the label for the current loop (begin of the
27354 loop and end of the loop).
27356 2001-10-15 Ravi Pratap <ravi@ximian.com>
27358 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
27359 use of emitting anything at all.
27361 * class.cs, rootcontext.cs : Get rid of calls to the same.
27363 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
27365 (Populate): Define the constructor correctly and set the implementation
27368 * typemanager.cs (delegate_types): New hashtable to hold delegates that
27371 (AddDelegateType): Implement.
27373 (IsDelegateType): Implement helper method.
27375 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
27377 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
27378 and accordingly handle it.
27380 * delegate.cs (Populate): Take TypeContainer argument.
27381 Implement bits to define the Invoke method. However, I still haven't figured out
27382 how to take care of the native int bit :-(
27384 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
27385 Qualify the name of the delegate, not its return type !
27387 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
27390 (StandardConversionExists): Checking for array types turns out to be recursive.
27392 (ConvertReferenceExplicit): Implement array conversion.
27394 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
27396 2001-10-12 Ravi Pratap <ravi@ximian.com>
27398 * cs-parser.jay (delegate_declaration): Store the fully qualified
27399 name as it is a type declaration.
27401 * delegate.cs (ReturnType, Name): Rename members to these. Make them
27404 (DefineDelegate): Renamed from Define. Does the same thing essentially,
27405 as TypeContainer::DefineType.
27407 (Populate): Method in which all the definition of the various methods (Invoke)
27410 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
27413 (CloseDelegate): Finally creates the delegate.
27415 * class.cs (TypeContainer::DefineType): Update to define delegates.
27416 (Populate, Emit and CloseType): Do the same thing here too.
27418 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
27419 delegates in all these operations.
27421 2001-10-14 Miguel de Icaza <miguel@ximian.com>
27423 * expression.cs: LocalTemporary: a new expression used to
27424 reference a temporary that has been created.
27426 * assign.cs: Handle PropertyAccess back here, so that we can
27427 provide the proper semantic access to properties.
27429 * expression.cs (Expression::ConvertReferenceExplicit): Implement
27430 a few more explicit conversions.
27432 * modifiers.cs: `NEW' modifier maps to HideBySig.
27434 * expression.cs (PropertyExpr): Make this into an
27435 ExpressionStatement, and support the EmitStatement code path.
27437 Perform get/set error checking, clean up the interface.
27439 * assign.cs: recognize PropertyExprs as targets, and if so, turn
27440 them into toplevel access objects.
27442 2001-10-12 Miguel de Icaza <miguel@ximian.com>
27444 * expression.cs: PropertyExpr::PropertyExpr: use work around the
27447 * typemanager.cs: Keep track here of our PropertyBuilders again to
27448 work around lameness in SRE.
27450 2001-10-11 Miguel de Icaza <miguel@ximian.com>
27452 * expression.cs (LValue::LValueResolve): New method in the
27453 interface, used to perform a second resolution pass for LValues.
27455 (This::DoResolve): Catch the use of this in static methods.
27457 (This::LValueResolve): Implement.
27459 (This::Store): Remove warning, assigning to `this' in structures
27462 (Invocation::Emit): Deal with invocation of
27463 methods on value types. We need to pass the address to structure
27464 methods rather than the object itself. (The equivalent code to
27465 emit "this" for structures leaves the entire structure on the
27466 stack instead of a pointer to it).
27468 (ParameterReference::DoResolve): Compute the real index for the
27469 argument based on whether the method takes or not a `this' pointer
27470 (ie, the method is static).
27472 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
27473 value types returned from functions when we need to invoke a
27474 method on the sturcture.
27477 2001-10-11 Ravi Pratap <ravi@ximian.com>
27479 * class.cs (TypeContainer::DefineType): Method to actually do the business of
27480 defining the type in the Modulebuilder or Typebuilder. This is to take
27481 care of nested types which need to be defined on the TypeBuilder using
27482 DefineNestedMethod.
27484 (TypeContainer::GetClassBases): Implement. Essentially the code from the
27485 methods in RootContext, only ported to be part of TypeContainer.
27487 (TypeContainer::GetInterfaceOrClass): Ditto.
27489 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
27491 * interface.cs (Interface::DefineInterface): New method. Does exactly
27492 what RootContext.CreateInterface did earlier, only it takes care of nested types
27495 (Interface::GetInterfaces): Move from RootContext here and port.
27497 (Interface::GetInterfaceByName): Same here.
27499 * rootcontext.cs (ResolveTree): Re-write.
27501 (PopulateTypes): Re-write.
27503 * class.cs (TypeContainer::Populate): Populate nested types too.
27504 (TypeContainer::Emit): Emit nested members too.
27506 * typemanager.cs (AddUserType): Do not make use of the FullName property,
27507 instead just use the name argument passed in as it is already fully
27510 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
27511 to TypeContainer mapping to see if a type is user-defined.
27513 * class.cs (TypeContainer::CloseType): Implement.
27515 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
27516 the default constructor.
27518 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
27521 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
27523 * interface.cs (CloseType): Create the type here.
27525 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
27528 Remove all the methods which are now in TypeContainer.
27530 2001-10-10 Ravi Pratap <ravi@ximian.com>
27532 * delegate.cs (Define): Re-write bits to define the delegate
27535 2001-10-10 Miguel de Icaza <miguel@ximian.com>
27537 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
27539 * expression.cs (ImplicitReferenceConversion): handle null as well
27540 as a source to convert to any reference type.
27542 * statement.cs (Return): Perform any implicit conversions to
27543 expected return type.
27545 Validate use of return statement.
27547 * codegen.cs (EmitContext): Pass the expected return type here.
27549 * class.cs (Method, Constructor, Property): Pass expected return
27550 type to EmitContext.
27552 2001-10-09 Miguel de Icaza <miguel@ximian.com>
27554 * expression.cs: Make DoResolve take an EmitContext instead of a
27557 Replaced `l' and `location' for `loc', for consistency.
27559 (Error, Warning): Remove unneeded Tc argument.
27561 * assign.cs, literal.cs, constant.cs: Update to new calling
27564 * codegen.cs: EmitContext now contains a flag indicating whether
27565 code is being generated in a static method or not.
27567 * cs-parser.jay: DecomposeQI, new function that replaces the old
27568 QualifiedIdentifier. Now we always decompose the assembled
27569 strings from qualified_identifier productions into a group of
27572 2001-10-08 Miguel de Icaza <miguel@ximian.com>
27574 * rootcontext.cs: Deal with field-less struct types correctly now
27575 by passing the size option to Define Type.
27577 * class.cs: Removed hack that created one static field.
27579 2001-10-07 Miguel de Icaza <miguel@ximian.com>
27581 * statement.cs: Moved most of the code generation here.
27583 2001-10-09 Ravi Pratap <ravi@ximian.com>
27585 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
27588 (ElementAccess): Remove useless bits for now - keep checks as the spec
27591 2001-10-08 Ravi Pratap <ravi@ximian.com>
27593 * expression.cs (ElementAccess::DoResolve): Remove my crap code
27594 and start performing checks according to the spec.
27596 2001-10-07 Ravi Pratap <ravi@ximian.com>
27598 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
27599 rank_specifiers instead.
27601 (rank_specifiers): Change the order in which the rank specifiers are stored
27603 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
27605 * expression.cs (ElementAccess): Implement the LValue interface too.
27607 2001-10-06 Ravi Pratap <ravi@ximian.com>
27609 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
27610 except that user defined conversions are not included.
27612 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
27613 perform the conversion of the return type, if necessary.
27615 (New::DoResolve): Check whether we are creating an array or an object
27616 and accordingly do the needful.
27618 (New::Emit): Same here.
27620 (New::DoResolve): Implement guts of array creation.
27622 (New::FormLookupType): Helper function.
27624 2001-10-07 Miguel de Icaza <miguel@ximian.com>
27626 * codegen.cs: Removed most of the code generation here, and move the
27627 corresponding code generation bits to the statement classes.
27629 Added support for try/catch/finalize and throw.
27631 * cs-parser.jay: Added support for try/catch/finalize.
27633 * class.cs: Catch static methods having the flags override,
27634 virtual or abstract.
27636 * expression.cs (UserCast): This user cast was not really doing
27637 what it was supposed to do. Which is to be born in fully resolved
27638 state. Parts of the resolution were being performed at Emit time!
27642 2001-10-05 Miguel de Icaza <miguel@ximian.com>
27644 * expression.cs: Implicity convert the result from UserCast.
27646 2001-10-05 Ravi Pratap <ravi@ximian.com>
27648 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
27649 prevented it from working correctly.
27651 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
27652 merely ConvertImplicit.
27654 2001-10-05 Miguel de Icaza <miguel@ximian.com>
27656 * typemanager.cs: Make the LookupTypeContainer function static,
27657 and not per-instance.
27659 * class.cs: Make static FindMembers (the one that takes a Type
27662 * codegen.cs: Add EmitForeach here.
27664 * cs-parser.jay: Make foreach a toplevel object instead of the
27665 inline expansion, as we need to perform semantic analysis on it.
27667 2001-10-05 Ravi Pratap <ravi@ximian.com>
27669 * expression.cs (Expression::ImplicitUserConversion): Rename to
27670 UserDefinedConversion.
27672 (Expression::UserDefinedConversion): Take an extra argument specifying
27673 whether we look for explicit user conversions too.
27675 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
27677 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
27679 (ExplicitUserConversion): Make it a call to UserDefinedConversion
27680 with the appropriate arguments.
27682 * cs-parser.jay (cast_expression): Record location too.
27684 * expression.cs (Cast): Record location info.
27686 (Expression::ConvertExplicit): Take location argument.
27688 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
27689 to determine if we are doing explicit conversions.
27691 (UserCast::Emit): Update accordingly.
27693 (Expression::ConvertExplicit): Report an error if everything fails.
27695 * ../errors/cs0030.cs : Add.
27697 2001-10-04 Miguel de Icaza <miguel@ximian.com>
27699 * modifiers.cs: If the ABSTRACT keyword is present, also set the
27700 virtual and newslot bits.
27702 * class.cs (TypeContainer::RegisterRequiredImplementations):
27703 Record methods we need.
27705 (TypeContainer::MakeKey): Helper function to make keys for
27706 MethodBases, since the Methodbase key is useless.
27708 (TypeContainer::Populate): Call RegisterRequiredImplementations
27709 before defining the methods.
27711 Create a mapping for method_builders_to_methods ahead of time
27712 instead of inside a tight loop.
27714 (::RequireMethods): Accept an object as the data to set into the
27715 hashtable so we can report interface vs abstract method mismatch.
27717 2001-10-03 Miguel de Icaza <miguel@ximian.com>
27719 * report.cs: Make all of it static.
27721 * rootcontext.cs: Drop object_type and value_type computations, as
27722 we have those in the TypeManager anyways.
27724 Drop report instance variable too, now it is a global.
27726 * driver.cs: Use try/catch on command line handling.
27728 Add --probe option to debug the error reporting system with a test
27731 * report.cs: Add support for exiting program when a probe
27732 condition is reached.
27734 2001-10-03 Ravi Pratap <ravi@ximian.com>
27736 * expression.cs (Binary::DoNumericPromotions): Fix the case when
27737 we do a forcible conversion regardless of type, to check if
27738 ForceConversion returns a null.
27740 (Binary::error19): Use location to report error.
27742 (Unary::error23): Use location here too.
27744 * ../errors/cs0019.cs : Check in.
27746 * ../errors/cs0023.cs : Check in.
27748 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
27749 case of a non-null MethodInfo object with a length of 0 !
27751 (Binary::ResolveOperator): Flag error if overload resolution fails to find
27752 an applicable member - according to the spec :-)
27753 Also fix logic to find members in base types.
27755 (Unary::ResolveOperator): Same here.
27757 (Unary::report23): Change name to error23 and make first argument a TypeContainer
27758 as I was getting thoroughly confused between this and error19 :-)
27760 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
27761 (::FindMostEncompassedType): Implement.
27762 (::FindMostEncompassingType): Implement.
27763 (::StandardConversionExists): Implement.
27765 (UserImplicitCast): Re-vamp. We now need info about most specific
27766 source and target types so that we can do the necessary conversions.
27768 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
27769 mathematical union with no duplicates.
27771 2001-10-03 Miguel de Icaza <miguel@ximian.com>
27773 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
27774 in order from base classes to child classes, so that we can in
27775 child classes look up in our parent for method names and
27776 attributes (required for handling abstract, virtual, new, override
27777 constructs: we need to instrospect our base class, and if we dont
27778 populate the classes in order, the introspection might be
27779 incorrect. For example, a method could query its parent before
27780 the parent has any methods and would determine that the parent has
27781 no abstract methods (while it could have had them)).
27783 (RootContext::CreateType): Record the order in which we define the
27786 2001-10-02 Miguel de Icaza <miguel@ximian.com>
27788 * class.cs (TypeContainer::Populate): Also method definitions can
27789 fail now, keep track of this.
27791 (TypeContainer::FindMembers): Implement support for
27792 DeclaredOnly/noDeclaredOnly flag.
27794 (Constructor::Emit) Return the ConstructorBuilder.
27796 (Method::Emit) Return the MethodBuilder.
27797 Check for abstract or virtual methods to be public.
27799 * rootcontext.cs (RootContext::CreateType): Register all the
27800 abstract methods required for the class to be complete and the
27801 interface methods that must be implemented.
27803 * cs-parser.jay: Report error 501 (method requires body if it is
27804 not marked abstract or extern).
27806 * expression.cs (TypeOf::Emit): Implement.
27808 * typemanager.cs: runtime_handle_type, new global type.
27810 * class.cs (Property::Emit): Generate code for properties.
27812 2001-10-02 Ravi Pratap <ravi@ximian.com>
27814 * expression.cs (Unary::ResolveOperator): Find operators on base type
27815 too - we now conform exactly to the spec.
27817 (Binary::ResolveOperator): Same here.
27819 * class.cs (Operator::Define): Fix minor quirk in the tests.
27821 * ../errors/cs0215.cs : Added.
27823 * ../errors/cs0556.cs : Added.
27825 * ../errors/cs0555.cs : Added.
27827 2001-10-01 Miguel de Icaza <miguel@ximian.com>
27829 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
27830 single integer which is really efficient
27832 2001-10-01 Ravi Pratap <ravi@ximian.com>
27834 * expression.cs (Expression::ImplicitUserConversion): Use location
27835 even in the case when we are examining True operators.
27837 * class.cs (Operator::Define): Perform extensive checks to conform
27838 with the rules for operator overloading in the spec.
27840 * expression.cs (Expression::ImplicitReferenceConversion): Implement
27841 some of the other conversions mentioned in the spec.
27843 * typemanager.cs (array_type): New static member for the System.Array built-in
27846 (cloneable_interface): For System.ICloneable interface.
27848 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
27849 we start resolving the tree and populating types.
27851 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
27853 2001-10-01 Miguel de Icaza <miguel@ximian.com>
27855 * expression.cs (Expression::ExprClassFromMemberInfo,
27856 Expression::Literalize): Create literal expressions from
27857 FieldInfos which are literals.
27859 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
27860 type casts, because they were wrong. The test suite in tests
27863 (ImplicitNumericConversion): ushort to ulong requires a widening
27866 Int32 constant to long requires widening cast as well.
27868 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
27869 for integers because the type on the stack is not i4.
27871 2001-09-30 Miguel de Icaza <miguel@ximian.com>
27873 * expression.cs (report118): require location argument.
27875 * parameter.cs: Do not dereference potential null value.
27877 * class.cs: Catch methods that lack the `new' keyword when
27878 overriding a name. Report warnings when `new' is used without
27879 anything being there to override.
27881 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
27883 * class.cs: Only add constructor to hashtable if it is non-null
27884 (as now constructors can fail on define).
27886 (TypeManager, Class, Struct): Take location arguments.
27888 Catch field instance initialization in structs as errors.
27890 accepting_filter: a new filter for FindMembers that is static so
27891 that we dont create an instance per invocation.
27893 (Constructor::Define): Catch errors where a struct constructor is
27896 * cs-parser.jay: Pass location information for various new
27899 * delegate.cs (Delegate): take a location argument.
27901 * driver.cs: Do not call EmitCode if there were problesm in the
27902 Definition of the types, as many Builders wont be there.
27904 * decl.cs (Decl::Decl): Require a location argument.
27906 * cs-tokenizer.cs: Handle properly hex constants that can not fit
27907 into integers, and find the most appropiate integer for it.
27909 * literal.cs: Implement ULongLiteral.
27911 * rootcontext.cs: Provide better information about the location of
27912 failure when CreateType fails.
27914 2001-09-29 Miguel de Icaza <miguel@ximian.com>
27916 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
27919 * expression.cs (Binary::CheckShiftArguments): Add missing type
27921 (Binary::ResolveOperator): Add type to the logical and and logical
27922 or, Bitwise And/Or and Exclusive Or code paths, it was missing
27925 (Binary::DoNumericPromotions): In the case where either argument
27926 is ulong (and most signed types combined with ulong cause an
27927 error) perform implicit integer constant conversions as well.
27929 2001-09-28 Miguel de Icaza <miguel@ximian.com>
27931 * expression.cs (UserImplicitCast): Method should always be
27933 (Invocation::BetterConversion): Simplified test for IntLiteral.
27935 (Expression::ImplicitNumericConversion): Split this routine out.
27936 Put the code that performs implicit constant integer conversions
27939 (Expression::Resolve): Become a wrapper around DoResolve so we can
27940 check eclass and type being set after resolve.
27942 (Invocation::Badness): Remove this dead function
27944 (Binary::ResolveOperator): Do not compute the expensive argumnets
27945 unless we have a union for it.
27947 (Probe::Emit): Is needs to do an isinst and then
27948 compare against null.
27950 (::CanConvert): Added Location argument. If the Location argument
27951 is null (Location.Null), then we do not report errors. This is
27952 used by the `probe' mechanism of the Explicit conversion. We do
27953 not want to generate an error for something that the user
27954 explicitly requested to be casted. But the pipeline for an
27955 explicit cast first tests for potential implicit casts.
27957 So for now, if the Location is null, it means `Probe only' to
27958 avoid adding another argument. Might have to revise this
27961 (ClassCast): New class used to type cast objects into arbitrary
27962 classes (used in Explicit Reference Conversions).
27964 Implement `as' as well.
27966 Reverted all the patches from Ravi below: they were broken:
27968 * The use of `level' as a mechanism to stop recursive
27969 invocations is wrong. That was there just to catch the
27970 bug with a strack trace but not as a way of addressing
27973 To fix the problem we have to *understand* what is going
27974 on and the interactions and come up with a plan, not
27975 just get things going.
27977 * The use of the type conversion cache that I proposed
27978 last night had an open topic: How does this work across
27979 protection domains. A user defined conversion might not
27980 be public in the location where we are applying the
27981 conversion, a different conversion might be selected
27982 (ie, private A->B (better) but public B->A (worse),
27983 inside A, A->B applies, but outside it, B->A will
27986 * On top of that (ie, even if the above is solved),
27987 conversions in a cache need to be abstract. Ie, `To
27988 convert from an Int to a Short use an OpcodeCast', not
27989 `To convert from an Int to a Short use the OpcodeCast on
27990 the variable 5' (which is what this patch was doing).
27992 2001-09-28 Ravi Pratap <ravi@ximian.com>
27994 * expression.cs (Invocation::ConversionExists): Re-write to use
27995 the conversion cache
27997 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
27998 cache all conversions done, not just user-defined ones.
28000 (Invocation::BetterConversion): The real culprit. Use ConversionExists
28001 to determine if a conversion exists instead of acutually trying to
28002 perform the conversion. It's faster too.
28004 (Expression::ConvertExplicit): Modify to use ConversionExists to check
28005 and only then attempt the implicit conversion.
28007 2001-09-28 Ravi Pratap <ravi@ximian.com>
28009 * expression.cs (ConvertImplicit): Use a cache for conversions
28010 already found. Check level of recursion and bail out if necessary.
28012 2001-09-28 Miguel de Icaza <miguel@ximian.com>
28014 * typemanager.cs (string_concat_string_string, string_concat_object_object):
28015 Export standard methods that we expect for string operations.
28017 * statement.cs (Block::UsageWarning): Track usage of variables and
28018 report the errors for not used variables.
28020 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
28023 2001-09-27 Miguel de Icaza <miguel@ximian.com>
28025 * codegen.cs: remove unnneded code
28027 * expression.cs: Removed BuiltinTypeAccess class
28029 Fix the order in which implicit conversions are
28032 The previous fixed dropped support for boxed conversions (adding a
28033 test to the test suite now)
28035 (UserImplicitCast::CanConvert): Remove test for source being null,
28036 that code is broken. We should not feed a null to begin with, if
28037 we do, then we should track the bug where the problem originates
28038 and not try to cover it up here.
28040 Return a resolved expression of type UserImplicitCast on success
28041 rather than true/false. Ravi: this is what I was talking about,
28042 the pattern is to use a static method as a "constructor" for
28045 Also, do not create arguments until the very last minute,
28046 otherwise we always create the arguments even for lookups that
28047 will never be performed.
28049 (UserImplicitCast::Resolve): Eliminate, objects of type
28050 UserImplicitCast are born in a fully resolved state.
28052 * typemanager.cs (InitCoreTypes): Init also value_type
28053 (System.ValueType).
28055 * expression.cs (Cast::Resolve): First resolve the child expression.
28057 (LValue): Add new method AddressOf to be used by
28060 Change the argument of Store to take an EmitContext instead of an
28061 ILGenerator, because things like FieldExpr need to be able to call
28062 their children expression to generate the instance code.
28064 (Expression::Error, Expression::Warning): Sugar functions for
28067 (Expression::MemberLookup): Accept a TypeContainer instead of a
28068 Report as the first argument.
28070 (Expression::ResolvePrimary): Killed. I still want to improve
28071 this as currently the code is just not right.
28073 (Expression::ResolveMemberAccess): Simplify, but it is still
28076 (Unary::Resolve): Catch errors in AddressOf operators.
28078 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
28079 index to a byte for the short-version, or the compiler will choose
28080 the wrong Emit call, which generates the wrong data.
28082 (ParameterReference::Emit, ::Store): same.
28084 (FieldExpr::AddressOf): Implement.
28086 * typemanager.cs: TypeManager: made public variable instead of
28089 * driver.cs: document --fatal.
28091 * report.cs (ErrorMessage, WarningMessage): new names for the old
28092 Error and Warning classes.
28094 * cs-parser.jay (member_access): Turn built-in access to types
28095 into a normal simplename
28097 2001-09-27 Ravi Pratap <ravi@ximian.com>
28099 * expression.cs (Invocation::BetterConversion): Fix to cope
28100 with q being null, since this was introducing a bug.
28102 * expression.cs (ConvertImplicit): Do built-in conversions first.
28104 2001-09-27 Ravi Pratap <ravi@ximian.com>
28106 * expression.cs (UserImplicitCast::Resolve): Fix bug.
28108 2001-09-27 Ravi Pratap <ravi@ximian.com>
28110 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
28111 I had introduced long ago (what's new ?).
28113 * expression.cs (UserImplicitCast::CanConvert): Static method to do
28114 the work of all the checking.
28115 (ConvertImplicit): Call CanConvert and only then create object if necessary.
28116 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
28118 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
28119 that is the right way.
28121 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
28122 overloading resolution. Use everywhere instead of cutting and pasting code.
28124 (Binary::ResolveOperator): Use MakeUnionSet.
28126 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
28127 we have to convert to bool types. Not complete yet.
28129 2001-09-27 Miguel de Icaza <miguel@ximian.com>
28131 * typemanager.cs (TypeManager::CSharpName): support ushort.
28133 * expression.cs (Expression::TryImplicitIntConversion): Attempts
28134 to provide an expression that performsn an implicit constant int
28135 conversion (section 6.1.6).
28136 (Expression::ConvertImplicitRequired): Reworked to include
28137 implicit constant expression conversions.
28139 (Expression::ConvertNumericExplicit): Finished.
28141 (Invocation::Emit): If InstanceExpression is null, then it means
28142 that we perform a call on this.
28144 2001-09-26 Miguel de Icaza <miguel@ximian.com>
28146 * expression.cs (Unary::Emit): Remove some dead code.
28147 (Probe): Implement Resolve and Emit for `is'.
28148 (Expression::ConvertImplicitRequired): Attempt to do constant
28149 expression conversions here. Maybe should be moved to
28150 ConvertImplicit, but I am not sure.
28151 (Expression::ImplicitLongConstantConversionPossible,
28152 Expression::ImplicitIntConstantConversionPossible): New functions
28153 that tell whether is it possible to apply an implicit constant
28154 expression conversion.
28156 (ConvertNumericExplicit): Started work on explicit numeric
28159 * cs-parser.jay: Update operator constants.
28161 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
28162 (Parameters::GetSignature): Hook up VerifyArgs here.
28163 (Parameters::VerifyArgs): Verifies that no two arguments have the
28166 * class.cs (Operator): Update the operator names to reflect the
28167 ones that the spec expects (as we are just stringizing the
28170 * expression.cs (Unary::ResolveOperator): Fix bug: Use
28171 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
28172 previous usage did only work for our methods.
28173 (Expression::ConvertImplicit): Handle decimal implicit numeric
28174 conversions as well.
28175 (Expression::InternalTypeConstructor): Used to invoke constructors
28176 on internal types for default promotions.
28178 (Unary::Emit): Implement special handling for the pre/post
28179 increment/decrement for overloaded operators, as they need to have
28180 the same semantics as the other operators.
28182 (Binary::ResolveOperator): ditto.
28183 (Invocation::ConversionExists): ditto.
28184 (UserImplicitCast::Resolve): ditto.
28186 2001-09-26 Ravi Pratap <ravi@ximian.com>
28188 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
28189 operator, return after emitting body. Regression tests pass again !
28191 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
28192 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
28193 (Invocation::OverloadResolve): Ditto.
28194 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
28196 * everywhere : update calls to the above methods accordingly.
28198 2001-09-26 Miguel de Icaza <miguel@ximian.com>
28200 * assign.cs (Assign): Make it inherit from ExpressionStatement.
28202 * expression.cs (ExpressionStatement): New base class used for
28203 expressions that can appear in statements, so that we can provide
28204 an alternate path to generate expression that do not leave a value
28207 (Expression::Emit, and all the derivatives): We no longer return
28208 whether a value is left on the stack or not. Every expression
28209 after being emitted leaves a single value on the stack.
28211 * codegen.cs (EmitContext::EmitStatementExpression): Use the
28212 facilties of ExpressionStatement if possible.
28214 * cs-parser.jay: Update statement_expression.
28216 2001-09-25 Miguel de Icaza <miguel@ximian.com>
28218 * driver.cs: Change the wording of message
28220 2001-09-25 Ravi Pratap <ravi@ximian.com>
28222 * expression.cs (Binary::ResolveOperator): Had forgottten to set
28223 the type of the expression to the return type of the method if
28224 we have an overloaded operator match ! The regression tests pass again !
28225 (Unary::ResolveOperator): Ditto.
28227 * expression.cs (Invocation::ConversionExists): Correct the member lookup
28228 to find "op_Implicit", not "implicit" ;-)
28229 (UserImplicitCast): New class to take care of user-defined implicit conversions.
28230 (ConvertImplicit, ForceConversion): Take TypeContainer argument
28232 * everywhere : Correct calls to the above accordingly.
28234 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
28235 (ConvertImplicit): Do user-defined conversion if it exists.
28237 2001-09-24 Miguel de Icaza <miguel@ximian.com>
28239 * assign.cs: track location.
28240 (Resolve): Use implicit conversions on assignment.
28242 * literal.cs: Oops. Not good, Emit of short access values should
28243 pass (Bytes) or the wrong argument will be selected.
28245 * expression.cs (Unary::Emit): Emit code for -expr.
28247 (Unary::ResolveOperator): Handle `Substract' for non-constants
28248 (substract from zero from the non-constants).
28249 Deal with Doubles as well.
28251 (Expression::ConvertImplicitRequired): New routine that reports an
28252 error if no implicit conversion exists.
28254 (Invocation::OverloadResolve): Store the converted implicit
28255 expressions if we make them
28257 2001-09-24 Ravi Pratap <ravi@ximian.com>
28259 * class.cs (ConstructorInitializer): Take a Location argument.
28260 (ConstructorBaseInitializer): Same here.
28261 (ConstructorThisInitializer): Same here.
28263 * cs-parser.jay : Update all calls accordingly.
28265 * expression.cs (Unary, Binary, New): Take location argument.
28266 Update accordingly everywhere.
28268 * cs-parser.jay : Update all calls to the above to take a location
28271 * class.cs : Ditto.
28273 2001-09-24 Ravi Pratap <ravi@ximian.com>
28275 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
28276 (Invocation::BetterConversion): Same here
28277 (Invocation::ConversionExists): Ditto.
28279 (Invocation::ConversionExists): Implement.
28281 2001-09-22 Ravi Pratap <ravi@ximian.com>
28283 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
28284 Also take an additional TypeContainer argument.
28286 * All over : Pass in TypeContainer as argument to OverloadResolve.
28288 * typemanager.cs (CSharpName): Update to check for the string type and return
28291 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
28294 2001-09-21 Ravi Pratap <ravi@ximian.com>
28296 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
28297 (Invocation::BetterFunction): Implement.
28298 (Invocation::BetterConversion): Implement.
28299 (Invocation::ConversionExists): Skeleton, no implementation yet.
28301 Okay, things work fine !
28303 2001-09-21 Miguel de Icaza <miguel@ximian.com>
28305 * typemanager.cs: declare and load enum_type, delegate_type and
28308 * expression.cs (Expression::Emit): Now emit returns a value that
28309 tells whether a value is left on the stack or not. This strategy
28310 might be reveted tomorrow with a mechanism that would address
28311 multiple assignments.
28312 (Expression::report118): Utility routine to report mismatches on
28315 (Unary::Report23): Report impossible type/operator combination
28318 (Unary::IsIncrementableNumber): Whether the type can be
28319 incremented or decremented with add.
28320 (Unary::ResolveOperator): Also allow enumerations to be bitwise
28322 (Unary::ResolveOperator): Implement ++, !, ~,
28324 (Invocation::Emit): Deal with new Emit convetion.
28326 * All Expression derivatives: Updated their Emit method to return
28327 whether they leave values on the stack or not.
28329 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
28330 stack for expressions that are statements.
28332 2001-09-20 Miguel de Icaza <miguel@ximian.com>
28334 * expression.cs (LValue): New interface. Must be implemented by
28336 (LocalVariableReference, ParameterReference, FieldExpr): Implement
28339 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
28340 interface for generating code, simplifies the code.
28342 2001-09-20 Ravi Pratap <ravi@ximian.com>
28344 * expression.cs (everywhere): Comment out return statements in ::Resolve
28345 methods to avoid the warnings.
28347 2001-09-20 Miguel de Icaza <miguel@ximian.com>
28349 * driver.cs (parse): Report error 2001 if we can not open the
28352 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
28355 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
28358 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
28359 otherwise nested blocks end up with the same index.
28361 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
28363 * expression.cs: Instead of having FIXMEs in the Resolve
28364 functions, throw exceptions so it is obvious that we are facing a
28367 * cs-parser.jay (invocation_expression): Pass Location information.
28369 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
28370 Use a basename for those routines because .NET does not like paths
28373 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
28376 2001-09-19 Miguel de Icaza <miguel@ximian.com>
28378 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
28379 are loading the correct data types (throws an exception if not).
28380 (TypeManager::InitCoreTypes): Use CoreLookupType
28382 * expression.cs (Unary::ResolveOperator): return the child
28383 expression for expressions which are just +expr.
28384 (Unary::ResolveOperator): Return negative literals for -LITERAL
28385 expressions (otherwise they are Unary {Literal}).
28386 (Invocation::Badness): Take into account `Implicit constant
28387 expression conversions'.
28389 * literal.cs (LongLiteral): Implement long literal class.
28390 (IntLiteral): export the `Value' of the intliteral.
28392 2001-09-19 Ravi Pratap <ravi@ximian.com>
28394 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
28396 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
28397 instead of 'Operator'
28399 * expression.cs (Binary::ResolveOperator): Update accordingly.
28400 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
28403 * cs-parser.jay (unary_expression): Update to use the new names.
28405 * gen-treedump.cs (GetUnary): Same here.
28407 * expression.cs (Unary::Resolve): Implement.
28408 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
28409 operators are found instead of making noise ;-)
28410 (Unary::ResolveOperator): New method to do precisely the same thing which
28411 Binary::ResolveOperator does for Binary expressions.
28412 (Unary.method, .Arguments): Add.
28413 (Unary::OperName): Implement.
28414 (Unary::ForceConversion): Copy and Paste !
28416 * class.cs (Operator::Define): Fix a small bug for the case when we have
28419 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
28420 for the inbuilt operators. Only overloading works for now ;-)
28422 2001-09-18 Miguel de Icaza <miguel@ximian.com>
28424 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
28425 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
28427 * expression.cs (This::Emit): Implement.
28428 (This::Resolve): Implement.
28429 (TypeOf:Resolve): Implement.
28430 (Expression::ResolveSimpleName): Add an implicit this to instance
28432 (MemberAccess::Resolve): Deal with Parameters and Fields.
28433 Bind instance variable to Field expressions.
28434 (FieldExpr::Instance): New field used to track the expression that
28435 represents the object instance.
28436 (FieldExpr::Resolve): Track potential errors from MemberLookup not
28438 (FieldExpr::Emit): Implement.
28440 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
28441 the last instruction contains a return opcode to avoid generating
28442 the last `ret' instruction (this generates correct code, and it is
28443 nice to pass the peverify output).
28445 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
28446 initializer for static and instance variables.
28447 (Constructor::Emit): Allow initializer to be null in the case of
28448 static constructors. Only emit initializer for instance
28451 (TypeContainer::FindMembers): Return a null array if there are no
28454 Also fix the code for the MemberTypes.Method branch, as it was not
28455 scanning that for operators (or tried to access null variables before).
28457 * assign.cs (Assign::Emit): Handle instance and static fields.
28461 * driver.cs: Stop compilation if there are parse errors.
28463 * cs-parser.jay (constructor_declaration): Provide default base
28464 initializer for non-static constructors.
28465 (constructor_declarator): Do not provide a default base
28466 initializers if none was specified.
28467 Catch the fact that constructors should not have parameters.
28469 * class.cs: Do not emit parent class initializers for static
28470 constructors, that should be flagged as an error.
28472 2001-09-18 Ravi Pratap <ravi@ximian.com>
28474 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
28475 Move back code into TypeContainer::Populate.
28477 2001-09-18 Ravi Pratap <ravi@ximian.com>
28479 * class.cs (TypeContainer::AddConstructor): Fix the check to
28480 compare against Name, not Basename.
28481 (Operator::OpType): Change Plus and Minus to Add and Subtract.
28483 * cs-parser.jay : Update accordingly.
28485 * class.cs (TypeContainer::FindMembers): For the case where we are searching
28486 for methods, don't forget to look into the operators too.
28487 (RegisterMethodBuilder): Helper method to take care of this for
28488 methods, constructors and operators.
28489 (Operator::Define): Completely revamp.
28490 (Operator.OperatorMethod, MethodName): New fields.
28491 (TypeContainer::Populate): Move the registering of builders into
28492 RegisterMethodBuilder.
28493 (Operator::Emit): Re-write.
28495 * expression.cs (Binary::Emit): Comment out code path to emit method
28496 invocation stuff for the case when we have a user defined operator. I am
28497 just not able to get it right !
28499 2001-09-17 Miguel de Icaza <miguel@ximian.com>
28501 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
28504 (Expression::MemberLookup): Provide a version that allows to
28505 specify the MemberTypes and BindingFlags.
28507 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
28508 so it was not fetching variable information from outer blocks.
28510 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
28511 Beforefieldinit as it was buggy.
28513 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
28514 that Ravi put here.
28516 * class.cs (Constructor::Emit): Only emit if block is not null.
28517 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
28518 deal with this by semantically definining it as if the user had
28521 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
28522 constructors as we now "emit" them at a higher level.
28524 (TypeContainer::DefineDefaultConstructor): Used to define the
28525 default constructors if none was provided.
28527 (ConstructorInitializer): Add methods Resolve and Emit.
28529 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
28531 2001-09-17 Ravi Pratap <ravi@ximian.com>
28533 * class.cs (TypeContainer::EmitDefaultConstructor): Register
28534 the default constructor builder with our hashtable for methodbuilders
28537 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
28538 and argument_count is 0 in which case we have a match.
28539 (Binary::ResolveOperator): More null checking and miscellaneous coding
28542 2001-09-17 Ravi Pratap <ravi@ximian.com>
28544 * rootcontext.cs (IsNameSpace): Compare against null.
28546 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
28548 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
28549 and Unary::Operator.
28551 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
28554 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
28555 we have overloaded operators.
28556 (Binary::ResolveOperator): Implement the part which does the operator overload
28559 * class.cs (Operator::Emit): Implement.
28560 (TypeContainer::Emit): Emit the operators we have too.
28562 * expression.cs (Binary::Emit): Update to emit the appropriate code for
28563 the case when we have a user-defined operator.
28565 2001-09-17 Miguel de Icaza <miguel@ximian.com>
28567 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
28569 2001-09-16 Ravi Pratap <ravi@ximian.com>
28571 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
28572 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
28573 (Constructor::Emit): Implement.
28574 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
28575 if we have no work to do.
28576 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
28579 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
28580 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
28582 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
28585 2001-09-15 Ravi Pratap <ravi@ximian.com>
28587 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
28589 (Tree::RecordNamespace): Method to do what the name says ;-)
28590 (Tree::Namespaces): Property to get at the namespaces hashtable.
28592 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
28595 * rootcontext.cs (IsNamespace): Fixed it :-)
28597 2001-09-14 Miguel de Icaza <miguel@ximian.com>
28599 * class.cs (TypeContainer::FindMembers): Add support for
28601 (MethodCore): New class that encapsulates both the shared aspects
28602 of a Constructor and a Method.
28603 (Method, Constructor): Factored pieces into MethodCore.
28605 * driver.cs: Added --fatal which makes errors throw exceptions.
28606 Load System assembly as well as part of the standard library.
28608 * report.cs: Allow throwing exceptions on errors for debugging.
28610 * modifiers.cs: Do not use `parent', instead use the real type
28611 container to evaluate permission settings.
28613 * class.cs: Put Ravi's patch back in. He is right, and we will
28614 have to cope with the
28616 2001-09-14 Ravi Pratap <ravi@ximian.com>
28618 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
28619 FamORAssem, not FamANDAssem.
28621 2001-09-14 Miguel de Icaza <miguel@ximian.com>
28623 * driver.cs: Added --parse option that only parses its input files
28626 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
28627 incorrect. IsTopLevel is not used to tell whether an object is
28628 root_types or not (that can be achieved by testing this ==
28629 root_types). But to see if this is a top-level *class* (not
28630 necessarly our "toplevel" container).
28632 2001-09-14 Ravi Pratap <ravi@ximian.com>
28634 * enum.cs (Enum::Define): Modify to call the Lookup method on the
28635 parent instead of a direct call to GetType.
28637 2001-09-14 Ravi Pratap <ravi@ximian.com>
28639 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
28640 Modifiers.TypeAttr. This should just be a call to that method.
28642 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
28643 object so that we can determine if we are top-level or not.
28645 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
28648 * enum.cs (Enum::Define): Ditto.
28650 * modifiers.cs (FieldAttr): Re-write.
28652 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
28653 (TypeContainer::HaveStaticConstructor): New property to provide access
28654 to precisely that info.
28656 * modifiers.cs (MethodAttr): Re-write.
28657 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
28659 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
28660 of top-level types as claimed.
28662 2001-09-13 Miguel de Icaza <miguel@ximian.com>
28664 * expression.cs (MemberLookup): Fruitless attempt to lookup
28665 constructors. Maybe I need to emit default constructors? That
28666 might be it (currently .NET emits this for me automatically).
28667 (Invocation::OverloadResolve): Cope with Arguments == null.
28668 (Invocation::EmitArguments): new function, shared by the new
28669 constructor and us.
28670 (Invocation::Emit): Handle static and instance methods. Emit
28671 proper call instruction for virtual or non-virtual invocations.
28672 (New::Emit): Implement.
28673 (New::Resolve): Implement.
28674 (MemberAccess:Resolve): Implement.
28675 (MethodGroupExpr::InstanceExpression): used conforming to the spec
28676 to track instances.
28677 (FieldExpr::Resolve): Set type.
28679 * support.cs: Handle empty arguments.
28681 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
28682 SimpleLookup): Auxiliary routines to help parse a qualifier
28685 Update qualifier_identifier rule.
28687 * codegen.cs: Removed debugging messages.
28689 * class.cs: Make this a global thing, this acts just as a "key" to
28690 objects that we might have around.
28692 (Populate): Only initialize method_builders_to_methods once.
28694 * expression.cs (PropertyExpr): Initialize type from the
28697 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
28698 Resolve pattern. Attempt to implicitly convert value to boolean.
28701 * expression.cs: Set the type for the int32/int32 argument case.
28702 (Binary::ResolveOperator): Set the return type to boolean for
28703 comparission operators
28705 * typemanager.cs: Remove debugging print code.
28707 (Invocation::Resolve): resolve type.
28709 * class.cs: Allocate a MemberInfo of the correct size, as the code
28710 elsewhere depends on the test to reflect the correct contents.
28712 (Method::) Keep track of parameters, due to System.Reflection holes
28714 (TypeContainer::Populate): Keep track of MethodBuilders to Method
28717 (TypeContainer::FindMembers): Use ArrayList and then copy an array
28718 of the exact size and return that.
28720 (Class::LookupMethodByBuilder): New function that maps
28721 MethodBuilders to its methods. Required to locate the information
28722 on methods because System.Reflection bit us again.
28724 * support.cs: New file, contains an interface ParameterData and
28725 two implementations: ReflectionParameters and InternalParameters
28726 used to access Parameter information. We will need to grow this
28729 * expression.cs (Invocation::GetParameterData): implement a cache
28730 and a wrapper around the ParameterData creation for methods.
28731 (Invocation::OverloadResolve): Use new code.
28733 2001-09-13 Ravi Pratap <ravi@ximian.com>
28735 * class.cs (TypeContainer::EmitField): Remove and move into
28736 (Field::Define): here and modify accordingly.
28737 (Field.FieldBuilder): New member.
28738 (TypeContainer::Populate): Update accordingly.
28739 (TypeContainer::FindMembers): Implement.
28741 2001-09-13 Miguel de Icaza <miguel@ximian.com>
28743 * statement.cs: (VariableInfo::VariableType): New field to be
28744 initialized with the full type once it is resolved.
28746 2001-09-12 Miguel de Icaza <miguel@ximian.com>
28748 * parameter.cs (GetParameterInfo): Use a type cache to compute
28749 things only once, and to reuse this information
28751 * expression.cs (LocalVariableReference::Emit): Implement.
28752 (OpcodeCast::Emit): fix.
28754 (ParameterReference::Resolve): Implement.
28755 (ParameterReference::Emit): Implement.
28757 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
28758 that are expressions need to stay as Expressions.
28760 * typemanager.cs (CSharpName): Returns the C# name of a type if
28763 * expression.cs (Expression::ConvertImplicit): New function that
28764 implements implicit type conversions.
28766 (Expression::ImplicitReferenceConversion): Implements implicit
28767 reference conversions.
28769 (EmptyCast): New type for transparent casts.
28771 (OpcodeCast): New type for casts of types that are performed with
28772 a sequence of bytecodes.
28774 (BoxedCast): New type used for casting value types into reference
28775 types. Emits a box opcode.
28777 (Binary::DoNumericPromotions): Implements numeric promotions of
28778 and computation of the Binary::Type.
28780 (Binary::EmitBranchable): Optimization.
28782 (Binary::Emit): Implement code emission for expressions.
28784 * typemanager.cs (TypeManager): Added two new core types: sbyte
28787 2001-09-12 Ravi Pratap <ravi@ximian.com>
28789 * class.cs (TypeContainer::FindMembers): Method which does exactly
28790 what Type.FindMembers does, only we don't have to use reflection. No
28791 implementation yet.
28793 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
28794 typecontainer objects as we need to get at them.
28795 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
28797 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
28798 typecontainer object.
28800 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
28801 of just a Report object.
28803 2001-09-11 Ravi Pratap <ravi@ximian.com>
28805 * class.cs (Event::Define): Go back to using the prefixes "add_" and
28807 (TypeContainer::Populate): Now define the delegates of the type too.
28808 (TypeContainer.Delegates): Property to access the list of delegates defined
28811 * delegates.cs (Delegate::Define): Implement partially.
28813 * modifiers.cs (TypeAttr): Handle more flags.
28815 2001-09-11 Ravi Pratap <ravi@ximian.com>
28817 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
28819 (Operator::Define): Re-write logic to get types by using the LookupType method
28820 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
28821 (Indexer::Define): Ditto.
28822 (Event::Define): Ditto.
28823 (Property::Define): Ditto.
28825 2001-09-10 Ravi Pratap <ravi@ximian.com>
28827 * class.cs (TypeContainer::Populate): Now define operators too.
28828 (TypeContainer.Operators): New property to access the list of operators
28830 (Operator.OperatorMethodBuilder): New member to hold the method builder
28831 for the operator we are defining.
28832 (Operator::Define): Implement.
28834 2001-09-10 Ravi Pratap <ravi@ximian.com>
28836 * class.cs (Event::Define): Make the prefixes of the accessor methods
28837 addOn_ and removeOn_
28839 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
28840 of the location being passed in too. Ideally, this should go later since all
28841 error reporting should be done through the Report object.
28843 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
28844 (Populate): Iterate thru the indexers we have and define them too.
28845 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
28846 for the get and set accessors.
28847 (Indexer::Define): Implement.
28849 2001-09-09 Miguel de Icaza <miguel@ximian.com>
28851 * expression.cs (Binary::Resolve): Beginning of it. I scratched
28852 my previous implementation, did not work.
28854 * typemanager.cs: Add a couple of missing types (the longs).
28856 * literal.cs: Use TypeManager.bool_type instead of getting it.
28858 * expression.cs (EventExpr): New kind of expressions.
28859 (Expressio::ExprClassFromMemberInfo): finish
28861 2001-09-08 Miguel de Icaza <miguel@ximian.com>
28863 * assign.cs: Emit stores to static fields differently.
28865 2001-09-08 Ravi Pratap <ravi@ximian.com>
28867 * Merge in changes and adjust code to tackle conflicts. Backed out my
28868 code in Assign::Resolve ;-)
28870 2001-09-08 Ravi Pratap <ravi@ximian.com>
28872 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
28873 instead Report.Error and also pass in the location.
28874 (CSharpParser::Lexer): New readonly property to return the reference
28875 to the Tokenizer object.
28876 (declare_local_variables): Use Report.Error with location instead of plain
28880 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
28881 (Operator.CheckBinaryOperator): Ditto.
28883 * cs-parser.jay (operator_declarator): Update accordingly.
28885 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
28886 (CheckBinaryOperator): Same here.
28888 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
28889 on the name without any prefixes of namespace names etc. This is because we
28890 already might have something already fully qualified like
28891 'System.Console.WriteLine'
28893 * assign.cs (Resolve): Begin implementation. Stuck ;-)
28895 2001-09-07 Ravi Pratap <ravi@ximian.com>
28897 * cs-tokenizer.cs (location): Return a string which also contains
28900 * expression.cs (ElementAccess): New class for expressions of the
28901 type 'element access.'
28902 (BaseAccess): New class for expressions of the type 'base access.'
28903 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
28906 * cs-parser.jay (element_access): Implement action.
28907 (base_access): Implement actions.
28908 (checked_expression, unchecked_expression): Implement.
28910 * cs-parser.jay (local_variable_type): Correct and implement.
28911 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
28913 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
28915 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
28916 name and the specifiers.
28918 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
28920 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
28921 making them all public ;-)
28923 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
28926 2001-09-07 Miguel de Icaza <miguel@ximian.com>
28928 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
28930 (FieldExpr, PropertyExprs): New resolved expressions.
28931 (SimpleName::MemberStaticCheck): Perform static checks for access
28932 to non-static fields on static methods. Maybe this should be
28933 generalized for MemberAccesses.
28934 (SimpleName::ResolveSimpleName): More work on simple name
28937 * cs-parser.jay (primary_expression/qualified_identifier): track
28938 the parameter index.
28940 * codegen.cs (CodeGen::Save): Catch save exception, report error.
28941 (EmitContext::EmitBoolExpression): Chain to expression generation
28942 instead of temporary hack.
28943 (::EmitStatementExpression): Put generic expression code generation.
28945 * assign.cs (Assign::Emit): Implement variable assignments to
28946 local variables, parameters and fields.
28948 2001-09-06 Miguel de Icaza <miguel@ximian.com>
28950 * statement.cs (Block::GetVariableInfo): New method, returns the
28951 VariableInfo for a variable name in a block.
28952 (Block::GetVariableType): Implement in terms of GetVariableInfo
28954 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
28955 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
28957 2001-09-06 Ravi Pratap <ravi@ximian.com>
28959 * cs-parser.jay (operator_declaration): Continue on my quest : update
28960 to take attributes argument.
28961 (event_declaration): Ditto.
28962 (enum_declaration): Ditto.
28963 (indexer_declaration): Ditto.
28965 * class.cs (Operator::Operator): Update constructor accordingly.
28966 (Event::Event): Ditto.
28968 * delegate.cs (Delegate::Delegate): Same here.
28970 * enum.cs (Enum::Enum): Same here.
28972 2001-09-05 Ravi Pratap <ravi@ximian.com>
28974 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
28976 * ../tests/cs0658.cs : New file to demonstrate error 0658.
28978 * attribute.cs (Attributes): New class to encapsulate all attributes which were
28979 being passed around as an arraylist.
28980 (Attributes::AddAttribute): Method to add attribute sections.
28982 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
28983 (struct_declaration): Update accordingly.
28984 (constant_declaration): Update.
28985 (field_declaration): Update.
28986 (method_header): Update.
28987 (fixed_parameter): Update.
28988 (parameter_array): Ditto.
28989 (property_declaration): Ditto.
28990 (destructor_declaration): Ditto.
28992 * class.cs (Struct::Struct): Update constructors accordingly.
28993 (Class::Class): Ditto.
28994 (Field::Field): Ditto.
28995 (Method::Method): Ditto.
28996 (Property::Property): Ditto.
28997 (TypeContainer::OptAttribute): update property's return type.
28999 * interface.cs (Interface.opt_attributes): New member.
29000 (Interface::Interface): Update to take the extra Attributes argument.
29002 * parameter.cs (Parameter::Parameter): Ditto.
29004 * constant.cs (Constant::Constant): Ditto.
29006 * interface.cs (InterfaceMemberBase): New OptAttributes field.
29007 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
29008 the attributes as a parameter.
29009 (InterfaceProperty): Update constructor call.
29010 (InterfaceEvent): Ditto.
29011 (InterfaceMethod): Ditto.
29012 (InterfaceIndexer): Ditto.
29014 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
29015 pass the attributes too.
29016 (interface_event_declaration): Ditto.
29017 (interface_property_declaration): Ditto.
29018 (interface_method_declaration): Ditto.
29019 (interface_declaration): Ditto.
29021 2001-09-05 Miguel de Icaza <miguel@ximian.com>
29023 * class.cs (Method::Define): Track the "static Main" definition to
29024 create an entry point.
29026 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
29027 EntryPoint if we find it.
29029 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
29030 (EmitContext::ig): Make this variable public.
29032 * driver.cs: Make the default output file be the first file name
29033 with the .exe extension.
29035 Detect empty compilations
29037 Handle various kinds of output targets. Handle --target and
29038 rename -t to --dumper.
29040 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
29041 methods inherited from Expression return now an Expression. This
29042 will is used during the tree rewriting as we resolve them during
29045 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
29046 the spec. Missing entirely is the information about
29047 accessability of elements of it.
29049 (Expression::ExprClassFromMemberInfo): New constructor for
29050 Expressions that creates a fully initialized Expression based on
29051 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
29054 (Invocation::Resolve): Begin implementing resolution of invocations.
29056 * literal.cs (StringLiteral): Implement Emit.
29058 2001-09-05 Ravi Pratap <ravi@ximian.com>
29060 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
29063 2001-09-04 Ravi Pratap <ravi@ximian.com>
29065 * cs-parser.jay (attribute_arguments): Implement actions.
29066 (attribute): Fix bug in production. Implement action.
29067 (attribute_list): Implement.
29068 (attribute_target): Implement.
29069 (attribute_target_specifier, opt_target_specifier): Implement
29070 (CheckAttributeTarget): New method to check if the attribute target
29072 (attribute_section): Implement.
29073 (opt_attributes): Implement.
29075 * attribute.cs : New file to handle attributes.
29076 (Attribute): Class to hold attribute info.
29078 * cs-parser.jay (opt_attribute_target_specifier): Remove production
29079 (attribute_section): Modify production to use 2 different rules to
29080 achieve the same thing. 1 s/r conflict down !
29081 Clean out commented, useless, non-reducing dimension_separator rules.
29083 * class.cs (TypeContainer.attributes): New member to hold list
29084 of attributes for a type.
29085 (Struct::Struct): Modify to take one more argument, the attribute list.
29086 (Class::Class): Ditto.
29087 (Field::Field): Ditto.
29088 (Method::Method): Ditto.
29089 (Property::Property): Ditto.
29091 * cs-parser.jay (struct_declaration): Update constructor call to
29092 pass in the attributes too.
29093 (class_declaration): Ditto.
29094 (constant_declaration): Ditto.
29095 (field_declaration): Ditto.
29096 (method_header): Ditto.
29097 (fixed_parameter): Ditto.
29098 (parameter_array): Ditto.
29099 (property_declaration): Ditto.
29101 * constant.cs (Constant::Constant): Update constructor similarly.
29102 Use System.Collections.
29104 * parameter.cs (Parameter::Parameter): Update as above.
29106 2001-09-02 Ravi Pratap <ravi@ximian.com>
29108 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
29109 (TypeContainer.delegates): New member to hold list of delegates.
29111 * cs-parser.jay (delegate_declaration): Implement the action correctly
29112 this time as I seem to be on crack ;-)
29114 2001-09-02 Miguel de Icaza <miguel@ximian.com>
29116 * rootcontext.cs (RootContext::IsNamespace): new function, used to
29117 tell whether an identifier represents a namespace.
29119 * expression.cs (NamespaceExpr): A namespace expression, used only
29120 temporarly during expression resolution.
29121 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
29122 utility functions to resolve names on expressions.
29124 2001-09-01 Miguel de Icaza <miguel@ximian.com>
29126 * codegen.cs: Add hook for StatementExpressions.
29128 * class.cs: Fix inverted test for static flag in methods.
29130 2001-09-02 Ravi Pratap <ravi@ximian.com>
29132 * class.cs (Operator::CheckUnaryOperator): Correct error number used
29133 to make it coincide with MS' number.
29134 (Operator::CheckBinaryOperator): Ditto.
29136 * ../errors/errors.txt : Remove error numbers added earlier.
29138 * ../errors/cs1019.cs : Test case for error # 1019
29140 * ../errros/cs1020.cs : Test case for error # 1020
29142 * cs-parser.jay : Clean out commented cruft.
29143 (dimension_separators, dimension_separator): Comment out. Ostensibly not
29144 used anywhere - non-reducing rule.
29145 (namespace_declarations): Non-reducing rule - comment out.
29147 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
29148 with TypeContainer::AddEnum.
29150 * delegate.cs : New file for delegate handling classes.
29151 (Delegate): Class for declaring delegates.
29153 * makefile : Update.
29155 * cs-parser.jay (delegate_declaration): Implement.
29157 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
29159 * class.cs (Event::Define): Implement.
29160 (Event.EventBuilder): New member.
29162 * class.cs (TypeContainer::Populate): Update to define all enums and events
29164 (Events): New property for the events arraylist we hold. Shouldn't we move to using
29165 readonly fields for all these cases ?
29167 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
29169 * class.cs (Property): Revamp to use the convention of making fields readonly.
29170 Accordingly modify code elsewhere.
29172 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
29173 the Define method of the Property class.
29175 * class.cs : Clean up applied patch and update references to variables etc. Fix
29177 (TypeContainer::Populate): Update to define all the properties we have. Also
29178 define all enumerations.
29180 * enum.cs (Define): Implement.
29182 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
29184 * cs-parser.jay (overloadable_operator): The semantic value is an
29185 enum of the Operator class.
29186 (operator_declarator): Implement actions.
29187 (operator_declaration): Implement.
29189 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
29190 validity of definitions.
29191 (Operator::CheckBinaryOperator): Static method to check for binary operators
29192 (TypeContainer::AddOperator): New method to add an operator to a type.
29194 * cs-parser.jay (indexer_declaration): Added line to actually call the
29195 AddIndexer method so it gets added ;-)
29197 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
29198 already taken care of by the MS compiler ?
29200 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
29202 * class.cs (Operator): New class for operator declarations.
29203 (Operator::OpType): Enum for the various operators.
29205 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
29207 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
29208 ostensibly handle this in semantic analysis.
29210 * cs-parser.jay (general_catch_clause): Comment out
29211 (specific_catch_clauses, specific_catch_clause): Ditto.
29212 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
29213 (catch_args, opt_catch_args): New productions.
29214 (catch_clause): Rewrite to use the new productions above
29215 (catch_clauses): Modify accordingly.
29216 (opt_catch_clauses): New production to use in try_statement
29217 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
29218 and re-write the code in the actions to extract the specific and
29219 general catch clauses by being a little smart ;-)
29221 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
29222 Hooray, try and catch statements parse fine !
29224 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
29226 * statement.cs (Block::GetVariableType): Fix logic to extract the type
29227 string from the hashtable of variables.
29229 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
29230 I end up making that mistake ;-)
29231 (catch_clauses): Fixed gross error which made Key and Value of the
29232 DictionaryEntry the same : $1 !!
29234 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
29236 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
29238 * cs-parser.jay (event_declaration): Correct to remove the semicolon
29239 when the add and remove accessors are specified.
29241 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
29243 * cs-parser.jay (IndexerDeclaration): New helper class to hold
29244 information about indexer_declarator.
29245 (indexer_declarator): Implement actions.
29246 (parsing_indexer): New local boolean used to keep track of whether
29247 we are parsing indexers or properties. This is necessary because
29248 implicit_parameters come into picture even for the get accessor in the
29249 case of an indexer.
29250 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
29252 * class.cs (Indexer): New class for indexer declarations.
29253 (TypeContainer::AddIndexer): New method to add an indexer to a type.
29254 (TypeContainer::indexers): New member to hold list of indexers for the
29257 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
29259 * cs-parser.jay (add_accessor_declaration): Implement action.
29260 (remove_accessor_declaration): Implement action.
29261 (event_accessors_declaration): Implement
29262 (variable_declarators): swap statements for first rule - trivial.
29264 * class.cs (Event): New class to hold information about event
29266 (TypeContainer::AddEvent): New method to add an event to a type
29267 (TypeContainer::events): New member to hold list of events.
29269 * cs-parser.jay (event_declaration): Implement actions.
29271 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
29273 * cs-parser.jay (dim_separators): Implement. Make it a string
29274 concatenating all the commas together, just as they appear.
29275 (opt_dim_separators): Modify accordingly
29276 (rank_specifiers): Update accordingly. Basically do the same
29277 thing - instead, collect the brackets here.
29278 (opt_rank_sepcifiers): Modify accordingly.
29279 (array_type): Modify to actually return the complete type string
29280 instead of ignoring the rank_specifiers.
29281 (expression_list): Implement to collect the expressions
29282 (variable_initializer): Implement. We make it a list of expressions
29283 essentially so that we can handle the array_initializer case neatly too.
29284 (variable_initializer_list): Implement.
29285 (array_initializer): Make it a list of variable_initializers
29286 (opt_array_initializer): Modify accordingly.
29288 * expression.cs (New::NType): Add enumeration to help us
29289 keep track of whether we have an object/delegate creation
29290 or an array creation.
29291 (New:NewType, New::Rank, New::Indices, New::Initializers): New
29292 members to hold data about array creation.
29293 (New:New): Modify to update NewType
29294 (New:New): New Overloaded contructor for the array creation
29297 * cs-parser.jay (array_creation_expression): Implement to call
29298 the overloaded New constructor.
29300 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
29302 * class.cs (TypeContainer::Constructors): Return member
29303 constructors instead of returning null.
29305 2001-08-26 Miguel de Icaza <miguel@ximian.com>
29307 * typemanager.cs (InitCoreTypes): Initialize the various core
29308 types after we have populated the type manager with the user
29309 defined types (this distinction will be important later while
29310 compiling corlib.dll)
29312 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
29313 on Expression Classification. Now all expressions have a method
29314 `Resolve' and a method `Emit'.
29316 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
29317 generation from working. Also add some temporary debugging
29320 2001-08-24 Miguel de Icaza <miguel@ximian.com>
29322 * codegen.cs: Lots of code generation pieces. This is only the
29323 beginning, will continue tomorrow with more touches of polish. We
29324 handle the fundamentals of if, while, do, for, return. Others are
29325 trickier and I need to start working on invocations soon.
29327 * gen-treedump.cs: Bug fix, use s.Increment here instead of
29330 * codegen.cs (EmitContext): New struct, used during code
29331 emission to keep a context. Most of the code generation will be
29334 * cs-parser.jay: Add embedded blocks to the list of statements of
29335 this block. So code generation proceeds in a top down fashion.
29337 2001-08-23 Miguel de Icaza <miguel@ximian.com>
29339 * statement.cs: Add support for multiple child blocks.
29341 2001-08-22 Miguel de Icaza <miguel@ximian.com>
29343 * codegen.cs (EmitCode): New function, will emit the code for a
29344 Block of code given a TypeContainer and its ILGenerator.
29346 * statement.cs (Block): Standard public readonly optimization.
29347 (Block::Block constructors): Link children.
29348 (Block::Child): Child Linker.
29349 (Block::EmitVariables): Emits IL variable declarations.
29351 * class.cs: Drop support for MethodGroups here, delay until
29353 (Method::): Applied the same simplification that I did before, and
29354 move from Properties to public readonly fields.
29355 (Method::ParameterTypes): Returns the parameter types for the
29356 function, and implements a cache that will be useful later when I
29357 do error checking and the semantic analysis on the methods is
29359 (Constructor::GetCallingConvention): Renamed from CallingConvetion
29360 and made a method, optional argument tells whether this is a class
29361 or a structure to apply the `has-this' bit.
29362 (Method::GetCallingConvention): Implement, returns the calling
29364 (Method::Define): Defines the type, a second pass is performed
29365 later to populate the methods.
29367 (Constructor::ParameterTypes): implement a cache similar to the
29368 one on Method::ParameterTypes, useful later when we do semantic
29371 (TypeContainer::EmitMethod): New method. Emits methods.
29373 * expression.cs: Removed MethodGroup class from here.
29375 * parameter.cs (Parameters::GetCallingConvention): new method.
29377 2001-08-21 Miguel de Icaza <miguel@ximian.com>
29379 * class.cs (TypeContainer::Populate): Drop RootContext from the
29382 (Constructor::CallingConvention): Returns the calling convention.
29383 (Constructor::ParameterTypes): Returns the constructor parameter
29386 (TypeContainer::AddConstructor): Keep track of default constructor
29387 and the default static constructor.
29389 (Constructor::) Another class that starts using `public readonly'
29390 instead of properties.
29392 (Constructor::IsDefault): Whether this is a default constructor.
29394 (Field::) use readonly public fields instead of properties also.
29396 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
29397 track of static constructors; If none is used, turn on
29398 BeforeFieldInit in the TypeAttributes.
29400 * cs-parser.jay (opt_argument_list): now the return can be null
29401 for the cases where there are no arguments.
29403 (constructor_declarator): If there is no implicit `base' or
29404 `this', then invoke the default parent constructor.
29406 * modifiers.cs (MethodAttr): New static function maps a set of
29407 modifiers flags into a MethodAttributes enum
29408 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
29409 MethodAttr, TypeAttr to represent the various mappings where the
29410 modifiers are used.
29411 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
29413 2001-08-19 Miguel de Icaza <miguel@ximian.com>
29415 * parameter.cs (GetParameterInfo): Fix bug where there would be no
29418 * interface.cs (PopulateIndexer): Implemented the code generator
29419 for interface indexers.
29421 2001-08-17 Miguel de Icaza <miguel@ximian.com>
29423 * interface.cs (InterfaceMemberBase): Now we track the new status
29426 (PopulateProperty): Implement property population. Woohoo! Got
29427 Methods and Properties going today.
29429 Removed all the properties for interfaces, and replaced them with
29430 `public readonly' fields.
29432 2001-08-16 Miguel de Icaza <miguel@ximian.com>
29434 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
29435 initialize their hashtables/arraylists only when they are needed
29436 instead of doing this always.
29438 * parameter.cs: Handle refs and out parameters.
29440 * cs-parser.jay: Use an ArrayList to construct the arguments
29441 instead of the ParameterCollection, and then cast that to a
29444 * parameter.cs: Drop the use of ParameterCollection and use
29445 instead arrays of Parameters.
29447 (GetParameterInfo): Use the Type, not the Name when resolving
29450 2001-08-13 Miguel de Icaza <miguel@ximian.com>
29452 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
29453 and instead use public readonly fields.
29455 * class.cs: Put back walking code for type containers.
29457 2001-08-11 Miguel de Icaza <miguel@ximian.com>
29459 * class.cs (MakeConstant): Code to define constants.
29461 * rootcontext.cs (LookupType): New function. Used to locate types
29464 2001-08-08 Miguel de Icaza <miguel@ximian.com>
29466 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
29467 this System.Reflection code is. Kudos to Microsoft
29469 * typemanager.cs: Implement a type cache and avoid loading all
29470 types at boot time. Wrap in LookupType the internals. This made
29471 the compiler so much faster. Wow. I rule!
29473 * driver.cs: Make sure we always load mscorlib first (for
29474 debugging purposes, nothing really important).
29476 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
29477 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
29479 * rootcontext.cs: Lookup types on their namespace; Lookup types
29480 on namespaces that have been imported using the `using' keyword.
29482 * class.cs (TypeContainer::TypeAttr): Virtualize.
29483 (Class::TypeAttr): Return attributes suitable for this bad boy.
29484 (Struct::TypeAttr): ditto.
29485 Handle nested classes.
29486 (TypeContainer::) Remove all the type visiting code, it is now
29487 replaced with the rootcontext.cs code
29489 * rootcontext.cs (GetClassBases): Added support for structs.
29491 2001-08-06 Miguel de Icaza <miguel@ximian.com>
29493 * interface.cs, statement.cs, class.cs, parameter.cs,
29494 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
29495 Drop use of TypeRefs, and use strings instead.
29497 2001-08-04 Miguel de Icaza <miguel@ximian.com>
29501 * class.cs (Struct::Struct): set the SEALED flags after
29502 checking the modifiers.
29503 (TypeContainer::TypeAttr): new property, returns the
29504 TypeAttributes for a class.
29506 * cs-parser.jay (type_list): Oops, list production was creating a
29507 new list of base types.
29509 * rootcontext.cs (StdLib): New property.
29510 (GetInterfaceTypeByName): returns an interface by type name, and
29511 encapsulates error handling here.
29512 (GetInterfaces): simplified.
29513 (ResolveTree): Encapsulated all the tree resolution here.
29514 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
29517 * driver.cs: Add support for --nostdlib, to avoid loading the
29518 default assemblies.
29519 (Main): Do not put tree resolution here.
29521 * rootcontext.cs: Beginning of the class resolution.
29523 2001-08-03 Miguel de Icaza <miguel@ximian.com>
29525 * rootcontext.cs: Provide better error reporting.
29527 * cs-parser.jay (interface_base): set our $$ to be interfaces.
29529 * rootcontext.cs (CreateInterface): Handle the case where there
29530 are no parent interfaces.
29532 (CloseTypes): Routine to flush types at the end.
29533 (CreateInterface): Track types.
29534 (GetInterfaces): Returns an array of Types from the list of
29535 defined interfaces.
29537 * typemanager.c (AddUserType): Mechanism to track user types (puts
29538 the type on the global type hash, and allows us to close it at the
29541 2001-08-02 Miguel de Icaza <miguel@ximian.com>
29543 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
29544 RecordInterface instead.
29546 * cs-parser.jay: Updated to reflect changes above.
29548 * decl.cs (Definition): Keep track of the TypeBuilder type that
29549 represents this type here. Not sure we will use it in the long
29550 run, but wont hurt for now.
29552 * driver.cs: Smaller changes to accomodate the new code.
29554 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
29557 * rootcontext.cs (CreateInterface): New method, used to create
29558 the System.TypeBuilder type for interfaces.
29559 (ResolveInterfaces): new entry point to resolve the interface
29561 (CodeGen): Property, used to keep track of the code generator.
29563 2001-07-26 Miguel de Icaza <miguel@ximian.com>
29565 * cs-parser.jay: Add a second production for delegate_declaration
29568 (enum_body): Put an opt_comma here instead of putting it on
29569 enum_body or enum_member_declarations so we can handle trailing
29570 commas on enumeration members. Gets rid of a shift/reduce.
29572 (type_list): Need a COMMA in the middle.
29574 (indexer_declaration): Tell tokenizer to recognize get/set
29576 * Remove old targets.
29578 * Re-add the parser target.
29580 2001-07-13 Simon Cozens <simon@simon-cozens.org>
29582 * cs-parser.jay: Add precendence rules for a number of operators
29583 ot reduce the number of shift/reduce conflicts in the grammar.
29585 2001-07-17 Miguel de Icaza <miguel@ximian.com>
29587 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
29590 Get rid of old crufty code.
29592 * rootcontext.cs: Use this to keep track of the parsed
29593 representation and the defined types available to the program.
29595 * gen-treedump.cs: adjust for new convention.
29597 * type.cs: Split out the type manager, and the assembly builder
29600 * typemanager.cs: the type manager will live here now.
29602 * cil-codegen.cs: And the code generator here.
29604 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
29606 * makefile: Fixed up for easy making.
29608 2001-07-13 Simon Cozens <simon@simon-cozens.org>
29610 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
29613 (unary_expression): Expand pre_increment_expression and
29614 post_decrement_expression to reduce a shift/reduce.
29616 2001-07-11 Simon Cozens
29618 * cs-tokenizer.cs: Hex numbers should begin with a 0.
29620 Improve allow_keyword_as_indent name.
29622 2001-06-19 Miguel de Icaza <miguel@ximian.com>
29624 * Adjustments for Beta2.
29626 2001-06-13 Miguel de Icaza <miguel@ximian.com>
29628 * decl.cs: Added `Define' abstract method.
29629 (InTransit): new property, used to catch recursive definitions.
29631 * interface.cs: Implement `Define'.
29633 * modifiers.cs: Map Modifiers.constants to
29634 System.Reflection.TypeAttribute flags.
29636 * class.cs: Keep track of types and user-defined types.
29637 (BuilderInit): New method for creating an assembly
29638 (ResolveType): New function to launch the resolution process, only
29639 used by interfaces for now.
29641 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
29642 that are inserted into the name space.
29644 2001-06-08 Miguel de Icaza <miguel@ximian.com>
29646 * ARGH. I have screwed up my tree so many times due to the use of
29647 rsync rather than using CVS. Going to fix this at once.
29649 * driver.cs: Objetify driver. Load assemblies, use assemblies to
29652 2001-06-07 Miguel de Icaza <miguel@ximian.com>
29654 * Experiment successful: Use System.Type rather that our own
29657 2001-05-25 Miguel de Icaza <miguel@ximian.com>
29659 * cs-parser.jay: Removed nsAliases from here.
29661 Use new namespaces, handle `using XXX;'
29663 * namespace.cs: Reimplemented namespace handling, use a recursive
29664 definition of the class. Now we can keep track of using clauses
29665 and catch invalid using clauses.
29667 2001-05-24 Miguel de Icaza <miguel@ximian.com>
29669 * gen-treedump.cs: Adapted for all the renaming.
29671 * expression.cs (Expression): this class now has a Type property
29672 which returns an expression Type.
29674 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
29675 `Type', as this has a different meaning now in the base
29677 2001-05-22 Miguel de Icaza <miguel@ximian.com>
29679 * interface.cs, class.cs: Removed from all the sources the
29680 references to signature computation, as we can not do method
29681 signature computation during the parsing time, as we are not
29682 trying to solve at that point distinguishing:
29686 void a (NS.Blah x) {}
29689 Which depending on the context might be valid or not, as we do not
29690 know if Blah is the same thing as NS.Blah at that point.
29692 * Redid everything so the code uses TypeRefs now instead of
29693 Types. TypeRefs are just temporary type placeholders, that need
29694 to be resolved. They initially have a pointer to a string and the
29695 current scope in which they are used. This is used later by the
29696 compiler to resolve the reference to an actual Type.
29698 * DeclSpace is no longer a CIR.Type, and neither are
29699 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
29700 are all DeclSpaces, but no Types.
29702 * type.cs (TypeRefManager): This implements the TypeRef manager,
29703 which keeps track of all the types that need to be resolved after
29704 the parsing has finished.
29706 2001-05-13 Miguel de Icaza <miguel@ximian.com>
29708 * ARGH. We are going to have to store `foreach' as a class rather
29709 than resolving it, as we need to verify error 1579 after name
29710 resolution. *OR* we could keep a flag that says `This request to
29711 IEnumerator comes from a foreach statement' which we can then use
29712 to generate the error.
29714 2001-05-10 Miguel de Icaza <miguel@ximian.com>
29716 * class.cs (TypeContainer.AddMethod): we now add methods to the
29717 MethodGroup instead of the method hashtable.
29719 * expression.cs: Add MethodGroup abstraction, which gets us one
29720 step closer to the specification in the way we handle method
29723 * cs-parser.jay (primary_expression): qualified_identifier now
29724 tried to match up an identifier to a local variable reference or
29725 to a parameter reference.
29727 current_local_parameters is now a parser global variable that
29728 points to the current parameters for the block, used during name
29731 (property_declaration): Now creates an implicit `value' argument to
29734 2001-05-09 Miguel de Icaza <miguel@ximian.com>
29736 * parameter.cs: Do not use `param' arguments as part of the
29737 signature, per the spec.
29739 2001-05-08 Miguel de Icaza <miguel@ximian.com>
29741 * decl.cs: Base class for classes, structs and interfaces. This
29742 is the "Declaration Space"
29744 * cs-parser.jay: Use CheckDef for checking declaration errors
29745 instead of having one on each function.
29747 * class.cs: Factor out some code for handling error handling in
29748 accordance to the "Declarations" section in the "Basic Concepts"
29749 chapter in the ECMA C# spec.
29751 * interface.cs: Make all interface member classes derive from
29752 InterfaceMemberBase.
29754 2001-05-07 Miguel de Icaza <miguel@ximian.com>
29756 * Many things: all interfaces are parsed and generated in
29757 gen-treedump. Support for member variables, constructors,
29758 destructors, properties, constants is there.
29760 Beginning of the IL backend, but very little done, just there for
29763 2001-04-29 Miguel de Icaza <miguel@ximian.com>
29765 * cs-parser.jay: Fix labeled statement.
29767 * cs-tokenizer.cs (escape): Escape " and ' always.
29768 ref_line, ref_name: keep track of the line/filename as instructed
29769 by #line by the compiler.
29772 2001-04-27 Miguel de Icaza <miguel@ximian.com>
29774 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
29775 to match the values in System.CodeDOM.
29777 Divid renamed to Divide.
29779 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
29781 (Statements.set): remove.
29783 * System.CodeDOM/CodeCatchClause.cs: always have a valid
29786 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
29787 falseStatements always have valid values.
29789 * cs-parser.jay: Use System.CodeDOM now.