ballerina-platform / ballerina-lang

The Ballerina Programming Language
https://ballerina.io/
Apache License 2.0
3.68k stars 752 forks source link

[Ballerina Shell] Enum definitions with explicit expressions incorrect behavior #28037

Open kdsuneraavinash opened 3 years ago

kdsuneraavinash commented 3 years ago

Description: Enum declarations with explicit expressions are do not work correctly.

Steps to reproduce: In REPL,

// This will not work due to type EN converting to english
=$ enum Language {EN="english", TA="tamil", SI="sinhala"}
=$ EN variable = "english"  // <- After this, goes into a Error state
DamithaSenevirathne commented 3 years ago

Can not reproduce this issue with latest ballerina master. issue-28037

DamithaSenevirathne commented 3 years ago

@kdsuneraavinash can you please describe more about the error state. Got above results in the ballerina shell with the latest ballerina master.

kdsuneraavinash commented 3 years ago

It previously went to an error state. Screenshot_20210705_134202

If it is not going to an error state like this, I think this issue might have been fixed by some change done in master.

DamithaSenevirathne commented 3 years ago

Managed to reproduce the error state. will work on a fix Screenshot from 2021-07-06 00-34-00

nipunayf commented 1 year ago

Cannot seem to reproduce this error with 2201.7.2.

image