Bug 22194 - Cannot use typeof operator with type parameters
Summary: Cannot use typeof operator with type parameters
Status: VERIFIED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Debugger ()
Version: 5.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: 5.7
Assignee: Jeffrey Stedfast
URL:
Depends on:
Blocks:
 
Reported: 2014-08-19 05:11 UTC by Marek Safar
Modified: 2014-11-26 08:01 UTC (History)
5 users (show)

Tags:
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:
Status:
VERIFIED FIXED

Description Marek Safar 2014-08-19 05:11:09 UTC
http://screencast.com/t/H6vIkFopH4C3

using System;

class C<T>
{
	public void Foo<U> ()
	{
		return;
	}
}

class X
{
	static int Main ()
	{
		new C<int> ().Foo<long> ();

		return 0;
	}
}
Comment 1 Sadik Ali 2014-08-19 09:52:55 UTC
I have checked this issue and I am able to reproduce this issue.

When I run the code mention on bug description and try to check the type of type parameter (U,T). I observed that typeof(U) and typeof (T) expression shows error message on watch window i.e. "Could not load type :U / Could not load type :T".

Note:When I use the typeof expression on text editor at run time as following 
     
  var test=typeof(U);

I am getting the value of test variable is "System.MonoType" but the same display error on watch window.

Screencast: http://www.screencast.com/t/LdHpJ4si

Environment Info:

=== Xamarin Studio ===

Version 5.2.1 (build 1)
Installation UUID: 6ea47b0d-1852-4aaf-808d-373ff0a5002b
Runtime:
	Mono 3.8.0 ((no/62a857e)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 308000007

=== Apple Developer Tools ===

Xcode 5.1 (5084)
Build 5B130a

=== Xamarin.Mac ===

Version: 1.10.0.9 (Business Edition)

=== Xamarin.Android ===

Version: 4.16.0 (Business Edition)
Android SDK: /Users/jatin66/Desktop/Backup/android-sdk-macosx
	Supported Android versions:
		1.6   (API level 4)
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		3.2   (API level 13)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
Java SDK: /usr
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

=== Xamarin.iOS ===

Version: 7.4.0.102 (Business Edition)
Hash: 141adb9
Branch: 
Build date: 2014-08-15 12:54:28-0400

=== Build Information ===

Release ID: 502010001
Git revision: d06832ce9807d6be24aca225457e8b37c7669f6f
Build date: 2014-08-07 12:10:47-04
Xamarin addins: 1de032531be4cecf2f39dbee3b87aac78204058c

=== Operating System ===

Mac OS X 10.9.3
Darwin Jatin66s-iMac.local 13.2.0 Darwin Kernel Version 13.2.0
    Thu Apr 17 23:03:13 PDT 2014
    root:xnu-2422.100.13~1/RELEASE_X86_64 x86_64
Comment 2 Greg Munn 2014-11-03 10:41:10 UTC
master/d117ea4
Comment 3 Prashant manu 2014-11-26 02:18:30 UTC
Now running the code mention in bug description and checking the type of
type parameter (U,T) shows proper values.

Screencast: http://www.screencast.com/t/mcQZQKnYhkk

Environment Info:
Xamarin Studio
Version 5.7 (build 596)
Installation UUID: 0b7eaebc-a0ed-4b58-81df-91e378cad28c
Runtime:
	Mono 3.12.0 ((detached/b75fa2b)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000046

Apple Developer Tools
Xcode 6.2 (6736)
Build 6C86e

Xamarin.iOS
Version: 8.6.0.5 (Business Edition)
Hash: 880cc21
Branch: 
Build date: 2014-11-25 12:12:17-0500

Xamarin.Android
Version: 5.0.0.0 (Business Edition)
Android SDK: /Users/Admin_Mac/Desktop/Anddk/android-sdk-macosx
	Supported Android versions:
		2.3    (API level 10)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

Xamarin.Mac
Not Installed

Build Information
Release ID: 507000596
Git revision: d996e9ba6874a0d64241e43e5e6b06322ce29c84
Build date: 2014-11-25 17:17:54-05
Xamarin addins: 8ca19707b41536a391f53364ee4ff9272711feb0

Operating System
Mac OS X 10.10.2
Darwin Admin-Macs-Mac-mini.local 14.1.0 Darwin Kernel Version 14.1.0
    Thu Nov 13 18:36:56 PST 2014
    root:xnu-2782.10.65~2/RELEASE_X86_64 x86_64