Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6681081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:32:59+00:00 2026-05-26T04:32:59+00:00

Originally Title : Mono 2.7: Array Initializer Bug I’m having an issue with mono

  • 0

Originally Title : “Mono 2.7: Array Initializer Bug”

I’m having an issue with mono where array initialization (at least for multidimensional arrays) does not work when inlined in a method call. It looks like the mono compiler is emitting the assignments after the method call.

For instance:

MathLib.PrintMatrix(new double[,] { {1.0, 1.0}, {1.0, 1.0} });

// Prints the following
// 0.0, 0.0
// 0.0, 0.0

However, the following code works correctly:

var myArray = new double[,] = { {1.0, 1.0}, {1.0, 1.0} };

MathLib.PrintMatrix(myArray);

// Prints the following
// 1.0, 1.0
// 1.0, 1.0

I couldn’t find any release note addressing this issue, and I’m currently running an older version (which I don’t want to update unless it’s going to be benificial). Does anyone know if this bug has been fixed?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:32:59+00:00Added an answer on May 26, 2026 at 4:32 am

    I don’t have 2.7 (a beta for 2.8) around but I have something older (2.6.7 in Ubuntu)

    poupou@mizar:~/src$ gmcs --version
    Mono C# compiler version 2.6.7.0
    poupou@mizar:~/src$ cat x.cs
    using System;
    
    class Program {
    
        static void PrintMatrix (double[,] values)
        {
            Console.WriteLine ("{0}, {1}\n{2}, {3}", values [0,0], values [0,1], values [1,0], values [1,1]);
        }
    
        static void Main ()
        {
            PrintMatrix (new double[,] { {1.0, 2.0}, {3.0, 4.0} });
        }
    }
    
    poupou@mizar:~/src$ gmcs x.cs
    poupou@mizar:~/src$ mono x.exe
    1, 2
    3, 4
    

    and something a lot newer: 2.11 from git

    [mono] ~/src @ mcs --version
    Mono C# compiler version 2.11.0.0
    [mono] ~/src @ mcs x.cs
    [mono] ~/src @ mono x.exe
    1, 2
    3, 4
    

    So I believe your issue is related to using an old, unsupported beta release of Mono.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT: This question title originally was: How does Doctrine know last inserted id in
I think that (the title) is the problem I am having. I set up
I'm not sure if the question title is accurate... Let me start by explaining
I am having a problem with restful routes and singular resources, originally I had
I'm using ModRewrite to send requests for /2/Blog-Title to /?post=2&title=Blog-Title Originally I used ([A-Za-z0-9-_/]+)
Hovering over option in a select list (window ) in IEs does not generate
NOTE: originally, I thought the issue was caused by something more complex; I see
The actual problem I was originally doing was converting a hash of arrays into
The original query looks like this (MySQL): SELECT * FROM books WHERE title LIKE
The original question is below, but I changed the title because I think it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.