Bug fix: Path.MakeCanonical now converts a drive letter to upper case.
Bug fix: The following construct generated invalid code:
class A { }
class B : A { }
void main() { System.Collections.List<A> x; B b; x.Add(b); }
Now fixed.
Bug fix: The following construct generated invalid code:
class A { }
class B : A { }
void foo
void main() { B* b; foo<A*>(b); }
Now fixed.
Bug fix: System.String
You can now create string literals and arrays of string literals as compile time constants, and obtain the length of a string literal as a compile time constant:
public const char* foo = "foo"; public const long n = foo.Length(); public const char*[] strings = [ "abc", "xyzzy", "foobar" ]; public const long m = strings[2].Length();
The same applies to wchar* and uchar*.
Unnamed namespaces like in C++. These two declarations with the same the name in two source files do not conflict each other because they are contained in an unnamed namespace that receives a unique name at compile time:
// alpha.cm:
namespace { const int[] foo = [1, 2, 3]; }
// beta.cm:
namespace { const int[] foo = [2, 3, 4]; }
The mangled name of an unnamed namespace will be "unnamed_ns_UNIQUE_HEX_STRING" where UNIQUE_HEX_STRING will be SHA-1 hash of a random UUID. The mangled names of the entities belonging to an unnamed namespace will be unique.
Visual Studio extension updated. It supports now Visual Studio 2019. The cmajor.vsix extension for VS 2019 is in the cmajor/vs/2019 directory.
System library changes:
New 'cmupd' tool for converting projects and solutions that use old System APIs to use the new APIs. It's not perfect of course, so some manual changes may be needed.
All system library parsers and lexers are now generated using the 'soulcm' lexer/parser generator tool. Each generated lexer is a DFA that has a multimeg Unicode character class map array which is in compressed form inside an executable containing the lexer. First call to a constructor of some lexer takes a while (about half a second on my machine), because it expands the class map. Subsequent calls to the same lexer (to a constructor or other member function) are much faster (taking fraction of a millisecond), because the class map is already expanded.
New System.Windows library that is available only on Windows. It is still in preliminary stage.
System.cms solution file can now be found in the cmajor/system/platform/windows and cmajor/system/platform/linux directories for Windows and Linux respectively. The Windows version includes the new System.Windows library.
Upgraded to LLVM 9.0.0
Upgraded to Unicode 12.1.