diff --git a/src/Language/SystemVerilog/Parser/ParseDecl.hs b/src/Language/SystemVerilog/Parser/ParseDecl.hs index 23be5ea..f01d9d4 100644 --- a/src/Language/SystemVerilog/Parser/ParseDecl.hs +++ b/src/Language/SystemVerilog/Parser/ParseDecl.hs @@ -343,9 +343,13 @@ parseDTsAsComponents tokens = parseDTsAsComponent :: [DeclToken] -> (Position, Component, [DeclToken]) parseDTsAsComponent [] = error "parseDTsAsComponent unexpected end of tokens" parseDTsAsComponent l0 = - if l /= Nothing && l /= Just Automatic - then error $ "unexpected non-automatic lifetime: " ++ show l0 - else (position, component, l5) + if l /= Nothing && l /= Just Automatic then + error $ "unexpected non-automatic lifetime: " ++ show l0 + else if dir == Local && tf rs == Implicit Unspecified [] then + error $ "declaration(s) missing type information: " + ++ show (position, tps) + else + (position, component, l5) where (dir, l1) = takeDir l0 (l , l2) = takeLifetime l1 diff --git a/test/error/dangling_stmt.sv b/test/error/dangling_stmt.sv new file mode 100644 index 0000000..1bc6515 --- /dev/null +++ b/test/error/dangling_stmt.sv @@ -0,0 +1,4 @@ +module top; + logic y; + y = 1; +endmodule diff --git a/test/error/run.sh b/test/error/run.sh index e9866f1..0cca832 100755 --- a/test/error/run.sh +++ b/test/error/run.sh @@ -9,6 +9,7 @@ addTest() { suite_addTest test_$test } +source ../lib/functions.sh source ../lib/discover.sh . shunit2