Commit ec8c61e
[TrimmableTypeMap] Skip UCO constructor generation for abstract types (#11461)
* Skip UCO constructor generation for abstract types
Abstract types are never directly instantiated from Java — the ACW
constructor's getClass() guard prevents activation. Generating UCO
constructor wrappers for them is dead code and fails when the managed
constructor is protected (which is legitimate for abstract types).
This fixes XAGTT7009 errors when using the trimmable type map with
abstract types like MAUI's CellAdapter that have protected constructors.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Assisted-by: Claude:claude-opus-4.6-1m
* Add test: abstract type with protected ctor builds with trimmable typemap
Verifies that abstract Java peer types with protected constructors do not
cause XAGTT7009 when using _AndroidTypeMapImplementation=trimmable.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Assisted-by: Claude:claude-opus-4.6-1m
* Add unit test: abstract type skips UCO constructor generation
Verifies that BuildUcoConstructors produces no UCO constructors for
abstract types, even when the Java constructor has SuperArgumentsString
and no matching public managed constructor exists. This complements
the existing Build_ExportConstructorWithoutMatchingManagedCtor_Throws
test which covers the concrete type case.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Assisted-by: Claude:claude-opus-4.6-1m
* Add IgnoreUnsupportedConfiguration guard to NativeAOT integration test
Addresses Copilot review feedback: the test hard-codes NativeAOT without
the IgnoreUnsupportedConfiguration guard, which can cause failures in
environments where NativeAOT builds are skipped.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Assisted-by: Claude:claude-opus-4.6-1m
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Šimon Rozsíval <simon@rozsival.com>1 parent a28e5f2 commit ec8c61e
3 files changed
Lines changed: 58 additions & 0 deletions
File tree
- src
- Microsoft.Android.Sdk.TrimmableTypeMap/Generator
- Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests
- tests/Microsoft.Android.Sdk.TrimmableTypeMap.Tests/Generator
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
359 | 366 | | |
360 | 367 | | |
361 | 368 | | |
| |||
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
394 | 394 | | |
395 | 395 | | |
396 | 396 | | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
397 | 428 | | |
398 | 429 | | |
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1369 | 1369 | | |
1370 | 1370 | | |
1371 | 1371 | | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
1372 | 1392 | | |
1373 | 1393 | | |
1374 | 1394 | | |
| |||
0 commit comments