-
Notifications
You must be signed in to change notification settings - Fork 99
Expand file tree
/
Copy pathOptionals.swift
More file actions
97 lines (79 loc) · 1.82 KB
/
Optionals.swift
File metadata and controls
97 lines (79 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2025 Apple Inc. and the Swift.org project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Swift.org project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import SwiftJava
#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
public func optionalBool(input: Bool?) -> Bool? {
input
}
public func optionalByte(input: Int8?) -> Int8? {
input
}
public func optionalChar(input: UInt16?) -> UInt16? {
input
}
public func optionalShort(input: Int16?) -> Int16? {
input
}
public func optionalInt(input: Int32?) -> Int32? {
input
}
public func optionalLong(input: Int64?) -> Int64? {
input
}
public func optionalPlatformDependentInt(input: Int?) -> Int? {
input
}
public func optionalFloat(input: Float?) -> Float? {
input
}
public func optionalDouble(input: Double?) -> Double? {
input
}
public func optionalString(input: String?) -> String? {
input
}
public func optionalClass(input: MySwiftClass?) -> MySwiftClass? {
input
}
public func optionalDate(input: Date?) -> Date? {
input
}
public func optionalData(input: Data?) -> Data? {
input
}
public func optionalJavaKitLong(input: JavaLong?) -> Int64? {
if let input {
return input.longValue()
} else {
return nil
}
}
public func optionalThrowing() throws -> Int64? {
throw MySwiftError.swiftError
}
public func multipleOptionals(
input1: Int8?,
input2: Int16?,
input3: Int32?,
input4: Int64?,
input5: String?,
input6: MySwiftClass?,
input7: Bool?
) -> Int64? {
1
}