Bug 10089 – Strange function call error message with specified module

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-05-15T09:51:00Z
Last change time
2013-05-17T15:42:15Z
Keywords
diagnostic, pull
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2013-05-15T09:51:52Z
import std.stdio, std.range; void main() { std.string.chunks("abcdef", 2); } Gives the error messages: test.d(3): Error: std.stdio.chunks at ...\dmd2\windows\bin\..\..\src\phobos\std\stdio.d(2270) conflicts with std.range.chunks(Source)(Source source, size_t chunkSize) at ...\dmd2\windows\bin\..\..\src\phobos\std\range.d(6520) test.d(3): Error: constructor std.stdio.chunks.this (File f, uint size) is not callable using argument types (void) Expected error messages should say that there is no std.string.chunks.
Comment #1 by k.hara.pg — 2013-05-15T21:33:27Z
This is a regression in 2.063a, caused by the fix for UFCS name lookup. With 2.062: test.d(3): Error: undefined identifier 'chunks', did you mean 'template chunks(Source)(Source source, size_t chunkSize)'?
Comment #2 by k.hara.pg — 2013-05-15T21:34:48Z
Comment #3 by github-bugzilla — 2013-05-17T12:59:09Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/fc314c322eb3bfbb00ce8b24f4a628c7220309f7 fix Issue 10089 - Strange function call error message with specified module https://github.com/D-Programming-Language/dmd/commit/68385f234e07d31698f713493fe211c288322433 Merge pull request #2040 from 9rnsr/fix10089 [REG2.063a] Issue 10089 - Strange function call error message with specified module
Comment #4 by github-bugzilla — 2013-05-17T13:01:55Z
Commit pushed to 2.063 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/40c00264079cbacc58f63703da1a02abb6a57b4d Merge pull request #2040 from 9rnsr/fix10089 [REG2.063a] Issue 10089 - Strange function call error message with specified module
Comment #5 by bearophile_hugs — 2013-05-17T15:42:15Z
(In reply to comment #2) > https://github.com/D-Programming-Language/dmd/pull/2040 Thank you for the fix. Now the original program: import std.stdio, std.range; void main() { std.string.chunks("abcdef", 2); } Gives the error message: temp.d(3): Error: undefined identifier 'chunks', did you mean 'template chunks(Source)(Source source, size_t chunkSize)'? It's essentially saying: "undefined identifier 'chunks', did you mean 'chunks'?" Why is the error message not showing the name "std.string"? Maybe both 'chunks' should be module-qualified.