{"action":"closed","issue":{"url":"https://api.github.com/repos/castleproject/Windsor/issues/404","repository_url":"https://api.github.com/repos/castleproject/Windsor","labels_url":"https://api.github.com/repos/castleproject/Windsor/issues/404/labels{/name}","comments_url":"https://api.github.com/repos/castleproject/Windsor/issues/404/comments","events_url":"https://api.github.com/repos/castleproject/Windsor/issues/404/events","html_url":"https://github.com/castleproject/Windsor/issues/404","id":328251804,"node_id":"MDU6SXNzdWUzMjgyNTE4MDQ=","number":404,"title":" TypeUtil.ToCSharpString(this Type) does not handle nested generic types correctly","user":{"login":"stakx","id":104481,"node_id":"MDQ6VXNlcjEwNDQ4MQ==","avatar_url":"https://avatars1.githubusercontent.com/u/104481?v=4","gravatar_id":"","url":"https://api.github.com/users/stakx","html_url":"https://github.com/stakx","followers_url":"https://api.github.com/users/stakx/followers","following_url":"https://api.github.com/users/stakx/following{/other_user}","gists_url":"https://api.github.com/users/stakx/gists{/gist_id}","starred_url":"https://api.github.com/users/stakx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stakx/subscriptions","organizations_url":"https://api.github.com/users/stakx/orgs","repos_url":"https://api.github.com/users/stakx/repos","events_url":"https://api.github.com/users/stakx/events{/privacy}","received_events_url":"https://api.github.com/users/stakx/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-05-31T18:39:37Z","updated_at":"2018-06-06T13:39:30Z","closed_at":"2018-06-06T13:39:30Z","author_association":"MEMBER","body":"_Migrated from https://github.com/castleproject/Core/issues/365._\r\n\r\n---\r\n\r\n_@pmg23 wrote:_\r\n\r\nThe useful extension method `TypeUtil.ToCSharpString(this Type)` does not correctly deal with types nested within generic types [as of Core 4.2.1]. For example:\r\n\r\n```cs\r\ninternal class A<T1>\r\n{\r\n    internal class B {}\r\n    internal class C<T2> {}\r\n}\r\n\r\nAssert.That(typeof(A<string>.B).ToCSharpString(),\r\n        Is.EqualTo(\"A<String>.B\")); // FAIL: actually \"A<·T1·>.B<String>\"\r\nAssert.That(typeof(A<string>.C<int>).ToCSharpString(),\r\n        Is.EqualTo(\"A<String>.C<Int32>\")); // FAIL: actually \"A<·T1·>.C<String, Int32>\"\r\n```\r\n\r\n---\r\n\r\n_@stakx replied:_\r\n\r\n(Shameless advertisement:)\r\n\r\nType name formatting is surprisingly complex because there are quite a few corner cases to deal with. I happen to have written a small library recently ([stakx/TypeNameFormatter](https://github.com/stakx/TypeNameFormatter)) that would solve this problem. It's available as a source code NuGet package.\r\n\r\n---\r\n\r\n_@stakx replied:_\r\n\r\nThat being said, I cannot seem to find a method `TypeUtil.ToCSharpString(this Type)` in Castle Core (this repository). Did you mean [this method](https://github.com/castleproject/Windsor/blob/a9d6ad8c7ad8d343d2017c97a67d6e1c2fb36c39/src/Castle.Windsor/Core/Internal/TypeUtil.cs#L50-L63) in Castle Windsor ([castleproject/Windsor](https://github.com/castleproject/Windsor))?"}}
{"actor":{"display_login":"jonorossi"}}