RE: [abc-dev] Compilation order should matter?

From: Oege de Moor <Oege.de.Moor@comlab.ox.ac.uk>
Date: Tue Aug 01 2006 - 21:53:31 BST

Many thanks for reporting this bug.

It is, in fact, a bug in the Polyglot Java compiler framework.

To verify that, leave out the aspect, put the interface in a separate file
and write "B implements IConstant" in the declaration of B. It doesn't
compile with the Polyglot compiler; I believe it might be a problem with the
implementation of barrier passes in Polyglot.

We (the abc developers) are unlikely to fix this problem soon.
Is it a showstopper for you?

-Oege

> -----Original Message-----
> From: Majordomo list server [mailto:majordomo@comlab.ox.ac.uk] On Behalf
> Of Fernando Calheiros
> Sent: 01 August 2006 20:40
> To: abc-dev@comlab.ox.ac.uk
> Subject: [abc-dev] Compilation order should matter?
>
> Hi everyone, I'm using ABC in a research project and the following
> situation has come up... suppose that I have the following classes and
> aspects (in their respective files).
>
> package s40;
>
> public class A {
> public static void main(String[] args) {
> switch(1) {
> case B.LITERAL:
> System.out.println("Works");
> }
> }
> }
>
> ---------------------------------------------------------
>
> package s40;
>
> public class B {
> }
>
> ---------------------------------------------------------
> package s40;
>
> public aspect C {
> declare parents : B implements IConstant;
>
> public interface IConstant {
> public static final int LITERAL = 1;
> }
> }
>
> This code should compile, but it doesn't (using "java abc.main.Main
> -sourceroots s40"), instead it gives me the following error message:
>
> A.java:6: Case label must be an integral constant.
>
> But if class A was named D (in D.java), this code compiles just fine.
>
> (It compiles with both ways in AspectJ)
>
> Is it a compiler bug?
>
> Thanks for your time,
> Fernando Calheiros
Received on Tue Aug 01 21:53:45 2006

This archive was generated by hypermail 2.1.8 : Mon Aug 28 2006 - 10:20:08 BST