From 553193ef5a8d6ca9b9f38c41366500a275d02045 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Wed, 15 Jul 2020 16:10:58 -0500 Subject: [PATCH 1/2] Fix subscript integrality check to give a good error message if type inf fails --- loopy/check.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/loopy/check.py b/loopy/check.py index 4588a59b4..f98abf3e9 100644 --- a/loopy/check.py +++ b/loopy/check.py @@ -72,7 +72,13 @@ VALID_NOSYNC_SCOPES = frozenset(["local", "global", "any"]) class SubscriptIndicesIsIntChecker(TypeInferenceMapper): def map_subscript(self, expr): for idx in expr.index_tuple: - if not self.rec(idx)[0].is_integral(): + type_inf_result = self.rec(idx) + if not type_inf_result: + raise LoopyError( + "When checking that subscript indices are integral: " + "Type inference did not find type of '%s'" + % idx) + if not type_inf_result[0].is_integral(): raise LoopyError("Non-integral array indices obtained in" " {}.".format(expr)) -- GitLab From fe7fb25a00c38cbfd4c1cbf91b5d8ca4fd191838 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Wed, 15 Jul 2020 17:13:26 -0500 Subject: [PATCH 2/2] Tweak Github CI names --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c6226d79..fc86ce0e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: . ./prepare-and-run-pylint.sh loopy test/test_*.py pytest3: - name: Conda Pytest Py3 + name: Conda Pytest runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -49,7 +49,7 @@ jobs: . ./build-and-test-py-project-within-miniconda.sh pytest_twice: - name: Pytest twice (for cache behavior) on Py${{ matrix.python-version }} + name: Conda Pytest Twice (for cache behavior) runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 -- GitLab