Commit 5b32352
Disable speculative array TypeMap emission (ILLink crash)
Reverts the runtime swap and factory-method removal from the previous
commit. Keeps the new `ITypeMapWithAliasing.TryGetType` raw lookup and
`TrimmableTypeMap.TryGetArrayType` helper as scaffolding for the
eventual ILLink-fixed approach.
The speculative `[L<jni>;` / `[[L<jni>;` / `[[[L<jni>;` TypeMap entries
crash ILLink with:
System.NotSupportedException: TypeDefinition cannot be resolved from
'Mono.Cecil.ArrayType' type
at Mono.Linker.LinkContext.Resolve(TypeReference typeReference)
at Mono.Linker.TypeMapHandler.RecordTypeMapEntry(...) (3-arg form)
at Mono.Linker.TypeMapHandler.MarkTypeMapAttribute(...) (2-arg form)
at Mono.Linker.TypeMapHandler.ProcessExternalTypeMapGroupSeen(...)
Both 2-arg and 3-arg TypeMap forms are affected — `MarkTypeMapAttribute`
calls `LinkContext.Resolve` on the `TargetType` slot (constructor arg
index 1) for any TypeMap, and Cecil's `ArrayType` is not a
`TypeDefinition`. There is no shape of `TypeMapAttribute` today that
accepts a closed array `Type`.
`EmitArrayEntries` is now a documented no-op.
`JavaPeerContainerFactory<T>.CreateArray` and
`CreateHigherRankArray` are restored.
`JNIEnv.ArrayCreateInstance` falls back to the legacy per-T factory
under trimmable.
Trimmable + CoreCLR lane after revert: 917 total, 0 errors, 3 failures
(pre-existing `TryGetJniNameForManagedType_*`, out of scope — same
baseline as #11225).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 4b0b089 commit 5b32352
4 files changed
Lines changed: 73 additions & 145 deletions
File tree
- src
- Microsoft.Android.Sdk.TrimmableTypeMap/Generator
- Mono.Android
- Android.Runtime
- Java.Interop
- tests/Microsoft.Android.Sdk.TrimmableTypeMap.Tests/Generator
Lines changed: 13 additions & 41 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
235 | 232 | | |
236 | 233 | | |
237 | 234 | | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
| 235 | + | |
264 | 236 | | |
265 | 237 | | |
266 | 238 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
29 | 35 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
| |||
Lines changed: 43 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
| 13 | + | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
24 | 32 | | |
25 | 33 | | |
26 | 34 | | |
| |||
72 | 80 | | |
73 | 81 | | |
74 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
75 | 112 | | |
76 | 113 | | |
77 | 114 | | |
| |||
Lines changed: 8 additions & 92 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
778 | 778 | | |
779 | 779 | | |
780 | 780 | | |
781 | | - | |
782 | | - | |
783 | | - | |
| 781 | + | |
784 | 782 | | |
785 | 783 | | |
786 | 784 | | |
787 | 785 | | |
788 | | - | |
789 | | - | |
790 | | - | |
| 786 | + | |
791 | 787 | | |
792 | 788 | | |
793 | 789 | | |
794 | | - | |
| 790 | + | |
795 | 791 | | |
796 | 792 | | |
797 | 793 | | |
| |||
800 | 796 | | |
801 | 797 | | |
802 | 798 | | |
803 | | - | |
804 | | - | |
805 | | - | |
806 | | - | |
807 | | - | |
808 | 799 | | |
809 | 800 | | |
810 | 801 | | |
| |||
857 | 848 | | |
858 | 849 | | |
859 | 850 | | |
860 | | - | |
861 | | - | |
862 | | - | |
863 | | - | |
864 | | - | |
865 | | - | |
866 | | - | |
867 | | - | |
868 | | - | |
869 | | - | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
870 | 855 | | |
871 | 856 | | |
872 | | - | |
| 857 | + | |
873 | 858 | | |
874 | 859 | | |
875 | 860 | | |
876 | 861 | | |
877 | | - | |
878 | | - | |
879 | | - | |
880 | | - | |
881 | | - | |
882 | | - | |
883 | | - | |
884 | | - | |
885 | | - | |
886 | | - | |
887 | | - | |
888 | | - | |
889 | | - | |
890 | | - | |
891 | | - | |
892 | | - | |
893 | | - | |
894 | | - | |
895 | | - | |
896 | | - | |
897 | | - | |
898 | | - | |
899 | | - | |
900 | | - | |
901 | | - | |
902 | | - | |
903 | | - | |
904 | | - | |
905 | | - | |
906 | | - | |
907 | | - | |
908 | | - | |
909 | | - | |
910 | | - | |
911 | | - | |
912 | | - | |
913 | | - | |
914 | | - | |
915 | | - | |
916 | | - | |
917 | | - | |
918 | | - | |
919 | | - | |
920 | | - | |
921 | | - | |
922 | | - | |
923 | | - | |
924 | | - | |
925 | | - | |
926 | | - | |
927 | | - | |
928 | | - | |
929 | | - | |
930 | | - | |
931 | | - | |
932 | | - | |
933 | | - | |
934 | | - | |
935 | | - | |
936 | | - | |
937 | | - | |
938 | | - | |
939 | | - | |
940 | | - | |
941 | | - | |
942 | | - | |
943 | | - | |
944 | | - | |
945 | | - | |
946 | 862 | | |
947 | 863 | | |
948 | 864 | | |
| |||
0 commit comments