Make constructors just methods.
* Eliminate "new" reserved word. * Allow "this" before a method definition to define a constructor. * Only create a default constructor for classes that don't define one.
This commit is contained in:
@@ -2,7 +2,7 @@ var ClosureType
|
||||
|
||||
{
|
||||
var a = "a"
|
||||
ClosureType = new Fn { IO.print(a) }.type
|
||||
ClosureType = Fn.new { IO.print(a) }.type
|
||||
}
|
||||
|
||||
class Subclass is ClosureType {} // expect runtime error: Subclass cannot inherit from Fn.
|
||||
|
||||
Reference in New Issue
Block a user