public class TempTest {
void foo() {
// works well
Console.WriteLine(10L.minutes());
// error in Consulo, but no error in VisualStudio and Mono Compiler
Console.WriteLine(10.hours());
// also works well
int ten = 10;
Console.WriteLine(ten.hours());
}
}
public static class TestEx {
public static long minutes(this long hours) {
return hours * 60L;
}
public static long hours(this int hours) {
return hours * 3600L;
}
}
As you can see, Consulo fails to parse the expression when literal integer is used, but has no problem with long literal or int variable. Same happens not only with extension method, but also for .ToString().
Also note the syntax highlighting (magnified): the dot here is highlighted blue like number literal (magnified):
Probably Consulo somehow thinks that this . is a numeric suffix, like L for long and f for float?
Example:
As you can see, Consulo fails to parse the expression when literal integer is used, but has no problem with
long
literal orint
variable. Same happens not only with extension method, but also for.ToString()
.Also note the syntax highlighting (magnified): the dot here is highlighted blue like number literal (magnified):
Probably Consulo somehow thinks that this
.
is a numeric suffix, likeL
forlong
andf
forfloat
?