[nem-bug] [Nemerle 0000976]: closure with "this" in constructor

feedback at nemerle.org feedback at nemerle.org
Mon Apr 9 06:59:54 CEST 2007


The following issue has been RESOLVED.
======================================================================
<http://nemerle.org/bugs/view.php?id=976> 
======================================================================
Reported By:                divan
Assigned To:                divan
======================================================================
Project:                    Nemerle
Issue ID:                   976
Category:                   Compiler
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     resolved
Resolution:                 fixed
Fixed in Version:           
======================================================================
Date Submitted:             03-20-2007 13:00 CET
Last Modified:              04-09-2007 06:59 CEST
======================================================================
Summary:                    closure with "this" in constructor
Description: 
class A {
  mutable x : int;
  static q () : void {}
  static w (_ : void -> void) : void {}
  public this (mutable y : int = 7) {
//  q (); //i suppose it should produce error when uncommented too
    --y;
    base ();
    this.x = 1;
    def f() {++x};
    f (); 
    w (f);
}
  public static Main () : void {
    System.Console.WriteLine (A ().x)
  }
}

Prints "2" when line is uncommented, should write
"error: closure utilizing 'this' reference is not allowed when base ctor
call is not placed at the beginning of current ctor"
======================================================================

----------------------------------------------------------------------
 divan - 04-09-07 06:59 
----------------------------------------------------------------------
Fixed on trunk r5781.

Issue History
Date Modified  Username       Field                    Change              
======================================================================
03-20-07 13:00 divan          New Issue                                    
04-09-07 06:59 divan          Note Added: 0001837                          
04-09-07 06:59 divan          Assigned To               => divan           
04-09-07 06:59 divan          Status                   new => assigned     
04-09-07 06:59 divan          Resolution               open => fixed       
04-09-07 06:59 divan          Summary                  closure with "this" in
constructor => closure with \"this\" in constructor
04-09-07 06:59 divan          Description Updated                          
04-09-07 06:59 divan          Status                   assigned => resolved
04-09-07 06:59 divan          Summary                  closure with "this" in
constructor => closure with \"this\" in constructor
04-09-07 06:59 divan          Description Updated                          
======================================================================




More information about the bugs mailing list