Giter Club home page Giter Club logo

Comments (5)

swift-ci avatar swift-ci commented on July 2, 2024

Comment by Matthias M. Schneider (JIRA)

If you rename Point to, for example, Pnt then the stuct will be evaluated correctly and printed without producing the error.

from llvm-project.

swift-ci avatar swift-ci commented on July 2, 2024

Comment by Enrico Granata (JIRA)

Hi,
I am one of the engineers that work on the Swift REPL

I can reproduce the issue you're presenting and it is an issue with the LLDB data formatters subsystem

We have a set of builtin data formatters that help us pretty print different data types (for instance, the elements in a Swift array, or the contents of an NSString, ...)
One of those data formatters is for a type named 'Point' that comes from some old Mac OS X framework
It is defined thusly: `(v=${var.v}, h=${var.h})`
In the LLDB formatters syntax, this means that your point shall be printed as the string "(v=" followed by the value of the member "v" of your Point variable, the string ", h=" the value of your Point variable's "h" member, and then a closed parenthesis

In your example, the Point type you defined has neither a ".v" nor a ".h" member, so the LLDB formatter gets confused, and emits a print error instead of just falling back to normal printing

The workaround is to - before defining your Point structure - type at the REPL prompt:

:type summary delete -l objc Point

I can see a few ways to improve this experience here, and I am going to hold on to this issue so that I can actively track these possible avenues

Thanks for your report!

from llvm-project.

swift-ci avatar swift-ci commented on July 2, 2024

Comment by Matthias M. Schneider (JIRA)

Hi Enrico,

thanks for looking into this and the workaround. I would never have thought along those lines given that a newly started REPL session explicitly tells me that Point is an "unresolved identifier" and as such I was happily playing along with the struct using this name. 😉

Your explanation is clear to me and I hope you and the team can fix this issue in the near future.

Cheers,

Mati

from llvm-project.

swift-ci avatar swift-ci commented on July 2, 2024

Comment by Matthias M. Schneider (JIRA)

The issue seems to be solved in snapshot 2016-01-11-a on Ubuntu 15.10.

from llvm-project.

swift-ci avatar swift-ci commented on July 2, 2024

Comment by Matthias M. Schneider (JIRA)

The issue seems to be fixed in current builds of Swift 2.2 and Swift 3.0.

from llvm-project.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.