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]: Typecast error thrown for typereference type default fields #43541

Open
HindujaB opened this issue Nov 1, 2024 · 1 comment · May be fixed by #43545
Open

[Bug]: Typecast error thrown for typereference type default fields #43541

HindujaB opened this issue Nov 1, 2024 · 1 comment · May be fixed by #43545
Assignees
Labels
Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime Type/Bug

Comments

@HindujaB
Copy link
Contributor

HindujaB commented Nov 1, 2024

Description

$subject

Steps to Reproduce

import ballerinax/aws.dynamodb;

type RetryConfig record {|
    int count;
    decimal interval;
    float backOffFactor;
|};

configurable RetryConfig retryConfig = ?;

public function main() returns error? {
    dynamodb:Client dynamoDBClient = check new ({
        retryConfig: {
            ...retryConfig
        },
        awsCredentials: {
            accessKeyId: "<AWS-ACCESS>",
            secretAccessKey: ""
        },
        region: ""
    });
}

error

Compiling source
        thisaru/test_package:0.1.0
WARNING [main.bal:(12:5,21:8)] unused variable 'dynamoDBClient'

Running executable

error: {ballerina}TypeCastError {"message":"incompatible types: '()' cannot be cast to 'decimal'"}
        at ballerina.http.2:createRetryClient(http_client_endpoint.bal:582)
           ballerina.http.2:checkForRetry(http_client_endpoint.bal:518)
           ballerina.http.2:initialize(http_client_endpoint.bal:492)
           ballerina.http.2.Client:init(http_client_endpoint.bal:54)
           ballerinax.aws.dynamodb.2.Client:init(client.bal:49)
           thisaru.test_package.0:main(main.bal:12)

Affected Version(s)

2201.9.4 onwards

OS, DB, other environment details and versions

No response

Related area

-> Runtime

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

@tharindu-nw
Copy link
Contributor

tharindu-nw commented Nov 4, 2024

This fix will be released with the 2201.9.5 patch
ballerina-platform/ballerina-distribution#5812

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

Successfully merging a pull request may close this issue.

3 participants