Thread overview
[Issue 19066] [REG 2.081.0] Error: `const(Object)` is used as a type
[Issue 19066] [REG 2.080.1] Error: `const(Object)` is used as a type with structs that have symbol named Object
Jul 06, 2018
Jacob Carlborg
Jul 06, 2018
Jacob Carlborg
July 06, 2018
https://issues.dlang.org/show_bug.cgi?id=19066

Steven Schveighoffer <schveiguy@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schveiguy@yahoo.com
           Assignee|nobody@puremagic.com        |schveiguy@yahoo.com

--- Comment #1 from Steven Schveighoffer <schveiguy@yahoo.com> ---
Jacob, I know what this is! It's the fix we worked on at dconf.

https://github.com/dlang/dmd/pull/8222

What's happening here is the local name Object is overriding the global type Object, so the generated toHash function uses that instead.

I'll try using the fully qualified type, and see if it fixes the issue.

--
July 06, 2018
https://issues.dlang.org/show_bug.cgi?id=19066

Steven Schveighoffer <schveiguy@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[REG 2.081.0] Error:        |[REG 2.080.1] Error:
                   |`const(Object)` is used as  |`const(Object)` is used as
                   |a type                      |a type with structs that
                   |                            |have symbol named Object

--- Comment #2 from Steven Schveighoffer <schveiguy@yahoo.com> ---
Updating regression to reflect where the error actually was introduced.

--
July 06, 2018
https://issues.dlang.org/show_bug.cgi?id=19066

--- Comment #3 from Jacob Carlborg <doob@me.com> ---
(In reply to Steven Schveighoffer from comment #1)

> I'll try using the fully qualified type, and see if it fixes the issue.

I gave that a try, it resulted in a new error message:

Error: need `this` for `Object` of type `main.Foo`

Might be a different issue.

--
July 06, 2018
https://issues.dlang.org/show_bug.cgi?id=19066

Steven Schveighoffer <schveiguy@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull, rejects-valid

--- Comment #4 from Steven Schveighoffer <schveiguy@yahoo.com> ---
PR: https://github.com/dlang/dmd/pull/8463

--
July 06, 2018
https://issues.dlang.org/show_bug.cgi?id=19066

--- Comment #5 from Steven Schveighoffer <schveiguy@yahoo.com> ---
(In reply to Jacob Carlborg from comment #3)
> I gave that a try, it resulted in a new error message:

Not sure what you tried, but I found something that seems to work, at least locally.

--
July 06, 2018
https://issues.dlang.org/show_bug.cgi?id=19066

--- Comment #6 from Steven Schveighoffer <schveiguy@yahoo.com> ---
Oh, haha! I meant I'll try updating the compiler to use the fully qualified name object.Object :)

--
July 06, 2018
https://issues.dlang.org/show_bug.cgi?id=19066

--- Comment #7 from Jacob Carlborg <doob@me.com> ---
(In reply to Steven Schveighoffer from comment #6)
> Oh, haha! I meant I'll try updating the compiler to use the fully qualified name object.Object :)

Yes, I did that. But now looking at your PR I see that I only updated to use the fully qualified name in the static if, not later in the body. Your fix works for me.

--
July 11, 2018
https://issues.dlang.org/show_bug.cgi?id=19066

--- Comment #8 from github-bugzilla@puremagic.com ---
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/2ff1ac05b6d523814018dec5970be117c08ff8dd Fix issue 19066 - Allow using symobls Object and object inside a struct without a toHash override.

https://github.com/dlang/dmd/commit/9b7ac1de8071934235707cf9faf2e45ca6be3c23 Merge pull request #8463 from schveiguy/fix19066

Fix issue 19066 - Allow using symobls Object inside a struct without a toHash override

--
July 11, 2018
https://issues.dlang.org/show_bug.cgi?id=19066

github-bugzilla@puremagic.com changed:

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

--