Skip to content

Commit

Permalink
Merge branch 'main' into allow-download-triggered-pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
mandel-macaque committed May 10, 2024
2 parents 72b246d + bc9575e commit 449e5c9
Show file tree
Hide file tree
Showing 13 changed files with 397 additions and 77 deletions.
72 changes: 72 additions & 0 deletions docs/preview-apis.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Preview APIs

The APIs listed here are currently marked as preview APIs, and as such may
change in the future (we don't guarante binary or source compatibility between
releases for these APIs).

We've marked these APIs using the [Experimental][1] attribute, which means
that compilation error will be shown if they're used:

> error APL0001: 'PreviewAPI' is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
This means that it's not possible to use these preview APIs by accident, the diagnostic has to be explicitly ignored.

Example program consuming preview API:

```cs
using System.Diagnostics.CodeAnalysis;

class App
{
public static void Main ()
{
Do.Something ();
}
}

[Experimental ("APL0001")]
class Do {
public static void Something () {}
}
```

this will show:

> Program.cs(8,9): error APL0001: 'Do' is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
Then ignore the warning in order to make the code compile:

```cs
using System.Diagnostics.CodeAnalysis;

class App
{
public unsafe static void Main ()
{
#pragma warning disable APL0001
Do.Something ();
#pragma warning restore APL0001
}
}

[Experimental ("APL0001")]
class Do {
public static void Something () {}
}

```

Our diagnostic IDs will be of the format `APL####` - for instance `APL0001` -
where the number is just monotonically increasing since the previous number,
without any specific meaning.

References:

* https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.experimentalattribute?view=net-8.0
* https://learn.microsoft.com/en-us/dotnet/fundamentals/apicompat/preview-apis#experimentalattribute

## Placeholder header for APL####

Coming soon!

[1]: https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.experimentalattribute?view=net-8.0
2 changes: 1 addition & 1 deletion src/Foundation/NSUrlSessionHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

#nullable enable

#if !MONOMAC
#if !MONOMAC && !XAMCORE_5_0
namespace System.Net.Http {
#else
namespace Foundation {
Expand Down
Loading

16 comments on commit 449e5c9

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

Please sign in to comment.