X10
  1. X10
  2. XTENLANG-2435

When inferring the return type, we should consider overriding methods and HasType.

    Details

    • Number of attachments :
      0

      Description

      class TestOverridingAndHasType {
      class A {
      	def m():Int = 1;
      	def t():Int = 1;
      	def p():Double = 1;
      }
      class B extends A {
      	def m() {throw new Exception();	} // ShouldNotBeERR
      	def t() <: Int { throw new Exception();	} // ShouldNotBeERR ShouldNotBeERR
      	def p() = 2;  // ShouldNotBeERR
      }
      class C {	
      	def m() { throw new Exception();	} // infers void
      	def m1():void { throw new Exception();	}
      	def m2():Int { throw new Exception();	}
      	def m3() <: Int {throw new Exception();	} // ShouldNotBeERR 
      	def m4() <: void {throw new Exception();	}
      }
      }
      

        Issue Links

          Activity

          Yoav Zibin made changes -
          Field Original Value New Value
          Description {code}
          class TestOverridingAndHasType {
          class A {
          def m() = 1;
          def t() = 1;
          def p() = 1;
          }
          class B extends A {
          def m() {throw new Exception(); } // ShouldNotBeERR
          def t() <: Int { throw new Exception(); } // ShouldNotBeERR ShouldNotBeERR
          def p() = 2; // ShouldNotBeERR
          }
          class C {
          def m() { throw new Exception(); } // infers void
          def m1():void { throw new Exception(); }
          def m2():Int { throw new Exception(); }
          def m3() <: Int {throw new Exception(); } // ERR
          def m4() <: void {throw new Exception(); }
          }
          }
          {code}
          {code}
          class TestOverridingAndHasType {
          class A {
          def m():Int = 1;
          def t():Int = 1;
          def p():Double = 1;
          }
          class B extends A {
          def m() {throw new Exception(); } // ShouldNotBeERR
          def t() <: Int { throw new Exception(); } // ShouldNotBeERR ShouldNotBeERR
          def p() = 2; // ShouldNotBeERR
          }
          class C {
          def m() { throw new Exception(); } // infers void
          def m1():void { throw new Exception(); }
          def m2():Int { throw new Exception(); }
          def m3() <: Int {throw new Exception(); } // ERR
          def m4() <: void {throw new Exception(); }
          }
          }
          {code}
          Yoav Zibin made changes -
          Summary When inferring the return type, we should consider overriding methods. When inferring the return type, we should consider overriding methods and HasType.
          Description {code}
          class TestOverridingAndHasType {
          class A {
          def m():Int = 1;
          def t():Int = 1;
          def p():Double = 1;
          }
          class B extends A {
          def m() {throw new Exception(); } // ShouldNotBeERR
          def t() <: Int { throw new Exception(); } // ShouldNotBeERR ShouldNotBeERR
          def p() = 2; // ShouldNotBeERR
          }
          class C {
          def m() { throw new Exception(); } // infers void
          def m1():void { throw new Exception(); }
          def m2():Int { throw new Exception(); }
          def m3() <: Int {throw new Exception(); } // ERR
          def m4() <: void {throw new Exception(); }
          }
          }
          {code}
          {code}
          class TestOverridingAndHasType {
          class A {
          def m():Int = 1;
          def t():Int = 1;
          def p():Double = 1;
          }
          class B extends A {
          def m() {throw new Exception(); } // ShouldNotBeERR
          def t() <: Int { throw new Exception(); } // ShouldNotBeERR ShouldNotBeERR
          def p() = 2; // ShouldNotBeERR
          }
          class C {
          def m() { throw new Exception(); } // infers void
          def m1():void { throw new Exception(); }
          def m2():Int { throw new Exception(); }
          def m3() <: Int {throw new Exception(); } // ShouldNotBeERR
          def m4() <: void {throw new Exception(); }
          }
          }
          {code}
          Igor Peshansky made changes -
          Fix Version/s X10 2.2 [ 16002 ]
          Igor Peshansky made changes -
          Link This issue is related to XTENLANG-2480 [ XTENLANG-2480 ]
          Igor Peshansky made changes -
          Link This issue is depended upon by XTENLANG-2439 [ XTENLANG-2439 ]
          Igor Peshansky made changes -
          Link This issue is depended upon by XTENLANG-2584 [ XTENLANG-2584 ]
          Igor Peshansky made changes -
          Link This issue duplicates XTENLANG-1584 [ XTENLANG-1584 ]
          Hide
          Igor Peshansky added a comment -

          This is a duplicate of XTENLANG-1584 (overriding methods) and XTENLANG-2480 (HasType).

          Show
          Igor Peshansky added a comment - This is a duplicate of XTENLANG-1584 (overriding methods) and XTENLANG-2480 (HasType).
          Igor Peshansky made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s X10 2.2 [ 16002 ]
          Resolution Duplicate [ 3 ]
          Hide
          David Grove added a comment -

          bulk close of resolved issues with unspecified fix target (svn head, won't fix, duplicate, etc).

          Show
          David Grove added a comment - bulk close of resolved issues with unspecified fix target (svn head, won't fix, duplicate, etc).
          David Grove made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

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

              Dates

              • Created:
                Updated:
                Resolved: