mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
* [CS] Decline to handle InlineArray in shrink Previously we would try the contextual type `(<int>, <element>)`, which is wrong. Given we want to eliminate shrink, let's just bail. * [Sema] Sink `ValueMatchVisitor` into `applyUnboundGenericArguments` Make sure it's called for sugar code paths too. Also let's just always run it since it should be a pretty cheap check. * [Sema] Diagnose passing integer to non-integer type parameter This was previously missed, though would have been diagnosed later as a requirement failure. * [Parse] Split up `canParseType` While here, address the FIXME in `canParseTypeSimpleOrComposition` and only check to see if we can parse a type-simple, including `each`, `some`, and `any` for better recovery. * Introduce type sugar for InlineArray Parse e.g `[3 x Int]` as type sugar for InlineArray. Gated behind an experimental feature flag for now.
10 lines
304 B
Swift
10 lines
304 B
Swift
// RUN: %batch-code-completion -enable-experimental-feature InlineArrayTypeSugar
|
|
|
|
// REQUIRES: swift_feature_InlineArrayTypeSugar
|
|
|
|
struct FooBar {}
|
|
|
|
[3 x #^COMPLETE_TOPLEVEL?check=COMPLETE^#
|
|
let _: [3 x #^COMPLETE_TYPE?check=COMPLETE^#
|
|
// COMPLETE: Decl[Struct]/CurrModule: FooBar[#FooBar#]; name=FooBar
|