Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Bug: Protected members are exposed publicly #1317

Copy link
Copy link
@sylveon

Description

@sylveon
Issue body actions

Version

2.0.230524.4

Summary

If you declare a protected member on a WinRT class, the projection type will directly expose this protected member to all consumers, meaning it is trivial to accidentally do things you shouldn't.

Reproducible example

[default_interface]
runtimeclass Class
{
    Class();
    protected Int32 MyProperty;
}
Class a;
int b = a.MyProperty();

Expected behavior

A build error saying MyProperty doesn't exist or is protected

Actual behavior

It correctly builds and will actually call implementation::Class::MyProperty.

Additional comments

No response

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.