line numbers in Playgrounds Xcode 9.1

What's happening with line numbers in the playgrounds in XCode 9.1. Is it a bug or new feature?


As I type lines into a new playground, I see the line numbers. When the code executes, the line numbers for valid statements disappear. I took screen captures, but don't know how to attach them here.

Replies

I took screen captures, but don't know how to attach them here.

I’d be interesting in seeing them. My recommendation is that you upload them to an image hosting site and then post the URL. That’ll require moderator approval, but I can take care of that.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Here's a couple of shared images. One shows the code as it was typed. The other shows the line numbers went missing after the execution cycle ran.


https://www.dropbox.com/sh/63nvnku73e42jcp/AACmKwf87MSAuqDNgZydJwu1a?dl=0

Wow, that’s weird. And I tried this myself and I see exactly the same problem. It seems that any line with a result displayed on the right loses its line number on the left. That’s both wacky and annoying )-:

I think we have a bug on file about this already (r. 34626324) but it wouldn’t hurt for you to file your own, just to be sure.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Done. 35460467


Thank you for confirming reproduciblility.

In 9.2 the number does not completely disappear : if you select the line you see it is white (in fact background color) on pale blue outline.


In addition, not all lines disappear ; in a func like this (Quinn, that should tell you something) :

func combinations<Elements, Element>(
    ofLength length: Int,
    elements: Elements
    ) -> AnySequence<[Element]> where Elements : Collection, Elements.Element == Element {
    if length == 0 {
        return AnySequence(CollectionOfOne([]))
    }
    let prefixes = combinations(ofLength: length - 1, elements: elements)
    return AnySequence(prefixes.lazy.flatMap { (prefix) in
        elements.lazy.map { (element) in
            // Uncomment this to check that everything is happening lazily.
            // print("tick")
            return prefix + [element]
        }
    })
}


lines 6, 8, 9, 10 13 only disappear ; but first level lines still have their line numbers visible

I'm happy that I'm not alone anymore, did you install XCode from the App Store? It happened when I did that. Before that, I was running 9.0 which I downloaded from the developer sites.

did you install XCode from the App Store?

I don’t believe this problem is dependent on where you get Xcode from. I reproduced it and I always install Xcode from the developer web site.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

OK, good to know. 9.1 and 9.2 had the bug when downloaded from the App Store, 9.0 from the developer site doesn't have it. When I go to that site now, it forwards me to the App Store for 9.2 though, so I can't update right now.


I'm considering rebuilding my whole system from scratch, maybe it's something in the library...