Commit af6a199
committed
Include optionality in AnyRegexOutput.Element.type
When reconstructing the type of a captured element for access through
the `AnyRegexOutput.Element.type` API, any optionality is being
omitted (e.g. `Int?` is returned as `Int`). This is both observable
through that API and results in a bug when accessing part of a
match's output through the dynamic member subscript (e.g. `match.1`).
In that case, the lack of optionality causes an incorrect calculation
of the output tuple member's position, resulting in the wrong member
being loaded and returned.
This change adds the missing optionality to the type.
Fixes swiftlang/swift#830221 parent 650b2c1 commit af6a199
File tree
2 files changed
+57
-2
lines changed- Sources/_StringProcessing/Regex
- Tests/RegexBuilderTests
2 files changed
+57
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
384 | | - | |
385 | | - | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
386 | 391 | | |
387 | 392 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1962 | 1962 | | |
1963 | 1963 | | |
1964 | 1964 | | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
| 1978 | + | |
| 1979 | + | |
| 1980 | + | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
| 1993 | + | |
| 1994 | + | |
| 1995 | + | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
| 1999 | + | |
| 2000 | + | |
| 2001 | + | |
| 2002 | + | |
| 2003 | + | |
| 2004 | + | |
| 2005 | + | |
| 2006 | + | |
| 2007 | + | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
| 2011 | + | |
| 2012 | + | |
| 2013 | + | |
| 2014 | + | |
1965 | 2015 | | |
1966 | 2016 | | |
1967 | 2017 | | |
| |||
0 commit comments