[Feature] Add nullable reference annotations.
See original GitHub issueThe playwright library has no clear documentation about whether an argument or return type can be null. In the original TypeScript library it’s not a problem since the type system of TypeScript supports nullable annotation. For example, the page.contentText
has a string | null
type, which indicates that it may be null. With strictNullCheck
compiler option, you can’t call its methods without proper null check.
However, in this project, the nullable annotation is absent, neither the documentation points out the fact that it can be null.
Java actually has a plenty of null annotations. These annotations can also be identify in Kotlin. I hope nullable can be properly annotated like the TypeScript library, or at least be documented.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:6 (2 by maintainers)
Top Results From Across the Web
The annotation for nullable reference types should only be ...
The nullable annotation context of any given source line is either enabled or disabled. You can think of the pre-C# 8.0 compiler as...
Read more >Nullable reference types - Microsoft Learn
You use annotations that can declare whether a variable is a nullable reference type or a non-nullable reference type. These annotations make ...
Read more >Annotating your C# code - Migrating to nullable reference types
Migrating to using nullable reference types becomes easier when your dependencies have nullable annotations in place, whether the native C# ...
Read more >Nullable Reference Types: Contexts and Attributes – A Look at ...
Nullable annotation context – When this context is enabled, all the nullability information that includes attributes and NRTs in public ...
Read more >Nullable Reference Types - C# Corner
The nullable annotation and warning context can be set for a project using the Nullable element in your csproj file. These settings define...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Couple of points:
Since Java 8 it’s possible to indicate that no value might be present using the
Optional
class. Could that maybe be used an alternative to annotations (for return types, at least)?