Skip to content

Commit

Permalink
fix test and check
Browse files Browse the repository at this point in the history
  • Loading branch information
Delta456 committed Oct 1, 2024
1 parent 915ab53 commit 7325d4f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
3 changes: 2 additions & 1 deletion vlib/v/checker/checker.v
Original file line number Diff line number Diff line change
Expand Up @@ -3193,7 +3193,8 @@ fn (mut c Checker) cast_expr(mut node ast.CastExpr) ast.Type {

type_str := c.table.type_to_str(to_type)
type_rm_ptr := type_str.replace('&', '')
if type_rm_ptr.len == 1 && type_rm_ptr.starts_with_capital() {
if type_rm_ptr.len == 1 && type_rm_ptr.starts_with_capital()
&& !c.expected_type.has_flag(.generic) {
c.error('unknown type `${to_sym.name}`', node.pos)
}

Expand Down
12 changes: 0 additions & 12 deletions vlib/v/checker/tests/globals/cast_expr_T_type_err.vv
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,3 @@ __global (
fn main() {

}

module main

__global (
fo = A(0)
fo1 = &A(0)
)

fn main() {

}

0 comments on commit 7325d4f

Please sign in to comment.