mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
We set an original expression on ErrorExpr for cases where we have something semantically invalid that doesn't fit into the AST, but is still something that the user has explicitly written. For example this is how we represent unresolved dots without member names (`x.`). We still want to type-check the underlying expression though since it can provide useful diagnostics and allows semantic functionality such as completion and cursor info to work correctly. rdar://130771574
11 lines
247 B
Swift
11 lines
247 B
Swift
struct S {
|
|
var x: Int
|
|
}
|
|
|
|
// Make sure we can still resolve 'x' even with the trailing dot.
|
|
func foo(_ s: S) {
|
|
s.x.
|
|
// RUN: %sourcekitd-test -req=cursor -pos=%(line-1):5 %s -- %s -module-name main | %FileCheck %s
|
|
}
|
|
// CHECK: s:4main1SV1xSivp
|