Commit Graph

28 Commits

Author SHA1 Message Date
practicalswift
9eb2ee0638 [gardening] Fix accidental double spaces 2016-02-14 17:30:44 +01:00
John McCall
1f3b3142b4 Distinguish conformance and superclass generic requirements.
As part of this, use a different enum for parsed generic requirements.

NFC except that I noticed that ASTWalker wasn't visiting the second
type in a conformance constraint; fixing this seems to have no effect
beyond producing better IDE annotations.
2016-01-11 16:07:37 -08:00
Xi Ge
264e91d3c4 [SourceKit] Allow SourceEntityWalker to visit generic type parameters of type decls.
This unlocks SourceKit's "find related identifiers" request on generic type params. rdar://22356526
2015-12-03 15:12:16 -08:00
Doug Gregor
7ba3cd27a9 Stop setting a bound type on top-level IdentTypeReprs.
Swift SVN r32432
2015-10-04 06:18:23 +00:00
Doug Gregor
6af6048c0c AST printing: take more care to only escape 'Self' when needed.
Cleans up AST printing somewhat as well as providing slightly better
type-to-declaration mappings for annotated AST printing and indexing.

Swift SVN r32420
2015-10-03 05:13:52 +00:00
Argyrios Kyrtzidis
012f6cb083 [IDE] Make sure to process the body of a defer statement properly.
Fixes IDE features (except code-completion) not working inside 'defer'.
rdar://22849414.

Swift SVN r32254
2015-09-26 00:50:39 +00:00
Argyrios Kyrtzidis
84e27fa26d [IDE] Properly annotate subscript brackets as references to subscript decls and enable jump-to-definition for them.
rdar://22099838

Swift SVN r30910
2015-08-01 05:36:13 +00:00
Xi Ge
57489ceb0f [SyntaxHighlighting] Give ASTWalker the option to walk into generic params of function decls.
Therefore, generic params can also benefit from syntax highlighting and semantic annotation
in SourceKit. rdar://20529255

Swift SVN r30220
2015-07-15 18:28:09 +00:00
Chris Lattner
107282297f two changes:
1) Teach resolveImmutableBase about SubscriptExprs that have 
resolved the decl that they are referring to.  This fixes case where we'd
generate an imprecise diagnostic because we weren't able to find the
result in the ResolvedOverloadSet list (which is because CSApply rewrite
it to a different expr node and the locator can't find it).

2) Change FailureDiagnosis::typeCheckIndependentSubExpression to have a
   blacklist of expressions that aren't recursed into, along with rationale
   for each node kind, instead of a short white list.  This produces more
   predictable results, e.g. producing the right diagnostic in 
   ClangModules/objc_parse.swift



Swift SVN r30118
2015-07-11 21:40:18 +00:00
Devin Coughlin
c67ac0d63b [Sema] Add source location for synthesized designated initializer overrides.
When synthesizing designated initializer overrides, set the source location
for the synthesized ConstructorDecl to the location of the opening brace of
the containing ClassDecl. This resolves an assertion failure when constructing
type refinement contexts when whole-program optimization is turned on.

rdar://problem/21233342

Swift SVN r29384
2015-06-15 19:46:09 +00:00
Ben Langmuir
c5fbbc0d38 [SourceEntityWalker] Pass module DeclRef through visitModuleReference
This returns to the behaviour we had before ModuleDecl came about.  It
fixes an assertion in SourceKit concerning the kinds of decls we will
visit in visitDeclReference. As the comments indicate, we need this
special case until Swift supports first class submodules.

Swift SVN r28934
2015-05-22 21:17:09 +00:00
Argyrios Kyrtzidis
a6f143b87e [AST] Add AST walking for the TypeLoc of IsPattern.
Fixes rdar://21032179

Swift SVN r28822
2015-05-20 04:06:38 +00:00
Dmitri Hrybenko
f46f16ae82 stdlib: implement new print() API
rdar://20775683

Swift SVN r28309
2015-05-08 01:37:59 +00:00
Argyrios Kyrtzidis
68bd67fc12 [Parse/AST] Introduce an AST node for editor placeholders in expression contexts.
If the placeholder is a typed one, parse its type string into a TypeRepr,
resolve it during typechecking and set it as the type for the associated EditorPlaceholderExpr.

