diff --git a/.github/workflows/ci_packages.yml b/.github/workflows/ci_packages.yml index 51ed2773b2..6cef86c28a 100644 --- a/.github/workflows/ci_packages.yml +++ b/.github/workflows/ci_packages.yml @@ -37,10 +37,10 @@ jobs: with: fetch-depth: 2 - - name: 'Install node.js 20.x' - uses: actions/setup-node@v4 + - name: 'Install node.js' + uses: actions/setup-node@v6 with: - node-version: '20.x' + node-version: 24 - name: 'Install dependencies (Linux amd64)' if: runner.os == 'Linux' && matrix.cpu == 'amd64' diff --git a/.github/workflows/ci_publish.yml b/.github/workflows/ci_publish.yml index d38a10d364..44cfaf8213 100644 --- a/.github/workflows/ci_publish.yml +++ b/.github/workflows/ci_publish.yml @@ -22,9 +22,9 @@ jobs: fetch-depth: 2 - name: 'Install node.js' - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: - node-version: '' + node-version: 24 - name: 'Install dependencies (Linux amd64)' if: runner.os == 'Linux' && matrix.cpu == 'amd64' diff --git a/compiler/sempass2.nim b/compiler/sempass2.nim index c1279f3754..91ade858e9 100644 --- a/compiler/sempass2.nim +++ b/compiler/sempass2.nim @@ -1550,6 +1550,7 @@ proc track(tracked: PEffects, n: PNode) = # Check for implicit range conversions if n.kind == nkHiddenStdConv and (not tracked.isArrayIndexing) and + n[1].kind notin {nkCharLit..nkUInt64Lit, nkFloatLit..nkFloat128Lit} and shouldWarnRangeConversion(tracked.config, n.info, n.typ, n[1].typ): message(tracked.config, n.info, warnImplicitRangeConversion, typeToString(n[1].typ) & " -> " & typeToString(n.typ)) diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 94435886a9..da7576ca4a 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -1203,7 +1203,15 @@ proc addImplicitGeneric(c: PContext; typeClass: PType, typId: PIdent; # is this a bindOnce type class already present in the param list? for i in 0.. Natural" -""" - - -proc foo(x: Natural) = - discard - -foo(12) \ No newline at end of file diff --git a/tests/range/timplicitrangedownsizing3.nim b/tests/range/timplicitrangedownsizing3.nim new file mode 100644 index 0000000000..7796a207b7 --- /dev/null +++ b/tests/range/timplicitrangedownsizing3.nim @@ -0,0 +1,14 @@ +discard """ + matrix: "--warning:systemRangeConversion --warningaserror:systemRangeConversion" +""" + +proc foo(x: range[0..100]) = discard + +foo(12) + +type + Float = range[0.0..100.0] + +proc bar(x: Float) = discard + +bar(12.0) \ No newline at end of file diff --git a/tests/vm/t21281.nim b/tests/vm/t21281.nim new file mode 100644 index 0000000000..7c7ffbb3b9 --- /dev/null +++ b/tests/vm/t21281.nim @@ -0,0 +1,13 @@ +discard """ + nimout: ''' +3 +3 +''' +""" + +proc f(x: static[auto]) = # doesn't work + static: echo x +proc g[T](x: static[T]) = # works + static: echo x +f(3) +g(3) \ No newline at end of file