expr.Type.GetSignatureForError ());
}
+ if (expr.Type.IsGenericParameter) {
+ expr = Convert.ImplicitTypeParameterConversion (expr, TypeManager.object_type);
+ }
+
VariableReference lv = expr as VariableReference;
bool locked;
if (lv != null) {
// Have to keep original lock value around to unlock same location
// in the case the original has changed or is null
//
- expr_copy = TemporaryVariableReference.Create (expr.Type, ec.CurrentBlock.Parent, loc);
+ expr_copy = TemporaryVariableReference.Create (TypeManager.object_type, ec.CurrentBlock.Parent, loc);
expr_copy.Resolve (ec);
//
--- /dev/null
+using System;
+
+public class Foo
+{
+ static void GenericLock<T> (T t) where T : class
+ {
+ lock (t)
+ {
+ }
+ }
+
+ public static void Main ()
+ {
+ GenericLock ("s");
+ }
+}
\ No newline at end of file
</method>
</type>
</test>
+ <test name="gtest-547.cs">
+ <type name="Foo">
+ <method name="Void GenericLock[T](T)">
+ <size>26</size>
+ </method>
+ <method name="Void Main()">
+ <size>11</size>
+ </method>
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ </type>
+ </test>
<test name="gtest-anon-1.cs">
<type name="X">
<method name="Void .ctor()">
<size>7</size>
</method>
<method name="Int32 Main()">
- <size>42</size>
+ <size>91</size>
</method>
</type>
</test>