Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Sep 30, 2024
1 parent 04aba8f commit cd88b5c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion vlib/v/checker/checker.v
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ fn (mut c Checker) alias_type_decl(node ast.AliasTypeDecl) {
c.error('cannot make an alias of Result type', node.type_pos)
}
match parent_typ_sym.kind {
.placeholder, .int_literal, .float_literal {
.placeholder, .int_literal, .float_literal, .any {
c.error('unknown aliased type `${parent_typ_sym.name}`', node.type_pos)
}
.alias {
Expand Down
7 changes: 7 additions & 0 deletions vlib/v/checker/tests/alias_to_generic_err.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
vlib/v/checker/tests/alias_to_generic_err.vv:4:12: error: unknown aliased type `T`
2 | module main
3 |
4 | type Foo = T
| ^
5 |
6 | fn main() {
6 changes: 6 additions & 0 deletions vlib/v/checker/tests/alias_to_generic_err.vv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module main

type Foo = T

fn main() {
}

0 comments on commit cd88b5c

Please sign in to comment.