X10
  1. X10
  2. XTENLANG-1764

Why can't I use this or self in a class invariant?

    Details

    • Number of attachments :
      0

      Description

      I can't write neither:

      class A(i:Int) {this.i==4}  {}
      class B(i:Int) {self.i==4}  {}
      
      Errors:
      C:\cygwin\home\Yoav\test\Hello.x10:3: This or super cannot be used (implicitly or explicitly) in a constructor return type.    
           	 Type: A{A#this.i==4, self.i==i}
      C:\cygwin\home\Yoav\test\Hello.x10:4: self may only be used within a dependent type
      2 errors.
      

      I think we should allow both, and they should refer to the same object.

        Issue Links

          Activity

          Hide
          David Grove added a comment -

          bulk defer to 2.4.1.

          Show
          David Grove added a comment - bulk defer to 2.4.1.
          Hide
          David Grove added a comment -

          bulk defer to 2.4.2

          Show
          David Grove added a comment - bulk defer to 2.4.2
          Hide
          David Grove added a comment -

          bulk defer to 2.4.3

          Show
          David Grove added a comment - bulk defer to 2.4.3
          Hide
          David Grove added a comment -

          bulk defer to 2.4.4

          Show
          David Grove added a comment - bulk defer to 2.4.4
          Hide
          David Grove added a comment -

          bulk defer to 2.5.2

          Show
          David Grove added a comment - bulk defer to 2.5.2

            People

            • Assignee:
              Unassigned
              Reporter:
              Yoav Zibin
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:

                Time Tracking

                Estimated:
                Original Estimate - 3 days
                3d
                Remaining:
                Remaining Estimate - 3 days
                3d
                Logged:
                Time Spent - Not Specified
                Not Specified