Commit f37a702
committed
fix: preserve reserved keyword in module import diagnostic message
When a reserved keyword (e.g. 'client') is used in a module import path
without the '^' escape prefix, BLangIdentifier.value is empty string
while originalValue holds the raw source text.
getQualifiedPackageName() was using id.value for all identifiers, causing
the keyword to be silently dropped and producing misleading diagnostics
like 'cannot resolve module ballerinax/.config' instead of the correct
'cannot resolve module ballerinax/client.config'.
Fall back to originalValue when value is empty to preserve the keyword
in the diagnostic message.
Fixes: #44509, #445191 parent 8e1d6a6 commit f37a702
1 file changed
Lines changed: 1 addition & 1 deletion
File tree
- compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/tree
compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/tree/BLangImportPackage.java
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| |||
0 commit comments