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

float:fromHexString throws an error when used #32220

Closed
ushirask opened this issue Aug 18, 2021 · 2 comments · Fixed by #32228
Closed

float:fromHexString throws an error when used #32220

ushirask opened this issue Aug 18, 2021 · 2 comments · Fixed by #32228
Assignees
Labels
NBalNeeds Priority/Blocker Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime Type/Bug

Comments

@ushirask
Copy link
Contributor

Description:
float:fromHexString function throws the following error
error: {ballerina}TypeCastError {"message":"incompatible types: 'handle' cannot be cast to '(float|error)'"} at ballerina.lang.float.1_0_0:fromHexString(float.bal:367)

Steps to reproduce:

import ballerina/io;

public function main() {
    io:println(float:fromHexString("0x1a"));
}

It gives the same error with or without the 0x prefix (as used in int:fromHexString )

Affected Versions:
Ballerina Swan Lake Beta 2
Language specification 2021R1
Update Tool 1.3.5

OS, DB, other environment details and versions:

Related Issues (optional):

Suggested Labels (optional):

Suggested Assignees (optional):

@jclark
Copy link

jclark commented Aug 19, 2021

That's not a valid HexFloatingPointLiteral.

@ushirask
Copy link
Contributor Author

That's not a valid HexFloatingPointLiteral.

The error persists with valid HexFloatingPointLiterals

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NBalNeeds Priority/Blocker Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime Type/Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants