Closed serkonda7 closed 1 year ago
I have this code in the playground. It's basically the hello world with a few lines from the reference pasted:
public class HelloFu { public static string GetMessage() { Dictionary<string(), int> dict; dict["foo"] = 42; dict["foo"] = 1337; Console.WriteLine(dict["foo"]); return "Hello, world!"; } }
However these two lines fail with an error.
dict["foo"] = 42; dict["foo"] = 1337;
cannot modify array trough read-only reference
Thank you for reporting this! It should be:
Dictionary<string(), int>() dict;
I fixed it in the reference.
I have this code in the playground. It's basically the hello world with a few lines from the reference pasted:
However these two lines fail with an error.