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

feedback at nemerle.org feedback at nemerle.org
Tue Mar 20 13:00:13 CET 2007


The following issue has been SUBMITTED.
======================================================================
<http://nemerle.org/bugs/view.php?id=976> 
======================================================================
Reported By:                divan
Assigned To:                
======================================================================
Project:                    Nemerle
Issue ID:                   976
Category:                   Compiler
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
======================================================================
Date Submitted:             03-20-2007 13:00 CET
Last Modified:              03-20-2007 13:00 CET
======================================================================
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"
======================================================================

Issue History
Date Modified  Username       Field                    Change              
======================================================================
03-20-07 13:00 divan          New Issue                                    
======================================================================




More information about the bugs mailing list