A variable still can be reference when it switch to private

You can reproduce this bug on UE4.6.

1.New a variable and set to be public.

23962-1.jpg

2.Compile.

3.Use it in another blueprint(A).

23961-2.jpg

4.Compile.

5.Set the variable to be private.

23963-3.jpg

6.Compile.

7.Compile the blueprint(A).

Is this a bug or not?

Sometime I don`t want a variable to be public for other classes, so I switch the variable to private.

But I forget it is used for another blueprints.

I would like the compiler needs to show an error when I compile blueprints(A).

Hello ZenTechEntertainment,

This is currently a known issue when using functions with access specifier private still being able to be called and referenced in other Blueprints. The bug report is logged under UE-4160. There are plans currently to switch back to making the variables created public by default. This should address your issue to keeping the variables you created with the private tag, exclusive to those specific blueprints.

Thank you for your report as this helps us improve the Engine and its features. We appreciate your patience with the issue as well, and ask that you look for the upcoming release notes as for a fix to this issue.

Thank you,