diff options
-rw-r--r-- | test/diagnostics/init.lua | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/diagnostics/init.lua b/test/diagnostics/init.lua index c526560a..ab55cd92 100644 --- a/test/diagnostics/init.lua +++ b/test/diagnostics/init.lua @@ -1311,6 +1311,43 @@ end local val = {} location('uri', val) ]] + +-- redundant-return +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() +]] + ---TODO(arthur) do return end |