close Warning: Can't synchronize with repository "(default)" (/var/svn/tolp does not appear to be a Subversion repository.). Look in the Trac log for more information.

Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#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 Víctor de Buen Remiro)

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)

def_A.tol (39 bytes) - added by Jorge 16 years ago.
test_A.tol (39 bytes) - added by Jorge 16 years ago.

Download all attachments as: .zip

Change History (6)

Changed 16 years ago by Jorge

Attachment: def_A.tol added

Changed 16 years ago by Jorge

Attachment: test_A.tol added

comment:1 Changed 16 years ago by Jorge

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

1 : Set Include( "def_A.tol" );
2 :
3 > A instA;


</E>

comment:2 Changed 16 years ago by Jorge

Keywords: #Embed added
Resolution: invalid
Status: newclosed

For class declaration #Embed should be used instead of Include.

comment:3 Changed 15 years ago by Víctor de Buen Remiro

Component: DatabaseOOP
Severity: criticaltrivial
Type: defectdoubt

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 Víctor de Buen Remiro

Description: modified (diff)
Note: See TracTickets for help on using tickets.