AST: Add Throws flag and ThrowsLoc to AbstractFunctionDecl

The verifier now asserts that Throws, ThrowsLoc and isBodyThrowing()
match up.

Also, add /*Label=*/ comments where necessary to make the long argument
lists easier to read, and cleaned up some inconsistent naming conventions.

I caught a case where ClangImporter where we were passing in a loc as
StaticLoc instead of FuncLoc, but probably this didn't affect anything.
This commit is contained in:
Slava Pestov
2016-05-18 15:34:39 -07:00
parent 09c57d32c7
commit 170992c39f
25 changed files with 401 additions and 294 deletions

View File

@@ -1460,7 +1460,7 @@ void ConstraintSystem::resolveOverload(ConstraintLocator *locator,
auto boundFunctionType = boundType->getAs<AnyFunctionType>();
if (boundFunctionType &&
CD->isBodyThrowing() != boundFunctionType->throws()) {
CD->hasThrows() != boundFunctionType->throws()) {
boundType = FunctionType::get(boundFunctionType->getInput(),
boundFunctionType->getResult(),
boundFunctionType->getExtInfo().