Skip to content
Gx
GitHub

GX2000: type error in an expression

A Go expression in a .gx file has a type error.

Cause

A Go expression in a .gx file has a type error. The Go type checker gives the message.

Example

ui/card/Card.gx
package card

props {
  Count int
}

<p>{p.Count + "items"}</p>

gx check reports:

gx check
ui/card/Card.gx:7:5: GX2000: invalid operation: p.Count + "items" (mismatched types int and untyped string)

Fix

Correct the expression. The position is the line and column in the .gx file.