mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
IsFirstPass is going away soon, but in the meantime, the next patch regresses matters slightly and causes us to emit duplicate diagnostics in more cases, so let's fix it.
19 lines
480 B
Swift
19 lines
480 B
Swift
// RUN: %target-typecheck-verify-swift
|
|
|
|
struct S1 {
|
|
// expected-error @+2 {{type member must not be named 'Type', since it would conflict with the 'foo.Type' expression}}
|
|
// expected-note @+1 {{if this name is unavoidable, use backticks to escape it}} {{8-12=`Type`}}
|
|
enum Type {
|
|
case A
|
|
}
|
|
}
|
|
|
|
struct S2 {
|
|
enum `Type` {
|
|
case A
|
|
}
|
|
}
|
|
|
|
let s1: S1.Type = .A // expected-error{{type of expression is ambiguous without more context}}
|
|
let s2: S2.`Type` = .A // no-error
|