Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type check warning failed to locate the code who raising the warning #4250

Closed
erizmr opened this issue Feb 10, 2022 · 3 comments · Fixed by #4858
Closed

Type check warning failed to locate the code who raising the warning #4250

erizmr opened this issue Feb 10, 2022 · 3 comments · Fixed by #4858
Labels
potential bug Something that looks like a bug but not yet confirmed
Milestone

Comments

@erizmr
Copy link
Contributor

erizmr commented Feb 10, 2022

Describe the bug
Type check warning failed to locate the code who raising the warning.

To Reproduce

import taichi as ti

ti.init(debug=True)

x = ti.field(dtype=ti.i32, shape=())
y = ti.field(dtype=ti.f32, shape=())
@ti.kernel
def bug_gen():
    x[None] += ti.cast(1.3, ti.f64)
    y[None] += ti.cast(2.5, ti.f64)
bug_gen()

Log/Screenshots
image

@erizmr erizmr added the potential bug Something that looks like a bug but not yet confirmed label Feb 10, 2022
@strongoier
Copy link
Contributor

Warnings are not something thrown out, so our current try-catch mechanism for error reporting cannot work. Maybe we still have to pass source code information inside expressions & statements... wdyt @lin-hitonami

@lin-hitonami
Copy link
Contributor

Yes, but it seems that we are passing the traceback info to the Expr class in C++? https://github.com/taichi-dev/taichi/blob/master/python/taichi/lang/expr.py#L37

@strongoier
Copy link
Contributor

Yes the missing info can be fixed. However, even if it is fixed, the result info will be the traceback mostly inside the ASTTransformer instead of anything locating source code.

@strongoier strongoier moved this to Untriaged in Taichi Lang Apr 26, 2022
@strongoier strongoier moved this from Untriaged to In Progress in Taichi Lang Apr 26, 2022
@strongoier strongoier added this to the Taichi v1.0.1 milestone Apr 26, 2022
Repository owner moved this from In Progress to Done in Taichi Lang Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
potential bug Something that looks like a bug but not yet confirmed
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants