Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Objectteams » Problems with Brole playedBy Arole
Problems with Brole playedBy Arole [message #568060] Fri, 12 February 2010 12:06
Eugene Hutorny is currently offline Eugene HutornyFriend
Messages: 110
Registered: January 2010
Senior Member
Hi Stephan,

I've made some more experiments with OT/J and got some more questions.

My teams are declares as the following (complete source http://hutorny.in.ua/wp-content/uploads/2010/02/exer14.zip)

public team class Ateam {
public class Arole playedBy Aclass {
//...
}
}

public team class Bteam {
private final Ateam ateam;
public class Brole playedBy Arole<@ateam> {
//...
}
public Brole lift(Arole<@ateam> as Brole brole) {
return brole;
}
}

public team class Cteam extends Ateam {
public class Crole extends Arole playedBy Aclass {
}
}



For the following code compiler generates error: The method lift(Arole<@bteam.ateam>) in the type Bteam is not applicable for the arguments (Arole<@ateam>)


Arole<@ateam> arole = ateam.lift(aclass);
bteam.lift(arole);


How to make the type applicable?

The following code fails with class cast exception:

final Cteam cteam = new Cteam();
final Bteam dteam = new Bteam(cteam);

within(cteam) {
within(dteam) {
aclass.run();
}
}

Exception in thread "main" java.lang.ClassCastException: ua.in.hutorny.otj.exer14.Cteam$__OT__Crole
at ua.in.hutorny.otj.exer14.Bteam$__OT__Brole._OT$run$base(Btea m.java)
at ua.in.hutorny.otj.exer14.Bteam$__OT__Brole.run(Bteam.java:21 )
Previous Topic:OTDT 1.4.0M3 released
Next Topic:Problems with Brole playedBy Arole
Goto Forum:
  


Current Time: Fri Mar 29 12:29:42 GMT 2024

Powered by FUDForum. Page generated in 0.02672 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top