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

[Error] Shorten the length of traceback of TaichiCompilationError #3965

Merged
merged 3 commits into from
Jan 8, 2022

Conversation

lin-hitonami
Copy link
Contributor

Related issue = #3785

For the following program:

import taichi as ti
ti.init()

@ti.kernel
def foo():
    1 in 2

foo()

The traceback looks like this after this PR:

Traceback (most recent call last):
  File "/home/lin/tmp/./test.py", line 8, in <module>
    foo()
  File "/home/lin/taichi2/python/taichi/lang/kernel_impl.py", line 724, in wrapped
    raise type(e)('\n' + str(e)) from None
taichi.lang.exception.TaichiSyntaxError: 
On line 6 of file "/home/lin/tmp/./test.py":
    1 in 2
    ^^^^^^
"In" is only supported inside `ti.static`.

@netlify
Copy link

netlify bot commented Jan 7, 2022

✔️ Deploy Preview for jovial-fermat-aa59dc canceled.

🔨 Explore the source changes: ce2e1d8

🔍 Inspect the deploy log: https://app.netlify.com/sites/jovial-fermat-aa59dc/deploys/61d7ded0e2649800083b0187

Copy link
Contributor

@strongoier strongoier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@lin-hitonami lin-hitonami merged commit b53523c into taichi-dev:master Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants