Zilliqa / scilla

Scilla - A Smart Contract Intermediate Level Language
https://scilla-lang.org
GNU General Public License v3.0
240 stars 78 forks source link

Disallow name shadowing within pattern binds #687

Open vaivaswatha opened 5 years ago

vaivaswatha commented 5 years ago

Scilla allows multiple binds of the same name within a pattern. This is an indicator of a bug and must be disallowed. OCaml disallows it as well.

transition t1(p : Pair (List Int32) Int32)
  match p with
  | Pair (Cons b c) b =>
    create_event b
  | _ =>
  end
end

I'm not sure if this should be considered backward incompatible.

anton-trunov commented 5 years ago

We should probably introduce a deprecation warning and remove this "feature" several releases later.

vaivaswatha commented 4 years ago

We should probably introduce a deprecation warning and remove this "feature" several releases later.

So we add the warning now? (in the current major version) @anton-trunov

anton-trunov commented 4 years ago

@vaivaswatha Sure, feel free :)