-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Closed
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 itself
Description
| Previous ID | SR-2203 |
| Radar | None |
| Original Reporter | @harlanhaskins |
| Type | Bug |
| Status | Resolved |
| Resolution | Done |
Additional Detail from JIRA
| Votes | 0 |
| Component/s | Compiler |
| Labels | Bug |
| Assignee | @slavapestov |
| Priority | Medium |
md5: 43f8e5edd99fb3c2f4f93df15da91423
is duplicated by:
- SR-2329 self unavailable in closures to initialize lazy properties unless type specified
- SR-4356 Type Interface could not resolve lazy var without type annotation.
relates to:
- SR-4663 Bad diagnostic when missing explicit type in lazy property declaration
- SR-48 Create warning for missing self in lazy var initialization
Issue Description:
struct Foo {
let bar: Int
lazy var baz: Int = {
return /* self. */bar
}()
}Does not work unless I add a `self`before 'bar'
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 itself