mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
variables to pick as potential bindings, try the default literal types corresponding to literal constraints on a type variable. Swift SVN r2883
19 lines
565 B
Swift
19 lines
565 B
Swift
// RUN: %swift -verify -constraint-checker -debug-constraints %s > %t
|
|
// RUN: FileCheck %s < %t
|
|
|
|
// CHECK: ---Solution---
|
|
// CHECK: Assumptions:
|
|
// CHECK: assuming $T0 == IntegerLiteralType
|
|
// CHECK: Type Variables:
|
|
// CHECK: $T0 as IntegerLiteralType
|
|
// CHECK: Constraints:
|
|
// CHECK: SOLVED (completely)
|
|
var i1 = 1
|
|
|
|
// CHECK: SOLVED (completely)
|
|
// CHECK: Found 2 potential solutions.
|
|
// FIXME: There are multiple interpretations. Should we prefer the one that
|
|
// uses default types?
|
|
var i2 = 1 + 2.0 + 1 // expected-error{{expression does not type-check}}
|
|
|