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

変な型の比較をコンパイルエラーにする #140

Open
kmyk opened this issue Aug 4, 2021 · 1 comment
Open

変な型の比較をコンパイルエラーにする #140

kmyk opened this issue Aug 4, 2021 · 1 comment

Comments

@kmyk
Copy link
Collaborator

kmyk commented Aug 4, 2021

現状だとたとえば以下のようなコードが書けてしまう。そして奥の方で分かりにくいエラーになるはず。これをちゃんと明示的に検出して分かりやすいエラーとして報告するようにしたい。

(lambda x: abs(x)) == (lambda y: y + 3)
(lambda x: abs(x)) < (lambda y: y + 3)
min(lambda x: abs(x)), (lambda y: y + 3))
@kmyk kmyk added the good first issue Good for newcomers label Aug 5, 2021
@kmyk
Copy link
Collaborator Author

kmyk commented Aug 5, 2021

src/Jikka/RestrictedPython/Convert/CheckInvalidComparison.hs みたいなのを新しく作り、Jikka.RestrictedPython.Language.UtilmapExprMmapSubExprM とを使ってそれぞれの Compare e1 (CmpOp' op t) e2t が変な型になってないか確認すればよい

@kmyk kmyk removed the good first issue Good for newcomers label Aug 5, 2021
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

No branches or pull requests

1 participant