Skip to content

Conversation

@madsodgaard
Copy link
Contributor

Adds support for importing nested types such as below. They are imported as nested static classes on the Java side.

public class A {                                                                                                                           
  public init() {}                                                                                                                         
                                                                                                                                           
  public class B {                                                                                                                         
    public init() {}                                                                                                                       
                                                                                                                                           
    public struct C {                                                                                                                      
      public init() {}                                                                                                                     
                                                                                                                                           
      public func g(a: A, b: B, bbc: BB.C) {}                                                                                              
    }                                                                                                                                      
  }                                                                                                                                        
                                                                                                                                           
  public class BB {                                                                                                                        
    public init() {}                                                                                                                       
                                                                                                                                           
    public struct C {                                                                                                                      
      public init() {}                                                                                                                     
    }                                                                                                                                      
  }                                                                                                                                        
                                                                                                                                           
  public func f(a: A, b: A.B, c: A.B.C, bb: BB, bbc: BB.C) {}                                                                              
}                                                                                                                                          
                                                                                                                                           
public enum NestedEnum {                                                                                                                   
  case one(OneStruct)                                                                                                                      
                                                                                                                                           
  public struct OneStruct {                                                                                                                
    public init() {}                                                                                                                       
  }                                                                                                                                        
}                                                                                                                                          

Copy link
Collaborator

@ktoso ktoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nitpick then LGTM, I wonder if you could give the FFM version of that a shot? Should be basically the same hmm

@ktoso ktoso merged commit cafcc1d into swiftlang:main Nov 7, 2025
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants