X10
  1. X10
  2. XTENLANG-1581

Functions that offer can fail to typecheck

    Details

    • Number of attachments :
      0

      Description

      The following code ought to compile. All it does is offer Ints around.

      class Offery {
        public def off() throws Exception offers Int  {
           offer 1;
           offer 2;
           offer 3;
        }
      
        val f : () offers Int => Int  = 
          () => {this.off(); 1};
        
        public static def main(argv:Rail[String]!) {
          
        }
      }
      

      However, no:

      /Users/bard/x10/tmp/colfin/Offery.x10:9: Code that can offer values of given type is invoked in a context which does not expect offers.
      Offer type: x10.lang.Int

        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:
            Bard Bloom
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: