Skip to content
This repository has been archived by the owner on Mar 9, 2021. It is now read-only.

Reflection bug? #375

Open
n9 opened this issue Dec 27, 2014 · 4 comments
Open

Reflection bug? #375

n9 opened this issue Dec 27, 2014 · 4 comments
Labels

Comments

@n9
Copy link

n9 commented Dec 27, 2014

type.GetFields(BindingFlags.Public | BindingFlags.Instance) seems to return protected fields as well. Is it an intended behavior?

@n9
Copy link
Author

n9 commented Jan 7, 2015

C# code:

[DefaultMemberReflectability(MemberReflectability.PublicAndProtected)]
public class Foo
{
    protected string A;

    public static void Test()
    {
        Console.WriteLine(typeof(Foo).GetFields(BindingFlags.Instance | BindingFlags.Public).Length.ToString());
    }
}

Foo.Test in .NET outputs 0, but in Saltarelle 1.

(It seems to me that there is missing visibility information in ss.setMetadata call.)

@n9
Copy link
Author

n9 commented Jan 7, 2015

Workaround solution would be to have MemberReflectability.Public option.

@erik-kallen erik-kallen added the bug label Jan 7, 2015
@erik-kallen
Copy link
Contributor

Probably a bug.

@erik-kallen
Copy link
Contributor

It seems we don't have any visibility info in the generated script, which is a bug.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants