Code to do semantic analysis and emit the attributes
is here.
- rootcontext.cs:
+ module.cs:
Keeps track of the types defined in the source code,
as well as the assemblies loaded.
The token 0 is reserved for ``anonymous'' locations, ie. if we
don't know the location (Location.Null).
- The tokenizer also tracks the column number for a token, but
- this is currently not being used or encoded. It could
- probably be encoded in the low 9 bits, allowing for columns
- from 1 to 512 to be encoded.
-
* The Parser
The parser is written using Jay, which is a port of Berkeley
a [i++]++
a [i++] += 5;
+
+** Optimalizations
+
+ Compiler does some limited high-level optimalizations when
+ -optimize option is used
+
+*** Instance field initializer to default value
+
+ Code to optimize:
+
+ class C
+ {
+ enum E
+ {
+ Test
+ }
+
+ int i = 0; // Field will not be redundantly assigned
+ int i2 = new int (); // This will be also completely optimized out
+
+ E e = E.Test; // Even this will go out.
+ }
** Statements
* Elements that contain code are now invoked to
perform semantic analysis and code generation.
+
+* References loading
+
+ Most programs use external references (assemblies and modules).
+ Compiler loads all referenced top-level types from referenced
+ assemblies into import cached. It imports initialy only C#
+ valid top-level types all other members are imported on demand
+ when needed.
+
+* Namespaces definition
+
+ Before any type resolution can be done we define all compiled
+ namespaces. This is mainly done to prepare using clauses of each
+ namespace block before any type resolution takes a place.
+
+* Types definition
+
+ The first step of type definition is to resolve base class or
+ base interfaces to correctly setup type hierarchy before any
+ member is defined.
+
+ At this point we do some error checking and verify that the
+ members inheritance is correct and some other members
+ oriented checks.
+
+ By the time we are done, all classes, structs and interfaces
+ have been defined and all their members have been defined as
+ well.
+
+* MemberCache
+
+ MemberCache is one of core compiler components. It maintains information
+ about types and their members. It tries to be as fast as possible
+ because almost all resolve operations end up querying members info in
+ some way.
+
+ MemberCache is not definition but specification oriented to maintain
+ differences between inflated versions of generic types. This makes usage
+ of MemberCache simple because consumer does not need to care how to inflate
+ current member and returned type information will always give correctly
+ inflated type. However setting MemberCache up is one of the most complicated
+ parts of the compiler due to possible dependencies when types are defined
+ and complexity of nested types.
* Output Generation
into an empty operation. Otherwise the above will become
a return statement that can infer return types.
+* Debugger support
+
+ Compiler produces .mdb symbol file for better debugging experience. The
+ process is quite straightforward. For every statement or a block there
+ is an entry in symbol file. Each entry includes of start location of
+ the statement and it's starting IL offset in the method. For most statements
+ this is easy but few need special handling (e.g. do, while).
+
+ When sequence point is needed to represent original location and no IL
+ entry is written for the line we emit `nop' instruction. This is done only
+ for very few constructs (e.g. block opening brace).
+
+ Captured variables are not treated differently at the moment. Debugger has
+ internal knowledge of their mangled names and how to decode them.
+
+* IKVM.Reflection vs System.Reflection
+
+ Mono compiler can be compiled using different reflection backends. At the
+ moment we support System.Reflection and IKVM.Reflection they both use same
+ API as official System.Reflection.Emit API which allows us to maintain only
+ single version of compiler with few using aliases to specialise.
+
+ The backends are not plug-able but require compiler to be compiled with
+ specific STATIC define when targeting IKVM.Reflection.
+
+ IKVM.Reflection is used for static compilation. This means the compiler runs
+ in batch mode like most compilers do. It can target any runtime version and
+ use any mscorlib. The mcs.exe is using IKVM.Reflection.
+
+ System.Reflection is used for dynamic compilation. This mode is used by
+ our REPL and Evaluator API. Produced IL code is not written to disc but
+ executed by runtime (JIT). Mono.CSharp.dll is using System.Reflection and
+ System.Reflection.Emit.
+
* Evaluation API
The compiler can now be used as a library, the API exposed
+++ /dev/null
-This document describes all code optimalizations performed by Mono C# compiler
-when optimalizations are enabled via /optimize+ option.
-
-Optimalizations:
-
-* Instance field initializer to default value
----------------------------------------------
-
-Code to optimize:
-
-class C
-{
- enum E
- {
- Test
- }
-
- int i = 0; // Field will not be redundantly assigned
- int i2 = new int (); // This will be also completely optimized out
-
- E e = E.Test; // Even this will go out.
-
-}
-
-
-
+++ /dev/null
----- This is a list of old tasks, just here for historical value ----
-
-Open question:
- Create a toplevel block for anonymous methods?
-
-Anonymous Methods
------------------
-
- Plan:
-
- * Resolve anonymous methods before.
- * Each time a Local matches, if the mode is `InAnonymous', flag
- the VariableInfo for `proxying'.
- * During Resolve track the depth required for local variables.
- * Before Emit, create proxy classes with proper depth.
- * Emit.
-
-Notes on memory allocation
---------------------------
-
- Outdated:
-
- A run of the AllocationProfile shows that the compiler allocates roughly
- 30 megabytes of strings. From those, 20 megabytes come from
- LookupType.
-
- See the notes on current_container problems below on memory usage.
-
-LookupTypeReflection:
----------------------
-
- With something like `System.Object', LookupTypeReflection will be called
- twice: once to find out that `System' is not a type and once
- for System.Object.
-
- This is required because System.Reflection requires that the type/nested types are
- not separated by a dot but by a plus sign.
-
- A nested class would be My+Class (My being the toplevel, Class the nested one).
-
- It is interesting to look at the most called lookups when bootstrapping MCS:
-
- 647 LTR: ArrayList
- 713 LTR: System.Globalization
- 822 LTR: System.Object+Expression
- 904 LTR: Mono.CSharp.ArrayList
- 976 LTR: System.Runtime.CompilerServices
- 999 LTR: Type
- 1118 LTR: System.Runtime
- 1208 LTR: Mono.CSharp.Type
- 1373 LTR: Mono.Languages
- 1599 LTR: System.Diagnostics
- 2036 LTR: System.Text
- 2302 LTR: System.Reflection.Emit
- 2515 LTR: System.Collections
- 4527 LTR: System.Reflection
- 22273 LTR: Mono.CSharp
- 24245 LTR: System
- 27005 LTR: Mono
-
- Analysis:
- The top 9 lookups are done for things which are not types.
-
- Mono.CSharp.Type happens to be a common lookup: the class Type
- used heavily in the compiler in the default namespace.
-
- RED FLAG:
-
- Then `Type' is looked up alone a lot of the time, this happens
- in parameter declarations and am not entirely sure that this is
- correct (FindType will pass to LookupInterfaceOrClass a the current_type.FullName,
- which for some reason is null!). This seems to be a problem with a lost
- piece of context during FindType.
-
- System.Object is also used a lot as a toplevel class, and we assume it will
- have children, we should just shortcut this.
-
- A cache:
-
- Adding a cache and adding a catch for `System.Object' to flag that it wont be the
- root of a hierarchy reduced the MCS bootstrap time from 10.22 seconds to 8.90 seconds.
-
- This cache is currently enabled with SIMPLE_SPEEDUP in typemanager.cs. Memory consumption
- went down from 74 megs to 65 megs with this change.
-
-Major tasks:
-------------
-
- Pinned and volatile require type modifiers that can not be encoded
- with Reflection.Emit.
-
-* Revisit
-
- Primary-expression, as it has now been split into
- non-array-creation-expression and array-creation-expression.
-
-* Emit `pinned' for pinned local variables.
-
- Both `modreq' and pinned will require special hacks in the compiler.
-
-* Make sure that we are pinning the right variable
-
-* local_variable_declaration
-
- Not sure that this grammar is correct, we might have to
- resolve this during semantic analysis.
-
-* Optimizations
-
- In Indexers and Properties, probably support an EmitWithDup
- That emits the code to call Get and then leaves a this pointer
- in the stack, so that later a Store can be emitted using that
- this pointer (consider Property++ or Indexer++)
-
-* Use of local temporary in UnaryMutator
-
- We should get rid of the Localtemporary there for some cases
-
- This turns out to be very complex, at least for the post-version,
- because this case:
-
- a = i++
-
- To produce optimal code, it is necessary for UnaryMutator to know
- that it is being assigned to a variable (the way the stack is laid
- out using dup requires the store to happen inside UnaryMutator).
-
-* Interface indexers
-
- I have not figured out why the Microsoft version puts an
- `instance' attribute, and I am not generating this `instance' attribute.
-
- Explanation: The reason for the `instance' attribute on
- indexers is that indexers only apply to instances
-
-* Check for Final when overriding, if the parent is Final, then we cant
- allow an override.
-
- Implement base indexer access.
-
-current_container/current_namespace and the DeclSpace
------------------------------------------------------
-
- We are storing fully qualified names in the DeclSpace instead of the node,
- this is because `current_namespace' (Namepsace) is not a DeclSpace like
- `current_container'.
-
- The reason for storing the full names today is this:
-
- namespace X {
- class Y {
- }
- }
-
- namespace A {
- class Y {
- }
- }
-
- The problem is that we only use the namespace stack to track the "prefix"
- for typecontainers, but they are not typecontainers themselves, so we have
- to use fully qualified names, because both A.X and A.Y would be entered
- in the toplevel type container. If we use the short names, there would be
- a name clash.
-
- To fix this problem, we have to make namespaces DeclSpaces.
-
- The full size, contrasted with the size that could be stored is:
- corlib:
- Size of strings held: 368901
- Size of strings short: 147863
-
- System:
- Size of strings held: 212677
- Size of strings short: 97521
-
- System.XML:
- Size of strings held: 128055
- Size of strings short: 35782
-
- System.Data:
- Size of strings held: 117896
- Size of strings short: 36153
-
- System.Web:
- Size of strings held: 194527
- Size of strings short: 58064
-
- System.Windows.Forms:
- Size of strings held: 220495
- Size of strings short: 64923
-
-
-The use of DottedName
----------------------
-
- We could probably use a different system to represent names, like this:
-
- class Name {
- string simplename;
- Name parent;
- }
-
- So `System.ComponentModel' becomes:
-
- x: (System, null)
- y: (ComponentModel, x)
-
- The problem is that we would still need to construct the name to pass to
- GetType.
-
- This has been now implemented, its called "QualifiedIdentifier"
-
-TODO:
-
- 1. Create a "partial" emit context for each TypeContainer..
-
- 2. EmitContext should be partially constructed. No IL Generator.
-
- interface_type review.
-
- parameter_array, line 952: `note: must be a single dimension array type'. Validate this
-
-Instance idea
--------------
-
- It would be nice to have things that can be "instances" to have an
- EmitInstance method (this would default to nothing).
-
- The idea is to be able to use efficiently the instance data on stack
- manipulations, as opposed to the current scheme, where we basically have
- a few special cases.
-
- * `yield' is no longer a keyword, it only has special
- meaning before a return or break keywords.
-
- * Study side effects with assign
- * Study TemporaryStorage/LocalStorage -> Merge/rename
-
-Completion support
-==================
-
- Supported:
-
- a.<TAB> to complete members of type `a'
- a<TAB> for types and namespaces
- a.W<TAB>
- a<TAB> for local variables
-
- Unsupported:
-
- delegate { FOO.<TAB>
- using statement autocompletion
-
+
These are the sources to the Mono C# compiler
---------------------------------------------
+++ /dev/null
-===========================================
-
-* Value Parameter
-
- I believe that `Value Parameter' might have been introduced
- after C# 1.0, also notice than in the treatment of Value Parameter
- the parameters are defined in four categories:
-
- Section 9.3 in the latest spec.
-
-
-Large project:
---------------
-
-New
----
-
- It would be nice to optimize the case of:
-
- Method (new ValueType ())
-
- So that no temporary is created, and we only use a newobj call
- that remains on the stack, as opposed to ldloca, initobj, ldloc
- call.
-
-NEW NOTES:
-----------
-
- ImplicitStandardConversionExists and ImplicitStandardConversion
- should always be the same, but there are a few diverging lines that
- must be studied:
-
- if (expr_type == target_type && !(expr is NullLiteral))
- return expr;
-
- vs:
-
- if (expr_type == target_type)
- return true;
-
-****************************************************************************************
-*
-* The information on the rest of this file is mostly outdated, and its kept here for
-* historical reasons
-*
-****************************************************************************************
-
-Error Reporting:
-----------------
-
- * Make yyerror show a nice syntax error, instead of the current mess.
-
-Optimization ideas
-------------------
-
- Currently when we build a type cache, it contains private members,
- internal members, and internal protected members; We should trim
- these out, as it shows up on the profile.
-
- We create too many Arraylists; When we know the size, we should create
- an array;
-
- During parsing we use arraylists to accumulate data, like this:
-
- thing:
-
- thing_list
- : thing { $$ =new ArrayList (); $$.Add ($1); }
- | thing_list thing { ArrayList a = $1; a.Add ($2); $$ = a; }
-
- We probably could start using "Pairs" there:
-
- thing_list
- : thing { $$ = new Pair ($1, null); }
- | thing_list thing { Pair p = $1; $$ = new Pair ($2, $1); }
-
-
-EmitContext.ResolveTypeTree
----------------------------
-
- We should investigate its usage. The problem is that by default
- this will be set when calling FindType, that triggers a more expensive
- lookup.
-
- I believe we should pass the current EmitContext (which has this turned off
- by default) to ResolveType/REsolveTypeExpr and then have the routines that
- need ResolveType to pass null as the emit context.
-
-DeclareLocal audit
-------------------
-
- DeclareLocal is used in various statements. The audit should be done
- in two steps:
-
- * Identify all the declare locals.
-
- * Identify its uses.
-
- * Find if we can make wrapper functions for all of them.
-
- Then we can move DeclareLocal into a helper class.
-
- This is required to fix foreach in iterators.
-
-Ideas:
-------
-
- Instead of the hack that *knows* about System.Object not having any children classes,
- we should just make it simple for a probe to know that there is no need for it.
-
-Dead Code Elimination bugs:
----------------------------
-
- I should also resolve all the children expressions in Switch, Fixed, Using.
-
-Major tasks:
-------------
- Properties and 17.6.3: Finish it.
-
-readonly variables and ref/out
-
-BUGS
-----
-
-* Break/Continue statements
-
- A finally block should reset the InLoop/LoopBegin/LoopEnd, as
- they are logically outside the scope of the loop.
-
-* Break/continue part 2.
-
- They should transfer control to the finally block if inside a try/catch
- block.
-
-*
-> // CSC sets beforefieldinit
-> class X {
-> // .cctor will be generated by compiler
-> public static readonly object O = new System.Object ();
-> public static void Main () {}
-> }
->
-
-PENDING TASKS
--------------
-
-* Merge test 89 and test-34
-
-* Code cleanup
-
- The information when registering a method in InternalParameters
- is duplicated, you can always get the types from the InternalParameters
-
-* Emit modreq for volatiles
-
- Handle modreq from public apis.
-
-* Merge tree.cs, rootcontext.cs
-
-OPTIMIZATIONS
--------------
-
-* User Defined Conversions is doing way too many calls to do union sets that are not needed
-
-* Add test case for destructors
-
-* Places that use `Ldelema' are basically places where I will be
- initializing a value type. I could apply an optimization to
- disable the implicit local temporary from being created (by using
- the method in New).
-
-* Dropping TypeContainer as an argument to EmitContext
-
- My theory is that I can get rid of the TypeBuilder completely from
- the EmitContext, and have typecasts where it is used (from
- DeclSpace to where it matters).
-
- The only pending problem is that the code that implements Aliases
- is on TypeContainer, and probably should go in DeclSpace.
-
-* Tests
-
- Write tests for the various reference conversions. We have
- test for all the numeric conversions.
-
-* Optimizations: variable allocation.
-
- When local variables of a type are required, we should request
- the variable and later release it when we are done, so that
- the same local variable slot can be reused later on.
-
-* Add a cache for the various GetArrayMethod operations.
-
-* MakeUnionSet Callers
-
- If the types are the same, there is no need to compute the unionset,
- we can just use the list from one of the types.
-
-* Factor the lookup code for class declarations an interfaces
- (interface.cs:GetInterfaceByName)
-
-RECOMMENDATIONS
----------------
-
-* Use of lexer.Location in the parser
-
- Currently we do:
-
- TOKEN nt TERMINAL nt TERMINAL nt3 {
- $$ = new Blah ($2, $4, $6, lexer.Location);
- }
-
- This is bad, because the lexer.Location is for the last item in `nt3'
-
- We need to change that to use this pattern:
-
- TOKEN { oob_stack.Push (lexer.Location) } nt TERMINAL nt TERMINAL nt3 {
- $$ = new Blah ($3, $5, $7, (Location) oob_stack.Pop ());
- }
-
- Notice how numbering of the arguments changes as the
- { oob_stack.Push (lexer.Location) } takes a "slot" in the productions.
-
+++ /dev/null
-Compiler operations
-
-The compiler has a number of phases:
-
-* Parsing
-
- Initially the compiler parses all the source files and keeps a
- parsed representation in memory. Also syntax error checking
- is performed at this point.
-
- The compiler stores the information in classes whose names
- represent the language construct, for example, the "if"
- construct is stored in an `If' class. A class is stored in a
- `Class'.
-
-* Type creation
-
- Once the parsing has happened, compiled types are created. What
- is actually created is only a type skeleton including name,
- correct nesting, type parameters definitions. Types are created
- before any referenced types are loaded to ensure that locally
- defined type is used when an external assembly references a type
- with same name as compiled type.
-
-* References loading
-
- As a next step referenced assemblies and modules are loaded and
- their top-level types are imported and cached. We import only
- C# valid top level types at this point all other members are
- imported on demand when needed.
-
-* Namespaces definition
-
- Before any type resolution can be done we define all compiled
- namespaces. This is mainly done to prepare using clauses of each
- namespace block before any type resolution takes a place.
-
-* Types definition
-
- The first step of type definition is to resolve base class or
- base interfaces to correctly setup type hierarchy before any
- member is defined.
-
- At this point we do some error checking and verify that the
- members inheritance is correct and some other members
- oriented checks.
-
- By the time we are done, all classes, structs and interfaces
- have been defined and all their members have been defined as
- well.
-
-* Emit aka Code Generation
-
- At this stage the CIL code is generated together with other
- metadata including attributes, constants, type parameter constraints.
- Before any method body code is generated its body is first
- resolved and check for errors including flow analysis.
-
-* Statements
-
- Most of the statements are handled in the statement.cs file.
-
-* Expressions
-
-* MemberCache
-
- MemberCache is one of core compiler components. It maintains information
- about types and their members. It tries to be as fast as possible
- because almost all resolve operations end up querying members info in
- some way.
-
- MemberCache is not definition but specification oriented to maintain
- differences between inflated versions of generic types. This makes usage
- of MemberCache simple because consumer does not need to care how to inflate
- current member and returned type information will always give correctly
- inflated type. However setting MemberCache up is one of the most complicated
- parts of the compiler due to possible dependencies when types are defined
- and complexity of nested types.
-
-* Debugger support
-
- Compiler produces .mdb symbol file for better debugging experience. The
- process is quite straightforward. For every statement or a block there
- is an entry in symbol file. Each entry includes of start location of
- the statement and it's starting IL offset in the method. For most statements
- this is easy but few need special handling (e.g. do, while).
-
- When sequence point is needed to represent original location and no IL
- entry is written for the line we emit `nop' instruction. This is done only
- for very few constructs (e.g. block opening brace).
-
- Captured variables are not treated differently at the moment. Debugger has
- internal knowledge of their mangled names and how to decode them.
-
-* IKVM.Reflection vs System.Reflection
-
- Mono compiler can be compiled using different reflection backends. At the
- moment we support System.Reflection and IKVM.Reflection they both use same
- API as official System.Reflection.Emit API which allows us to maintain only
- single version of compiler with few using aliases to specialise.
-
- The backends are not plug-able but require compiler to be compiled with
- specific STATIC define when targeting IKVM.Reflection.
-
- IKVM.Reflection is used for static compilation. This means the compiler runs
- in batch mode like most compilers do. It can target any runtime version and
- use any mscorlib. The mcs.exe is using IKVM.Reflection.
-
- System.Reflection is used for dynamic compilation. This mode is used by
- our REPL and Evaluator API. Produced IL code is not written to disc but
- executed by runtime (JIT). Mono.CSharp.dll is using System.Reflection and
- System.Reflection.Emit.
-
-* Error reporting
-
- Always use `Report::Error' or `Report::Warning' methods of Report
- class. The actual Report instance is available via local context.
- An expression error reporting has to be done during Resolve phase,
- except when it's Emit specific (very rare).
-
- Error reporting should try to use the same codes that the
- Microsoft compiler uses (if only so we can track which errors
- we handle and which ones we don't).
-
- If there is an error which is specific to MSC, use negative
- numbers, and register the number in mcs/errors/errors.txt
-
- Try to write a test case for any error that you run into the
- code of the compiler if there is none already.
-
- Put your test case in a file called csNNNN.cs in the
- mcs/errors directory, and have the first two lines be:
-
- // csNNNN.cs: This is the error message
- // Line: XXX
- // Compiler options: an optional compiler options
-
- Where `XXX' is the line where the error occurs. We will later
- use this as a regression test suite for catching errors in the
- compiler.
It currently has a few problems:
- * Support for overwritting existing defined
- classes is not supported.
-
* The usability is not as useful, since the defaults
for C# are still to make members private, we should
change this default to be public in those cases.
- * The error lookup system lacks information from types, for
- example this causes an unsupported call into a TypeBuilder:
-
- csharp>class D { void DD () {} }
- csharp>var d = new D ();
- csharp>d.DD ();
-
- Internal compiler error at Internal(1,1):: exception caught while emitting MethodBuilder [Class0::Host]
- System.NotSupportedException: The invoked member is not supported in a dynamic module.
- at System.Reflection.Emit.AssemblyBuilder.get_Location () [0x00000] in <filename unknown>:0
- at Mono.CSharp.Report.SymbolRelatedToPreviousError (System.Reflection.MemberInfo mi) [0x00000] in
- at Mono.CSharp.MethodGroupExpr.NoExactMatch (Mono.CSharp.ResolveContext ec,
- Mono.CSharp.Arguments& Arguments, IDictionary`2 c
-
-
- The above is caused by TypeManager.LookupDeclSpace (dt)
- failing to return a value (it returns null) so our code
- assumes we have an Assembly instead of an assemblybuilder.
-
-
-
-* Declaring a class twice produces an internal parse error:
-
- class X {}
- class X {}
-
- The second declaration will no longer be parsed, so it could even
- contain junk, and wont be flagged. We probably need to allow for
- type redefinition in REPL modes, the exception from the second is:
-
- csharp -v -v
- > class X {}
- > class X {}
-
- System.ArgumentException: An element with the same key already exists in the dictionary.
- at System.Collections.Generic.Dictionary`2[System.String,Mono.CSharp.DeclSpace].Add (System.String key, Mono.CSharp.DeclSpace value) [0x00000] in <filename unknown>:0
- at Mono.CSharp.Namespace.AddDeclSpace (System.String name, Mono.CSharp.DeclSpace ds) [0x00000] in <filename unknown>:0
- at Mono.CSharp.ModuleCompiled.AddMemberType (Mono.CSharp.DeclSpace ds) [0x00000] in <filename unknown>:0
- at Mono.CSharp.TypeContainer.AddTypeContainer (Mono.CSharp.TypeContainer tc) [0x00000] in <filename unknown>:0
- at Mono.CSharp.CSharpParser.push_current_class (Mono.CSharp.TypeContainer tc, System.Object partial_token) [0x00000] in <filename unknown>:0
- at Mono.CSharp.CSharpParser.yyparse (yyInput yyLex) [0x00000] in <filename unknown>:0
- at Mono.CSharp.CSharpParser.yyparse (yyInput yyLex, System.Object yyd) [0x00000] in <filename unknown>:0
- at Mono.CSharp.CSharpParser.parse () [0x00000] in <filename unknown>:0
-
-* Mix statements with other top-level declarations.
-
-csharp> class Y {static void Main () {Console.WriteLine ("Foo"); }}
-csharp> typeof (Y);
-Y
-csharp> Y.Main ();
-Exception caught by the compiler while compiling:
- Block that caused the problem begin at: Internal(1,1):
- Block being compiled: [<interactive>(1,2):,<interactive>(1,11):]
-System.NotSupportedException: The invoked member is not supported in a dynamic module.
-Internal compiler error at Internal(1,1):: exception caught while emitting MethodBuilder [Class2::Host]
-System.NotSupportedException: The invoked member is not supported in a dynamic module.
- at System.Reflection.Emit.AssemblyBuilder.get_Location () [0x00000] in /second/home/cvs/mcs/class/corlib/System.Reflection.Emit/AssemblyBuilder.cs:214
- at Mono.CSharp.Report.SymbolRelatedToPreviousError (System.Reflection.MemberInfo mi) [0x00036] in /second/home/cvs/mcs/mcs/report.cs:664
- at Mono.CSharp.Expression.Error_MemberLookupFailed (System.Type container_type, System.Type qualifier_type, System.Type queried_type, System.String name, System.String class_name, MemberTypes mt, BindingFlags bf) [0x00121] in /second/home/cvs/mcs/mcs/ecore.cs:857
- at Mono.CSharp.MemberAccess.DoResolve (Mono.CSharp.EmitContext ec, Mono.CSharp.Expression right_side) [0x00230] in /second/home/cvs/mcs/mcs/expression.cs:7426
- at Mono.CSharp.MemberAccess.DoResolve (Mono.CSharp.EmitContext ec) [0x00000] in /second/home/cvs/mcs/mcs/expression.cs:7494
- at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec, ResolveFlags flags) [0x00075] in /second/home/cvs/mcs/mcs/ecore.cs:479
- at Mono.CSharp.Invocation.DoResolve (Mono.CSharp.EmitContext ec) [0x0000d] in /second/home/cvs/mcs/mcs/expression.cs:4725
- at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec, ResolveFlags flags) [0x00075] in /second/home/cvs/mcs/mcs/ecore.cs:479
- at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec) [0x00000] in /second/home/cvs/mcs/mcs/ecore.cs:506
- at Mono.CSharp.OptionalAssign.DoResolve (Mono.CSharp.EmitContext ec) [0x00013] in /second/home/cvs/mcs/mcs/repl.cs:681
- at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec, ResolveFlags flags) [0x00075] in /second/home/cvs/mcs/mcs/ecore.cs:479
- at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec) [0x00000] in /second/home/cvs/mcs/mcs/ecore.cs:506
- at Mono.CSharp.ExpressionStatement.ResolveStatement (Mono.CSharp.EmitContext ec) [0x00000] in /second/home/cvs/mcs/mcs/ecore.cs:1307
- at Mono.CSharp.StatementExpression.Resolve (Mono.CSharp.EmitContext ec) [0x0000b] in /second/home/cvs/mcs/mcs/statement.cs:743
- at Mono.CSharp.Block.Resolve (Mono.CSharp.EmitContext ec) [0x000f0] in /second/home/cvs/mcs/mcs/statement.cs:2254
- at Mono.CSharp.ExplicitBlock.Resolve (Mono.CSharp.EmitContext ec) [0x00000] in /second/home/cvs/mcs/mcs/statement.cs:2550
- at Mono.CSharp.EmitContext.ResolveTopBlock (Mono.CSharp.EmitContext anonymous_method_host, Mono.CSharp.ToplevelBlock block, Mono.CSharp.Parameters ip, IMethodData md, System.Boolean& unreachable) [0x00087] in /second/home/cvs/mcs/mcs/codegen.cs:796
-csharp>
-
-* Another one:
-
-csharp> class X { X (){ Console.WriteLine ("Called"); } }
-csharp> new X ();
-Exception caught by the compiler while compiling:
- Block that caused the problem begin at: Internal(1,1):
- Block being compiled: [<interactive>(1,2):,<interactive>(1,10):]
-System.NotSupportedException: The invoked member is not supported in a dynamic module.
-Internal compiler error at Internal(1,1):: exception caught while emitting MethodBuilder [Class0::Host]
-System.NotSupportedException: The invoked member is not supported in a dynamic module.
- at System.Reflection.Emit.AssemblyBuilder.get_Location () [0x00000] in /second/home/cvs/mcs/class/corlib/System.Reflection.Emit/AssemblyBuilder.cs:214
- at Mono.CSharp.Report.SymbolRelatedToPreviousError (System.Reflection.MemberInfo mi) [0x00036] in /second/home/cvs/mcs/mcs/report.cs:664
- at Mono.CSharp.Expression.Error_MemberLookupFailed (System.Type container_type, System.Type qualifier_type, System.Type queried_type, System.String name, System.String class_name, MemberTypes mt, BindingFlags bf) [0x00121] in /second/home/cvs/mcs/mcs/ecore.cs:857
- at Mono.CSharp.Expression.MemberLookupFinal (Mono.CSharp.EmitContext ec, System.Type qualifier_type, System.Type queried_type, System.String name, MemberTypes mt, BindingFlags bf, Location loc) [0x0002f] in /second/home/cvs/mcs/mcs/ecore.cs:804
- at Mono.CSharp.New.DoResolve (Mono.CSharp.EmitContext ec) [0x002ad] in /second/home/cvs/mcs/mcs/expression.cs:5486
- at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec, ResolveFlags flags) [0x00075] in /second/home/cvs/mcs/mcs/ecore.cs:479
- at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec) [0x00000] in /second/home/cvs/mcs/mcs/ecore.cs:506
- at Mono.CSharp.OptionalAssign.DoResolve (Mono.CSharp.EmitContext ec) [0x00013] in /second/home/cvs/mcs/mcs/repl.cs:687
- at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec, ResolveFlags flags) [0x00075] in /second/home/cvs/mcs/mcs/ecore.cs:479
- at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec) [0x00000] in /second/home/cvs/mcs/mcs/ecore.cs:506
- at Mono.CSharp.ExpressionStatement.ResolveStatement (Mono.CSharp.EmitContext ec) [0x00000] in /second/home/cvs/mcs/mcs/ecore.cs:1307
- at Mono.CSharp.StatementExpression.Resolve (Mono.CSharp.EmitContext ec) [0x0000b] in /second/home/cvs/mcs/mcs/statement.cs:743
- at Mono.CSharp.Block.Resolve (Mono.CSharp.EmitContext ec) [0x000f0] in /second/home/cvs/mcs/mcs/statement.cs:2254
- at Mono.CSharp.ExplicitBlock.Resolve (Mono.CSharp.EmitContext ec) [0x00000] in /second/home/cvs/mcs/mcs/statement.cs:2550
- at Mono.CSharp.EmitContext.ResolveTopBlock (Mono.CSharp.EmitContext anonymous_method_host, Mono.CSharp.ToplevelBlock block, Mono.CSharp.Parameters ip, IMethodData md, System.Boolean& unreachable) [0x00087] in /second/home/cvs/mcs/mcs/codegen.cs:796
-csharp>
-
-* Important: we need to replace TypeBuidlers with Types after things
- have been emitted, or stuff like this happens:
-
-csharp> public class y {}
-csharp> typeof (y);
-Class1
-
-
* Clearing data
TODO: when clearing data for variables that have been overwritten
This is easy to implement, just retry the parse with a
semicolon, the question is whether this is a good idea to do
in the first place or not.
+
+Completion support
+==================
+
+ Supported:
+
+ a.<TAB> to complete members of type `a'
+ a<TAB> for types and namespaces
+ a.W<TAB>
+ a<TAB> for local variables
+
+ Unsupported:
+
+ delegate { FOO.<TAB>
+ using statement autocompletion