[nem-bug] [Nemerle 0001026]: user-defined operators break
type-inference
feedback at nemerle.org
feedback at nemerle.org
Wed Jun 13 18:00:41 CEST 2007
A NOTE has been added to this issue.
======================================================================
<http://nemerle.org/bugs/view.php?id=1026>
======================================================================
Reported By: divan
Assigned To:
======================================================================
Project: Nemerle
Issue ID: 1026
Category: Compiler (type engine)
Reproducibility: always
Severity: major
Priority: normal
Status: new
======================================================================
Date Submitted: 06-12-2007 16:53 CEST
Last Modified: 06-13-2007 18:00 CEST
======================================================================
Summary: user-defined operators break type-inference
Description:
using System;
using DateHelper;
public module DateHelper {
public @+ (date : DateTime, delta : double) : DateTime {
date.AddDays (delta);
}
public @+ (_ : int, _ : DateTime) : int {
1
}
}
_ = [1.0].FoldLeft (2.0, _ + _)
Results in error, but should choose double+double overload.
======================================================================
----------------------------------------------------------------------
divan - 06-13-07 18:00
----------------------------------------------------------------------
1)One more example:
_ = (_ + _) ([1], [2]);
or even
_ = (op_Addition : _ -> _) ([1], [2]);
gets same errors but can be fixed by "using Nemerle.Core.list"
2)module DateHelper can be replaced with class A, and operators A+int,
int+A, same errors
3)It looks like it's the problem only with operators, because replacing @+
with for example "string", and testing _ = (string : _ -> _) ('a', 1);
works ok, choosing one of string constructors.
Issue History
Date Modified Username Field Change
======================================================================
06-12-07 16:53 divan New Issue
06-13-07 18:00 divan Note Added: 0001916
======================================================================
More information about the bugs
mailing list