mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
Compare commits
5 commits
84f68168ed
...
71d2e3f556
Author | SHA1 | Date | |
---|---|---|---|
![]() |
71d2e3f556 | ||
![]() |
619bd968be | ||
![]() |
2c392f848b | ||
![]() |
9158aed80a | ||
![]() |
19ca0d0346 |
5 changed files with 61 additions and 22 deletions
15
.github/workflows/disable_azure_mirror.sh
vendored
15
.github/workflows/disable_azure_mirror.sh
vendored
|
@ -1,10 +1,11 @@
|
|||
#!/bin/bash
|
||||
echo "APT MIRRORS BEFORE:"
|
||||
cat /etc/apt/apt-mirrors.txt
|
||||
sudo sed -i 's@http://azure.archive.ubuntu.com@https://us.archive.ubuntu.com@gm' /etc/apt/apt-mirrors.txt
|
||||
echo "APT MIRRORS AFTER:"
|
||||
cat /etc/apt/apt-mirrors.txt
|
||||
echo "APT MIRRORS BEFORE:"; cat /etc/apt/apt-mirrors.txt
|
||||
sudo sed -i 's@http://azure.archive.ubuntu.com@http://archive.ubuntu.com@gm' /etc/apt/apt-mirrors.txt
|
||||
echo "APT MIRRORS AFTER:"; cat /etc/apt/apt-mirrors.txt
|
||||
|
||||
echo "ls -la /etc/apt/sources.list.d/"
|
||||
ls -la /etc/apt/sources.list.d/
|
||||
echo "ls -la /etc/apt/sources.list.d/"; ls -la /etc/apt/sources.list.d/
|
||||
for f in /etc/apt/sources.list.d/*; do echo "####### $f ######"; cat $f; done
|
||||
|
||||
echo "APT SOURCES BEFORE:"; echo "ls -la /etc/apt/sources.list"; ls -la /etc/apt/sources.list; cat /etc/apt/sources.list
|
||||
sudo sed -i 's@http://azure.archive.ubuntu.com@http://archive.ubuntu.com@gm' /etc/apt/sources.list
|
||||
echo "APT SOURCES AFTER:"; echo "ls -la /etc/apt/sources.list"; ls -la /etc/apt/sources.list; cat /etc/apt/sources.list
|
||||
|
|
32
.github/workflows/puzzle_vibes_ci.yml
vendored
32
.github/workflows/puzzle_vibes_ci.yml
vendored
|
@ -4,19 +4,23 @@ on:
|
|||
workflow_dispatch:
|
||||
push:
|
||||
paths:
|
||||
- 'vlib/**'
|
||||
- 'vlib/v/checker/**.v'
|
||||
- 'vlib/v/gen/c/**.v'
|
||||
- 'thirdparty/**'
|
||||
- 'cmd/tools/builders/**.v'
|
||||
- 'cmd/tools/vshader.v'
|
||||
- '**/puzzle_vibes_ci.yml'
|
||||
- '!**_test.v'
|
||||
- '!**.md'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'vlib/**'
|
||||
- 'vlib/v/checker/**'
|
||||
- 'vlib/v/gen/c/**'
|
||||
- 'thirdparty/**'
|
||||
- 'cmd/tools/builders/**.v'
|
||||
- 'cmd/tools/vshader.v'
|
||||
- '**/puzzle_vibes_ci.yml'
|
||||
- '!**_test.v'
|
||||
- '!**.md'
|
||||
|
||||
concurrency:
|
||||
|
@ -26,19 +30,17 @@ concurrency:
|
|||
jobs:
|
||||
v-compiles-puzzle-vibes:
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 30
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: awalsh128/cache-apt-pkgs-action@v1.5.3
|
||||
with:
|
||||
packages: libsdl2-dev libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev
|
||||
version: 1.0
|
||||
|
||||
- name: Build V
|
||||
run: make && ./v symlink
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
.github/workflows/disable_azure_mirror.sh
|
||||
v retry 'sudo apt update'
|
||||
v retry 'sudo apt install -y libsdl2-dev libsdl2-ttf-dev'
|
||||
v retry 'sudo apt install -y libsdl2-mixer-dev libsdl2-image-dev'
|
||||
|
||||
- name: Install & Setup SDL
|
||||
run: v retry -- v install sdl && v ~/.vmodules/sdl/setup.vsh
|
||||
|
||||
|
@ -48,14 +50,14 @@ jobs:
|
|||
- name: Clone Puzzle Vibes
|
||||
run: v retry -- git clone https://github.com/larpon/puzzle_vibes/
|
||||
|
||||
- name: Check PV compiles
|
||||
run: cd puzzle_vibes && v .
|
||||
|
||||
- name: Check PV compiles with -g
|
||||
run: cd puzzle_vibes && v -g .
|
||||
|
||||
- name: Check PV compiles
|
||||
run: cd puzzle_vibes && v .
|
||||
|
||||
- name: Check PV compiles with -prod
|
||||
run: cd puzzle_vibes && v -prod .
|
||||
run: cd puzzle_vibes && v -prod -no-prod-options .
|
||||
|
||||
- name: Check PV compiles with -prod and -g
|
||||
run: cd puzzle_vibes && v -prod -g .
|
||||
run: cd puzzle_vibes && v -prod -g -no-prod-options .
|
||||
|
|
|
@ -1685,6 +1685,16 @@ fn (mut c Checker) fn_call(mut node ast.CallExpr, mut continue_check &bool) ast.
|
|||
return ast.void_type
|
||||
}
|
||||
}
|
||||
if !func.is_variadic && func.params.len < (param_i + arg_typ_sym.info.types.len) {
|
||||
c.fn_call_error_have_want(
|
||||
nr_params: func.params.len
|
||||
nr_args: param_i + arg_typ_sym.info.types.len
|
||||
params: func.params
|
||||
args: node.args
|
||||
pos: node.pos
|
||||
)
|
||||
return ast.void_type
|
||||
}
|
||||
out: for n in 0 .. arg_typ_sym.info.types.len {
|
||||
curr_arg := arg_typs[n]
|
||||
multi_param := if func.is_variadic && i >= func.params.len - 1 {
|
||||
|
|
15
vlib/v/checker/tests/fn_call_arg_multi_err.out
Normal file
15
vlib/v/checker/tests/fn_call_arg_multi_err.out
Normal file
|
@ -0,0 +1,15 @@
|
|||
vlib/v/checker/tests/fn_call_arg_multi_err.vv:9:7: error: assignment mismatch: 1 variable but `a()` returns 2 values
|
||||
7 |
|
||||
8 | fn main() {
|
||||
9 | rets := a()
|
||||
| ~~
|
||||
10 | b(1, rets)
|
||||
11 | }
|
||||
vlib/v/checker/tests/fn_call_arg_multi_err.vv:10:2: error: expected 2 arguments, but got 3
|
||||
8 | fn main() {
|
||||
9 | rets := a()
|
||||
10 | b(1, rets)
|
||||
| ~~~~~~~~~~
|
||||
11 | }
|
||||
Details: have (int literal, (int, int))
|
||||
want (int, []int)
|
11
vlib/v/checker/tests/fn_call_arg_multi_err.vv
Normal file
11
vlib/v/checker/tests/fn_call_arg_multi_err.vv
Normal file
|
@ -0,0 +1,11 @@
|
|||
fn a() (int, int) {
|
||||
return 1, 1
|
||||
}
|
||||
|
||||
fn b(w int, arg []int) {
|
||||
}
|
||||
|
||||
fn main() {
|
||||
rets := a()
|
||||
b(1, rets)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue