GridTools / gt4py

Python library for generating high-performance implementations of stencil kernels for weather and climate modeling from a domain-specific language (DSL).
https://GridTools.github.io/gt4py
BSD 3-Clause "New" or "Revised" License
111 stars 49 forks source link

next: problem parsing if stmt #1606

Open havogt opened 2 months ago

havogt commented 2 months ago

The following code fails, but looks legal

    def foo(a: bool, b: gtx.Field[[TDim], float64], c: gtx.Field[[TDim], float64]):
        res = b
        if a:
            return b
        else:
            res = c
        return res

with

gt4py.next.errors.exceptions.DSLError: Undeclared symbol 'resᐞ1'. in

src/gt4py/next/ffront/foast_passes/type_deduction.py:354: DSLError