I just realized that we _do_ need to allow `with` on interfaces:

LZO's use interfaces to describe the classes they contain.  Currently they are 
(incorrectly) creating interfaces for anonymous interstitials and then 
extending those anonymous interstitials.  This seems to work only by accident, 
and further could potentially (although unlikely given their name scheme) 
collide with user-defined classes.

The solution is that the interface should tell the schema what it extends and 
what it mixes in, which means that interface needs to allow `with`.  An 
interface generates no code, it simply creates a schema type that is used by 
the code generator for instances of the interface or classes that extend the 
interface.

I will be backing out the part of this change that disallows `with` in 
`interface` as a part of the fix for LPP-9691.

On 2011-01-13, at 13:18, Henry Minsky wrote:

> approved
> 
> On Wed, Jan 12, 2011 at 6:45 PM, AndrĂ© Bargull <[email protected]>wrote:
> 
>> Change bargull-20110113-UTt by bargull@Bargull02 on 2011-01-13 00:24:02
>> in /home/anba/src/svn/openlaszlo/trunk
>> for http://svn.openlaszlo.org/openlaszlo/trunk
>> 
>> Summary: report compiler error when extending mixins
>> 
>> Bugs Fixed: LPP-8895 (mixin inheritance)
>> 
>> Technical Reviewer: ptw, henry
>> QA Reviewer: (pending)
>> 
>> Details:
>> Respond with a compiler error when users try to extend mixins because it's
>> unsupported. We may allow mixin inheritance at a later point, but currently
>> it's still open for implementation questions.
>> 
>> MixinCompiler.java:
>> - report compilation error if "extends", "with" or "implements" is found on
>> <mixin> element
>> 
>> InterfaceCompiler.java:
>> - report compilation error if "with" or "implements" is found on
>> <interface> element
>> - "extends" attribute is allowed for <interface>, see lfc.lzx schema file
>> 
>> Parser.jjt:
>> - create two separate productions for class and mixin preamble
>> - only class preamble allows "extends", "with" and "extends"
>> - mixin preamble doesn't allow any inheritance verbs, but still produces
>> EmptyExpressions so ClassDefinition has the same number of children for
>> classes and mixins (maybe we should create a distinct ast-node for mixins,
>> but for now this works)
>> 
>> 
>> Tests:
>> test case from bugreport reports compiler errors
>> 
>> Files:
>> M WEB-INF/lps/server/sc/src/org/openlaszlo/sc/Parser.jjt
>> M WEB-INF/lps/server/src/org/openlaszlo/compiler/MixinCompiler.java
>> M WEB-INF/lps/server/src/org/openlaszlo/compiler/InterfaceCompiler.java
>> 
>> Changeset:
>> http://svn.openlaszlo.org/openlaszlo/patches/bargull-20110113-UTt.tar
>> 
>> 
> 
> 
> -- 
> Henry Minsky
> Software Architect
> [email protected]


Reply via email to