Commit Graph

59 Commits

Author SHA1 Message Date
Slava Pestov
01b3965459 Sema: Add a timer for preCheckExpression() 2020-12-15 23:43:04 -05:00
Pavel Yaskevich
607f49dc2e [TypeChecker] Find outermost paren or tuple while checking invalid inout use
Unwrap `InOutExpr` from all parens until the outermost paren or a tuple
to correctly diagnose calls like `foo(((&bar)))` or `foo(x: (&bar))`,
 and suggest a fix-it with moves `&` outside parens.

Resolves: rdar://problem/71356981
2020-11-19 13:31:10 -08:00
Slava Pestov
5808d9beb9 Parse: Remove parse-time name lookup 2020-11-16 22:39:44 -05:00
Slava Pestov
641a257f73 Sema: Don't diagnose forward references to debugger variables in pre-checking 2020-11-16 22:39:43 -05:00
Slava Pestov
2a678f29db Sema: Remove TypeResolutionFlags::AllowUnavailable{,Protocol} 2020-10-14 23:42:44 -04:00
Pavel Yaskevich
461eafff54 [ConstraintSystem] NFC: Move ConstraintSystem.h to include/swift/Sema 2020-10-08 10:45:47 -07:00
Slava Pestov
554e0f97e6 AST: Find local property wrappers in ASTScope::lookupLocalDecls()
Two fixes here:

- The ASTScopeDeclConsumerForLocalLookup needs to visit auxiliary variables
- preCheckExpression() should call ASTScope::lookupLocalDecls() even when
  parser lookup is enabled, since otherwise we won't be able to find
  auxiliary decls in the current DeclContext.
2020-10-02 14:40:11 -04:00
Slava Pestov
06fc9c5a5e Sema: Simulate old name lookup behavior when parser lookup is off
Before performing an UnqualifiedLookup with Flags::IncludeOuterResults
turned on, call ASTScope::lookupSingleLocalDecl() to find local
bindings that precede the current source location.

If this fails, we perform an unqualified lookup to try to find
forward references to captures, type members, and top-level
declarations.
2020-10-01 23:50:16 -04:00
Slava Pestov
d576b4e926 Sema: Move preCheckExpression() into its own file 2020-10-01 17:24:44 -04:00