Files
swift-mirror/test/Constraints/warn_long_compile.swift
Slava Pestov 017be57e9b Sema: Fix -warn-long-expression-type-checking when expression timer is turned off
My change 983b75e1cf broke
-warn-long-expression-type-checking because now the
ExpressionTimer is not instantiated by default and that
entire code path is skipped.

Change it so that if -warn-long-expression-type-checking
is passed in, we still start the timer, we just don't
ever consider it to have 'expired'.

Fixes rdar://problem/152998878.
2025-06-25 22:07:56 -04:00

13 lines
424 B
Swift

// RUN: %target-typecheck-verify-swift -warn-long-expression-type-checking=1 -solver-disable-shrink -warn-long-function-bodies=1
@_silgen_name("generic_foo")
func foo<T>(_ x: T) -> T
@_silgen_name("foo_of_int")
func foo(_ x: Int) -> Int
func test(m: Double) -> Int {
// expected-warning@-1 {{global function 'test(m:)' took}}
return ~(~(~(~(~(~(~(~(~(~(~(~(0))))))))))))
// expected-warning@-1 {{expression took}}
}