mirror of
https://github.com/dlang/dmd.git
synced 2025-05-05 09:30:22 +03:00
Remove references to D1 opDot
(#20772)
This commit is contained in:
parent
e5bd2d06aa
commit
cb31f45e15
4 changed files with 1 additions and 48 deletions
|
@ -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;
|
||||||
|
|
|
@ -232,7 +232,6 @@ immutable Msgtable[] msgtable =
|
||||||
{ "opSliceAssign" },
|
{ "opSliceAssign" },
|
||||||
{ "opCall" },
|
{ "opCall" },
|
||||||
{ "opCast" },
|
{ "opCast" },
|
||||||
{ "opDot" },
|
|
||||||
{ "opDispatch" },
|
{ "opDispatch" },
|
||||||
{ "opDollar" },
|
{ "opDollar" },
|
||||||
{ "opUnary" },
|
{ "opUnary" },
|
||||||
|
|
|
@ -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.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -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;
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue