Commit Graph

7 Commits

Author SHA1 Message Date
Mike Ash
91dcf8d298 [Runtime] Fix subscript key path printing when arguments can't be resolved.
If there's a mismatch between the arguments we match and the arguments we actually have, we can end up indexing off the end of the argumentTypeNames vector. This can happen when an argument has a dependent generic type. Add a bounds check and print <unknown> when we're out of bounds to avoid crashing.

For correctness, we should match generic dependent types and add them to the arguments array, but we'll fix the crashes first.

rdar://104438524
2023-03-02 13:46:44 -05:00
Mike Ash
f440432891 [Runtime] Fix debugDescription of .self keypaths.
AnyKeyPath's debugDescription assumes there's always at least one component, but `\Type.self` produces an empty keypath. Special-case the empty case to display a `.self` component.

rdar://103237845
2022-12-12 14:34:22 -05:00
Arnold Schwaighofer
f9a56205a3 test/Interpreter/keypath.swift does not work in back-deployment scenarios anymore
The file check expectations (the way we print stuff) is different after #60133.

rdar://100564676
2022-09-29 08:50:13 -07:00
Ben Pious
57d82317c1 Add CustomDebugDescription conformance to AnyKeyPath (#60133)
* initial

* it works

demangling mostly works

fix dots

printing works

add tests

add conformance to AnyKeyPath

implement SPI

subscripts fully work

comments

use cross platform image inspection

remove unnecessary comment

fix

fix issues

add conditional conformance

add types

try to fix the api-digester test

cr feedback: move impls behind flag, remove addChain(), switch statement, fallthrough instead of if-elses, move import

cr feedback: refactor switch statement

fix #ifdef

reindent, cr feedback: removes manual memory management

fix missing whitespace

fix typo

fix indentation issues

switch to regexes

checks should test in on all platforms

print types in subscripts

add test for empty subscript

Update test/api-digester/stability-stdlib-abi-without-asserts.test

Co-authored-by: Xiaodi Wu <13952+xwu@users.noreply.github.com>

add commas

fix failing test

fix stdlib annotation

cr feedback: remove global, refactor ifdef

cr feedback: switch back to manual memory management

switch to 5.8 macro

add new weakly linked functions to the allowlist

fix one more failing test

more cr feedback

more cr feedback

* fix invisible unicode
2022-09-13 09:23:32 -07:00
Josh Soref
7aefe0162e Spelling test interpreter (#58566)
* spelling: bridgeable

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: constrained

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: exist

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: overridden

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2022-05-04 19:23:25 -07:00
Arnold Schwaighofer
bd6fa67f39 Fix generic class constraint keypath 2019-06-10 09:02:46 -07:00
Arnold Schwaighofer
bc9eac9f1f IRGen: Allow stored_property keypaths on class constraint archetypes
rdar://50271944
2019-06-06 07:59:52 -07:00