Commit Graph

8 Commits

Author SHA1 Message Date
Hamish Knight
396a6a8fe6 Enable InlineArray type sugar
Promote it from an experimental feature.

rdar://155607927
2025-08-04 15:16:30 +01:00
Hamish Knight
5d1f219acb Change InlineArray sugar separator x -> of 2025-05-30 13:50:22 +01:00
Alejandro Alonso
e68b398d41 Rename isArrayType and split the InlineArray portion 2025-04-29 15:57:10 -07:00
Hamish Knight
f8ab391737 Introduce type sugar for InlineArray (#80087)
* [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.
2025-03-23 15:31:37 -07:00
Alejandro Alonso
c1bb143648 Make ValueGenerics feature always available 2025-02-27 10:03:37 -08:00
Alejandro Alonso
ce1adf91c3 Update inlinearray.swift 2025-02-11 13:35:21 -08:00
Alejandro Alonso
6b78b78165 Update test/Sema/inlinearray.swift
Co-authored-by: Guillaume Lessard <glessard@tffenterprises.com>
2025-02-11 13:34:17 -08:00
Alejandro Alonso
e4fb1f6761 Rename Slab to InlineArray 2025-02-11 10:26:44 -08:00