diff options
Diffstat (limited to 'test/diagnostics/redundant-return.lua')
-rw-r--r-- | test/diagnostics/redundant-return.lua | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/diagnostics/redundant-return.lua b/test/diagnostics/redundant-return.lua new file mode 100644 index 00000000..11214aab --- /dev/null +++ b/test/diagnostics/redundant-return.lua @@ -0,0 +1,34 @@ +TEST [[ +local function f() + <!return!> +end +f() +]] + +TEST [[ +local function f() + return nil +end +f() +]] + +TEST [[ +local function f() + local function x() + <!return!> + end + x() + return true +end +f() +]] + +TEST [[ +local function f() + local function x() + return true + end + return x() +end +f() +]] |