Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad error message for invalid code #20560

Open
thewilsonator opened this issue Dec 15, 2024 · 0 comments
Open

Bad error message for invalid code #20560

thewilsonator opened this issue Dec 15, 2024 · 0 comments

Comments

@thewilsonator
Copy link
Contributor

see #19546 #9495

a.d:

module a;

struct X {
	import b : Baz;
	Err err;
}

b.d:

module b;

struct Baz {
}

struct Qux {
	import c;
}

c.d:

module c;

struct Foo {
	import a : X;
	X[] x;
}

Nullable!Foo foo() {
	Nullable!Foo output;
	return output;
}

struct Nullable(T)
{
    bool opEquals(U)(const(U) rhs) const
    if (is(typeof(this.get == rhs)))
    {
        return true;
    }

    inout(T) get() inout
    {
        return T.init;
    }
}

yields

Error: struct `ice19762.X` had semantic errors when compiling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant