Skip to content

Various issues #429

@jgh07

Description

@jgh07

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 about op_x methods 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions