[Mono-dev] csharp REPL bombs after asking for GetType on a dynamic instance

John Feminella johnf at bitsbuilder.com
Sun Feb 20 18:22:49 EST 2011


hello,

I compiled Mono 2.10 from source. When I run the csharp REPL that was
built, certain commands blow up on dynamic types:

==== begin snippet ====
[/tmp]> csharp
Mono C# Shell, type "help;" for help

Enter statements below.
csharp> dynamic d = 100;

csharp> Console.WriteLine("hello, world!");
hello, world!

# this is fine...
csharp> Console.WriteLine("d's type is: {0}", d.GetType());
d's type is: System.Int32

# but no dice here:
csharp> d.GetType();
Internal compiler error at Internal(1,1):: exception caught while
emitting MethodBuilder [Class3::Host]
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Internal
compiler error: Internal compiler error: Internal compiler error: The
`.' operator cannot be applied to operand of type `dynamic'
  at Microsoft.CSharp.RuntimeBinder.ErrorPrinter.Print
(Mono.CSharp.AbstractMessage msg) [0x00000] in <filename unknown>:0
  at Mono.CSharp.Report.Error (Int32 code, Location loc, System.String
error) [0x00000] in <filename unknown>:0
  at Mono.CSharp.Report.Error (Int32 code, Location loc, System.String
format, System.String arg) [0x00000] in <filename unknown>:0
  at Mono.CSharp.ParametersBlock.Resolve (Mono.CSharp.FlowBranching
parent, Mono.CSharp.BlockContext rc, IMethodData md) [0x00000] in
<filename unknown>:0
  at Mono.CSharp.MethodData.Emit (Mono.CSharp.DeclSpace parent)
[0x00000] in <filename unknown>:0
  at Mono.CSharp.MethodOrOperator.Emit () [0x00000] in <filename unknown>:0
  at Mono.CSharp.Method.Emit () [0x00000] in <filename unknown>:0
==== end snippet ====

Any hints on what might be afoot here, or is this a known bug?

~ jf
--
John Feminella
Principal Consultant, BitsBuilder
LI: http://www.linkedin.com/in/johnxf
SO: http://stackoverflow.com/users/75170/


More information about the Mono-devel-list mailing list