[nem-bug] [Nemerle 0000882]: Operators defined inside Function
class are not implicitly visible
feedback at nemerle.org
feedback at nemerle.org
Sat Jul 7 21:02:57 CEST 2007
A NOTE has been added to this issue.
======================================================================
<http://nemerle.org/bugs/view.php?id=882>
======================================================================
Reported By: nazgul
Assigned To: divan
======================================================================
Project: Nemerle
Issue ID: 882
Category: Compiler
Reproducibility: always
Severity: minor
Priority: normal
Status: assigned
======================================================================
Date Submitted: 02-07-2007 19:14 CET
Last Modified: 07-07-2007 21:02 CEST
======================================================================
Summary: Operators defined inside Function class are not
implicitly visible
Description:
See
http://nemerle.org/svn/nemerle/trunk/ncc/testsuite/positive/methods-1st-class-citizens.n
The operators should work without 'using Nemerle.Builtins.Function'
======================================================================
----------------------------------------------------------------------
divan - 07-02-07 19:41
----------------------------------------------------------------------
Should it just be added to default namespaces? (like in attached patch)
----------------------------------------------------------------------
nazgul - 07-02-07 19:51
----------------------------------------------------------------------
Your patch opens whole type to global namespace, which currently does not
bring any wrong side effects, but should not be necessary. The operators
should just work as they are defined inside the type of one of operands
(function).
----------------------------------------------------------------------
divan - 07-02-07 20:08
----------------------------------------------------------------------
Oh, indeed, I thought of them as of operators in auxiliary class :)
Then I have another one, just delay even if no matching operators are
currently discovered. Implies some more minor fixes, will fix it soon.
----------------------------------------------------------------------
nazgul - 07-02-07 20:11
----------------------------------------------------------------------
Cool, so let's make it in a proper way.
----------------------------------------------------------------------
divan - 07-04-07 20:57
----------------------------------------------------------------------
Done on r7732, but only when there is good type hint. (in the testcase |>
fails, >> is ok)
Following still fails
_ = 1.0 |> System.Math.Floor.
Floor is overloaded and can't be resolved, while it's not resolved it
doesn't give good enough MType.Fun hint (!) and we're stuck.
So further fixing paths:
1) Get rid of different fun types for void cases (if they were equal just
?->? hint could be enough, probably). Todo in far future :)
2) Provide one more workaround:
use "using class;" is already possible, but not too good,
allowing "using class.|>;" or something like that will be better
3) Delaying redesign (looking into all classes for operators or more
general redesign)
4) Improve type hints, maybe related to 921 (where intersection of
functions is called)
----------------------------------------------------------------------
divan - 07-07-07 21:02
----------------------------------------------------------------------
Fixed on r7744.
Just added simple type hint in delaying resolution, so testcase works
now.
If there will be more complex example where hint isn't generated it'll be
separate issue :)
Issue History
Date Modified Username Field Change
======================================================================
02-07-07 19:14 nazgul New Issue
06-27-07 13:53 divan Issue Monitored: divan
07-02-07 19:39 divan File Added: GlobalEnv.n.patch
07-02-07 19:41 divan Note Added: 0001928
07-02-07 19:51 nazgul Note Added: 0001929
07-02-07 20:08 divan Note Added: 0001930
07-02-07 20:11 nazgul Note Added: 0001931
07-02-07 20:50 divan Status new => assigned
07-02-07 20:50 divan Assigned To => divan
07-04-07 20:57 divan Note Added: 0001932
07-07-07 21:02 divan Note Added: 0001934
======================================================================
More information about the bugs
mailing list