V8.2 compilation error, works in V8.1 [message #80440] |
Fri, 01 June 2012 08:51 |
wlandsman
Messages: 743 Registered: June 2000
|
Senior Member |
|
|
We are getting many compilation errors in V8.2 for code that worked in V8.1. Apparently, there was a loophole in V8.1 that allowed one to directly access an object's variables in certain case, but now a line like
self.obj2.index
gives an error
% Expression must be a structure in this context: <OBJREF (<ObjHeapVar2(OBJ2)>)>
One can always access the variable with a GETPROPERTY, and I suppose this might have been a "bug fix". Is there any place where one can get a list of the V8.2 bug fixes?
Below I give an example with two simple objects.
IDL> t = obj_new('obj1')
IDL> t.printvalue
gives an error in V8.2 but not V8.1
;obj1__define.pro
pro obj1::printvalue,index=index
print,self.obj2.index
end
pro obj1::getproperty,obj2=obj2
if arg_present(obj2) then obj2 = self.obj2
end
function obj1::init,obj2=obj2
if ~isa(obj2,'obj2') then self.obj2 = obj_new('obj2')
return,1
end
pro obj1__define
compile_opt idl2
obj1 = {obj1, $
obj2:obj_new()}
end
;obj2__define.pro
pro obj2::getproperty,index=index
if arg_present(index) then index = self.index
end
pro obj2__define
compile_opt idl2
obj2 = {obj2, $
index:0L}
end
|
|
|