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

Change a unittest that test for 'in' => 'const' lowering #213

Merged
merged 1 commit into from
Aug 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 10 additions & 2 deletions source/vibe/internal/traits.d
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,16 @@ unittest {
void write(InputStream stream, ulong nbytes) {}
}

static assert(checkInterfaceConformance!(NonOSStruct2, OutputStream) ==
"NonOSStruct2 does not implement method \"write\" of type @safe void(const(ubyte[]) bytes)");
// `in` used to show up as `const` / `const scope`.
// With dlang/dmd#11474 it shows up as `in`.
// Remove when support for v2.093.0 is dropped
static if (checkInterfaceConformance!(NonOSStruct2, OutputStream) !=
"NonOSStruct2 does not implement method \"write\" of type @safe void(in ubyte[] bytes)")
{
// Fallback to pre-2.092+
static assert(checkInterfaceConformance!(NonOSStruct2, OutputStream) ==
"NonOSStruct2 does not implement method \"write\" of type @safe void(const(ubyte[]) bytes)");
}
}

string functionAttributeString(alias F)(bool restrictions_only)
Expand Down