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

[Bug?] Types documentation and implementation mismatch for string#charCodeAt() #682

Closed
jtenner opened this issue Jun 20, 2019 · 2 comments · Fixed by #683
Closed

[Bug?] Types documentation and implementation mismatch for string#charCodeAt() #682

jtenner opened this issue Jun 20, 2019 · 2 comments · Fixed by #683

Comments

@jtenner
Copy link
Contributor

jtenner commented Jun 20, 2019

ERROR AS200: Conversion from type 'i32' to 'u16' requires an explicit cast.

       let value: u16 = color.charCodeAt(i);
                        ~~~~~~~~~~~~~~~~~~~
 in assembly/__tests__/ColorParseOperation.spec.ts(8,23)

In the index.d.ts file, it's marked at u16 as I think it should be, but the implementation likely has an i32 output, which is currently unexpected.

declare class String {
  charCodeAt(index: u32): u16;
}

I can't submit a pull request right this second, but if nobody makes it by the end of tonight, I can probably get around to this.

The question is, what needs to be done?

@jtenner jtenner changed the title Types documentation and implementation mismatch for string#charCodeAt() [Bug?] Types documentation and implementation mismatch for string#charCodeAt() Jun 20, 2019
@MaxGraey
Copy link
Member

Good catch! Should be i32 everywhere

@jtenner
Copy link
Contributor Author

jtenner commented Jun 20, 2019

Thanks for the fix.

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

Successfully merging a pull request may close this issue.

2 participants