Skip to content

Fix: Incorrect type declaration about 'Number' #2278

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

Merged
merged 2 commits into from
May 3, 2022

Conversation

tari404
Copy link
Contributor

@tari404 tari404 commented Apr 29, 2022

In #2260 , Number was declared as typeof F64 (equivalent to typeof _Float), which causes all numbers to be considered as a Class with some methods that don't belong to it, just like:

image

I updated the declaration of Number according to the document. I think this is a small change, so I submit PR directly.



  • I've read the contributing guidelines
  • I've added my name and email to the NOTICE file

@dcodeIO
Copy link
Member

dcodeIO commented May 3, 2022

Wondering if it is sufficient to change

declare type Number = typeof F64;

to

declare type Number = F64;

to make it the desired alias, including all properties?

@tari404
Copy link
Contributor Author

tari404 commented May 3, 2022

Wondering if it is sufficient to change

declare type Number = typeof F64;

to

declare type Number = F64;

to make it the desired alias, including all properties?

I think it's better and add a new commit. *but it should be:

declare type Number = _Float;

@dcodeIO dcodeIO merged commit e89cec2 into AssemblyScript:main May 3, 2022
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

Successfully merging this pull request may close these issues.

2 participants