Commit e176e65
committed
[generator] covariant return type fixes need to happen later on
When testing generator upstream in xamarin-android, I was getting NREs
generating `Mono.Android.dll`.
It appears that `OnValidate` was a bit too early to do the work for
fixing covariant return types. It seems that `OnValidate` needs to
happen on all base classes and interfaces, which *can* work if your
types happen to be in the right order.
So I followed the pattern for some of the other fixups in generator:
- Add a `FixupCovariantReturnTypes` method to `GenBase`
- Call this as a “pass” that happens first, before `FillProperties`
- Make sure to call `FixupCovariantReturnTypes` recursively on nested
types
Also:
- Made the variable declarations for `foreach` loops in `CodeGenerator`
all match1 parent d9e0953 commit e176e65
2 files changed
+26
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
326 | | - | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
327 | 330 | | |
328 | 331 | | |
329 | 332 | | |
330 | 333 | | |
331 | 334 | | |
332 | | - | |
| 335 | + | |
333 | 336 | | |
334 | 337 | | |
335 | | - | |
| 338 | + | |
336 | 339 | | |
337 | 340 | | |
338 | 341 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | 418 | | |
432 | 419 | | |
433 | 420 | | |
| |||
740 | 727 | | |
741 | 728 | | |
742 | 729 | | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
743 | 750 | | |
744 | 751 | | |
745 | 752 | | |
| |||
0 commit comments