Add type parameter to Number #392

Closed
gavinking opened this Issue Jan 11, 2014 · 5 comments

Projects

None yet

3 participants

@gavinking
Member

Similarly to #376, we should redefine Number like this:

shared interface Number<Other=Object>
    given Other satisfies Object
@gavinking gavinking was assigned Jan 11, 2014
@chochos
Member
chochos commented Mar 20, 2014

Let me know if/when you do this because Number is a native interface in JS (for interop reasons)

@tombentley tombentley added IN PROGRESS and removed IN PROGRESS labels Mar 24, 2014
@tombentley
Member

@gavinking are we doing this? Are you doing this?

@tombentley
Member

@gavinking I had a very brief look at this, but it's not clear to me how that type parameter would be used (non of the members of Number would be of type Other as far as I can tell).

@gavinking
Member

Well, fractionalPart, magnitude, and wholePart would be Number&Other. Still, I don't think we should to make this change, which was never really properly thought-through. Really Other is a self-type here, but we can't add the self-type constraint because Object wouldn't satisfy it.

If anything, we could actually get rid of Number since it seems to me that the only Numbers are all actually Scalars.

@gavinking
Member

Closing, see #452.

@gavinking gavinking closed this May 13, 2014
@CeylonMigrationBot CeylonMigrationBot referenced this issue in ceylon/ceylon Nov 14, 2015
Closed

Add type parameter to Number #5270

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment