Commit 5b75df9
committed
Add constructors for TypeOrBounds that are not refs or PolyType
Constructors added:
- TypeBounds
- ConstantType
- AnnotatedType
- AndType
- OrType
- TypeLambda
- MatchType
All these types are tested by using `=:=` to compare them to equivalent type quotes. Additional tests are included for constructors that
were not added `Refinement` and `AppliedType` because they are related and would have been added were they not originally
present.
Aside from constructors, `TypeLambda.param(Int)` was added in order to refer to the parameters of a `TypeLambda` during
construction.
An accessor for `internal.MatchCase[_,_]` was also added to make the `MatchType` constructor useable in practice.
Things like `TypeRef`, `TermRef`, `ThisType` are not included because I could not think of a use for them that is not
better (and more safely) served by less direct methods as I used in my test code.
`PolyType` is not included because to test that we would need need a way to synthesize `DefDef` declarations, which is not
currently supported. `ByNameType` (or, `ExprType`) is also not testable for similar reasons.1 parent 7a99d3d commit 5b75df9
File tree
6 files changed
+123
-0
lines changed- compiler/src/dotty/tools/dotc/tastyreflect
- library/src/scala/tasty/reflect
- tests/run-macros
- tasty-construct-types
6 files changed
+123
-0
lines changedLines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1117 | 1117 | | |
1118 | 1118 | | |
1119 | 1119 | | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
1120 | 1123 | | |
1121 | 1124 | | |
1122 | 1125 | | |
| |||
1201 | 1204 | | |
1202 | 1205 | | |
1203 | 1206 | | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
1204 | 1210 | | |
1205 | 1211 | | |
1206 | 1212 | | |
| |||
1305 | 1311 | | |
1306 | 1312 | | |
1307 | 1313 | | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
1308 | 1317 | | |
1309 | 1318 | | |
1310 | 1319 | | |
| |||
1317 | 1326 | | |
1318 | 1327 | | |
1319 | 1328 | | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
1320 | 1332 | | |
1321 | 1333 | | |
1322 | 1334 | | |
| |||
1329 | 1341 | | |
1330 | 1342 | | |
1331 | 1343 | | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
1332 | 1347 | | |
1333 | 1348 | | |
1334 | 1349 | | |
| |||
1341 | 1356 | | |
1342 | 1357 | | |
1343 | 1358 | | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
1344 | 1362 | | |
1345 | 1363 | | |
1346 | 1364 | | |
| |||
1445 | 1463 | | |
1446 | 1464 | | |
1447 | 1465 | | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
1448 | 1469 | | |
1449 | 1470 | | |
| 1471 | + | |
| 1472 | + | |
1450 | 1473 | | |
1451 | 1474 | | |
1452 | 1475 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
797 | 797 | | |
798 | 798 | | |
799 | 799 | | |
| 800 | + | |
| 801 | + | |
800 | 802 | | |
801 | 803 | | |
802 | 804 | | |
| |||
887 | 889 | | |
888 | 890 | | |
889 | 891 | | |
| 892 | + | |
| 893 | + | |
890 | 894 | | |
891 | 895 | | |
892 | 896 | | |
| |||
941 | 945 | | |
942 | 946 | | |
943 | 947 | | |
| 948 | + | |
| 949 | + | |
944 | 950 | | |
945 | 951 | | |
946 | 952 | | |
| |||
949 | 955 | | |
950 | 956 | | |
951 | 957 | | |
| 958 | + | |
| 959 | + | |
952 | 960 | | |
953 | 961 | | |
954 | 962 | | |
| |||
957 | 965 | | |
958 | 966 | | |
959 | 967 | | |
| 968 | + | |
| 969 | + | |
960 | 970 | | |
961 | 971 | | |
962 | 972 | | |
| |||
965 | 975 | | |
966 | 976 | | |
967 | 977 | | |
| 978 | + | |
| 979 | + | |
968 | 980 | | |
969 | 981 | | |
970 | 982 | | |
| |||
1037 | 1049 | | |
1038 | 1050 | | |
1039 | 1051 | | |
| 1052 | + | |
| 1053 | + | |
1040 | 1054 | | |
1041 | 1055 | | |
| 1056 | + | |
1042 | 1057 | | |
1043 | 1058 | | |
1044 | 1059 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| |||
205 | 206 | | |
206 | 207 | | |
207 | 208 | | |
| 209 | + | |
| 210 | + | |
208 | 211 | | |
209 | 212 | | |
210 | 213 | | |
| |||
221 | 224 | | |
222 | 225 | | |
223 | 226 | | |
| 227 | + | |
| 228 | + | |
224 | 229 | | |
225 | 230 | | |
226 | 231 | | |
| |||
237 | 242 | | |
238 | 243 | | |
239 | 244 | | |
| 245 | + | |
240 | 246 | | |
241 | 247 | | |
242 | 248 | | |
| |||
253 | 259 | | |
254 | 260 | | |
255 | 261 | | |
| 262 | + | |
| 263 | + | |
256 | 264 | | |
257 | 265 | | |
258 | 266 | | |
| |||
263 | 271 | | |
264 | 272 | | |
265 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
266 | 282 | | |
267 | 283 | | |
268 | 284 | | |
| |||
381 | 397 | | |
382 | 398 | | |
383 | 399 | | |
| 400 | + | |
| 401 | + | |
384 | 402 | | |
385 | 403 | | |
386 | 404 | | |
387 | 405 | | |
388 | 406 | | |
389 | 407 | | |
390 | 408 | | |
| 409 | + | |
391 | 410 | | |
392 | 411 | | |
393 | 412 | | |
| |||
400 | 419 | | |
401 | 420 | | |
402 | 421 | | |
| 422 | + | |
| 423 | + | |
403 | 424 | | |
404 | 425 | | |
405 | 426 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
0 commit comments