Commit Graph

17988 Commits

Author SHA1 Message Date
Jordan Rose
4b87bd93f9 Tweak DiagnosticEngine's 'aka' logic to only kick in for typealiases. (#9010)
Previously we had more ad hoc logic that tried to decide if it was
worth desugaring a type based on its structure. Now we instead look
for a typealias that might actually benefit from desugaring, and if
we don't find one we won't show the 'aka' note.
2017-04-25 19:37:22 -07:00
swift-ci
8551251b9b Merge pull request #9015 from gparker42/reinstate-mirror-test 2017-04-25 19:11:45 -07:00
Dave Abrahams
824af8cade [stdlib] UnicodeDecoders: improved benchmark instructions 2017-04-25 18:51:53 -07:00
Dave Abrahams
76b188f9dd [stdlib] UnicodeDecoders: inject _UIntBuffer
Use something a little higher-level for buffering bytes, so we can give the
Decoder's buffer a Collection requirement, on the way to building indexable
transcoded collections.

For now, we're still reaching into our high-level data structure's stored
properties rather than using its API.
2017-04-25 18:38:44 -07:00
John Holdsworth
981e706fd9 An implementation for 0168-multi-line-string-literals.md (#8813)
This adds support for SE-0168, multi-line string literals.

Extend the lexer to recognize the new literals. Test cases added.

There are still areas for future diagnostic improvement, such as fixits and notes as to why a multi-line string literal will be malformed. Multi-line literals are explicitly forbidden inside of string interpolation, though this may be relaxed in the future.
2017-04-25 18:13:03 -07:00
swift-ci
a321dcc679 Merge pull request #9022 from DougGregor/solver-lvalue-optional 2017-04-25 17:52:38 -07:00
swift-ci
9bbd5dcb74 Merge pull request #9020 from jrose-apple/subclass_existentials-32 2017-04-25 17:46:14 -07:00
Dave Abrahams
503fba9952 Rename _buffer -> _bufferStorage 2017-04-25 17:27:45 -07:00
Doug Gregor
a5868a6148 [Constraint solver] Look through lvalue types when establish nil-convertibility.
When determining whether our inference of an optional type should add
a layer of optionality, look through lvalue types.
Fixes rdar://problem/31779785.
2017-04-25 17:04:22 -07:00
Jordan Rose
7fe6db33a9 [test] Fix IRGen/subclass_existentials.sil on 32-bit platforms. 2017-04-25 17:01:32 -07:00
Dave Abrahams
06ee85c0fb [stdlib] UnicodeDecoders: nix wrong forward/reverse relationship
There may be a reason to do something like this once we start hooking up
indices, but the relationship isn't what we thought.
2017-04-25 16:57:38 -07:00
Michael Ilseman
fa61a665c5 [stdlib] Fix relative-offset computing bug in grapheme breaking.
Many of StringCore private APIs, when the StringCore is itself a
substring, expect relative offsets rather than absolute offsets. This
fixes a bug in the sub-0x300 fast path where we were using absolute
offsets. Test cases added.
2017-04-25 16:51:35 -07:00
Roman Levenstein
af2a59622e [sil-generic-specializer] Fix a bug related to cloning of self-referring generic closures
Fixes rdar://31776399
2017-04-25 16:31:42 -07:00
Ted Kremenek
758d5d465a Resolve merge conflict. 2017-04-25 16:21:56 -07:00
Ted Kremenek
8eed9ac58e Remove hard passing -swift-version X for some tests.
lit now passes ‘-swift-version X’ to
these tests as part of %target-swift-ide-test.

Note that these tests still require
-swift-version 3.
2017-04-25 16:18:29 -07:00
Ted Kremenek
be5d87a8c6 Add “-swift-version X” to %target-swift-ide-test substitution. 2017-04-25 16:17:08 -07:00
Doug Gregor
e858c553cb [GSB] Start inferring same-type requirements from inherited type declarations.
Infer same-type requirements among same-named associated
types/typealiases within inherited protocols. This is more staging; it
doesn't really have teeth until we stop wiring together these types as
part of lookup.
2017-04-25 16:13:48 -07:00
swift-ci
e44bcca607 Merge pull request #9014 from benlangmuir/nt-missing-name-piece 2017-04-25 15:58:38 -07:00
Xi Ge
7163a40ffb [Migrator] Support framework API function renames. rdar://31766131 (#9013) 2017-04-25 15:50:40 -07:00
Greg Parker
d7c5b31f32 Revert "[test] Temporarily disable test stdlib/Mirror.swift on armv7s."
This reverts commit 9681fbc59d.

This was a workaround for an LLVM bug that is now fixed.
2017-04-25 15:49:51 -07:00
Ben Langmuir
7e5dd1fa01 [sourcekitd] Allow mising name pieces preferred names
With the interpretation that they mean to retain whatever the name
piece was in the original name.
2017-04-25 15:25:53 -07:00
Jordan Rose
bae60156ce [swift-ide-test] Update -find-mangled to use the real logic. (#9008)
At the time this code was written, the logic to find a Decl from a
demangled name still lived in LLDB. Now that it's been sunk into
libIDE, we can test the actual behavior, though I've changed it to
find declarations rather than types.
2017-04-25 15:09:28 -07:00
Max Moiseev
b1898ab768 Porting String APIs to Subtring and fixing some tests 2017-04-25 14:58:06 -07:00
swift-ci
274dd86ba1 Merge pull request #9012 from huonw/emit-loaded-module-trace 2017-04-25 14:47:04 -07:00
swift-ci
6ca9bc5b6f Merge pull request #9006 from DougGregor/bridge-cast-optimize-downcast 2017-04-25 14:16:29 -07:00
Itai Ferber
22185d237f CodingKey/*Codable tests don't need ObjC interop
Since all of the core types are now in the Swift stdlib, the tests no
longer rely on objc_interop or Foundation.
2017-04-25 14:11:24 -07:00
Doug Gregor
f7e05fd951 [Bridging cast optimization] Unchecked casts can perform a class downcast.
Handle a class downcast following a bridging cast. Fixes
rdar://problem/31791421.
2017-04-25 13:43:06 -07:00
swift-ci
83ba94ba60 Merge pull request #9003 from DougGregor/rdar-31794932-part-deux 2017-04-25 13:27:01 -07:00
Huon Wilson
45bda6fe79 [Frontend] Change LOADED_MODULE_TRACE_PATH -> ..._FILE.
Accidentally wrote down the wrong name initially.
2017-04-25 13:19:49 -07:00
Itai Ferber
e2318392be Add CodingKey and *codable derived conformance
* Allow CodingKey conformance to be automatically derived for enums
  which have no raw type (with no associated values) and which have
  a raw type of String or Int.
* Allow Encodable and Decodable conformance to be automatically derived
  for classes and structs with Encodable/Decodable properties
* Add initial unit tests for verifying derived conformance
2017-04-25 13:13:35 -07:00
swift-ci
48a214c9f5 Merge pull request #9002 from akyrtzi/index-comment-tags 2017-04-25 12:44:40 -07:00
Doug Gregor
dd96aee1b1 [Type checker] Fix rethrow checking with a single argument label harder.
My original fix for rdar://problem/31794932 didn't work for generic
functions because it was checking in the unsubstituted interface
type. Check structurally instead. Fixes rdar://problem/31794932.
2017-04-25 12:37:32 -07:00
Argyrios Kyrtzidis
79ef8ae77c [index] Index documentation comment tags
rdar://30569973
2017-04-25 12:16:25 -07:00
practicalswift
ff827e0455 [gardening] Fix recently introduced typos 2017-04-25 21:03:44 +02:00
practicalswift
861f70e13d [gardening] Use consistent spacing 2017-04-25 21:03:43 +02:00
Dave Abrahams
a1686dc384 [stdlib] UnicodeDecoders: minor simplification/cleanup 2017-04-25 11:07:11 -07:00
Jacopo Andrea Giola
4c05532090 Change emitted error for @nonobjc invalid usage (#8480) 2017-04-25 10:11:26 -07:00
John McCall
e9fed042b8 Merge pull request #8994 from rjmccall/delay-inout-to-pointer-access
Delay the formal accesses associated with pointer conversions until the call
2017-04-25 12:58:37 -04:00
Jordan Rose
6f7925cb5d [ClangImporter] If enum_extensibility was removed, it's not an enum. (#8992)
(and similar for flag_enum)

This commit prepares the importer for a world in which NS_ENUM and
NS_OPTIONS have adopted the new Clang attributes 'enum_extensibility'
and 'flag_enum', but API notes are used to reverse the effect. Without
this there would be no transition path for adopting the standard Cocoa
macros, which have applied unconditionally up to now.

rdar://problem/18744821
2017-04-25 09:04:16 -07:00
Maxim Moiseev
13abb9a0a7 [stdlib] BinaryInteger func word(at:) => var words: Words (#8984)
* [stdlib] Underscoring BinaryInteger.word(at:)

* [stdlib] Implementing var words in terms of _word(at:)
2017-04-25 08:45:01 -07:00
Slava Pestov
e0391ca52e SILGen: More subclass existential tests 2017-04-25 02:42:15 -07:00
Slava Pestov
454495f974 IRGen: Subclass existential scalar downcasts
This handles the case where the left hand side of the cast is known
to be class-like, and the right hand side is known at compile time
to be a protocol composition type.

Note that this change results in a small optimization -- a checked
cast of a metatype known to be a class metatype to a class-constrained
existential metatype no longer has to emit an explicit check that
the source is class-constrained.

Fully dynamic casts are coming up next.
2017-04-25 02:42:14 -07:00
Slava Pestov
cb95ee3581 IRGen: Don't crash when emitting a capture descriptor containing an opened existential 2017-04-25 01:32:45 -07:00
Slava Pestov
743aaa7e3d Sema: Add another small test case for subclass existentials 2017-04-25 01:32:45 -07:00
Slava Pestov
c3391afbea Sema: A composition consisting of a single class type is equivalent to the class itself
Otherwise, you can run into confusing behavior.
2017-04-25 01:32:44 -07:00
John McCall
f7e73ccc48 Delay the formal accesses associated with inout-to-pointer and
array-to-pointer argument conversions until just before the call.

rdar://31781386
2017-04-25 03:54:49 -04:00
swift-ci
355b7c1456 Merge pull request #8981 from apple/stateful-unicode-decoding 2017-04-24 21:41:10 -07:00
Argyrios Kyrtzidis
9b9c84a708 Merge pull request #8972 from akyrtzi/index-external-symbol-namespacing
[index] Use a #pragma to apply module namespacing for exported ObjC header and match Swift namespaced USRs with the clang side
2017-04-24 21:13:12 -07:00
Argyrios Kyrtzidis
73c3a18055 [test/index] Add 'objc_interop' requirement to test/Index/cross_language.swift 2017-04-24 20:26:03 -07:00
Arnold Schwaighofer
a383adf9df Revert "Enable SourceKit tests if building SourceKit" 2017-04-24 17:59:03 -07:00