Files
swift-mirror/test/NameBinding/multi-file-with-main.swift
Chris Lattner bd03e48090 teach typeCheckArgumentChildIndependently how to propagate type information
down to call argument lists that have more than one operand (heavily leveraging
"computeTupleShuffle").  This resolves a great number of QoI radars, including
things like:
<rdar://problem/19981782> QoI: poor diagnostic for call to memcmp with UInt length parameter

where we used to produce:

error: cannot invoke 'memcmp' with an argument list of type '([UInt8], [UInt8], UInt)'
    return memcmp(left, right, UInt(left.count)) == 0
           ^
note: expected an argument list of type '(UnsafePointer<Void>, UnsafePointer<Void>, Int)'

but now we produce:
error: cannot convert value of type 'UInt' to expected argument type 'Int'
    return memcmp(left, right, UInt(left.count)) == 0
                               ^~~~~~~~~~~~~~~~

which is more "to the point"



Swift SVN r30930
2015-08-02 05:51:26 +00:00

8 lines
311 B
Swift

// RUN: %target-swift-frontend -parse -enable-source-import -primary-file %s %S/Inputs/multi-file-with-main/main.swift -module-name=MultiFile -sdk "" -verify
func testOperator() {
let x: Int = 1 +++ "abc" // expected-error {{cannot convert value of type 'String' to expected argument type 'Int'}}
_ = x
}