You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using explicit type signatures for closure arguments, it's possible to specify type signatures that aren't compatible with what is expected, yet the compiler doesn't catch this.
Please list the exact steps necessary to reproduce the bug
Create test.inko with these contents:
class Thing {
fn mut example(value: mut Array[Int]) {}
}
class async Main {
fn async main {
let a = [Thing()]
a.iter.each(fn (thing: mut Thing) { thing.example([]) })
}
}
When running inko check test.inko, a type error should be produced for the thing argument as the actual value is ref Thing (due to a.iter instead of a.iter_mut) and not mut Thing, yet the compiler considers this code to be valid.
Operating system
Fedora 40
Inko version
main
Rust version
1.70.0
The text was updated successfully, but these errors were encountered:
Please describe the bug
When using explicit type signatures for closure arguments, it's possible to specify type signatures that aren't compatible with what is expected, yet the compiler doesn't catch this.
Please list the exact steps necessary to reproduce the bug
Create
test.inko
with these contents:When running
inko check test.inko
, a type error should be produced for thething
argument as the actual value isref Thing
(due toa.iter
instead ofa.iter_mut
) and notmut Thing
, yet the compiler considers this code to be valid.Operating system
Fedora 40
Inko version
main
Rust version
1.70.0
The text was updated successfully, but these errors were encountered: