Skip to content

Type.IsPublic returns wrong answer for pointer and byref types #12355

Closed

Description

@GrabYourPitchforks

Even though int is public, int* and int& aren't. Sample code below.

Console.WriteLine(typeof(int).MakePointerType().IsPublic); // prints 'False', expected 'True'
Console.WriteLine(typeof(int).MakeByRefType().IsPublic); // prints 'False', expected 'True'

Perhaps an oversight when copying the elemental Type's visibility attributes into the pointer / byref Type we manfacture behind the scenes?

(Found by @stephentoub)

Activity

  1. steveharter commented on May 30, 2019

    @steveharter
    Contributor

    Moving to future; not in scope for 3.0.

  2. transferred this issue fromdotnet/coreclron Jan 31, 2020
  3. added this to the Future milestone on Jan 31, 2020
  4. added
    untriaged
    on Feb 26, 2020
  5. modified the milestones: Future, 5.0 on Mar 19, 2020
  6. removed
    untriaged
    on Mar 19, 2020
  7. removed their assignment
    on Nov 12, 2020
  8. modified the milestones: Future, 6.0.0 on Nov 12, 2020
  9. BartoszKlonowski commented on May 23, 2021

    @BartoszKlonowski
    Contributor

    @GrabYourPitchforks I would like to work on that, so please assign me to this issue.
    CC: @steveharter @krwq

  10. 3 remaining items

  11. BartoszKlonowski commented on Jul 8, 2021

    @BartoszKlonowski
    Contributor

    @krwq Yes, and sorry for the delay. I had it planned for this week, but it turned out to be busier then I thought.
    It will for sure be delivered within next week.

  12. BartoszKlonowski commented on Aug 3, 2021

    @BartoszKlonowski
    Contributor

    @krwq Unfortunately I need to postpone my work on this as I currently don't have enough time to spend to deep into this, sorry for inconvenience.

  13. ghost added
    needs-further-triage
    on Aug 3, 2021
  14. GrabYourPitchforks commented on Aug 3, 2021

    @GrabYourPitchforks
    MemberAuthor

    Thanks for the heads up @BartoszKlonowski! I think we all understand busy schedules interfering with these things. :)

  15. removed their assignment
    on Aug 3, 2021
  16. removed
    needs-further-triage
    on Aug 5, 2021
  17. ghost added
    in-pr
    on Feb 10, 2022
  18. ghost removed
    in-pr
    on Feb 21, 2022
  19. Repository owner moved this from Future to Done in Triage POD for Reflection, META, etc.on Feb 21, 2022
  20. ghost locked as resolved and limited conversation to collaborators on Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions