Commit Graph

11880 Commits

Author SHA1 Message Date
swift-ci
2d9ad19c30 Merge remote-tracking branch 'origin/master' into master-next 2019-10-12 15:29:46 -07:00
Doug Gregor
190d96535c [Property wrappers] Fix source compatibility issue with attribute lookup.
Swift 5.1's lookup for custom attributes skipped associated type
members, which allowed code like the given example to compile. To
maintain source compatibility, identify the narrow case that happens
in practice---the property wrapper is at module scope but is now
shadowed by an associated type---warn about it, and accept it.

Fixes rdar://problem/56213175.
2019-10-11 22:44:50 -07:00
swift-ci
71e9fc221b Merge remote-tracking branch 'origin/master' into master-next 2019-10-11 22:09:52 -07:00
Slava Pestov
2e558f8c89 Merge pull request #27594 from slavapestov/circular-validation-cleanups-6
Circular validation cleanups, part 6
2019-10-12 00:59:21 -04:00
swift-ci
240bee6abb Merge remote-tracking branch 'origin/master' into master-next 2019-10-11 20:09:49 -07:00
Suyash Srijan
a9588b3382 Merge pull request #27253 from theblixguy/fix/SR-11477
[PropertyWrappers] Look for constructors with default args when finding default init
2019-10-12 03:51:59 +01:00
swift-ci
e4cbf824ae Merge remote-tracking branch 'origin/master' into master-next 2019-10-11 15:10:04 -07:00
Robert Widmann
7770564f1a Merge pull request #27624 from CodaFi/in-locale-parentis
Downgrade The TypeLoc in VarDecl to a TypeRepr
2019-10-11 14:53:10 -07:00
swift-ci
a05bdbd228 Merge remote-tracking branch 'origin/master' into master-next 2019-10-11 14:50:21 -07:00
swift-ci
adfd8b358e Merge pull request #27555 from rxwei/ad-upstream-autodiff-index-subset 2019-10-11 14:46:03 -07:00
swift-ci
7ccde2960f Merge remote-tracking branch 'origin/master' into master-next 2019-10-11 14:29:59 -07:00
Suyash Srijan
370f47c27a [PropertyWrappers] Merge 'findDefaultInit' and 'findInitialValueInit' methods into a single 'findSuitableWrapperInit' method 2019-10-11 22:25:46 +01:00
Pavel Yaskevich
6b9b764974 Merge pull request #27614 from xedin/inout-type-mismatch
[ConstraintSystem] Detect and diagnose type mismatch failures of `ino…
2019-10-11 14:14:09 -07:00
Robert Widmann
660f66d7c0 Delete the IsTypeLocImplicit Bit 2019-10-11 13:41:19 -07:00
Richard Wei
9765858d31 Rename to 'IndexSubset' and move it to its own file. 2019-10-11 13:07:53 -07:00
Pavel Yaskevich
8e16aa4b8d [Diagnostics] Extend argument-to-parameter mismatch note to cover inout parameters 2019-10-11 12:38:11 -07:00
Robert Widmann
2516089cb6 Clean up the pseudo-clone-constructor for ParamDecl 2019-10-11 11:51:50 -07:00
Robert Widmann
060cbb293f [NFC] Downgrade The TypeLoc in VarDecl to a TypeRepr
TypeCheckPattern used to splat the interface type into this, and
different parts of the compiler would check one or the other.   There is
now one source of truth: The interface type.  The type repr is now just
a signal that the user has written an explicit type annotation on
a parameter.  For variables, we will eventually be able to just grab
this information from the parent pattern.
2019-10-11 11:15:51 -07:00
swift-ci
0c2d2a87b5 Merge remote-tracking branch 'origin/master' into master-next 2019-10-10 21:30:01 -07:00
swift-ci
09299de0dc Merge pull request #27617 from ravikandhadai/constexpr-toplevel-separation 2019-10-10 21:23:20 -07:00
swift-ci
156c2a9cb3 Merge remote-tracking branch 'origin/master' into master-next 2019-10-10 19:49:52 -07:00
David Ungar
37afa7cf98 Merge pull request #27435 from davidungar/A-9-29-recursion-assert
[ASTScopes] Use RequestEvaluator for ASTScope expansion to detect recursion
2019-10-10 19:42:22 -07:00
Ravi Kandhadai
28e4cd02d5 [Constant Evaluator] Add a flag for denoting top-level evaluation
mode and separate out the code for top-level evaluation from the normal
step-by-step evaluation. This ensures that step-by-step evaluation
does not accidentally rely on any logic meant for top-level evaluation.

This change should not affect the observable behavior of the evaluator.
2019-10-10 19:32:26 -07:00
David Ungar
571d815c6a Remove radar numbers. 2019-10-10 17:39:42 -07:00
swift-ci
97f8ee294c Merge remote-tracking branch 'origin/master' into master-next 2019-10-10 17:09:54 -07:00
Slava Pestov
90fa96d8fa Sema: Fold SubscriptDecl::computeType() into validateDecl() 2019-10-10 19:55:02 -04:00
Slava Pestov
09034fdf66 Sema: Fold EnumElementDecl::computeType() into validateDecl() 2019-10-10 19:55:02 -04:00
Slava Pestov
6974448b1e Sema: Fold TypeAliasDecl::computeType() into validateDecl() 2019-10-10 19:55:02 -04:00
Slava Pestov
797a7974bc Sema: Fold NominalTypeDecl::computeType() into validateDecl() 2019-10-10 19:55:01 -04:00
Slava Pestov
87dd47aeaa Sema: Fold AssociatedTypeDecl::computeType() into validateDecl() 2019-10-10 19:54:48 -04:00
Slava Pestov
3062b8c64a Sema: Move function result/subscript element type computation into a request
validateDecl() no longer explicitly validates the result TypeLoc.
Instead, the request is triggered via validateDecl() calling
computeType() on the FuncDecl or SubscriptDecl.
2019-10-10 19:54:48 -04:00
Slava Pestov
12231d2df3 Merge pull request #27571 from slavapestov/circular-validation-cleanups-5
Circular validation cleanups, part 5
2019-10-10 19:52:56 -04:00
swift-ci
be63ef78ee Merge remote-tracking branch 'origin/master' into master-next 2019-10-10 15:30:28 -07:00
Jordan Rose
7725818275 Revert "Merge pull request #27057 from theblixguy/unrevert/SR-11298"
This reverts commit c99facb48b, reversing
changes made to 9a24013228.

rdar://problem/56165420
2019-10-10 14:29:52 -07:00
swift-ci
84f192ddce Merge remote-tracking branch 'origin/master' into master-next 2019-10-10 13:50:08 -07:00
Xi Ge
c9f1900d3b Merge pull request #27464 from nkcsgexi/deserialize-source-info
SerializeLoc: serialize basic decl source location information to .swiftsourceinfo file
2019-10-10 13:46:04 -07:00
Miguel Salinas
138d731bad Merge remote-tracking branch 'upstream/master' into warn-on-empty-optionset-static-constants 2019-10-10 14:57:20 -05:00
Slava Pestov
6701a7efcf AST: Remove unused method declaration 2019-10-10 15:28:35 -04:00
Slava Pestov
3dbdc09a4e Sema: Move ParamDecl interface type computation to validateDecl()
This eliminates typeCheckParameterList() altogether.
2019-10-10 15:28:14 -04:00
Slava Pestov
d8b61ff24b Sema: Peel off typeCheckParameterList()'s specifier computation into a request
Since getSpecifier() now kicks off a request instead of always
returning what was previously set, we can't pass a ParamSpecifier
to the ParamDecl constructor anymore. Instead, callers either
call setSpecifier() if the ParamDecl is synthesized, or they
rely on the request, which can compute the specifier in three
specific cases:

- Ordinary parsed parameters get their specifier from the TypeRepr.

- The 'self' parameter's specifier is based on the self access kind.

- Accessor parameters are either the 'newValue' parameter of a
  setter, or a cloned subscript parameter.

For closure parameters with inferred types, we still end up
calling setSpecifier() twice, once to set the initial defalut
value and a second time when applying the solution in the
case that we inferred an 'inout' specifier. In practice this
should not be a big problem because expression type checking
walks the AST in a pre-determined order anyway.
2019-10-10 15:00:07 -04:00
Slava Pestov
df62f3629b AST: Rename ParamDecl::Specifier to ParamSpecifier
Nested types cannot be forward declared which poses difficulties
for the request evaluator.
2019-10-10 14:34:26 -04:00
swift-ci
9b8a94c725 Merge remote-tracking branch 'origin/master' into master-next 2019-10-10 11:09:53 -07:00
Rintaro Ishizaki
cdfd1ab2cf Merge pull request #27592 from rintaro/syntaxparse-exprtuple
[SyntaxParse] Parse tuple/paren expression syntax
2019-10-10 19:56:41 +02:00
David Ungar
a9ab4aa8c2 Use SeparateCaching 2019-10-09 22:33:39 -07:00
Xi Ge
483bd5dbc3 SerializeLoc: implement SourceFile::getBasicLocsForDecl()
After having this function, the serialization logic doesn't have to
know where the source locations are coming from (.swift or .swiftmodule).
2019-10-09 17:30:34 -07:00
swift-ci
da686f2aa7 Merge remote-tracking branch 'origin/master' into master-next 2019-10-09 17:09:31 -07:00
Jordan Rose
16bb84f28c Merge pull request #27574 from jrose-apple/we-could-have-called-them-iterator-stoves
Remove IteratorRange in favor of llvm::iterator_range
2019-10-09 16:54:38 -07:00
Xi Ge
dd33540231 AST: rename printDeclUSRForModuleDoc to printDeclUSR. NFC 2019-10-09 15:29:52 -07:00
Xi Ge
c9647bb02e SerializeLoc: remove NameLoc entry in the serialized format
Having both Loc and NameLoc fields seems to be redundant.
2019-10-09 15:29:52 -07:00
Xi Ge
8293bdc9e9 SerilizeLoc: refactor table structures per Jordan's comments
After this change, we only use one single hash table for USR to USR id
mapping. The basic source locations are an array of fixed length
records that could be retrieved by using the USR id since each
USR id is guaranteed to be associated with one basic location entry.

The source file paths are refactored to a blob of 0-terminated strings.
Decl locations use offset in this blob to refer to the source file path
where the decl was defined.
2019-10-09 15:29:52 -07:00