"Fossies" - the Fresh Open Source Software Archive

Member "dmd-2.089.0/test/fail_compilation/fail19520.d" (2 Nov 2019, 922 Bytes) of package /linux/misc/dmd-2.089.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) D source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /* https://issues.dlang.org/show_bug.cgi?id=19520
    2 TEST_OUTPUT:
    3 ---
    4 fail_compilation/fail19520.d(17): Error: incompatible types for `(Empty) is (Empty)`: cannot use `is` with types
    5 fail_compilation/fail19520.d(17):        while evaluating: `static assert((Empty) is (Empty))`
    6 fail_compilation/fail19520.d(18): Error: incompatible types for `(WithSym) is (WithSym)`: cannot use `is` with types
    7 fail_compilation/fail19520.d(18):        while evaluating: `static assert((WithSym) is (WithSym))`
    8 fail_compilation/fail19520.d(19): Error: incompatible types for `(Empty) is (Empty)`: cannot use `is` with types
    9 fail_compilation/fail19520.d(20): Error: incompatible types for `(WithSym) is (WithSym)`: cannot use `is` with types
   10 ---
   11 */
   12 struct Empty { }
   13 struct WithSym { int i; }
   14 
   15 void test()
   16 {
   17     static assert(Empty is Empty);
   18     static assert(WithSym is WithSym);
   19     assert(Empty is Empty);
   20     assert(WithSym is WithSym);
   21 }