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

fix(cxx): Always add int64 suffix to int64 literals #205

Merged
merged 2 commits into from
Sep 1, 2021

Conversation

riantkb
Copy link
Contributor

@riantkb riantkb commented Sep 1, 2021

#202

Summary

  • int64 の定数リテラルに対し、その定数が int32 の範囲でも接尾辞 ll を付加するように変更した

Tests

@riantkb riantkb changed the title fix(cxx): Always add int64 suffix to literals fix(cxx): Always add int64 suffix to int64 literals Sep 1, 2021
Copy link
Collaborator

@kmyk kmyk left a comment

Choose a reason for hiding this comment

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

@riantkb ありがとう。コードの修正はよさそうです。しかし test/Jikka/CPlusPlus/FormatSpec.hs の単体テストが落ちてて merge できないのでこれも更新してほしい (バグを直すと落ちるようなテストで申し訳ない……)

Failures:

  test/Jikka/CPlusPlus/FormatSpec.hs:45:7: 
  1) Jikka.CPlusPlus.Format.run works
       expected: ["int64_t solve(int32_t n) {","    int64_t x = 0;","    for (int32_t i = 0; i < n; ++ i) {","        x += int64_t(i);","    }","    return x;","}"]
        but got: ["int64_t solve(int32_t n) {","    int64_t x = 0ll;","    for (int32_t i = 0; i < n; ++ i) {","        x += int64_t(i);","    }","    return x;","}"]

  To rerun use: --match "/Jikka.CPlusPlus.Format/run/works/"

  test/Jikka/CPlusPlus/FormatSpec.hs:75:7: 
  2) Jikka.CPlusPlus.Format, no unnecessary paren in index, works
       expected: ["int64_t solve(int32_t n, std::vector<int64_t> h) {","    int64_t x = 0;","    for (int32_t i = 2; i < n; ++ i) {","        x += h[i - 2];","    }","    return x;","}"]
        but got: ["int64_t solve(int32_t n, std::vector<int64_t> h) {","    int64_t x = 0ll;","    for (int32_t i = 2; i < n; ++ i) {","        x += h[i - 2];","    }","    return x;","}"]

  To rerun use: --match "/Jikka.CPlusPlus.Format/no unnecessary paren in index/works/"

@riantkb
Copy link
Contributor Author

riantkb commented Sep 1, 2021

修正しました 🙇🙇🙇

@kmyk kmyk merged commit a4bd873 into kmyk-jikka:master Sep 1, 2021
@kmyk
Copy link
Collaborator

kmyk commented Sep 1, 2021

ありがとう。merge しました

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