Working on contrained types(domains) idea, proposed syntax:
--------------------------------------------
use RTL;
--------------------------------------------
use RTL;
//Domain with constrain
public domain HumanAge(int)
{
value >= 0 and value <= 150; }
{
value >= 0 and value <= 150; }
public static class Program1 begin
public method Main
{
Console.WriteLine("Hello Delphi days!");
Console.ReadLine();
Console.WriteLine("About to crash");
var age: HumanAge;
age = 500; // CRASH!!!!!! Domain is constrained and did not pass validation
}
end;
end;