mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Push FunctionTypeRepr Input Invariants Up
Validation of the input side of FunctionTypeRepr was previously being done in Sema because of expression folding. If we instead push the invariant that the input TypeRepr should always be a TupleTypeRepr into the AST a number of nice cleanups fall out: - The SIL Parser no longer accepts Swift 2-style type declarations - Parse is more cleanly able to reject invalid FunctionTypeReprs - Clients of the AST can be assured the input type is always a TupleType so we can flush Swift 2 hacks
This commit is contained in:
@@ -1461,7 +1461,7 @@ private:
|
||||
bool walkToTypeReprPre(TypeRepr *T) override {
|
||||
if (auto *FTR = dyn_cast<FunctionTypeRepr>(T)) {
|
||||
FoundFunctionTypeRepr = true;
|
||||
if (auto *TTR = dyn_cast_or_null<TupleTypeRepr>(FTR->getArgsTypeRepr())) {
|
||||
if (auto *TTR = FTR->getArgsTypeRepr()) {
|
||||
for (auto &ArgElt : TTR->getElements()) {
|
||||
CharSourceRange NR;
|
||||
CharSourceRange TR;
|
||||
|
||||
Reference in New Issue
Block a user