ballerina-platform / ballerina-library

The Ballerina Library
https://ballerina.io/learn/api-docs/ballerina/
Apache License 2.0
136 stars 64 forks source link

[Bug]: Constants not identifying its type #7322

Open Rashmika998 opened 3 weeks ago

Rashmika998 commented 3 weeks ago

Description

const CAPACITY = 100;
const EVICTION_FACTOR = 0.2;

final cache:Cache userInfoCache = new (capacity = CAPACITY, evictionFactor = EVICTION_FACTOR);

This gives the following error, as it doesn't recognize the constant types as int or float: invalid value: For input string: "CAPACITY" invalid value: For input string: "EVICTION_FACTOR"

It seems the constants are not being identified with their intended types.

Steps to Reproduce

No response

Affected Version(s)

No response

OS, DB, other environment details and versions

No response

Related area

-> Compilation

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

MaryamZi commented 3 weeks ago

Related to https://github.com/ballerina-platform/ballerina-library/issues/6036