Ticket #165 (closed defect: fixed)
Bad error message for bad numeric for loop
Reported by: | Chuck | Owned by: | eric.sellon |
---|---|---|---|
Priority: | major | Milestone: | Cobra 0.9 |
Component: | Cobra Compiler | Version: | 0.8.0 |
Keywords: | Cc: |
Description
In the following code, the upper bound of the loop is j/2 although j//2 was probably the true intent:
class X def main j = 4 for i in 0 : j/2 print i * 2
The error message is really bad:
error: For arg 1: Cannot apply STAR to Object and int. Try finding a method that performs this function.
Looks like numeric for loops need to check that both bounds are integer types.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.