Bug 13884 – No error line number with std.array.array of range of type tuples

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-12-21T16:46:00Z
Last change time
2015-01-19T14:06:23Z
Keywords
diagnostic, pull
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2014-12-21T16:46:27Z
This is wrong code: import std.array: array; import std.algorithm: map; struct Foo { int x; } void main() { [Foo(1)].map!(t => t.tupleof).array; } Dmd 2.067alpha shows an error without line number: Error: no size for type (int) temp.d(5,19): Error: functions cannot return a tuple ...\dmd2\src\phobos\std\algorithm.d(450,16): instantiated from here: MapResult!(__lambda1, Foo[]) temp.d(5,13): instantiated from here: map!(Foo[])
Comment #1 by k.hara.pg — 2015-01-19T10:40:56Z
Comment #2 by github-bugzilla — 2015-01-19T14:06:22Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/4457f99ef67aea02b1cd0b1cc2b02865c640a2ff fix Issue 13884 - No error line number with std.array.array of range of type tuples Validate return type before calling retStyle() on auto function. https://github.com/D-Programming-Language/dmd/commit/dedf4417f10472886f40226845c7ae53cdd88bb9 Merge pull request #4311 from 9rnsr/fix13884 Issue 13884 - No error line number with std.array.array of range of type tuples