Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly handle number sub-types in type matching #6

Closed
mraak opened this issue Feb 12, 2019 · 2 comments
Closed

Properly handle number sub-types in type matching #6

mraak opened this issue Feb 12, 2019 · 2 comments
Assignees

Comments

@mraak
Copy link
Collaborator

mraak commented Feb 12, 2019

number
finite - everything apart from infinity or NaN
int
bint - bigint

For example, int can be assigned to number, but not vice versa.

@mraak mraak self-assigned this Feb 12, 2019
@getify
Copy link
Owner

getify commented Feb 13, 2019

Example:

var a = int`3`;
a = 4;   // error, can't assign number to int

var b = 5;
b = int`6`;   // no error

var c = finite`7`;
b = c;   // no error
c = b;   // error can't assign `number` to `finite`

@getify getify mentioned this issue Feb 20, 2019
11 tasks
mraak added a commit that referenced this issue Feb 22, 2019
@mraak
Copy link
Collaborator Author

mraak commented Feb 22, 2019

Sent in the PR for this, have a look.

mraak added a commit that referenced this issue Feb 23, 2019
* #6 Number subtypes

* #6 Added 'any' check to isAssignmentAllowed

* #8 any (#29)

* #8 Allowing assignement to any, handling any as argument. Added line and column display to messages.

* #8 indentation

* checker: fixing bug where 'any' and 'undef' were confused (#26)

* #6 merged any check and line number reporting.

* #6 code review fixes, allowed assignment lookup improvement.
@getify getify closed this as completed Feb 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants