-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfimplicit member expressionsFeature → expressions: Implicit member expressionsFeature → expressions: Implicit member expressionstype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis
Description
We don't currently allow parens in the middle of an unresolved member chain:
struct S {
static var foo: S { S() }
var bar: S { S() }
}
let _: S = (.foo) // works
let _: S = .foo.bar // works
let _: S = (.foo).bar // error: cannot infer contextual base in reference to member 'foo'
However it's not clear this was an intentional design choice, as written there would be no other way to infer the base of .foo
. We ought to consider lifting this restriction.
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfimplicit member expressionsFeature → expressions: Implicit member expressionsFeature → expressions: Implicit member expressionstype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis