We cannot emit a compile-time warning due to possible dynamic placement changes at runtime. For example a <node> may contain several <view>s, but in its determinePlacement() method, the <node> will change the immediate-parent for the <view>s, so they're properly attached to another <view>.

Simple example to underline my concern:
<canvas>
<class name="mynode" extends="node" defaultplacement="whatever">
<method name="determinePlacement" args="aSub, placement, args" >
      return canvas;
</method>
</class>

<mynode>
<!-- the view will be attached to the canvas -->
<view width="50" height="50" bgcolor="blue"/>
</mynode>
</canvas>

>/  Guess the compiler would have to throw an error when a subclass of
/>/  node uses a mixin which contains views. But then, I just realize that
/>/  the compiler doesn't warn if you add a view to a subclass of node when
/>/  not using a mixin. What should the compiler do in such a case?
/>/
/

Yeah there ought to be a warning either at compile time if possible or at
runtime
if a view is a child of a non-view parent. Perhaps in debug mode we could
have a runtime check. File an improvement request in Jira?

--
Henry Minsky
Software Architect
hminsky at laszlosystems.com  
<http://www.openlaszlo.org/mailman/listinfo/laszlo-dev>

Reply via email to