forked from ValeLang/Vale
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ValeLang#620 from Verdagon/regionsmerge15
Regions merge: Pulled coercing logic into higher typing phase
- Loading branch information
Showing
38 changed files
with
1,455 additions
and
1,306 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
2 changes: 2 additions & 0 deletions
2
Frontend/Builtins/src/dev/vale/resources/runtime_sized_array_capacity.vale
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,2 @@ | ||
extern("vale_runtime_sized_array_capacity") | ||
func capacity<M Mutability, E>(arr &[]<M>E) int; |
13 changes: 13 additions & 0 deletions
13
Frontend/Builtins/src/dev/vale/resources/runtime_sized_array_mut_drop.vale
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,13 @@ | ||
|
||
func drop_into<E, F>(arr []<mut>E, consumer &F) void | ||
where func(&F, E)void | ||
{ | ||
while (arr.len() > 0) { | ||
consumer(arr.pop()); | ||
} | ||
[] = arr; | ||
} | ||
func drop<E>(arr []<mut>E) void | ||
where func drop(E)void { | ||
drop_into(arr, {_;}); | ||
} |
9 changes: 9 additions & 0 deletions
9
Frontend/Builtins/src/dev/vale/resources/static_sized_array_mut_drop.vale
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 @@ | ||
|
||
extern("vale_static_sized_array_drop_into") | ||
func drop_into<V Variability, S Int, E, F>(arr [#S]<mut, V>E, consumer &F) void | ||
where func(&F, E)void; | ||
|
||
func drop<V Variability, S Int, E>(arr [#S]<mut, V>E) void | ||
where func drop(E)void { | ||
drop_into(arr, {_;}); | ||
} |
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
Oops, something went wrong.