Giter Site home page Giter Site logo

Comments (6)

donnerpeter avatar donnerpeter commented on June 3, 2024

Sorry, I don't quite understand "Parent is a inner type whose nearest outer type is the child". Could you please give an example?

from jspecify.

kevinb9n avatar kevinb9n commented on June 3, 2024

Sure, like this. The type as seen in code is on the left, how I want to picture that as a tree on the right.

image

And the phrase you're asking about is abbreviated as just "inner-of".

from jspecify.

cushon avatar cushon commented on June 3, 2024

One saving grace for enclosing instance of types is that they're always going to be @NonNull, so that part really only matters for nullness when talking component types of the enclosing instance (e.g. Bar) in your example, which could still be @Nullable.

from jspecify.

kevinb9n avatar kevinb9n commented on June 3, 2024

Note in the diagram above that:

  1. whether Foo can potentially be nullable is governed by the edge type pointing to it (inner-of, therefore "no")
  2. whereas, whether Baz can potentially be nullable is governed by what type context this is whole tree is sitting in.

This illustrates that it is really Baz that sits directly in the type context, and Foo that comes in underneath.

from jspecify.

kevinb9n avatar kevinb9n commented on June 3, 2024

Oh and there's more. I think it's very desirable that every subtree of the type tree is itself a valid type.

from jspecify.

kevinb9n avatar kevinb9n commented on June 3, 2024

I believe the arguments in this thread strongly support the idea that JLS "type paths" are not a useful model for us to base on. We won't try to redefine what "type path" means but we should mostly strive to avoid the concept (except in contexts where we specifically must map to JLS terminology).

We should define our own term like type "containment".

from jspecify.

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.