Skip to content

Commit 14ade93

Browse files
committed
Fix getActiveDependencySourceOrNull For Private Dependencies
Restore the behavior here of only looking at the topmost dependency source object that was lost when the referenced name tracker was removed. Oops.
1 parent ddaa3be commit 14ade93

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

include/swift/AST/EvaluatorDependencies.h

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,12 @@ struct DependencyRecorder {
298298
SourceFile *getActiveDependencySourceOrNull() const {
299299
if (dependencySources.empty())
300300
return nullptr;
301-
return dependencySources.back().getPointer();
301+
switch (mode) {
302+
case Mode::StatusQuo:
303+
return dependencySources.back().getPointer();
304+
case Mode::ExperimentalPrivateDependencies:
305+
return dependencySources.front().getPointer();
306+
}
302307
}
303308

304309
public:
@@ -331,14 +336,6 @@ struct DependencyRecorder {
331336
};
332337

333338
private:
334-
/// Returns the first dependency source registered with the tracker, or
335-
/// \c nullptr if no dependency sources have been registered.
336-
SourceFile *getFirstDependencySourceOrNull() const {
337-
if (dependencySources.empty())
338-
return nullptr;
339-
return dependencySources.front().getPointer();
340-
}
341-
342339
/// Returns \c true if the scope of the current active source cascades.
343340
///
344341
/// If there is no active scope, the result always cascades.

0 commit comments

Comments
 (0)