Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SyntaxTree serialization fails trying to write VB date time literal #14943

Closed
mattwar opened this issue Nov 3, 2016 · 10 comments
Closed

SyntaxTree serialization fails trying to write VB date time literal #14943

mattwar opened this issue Nov 3, 2016 · 10 comments
Assignees
Milestone

Comments

@mattwar
Copy link
Contributor

mattwar commented Nov 3, 2016

This code:

Public Class C
Private _x As DateTime = #10/5/2015#
End Class

Causes this exception when the tree gets serialized:

System.InvalidOperationException: Cannot serialize type 'System.DateTime'.
at Roslyn.Utilities.StreamObjectWriter.WriteObject(Object instance)
at Roslyn.Utilities.StreamObjectWriter.WriteVariant(Variant value)
at Roslyn.Utilities.StreamObjectWriter.Emit()
at Roslyn.Utilities.StreamObjectWriter.WriteValue(Object value)
at Microsoft.CodeAnalysis.SyntaxNode.SerializeTo(Stream stream, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Host.AbstractSyntaxTreeFactoryService.RecoverableSyntaxRoot`1.d__6.MoveNext()

@Pilchie
Copy link
Member

Pilchie commented Nov 3, 2016

Can we get more details about when this happens? @asecchia?

@mattwar
Copy link
Contributor Author

mattwar commented Nov 3, 2016

How can it be more clear than the title of the issue?

@Pilchie
Copy link
Member

Pilchie commented Nov 3, 2016

How does a user experience this? Does this crash VS whenever there is a VB file with a date constant? Should this be in RC instead of RC2?

@mattwar
Copy link
Contributor Author

mattwar commented Nov 3, 2016

The bug is caused by my recent change to the serializer that is in master and not in RC.

@Pilchie
Copy link
Member

Pilchie commented Nov 3, 2016

Ah, great! Thanks!

@asecchia
Copy link
Contributor

asecchia commented Nov 3, 2016

I opened roslyn.sln and VS crashed (failfast)

@mattwar
Copy link
Contributor Author

mattwar commented Nov 3, 2016

@Pilchie there is a nice PR here for you to green light #14944

@dpoeschl
Copy link
Contributor

Reopening because this change was reverted as part of #15068

@dpoeschl dpoeschl reopened this Nov 10, 2016
@dpoeschl
Copy link
Contributor

FYI @mattwar

@mattwar
Copy link
Contributor Author

mattwar commented Nov 10, 2016

This only failed because of the serialization changes you also rolled back.

@mattwar mattwar closed this as completed Nov 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants