Remove references to D1 opDot (#20772)

This commit is contained in:
Dennis 2025-01-24 12:00:29 +01:00 committed by GitHub
parent e5bd2d06aa
commit cb31f45e15
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 1 additions and 48 deletions

View file

@ -8828,7 +8828,6 @@ struct Id final
static Identifier* opSliceAssign; static Identifier* opSliceAssign;
static Identifier* opCall; static Identifier* opCall;
static Identifier* opCast; static Identifier* opCast;
static Identifier* opDot;
static Identifier* opDispatch; static Identifier* opDispatch;
static Identifier* opDollar; static Identifier* opDollar;
static Identifier* opUnary; static Identifier* opUnary;

View file

@ -232,7 +232,6 @@ immutable Msgtable[] msgtable =
{ "opSliceAssign" }, { "opSliceAssign" },
{ "opCall" }, { "opCall" },
{ "opCast" }, { "opCast" },
{ "opDot" },
{ "opDispatch" }, { "opDispatch" },
{ "opDollar" }, { "opDollar" },
{ "opUnary" }, { "opUnary" },

View file

@ -4883,7 +4883,7 @@ Expression dotExp(Type mt, Scope* sc, Expression e, Identifier ident, DotExpFlag
/*************************************** /***************************************
* `ident` was not found as a member of `mt`. * `ident` was not found as a member of `mt`.
* Attempt to use overloaded opDot(), overloaded opDispatch(), or `alias this`. * Attempt to use overloaded opDispatch() or `alias this`.
* If that fails, forward to visitType(). * If that fails, forward to visitType().
* Params: * Params:
* mt = class or struct * mt = class or struct
@ -4939,21 +4939,6 @@ Expression dotExp(Type mt, Scope* sc, Expression e, Identifier ident, DotExpFlag
ident != Id.postblit && ident != Id.postblit &&
ident != Id.__xpostblit) ident != Id.__xpostblit)
{ {
/* Look for overloaded opDot() to see if we should forward request
* to it.
*/
if (auto fd = search_function(sym, Id.opDot))
{
/* Rewrite e.ident as:
* e.opDot().ident
*/
e = build_overload(e.loc, sc, e, null, fd);
// @@@DEPRECATED_2.110@@@.
// Deprecated in 2.082, made an error in 2.100.
error(e.loc, "`opDot` is obsolete. Use `alias this`");
return ErrorExp.get();
}
/* Look for overloaded opDispatch to see if we should forward request /* Look for overloaded opDispatch to see if we should forward request
* to it. * to it.
*/ */

View file

@ -1,30 +0,0 @@
/*
REQUIRED_ARGS: -de
TEST_OUTPUT:
---
fail_compilation/deprecateopdot.d(27): Error: `opDot` is obsolete. Use `alias this`
fail_compilation/deprecateopdot.d(28): Error: `opDot` is obsolete. Use `alias this`
fail_compilation/deprecateopdot.d(29): Error: `opDot` is obsolete. Use `alias this`
---
*/
struct S6
{
int a, b;
}
struct T6
{
S6 s;
S6* opDot() return
{
return &s;
}
}
void test6()
{
T6 t;
t.a = 4;
assert(t.a == 4);
t.b = 5;
}