Compiler Error while using Validation in the hunt-framework

Roman Funk roman.funk66 at gmail.com
Wed Oct 19 19:00:25 UTC 2022


Hello,

I started playing with D and the hunt-framework. But I bumped 
into an error using Validation.

```d
module app.forms.LoginForm;
import hunt.validation;
import hunt.framework.http.Form;

class LoginForm : Form {
     mixin MakeForm;
     @Email
     string name;
     @Length(3,8)
     string password;
}

```
The error looks like that:

`../hunt/validation/DeclDef.d-mixin-41(54,108): Error: undefined 
identifier arg`

When I remove the parameters from `@Length`, it compiles.

I tried the `dicoth` example application, but I get the same 
error for the validation used there.

I use this compiler: DMD64 D Compiler v2.100.2
under Linux.

My current D knowledge is not sufficient to fix the bug. No idea 
how the annotation and mixin templates work together here. I 
didn't find any documentation, how to write custom annotations.

Can somebody give me a hint?

BR Roman


More information about the Digitalmars-d-learn mailing list