Files
swift-mirror/test/Parse/confusables.swift
2020-03-29 08:41:29 -07:00

25 lines
1.6 KiB
Swift
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// RUN: %target-typecheck-verify-swift
// expected-error @+4 {{type annotation missing in pattern}}
// expected-error @+3 {{use of unresolved operator ''}}
// expected-error @+2 {{operator with postfix spacing cannot start a subexpression}}
// expected-error @+1 {{consecutive statements on a line must be separated by ';'}}
let number Int // expected-note {{operator '' contains possibly confused characters; did you mean to use ':'?}} {{11-14=:}}
// expected-warning @+3 2 {{integer literal is unused}}
// expected-error @+2 {{invalid character in source file}}
// expected-error @+1 {{consecutive statements on a line must be separated by ';'}}
5 5 // expected-note {{unicode character '' looks similar to '-'; did you mean to use '-'?}} {{3-6=-}}
// expected-error @+2 {{use of unresolved identifier ''}}
// expected-error @+1 {{expected ',' separator}}
if (true false) {} // expected-note {{identifier '' contains possibly confused characters; did you mean to use '&&&'?}} {{10-19=&&&}}
// expected-error @+3 {{invalid character in source file}}
// expected-error @+2 {{expected ',' separator}}
// expected-error @+1 {{type '(Int, Int)' cannot conform to 'BinaryInteger'; only struct/enum/class types can conform to protocols}}
if (5 5) == 0 {} // expected-note {{unicode character '' looks similar to '-'; did you mean to use '-'?}} {{7-10=-}}
// expected-note @-1 {{operator function '=='}}
// FIXME(rdar://61028087): The above note should read "required by referencing operator function '==' on 'BinaryInteger' where 'Self' = '(Int, Int)'".