Comments (6)
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.
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.
And the phrase you're asking about is abbreviated as just "inner-of".
from jspecify.
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.
Note in the diagram above that:
- whether
Foo
can potentially be nullable is governed by the edge type pointing to it (inner-of, therefore "no") - 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.
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.
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)
- Generalized contract language expressed in a single `@Contract("...")` annotation, like IntelliJ supports HOT 4
- Document intended pre-1.0 releases, including release candidates
- Write 1.0 release announcement HOT 1
- Documentation for code authors
- Finalize all workingly-decided specification issues affecting 1.0 HOT 1
- Guava has documented their plan for releasing with JSpecify annotations HOT 3
- No access to Java-concepts glossary HOT 2
- How to annotate `Collection.toArray(T[])` HOT 2
- Move module-info back to the main root? HOT 2
- `@ValueClass`, to prepare a class for Valhalla transition (also immediately useful) HOT 1
- Consider annotating `InvocationTargetException`, `ExecutionException`, and `CompletionException` causes as non-nullable HOT 8
- Take the Javadoc warning down a notch HOT 8
- Not possible to annotation a return enum @Nullable from a method HOT 1
- Document that we ignore `@Inherited`
- Give advice in docs about the "findViewById problem"
- Document how to declare that your JPMS module uses JSpecify HOT 11
- Figure out and document whether module-level `@NullMarked` helps users who don't declare a module HOT 13
- generic userdoc confusion HOT 7
- Document on how to add the jspecify dependency: Maven and Gradle HOT 3
- Document the nullness of special APIs on enum and annotation types HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jspecify.