{"action":"closed","issue":{"url":"https://api.github.com/repos/AArnott/ImmutableObjectGraph/issues/57","labels_url":"https://api.github.com/repos/AArnott/ImmutableObjectGraph/issues/57/labels{/name}","comments_url":"https://api.github.com/repos/AArnott/ImmutableObjectGraph/issues/57/comments","events_url":"https://api.github.com/repos/AArnott/ImmutableObjectGraph/issues/57/events","html_url":"https://github.com/AArnott/ImmutableObjectGraph/issues/57","id":113704459,"number":57,"title":"The \"GenerateCodeFromAttributes\" task failed unexpectedly when DefineRootedStruct = True on nested immutable","user":{"login":"jviau","id":5439812,"avatar_url":"https://avatars.githubusercontent.com/u/5439812?v=3","gravatar_id":"","url":"https://api.github.com/users/jviau","html_url":"https://github.com/jviau","followers_url":"https://api.github.com/users/jviau/followers","following_url":"https://api.github.com/users/jviau/following{/other_user}","gists_url":"https://api.github.com/users/jviau/gists{/gist_id}","starred_url":"https://api.github.com/users/jviau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jviau/subscriptions","organizations_url":"https://api.github.com/users/jviau/orgs","repos_url":"https://api.github.com/users/jviau/repos","events_url":"https://api.github.com/users/jviau/events{/privacy}","received_events_url":"https://api.github.com/users/jviau/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/AArnott/ImmutableObjectGraph/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-10-27T22:37:20Z","updated_at":"2015-12-20T19:53:53Z","closed_at":"2015-12-20T19:53:53Z","body":"The objects are as follows:\r\n\r\n```C#\r\n    [GenerateImmutable(GenerateBuilder = true, DefineRootedStruct = true)]\r\n    public partial class Node\r\n    {\r\n        readonly string name;\r\n        readonly ImmutableHashSet<string> tags;\r\n    }\r\n\r\n    [GenerateImmutable(GenerateBuilder = true)]\r\n    public partial class Tree\r\n    {\r\n        readonly ImmutableSortedSet<Tree> children;\r\n        readonly Node node;\r\n    }\r\n```\r\n\r\nThis results in the following build error:\r\n\r\n```\r\nThe \"GenerateCodeFromAttributes\" task failed unexpectedly.\r\nSystem.ArgumentException: Undefined type.\r\nParameter name: metaType\r\n   at ImmutableObjectGraph.CodeGeneration.CodeGen.RootedStructGen.GetRootedTypeSyntax(MetaType metaType) in C:\\Users\\andarno\\git\\ImmutableObjectGraph\\src\\ImmutableObjectGraph.CodeGeneration.Roslyn\\CodeGen+RootedStructGen.cs:line 70\r\n   at ImmutableObjectGraph.CodeGeneration.CodeGen.RootedStructGen.CreateRootProperty() in C:\\Users\\andarno\\git\\ImmutableObjectGraph\\src\\ImmutableObjectGraph.CodeGeneration.Roslyn\\CodeGen+RootedStructGen.cs:line 429\r\n   at ImmutableObjectGraph.CodeGeneration.CodeGen.RootedStructGen.CreateRootedStruct() in C:\\Users\\andarno\\git\\ImmutableObjectGraph\\src\\ImmutableObjectGraph.CodeGeneration.Roslyn\\CodeGen+RootedStructGen.cs:line 176\r\n   at ImmutableObjectGraph.CodeGeneration.CodeGen.RootedStructGen.GenerateCore() in C:\\Users\\andarno\\git\\ImmutableObjectGraph\\src\\ImmutableObjectGraph.CodeGeneration.Roslyn\\CodeGen+RootedStructGen.cs:line 107\r\n   at ImmutableObjectGraph.CodeGeneration.CodeGen.<GenerateAsync>d__56.MoveNext() in C:\\Users\\andarno\\git\\ImmutableObjectGraph\\src\\ImmutableObjectGraph.CodeGeneration.Roslyn\\CodeGen.cs:line 151\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at ImmutableObjectGraph.CodeGeneration.CodeGen.<GenerateAsync>d__54.MoveNext() in C:\\Users\\andarno\\git\\ImmutableObjectGraph\\src\\ImmutableObjectGraph.CodeGeneration.Roslyn\\CodeGen.cs:line 89\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)\r\n   at ImmutableObjectGraph.CodeGeneration.DocumentTransform.<TransformAsync>d__2.MoveNext() in C:\\Users\\andarno\\git\\ImmutableObjectGraph\\src\\ImmutableObjectGraph.CodeGeneration\\DocumentTransform.cs:line 55\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)\r\n   at ImmutableObjectGraph.CodeGeneration.Tasks.GenerateCodeFromAttributes.Helper.<<Execute>b__28_0>d.MoveNext() in C:\\Users\\andarno\\git\\ImmutableObjectGraph\\src\\ImmutableObjectGraph.CodeGeneration.Tasks\\GenerateCodeFromAttributes.cs:line 127\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at ImmutableObjectGraph.CodeGeneration.Tasks.GenerateCodeFromAttributes.Helper.Execute() in C:\\Users\\andarno\\git\\ImmutableObjectGraph\\src\\ImmutableObjectGraph.CodeGeneration.Tasks\\GenerateCodeFromAttributes.cs:line 98\r\n   at ImmutableObjectGraph.CodeGeneration.Tasks.GenerateCodeFromAttributes.Helper.Execute()\r\n   at ImmutableObjectGraph.CodeGeneration.Tasks.GenerateCodeFromAttributes.Execute() in C:\\Users\\andarno\\git\\ImmutableObjectGraph\\src\\ImmutableObjectGraph.CodeGeneration.Tasks\\GenerateCodeFromAttributes.cs:line 55\r\n   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()\r\n   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()\tImmutableGraph\r\n```"}}