Renamed Imports aren't being used in the VSCode ext's Code Completion for Union Assertions. Instead the og package name is.
Compiler will Error out if current completion is used.
I've not tested it in other editors. Nor if it happens in other areas.
package main
import bar "food"
main :: proc() {
// Current code completion
cake := bar.fight(0).(food.Cakes)
pies := bar.fight(1).(food.Pies)
glass := bar.fight(2).(food.Glass)
// What it should be
_cake := bar.fight(0).(bar.Cakes)
_pies := bar.fight(1).(bar.Pies)
_glass := bar.fight(2).(bar.Glass)
}
./food/food.odin
package food
Cakes :: string
Pies :: bool
Glass :: enum {Wine, Stout, Whisky,}
Items :: union {Cakes, Pies, Glass,}
fight :: proc(t: int) -> Items {
switch t {
case 0: return "Sweet Rolls"
case 1: return true
case 2: return Glass.Stout
case: return nil
}
}
Issue
Renamed Imports aren't being used in the VSCode ext's Code Completion for Union Assertions. Instead the og package name is. Compiler will Error out if current completion is used. I've not tested it in other editors. Nor if it happens in other areas.
Versions
ols: v0.1.21 Odin: dev-2023-08 VSCode: 1.81.1 OS: Windows 10 22H2 19045.3324
Example
./main.odin
./food/food.odin