diff options
Diffstat (limited to 'pkg/compiler/testdata')
| -rw-r--r-- | pkg/compiler/testdata/all.txt | 20 | ||||
| -rw-r--r-- | pkg/compiler/testdata/errors.txt | 17 |
2 files changed, 37 insertions, 0 deletions
diff --git a/pkg/compiler/testdata/all.txt b/pkg/compiler/testdata/all.txt index 2bf76c28b..dd2a90ba3 100644 --- a/pkg/compiler/testdata/all.txt +++ b/pkg/compiler/testdata/all.txt @@ -133,6 +133,26 @@ struct0 { f2 int16 } +type templ_base0[TYPE, CONST] { + f1 TYPE + f2 const[CONST, int32] +} + +type templ_base1[TYPE, CONST] { + f2 const[CONST, int8] + f1 TYPE +} + +type templ_templ[BASE, CONST] { + f1 BASE[int8, CONST] + f2 BASE[int32, 0] +} + +templ_templ_use { + f1 templ_templ[templ_base0, 0] + f2 templ_templ[templ_base1, 1] +} + type templ_struct2[A] templ_struct0[A, int8] type templ_struct3 templ_struct2[C1] type templ_struct4 templ_struct3 diff --git a/pkg/compiler/testdata/errors.txt b/pkg/compiler/testdata/errors.txt index 2be2e65ad..f4c9cf69a 100644 --- a/pkg/compiler/testdata/errors.txt +++ b/pkg/compiler/testdata/errors.txt @@ -260,6 +260,23 @@ type templ_struct2[A] { f B ### unknown type B } +type templ_base0[TYPE] { + f1 TYPE +} + +type templ_templ0[BASE] { + f1 BASE +} + +type templ_templ1[BASE] { + f1 BASE[int16] ### both template parameter BASE and its usage have sub-arguments +} + +templ_templ_use0 { + f1 templ_templ0[templ_base0] ### template templ_base0 needs 1 arguments instead of 0 + f2 templ_templ1[templ_base0[int32]] +} + foo$200(a templ0[42, int8]) foo$202(a templ0) ### template templ0 needs 2 arguments instead of 0 foo$203(a type0[42]) ### type type0 is not a template |
