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

regression(vibe 0.8) vibe.data.bson.BsonSerializer.readDictionary is not callable using argument type #1991

Closed
timotheecour opened this issue Dec 5, 2017 · 0 comments

Comments

@timotheecour
Copy link

@timotheecour timotheecour commented Dec 5, 2017

app.d:

void main(){}

import vibe.data.bson;

class A {
  @property @name("foo") {
    string fooString() const { return "a"; }
    void fooString(string a) {  }
  }
}

void test(){
	Bson a;
  auto a2=a.deserializeBson!A;
}

dub.json:

{
"name": "test1",
"targetType": "dynamicLibrary",
"targetName": "test1",
"dependencies": {"vibe-d": "==0.8.1",},

"description": "A simple vibe.d server application. v1",
"copyright": "Copyright © 2017, Timothee Cour",
"authors": ["Timothee Cour"],
"license": "proprietary"
}
/Users/timothee/.dub/packages/vibe-d-0.8.1/vibe-d/data/vibe/data/serialization.d(752): Error: function vibe.data.bson.BsonSerializer.readDictionary!(Traits!(A, DefaultPolicy)).readDictionary (scope void delegate(string) @safe entry_callback) is not callable using argument types (void)
/Users/timothee/.dub/packages/vibe-d-0.8.1/vibe-d/data/vibe/data/serialization.d(565): Error: template instance vibe.data.serialization.deserializeValueImpl!(BsonSerializer, DefaultPolicy).deserializeValueDeduced!(A) error instantiating
/Users/timothee/.dub/packages/vibe-d-0.8.1/vibe-d/data/vibe/data/serialization.d(299):        instantiated from here: deserializeValue!(A)
/Users/timothee/.dub/packages/vibe-d-0.8.1/vibe-d/data/vibe/data/serialization.d(265):        instantiated from here: deserializeWithPolicy!(BsonSerializer, DefaultPolicy, A, Bson)
/Users/timothee/.dub/packages/vibe-d-0.8.1/vibe-d/data/vibe/data/bson.d(1141):        instantiated from here: deserialize!(BsonSerializer, A, Bson)
source/app.d(17):        instantiated from here: deserializeBson!(A)

it worked fine with 0.7.32

NOTE: this syntax was proposed by @s-ludwig here: #1710 (comment)

s-ludwig added a commit that referenced this issue Dec 13, 2017
…system. Fixes #1991.

A warning is emitted because this workaround breaks safety inference.
s-ludwig added a commit that referenced this issue Dec 14, 2017
…system. Fixes #1991.

A warning is emitted because this workaround breaks safety inference.
@s-ludwig s-ludwig closed this in ad64494 Dec 22, 2017
s-ludwig added a commit that referenced this issue Dec 22, 2017
…lization

Work around compile error in the serialization system. Fixes #1991.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant