Description
import ballerina/io;
configurable Product p = ?;
configurable Cricketer cricketer = ?;
type Product record {
string name;
float price;
};
type Cricketer readonly & record {|
string name;
float strikeRate;
float battingAverage;
|};
public function main() {
io:println("Product: ", p.name);
io:println("Price: ", p.price);
}
Config.Toml
[p]
name = "Book"
price = 12
[cricketer]
name = "waruna"
strikeRate = 91.5
battingAverage = 45
Getting
error: {ballerina/lang.map}InherentTypeViolation {"message":"invalid value for record field 'price': expected value of type 'float', found 'int'"}
at ballerina.lang.__internal.0:getConfigurableValue(configurable.bal:40)
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
Description
Config.Toml
Getting
error: {ballerina/lang.map}InherentTypeViolation {"message":"invalid value for record field 'price': expected value of type 'float', found 'int'"}
at ballerina.lang.__internal.0:getConfigurableValue(configurable.bal:40)
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