Boo
  1. Boo
  2. BOO-1300

Automatically make a constructor() in global scope static

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 0.9.5
    • Component/s: Compiler
    • Labels:
      None
    • Testcase included:
      yes
    • Number of attachments :
      0

      Description

      when to define constructor() in global scope,
      I think that the compiler should report an error then.

      ---sample code---

      1. the code has a bug purposely

      class Rectangle:
      _width as single
      _height as single
      def constructor(width as single, height as single):
      _width = width
      _height = height

      virtual def GetArea():
      return _width * _height

      class Square(Rectangle):
      def constructor(width as single):
      super(width, width)

      override def GetArea():
      return _width * _width

      ----compile it----
      >booc constructor.boo
      Boo Compiler version 0.9.2.3383 (CLR 2.0.50727.4200)
      constructor.boo(14,14): BCE0024: The type 'Rectangle' does not have a visible constructor
      that matches the argument list '(single, single)'.
      constructor.boo(16,18): BCE0060: 'Square.GetArea()': no suitable method found to override.

      constructor.boo(9,16): BCE0005: Unknown identifier: '_width'.
      constructor.boo(9,25): BCE0005: Unknown identifier: '_height'.
      4 error(s).

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            KATO Kanryu
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: