mirror of
https://github.com/dlang/dmd.git
synced 2025-04-28 06:00:13 +03:00
35 lines
1.1 KiB
D
35 lines
1.1 KiB
D
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/fail58.d(26): Error: function `fail58.SomeFunc(dchar[] pText, out int pStopPosn)` is not callable using argument types `(string, int)`
|
|
fail_compilation/fail58.d(26): cannot pass argument `"123"` of type `string` to parameter `dchar[] pText`
|
|
fail_compilation/fail58.d(30): Error: function `fail58.SomeFunc(dchar[] pText, out int pStopPosn)` is not callable using argument types `(string, int)`
|
|
fail_compilation/fail58.d(30): cannot pass argument `""` of type `string` to parameter `dchar[] pText`
|
|
---
|
|
*/
|
|
debug import std.stdio;
|
|
const int anything = -1000; // Line #2
|
|
dchar[] SomeFunc( dchar[] pText, out int pStopPosn)
|
|
{
|
|
if (pText.length == 0)
|
|
pStopPosn = 0;
|
|
else
|
|
pStopPosn = -1;
|
|
debug writefln("DEBUG: using '%s' we get %d", pText, pStopPosn);
|
|
return pText.dup;
|
|
}
|
|
|
|
int main(char[][] pArgs)
|
|
{
|
|
int sp;
|
|
|
|
SomeFunc("123", sp);
|
|
debug writefln("DEBUG: got %d", sp);
|
|
assert(sp == -1);
|
|
|
|
SomeFunc("", sp);
|
|
// if (sp != 0){} // Line #22
|
|
debug writefln("DEBUG: got %d", sp);
|
|
assert(sp == -1);
|
|
return 0;
|
|
}
|