#717 closed doubt (invalid)
error instantiating a Class just afert including the definition
Reported by: | Jorge | Owned by: | Jorge |
---|---|---|---|
Priority: | highest | Milestone: | OOP Implementation |
Component: | OOP | Version: | 2.0.1 |
Severity: | trivial | Keywords: | #Embed |
Cc: | javipor@… |
Description (last modified by )
Create a file 'def_A.tol' with this contents:
================= def_A.tol ================= Class A { Real a = 1 }; A a;
if you compile it works as expected but if we instantiate 'A a' in other file where def_A is included then TOL emit and error. In order to reproduce bug use the attached files and compile test_A.tol.
Attachments (2)
Change History (6)
Changed 16 years ago by
Changed 16 years ago by
Attachment: | test_A.tol added |
---|
comment:1 Changed 16 years ago by
comment:2 Changed 16 years ago by
Keywords: | #Embed added |
---|---|
Resolution: | → invalid |
Status: | new → closed |
For class declaration #Embed should be used instead of Include.
comment:3 Changed 15 years ago by
Component: | Database → OOP |
---|---|
Severity: | critical → trivial |
Type: | defect → doubt |
It is not a problem of Class instances, the same happens with Struct.
Parser fails because function Include does nothingt at parsing time. Purpose of Include is to create a Set hierarchy of variables and functions.
In order to load a TOL file in parsing time you can use macro #Embed that is the same that writing the embeded file, so, no Set will be created.
comment:4 Changed 15 years ago by
Description: | modified (diff) |
---|
This is the error message I receive from TOL:
<E>
ERROR: [1] Unexpected argument instA. Unexpected symbol . in character 7 of line 3:
Code line
</E>