Files
swift-mirror/test/Compatibility/throws_identifier.swift
Rintaro Ishizaki a1760161c5 [Parse] Don't parse 'throws' or 'rethrows' as identifiers
It seems there is no reason to accept them.
Why we want to accept `class C<throws> { ... }`?
2016-11-24 10:55:24 +09:00

15 lines
602 B
Swift

// RUN: rm -rf %t && mkdir -p %t
// RUN: %utils/split_file.py -o %t %s
// RUN: %target-swift-frontend -parse -primary-file %t/swift3.swift -verify -swift-version 3
// RUN: %target-swift-frontend -parse -primary-file %t/swift4.swift -verify -swift-version 4
// 'throws' or 'rethrows' are allowed as an identifier in Swift 3.
// BEGIN swift3.swift
class C<throws> {}
precedencegroup rethrows {}
// BEGIN swift4.swift
class C<throws> {} // expected-error {{expected an identifier to name generic parameter}}
precedencegroup rethrows {} // expected-error {{expected identifier after 'precedencegroup'}}