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

Temporarily disable test that check const fields #94

Conversation

mihails-strasuns-sociomantic
Copy link
Contributor

Because of deficiency in DMD implementation, combination of pragma(msg) and
is(typeof()) will result in message printed even if instantiation is
speculative. As it is not possible to turn them into asserts yet, all tests that
trigger warning are disabled for now.

@mihails-strasuns-sociomantic
Copy link
Contributor Author

(we should release 2.6.6 with this ASAP to remove irrelevant warning spam in 2.6.5)

@@ -734,10 +734,10 @@ unittest
{
static struct CS
{
cstring s;
mstring s;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this change need to be reverted in v4.x.x as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this will be a breaking change in v4.x.x - such struct will no longer deserialize (it was never intended to). I wonder though how will it affect bidding apps as I presume this test was added by @mathias-lang-sociomantic originally.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, we talked with @mathias-lang-sociomantic, looks like it was needed for one of work-in-progress ports and doesn't affect any merged code. We'll see if that code can be adjusted in a fashion simlar to swarm, for now this adjustments should be OK to merge.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change unrelated to "Temporarily disable test that check const fields" then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit indirectly. I will split it into separate commit and explain there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

"Serializer should reject a struct with 'istring'");
static assert(!is(typeof({Deserializer.deserialize!(II)(buffer2);})),
"Deserializer should reject a struct with 'immutable' element");
version (none)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should create an issue in v4.0.0 to reenable these tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#95

Because of deficiency in DMD implementation, combination of `pragma(msg)` and
`is(typeof())` will result in message printed even if instantiation is
speculative. As it is not possible to turn them into asserts yet, all tests that
trigger warning are disabled for now.
It slipped through review by an accident some time ago - such use case was not
intended and is going to be completely prohibited in ocean v4.0.0

Instead applications are supposed to use mutable structs for deserialization and
apply head `const` if needed on serialized version.
@gavin-norman-sociomantic

LGTM.

@gavin-norman-sociomantic gavin-norman-sociomantic merged commit 687eeee into sociomantic-tsunami:v2.6.x May 2, 2017
@mihails-strasuns-sociomantic mihails-strasuns-sociomantic deleted the deserializer-warning branch May 31, 2017 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants