v0.13.7
errors and warnings / types

errors and warnings / types / E2013

E2013 error

Wrong number of type arguments

area
types (x2xxx)
fails the build
yes
in plain Lua files
reported as W2013

A generic type is given the wrong number of type arguments: Pair<A, B> written as Pair<number>. Give one argument per type parameter. Writing a generic type without any arguments is allowed (they are any), which the optional lint W2063 can report.

Example

× failswowlua
type Pair<A, B> = { first: A, second: B }local p: Pair<number> = { first = 1, second = 2 }print(p)
✓ compileswowlua
type Pair<A, B> = { first: A, second: B }local p: Pair<number, number> = { first = 1, second = 2 }print(p)

The compiler reports it like this:

error[E2013]: `Pair` takes 2 type arguments, but 1 were given
  ┌─ src/main.wowlua:2:10
  │
2 │ local p: Pair<number> = { first = 1, second = 2 }
  │          ^^^^^^^^^^^^ here
codemessage
E2002Unknown type name
E2014Type argument does not satisfy its constraint

Offline

terminal
$ wowlua explain E2013
E2013 (error): Wrong number of type arguments

source on GitHub ↗