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

Error on template instance #38

Closed
o3o opened this issue Jul 10, 2019 · 3 comments
Closed

Error on template instance #38

o3o opened this issue Jul 10, 2019 · 3 comments

Comments

@o3o
Copy link
Contributor

o3o commented Jul 10, 2019

After a dmd update:

$ dub build
/usr/include/dlang/dmd/std/format.d(6304,26): Error: type char is not an expression
source/tinyredis/encoder.d(169,15): Error: template instance `tinyredis.encoder.toBulk!char` error instantiating
source/tinyredis/encoder.d(51,31):        instantiated from here: accumulator!(char, string)
source/tinyredis/redis.d(64,31):        instantiated from here: toMultiBulk!(char, string)
source/tinyredis/collections/set.d(30,22):        instantiated from here: send!(Response, string)
source/tinyredis/collections/set.d(35,31): Error: template instance `tinyredis.redis.Redis.send!(int, string)` error instantiating
source/tinyredis/encoder.d(51,31): Error: template instance `tinyredis.encoder.accumulator!(char, string, const(char)[])` error instantiating
source/tinyredis/redis.d(64,31):        instantiated from here: toMultiBulk!(char, string, const(char)[])
source/tinyredis/collections/set.d(42,32):        instantiated from here: send!(bool, string, const(char)[])
source/tinyredis/collections/set.d(53,12): Error: template instance `tinyredis.redis.Redis.send!(Response, string, const(char)[])` error instantiating
/usr/include/dlang/dmd/std/format.d(6304,26): Error: type char is not an expression
source/tinyredis/redis.d(106,30): Error: template instance `tinyredis.encoder.toMultiBulk!char` error instantiating
source/tinyredis/redis.d(129,32):        instantiated from here: pipeline!(immutable(char))

My environment:

$ dmd --version
DMD64 D Compiler v2.087.0

$ dub --version
DUB version 1.16.0, built on Jul 02 2019

$ uname --all
Linux abe 5.1.9-arch1-1-ARCH #1 SMP PREEMPT Tue Jun 11 16:18:09 UTC 2019 x86_64 GNU/Linux

With ldc compiler works.

Thank you

@o3o
Copy link
Contributor Author

o3o commented Jul 10, 2019

Issue is in encoder.d row 144 and 150:

    return format!(C)("$%d\r\n%s\r\n", str.length, str);

should be:

    return format("$%d\r\n%s\r\n", str.length, str);

or

   return format!"$%d\r\n%s\r\n"(str.length, str);

@adilbaig
Copy link
Owner

Thanks @o3o . Would you be willing to send a PR I can review? I have not worked with a recent version of the compiler for a while and there's probably other parts of the API that are broken.

@o3o
Copy link
Contributor Author

o3o commented Jul 15, 2019

You're right :)

Thank you for your great piece of sw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants