[nem-bug] [Nemerle 0001026]: user-defined operators break
type-inference
feedback at nemerle.org
feedback at nemerle.org
Thu Jun 28 22:14:34 CEST 2007
The following issue has been RESOLVED.
======================================================================
<http://nemerle.org/bugs/view.php?id=1026>
======================================================================
Reported By: divan
Assigned To: divan
======================================================================
Project: Nemerle
Issue ID: 1026
Category: Compiler (type engine)
Reproducibility: always
Severity: major
Priority: normal
Status: resolved
Resolution: fixed
Fixed in Version:
======================================================================
Date Submitted: 06-12-2007 16:53 CEST
Last Modified: 06-28-2007 22:14 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.
======================================================================
Relationships ID Summary
----------------------------------------------------------------------
related to 0000635 When _ + _ is used inside a @+ definiti...
======================================================================
----------------------------------------------------------------------
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.
----------------------------------------------------------------------
divan - 06-28-07 22:14
----------------------------------------------------------------------
Fixed on r7720.
Issue History
Date Modified Username Field Change
======================================================================
06-12-07 16:53 divan New Issue
06-13-07 18:00 divan Note Added: 0001916
06-23-07 13:11 divan Status new => assigned
06-23-07 13:11 divan Assigned To => divan
06-27-07 14:45 divan Relationship added related to 0000635
06-28-07 22:14 divan Note Added: 0001926
06-28-07 22:14 divan Status assigned => resolved
06-28-07 22:14 divan Resolution open => fixed
06-28-07 22:14 divan Description Updated
06-28-07 22:14 divan Additional Information Updated
======================================================================
More information about the bugs
mailing list