Skip to content

[cxx-interop][regression] methods returning vector are unsafe unless vector instantiated prior in a type alias. #65446

Open
@hyp

Description

@hyp

After #64897 our safe/unsafe method detection logic has regressed .

For example, let's say we're returning a vector:

class SimplePOD {
public:
    int x;
};

class VecOwner {
public:
    std::vector<SimplePOD> getPODItems() const;
};

The module interface will mark the method as unsafe:

struct VecOwner {
  init()
  func __getPODItemsUnsafe() -> std.__1.vector<SimplePOD, allocator<SimplePOD>>
  @available(swift, obsoleted: 5, renamed: "__getPODItemsUnsafe()")
  func getPODItems() -> std.__1.vector<SimplePOD, allocator<SimplePOD>>
}

Metadata

Metadata

Assignees

Labels

bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.c++ interopFeature: Interoperability with C++swift 5.9

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions