| Summary: | Constructors in handlers shouldn't be "abstract" | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Matt Heitz <mheitz> |
| Component: | EDT | Assignee: | Project Inbox <edt.compiler-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P1 | CC: | pharmon |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
|
Description
Matt Heitz
I have released some support for this. You can now define statements, and they are validated and generated into the IR. However, the resolution code needs to be updated to support invoking a constructor from within a constructor. EX: Handler hand1 constructor() .... end constructor(f1 int) this(); ... end end Also, we need to define what rules there are for invoking a constructor in this manner. Java, for instance, only lets you invoke a constructor using "this()" if you are on the first line of a constructor. I have fixed the original problem with this. You can now specify statements in the constructors.
However, the code can still not handle resolution to constructors via the "this" syntax. For example:
Handler myHandler
field1 int;
field2 string;
constructor(p1 int)
field1 = p1;
end
constructor(p1 int, p2 string)
this(p1); // this resolution fails in binding and in the IRs
field2 = p2;
end
end
Also, we have not yet defined what restrictions may exist for invoking constructors within constructors. In Java, for instance, a constructor invocation must be the first statement inside a constructor.
I am leaving this bug open until the resolution problem is fixed and any validation that is required is written.
This work has been completed Do we have restrictions on invoking constructors within constructors, such as the one in Java? Yes, for now I have added valdiation checks so that the syntax: this(...) to invoke a constructor can only be used as the first statement of a constructor. Verified. |