diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f35cdd7f..27ed2da9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,7 @@ jobs: - uses: roc-lang/setup-roc@cbe782d6f165b89c87d99f50a59ac4f5f73b4427 # ratchet:roc-lang/setup-roc@v0.3.0 with: version: nightly-new-compiler - nightly-tag: nightly-2026-08-23-fb208ba + nightly-tag: nightly-2026-08-30-34e7489 - name: Install Rust toolchain run: | rustup toolchain install "${{ needs.rust-version.outputs.version }}" --profile minimal --target x86_64-unknown-linux-musl --component llvm-tools-preview @@ -58,7 +58,7 @@ jobs: - uses: roc-lang/setup-roc@cbe782d6f165b89c87d99f50a59ac4f5f73b4427 # ratchet:roc-lang/setup-roc@v0.3.0 with: version: nightly-new-compiler - nightly-tag: nightly-2026-08-23-fb208ba + nightly-tag: nightly-2026-08-30-34e7489 - name: Install Rust toolchain shell: bash run: | @@ -103,7 +103,7 @@ jobs: - uses: roc-lang/setup-roc@cbe782d6f165b89c87d99f50a59ac4f5f73b4427 # ratchet:roc-lang/setup-roc@v0.3.0 with: version: nightly-new-compiler - nightly-tag: nightly-2026-08-23-fb208ba + nightly-tag: nightly-2026-08-30-34e7489 - name: Install Rust toolchain shell: bash run: | diff --git a/platform/Sqlite.roc b/platform/Sqlite.roc index 4488986d..064edf8d 100644 --- a/platform/Sqlite.roc +++ b/platform/Sqlite.roc @@ -395,7 +395,7 @@ decode_rows! = |stmt, gen_decode| { } lookup_value! = |cols, stmt, name| - match cols.find_first_index(|x| x == name) { + match List.find_first_index(cols, |x| x == name) { Ok(index) => sqlite_column_value!(stmt, index) Err(NotFound) => Err(NoSuchField(name)) } @@ -499,3 +499,20 @@ code_from_i64 = |code| 101 => Done other => Unknown(other) } + +## A row decoder written the way an application writes one. +## The compiler has to settle its type right here, before `query_many!` +## ever gets to say what `cols` is. Each call infers the type of `cols` separately, +## and since roc-lang/roc#10984 these types are no longer resolved together. +## +## The test is successful if this snippet compiles. +expect { + _decode_row = |cols| + |stmt| { + id = Sqlite.i64("id")(cols)(stmt)? + task = Sqlite.str("task")(cols)(stmt)? + status = Sqlite.str("status")(cols)(stmt)? + Ok({ id, task, status }) + } + Bool.True +}