-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix_c_struct_embedded
- Loading branch information
Showing
36 changed files
with
354 additions
and
136 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
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
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
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
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
This file was deleted.
Oops, something went wrong.
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,3 @@ | ||
vlib/v/checker/tests/alias_type_unkown.vv:1:15: error: unknown type `Bird` | ||
1 | type Pigeon = Bird | ||
| ~~~~ |
File renamed without changes.
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,34 @@ | ||
vlib/v/checker/tests/any_type_err.vv:3:16: error: cannot use type `any` here | ||
1 | // Any types should error, while parametrically polymorphic should not. | ||
2 | | ||
3 | type AnyType = any | ||
| ~~~ | ||
4 | type AnySumType = any | string | ||
5 | type AnyPolySumType = T | any | ||
vlib/v/checker/tests/any_type_err.vv:4:19: error: cannot use type `any` here | ||
2 | | ||
3 | type AnyType = any | ||
4 | type AnySumType = any | string | ||
| ~~~ | ||
5 | type AnyPolySumType = T | any | ||
6 | | ||
vlib/v/checker/tests/any_type_err.vv:5:27: error: cannot use type `any` here | ||
3 | type AnyType = any | ||
4 | type AnySumType = any | string | ||
5 | type AnyPolySumType = T | any | ||
| ~~~ | ||
6 | | ||
7 | type PolyType = T | ||
vlib/v/checker/tests/any_type_err.vv:11:6: error: cannot use type `any` here | ||
9 | | ||
10 | struct AnyStructField[T] { | ||
11 | foo any | ||
| ~~~ | ||
12 | bar T | ||
13 | } | ||
vlib/v/checker/tests/any_type_err.vv:16:7: error: cannot use type `any` here | ||
14 | | ||
15 | fn any_cast() { | ||
16 | _ := any('foo') | ||
| ~~~~~~~~~~ | ||
17 | } |
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,17 @@ | ||
// Any types should error, while parametrically polymorphic should not. | ||
|
||
type AnyType = any | ||
type AnySumType = any | string | ||
type AnyPolySumType = T | any | ||
|
||
type PolyType = T | ||
type PolySumType = T | string | ||
|
||
struct AnyStructField[T] { | ||
foo any | ||
bar T | ||
} | ||
|
||
fn any_cast() { | ||
_ := any('foo') | ||
} |
6 changes: 6 additions & 0 deletions
6
vlib/v/checker/tests/assign_ref_call_expr_with_ref_return_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,6 @@ | ||
vlib/v/checker/tests/assign_ref_call_expr_with_ref_return_err.vv:8:6: error: cannot take the address of foo() | ||
6 | } | ||
7 | | ||
8 | _ := &foo() | ||
| ^ | ||
9 | |
9 changes: 9 additions & 0 deletions
9
vlib/v/checker/tests/assign_ref_call_expr_with_ref_return_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,9 @@ | ||
@[heap] | ||
struct Foo {} | ||
|
||
fn foo() &Foo { | ||
return &Foo{} | ||
} | ||
|
||
_ := &foo() | ||
|
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
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,28 @@ | ||
vlib/v/checker/tests/type_exists_err.vv:3:1: error: cannot register alias `Foo`, another type with this name exists | ||
1 | struct Foo {} | ||
2 | | ||
3 | type Foo = Foo | ||
| ~~~~~~~~ | ||
4 | | ||
5 | type Foo = string | ||
vlib/v/checker/tests/type_exists_err.vv:5:1: error: cannot register alias `Foo`, another type with this name exists | ||
3 | type Foo = Foo | ||
4 | | ||
5 | type Foo = string | ||
| ~~~~~~~~ | ||
6 | | ||
7 | type Foo = int | string | ||
vlib/v/checker/tests/type_exists_err.vv:7:1: error: cannot register sum type `Foo`, another type with this name exists | ||
5 | type Foo = string | ||
6 | | ||
7 | type Foo = int | string | ||
| ~~~~~~~~ | ||
8 | | ||
9 | enum Foo { | ||
vlib/v/checker/tests/type_exists_err.vv:9:1: error: cannot register enum `Foo`, another type with this name exists | ||
7 | type Foo = int | string | ||
8 | | ||
9 | enum Foo { | ||
| ~~~~~~~~ | ||
10 | @none | ||
11 | } |
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,11 @@ | ||
struct Foo {} | ||
|
||
type Foo = Foo | ||
|
||
type Foo = string | ||
|
||
type Foo = int | string | ||
|
||
enum Foo { | ||
@none | ||
} |
Oops, something went wrong.