We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9e57074 commit 303ba3bCopy full SHA for 303ba3b
compiler/test/runnable/nullderefcheck.d
@@ -26,27 +26,13 @@ void main()
26
27
void wrap(alias test)(int expectedLine)
28
{
29
- gotFile = null;
30
- gotLine = 0;
31
try
32
33
test();
+ assert(0);
34
}
35
- catch (Error)
+ catch (Error e)
36
+ assert(e.line == expectedLine);
37
38
- assert(gotFile == __FILE__);
39
- assert(gotLine == expectedLine);
40
-}
41
-
42
-string gotFile;
43
-uint gotLine;
44
45
-extern (C) void _d_nullpointerp(immutable(char*) file, uint line)
46
-{
47
- import core.stdc.string : strlen;
48
49
- gotFile = file[0 .. strlen(file)];
50
- gotLine = line;
51
- throw new Error("");
52
0 commit comments