"Fossies" - the Fresh Open Source Software Archive

Member "dmd-2.089.0/test/fail_compilation/fail225.d" (2 Nov 2019, 391 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 /*
    2 TEST_OUTPUT:
    3 ---
    4 fail_compilation/fail225.d(15): Error: cannot implicitly convert expression `1` of type `int` to `immutable(char*)`
    5 fail_compilation/fail225.d(15): Error: cannot implicitly convert expression `& ch` of type `char*` to `immutable(char*)`
    6 ---
    7 */
    8 struct Struct { 
    9         char* chptr; 
   10 }
   11 
   12 void main()
   13 {
   14         char ch = 'd';
   15         immutable Struct iStruct = {1, &ch};
   16 }
   17