Bug 4323 - Parameter completion exception while attempting to instantiate unknown class
Summary: Parameter completion exception while attempting to instantiate unknown class
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: Trunk
Hardware: PC Linux
: Low normal
Target Milestone: ---
Assignee: Mike Krüger
Depends on:
Reported: 2012-04-06 21:12 UTC by Csaba Halász
Modified: 2012-04-07 03:42 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Csaba Halász 2012-04-06 21:12:02 UTC
Try this sample code:

namespace Test
    class TestClass
        public static void Main(string[] args)
            object foo = new Foo<caret>

Now press ( and an exception will be logged to the console:

ERROR [2012-04-07 03:06:35Z]: Unexpected parameter completion exception.
FileName: CompletionTest/Test.cs
Position: line=7 col=24
Line text:                      object foo = new Foo(
System.NullReferenceException: Object reference not set to an instance of an object
  at ICSharpCode.NRefactory.TypeSystem.ExtensionMethods.IsDerivedFrom (ITypeDefinition type, ITypeDefinition baseType) [0x00000] in monodevelop/main/contrib/ICSharpCode.NRefactory/TypeSystem/ExtensionMethods.cs:88
  at MonoDevelop.CSharp.Completion.ConstructorParameterDataProvider..ctor (Int32 startOffset, MonoDevelop.CSharp.Completion.CSharpCompletionTextEditorExtension ext, IType type) [0x00053] in monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ConstructorParameterDataProvider.cs:46
  at MonoDevelop.CSharp.Completion.CSharpCompletionTextEditorExtension.ICSharpCode.NRefactory.CSharp.Completion.IParameterCompletionDataFactory.CreateConstructorProvider (Int32 startOffset, IType type) [0x00000] in monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CSharpCompletionTextEditorExtension.cs:616
  at ICSharpCode.NRefactory.CSharp.Completion.CSharpParameterCompletionEngine.GetParameterDataProvider (Int32 offset, Char completionChar) [0x00167] in monodevelop/main/contrib/ICSharpCode.NRefactory.CSharp/Completion/CSharpParameterCompletionEngine.cs:176
  at MonoDevelop.CSharp.Completion.CSharpCompletionTextEditorExtension.HandleParameterCompletion (MonoDevelop.Ide.CodeCompletion.CodeCompletionContext completionContext, Char completionChar) [0x0008e] in monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CSharpCompletionTextEditorExtension.cs:375

The exception has no noticeable negative effects. Git revision is 93fa2ebf.
Comment 1 Mike Krüger 2012-04-07 03:42:12 UTC