From 352d592d59051233948f75c31e889157f570f0f0 Mon Sep 17 00:00:00 2001 From: Kayleexx <105365766+Kayleexx@users.noreply.github.com> Date: Thu, 21 Sep 2023 17:02:03 +0530 Subject: [PATCH] just added some examples in breaking-changes.rst --- docs/050-breaking-changes.rst | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/docs/050-breaking-changes.rst b/docs/050-breaking-changes.rst index a40bbcf6e..4b51ae82a 100644 --- a/docs/050-breaking-changes.rst +++ b/docs/050-breaking-changes.rst @@ -232,8 +232,37 @@ Variables * Declaring empty structs is now disallowed for clarity. +**Before v0.5.0 (Valid):** + +```solidity +struct EmptyStruct {} // Allowed in older versions +``` +**v0.5.0 and Later (Disallowed):** + +```solidity +struct EmptyStruct {} // Disallowed +``` + + * The ``var`` keyword is now disallowed to favor explicitness. +**Before v0.5.0 (Valid):** + +```solidity +function example() { + var x = 42; // Allowed in older versions +} +``` + +**v0.5.0 and Later (Disallowed):** + +```solidity +function example() { + var x = 42; // Disallowed +} +``` + + * Assignments between tuples with different number of components is now disallowed.