-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Not sure if the WebCompiler is up to date, but I found several issues with very basic language constructs:
- Real literals
Console.WriteLine(1.5); // NotImplementedException
Also, the grammar apparently doesn't allow shorting 0.x to just .x:
Console.WriteLine(.3); // unexpected input while parsing expression
- Accessing constants
Console.WriteLine(Math.PI); // NotImplementedException
- Chained member access on value types
val date = DateTime.Now;
Console.WriteLine(date.ToString()); // works
Console.WriteLine(date.TimeOfDay.ToString()); // NullReferenceException
- Overloaded operators
The compiler does not seem to care aboutop_xmethods at all.
val date = DateTime.Now;
val time = TimeSpan(2, 0, 0);
val newDate = date + time; // no matching overload found for operator +
// op_Implicit
val a: BigInteger = 2; // type mismatch between BigInteger and Int32
val b: Int64 = 10; // type mismatch between Int64 and Int32
- Boolean logic
val a = 2;
val b = 5;
val c = a & b; // unexpected input while parsing statement
val d = a | b; // unexpected input while parsing statement
val e = a ^ b; // unexpected input while parsing statement
val f = a >> b; // unexpected input while parsing statement
val g = a << b; // unexpected input while parsing statement
val h = ~a; // unexpected input while parsing expression
- Flags enums
import System.Reflection;
val flags = BindingFlags.Public | BindingFlags.Static; // unexpected input while parsing statement
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels