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

Closed
HindujaB opened this issue Nov 1, 2024 · 2 comments · Fixed by #43545
Closed

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

HindujaB opened this issue Nov 1, 2024 · 2 comments · Fixed by #43545
Assignees
Labels
Reason/EngineeringMistake The issue occurred due to a mistake made in the past. 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

Copy link

This issue is NOT closed with a proper Reason/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now.

      - Reason/EngineeringMistake - The issue occurred due to a mistake made in the past.
      - Reason/Regression - The issue has introduced a regression.
      - Reason/MultipleComponentInteraction - Issue occured due to interactions in multiple components.
      - Reason/Complex - Issue occurred due to complex scenario.
      - Reason/Invalid - Issue is invalid.
      - Reason/Other - None of the above cases.

@gimantha gimantha added the Reason/EngineeringMistake The issue occurred due to a mistake made in the past. label Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reason/EngineeringMistake The issue occurred due to a mistake made in the past. Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime Type/Bug
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants