Bug: Incorrect scanning of nested classes.
The following code : public class Instrument { class IInstrument { } } produces the following error. [t.ck]:line(25): class/type 'IInstrument' is already defined in namespace 'Instrument' The fix: ChuckScan.cpp line 1225: < ret = type_engine_scan0_class_def( env, body->section->class_def ); > ret = type_engine_scan1_class_def( env, body->section->class_def ); Rationale: The nested class has already had scan0 peformed during scan0 of the parent class. This call is made during scan1 processing, and should perform scan1 processing. Note that the other two cases in this switch perform scan1 processing, not scan0 processing. Please review the fix for correctness. I'm 98% sure it's correct. Regards, Robin Davies.
Hi Robin and all, Thanks for tracking this down - it has been fixed (maybe). The scan0 vs. scan1 was a problem, also there was a incorrect flag in type_engine_scan0_class_def when the name is verified in the namespace. It has been changed to look only in the local namespace. The fix is in CVS and will be in 1.2.0.1. Best, Ge! On Sep 4, 2005, at 11:35 AM, Robin Davies wrote:
The following code :
public class Instrument { class IInstrument { } }
produces the following error.
[t.ck]:line(25): class/type 'IInstrument' is already defined in namespace 'Instrument'
ret = type_engine_scan1_class_def( env,
The fix: ChuckScan.cpp line 1225: < ret = type_engine_scan0_class_def( env, body->section->class_def ); body->section->class_def ); Rationale: The nested class has already had scan0 peformed during scan0 of the parent class. This call is made during scan1 processing, and should perform scan1 processing. Note that the other two cases in this switch perform scan1 processing, not scan0 processing. Please review the fix for correctness. I'm 98% sure it's correct.
Regards,
Robin Davies.
_______________________________________________ chuck-dev mailing list chuck-dev@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-dev
participants (2)
-
Ge Wang
-
Robin Davies