mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00
Add tests
This commit is contained in:
parent
a3a452fe35
commit
23ac807fe9
2 changed files with 18 additions and 0 deletions
|
@ -79,6 +79,7 @@ class ErrorSinkNull : ErrorSink
|
|||
|
||||
/*****************************************
|
||||
* Simplest implementation, just sends messages to stderr.
|
||||
* See also: ErrorSinkCompiler.
|
||||
*/
|
||||
class ErrorSinkStderr : ErrorSink
|
||||
{
|
||||
|
|
17
compiler/test/fail_compilation/match_func_ptr.d
Normal file
17
compiler/test/fail_compilation/match_func_ptr.d
Normal file
|
@ -0,0 +1,17 @@
|
|||
/*
|
||||
TEST_OUTPUT:
|
||||
---
|
||||
fail_compilation/match_func_ptr.d(13): Error: cannot match delegate literal to function pointer type `void function()`
|
||||
fail_compilation/match_func_ptr.d(14): Error: cannot match function literal to delegate type `void delegate()`
|
||||
fail_compilation/match_func_ptr.d(15): Error: cannot infer parameter types from `int function()`
|
||||
fail_compilation/match_func_ptr.d(16): Error: cannot infer parameter types from `int delegate(int, int)`
|
||||
---
|
||||
*/
|
||||
|
||||
void main()
|
||||
{
|
||||
void function() f = delegate {};
|
||||
void delegate() d = function {};
|
||||
int function() f2 = i => 2;
|
||||
int delegate(int, int) d2 = i => 2;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue