opendylan icon indicating copy to clipboard operation
opendylan copied to clipboard

Warn about unused results when no side-effects

Open cgay opened this issue 7 years ago • 0 comments

Module: my-app

define function main
    (name :: <string>, arguments :: <vector>)
  local method usage()
          format-out("foo\n");
        end;
  arguments.size = 1 | usage;
  format-out("Hello, world!\n");
end;
 
main(application-name(), application-arguments());

Above I should've written usage() rather than usage. The compiler should warn in this situation because there's no point in returning usage as a value in that context.

cgay avatar Oct 27 '18 20:10 cgay