Quantcast
Channel: SharpDevelop Community
Viewing all articles
Browse latest Browse all 1764

Code generation bug in IronRuby on SD 4.4 using Windows Forms

$
0
0

1. Create an IronRuby Windows Forms app.

2. Place a NumericUpDown control on it.

3. Set the Minimum and Initial values for the nud to 1.

4. The app will crash.  The same thing happens on the end-of-life SD 3.2 as well. 

Now, since the Console won't pause to give me the error message, I tried to run ir.exe manually from a console (i.e., <path to RubyBackendBindings>\ir.exe Program.rb) and got the error message:

"unknown: no such file to load -- gem_prelude.rb (LoadError)"

I did manage to get an unhandled exception stack trace in an app I had started and the same thing happened with the final trace line being:

"System.InvalidOperationException: can't convert System::Int32[ into Float"

 

Here's the IronRuby Windows Form generated code:

        #
        # numericUpDown1
        #
        @numericUpDown1.Location = System::Drawing::Point.new(63, 53)
        @numericUpDown1.Minimum = System::Decimal.new(System::Array[System::Int32].new(
            [1,
            0,
            0,
            0]))
        @numericUpDown1.Name = "numericUpDown1"
        @numericUpDown1.Size = System::Drawing::Size.new(60, 20)
        @numericUpDown1.TabIndex = 0
        @numericUpDown1.Value = System::Decimal.new(System::Array[System::Int32].new(
            [1,
            0,
            0,
            0]))

 

Just to see, I did the same test on an IronPython Windows Forms app and it worked fine.  The generated IronPython code for the nud was:

        # 
        # numericUpDown1
        
        self._numericUpDown1.Location = System.Drawing.Point(8559)
        self._numericUpDown1.Minimum = System.Decimal(System.Array[System.Int32](
            [1,
            0,
            0,
            0]))
        self._numericUpDown1.Name = "numericUpDown1"
        self._numericUpDown1.Size = System.Drawing.Size(4820)
        self._numericUpDown1.TabIndex = 0
        self._numericUpDown1.Value = System.Decimal(System.Array[System.Int32](
            [1,
            0,
            0,
            0]))


Viewing all articles
Browse latest Browse all 1764

Trending Articles