Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
checker: add check for unknown generic types in type alias decl (#16377)
- Loading branch information
Showing
3 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
vlib/v/checker/tests/type_alias_struct_generic_unknown_name_err.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
vlib/v/checker/tests/type_alias_struct_generic_unknown_name_err.vv:7:16: error: unknown type `UnknownType` | ||
5 | } | ||
6 | | ||
7 | type NewType = Foo<UnknownType> | ||
| ~~~~~~~~~~~~~~~~ | ||
8 | | ||
9 | fn main() { |
10 changes: 10 additions & 0 deletions
10
vlib/v/checker/tests/type_alias_struct_generic_unknown_name_err.vv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module main | ||
|
||
struct Foo<T> { | ||
value T | ||
} | ||
|
||
type NewType = Foo<UnknownType> | ||
|
||
fn main() { | ||
} |