• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2020 The JSpecify Authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 import org.jspecify.annotations.NullMarked;
17 import org.jspecify.annotations.Nullable;
18 import org.jspecify.annotations.NullnessUnspecified;
19 
20 @NullMarked
21 class TypeVariableToParentUnspec<
22     Never1T,
23     ChildOfNever1T extends Never1T,
24     UnspecChildOfNever1T extends @NullnessUnspecified Never1T,
25     NullChildOfNever1T extends @Nullable Never1T,
26     //
27     Never2T extends Object,
28     ChildOfNever2T extends Never2T,
29     UnspecChildOfNever2T extends @NullnessUnspecified Never2T,
30     NullChildOfNever2T extends @Nullable Never2T,
31     //
32     UnspecT extends @NullnessUnspecified Object,
33     ChildOfUnspecT extends UnspecT,
34     UnspecChildOfUnspecT extends @NullnessUnspecified UnspecT,
35     NullChildOfUnspecT extends @Nullable UnspecT,
36     //
37     ParametricT extends @Nullable Object,
38     ChildOfParametricT extends ParametricT,
39     UnspecChildOfParametricT extends @NullnessUnspecified ParametricT,
40     NullChildOfParametricT extends @Nullable ParametricT,
41     //
42     UnusedT> {
x0(ChildOfNever1T x)43   @NullnessUnspecified Never1T x0(ChildOfNever1T x) {
44     return x;
45   }
46 
x1(UnspecChildOfNever1T x)47   @NullnessUnspecified Never1T x1(UnspecChildOfNever1T x) {
48     // jspecify_nullness_not_enough_information
49     return x;
50   }
51 
x2(NullChildOfNever1T x)52   @NullnessUnspecified Never1T x2(NullChildOfNever1T x) {
53     // jspecify_nullness_not_enough_information
54     return x;
55   }
56 
x3(ChildOfNever2T x)57   @NullnessUnspecified Never2T x3(ChildOfNever2T x) {
58     return x;
59   }
60 
x4(UnspecChildOfNever2T x)61   @NullnessUnspecified Never2T x4(UnspecChildOfNever2T x) {
62     // jspecify_nullness_not_enough_information
63     return x;
64   }
65 
x5(NullChildOfNever2T x)66   @NullnessUnspecified Never2T x5(NullChildOfNever2T x) {
67     // jspecify_nullness_not_enough_information
68     return x;
69   }
70 
x6(ChildOfUnspecT x)71   @NullnessUnspecified UnspecT x6(ChildOfUnspecT x) {
72     return x;
73   }
74 
x7(UnspecChildOfUnspecT x)75   @NullnessUnspecified UnspecT x7(UnspecChildOfUnspecT x) {
76     // jspecify_nullness_not_enough_information
77     return x;
78   }
79 
x8(NullChildOfUnspecT x)80   @NullnessUnspecified UnspecT x8(NullChildOfUnspecT x) {
81     // jspecify_nullness_not_enough_information
82     return x;
83   }
84 
x9(ChildOfParametricT x)85   @NullnessUnspecified ParametricT x9(ChildOfParametricT x) {
86     return x;
87   }
88 
x10(UnspecChildOfParametricT x)89   @NullnessUnspecified ParametricT x10(UnspecChildOfParametricT x) {
90     // jspecify_nullness_not_enough_information
91     return x;
92   }
93 
x11(NullChildOfParametricT x)94   @NullnessUnspecified ParametricT x11(NullChildOfParametricT x) {
95     // jspecify_nullness_not_enough_information
96     return x;
97   }
98 }
99