Skip to content

Commit fbaa9ab

Browse files
author
David Ungar
committed
Added test.
1 parent 6a5c449 commit fbaa9ab

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Some types, such as StringLiteralType, used to be cached in the TypeChecker.
2+
// Consequently, the second primary file (in batch mode) to use that type would
3+
// hit in the cache and no dependency would be recorded.
4+
// This test ensures that this bug stays fixed.
5+
//
6+
// RUN: %empty-directory(%t)
7+
//
8+
// Create two identical inputs, each needing StringLiteralType:
9+
//
10+
// RUN: echo 'fileprivate var v: String { return "\(x)" }; fileprivate let x = "a"' >%t/1.swift
11+
// RUN: echo 'fileprivate var v: String { return "\(x)" }; fileprivate let x = "a"' >%t/2.swift
12+
//
13+
// RUN: %target-swift-frontend -typecheck -primary-file %t/1.swift -primary-file %t/2.swift -emit-reference-dependencies-path %t/1.swiftdeps -emit-reference-dependencies-path %t/2.swiftdeps
14+
//
15+
// RUN cmp -s %t/1.swiftdeps %t/2.swiftdeps

0 commit comments

Comments
 (0)