Swift SVN r26215
2015-03-17 01:53:02 +00:00
Argyrios Kyrtzidis
944e20949a [AST/IDE] Use TypeReprs to keep track of the type components in an ExtensionDecl.
This allows preserving type info and proper annotation of the extension's type components.

Swift SVN r25309
2015-02-16 08:36:16 +00:00
Joe Pamer
e452c87edb If an expression fails to type check because one of its sub-expressions is a failed call expression, make sure that the inner call expression's diagnostic is surfaced. Doing so address rdar://problem/19419422, rdar://problem/19437880 and rdar://problem/19559649.
Swift SVN r24935
2015-02-04 02:03:41 +00:00
Denis Vnukov
844fe7dd77 Fix for rdar://19614869, Fuzzing Swift: AnnotAndDiagASTConsumer crashes in SemaAnnotator::walkToDeclPost(...): Assertion failed: "lazy var not implicitly computed"
Minor: modified assertion to handle invalid getters.



Swift SVN r24896
2015-02-02 19:09:51 +00:00
Doug Gregor
2bf69a0ea0 Require witnesses for @objc requirements to be @objc.
Previously, we attempted to infer @objc-ness based on conformance, but
doing so is fraught with ordering dependencies, and just doesn't work
in the general case. Among other crimes, this allowed us to
retroactively mark a non-@objc method from an imported module as
@objc... even though nobody would ever then emit the @objc entry
points for it.

Fixes the rest of rdar://problem/18383574.

Swift SVN r24831
2015-01-29 22:53:53 +00:00
Dmitri Hrybenko
3b04d1b013 tests: reorganize tests so that they actually use the target platform
Most tests were using %swift or similar substitutions, which did not
include the target triple and SDK.  The driver was defaulting to the
host OS.  Thus, we could not run the tests when the standard library was
not built for OS X.

Swift SVN r24504
2015-01-19 06:52:49 +00:00
Doug Gregor
8cf718f9f6 Don't allow a generic parameter with a non-@objc protocol requirement to bind to an existential.
We don't properly open up the existential to make this work, which
leads to an IRGen crash. Reject the uses of generics that would cause
such a crash rdar://problem/17491663.


Swift SVN r21946
2014-09-15 17:36:26 +00:00
Argyrios Kyrtzidis
7049168e4b [IDE] Annotate the explicit result type of a closure.
Swift SVN r21808
2014-09-09 16:53:33 +00:00
Doug Gregor
e9037bcfa7 Default swift-ide-test to -implicit-objc-with like the rest of the world.
We require some level of consistency between the way the overlays were
built and what we work with in our mock SDK. The IDE/sdk_sugar.swift
test failure was because the overlay referenced "init(coder:)" while
the test was looking for "init(withCoder:)". Hilarity ensued
<rdar://problem/17791048>.

This only impacts testing.

Swift SVN r20564
2014-07-25 22:13:43 +00:00
Ben Langmuir
2113e3a592 Walk through the initializer for a lazy property in SourceEntityWalker
@lazy foo: Int = {
  // Required for syntax highlighting and quick help here.
}()

Swift SVN r20078
2014-07-17 06:43:02 +00:00
Ben Langmuir
09f465ee64 Don't print sugar or generic parameters in extensions
Before:
extension [T] : P { }
extension Foo<T> : P { }

After:
extension Array : P { }
extension Foo : P { }

<rdar://problem/16613904>

Swift SVN r20057
2014-07-16 22:55:48 +00:00
Chris Lattner
4dd6c6ee2c fix a use of the old range syntax.
Swift SVN r19925
2014-07-14 14:27:57 +00:00
Ted Kremenek
9eea282719 Switch range operators ".." and "...".
- 1..3 now means 1,2
- 1...3 now means 1,2,3

Implements <rdar://problem/16839891>

Swift SVN r18066
2014-05-14 07:36:00 +00:00
Ted Kremenek
fad874708e Adjust test cases.
Swift SVN r17964
2014-05-12 22:01:52 +00:00
Argyrios Kyrtzidis
0fe6d45e62 [IDE] Introduce semantic annotation functionality and test.
Swift SVN r8618
2013-09-25 01:35:36 +00:00