The following for loop filter


for(student: StudentInCourse in assign.course.enrolled order by assign.grade(student) desc) {

}

produces this error message on compilation of the generated Java code:


Assignment_Template.java:183: cannot find symbol
symbol : method gradeStudentInCourse
(webdsl.generated.domain.StudentInCourse)
location: class webdsl.generated.domain.StudentInCourse
return o2.gradeStudentInCourse
(o2).compareTo(o1.gradeStudentInCourse_(o1));

Perhaps the problem is caused by the fact that the object that I test on is not the same (type) as the loop index. But if I change it into

  for(student: StudentInCourse in assign.course.enrolled order by student.grade(assign) desc) {

}

the error is


Assignment_Template.java:183: gradeAssignment(webdsl.generated.domain.Assignment) in webdsl.generated.domain.StudentInCourse cannot be applied to (webdsl.generated.domain.StudentInCourse)
return o2.gradeAssignment
(o2).compareTo(o1.gradeAssignment_(o1));
^

Looks like the replacement of the index variable in the expression is too enthusiastic.

Submitted by Eelco Visser on 6 July 2012 at 12:31

On 24 February 2016 at 13:02 Elmer van Chastelet tagged 1.3.0

On 24 February 2016 at 13:02 Elmer van Chastelet closed this issue.

Log in to post comments