Commit a6a96da
committed
AST: Source range of FuncDecl/ConstructorDecl should include the thrown type
When a function declaration has a body, its source range ends at the
closing curly brace, so it includes the `throws(E)`. However, a
protocol requirement doesn't have a body, and due to an oversight,
getSourceRange() was never updated to include the extra tokens
that appear after `throws` when the function declares a thrown
error type. As a result, unqualified lookup would fail to find a
generic parameter type, if that happened to be the thrown type.
Fixes rdar://problem/143950572.1 parent 4937d0a commit a6a96da
File tree
6 files changed
+69
-43
lines changed- include/swift/AST
- lib
- AST
- IDE
- test
- IDE
- decl/protocol
- tools/SourceKit/lib/SwiftLang
6 files changed
+69
-43
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8078 | 8078 | | |
8079 | 8079 | | |
8080 | 8080 | | |
8081 | | - | |
| 8081 | + | |
| 8082 | + | |
| 8083 | + | |
| 8084 | + | |
| 8085 | + | |
8082 | 8086 | | |
8083 | 8087 | | |
8084 | 8088 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9950 | 9950 | | |
9951 | 9951 | | |
9952 | 9952 | | |
9953 | | - | |
| 9953 | + | |
9954 | 9954 | | |
9955 | | - | |
9956 | | - | |
9957 | | - | |
| 9955 | + | |
| 9956 | + | |
| 9957 | + | |
| 9958 | + | |
| 9959 | + | |
| 9960 | + | |
| 9961 | + | |
9958 | 9962 | | |
9959 | | - | |
| 9963 | + | |
| 9964 | + | |
| 9965 | + | |
| 9966 | + | |
| 9967 | + | |
| 9968 | + | |
| 9969 | + | |
| 9970 | + | |
| 9971 | + | |
| 9972 | + | |
| 9973 | + | |
| 9974 | + | |
| 9975 | + | |
| 9976 | + | |
9960 | 9977 | | |
9961 | 9978 | | |
9962 | 9979 | | |
| |||
10993 | 11010 | | |
10994 | 11011 | | |
10995 | 11012 | | |
10996 | | - | |
| 11013 | + | |
10997 | 11014 | | |
10998 | | - | |
| 11015 | + | |
10999 | 11016 | | |
11000 | 11017 | | |
11001 | 11018 | | |
11002 | | - | |
11003 | | - | |
11004 | | - | |
11005 | | - | |
11006 | | - | |
11007 | | - | |
11008 | | - | |
11009 | | - | |
11010 | | - | |
11011 | | - | |
11012 | | - | |
11013 | | - | |
11014 | | - | |
11015 | | - | |
11016 | | - | |
11017 | | - | |
| 11019 | + | |
11018 | 11020 | | |
11019 | | - | |
11020 | | - | |
11021 | | - | |
| 11021 | + | |
| 11022 | + | |
| 11023 | + | |
| 11024 | + | |
11022 | 11025 | | |
11023 | | - | |
11024 | | - | |
| 11026 | + | |
| 11027 | + | |
11025 | 11028 | | |
11026 | | - | |
11027 | | - | |
| 11029 | + | |
| 11030 | + | |
| 11031 | + | |
| 11032 | + | |
| 11033 | + | |
| 11034 | + | |
| 11035 | + | |
| 11036 | + | |
11028 | 11037 | | |
11029 | | - | |
11030 | | - | |
11031 | | - | |
11032 | | - | |
| 11038 | + | |
11033 | 11039 | | |
11034 | 11040 | | |
11035 | 11041 | | |
| |||
11133 | 11139 | | |
11134 | 11140 | | |
11135 | 11141 | | |
11136 | | - | |
11137 | | - | |
11138 | 11142 | | |
11139 | 11143 | | |
11140 | 11144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
873 | 873 | | |
874 | 874 | | |
875 | 875 | | |
876 | | - | |
| 876 | + | |
877 | 877 | | |
878 | 878 | | |
879 | 879 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
48 | 52 | | |
49 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
50 | 57 | | |
51 | 58 | | |
52 | 59 | | |
| |||
55 | 62 | | |
56 | 63 | | |
57 | 64 | | |
58 | | - | |
| 65 | + | |
| 66 | + | |
59 | 67 | | |
60 | 68 | | |
61 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
890 | 890 | | |
891 | 891 | | |
892 | 892 | | |
893 | | - | |
| 893 | + | |
894 | 894 | | |
895 | 895 | | |
896 | | - | |
| 896 | + | |
897 | 897 | | |
898 | 898 | | |
899 | 899 | | |
900 | 900 | | |
901 | 901 | | |
902 | 902 | | |
903 | | - | |
| 903 | + | |
904 | 904 | | |
905 | 905 | | |
906 | 906 | | |
| |||
0 commit comments