diff --git a/include/swift/AST/DiagnosticsSema.def b/include/swift/AST/DiagnosticsSema.def index f1d7282aca5ae..82c1fa80c183a 100644 --- a/include/swift/AST/DiagnosticsSema.def +++ b/include/swift/AST/DiagnosticsSema.def @@ -257,7 +257,7 @@ ERROR(cannot_throw_nil,none, ERROR(cannot_convert_raw_initializer_value,none, "cannot convert value of type %0 to raw type %1", (Type,Type)) ERROR(cannot_convert_raw_initializer_value_nil,none, - "cannot convert nil to raw type %1", (Type)) + "cannot convert nil to raw type %0", (Type)) ERROR(cannot_convert_default_arg_value,none, "default argument value of type %0 cannot be converted to type %1", diff --git a/test/Parse/enum.swift b/test/Parse/enum.swift index 31e3b305a7271..c4d46b2ca26da 100644 --- a/test/Parse/enum.swift +++ b/test/Parse/enum.swift @@ -429,3 +429,7 @@ public protocol RawValueB enum RawValueBTest: Double, RawValueB { case A, B } + +enum foo : String { + case bar = nil // expected-error {{cannot convert nil to raw type 'String'}} +}