-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Closed
Closed
Copy link
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.standard libraryArea: Standard library umbrellaArea: Standard library umbrellatype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis
Description
Previous ID | SR-3914 |
Radar | rdar://problem/30472072 |
Original Reporter | @keith |
Type | Bug |
Status | Resolved |
Resolution | Won't Do |
Additional Detail from JIRA
Votes | 0 |
Component/s | Standard Library |
Labels | Bug, 3.1Regression, TypeChecker |
Assignee | None |
Priority | Medium |
md5: 8ff5f9ec83e0c164daad3b038df2038b
Issue Description:
This code produces the "Mixed-type subtraction is deprecated." warning even though both `tv_usec` calls return a `_darwin_suseconds_t` aka `_int32_t` aka `Int32`
import Darwin
var bootTime: timeval = timeval()
var now: timeval = timeval()
_ = now.tv_usec - bootTime.tv_usec // Doesn't warn
_ = max(0, now.tv_usec - bootTime.tv_usec) // Doesn't warn
_ = UInt64(max(0, now.tv_usec - bootTime.tv_usec)) // Warns
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.standard libraryArea: Standard library umbrellaArea: Standard library umbrellatype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis