       assert specs(bytecode) == callbacks(bytecode)
     end
 
-    test "@spec(spec)" do
+    test "@opaque" do
+      bytecode =
+        test_module do
+          @opaque my_type(x) :: x
+        end
+
+      assert [opaque: {:my_type, {:var, _, :x}, [{:var, _, :x}]}] = types(bytecode)
+    end
+
+    test "@spec" do
       bytecode =
         test_module do
           def my_fun1(x), do: x

      end
    end

    test "ill defined optional callback" do
      assert_raise CompileError, ~r"invalid optional callback :foo", fn ->
        test_module do
          @optional_callbacks :foo

               type
    end

    test "@spec with guards" do
      bytecode =
        test_module do
          def my_fun1(x), do: x
