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

Compilation Error from the Cache Module #5915

Closed
AyeshW opened this issue Jan 5, 2024 · 1 comment · Fixed by ballerina-platform/module-ballerina-cache#1031
Closed

Compilation Error from the Cache Module #5915

AyeshW opened this issue Jan 5, 2024 · 1 comment · Fixed by ballerina-platform/module-ballerina-cache#1031
Assignees
Labels
Reason/Complex Issue occurred due to complex scenario. Type/Bug

Comments

@AyeshW
Copy link

AyeshW commented Jan 5, 2024

Description:
I have two ballerina module, one contains configurations and other one uses it. config module has following constants (values are not actual values).

public const int CAPACITY = 10;
public const float EVICTION_FACTOR = 0.2;
public const decimal DEFAULT_MAX_AGE = 30;
public const decimal CLEANUP_INTERVAL = 60;

Inside the other module, I use these constants to initialize the CacheConfig. Code segment can be found below.

import ballerina/cache;

final cache:CacheConfig cacheConfig = {
    capacity: config:CAPACITY,
    evictionFactor: config:EVICTION_FACTOR,
    defaultMaxAge: config:DEFAULT_MAX_AGE,
    cleanupInterval: config:CLEANUP_INTERVAL
};

Error Logs:

ERROR [foo.bal:(44:15,44:30)] invalid value: For input string: "config:CAPACITY"
ERROR [foo.bal:(45:21,45:43)] invalid value: For input string: "config:EVICTION_FACTOR"
ERROR [foo.bal:(46:20,46:42)] invalid value: For input string: "config:DEFAULT_MAX_AGE"
ERROR [foo.bal:(47:22,47:45)] invalid value: For input string: "config:CLEANUP_INTERVAL"

The same code was working in ballerina version 2201.0.0 without an issue.

Steps to reproduce:

Affected Versions:
2201.8.4

OS, DB, other environment details and versions:

Related Issues (optional):

Suggested Labels (optional):

Suggested Assignees (optional):

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.

@Bhashinee Bhashinee added the Reason/Complex Issue occurred due to complex scenario. label Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reason/Complex Issue occurred due to complex scenario. Type/Bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants