Thread overview
[Issue 22283] -preview=in -inline leads to strange error inside object.d
[Issue 22283] -preview=in -inline leads strange error inside object.d
Sep 06, 2021
Temtaime
Sep 06, 2021
Temtaime
Sep 07, 2021
Tejas_Garhewal
Sep 07, 2021
Tejas_Garhewal
Sep 07, 2021
Temtaime
Sep 07, 2021
Tejas_Garhewal
Sep 07, 2021
Tejas_Garhewal
Oct 18, 2021
Dlang Bot
Oct 18, 2021
Dlang Bot
September 06, 2021
https://issues.dlang.org/show_bug.cgi?id=22283

Temtaime <temtaime@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com

--
September 06, 2021
https://issues.dlang.org/show_bug.cgi?id=22283

Temtaime <temtaime@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|-preview=in -inline leads   |-preview=in -inline leads
                   |strange error inside        |to strange error inside
                   |object.d                    |object.d

--
September 07, 2021
https://issues.dlang.org/show_bug.cgi?id=22283

Tejas_Garhewal <scienticman@gmail.com> changed:

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

--- Comment #1 from Tejas_Garhewal <scienticman@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.

--
September 07, 2021
https://issues.dlang.org/show_bug.cgi?id=22283

--- Comment #2 from Tejas_Garhewal <scienticman@gmail.com> ---
(In reply to Tejas_Garhewal from comment #1)
> (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
> 

Oh, and -inline makes no difference for me.

--
September 07, 2021
https://issues.dlang.org/show_bug.cgi?id=22283

--- Comment #3 from Temtaime <temtaime@gmail.com> ---
You can try it on
https://run.dlang.io/is/w2P2tQ
It makes difference, maybe your compiler is outdated / etc

--
September 07, 2021
https://issues.dlang.org/show_bug.cgi?id=22283

--- Comment #4 from Tejas_Garhewal <scienticman@gmail.com> ---
(In reply to Temtaime from comment #3)
> You can try it on
> https://run.dlang.io/is/w2P2tQ
> It makes difference, maybe your compiler is outdated / etc

Yeah that error is coming for me on dmd 2.097.1

Maybe regression?

--
September 07, 2021
https://issues.dlang.org/show_bug.cgi?id=22283

--- Comment #5 from Tejas_Garhewal <scienticman@gmail.com> ---
(In reply to Tejas_Garhewal from comment #4)
> (In reply to Temtaime from comment #3)
> > You can try it on
> > https://run.dlang.io/is/w2P2tQ
> > It makes difference, maybe your compiler is outdated / etc
> 
> Yeah that error is coming for me on dmd 2.097.1
> 
> Maybe regression?

Sorry, 2.079.2

--
October 18, 2021
https://issues.dlang.org/show_bug.cgi?id=22283

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #6 from Dlang Bot <dlang-bot@dlang.rocks> ---
@Geod24 created dlang/druntime pull request #3592 "[stable] Fix 22283: Weird error in object with inline and preview=in" fixing this issue:

- Fix 22283: Weird error in object with inline and preview=in

  This happens because preview=in uses a 'stronger' version of 'in',
  which makes 'scope const' and 'in' parameters not covariant.
  Why it triggers with '-inline' and not without is anyone's guess.

https://github.com/dlang/druntime/pull/3592

--
October 18, 2021
https://issues.dlang.org/show_bug.cgi?id=22283

Dlang Bot <dlang-bot@dlang.rocks> changed:

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

--- Comment #7 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/druntime pull request #3592 "[stable] Fix 22283: Weird error in object with inline and preview=in" was merged into master:

- 096fa3656feece08d2fce6cd018f6bdacf83c175 by Geod24:
  Fix 22283: Weird error in object with inline and preview=in

  This happens because preview=in uses a 'stronger' version of 'in',
  which makes 'scope const' and 'in' parameters not covariant.
  Why it triggers with '-inline' and not without is anyone's guess.

https://github.com/dlang/druntime/pull/3592

--