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

#712 closed enhancement (fixed)

Copy y DeepCopy para NameBlock y objetos (Clases)

Reported by: Javier Portugal Owned by: Víctor de Buen Remiro
Priority: highest Milestone:
Component: OOP Version: 2.0.1
Severity: critical Keywords:
Cc:

Description (last modified by Víctor de Buen Remiro)

Parece que el Copy con NameBlocks no copia. Ni en la Active ni en la 1.1.7.

NameBlock a = [[
 Text _.valor = "Inicial";
 Text GetValor (Real void) {
   _.valor
 };
 Text SetValor (Text valor) {
   Text _.valor := valor
 }
]];

NameBlock b = Copy(a);

Text b::SetValor("cambiado");

Text WriteLn("El valor de b es "+b::GetValor(0));
Text WriteLn("El valor de a es "+a::GetValor(0));

Aparte del Copy sería necesario tener un DeepCopy para NameBlocks (objetos de clases)

Change History (2)

comment:1 Changed 16 years ago by Víctor de Buen Remiro

Description: modified (diff)
Status: newassigned

comment:2 Changed 16 years ago by Víctor de Buen Remiro

Resolution: fixed
Status: assignedclosed

(In [1176]) Method BNameBlock::operator= uses DeepCopy instead of Copy in order to create independent instances
Fixes #712

Note: See TracTickets for help on using tickets.