W0020: function shadows built-in prelude definition
Generated from rellum-diagnostics/src/db.rs.
Explanation
The core prelude defines higher-order functions like map, filter, and fold that are available in every Rellum program. Defining a function with the same name replaces the prelude definition within this module. The shadowing is harmless if intentional, but surprising if accidental.
Common causes
- defining a local
maporfilterwithout knowing the prelude provides one - defining a helper named
map_implthat collides with the prelude implementation
Canonical fixes
- rename your function to avoid the collision
Before:
map(arr: [Int], f: Int -> Int) : [Int] = ...
After:
transform(arr: [Int], f: Int -> Int) : [Int] = ...
Code example
map(arr: [Int], f: Int -> Int) : [Int] = ...