Can't compile import @testable etc

(Dylan Nicholson) #21 (1.7 KB) (448.1 KB)
MyLibrary.bugreport.txt (5.0 KB)

It looks like it’s quite often crashing when you’re still editing code that isn’t syntactically correct - e.g. your snippet is from a version of the file where I was still editing it and the { was after the // instead of before.

Looking at some of the other txt files that show stack traces along with the current code it’s parsing show similar things.

But TBH while annoying (and obviously something you’d want to fix), that’s not the main issue as I don’t typically edit code in Fire (I use Xcode). It’s failures to compile syntactically correct code that compiles fine in Xcode and in Fire that are the main concern.

(Dylan Nicholson) #22

Fire is definitely telling me I have the latest version (, but

a) new solution command doesn’t work
b) still get all the above compile errors with: (3.5 KB)

In Fire 9.3 the same code compiles with the expected error “unknown type” for the line “extension FooBar”
(also, 9.3 is telling me an update is available, but I can’t see how to download it - only v10)

(marc hoffman) #23

can you try with 2319?

(Dylan Nicholson) #24

How do I get hold of it?

(Dylan Nicholson) #25

Never mind, 2321 now available, trying that

(Dylan Nicholson) #26

Kept getting errors trying to download that, now just get “forbidden”

(Dylan Nicholson) #27

Ok finally was able to download and install.
All the same errors occur (including New Solution doing nothing) except that [weak] inside an #if iOS block is now shown as just a warning in the IDE (even though it’s an error in the build log).

(marc hoffman) #28

Having a look at the compile issues now…

File|New Solution is fine for me here. Do you see any messages in Console? I take it literally nothing happens, you don’t even get a “Save” sheet?

(RemObjects) #29

Thanks, logged as bugs://80902

(marc hoffman) #30

I see two issues that seem valid bugs, this one:

	[weak m] in // E1 closing bracket expected, got closing block
				// E1 closing block expected, got identifier

(I though we recently added support for this syntax, but I guess not yet; if not, that’s already on the list somewhere). And this one:

infix operator =>: Subscribe // E477 Declaration expected
							 // E1 #endif expected, got :
							 // E287 Syntax error

I guess our operator rules are just too strict, we’ll fix.

Not entirely are about this one though, that seems as designed?

let array = [Dictionary<String, AnyObject>]()
let bar = array.flatMap({ $0["foo"] as? String }) // E575 Cannot assign wrapped nullable to not nullable type (String)

your dictionary is defined as non-nullable String. yet you pass a “wrapped” potentially-null string, so the error is correct, no?

(Carlo Kok) #31

the recursive error should be Unknown type, it’s an extension and the type it extends doesn’t exist.

[weak self] should be good now.

the operator decl is logged as bugs://75872: Swift 3.0: (SE-0077) Improved operator declarations

(Existing issue)

I’m closing 80902 as all issues are fixed except for 75872 which i’ll handle separately.

(RemObjects) #32

bugs://80902 got closed with status fixed.

(Dylan Nicholson) #33

$0["foo"] will be of type AnyObject - which may or may not be a String. This code compiles and works as expected with Fire 9.

(Dylan Nicholson) #34

No messages in Console, no UI response at all.

(marc hoffman) #35

Thats not the problem. the problem, as I understand it, is that as? String will produce a nullable string (ie String?, but the call expects a non-nullable (String)…

(Dylan Nicholson) #36

What call expects a non-nullable string? flatMap should be able to work with a closure that returns anything. But like I said, this code compiles and works fine with Xcode and with Fire 9.

(Dylan Nicholson) #40

So will it be worth retesting all this with the build at the end of this week?

(marc hoffman) #41

the array.flatMap issue we still need to look into; I’ll check with Carlo because TBH I don’t quite understand whats happening there and what the error refers to. The rest should be fixed for 2325, iirc, yes.