Created
September 30, 2020 20:14
-
-
Save lambdageek/40e2a18aa4cbca6c95bac9025d3c051d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework> | |
<EnableTargetingPackDownload>false</EnableTargetingPackDownload> | |
<LanguageVersion>latest</LanguageVersion> | |
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | |
<RunAnalyzers>false</RunAnalyzers> | |
</PropertyGroup> | |
<!-- Redirect 'dotnet publish' to in-tree runtime pack --> | |
<Target Name="TrickRuntimePackLocation" AfterTargets="ProcessFrameworkReferences"> | |
<ItemGroup> | |
<RuntimePack> | |
<PackageDirectory>$(ArtifactsBinDir)microsoft.netcore.app.runtime.$(RuntimeIdentifier)\$(Configuration)</PackageDirectory> | |
</RuntimePack> | |
</ItemGroup> | |
<Message Text="Packaged ID: %(RuntimePack.PackageDirectory)" Importance="high" /> | |
</Target> | |
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TOP=../../../../../ | |
DOTNET:=$(TOP)./dotnet.sh | |
DOTNET_Q_ARGS=--nologo -v:q -consoleloggerparameters:NoSummary | |
MONO_CONFIG=Release | |
MONO_ARCH=x64 | |
OS := $(shell uname -s) | |
ifeq ($(OS),Darwin) | |
TARGET_OS=osx | |
else | |
TARGET_OS=linux | |
endif | |
publish: | |
$(DOTNET) publish -c $(MONO_CONFIG) -r $(TARGET_OS)-$(MONO_ARCH) | |
# MONO_ENV_OPTIONS="--llvm" \ | |
# | |
run: publish | |
COMPlus_DebugWriteToStdErr=1 \ | |
$(TOP)artifacts/bin/HelloWorld/$(MONO_ARCH)/$(MONO_CONFIG)/$(TARGET_OS)-$(MONO_ARCH)/publish/HelloWorld | |
clean: | |
rm -rf $(TOP)artifacts/bin/HelloWorld/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Licensed to the .NET Foundation under one or more agreements. | |
// The .NET Foundation licenses this file to you under the MIT license. | |
using System; | |
using System.Reflection; | |
Console.WriteLine($"typeof(delegate*<int>):\t\t\t\t{typeof(delegate*<int>)}"); | |
Console.WriteLine($"typeof(delegate*<int>[]:\t\t\t{typeof(delegate*<int>[])}"); | |
Console.WriteLine($"typeof(delegate*<int>*):\t\t\t{typeof(delegate*<int>*)}"); | |
Console.WriteLine($"typeof(delegate*<int>[]).GetElementType():\t{typeof(delegate*<int>[]).GetElementType()}"); | |
Console.WriteLine(); | |
Console.WriteLine($"Methods on {nameof(Foo)}:"); | |
foreach (var m in typeof(Foo).GetMethods(BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.Static)) | |
{ | |
Console.WriteLine(m); | |
Console.WriteLine($" {m.GetParameters()[0].ParameterType}"); | |
} | |
unsafe static class Foo | |
{ | |
public static void Method(delegate*<int, int> a) => throw null; | |
public static void Method(delegate*<long, long> a) => throw null; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment