[nem-bug] [Nemerle 0000707]: Bug in Extension method implementation

feedback at nemerle.org feedback at nemerle.org
Sat Jul 15 01:29:01 CEST 2006


A NOTE has been added to this issue.
======================================================================
<http://nemerle.org/bugs/view.php?id=707> 
======================================================================
Reported By:                VladD2
Assigned To:                
======================================================================
Project:                    Nemerle
Issue ID:                   707
Category:                   Compiler
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
======================================================================
Date Submitted:             07-03-2006 08:13 CEST
Last Modified:              07-15-2006 01:29 CEST
======================================================================
Summary:                    Bug in Extension method implementation
Description: 
using System;
using System.Console;

public module M1
{
  public Sort[T](this source : array[T]) : array[T]
  {
    Array.Sort(source);
    source
  }
}

WriteLine(array[4,1,3,8,2].Sort());

Retort errors:
Main.n(13,11,13,32): error : trying to access static member (method
System.Array.Sort(array : array [T.754]) : void) through an instance
...
======================================================================

----------------------------------------------------------------------
 VladD2 - 07-15-06 01:29 
----------------------------------------------------------------------
One more example of this bug:
using System.Console;
using Nemerle.Utility;

def ary = array[0,1,2,3,4,5,6,7,8,9];
def j = 3;

WriteLine(ary.Exists(elem => elem == j));
====================================================
Main.n(7,11,7,21): error : trying to access static member (method
System.Array.Exists(array : array [T.771], match :
System.Predicate[T.771]) : bool) through an instance

Issue History
Date Modified  Username       Field                    Change              
======================================================================
07-03-06 08:13 VladD2         New Issue                                    
07-15-06 01:29 VladD2         Note Added: 0001372                          
======================================================================




More information about the bugs mailing list