Uploaded image for project: 'CloverDX'
  1. CloverDX
  2. CLO-18168

Disallow variable shadowing

    XMLWordPrintable

    Details

      Description

      Extend the scope of variable declaration to the whole function (this puts CTL to sync with Java and allows seamless compilation of CTL to Java).

      https://en.wikipedia.org/wiki/Variable_shadowing

      Example:

      function integer transform() {
          integer b=10;
          for (integer c=10; c<100; c++) {
              integer b=20;
          }
      }
      

      Should lead to something like: Error: Line 4 column 5 - Line 12 column 16: Duplicate variable 'b’!

        Attachments

          Activity

            People

            Assignee:
            slamam Martin Slama
            Reporter:
            slamam Martin Slama
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day
                1d