[Issue 22283] -preview=in -inline leads to strange error inside object.d

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Sep 7 05:47:57 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=22283

Tejas_Garhewal <scienticman at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |scienticman at gmail.com

--- Comment #1 from Tejas_Garhewal <scienticman at gmail.com> ---
(In reply to Temtaime from comment #0)
> void main()
> {
>     try
>     {
>     }
>     catch(Throwable e)
>         e.toString;
> }
> 
> compile with -preview=in -inline:
> 
> /dlang/dmd/linux/bin64/../../src/druntime/import/object.d(2405): Error: none
> of the overloads of `toString` are callable using argument types `(void)`,
> candidates are:
> /dlang/dmd/linux/bin64/../../src/druntime/import/object.d(2402):       
> `object.Throwable.toString()`
> /dlang/dmd/linux/bin64/../../src/druntime/import/object.d(2415):       
> `object.Throwable.toString(scope void delegate(in char[]) sink)`

Well, it's not working for me even when I remove preview=in

But my error messages are different(ldc 1.25.0 based on dmd 2.095.1):


Error: none of the overloads of this are callable using argument types (),
candidates are:


/usr/lib/ldc/x86_64-redhat-linux-gnu/include/d/object.d(2140):       
object.Exception.this(string msg, string file = __FILE__, ulong line =
cast(ulong)__LINE__, Throwable nextInChain = null)


/usr/lib/ldc/x86_64-redhat-linux-gnu/include/d/object.d(2145):       
object.Exception.this(string msg, Throwable nextInChain, string file =
__FILE__, ulong line = cast(ulong)__LINE__)

(whitespace inserted by me)

Of course, providing a string argument to Exception solves this, preview=in or
otherwise.

--


More information about the Digitalmars-d-bugs mailing list