Fileprivate not accepted for struct elements?

The following generates an error:

struct Foo {
	fileprivate let a: Int // Error: Declaration expected
}

Works for me, even though it SHOULD fail (and does for class):

struct Foo {
	fileprivate let a: Int 
}

class Foo2 {
	fileprivate let a: Int  // H8 Field "$p_a" defined in type "Foo2!" is never assigned
							// E512 Variable declared with "let" requires initialization
}

what platform are you on?

Thanks, logged as bugs://77040 (for it not failing on struct, and for the internal name showing in the message)

I’m on the following on Mac OS 10.12.1 (and it’s definitely failing with
struct for me)

which platform are you building for? macOS? iOS? Java/Android?

Also, 8.3 is long outdated. what about 9.0?

Apologies, Marc. I’ve been bouncing between several different machines and didn’t realize I hadn’t updated this one. It’s not a problem on 9.1. I’ll double check my other recently submitted issues.

1 Like

bugs://77040 got closed with status fixed.

Logged as bugs://i64808.

bugs://i64808 was closed as fixed.