aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBradley Lewis <22850972+BradLewis@users.noreply.github.com>2025-09-13 09:07:58 -0400
committerGitHub <noreply@github.com>2025-09-13 09:07:58 -0400
commit6c3e9087b0756115e8725cac0735b0c8e3130064 (patch)
tree0891b5bb42863988adb910803a0fca6ad48ce84d
parent76f8c1ffa873ac15287d28a3174d476f588e51b0 (diff)
parent5352e8935007f9890aeb5ef578c5c3f1b9739b2c (diff)
Merge pull request #1004 from BradLewis/fix/allow-untyped-int-use-float-types
Allow untyped ints to be mapped to floating point types
-rw-r--r--src/server/analysis.odin9
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