# @spec reports false error

**URL:** <https://forum.elixirforum.com/t/spec-reports-false-error/49472>\
**Category:** Questions\
**Tags:** dialyzer, typespecs, spec\
**Created:** [August 10, 2022, 3:19pm UTC](https://forum.elixirforum.com/t/spec-reports-false-error/49472 "2022-08-10T15:19:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bodhilogic](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/bodhilogic/32/10652_2.png) [@bodhilogic](https://forum.elixirforum.com/u/bodhilogic)\
**Post date:** [August 10, 2022, 3:19pm UTC](https://forum.elixirforum.com/t/spec-reports-false-error/49472/1 "2022-08-10T15:19:19Z")

</div>

I’m trying to define a @spec that looks like this:

```elixir
@type sql() :: String.t()
@spec query() :: sql()

```

The function takes no parameters and returns a string representing the SQL code that will be run in a database query.

When I start the phx.server, I am getting this error:

```elixir
== Compilation error in file lib/mim_core/stuff.ex ==
** (CompileError) lib/mim_core/stuff.ex:108: misplaced operator ::/2

The :: operator is typically used in bitstrings to specify types and sizes of segments:

    <<size::32-integer, letter::utf8, rest::binary>>

It is also used in typespecs, such as @type and @spec, to describe inputs and outputs
    (elixir 1.13.4) expanding macro: Kernel.@/1

```

It knows that the :: can be found in a @spec though it doesn’t let my spec’s return typespec get past the error.

Is there a way to define the @spec so that it doesn’t generate a “misplaced operator ::/2” error?

---

<div class="post-metadata">

**Author:** ![bodhilogic](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/bodhilogic/32/10652_2.png) [@bodhilogic](https://forum.elixirforum.com/u/bodhilogic)\
**Post date:** [August 10, 2022, 3:23pm UTC](https://forum.elixirforum.com/t/spec-reports-false-error/49472/2 "2022-08-10T15:23:29Z")

</div>

Nevermind - sorry good friends… I had a typo in my code ☹
