mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
This was initially added to avoid "expression was too complex" in a case where we were not previously reporting it for -swift-version 3 but should have been. In retrospect this seems misguided since although we would not like to regress on "too complex" expressions, we really don't want to silently continue in the cases where we decide an expression is "too complex", but where we have a solution that we could use. It's better to fail.
13 lines
444 B
Swift
13 lines
444 B
Swift
// RUN: %target-typecheck-verify-swift -solver-memory-threshold 16000 -propagate-constraints
|
|
|
|
var z = 10 + 10 // expected-error{{expression was too complex to be solved in reasonable time; consider breaking up the expression into distinct sub-expressions}}
|
|
|
|
// No errors should appear below as a result of the error above.
|
|
var x = [1, 2, 3, 4.5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 ,19]
|
|
var y = 10
|
|
|
|
class C {}
|
|
|
|
var c = C()
|
|
var d = c
|