Skip to content

Commit 839d92b

Browse files
authored
[stdlib] UnicodeScalarProperties: use RawValue over UInt32
On Windows, `__swift_stdlib_UNumericType` and `__swift_stdlib_UCharCategory` are imported as `Int32`s rather than `UInt32`. Change the constructors to use the type's inferred `RawValue` rather than always `UInt32`.
1 parent 48e298a commit 839d92b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

stdlib/public/core/UnicodeScalarProperties.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,8 @@ extension Unicode.Scalar.Properties {
10861086
/// [Unicode Standard](http://www.unicode.org/versions/latest/).
10871087
public var generalCategory: Unicode.GeneralCategory {
10881088
let rawValue = __swift_stdlib_UCharCategory(
1089-
UInt32(__swift_stdlib_u_getIntPropertyValue(
1089+
__swift_stdlib_UCharCategory.RawValue(
1090+
__swift_stdlib_u_getIntPropertyValue(
10901091
_value, __swift_stdlib_UCHAR_GENERAL_CATEGORY)))
10911092
return Unicode.GeneralCategory(rawValue: rawValue)
10921093
}
@@ -1363,7 +1364,8 @@ extension Unicode.Scalar.Properties {
13631364
/// [Unicode Standard](http://www.unicode.org/versions/latest/).
13641365
public var numericType: Unicode.NumericType? {
13651366
let rawValue = __swift_stdlib_UNumericType(
1366-
UInt32(__swift_stdlib_u_getIntPropertyValue(
1367+
__swift_stdlib_UNumericType.RawValue(
1368+
__swift_stdlib_u_getIntPropertyValue(
13671369
_value, __swift_stdlib_UCHAR_NUMERIC_TYPE)))
13681370
return Unicode.NumericType(rawValue: rawValue)
13691371
}

0 commit comments

Comments
 (0)