Skip to content

[Mono.Android.dll] Add support for ObsoletedOSPlatformAttribute #7234

@jpobst

Description

@jpobst

Context: #6349
Context: dotnet/runtime#47601

Imagine Android adds a new overload of a method and deprecates the existing method:

[SupportedOSPlatformAttribute ("android33.0")]
public void Foo (string bar) { ... }

[Obsolete]
[SupportedOSPlatformAttribute ("android26.0")]
public void Foo (int bar) { ... }

If you are compiling against API-33 reference assemblies, there is no reasonable way to consume this API without generating an "obsolete" warning:

  • Using the old method generates a warning
  • Using the new method won't work on pre-API-33

In .NET 6 we did not have a good way to express "obsoleted in API X" warnings. In .NET 7 [ObsoletedOSPlatformAttribute] has been added, allowing us to express this properly.

In order to support this, we will need to:

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions