Wiki

Ticket #260 (closed defect: fixed)

Opened 14 years ago

Last modified 14 years ago

expressions receive wrong type

Reported by: blubb Owned by:
Priority: major Milestone:
Component: Cobra Compiler Version: 0.8.0
Keywords: Cc:

Description

the following code does not compile:

class Oops

    def main
        if (0 == 0) == true
            print "okay"

It fails with the error:

/home/blubb/cobra-workspace/Source/oops.cobra(4): warning: Unnecessary parentheses around expression. You can remove them.
/home/blubb/cobra-workspace/Source/oops.cobra(4): error: The left and right sides of the "==" expression cannot be equated because of their types ("int" and "bool").

when removing the == true, everything works as expected

Change History

Changed 14 years ago by Chuck

  • status changed from new to closed
  • resolution set to fixed

Fixed in changeset:2450

This bug was introduced with the earlier addition of Python-style chained comparisons such as "0 < i < 10" which is why the bug required two comparison operators in order to manifest.

Note: See TracTickets for help on using tickets.