Ghostdoc doesn't support C# 7 pattern matching case statements
Problem reported by Matthew Hull - April 5 at 12:35 PM
Resolved
A method containing a pattern matching switch statement breaks the parser:
 
			switch (o)
			{
				case null when nullable == null && typeof(T).IsValueType:
					throw new InvalidCastException("Cannot cast null to non-nullable type");
				case null:
					return (T) (object) null;
				case T inputAsT:				
			}
 
 
 
Exception Source: Parser exception
Exception Message: error: identifier ':' expected, FileName: C:\Development\PathRedacted\ReflectionUtils.cs
Line: 247, Col: 15,
Line text: " case null when nullable == null && typeof(T).IsValueType:"
Stack Trace :
   at A.c2a633a86bc6520b19077f08c4d83eef0.Step(IToken t)
   at A.cdf5a991a4f2b59674066812a748e69dd.cebe87f60c9c9b487fd2073bcf6cf1cf3()
   at A.cdf5a991a4f2b59674066812a748e69dd.ca75db99c7204e2adc36977cdf185c408()
   at A.cdf5a991a4f2b59674066812a748e69dd.cac96f11b7ae4d4f23a2a467b655ea151()
   at A.cdf5a991a4f2b59674066812a748e69dd.cf88a6ffa904ce6f56453b115fd77d3d7()
   at A.cdf5a991a4f2b59674066812a748e69dd.c7c6578f3f20b7d364e1ac55db36d4013()
   at A.cdf5a991a4f2b59674066812a748e69dd.cc4badd6a3e5c5623821b7577b02193ef()
   at A.c75a3b37fbb1f9b5aa8c01056df3ac2ee.cc4badd6a3e5c5623821b7577b02193ef(IRegion )
   at A.c144179a81958e48c0867485a5df7fff3.c61da114bb0a65bf573bcd0617a0cfb2b()
   at A.c144179a81958e48c0867485a5df7fff3.c581074e4f15614505aaf43ef7c03ca58()
   at A.c85d63cdad2a75941f7e65d2c2d359aad.c66772c4aca7dd32de5f62e3af4d8c3a8(ICompilationUnit , IClassInterface , INamespaceDeclaration )
   at A.c85d63cdad2a75941f7e65d2c2d359aad.cbceecda92945e0fdceb8fc69cbec7b63()
   at A.cb68d1b45010ff9a861d749e0871601be.cfb8d75f7155fc3a47e8a8718d15bb676(IRegion , INamespaceDeclaration , IType , ICompilationUnit , AttributeSectionCollection , MemberModifiers , IRegion )
   at A.c2a633a86bc6520b19077f08c4d83eef0.NamespaceMember(INamespaceDeclaration currentNamespaceDeclaration)
   at A.c2a633a86bc6520b19077f08c4d83eef0.NamespaceMember(INamespaceDeclaration currentNamespaceDeclaration)
Log Message (4/5/2018 3:33:01 PM) : ExecuteWithoutCodeDOM->_currentObjectUnderCursor == null at (233,28): "C:\Development\PathRedacted\ReflectionUtils.cs" 
Log Message (4/5/2018 3:33:01 PM) : Information: ViewGeneratedXmlCommand->Execute, _currentObjectUnderCursor is null.
Log Message (4/5/2018 3:33:01 PM) : XmlDocumentationFileHelper->Generate: comments.xml

1 Reply

Reply to Thread
0
Serge B. Replied
Employee Post
Hi Matthew,
 
There was a parser glitch that we now have fixed. Thanks for reporting this!
 
 
Serge Baranovsky
SubMain Software
(800) 936-2134

Reply to Thread