Giter Site home page Giter Site logo

Comments (6)

eugene-rw avatar eugene-rw commented on July 2, 2024

It seems, compiler incorrectly use condition "provider.NumberList != null" as proof of non-nullability of a

from roslyn.

huoyaoyuan avatar huoyaoyuan commented on July 2, 2024

It seems, compiler incorrectly use condition "provider.NumberList != null" as proof of non-nullability of a

It is the contract of property. Nullability analysis and many other analyzers doesn't expect the get result of property to change randomly. There are also other cases that tooling can invoke the getter of properties.

from roslyn.

eugene-rw avatar eugene-rw commented on July 2, 2024

@huoyaoyuan
I would agree, if it was simple variable. But nullability analysis can see that the property is function indeed, and doesn't relay on it constancy. It can be make as configurable though.

from roslyn.

huoyaoyuan avatar huoyaoyuan commented on July 2, 2024

But nullability analysis can see that the property is function indeed

Nullability analysis and potentially all language features doesn't see through method body of other methods. It only check for the signatures with attributes applied.

It's also impractical to understand what can happen in a method in detail.

I would agree, if it was simple variable.

It's the contract of properties to act similar to simple variables. Many of the tooling including debugger follow this contract.

from roslyn.

eugene-rw avatar eugene-rw commented on July 2, 2024

It's also impractical to understand what can happen in a method in detail.

Yes, of course.

I supposed, that there is a simple method to distinguish cases when property has simple get accessor with hidden backing field and when property calls function. But PropertyInfo has no info for that, it seems, that it can be compiler internals only.

from roslyn.

CyrusNajmabadi avatar CyrusNajmabadi commented on July 2, 2024

Closing as by design. Only the signatures of members are examined to determine their impact on NRT analysis.

from roslyn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.