diff options
| author | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-09-13 08:59:59 -0400 |
|---|---|---|
| committer | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-09-13 09:02:21 -0400 |
| commit | 5352e8935007f9890aeb5ef578c5c3f1b9739b2c (patch) | |
| tree | 0891b5bb42863988adb910803a0fca6ad48ce84d /src | |
| parent | 76f8c1ffa873ac15287d28a3174d476f588e51b0 (diff) | |
Allow untyped ints to be mapped to floating point types
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/analysis.odin | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin index 7538fe1..219ce3c 100644 --- a/src/server/analysis.odin +++ b/src/server/analysis.odin @@ -313,6 +313,15 @@ are_symbol_untyped_basic_same_typed :: proc(a, b: Symbol) -> (bool, bool) { return true, true } } + // Untyped ints are allowed to map to floats + if untyped.type == .Integer { + names := untyped_map[.Float] + for name in names { + if basic.ident.name == name { + return true, true + } + } + } return false, true } else if untyped_b, ok := b.value.(SymbolUntypedValue); ok { return untyped.type == untyped_b.type, true |