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 CaptureConvertedToObjectUnspec { x0(ImplicitlyObjectBounded<? extends Lib> x)22 @NullnessUnspecified Object x0(ImplicitlyObjectBounded<? extends Lib> x) { 23 return x.get(); 24 } 25 x1(ImplicitlyObjectBounded<? extends @NullnessUnspecified Lib> x)26 @NullnessUnspecified Object x1(ImplicitlyObjectBounded<? extends @NullnessUnspecified Lib> x) { 27 return x.get(); 28 } 29 x2(ImplicitlyObjectBounded<? extends @Nullable Lib> x)30 @NullnessUnspecified Object x2(ImplicitlyObjectBounded<? extends @Nullable Lib> x) { 31 return x.get(); 32 } 33 x3(ExplicitlyObjectBounded<? extends Lib> x)34 @NullnessUnspecified Object x3(ExplicitlyObjectBounded<? extends Lib> x) { 35 return x.get(); 36 } 37 x4(ExplicitlyObjectBounded<? extends @NullnessUnspecified Lib> x)38 @NullnessUnspecified Object x4(ExplicitlyObjectBounded<? extends @NullnessUnspecified Lib> x) { 39 return x.get(); 40 } 41 x5(ExplicitlyObjectBounded<? extends @Nullable Lib> x)42 @NullnessUnspecified Object x5(ExplicitlyObjectBounded<? extends @Nullable Lib> x) { 43 return x.get(); 44 } 45 x6(UnspecBounded<? extends Lib> x)46 @NullnessUnspecified Object x6(UnspecBounded<? extends Lib> x) { 47 return x.get(); 48 } 49 x7(UnspecBounded<? extends @NullnessUnspecified Lib> x)50 @NullnessUnspecified Object x7(UnspecBounded<? extends @NullnessUnspecified Lib> x) { 51 // jspecify_nullness_not_enough_information 52 return x.get(); 53 } 54 x8(UnspecBounded<? extends @Nullable Lib> x)55 @NullnessUnspecified Object x8(UnspecBounded<? extends @Nullable Lib> x) { 56 // jspecify_nullness_not_enough_information 57 return x.get(); 58 } 59 x9(NullableBounded<? extends Lib> x)60 @NullnessUnspecified Object x9(NullableBounded<? extends Lib> x) { 61 return x.get(); 62 } 63 x10(NullableBounded<? extends @NullnessUnspecified Lib> x)64 @NullnessUnspecified Object x10(NullableBounded<? extends @NullnessUnspecified Lib> x) { 65 // jspecify_nullness_not_enough_information 66 return x.get(); 67 } 68 x11(NullableBounded<? extends @Nullable Lib> x)69 @NullnessUnspecified Object x11(NullableBounded<? extends @Nullable Lib> x) { 70 // jspecify_nullness_not_enough_information 71 return x.get(); 72 } 73 74 interface ImplicitlyObjectBounded<T> { get()75 T get(); 76 } 77 78 interface ExplicitlyObjectBounded<T extends Object> { get()79 T get(); 80 } 81 82 interface UnspecBounded<T extends @NullnessUnspecified Object> { get()83 T get(); 84 } 85 86 interface NullableBounded<T extends @Nullable Object> { get()87 T get(); 88 } 89 90 interface Lib {} 91 } 92