Skip to content

Instantly share code, notes, and snippets.

@migueldeicaza
migueldeicaza / gist:624675f0edc9f5dd1a908bf547445987
Created April 2, 2018 15:56
Public type surface for System.Runtime.Extensions.dll
Assembly Information:
Culture=neutral
PublicKeyToken=b03f5f7f11d50a3a
System.AppDomain
System.AppDomainUnloadedException
System.ApplicationId
System.AssemblyLoadEventArgs
@migueldeicaza
migueldeicaza / gist:43b28ef3ceb8db59ffc00b70eb37f309
Created April 25, 2017 01:54
Dictionary-literal improvement to allow literals to be assigned to other Dictionary-shaped objects
--- /dev/null 2017-04-24 21:53:22.000000000 -0400
+++ README.md 2017-04-24 21:53:03.000000000 -0400
@@ -0,0 +1,67 @@
+Current work:
+
+Trying to allow the existing patch for dictionary literals that allows:
+
+ var a = ["key":"value"];
+
+Which creates an inferred Dictionary<string,string> above into
mono$ mono /usr/local//share/dotnet/sdk/1.0.0-preview3-004056/csc.exe
Could not load signature of Microsoft.CodeAnalysis.CommonCompiler:ResolveAnalyzersFromArguments due to: Could not load file or assembly 'System.Collections.Immutable, Version=1.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. assembly:System.Collections.Immutable, Version=1.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:<unknown type> member:<none>
Unhandled Exception:
System.TypeLoadException: Could not load type of field 'Microsoft.CodeAnalysis.CoreClrAnalyzerAssemblyLoader:_loadContext' (0) due to: Could not load file or assembly 'System.Runtime.Loader, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. assembly:System.Runtime.Loader, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:<unknown type> member:<none>
at Microsoft.CodeAnalysis.CommandLine.BuildClient.RunCompilation (System.Collections.Generic.IEnumerable`1[T] o
@migueldeicaza
migueldeicaza / gist:8de4f89b182588927ba16f31b214e35a
Created September 25, 2016 14:17
Minimal HoloLens app with UrhoSharp.
using System;
using Windows.ApplicationModel.Core;
using Urho;
using Urho.Holographics;
using Urho.HoloLens;
internal class Program
{
[MTAThread]
private static void Main()
@migueldeicaza
migueldeicaza / gist:96c2bc52bfc30aa47a3ba34ce135e6f1
Last active September 12, 2016 14:00
Implicit string constant to byte[]/byte* conversions for C#
diff --git a/mcs/mcs/constant.cs b/mcs/mcs/constant.cs
old mode 100644
new mode 100755
index a0ae78c..0f45e74
--- a/mcs/mcs/constant.cs
+++ b/mcs/mcs/constant.cs
@@ -12,6 +12,7 @@
using System;
using System.Globalization;
@migueldeicaza
migueldeicaza / gist:630331ecb44dcec3aa815a7dca6eaeee
Created September 6, 2016 02:52
mcs tuple grammer changes
diff --git a/mcs/mcs/cs-parser.jay b/mcs/mcs/cs-parser.jay
index bb2bd6e..a41ae23 100644
--- a/mcs/mcs/cs-parser.jay
+++ b/mcs/mcs/cs-parser.jay
@@ -3222,6 +3222,20 @@ type_expression
$$ = new ComposedCast ((ATypeNameExpression) $1, (ComposedTypeSpecifier) $2);
}
| builtin_type_expression
+ | tuple_type
+ ;
using Mono.CSharp;
class X {
static void Main ()
{
var a = new
Evaluator (new CompilerContext (new CompilerSettings (), new ConsoleReportPrinter ()));
a.Run ("System.Console.WriteLine (true);");
}
}
@migueldeicaza
migueldeicaza / gist:cd99938c2a4372e7e5d5
Created September 8, 2015 14:31
Probing for events having a single callback on .NET and Mono
const BindingFlags SEARCH_FLAGS = BindingFlags.NonPublic | BindingFlags.Instance;
var hasSingleTargetMethod = typeof(MulticastDelegate).GetMethod("InvocationListLogicallyNull", SEARCH_FLAGS) ??
typeof(MulticastDelegate).GetMethod("get_HasSingleTarget", SEARCH_FLAGS);
if (hasSingleTargetMethod != null)
HasSingleTarget = (HasSingleTargetFn)Delegate.CreateDelegate(typeof(HasSingleTargetFn), hasSingleTargetMethod, true);
else // gracefull degradation
HasSingleTarget = md => md.GetInvocationList().Length == 1;
// ...
@migueldeicaza
migueldeicaza / gist:ae2a3ebf289169d413dc
Created June 16, 2015 01:53
Add IsAbstract property
diff --git a/Clang/Ast/CXXRecordDecl.cs b/Clang/Ast/CXXRecordDecl.cs
index 6acc7b3..16f5453 100644
--- a/Clang/Ast/CXXRecordDecl.cs
+++ b/Clang/Ast/CXXRecordDecl.cs
@@ -19,6 +19,13 @@ namespace Clang.Ast
public extern bool IsDerivedFrom (CXXRecordDecl baseDecl);
[MethodImpl (MethodImplOptions.InternalCall)]
+ extern int GetAbstract ();
+
diff --git a/external/rx b/external/rx
--- a/external/rx
+++ b/external/rx
@@ -1 +1 @@
-Subproject commit 00c1aadf149334c694d2a5096983a84cf46221b8
+Subproject commit 00c1aadf149334c694d2a5096983a84cf46221b8-dirty
diff --git a/mcs/mcs/Makefile b/mcs/mcs/Makefile
index d2aa50e..8999939 100644
--- a/mcs/mcs/Makefile
+++ b/mcs/mcs/Makefile