Commits
Chris Lattner committed 8c258eee677
Fix <rdar://problem/19746552> QoI: variable "used before being initialized" instead of "returned uninitialized" in address-only enum/struct
Teach DI about a pattern in address-only struct/enum initializers, improving diagnostics
on code like:
struct S<T, U> {
let a : T?
let b : U?
init(a : T) {
self.a = a
}
}
enum E<T> {
case X(T), Y
init() {
}
}
from:
t.swift:7:5: error: variable 'self.b' used before being initialized
}
^
t.swift:14:3: error: variable 'self' used before being initialized
}
^
To:
t.swift:7:5: error: return from initializer without initializing all stored properties
}
^
t.swift:3:9: note: 'self.b' not initialized
let b : U?
^
t.swift:14:3: error: return from enum initializer method without storing to 'self'
}
^
Swift SVN r25528