|
|
| Previous ID |
SR-5324 |
| Radar |
rdar://problem/33015870 |
| Original Reporter |
@jckarter |
| Type |
Improvement |
| Status |
Resolved |
| Resolution |
Done |
Additional Detail from JIRA
|
|
| Votes |
0 |
| Component/s |
Compiler |
| Labels |
Improvement, DiagnosticsQoI, StarterBug |
| Assignee |
kacperh (JIRA) |
| Priority |
Medium |
md5: 89ed2369cd8bd72c149a19b747b77277
Issue Description:
If you attempt something like this:
struct Outer {
var outer: Int
struct Inner {
var inner: Int
func sum() -> Int {
return inner + outer
}
}
}
then you get a somewhat confusing error message:
foo.swift:8:22: error: instance member 'outer' cannot be used on type 'Outer'
return inner + outer
^~~~~
since the member isn't really being used on the outer type, but on an instance of the inner type. A specialized diagnostic that said "instance member 'outer' of type 'Outer' cannot be accessed on instance of nested type 'Outer.Inner'" would be easier to understand.

Additional Detail from JIRA
md5: 89ed2369cd8bd72c149a19b747b77277
Issue Description:
If you attempt something like this:
then you get a somewhat confusing error message:
since the member isn't really being used on the outer type, but on an instance of the inner type. A specialized diagnostic that said "instance member 'outer' of type 'Outer' cannot be accessed on instance of nested type 'Outer.Inner'" would be easier to understand.