[Linter] Warn on pub let
for dictionaries, arrays, capabilities, and structs with publicly callable functions
#431
Labels
pub let
for dictionaries, arrays, capabilities, and structs with publicly callable functions
#431
Cadence's access control may surprise the unwary in several ways:
pub let
dictionaries and arrays can be mutated by anyone who can access them.pub let
Capabilities can be copied and this may be undesirable.pub let
struct member variables that expose any of the above, and/or have public functions, may surprise the unwary in any of these ways.The Cadence documentation does describe these scenarios, but they can be serious enough that it is probably worth catching them in the compiler and emitting a warning.
(I thought there was a ticket for this, but I cannot locate it. 😺)
The text was updated successfully, but these errors were encountered: