File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ // RUN: %empty-directory(%t)
2+ // RUN: split-file %s %t
3+ // RUN: %target-swift-frontend -emit-module -o %t %t/LibCore.swift -public-module-name Lib
4+ // RUN: %target-swift-frontend -emit-module -I %t -o %t %t/Lib.swift
5+ // RUN: %target-swift-frontend -typecheck -primary-file %t/main.swift %t/other.swift -I %t -verify -swift-version 5 -enable-upcoming-feature MemberImportVisibility
6+ 
7+ // REQUIRES: swift_feature_MemberImportVisibility
8+ 
9+ //--- main.swift
10+ 
11+ import  Swift
12+ // expected-note {{add import of module 'Lib'}}
13+ 
14+ func  foo( _ x:  Int )  ->  Int  { 
15+   x. bar // expected-error {{property 'bar' is not available due to missing import of defining module 'Lib'}}
16+ } 
17+ 
18+ //--- other.swift
19+ 
20+ import  Lib
21+ 
22+ //--- Lib.swift
23+ 
24+ @_exported   import  LibCore
25+ 
26+ //--- LibCore.swift
27+ 
28+ extension  Int  { 
29+   public  var  bar :  Int  { 
30+     return  self  <  0  ?  - self  :  self 
31+   } 
32+ } 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments