Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/Basic/SourceLoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -797,11 +797,11 @@ static bool isBeforeInSource(
SourceLoc firstLocInLCA = firstMismatch == firstAncestors.end()
? firstLoc
: sourceMgr.getGeneratedSourceInfo(*firstMismatch)
->originalSourceRange.getStart();
->originalSourceRange.getEnd();
SourceLoc secondLocInLCA = secondMismatch == secondAncestors.end()
? secondLoc
: sourceMgr.getGeneratedSourceInfo(*secondMismatch)
->originalSourceRange.getStart();
->originalSourceRange.getEnd();
return sourceMgr.isBeforeInBuffer(firstLocInLCA, secondLocInLCA) ||
(allowEqual && firstLocInLCA == secondLocInLCA);
}
Expand Down
10 changes: 10 additions & 0 deletions test/stdlib/Observation/Observable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,16 @@ class RecursiveOuter {
class GuardedAvailability {
}

@Observable class TestASTScopeLCA {
// Make sure ASTScope unqualified lookup can find local variables
// inside initial values with closures when accessor macros are
// involved.
var state : Bool = {
let value = true
return value
}()
}

@main
struct Validator {
@MainActor
Expand Down