muScript: support types matchig ? extends for DFinal.of
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
Johannes Frohnmeyer 2023-03-12 18:06:57 +01:00
parent ee7c5f8327
commit 3968ac45a9
Signed by: Johannes
GPG Key ID: E76429612C2929F4
2 changed files with 8 additions and 8 deletions

View File

@ -75,15 +75,15 @@ public class Scope implements DObject {
return set(key, DFinal.of(value));
}
public Scope set(String key, Map<String, Dynamic<?>> value) {
public Scope set(String key, Map<String, ? extends Dynamic<?>> value) {
return set(key, DFinal.of(value));
}
public Scope set(String key, List<Dynamic<?>> value) {
public Scope set(String key, List<? extends Dynamic<?>> value) {
return set(key, DFinal.of(value));
}
public Scope set(String key, Function<DList, Dynamic<?>> value) {
public Scope set(String key, Function<DList, ? extends Dynamic<?>> value) {
return set(key, DFinal.of(value, () -> key));
}

View File

@ -25,7 +25,7 @@ public class DFinal {
return new FString(b);
}
public static DObject of(Map<String, Dynamic<?>> b) {
public static DObject of(Map<String, ? extends Dynamic<?>> b) {
return new FObject(Map.copyOf(b));
}
@ -33,12 +33,12 @@ public class DFinal {
return new FList(List.of(b));
}
public static DList of(List<Dynamic<?>> b) {
return new FList(ImmCollection.of(b));
public static DList of(List<? extends Dynamic<?>> b) {
return new FList(ImmCollection.of((List<Dynamic<?>>) b));
}
public static DCallable of(Function<DList, Dynamic<?>> b, Supplier<String> serialized) {
return new FCallable(b, new LazySupplier<>(serialized));
public static DCallable of(Function<DList, ? extends Dynamic<?>> b, Supplier<String> serialized) {
return new FCallable((Function<DList, Dynamic<?>>) b, new LazySupplier<>(serialized));
}
/**