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

go/types: Info.Types does not map ast.IfStmt.Cond #16422

Closed
ghost opened this issue Jul 19, 2016 · 2 comments
Closed

go/types: Info.Types does not map ast.IfStmt.Cond #16422

ghost opened this issue Jul 19, 2016 · 2 comments
Milestone

Comments

@ghost
Copy link

ghost commented Jul 19, 2016

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?
    go version go1.6.3 darwin/amd64
  2. What did you do?
    • Parse the AST for any program with any if statement
    • Walk the tree until you find an *ast.IfStmt node
    • Try to find the type of the expression via the types.Info struct you processed.
  3. What did you expect to see?
    An entry of type types.Basic with kind bool.
  4. What did you see instead?
    no entry in the map
  5. Extra
    This is quite obviously not necessary as the types.Type of any ast.IfStmt.Cond is obviously types.Basic (with kind bool) but this complicates at least one piece of my code.
@ianlancetaylor ianlancetaylor changed the title go/types Info.Types does not map ast.IfStmt.Cond go/types: Info.Types does not map ast.IfStmt.Cond Jul 19, 2016
@ianlancetaylor
Copy link
Contributor

Can you provide a complete standalone example (perhaps a program plus an input file) showing the problem you are describing? Code is much easier to understand than text. Thanks.

@ianlancetaylor ianlancetaylor added this to the Go1.8 milestone Jul 19, 2016
@ghost
Copy link
Author

ghost commented Jul 19, 2016

Ok turns out I can't reproduce the bug with a playground example (it compiles fine but the bug doesn't show up) I'll reopen the issue if I can find a isolated example where it didn't parse correctly.

@ghost ghost closed this as completed Jul 19, 2016
@ghost ghost reopened this Jul 19, 2016
@ghost ghost closed this as completed Jul 19, 2016
@golang golang locked and limited conversation to collaborators Jul 19, 2017
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants