GX2008: fragment free variable
A fragment uses a variable that is not one of its parameters.
Cause
A fragment uses a variable that is not one of its parameters. The generated fragment function can use its parameters and p only.
Example
package cart
props {
Total int
}
<div>
total := p.Total
tax := total / 10
<span #total(total int)>{total + tax}</span>
</div>gx check reports:
cart/Cart.gx:10:36: GX2008: undefined: taxFix
- Add the variable to the parameter list of the fragment.
- Or calculate the value in the fragment from its parameters.