Thread overview
[Issue 13777] Value range propagation faild on array function argument
Nov 28, 2014
Kenji Hara
Nov 28, 2014
Kenji Hara
Dec 05, 2014
Kenji Hara
November 26, 2014
https://issues.dlang.org/show_bug.cgi?id=13777

bearophile_hugs@eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs@eml.cc

--- Comment #1 from bearophile_hugs@eml.cc ---
(In reply to Denis Shelomovskij from comment #0)

> In case it was an accept-invalid bug,

I doubt it was an accept-invalid bug.

--
November 28, 2014
https://issues.dlang.org/show_bug.cgi?id=13777

--- Comment #2 from Kenji Hara <k.hara.pg@gmail.com> ---
(In reply to Denis Shelomovskij from comment #0)
> This code used to work:
> ---
> T select(T)(in size_t idx, T[2] values...)
> {
>     return values[idx];
> }
> 
> void main()
> {
>     ubyte ub = select(0, 3, 4);
> }
> ---

With 2.057 to 2.066 and git-head, the code fails to compile because T is deduced to int and an int function return is not always implicitly convertible to ubyte.

Which dmd version had you used? If the code has been accepted with certain dmd release, it was definitely an accepts-invalid bug.

> In case it was an accept-invalid bug, a clear reason to disallow the feature should be stated as it breaks user code without any deprecation cycle.

Bugfix does not need deprecation cycle.

--
November 28, 2014
https://issues.dlang.org/show_bug.cgi?id=13777

--- Comment #3 from bearophile_hugs@eml.cc ---
(In reply to Kenji Hara from comment #2)

> With 2.057 to 2.066 and git-head, the code fails to compile because T is deduced to int and an int function return is not always implicitly convertible to ubyte.

I missed that. So do we close this report as invalid?

--
November 28, 2014
https://issues.dlang.org/show_bug.cgi?id=13777

--- Comment #4 from Kenji Hara <k.hara.pg@gmail.com> ---
(In reply to bearophile_hugs from comment #3)
> (In reply to Kenji Hara from comment #2)
> 
> > With 2.057 to 2.066 and git-head, the code fails to compile because T is deduced to int and an int function return is not always implicitly convertible to ubyte.
> 
> I missed that. So do we close this report as invalid?

Maybe, but I'd like to wait Denis's reply.

--
December 05, 2014
https://issues.dlang.org/show_bug.cgi?id=13777

Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #5 from Kenji Hara <k.hara.pg@gmail.com> ---
Close as invalid issue.

--