Skip to content

Commit d886513

Browse files
committed
[Sema] add reproducer (NFC)
This test case compiled fine before da96079 and the subsequent #84828, but now errors. The next commit will revert those changes.
1 parent 827c30f commit d886513

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Regression test for rdar://164588082
2+
3+
// RUN: %empty-directory(%t)
4+
// RUN: split-file %s %t
5+
6+
// RUN: %target-swift-frontend -verify -verify-additional-file %t%{fs-sep}bar.h -typecheck %t/test.swift -I %t
7+
8+
//--- test.swift
9+
// expected-note@+1{{struct 'Baz' imported as 'private' from 'Bar' here}}
10+
private import Foo.Bar
11+
public import Foo
12+
13+
// expected-error@+2{{function cannot be declared public because its parameter uses a private type}}
14+
// expected-note@+1{{struct 'Baz' is imported by this file as 'private' from 'Bar'}}
15+
public func test(x: Baz) {}
16+
17+
//--- foo.h
18+
#pragma once
19+
#include "bar.h"
20+
21+
//--- bar.h
22+
#pragma once
23+
// expected-note@+1{{type declared here}}
24+
struct Baz {};
25+
26+
//--- module.modulemap
27+
module Foo {
28+
header "foo.h"
29+
export *
30+
31+
explicit module Bar {
32+
header "bar.h"
33+
export *
34+
}
35+
}

0 commit comments

Comments
 (0)