Changes in / [b5629d8:f0d67e5]


Ignore:
Files:
4 added
9 deleted
38 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/bits/collection.hfa

    rb5629d8 rf0d67e5  
    1313        // return true iff *this is an element of a collection
    1414        bool listed( Colable & co ) with( co ) {                        // pre: this != 0
    15                 return next != 0p;
     15                return next != 0;
    1616        }
    1717
     
    2323                return cp->next;
    2424        }
    25 
    26         forall( dtype T ) {
    27                 T *& Next( T * n ) {
    28                         return (T *)Next( (Colable *)n );
    29                 }
    30 
    31                 bool listed( T * n ) {
    32                         return Next( (Colable *)n ) != 0p;
    33                 }
    34         } // distribution
    3525} // distribution
    36 
    3726
    3827struct Collection {
     
    5241                return root == 0p;
    5342        }
    54 
    5543        void * head( Collection & collection ) with( collection ) {
    5644                return root;
     
    6755                curr = 0p;
    6856        } // post: elts = null
    69 
    70         forall( dtype T ) {
    71                 T * Curr( ColIter & ci ) with( ci ) {
    72                         return (T *)curr;
    73                 }
    74         } // distribution
    7557} // distribution
  • libcfa/src/bits/queue.hfa

    rb5629d8 rf0d67e5  
    1515                } // post: empty() & head() == 0 | !empty() & head() in *q
    1616
     17                bool empty( Queue(T) & q ) with( q ) {                  // 0 <=> *q contains no elements
     18                        return empty( (Collection &)q );
     19                }
     20
     21                bool listed( T * n ) {
     22                        return Next( (Colable *)n ) != 0;
     23                }
     24
     25                T *& Next( T * n ) {
     26                        return (T *)Next( (Colable *)n );
     27                }
     28
     29                T * Root( Queue(T) & q ) with( q ) {
     30                        return (T *)root;
     31                }
     32
    1733                void ?{}( Queue(T) &, const Queue(T) & ) = void; // no copy
    1834                Queue(T) & ?=?( const Queue(T) & ) = void;              // no assignment
     
    3955#endif // __CFA_DEBUG__
    4056                        if ( last ) {
    41                                 Next( n ) = head( q );
     57                                Next( n ) = Root( q );
    4258                                q.root = n;
    4359                        } else {
     
    6581                        if ( root ) {
    6682                                root = Next( root );
    67                                 if ( head( q ) == t ) {
     83                                if ( Root( q ) == t ) {
    6884                                        root = last = 0p;                                       // only one element
    6985                                }
     
    116132                                root = from.root;
    117133                        } else {                                                                        // "to" list not empty
    118                                 Next( last ) = head( from );
     134                                Next( last ) = Root( from );
    119135                        }
    120136                        last = from.last;
     
    132148                        to.last = n;                                                            // end of "to" list
    133149                        from.root = Next( n );                                          // start of "from" list
    134                         if ( n == head( from ) ) {                                      // last node in list ?
     150                        if ( n == Root( from ) ) {                                      // last node in list ?
    135151                                from.root = from.last = 0p;                             // mark "from" list empty
    136152                        } else {
     
    148164
    149165        inline {
     166                // wrappers to make ColIter have T
     167                T * Curr( QueueIter(T) & qi ) with( qi ) {
     168                        return (T *)curr;
     169                }
     170
    150171                void ?{}( QueueIter(T) & qi ) with( qi ) {
    151172                        ((ColIter &)qi){};
     
    166187                } // post: curr = {e in q}
    167188
    168                 bool ?>>?( QueueIter(T) & qi, T && tp ) with( qi ) {
     189                bool ?>>?( QueueIter(T) & qi, T *& tp ) with( qi ) {
    169190                        if ( curr ) {
    170                                 &tp = Curr( qi );
     191                                tp = Curr( qi );
    171192                                T * n = Next( Curr( qi ) );
    172193                                curr = (n == Curr( qi ) ) ? 0p : n;
    173                         } else &tp = 0p;
    174                         return &tp != 0p;
     194                        } else tp = 0p;
     195                        return tp != 0p;
    175196                }
    176197                // post: elts == null & !operator>>(tp) | elts != null & *tp' in elts & elts' == elts - *tp & operator>>(tp)
  • libcfa/src/bits/queue_example.cfa

    rb5629d8 rf0d67e5  
    1717        Queue(Fred) fred;
    1818        QueueIter(Fred) fredIter = { fred };
    19         Fred & f;
     19        Fred * f;
     20        int i;
    2021
    2122        sout | nlOff;                                                                           // turn off auto newline
    2223
    2324        for ( ; fredIter >> f; ) {                                                      // empty list
    24                 sout | f.i | ' ';
     25                sout | f->i | ' ';
    2526        }
    2627        sout | "empty" | nl;
    2728       
    28         for ( i; 10 ) {
     29        for ( i = 0; i < 10; i += 1 ) {
    2930                add( fred, new( 2 * i ) );
    3031        }
    3132
    32         for ( QueueIter(Fred) iter = { fred }; iter >> f; ) {
    33                 sout | f.i | ' ';
     33        for ( over( fredIter, fred ); fredIter >> f; ) {
     34                sout | f->i | ' ';
    3435        }
    3536        sout | nl;
    3637
    37         for ( i; 9 ) {
     38        for ( i = 0; i < 9; i += 1 ) {
    3839                delete( drop( fred ) );
    3940        }
    4041
    4142        for ( over( fredIter, fred ); fredIter >> f; ) {
    42                 sout | f.i | ' ';
     43                sout | f->i | ' ';
    4344        }
    4445        sout | nl;
    4546       
    46         for ( i; 10 ) {
     47        for ( i = 0; i < 10; i += 1 ) {
    4748                add( fred, new( 2 * i + 1 ) );
    4849        }
    4950        for ( over( fredIter, fred ); fredIter >> f; ) {
    50                 sout | f.i | ' ';
     51                sout | f->i | ' ';
    5152        }
    5253        sout | nl;
    5354
    5455        for ( over( fredIter, fred ); fredIter >> f; ) {
    55                 delete( &f );
     56                delete( f );
    5657        }
    5758
     
    7071        Queue(Mary) mary;
    7172        QueueIter(Mary) maryIter = { mary };
    72         Mary & m;
     73        Mary * m;
    7374
    7475        for ( ; maryIter >> m; ) {                                                      // empty list
    75                 sout | m.i | m.j | ' ';
     76                sout | m->i | m->j | ' ';
    7677        }
    7778        sout | "empty" | nl;
    7879       
    79         for ( i; 10 ) {
     80        for ( i = 0; i < 10; i += 1 ) {
    8081                add( mary, new( 2 * i ) );
    8182        }
    8283
    83         for ( QueueIter(Mary) iter = { mary }; iter >> m; ) {
    84                 sout | m.i | m.j | ' ';
     84        for ( over( maryIter, mary ); maryIter >> m; ) {
     85                sout | m->i | m->j | ' ';
    8586        }
    8687        sout | nl;
    8788       
    88         for ( i; 9 ) {
     89        for ( i = 0; i < 9; i += 1 ) {
    8990                delete( drop( mary ) );
    9091        }
    9192
    9293        for ( over( maryIter, mary ); maryIter >> m; ) {
    93                 sout | m.i | m.j | ' ';
     94                sout | m->i | m->j | ' ';
    9495        }
    9596        sout | nl;
    9697       
    97         for ( i; 10 ) {
     98        for ( i = 0; i < 10; i += 1 ) {
    9899                add( mary, new( 2 * i + 1 ) );
    99100        }
    100101        for ( over( maryIter, mary ); maryIter >> m; ) {
    101                 sout | m.i | m.j | ' ';
     102                sout | m->i | m->j | ' ';
    102103        }
    103104        sout | nl;
    104105
    105106        for ( over( maryIter, mary ); maryIter >> m; ) {
    106                 delete( &m );
     107                delete( m );
    107108        }
    108109}
  • libcfa/src/bits/sequence.hfa

    rb5629d8 rf0d67e5  
    1010inline {
    1111        void ?{}( Seqable & sq ) with( sq ) {
    12                 ((Colable &) sq){};
     12                ((Colable & ) sq){};
    1313                back = 0p;
    1414        } // post: ! listed()
     
    3434                } // post: empty() & head() == 0 | !empty() & head() in *s
    3535
     36                bool empty( Sequence(T) & s ) with( s ) {               // 0 <=> *s contains no elements
     37                        return empty( (Collection &)s );
     38                }
     39
     40                bool listed( T * n ) {
     41                        return Next( (Colable *)n ) != 0;
     42                }
     43
     44                T *& Next( T * n ) {
     45                        return (T *)Next( (Colable *)n );
     46                }
     47
    3648                T *& Back( T * n ) {
    3749                        return (T *)Back( (Seqable *)n );
     50                }
     51
     52                T * Root( Sequence(T) & s ) with( s ) {
     53                        return (T *)root;
    3854                }
    3955
     
    4662
    4763                // Return a pointer to the last sequence element, without removing it. 
    48                 T & tail( Sequence(T) & s ) with( s ) {
    49                         return root ? (T &)Back( head( s ) ) : *0p;     // needs cast?
     64                T * tail( Sequence(T) & s ) with( s ) {
     65                        return root ? (T *)Back( Root( s ) ) : 0p;      // needs cast?
    5066                }       // post: empty() & tail() == 0 | !empty() & tail() in *s
    5167
     
    5571                        if ( ! listed( n ) ) abort( "(Sequence &)%p.succ( %p ) : Node is not on a list.", &s, n );
    5672#endif // __CFA_DEBUG__
    57                         return Next( n ) == head( s ) ? 0p : Next( n );
     73                        return Next( n ) == Root( s ) ? 0p : Next( n );
    5874                }       // post: n == tail() & succ(n) == 0 | n != tail() & *succ(n) in *s
    5975
     
    6379                        if ( ! listed( n ) ) abort( "(Sequence &)%p.pred( %p ) : Node is not on a list.", &s, n );
    6480#endif // __CFA_DEBUG__
    65                         return n == head( s ) ? 0p : Back( n );
     81                        return n == Root( s ) ? 0p : Back( n );
    6682                }       // post: n == head() & head(n) == 0 | n != head() & *pred(n) in *s
    6783
    6884
    6985                // Insert *n into the sequence before *bef, or at the end if bef == 0.
    70                 void insertBef( Sequence(T) & s, T & n, T & bef ) with( s ) { // pre: !n->listed() & *bef in *s
    71 #ifdef __CFA_DEBUG__
    72                         if ( listed( &n ) ) abort( "(Sequence &)%p.insertBef( %p, %p ) : Node is already on another list.", &s, n, &bef );
    73 #endif // __CFA_DEBUG__
    74                         if ( &bef == head( s ) ) {                                      // must change root
     86                void insertBef( Sequence(T) & s, T * n, T * bef ) with( s ) { // pre: !n->listed() & *bef in *s
     87#ifdef __CFA_DEBUG__
     88                        if ( listed( n ) ) abort( "(Sequence &)%p.insertBef( %p, %p ) : Node is already on another list.", &s, n, bef );
     89#endif // __CFA_DEBUG__
     90                        if ( bef == Root( s ) ) {                                       // must change root
    7591                                if ( root ) {
    76                                         Next( &n ) = head( s );
    77                                         Back( &n ) = Back( head( s ) );
     92                                        Next( n ) = Root( s );
     93                                        Back( n ) = Back( Root( s ) );
    7894                                        // inserted node must be consistent before it is seen
    7995                                        asm( "" : : : "memory" );                       // prevent code movement across barrier
    80                                         Back( head( s ) ) = &n;
    81                                         Next( Back( &n ) ) = &n;
     96                                        Back( Root( s ) ) = n;
     97                                        Next( Back( n ) ) = n;
    8298                                } else {
    83                                         Next( &n ) = &n;
    84                                         Back( &n ) = &n;
     99                                        Next( n ) = n;
     100                                        Back( n ) = n;
    85101                                } // if
    86102                                // inserted node must be consistent before it is seen
    87103                                asm( "" : : : "memory" );                               // prevent code movement across barrier
    88                                 root = &n;
     104                                root = n;
    89105                        } else {
    90                                 if ( ! &bef ) &bef = head( s );
    91                                 Next( &n ) = &bef;
    92                                 Back( &n ) = Back( &bef );
     106                                if ( ! bef ) bef = Root( s );
     107                                Next( n ) = bef;
     108                                Back( n ) = Back( bef );
    93109                                // inserted node must be consistent before it is seen
    94110                                asm( "" : : : "memory" );                               // prevent code movement across barrier
    95                                 Back( &bef ) = &n;
    96                                 Next( Back( &n ) ) = &n;
     111                                Back( bef ) = n;
     112                                Next( Back( n ) ) = n;
    97113                        } // if
    98114                }       // post: n->listed() & *n in *s & succ(n) == bef
     
    100116
    101117                // Insert *n into the sequence after *aft, or at the beginning if aft == 0.
    102                 void insertAft( Sequence(T) & s, T & aft, T & n ) with( s ) {   // pre: !n->listed() & *aft in *s
    103 #ifdef __CFA_DEBUG__
    104                         if ( listed( &n ) ) abort( "(Sequence &)%p.insertAft( %p, %p ) : Node is already on another list.", &s, &aft, &n );
    105 #endif // __CFA_DEBUG__
    106                         if ( ! &aft ) {                                                         // must change root
     118                void insertAft( Sequence(T) & s, T *aft, T *n ) with( s ) {     // pre: !n->listed() & *aft in *s
     119#ifdef __CFA_DEBUG__
     120                        if ( listed( n ) ) abort( "(Sequence &)%p.insertAft( %p, %p ) : Node is already on another list.", &s, aft, n );
     121#endif // __CFA_DEBUG__
     122                        if ( ! aft ) {                                                          // must change root
    107123                                if ( root ) {
    108                                         Next( &n ) = head( s );
    109                                         Back( &n ) = Back( head( s ) );
     124                                        Next( n ) = Root( s );
     125                                        Back( n ) = Back( Root( s ) );
    110126                                        // inserted node must be consistent before it is seen
    111127                                        asm( "" : : : "memory" );                       // prevent code movement across barrier
    112                                         Back( head( s ) ) = &n;
    113                                         Next( Back( &n ) ) = &n;
     128                                        Back( Root( s ) ) = n;
     129                                        Next( Back( n ) ) = n;
    114130                                } else {
    115                                         Next( &n ) = &n;
    116                                         Back( &n ) = &n;
     131                                        Next( n ) = n;
     132                                        Back( n ) = n;
    117133                                } // if
    118134                                asm( "" : : : "memory" );                               // prevent code movement across barrier
    119                                 root = &n;
     135                                root = n;
    120136                        } else {
    121                                 Next( &n ) = Next( &aft );
    122                                 Back( &n ) = &aft;
     137                                Next( n ) = Next( aft );
     138                                Back( n ) = aft;
    123139                                // inserted node must be consistent before it is seen
    124140                                asm( "" : : : "memory" );                               // prevent code movement across barrier
    125                                 Back( Next( &n ) ) = &n;
    126                                 Next( &aft ) = &n;
     141                                Back( Next( n ) ) = n;
     142                                Next( aft ) = n;
    127143                        } // if
    128144                }         // post: n->listed() & *n in *s & succ(n) == bef
    129145               
    130146                // pre: n->listed() & *n in *s
    131                 void remove( Sequence(T) & s, T & n ) with( s ) { // O(1)
    132 #ifdef __CFA_DEBUG__
    133                         if ( ! listed( &n ) ) abort( "(Sequence &)%p.remove( %p ) : Node is not on a list.", &s, &n );
    134 #endif // __CFA_DEBUG__
    135                         if ( &n == head( s ) ) {
    136                                 if ( Next( head( s ) ) == head( s ) ) root = 0p;
    137                                 else root = Next( head(s ) );
    138                         } // if
    139                         Back( Next( &n ) ) = Back( &n );
    140                         Next( Back( &n ) ) = Next( &n );
    141                         Next( &n ) = Back( &n ) = 0p;
     147                void remove( Sequence(T) & s, T *n ) with( s ) { // O(1)
     148#ifdef __CFA_DEBUG__
     149                        if ( ! listed( n ) ) abort( "(Sequence &)%p.remove( %p ) : Node is not on a list.", &s, n );
     150#endif // __CFA_DEBUG__
     151                        if ( n == Root( s ) ) {
     152                                if ( Next( Root( s ) ) == Root( s ) ) root = 0p;
     153                                else root = Next( Root(s ) );
     154                        } // if
     155                        Back( Next( n ) ) = Back( n );
     156                        Next( Back( n ) ) = Next( n );
     157                        Next( n ) = Back( n ) = 0p;
    142158                }                                                       // post: !n->listed().
    143159
    144160                // Add an element to the head of the sequence.
    145                 void addHead( Sequence(T) & s, T & n ) {                // pre: !n->listed(); post: n->listed() & head() == n
    146                         insertAft( s, *0p, n );
     161                void addHead( Sequence(T) & s, T *n ) {                 // pre: !n->listed(); post: n->listed() & head() == n
     162                        insertAft( s, 0, n );
    147163                }
    148164                // Add an element to the tail of the sequence.
    149                 void addTail( Sequence(T) & s, T & n ) {                // pre: !n->listed(); post: n->listed() & head() == n
    150                         insertBef( s, n, *0p );
     165                void addTail( Sequence(T) & s, T *n ) {                 // pre: !n->listed(); post: n->listed() & head() == n
     166                        insertBef( s, n, 0 );
    151167                }
    152168                // Add an element to the tail of the sequence.
    153                 void add( Sequence(T) & s, T & n ) {                    // pre: !n->listed(); post: n->listed() & head() == n
     169                void add( Sequence(T) & s, T *n ) {                             // pre: !n->listed(); post: n->listed() & head() == n
    154170                        addTail( s, n );
    155171                }
    156172                // Remove and return the head element in the sequence.
    157                 T & dropHead( Sequence(T) & s ) {
     173                T * dropHead( Sequence(T) & s ) {
    158174                        T * n = head( s );
    159                         return n ? remove( s, *n ), *n : *0p;
     175                        return n ? remove( s, n ), n : 0p;
    160176                }
    161177                // Remove and return the head element in the sequence.
    162                 T & drop( Sequence(T) & s ) {
     178                T * drop( Sequence(T) & s ) {
    163179                        return dropHead( s );
    164180                }
    165181                // Remove and return the tail element in the sequence.
    166                 T & dropTail( Sequence(T) & s ) {
    167                         T & n = tail( s );
    168                         return &n ? remove( s, n ), n : *0p;
     182                T * dropTail( Sequence(T) & s ) {
     183                        T * n = tail( s );
     184                        return n ? remove( s, n ), n : 0p;
    169185                }
    170186
     
    175191                                root = from.root;
    176192                        } else {                                                                        // "to" list not empty
    177                                 T * toEnd = Back( head( s ) );
    178                                 T * fromEnd = Back( head( from ) );
     193                                T * toEnd = Back( Root( s ) );
     194                                T * fromEnd = Back( Root( from ) );
    179195                                Back( root ) = fromEnd;
    180                                 Next( fromEnd ) = head( s );
     196                                Next( fromEnd ) = Root( s );
    181197                                Back( from.root ) = toEnd;
    182                                 Next( toEnd ) = head( from );
     198                                Next( toEnd ) = Root( from );
    183199                        } // if
    184200                        from.root = 0p;                                                         // mark "from" list empty
     
    197213                                from.root = 0p;                                                 // mark "from" list empty
    198214                        } else {
    199                                 Back( head( from ) ) = Back( head( to ) ); // fix "from" list
    200                                 Next( Back( head( to ) ) ) = head( from );
    201                                 Next( n ) = head( to );                                 // fix "to" list
    202                                 Back( head( to ) ) = n;
     215                                Back( Root( from ) ) = Back( Root( to ) ); // fix "from" list
     216                                Next( Back( Root( to ) ) ) = Root( from );
     217                                Next( n ) = Root( to );                                 // fix "to" list
     218                                Back( Root( to ) ) = n;
    203219                        } // if
    204220                        transfer( s, to );
     
    215231
    216232        inline {
    217                 void ?{}( SeqIter(T) & si ) with( si ) {
    218                         ((ColIter &)si){};
     233                // wrappers to make ColIter have T
     234                T * Curr( SeqIter(T) & si ) with( si ) {
     235                        return (T *)curr;
     236                }
     237
     238                void ?{}( SeqIter(T) & si ) with( si ) {       
     239                        ((ColIter &) si){};
    219240                        seq = 0p;
    220241                } // post: elts = null.
     
    223244                        ((ColIter &) si){};
    224245                        seq = &s;
    225                         curr = head( s );
    226246                } // post: elts = null.
    227247               
     
    231251                } // post: elts = {e in s}.
    232252
    233                 bool ?>>?( SeqIter(T) & si, T && tp ) with( si ) {
     253                bool ?>>?( SeqIter(T) & si, T *& tp ) with( si ) {
    234254                        if ( curr ) {
    235                                 &tp = Curr( si );
    236                                 T * n = succ( *seq, Curr( si ) );
     255                                tp = Curr( si );
     256                                T *n = succ( *seq, Curr( si ) );
    237257                                curr = n == head( *seq ) ? 0p : n;
    238                         } else &tp = 0p;
    239                         return &tp != 0p;
     258                        } else tp = 0p;
     259                        return tp != 0p;
    240260                }
    241261        } // distribution
     
    249269
    250270        inline {
     271                // wrappers to make ColIter have T
     272                T * Curr( SeqIterRev(T) & si ) with( si ) {
     273                        return (T *)curr;
     274                }
     275
    251276                void ?{}( SeqIterRev(T) & si ) with( si ) {     
    252277                        ((ColIter &) si){};
     
    257282                        ((ColIter &) si){};
    258283                        seq = &s;
    259                         curr = &tail( s );
    260284                } // post: elts = null.
    261285               
    262286                void over( SeqIterRev(T) & si, Sequence(T) & s ) with( si ) {
    263287                        seq = &s;
    264                         curr = &tail( s );
     288                        curr = tail( s );
    265289                } // post: elts = {e in s}.
    266290
    267                 bool ?>>?( SeqIterRev(T) & si, T && tp ) with( si ) {
     291                bool ?>>?( SeqIterRev(T) & si, T *&tp ) with( si ) {
    268292                        if ( curr ) {
    269                                 &tp = Curr( si );
    270                                 T * n = pred( *seq, Curr( si ) );
    271                                 curr = n == &tail( *seq ) ? 0p : n;
    272                         } else &tp = 0p;
    273                         return &tp != 0p;
     293                                tp = Curr( si );
     294                                T *n = pred( *seq, Curr( si ) );
     295                                curr = n == tail( *seq ) ? 0p : n;
     296                        } else tp = 0p;
     297                        return tp != 0p;
    274298                }
    275299        } // distribution
  • libcfa/src/bits/sequence_example.cfa

    rb5629d8 rf0d67e5  
    1717        Sequence(Fred) fred;
    1818        SeqIter(Fred) fredIter = { fred };
    19         Fred & f;
     19        Fred * f;
     20        int i;
    2021
    2122        sout | nlOff;                                                                           // turn off auto newline
    2223
    2324        for ( ; fredIter >> f; ) {                                                      // empty list
    24                 sout | f.i | ' ';
     25                sout | f->i | ' ';
    2526        }
    2627        sout | "empty" | nl;
    2728       
    28         for ( i; 10 ) {
    29                 add( fred, *new( 2 * i ) );
     29        for ( i = 0; i < 10; i += 1 ) {
     30                add( fred, new( 2 * i ) );
    3031        }
    3132
    32         for ( SeqIter(Fred) iter = { fred }; iter >> f; ) {
    33                 sout | f.i | ' ';
     33        for ( over( fredIter, fred ); fredIter >> f; ) {
     34                sout | f->i | ' ';
    3435        }
    3536        sout | nl;
    3637
    37         for ( i; 9 ) {
    38                 delete( &dropHead( fred ) );
     38        for ( i = 0; i < 9; i += 1 ) {
     39                delete( dropHead( fred ) );
    3940        }
    4041
    4142        for ( over( fredIter, fred ); fredIter >> f; ) {
    42                 sout | f.i | ' ';
     43                sout | f->i | ' ';
    4344        }
    4445        sout | nl;
    4546       
    46         for ( i; 10 ) {
    47                 addTail( fred, *new( 2 * i + 1 ) );
     47        for ( i = 0; i < 10; i += 1 ) {
     48                addTail( fred, new( 2 * i + 1 ) );
    4849        }
    4950        for ( over( fredIter, fred ); fredIter >> f; ) {
    50                 sout | f.i | ' ';
     51                sout | f->i | ' ';
    5152        }
    5253        sout | nl;
    5354
    54         for ( i; 9 ) {
    55                 delete( &dropTail( fred ) );
     55        for ( i = 0; i < 9; i += 1 ) {
     56                delete( dropTail( fred ) );
    5657        }
    5758        for ( over( fredIter, fred ); fredIter >> f; ) {
    58                 sout | f.i | ' ';
     59                sout | f->i | ' ';
    5960        }
    6061        sout | nl;
    6162
    6263        for ( over( fredIter, fred ); fredIter >> f; ) {
    63                 delete( &f );
     64                delete( f );
    6465        }
    6566
     
    7980        Sequence(Mary) baz;
    8081        SeqIter(Mary) maryIter = { mary };
    81         Mary & m;
     82        Mary * m;
    8283
    8384        for ( ; maryIter >> m; ) {                                                      // empty list
    84                 sout | m.i | m.j | ' ';
     85                sout | m->i | m->j | ' ';
    8586        }
    8687        sout | "empty" | nl;
    8788       
    88         for ( i; 10 ) {
    89                 add( mary, *new( 2 * i ) );
    90                 add( baz, *new( 2 * i ) );
     89        for ( i = 0; i < 10; i += 1 ) {
     90                add( mary, new( 2 * i ) );
     91                add( baz, new( 2 * i ) );
    9192        }
    9293
    93         for ( SeqIter(Mary) iter = { mary }; iter >> m; ) {
    94                 sout | m.i | m.j | ' ';
     94        for ( over( maryIter, mary ); maryIter >> m; ) {
     95                sout | m->i | m->j | ' ';
    9596        }
    9697        sout | nl;
    9798       
    98         for ( i; 9 ) {
    99                 delete( &dropHead( mary ) );
     99        for ( i = 0; i < 9; i += 1 ) {
     100                delete( dropHead( mary ) );
    100101        }
    101102
    102103        for ( over( maryIter, mary ); maryIter >> m; ) {
    103                 sout | m.i | m.j | ' ';
     104                sout | m->i | m->j | ' ';
    104105        }
    105106        sout | nl;
    106107       
    107         for ( i; 10 ) {
    108                 addTail( mary, *new( 2 * i + 1 ) );
     108        for ( i = 0; i < 10; i += 1 ) {
     109                addTail( mary, new( 2 * i + 1 ) );
    109110        }
    110111        for ( over( maryIter, mary ); maryIter >> m; ) {
    111                 sout | m.i | m.j | ' ';
     112                sout | m->i | m->j | ' ';
    112113        }
    113114        sout | nl;
    114115
    115         for ( i; 9 ) {
    116                 delete( &dropTail( mary ) );
     116        for ( i = 0; i < 9; i += 1 ) {
     117                delete( dropTail( mary ) );
    117118        }
    118119        for ( over( maryIter, mary ); maryIter >> m; ) {
    119                 sout | m.i | m.j | ' ';
     120                sout | m->i | m->j | ' ';
    120121        }
    121122        sout | nl;
     
    124125
    125126        for ( over( maryIter, baz ); maryIter >> m; ) {
    126                 sout | m.i | m.j | ' ';
     127                sout | m->i | m->j | ' ';
    127128        }
    128129        sout | "empty" | nl;
    129130
    130131        for ( over( maryIter, mary ); maryIter >> m; ) {
    131                 sout | m.i | m.j | ' ';
     132                sout | m->i | m->j | ' ';
    132133        }
    133134        sout | nl;
    134135
    135136        for ( over( maryIter, mary ); maryIter >> m; ) {
    136                 delete( &m );
     137                delete( m );
    137138        }
    138139}
    139140
    140141// Local Variables: //
    141 // compile-command: "cfa sequence_example.cfa" //
     142// compile-command: "cfa sequence_example.cc" //
    142143// End: //
  • libcfa/src/bits/stack.hfa

    rb5629d8 rf0d67e5  
    1414                } // post: empty() & head() == 0 | !empty() & head() in *this
    1515
     16                bool empty( Stack(T) & s ) with( s ) {                  // 0 <=> *this contains no elements
     17                        return empty( (Collection &)s );
     18                }
     19
     20                T *& Next( T * n ) {
     21                        return (T *)Next( (Colable *)n );
     22                }
     23
     24                T * Root( Stack(T) & s ) with( s ) {
     25                        return (T *)root;
     26                }
     27
    1628                void ?{}( Stack(T) &, const Stack(T) & ) = void; // no copy
    1729                Stack(T) & ?=?( const Stack(T) & ) = void;              // no assignment
     
    2133                } // post: empty()
    2234
    23                 T & top( Stack(T) & s ) with( s ) {
    24                         return *head( s );
     35                T * top( Stack(T) & s ) with( s ) {
     36                        return head( s );
    2537                }
    2638
    27                 void addHead( Stack(T) & s, T & n ) with( s ) {
     39                void addHead( Stack(T) & s, T * n ) with( s ) {
    2840#ifdef __CFA_DEBUG__
    29                         if ( listed( (Colable &)(n) ) ) abort( "(Stack &)%p.addHead( %p ) : Node is already on another list.", &s, n );
     41                        if ( listed( (Colable &)(*n) ) ) abort( "(Stack &)%p.addHead( %p ) : Node is already on another list.", &s, n );
    3042#endif // __CFA_DEBUG__
    31                         Next( &n ) = head( s ) ? head( s ) : &n;
    32                         root = &n;
     43                        Next( n ) = Root( s ) ? Root( s ) : n;
     44                        root = n;
    3345                }
    3446
    35                 void add( Stack(T) & s, T & n ) with( s ) {
     47                void add( Stack(T) & s, T * n ) with( s ) {
    3648                        addHead( s, n );
    3749                }
    3850
    39                 void push( Stack(T) & s, T & n ) with( s ) {
     51                void push( Stack(T) & s, T * n ) with( s ) {
    4052                        addHead( s, n );
    4153                }
    4254
    43                 T & drop( Stack(T) & s ) with( s ) {
    44                         T & t = *head( s );
     55                T * drop( Stack(T) & s ) with( s ) {
     56                        T * t = head( s );
    4557                        if ( root ) {
    4658                                root = ( T *)Next(root);
    47                                 if ( head( s ) == &t ) root = 0p;               // only one element ?
    48                                 Next( &t ) = 0p;
     59                                if ( Root( s ) == t ) root = 0p;                // only one element ?
     60                                Next( t ) = 0p;
    4961                        } // if
    5062                        return t;
    5163                }
    5264
    53                 T & pop( Stack(T) & s ) with( s ) {
     65                T * pop( Stack(T) & s ) with( s ) {
    5466                        return drop( s );
    5567                }
     
    6476
    6577        inline {
     78                // wrappers to make ColIter have T
     79                T * Curr( StackIter(T) & si ) with( si ) {
     80                        return (T *)curr;
     81                }
     82
    6683                void ?{}( StackIter(T) & si ) with( si ) {
    6784                        ((ColIter &)si){};
     
    7390                } // post: curr = {e in s}
    7491
    75                 void ?{}( StackIter(T) & si, T & start ) with( si ) {
    76                         curr = &start;
     92                void ?{}( StackIter(T) & si, T * start ) with( si ) {
     93                        curr = start;
    7794                } // post: curr = {e in s}
    7895
     
    8299                } // post: curr = {e in s}
    83100
    84                 bool ?>>?( StackIter(T) & si, T && tp ) with( si ) {
     101                bool ?>>?( StackIter(T) & si, T *& tp ) with( si ) {
    85102                        if ( curr ) {
    86                                 &tp = Curr( si );
     103                                tp = Curr( si );
    87104                                T * n = Next( Curr( si ) );
    88                                 curr = n == Curr( si ) ? 0p : n;
    89                         } else &tp = 0p;
    90                         return &tp != 0p;
     105                                curr = (n == Curr( si ) ) ? 0p : n;
     106                        } else tp = 0p;
     107                        return tp != 0p;
    91108                }
    92109        } // distribution
  • libcfa/src/bits/stack_example.cfa

    rb5629d8 rf0d67e5  
    1717        Stack(Fred) fred;
    1818        StackIter(Fred) fredIter = { fred };
    19         Fred & f;
     19        Fred * f;
     20        int i;
    2021
    2122        sout | nlOff;                                                                           // turn off auto newline
    2223
    2324        for ( ; fredIter >> f; ) {                                                      // empty list
    24                 sout | f.i | ' ';
     25                sout | f->i | ' ';
    2526        }
    2627        sout | "empty" | nl;
    2728       
    28         for ( i; 10 ) {
    29                 push( fred, *new( 2 * i ) );
     29        for ( i = 0; i < 10; i += 1 ) {
     30                push( fred, new( 2 * i ) );
    3031        }
    3132
    32         for ( StackIter(Fred) iter = { fred }; iter >> f; ) {
    33                 sout | f.i | ' ';
     33        for ( over( fredIter, fred ); fredIter >> f; ) {
     34                sout | f->i | ' ';
    3435        }
    3536        sout | nl;
    3637       
    37         for ( i; 9 ) {
    38                 delete( &pop( fred ) );
     38        for ( i = 0; i < 9; i += 1 ) {
     39                delete( pop( fred ) );
    3940        }
    4041
    4142        for ( over( fredIter, fred ); fredIter >> f; ) {
    42                 sout | f.i | ' ';
     43                sout | f->i | ' ';
    4344        }
    4445        sout | nl;
    4546       
    46         for ( i; 10 ) {
    47                 push( fred, *new( 2 * i + 1 ) );
     47        for ( i = 0; i < 10; i += 1 ) {
     48                push( fred, new( 2 * i + 1 ) );
    4849        }
    4950        for ( over( fredIter, fred ); fredIter >> f; ) {
    50                 sout | f.i | ' ';
     51                sout | f->i | ' ';
    5152        }
    5253        sout | nl;
    5354
    5455        for ( over( fredIter, fred ); fredIter >> f; ) {
    55                 delete( &f );
     56                delete( f );
    5657        }
    5758
     
    7071        Stack(Mary) mary;
    7172        StackIter(Mary) maryIter = { mary };
    72         Mary & m;
     73        Mary * m;
    7374
    7475        for ( ; maryIter >> m; ) {                                                      // empty list
    75                 sout | m.i | m.j | ' ';
     76                sout | m->i | m->j | ' ';
    7677        }
    7778        sout | "empty" | nl;
    7879       
    79         for ( i; 10 ) {
    80                 push( mary, *new( 2 * i ) );
     80        for ( i = 0; i < 10; i += 1 ) {
     81                push( mary, new( 2 * i ) );
    8182        }
    8283
    83         for ( StackIter(Mary) iter = { mary }; iter >> m; ) {
    84                 sout | m.i | m.j | ' ';
     84        for ( over( maryIter, mary ); maryIter >> m; ) {
     85                sout | m->i | m->j | ' ';
    8586        }
    8687        sout | nl;
    8788       
    88         for ( i; 9 ) {
    89                 delete( &pop( mary ) );
     89        for ( i = 0; i < 9; i += 1 ) {
     90                delete( pop( mary ) );
    9091        }
    9192
    9293        for ( over( maryIter, mary ); maryIter >> m; ) {
    93                 sout | m.i | m.j | ' ';
     94                sout | m->i | m->j | ' ';
    9495        }
    9596        sout | nl;
    9697       
    97         for ( i; 10 ) {
    98                 push( mary, *new( 2 * i + 1 ) );
     98        for ( i = 0; i < 10; i += 1 ) {
     99                push( mary, new( 2 * i + 1 ) );
    99100        }
    100101        for ( over( maryIter, mary ); maryIter >> m; ) {
    101                 sout | m.i | m.j | ' ';
     102                sout | m->i | m->j | ' ';
    102103        }
    103104        sout | nl;
    104105
    105106        for ( over( maryIter, mary ); maryIter >> m; ) {
    106                 delete( &m );
     107                delete( m );
    107108        }
    108109}
  • src/AST/Print.cpp

    rb5629d8 rf0d67e5  
    205205
    206206        void preprint( const ast::NamedTypeDecl * node ) {
    207                 if ( ! node->name.empty() ) {
    208                         if( deterministic_output && isUnboundType(node->name) ) os << "[unbound]:";
    209                         else os << node->name << ": ";
    210                 }
     207                if ( ! node->name.empty() ) os << node->name << ": ";
    211208
    212209                if ( ! short_mode && node->linkage != Linkage::Cforall ) {
     
    243240
    244241                if ( node->result ) {
    245                         os << endl << indent << "... with resolved type:" << endl;
    246                         ++indent;
    247                         os << indent;
    248                         node->result->accept( *this );
    249                         --indent;
     242                        if (!deterministic_output) {
     243                                os << endl << indent << "... with resolved type:" << endl;
     244                                ++indent;
     245                                os << indent;
     246                                node->result->accept( *this );
     247                                --indent;
     248                        }
    250249                }
    251250
     
    13831382        virtual const ast::Type * visit( const ast::TypeInstType * node ) override final {
    13841383                preprint( node );
    1385                 const auto & _name = deterministic_output && isUnboundType(node) ? "[unbound]" : node->name;
    1386                 os << "instance of type " << _name
     1384                os << "instance of type " << node->name
    13871385                   << " (" << (node->kind == ast::TypeDecl::Ftype ? "" : "not ") << "function type)";
    13881386                print( node->params );
  • src/AST/Type.cpp

    rb5629d8 rf0d67e5  
    133133
    134134BaseInstType::BaseInstType( const BaseInstType & o )
    135 : ParameterizedType( o.qualifiers, copy( o.attributes ) ), params(), name( o.name ),
     135: ParameterizedType( o.qualifiers, copy( o.attributes ) ), params(), name( o.name ), 
    136136  hoistType( o.hoistType ) {
    137137        Pass< ForallSubstitutor > sub;
     
    222222                // TODO: once TypeInstType representation is updated, it should properly check
    223223                // if the context id is filled. this is a temporary hack for now
    224                 return isUnboundType(typeInst->name);
    225         }
    226         return false;
    227 }
    228 
    229 bool isUnboundType(const std::string & tname) {
    230         // xxx - look for a type name produced by renameTyVars.
    231 
    232         // TODO: once TypeInstType representation is updated, it should properly check
    233         // if the context id is filled. this is a temporary hack for now
    234         if (std::count(tname.begin(), tname.end(), '_') >= 3) {
    235                 return true;
     224                if (std::count(typeInst->name.begin(), typeInst->name.end(), '_') >= 3) {
     225                        return true;
     226                }
    236227        }
    237228        return false;
  • src/AST/Type.hpp

    rb5629d8 rf0d67e5  
    536536
    537537bool isUnboundType(const Type * type);
    538 bool isUnboundType(const std::string & tname);
    539538
    540539}
  • src/AST/TypeEnvironment.cpp

    rb5629d8 rf0d67e5  
    3434#include "ResolvExpr/Unify.h"      // for unifyInexact
    3535#include "Tuples/Tuples.h"         // for isTtype
    36 #include "CompilationState.h"
    3736
    3837using ResolvExpr::WidenMode;
     
    5756
    5857void print( std::ostream & out, const EqvClass & clz, Indenter indent ) {
    59         out << "(";
    60         bool first = true;
    61         for(const auto & var : clz.vars) {
    62                 if(first) first = false;
    63                 else out << " ";
    64                 if( deterministic_output && isUnboundType(var) ) out << "[unbound]";
    65                 else out << var;
    66         }
     58        out << "( ";
     59        std::copy( clz.vars.begin(), clz.vars.end(), std::ostream_iterator< std::string >( out, " " ) );
    6760        out << ")";
    6861
  • src/Common/CodeLocation.h

    rb5629d8 rf0d67e5  
    4242        }
    4343
    44         bool startsBefore( CodeLocation const & other ) const {
    45                 if( filename < other.filename ) return true;
    46                 if( filename > other.filename ) return false;
    47 
    48                 if( first_line < other.first_line ) return true;
    49                 if( first_line > other.first_line ) return false;
    50 
    51                 if( last_line < other.last_line ) return true;
    52                 return false;
    53         }
    54 
    55         bool followedBy( CodeLocation const & other, int seperation ) const {
     44        bool followedBy( CodeLocation const & other, int seperation ) {
    5645                return (first_line + seperation == other.first_line &&
    5746                        filename == other.filename);
    5847        }
    5948
    60         bool operator==( CodeLocation const & other ) const {
     49        bool operator==( CodeLocation const & other ) {
    6150                return followedBy( other, 0 );
    6251        }
    6352
    64         bool operator!=( CodeLocation const & other ) const {
     53        bool operator!=( CodeLocation const & other ) {
    6554                return !(*this == other);
    6655        }
  • src/Common/SemanticError.cc

    rb5629d8 rf0d67e5  
    9090void SemanticErrorException::print() {
    9191        using std::to_string;
    92 
    93         errors.sort([](const error & lhs, const error & rhs) -> bool {
    94                 if(lhs.location.startsBefore(rhs.location)) return true;
    95                 if(rhs.location.startsBefore(lhs.location)) return false;
    96 
    97                 return lhs.description < rhs.description;
    98         });
    99 
    10092        for( auto err : errors ) {
    10193                std::cerr << ErrorHelpers::bold() << err.location << ErrorHelpers::error_str() << ErrorHelpers::reset_font() << err.description << std::endl;
  • src/ResolvExpr/AlternativeFinder.cc

    rb5629d8 rf0d67e5  
    132132        void printAlts( const AltList &list, std::ostream &os, unsigned int indentAmt ) {
    133133                Indenter indent = { indentAmt };
    134 
    135                 std::vector<int> idx;
    136                 idx.reserve(list.size());
    137                 for(int i = 0; i < list.size(); i++) { idx.push_back(i); }
    138 
    139                 std::sort(idx.begin(), idx.end(), [&list](int lhs_idx, int rhs_idx) -> bool {
    140                         const auto & lhs = list.at(lhs_idx);
    141                         const auto & rhs = list.at(rhs_idx);
    142                         if(lhs.expr->location.startsBefore(rhs.expr->location)) return true;
    143                         if(rhs.expr->location.startsBefore(lhs.expr->location)) return false;
    144 
    145                         if(lhs.env.size() < rhs.env.size()) return true;
    146                         if(lhs.env.size() > rhs.env.size()) return false;
    147 
    148                         if(lhs.openVars.size() < rhs.openVars.size()) return true;
    149                         if(lhs.openVars.size() > rhs.openVars.size()) return false;
    150 
    151                         if(lhs.need.size() < rhs.need.size()) return true;
    152                         if(lhs.need.size() > rhs.need.size()) return false;
    153 
    154                         return false;
    155                 });
    156 
    157134                for ( AltList::const_iterator i = list.begin(); i != list.end(); ++i ) {
    158135                        i->print( os, indent );
     
    17411718                                        std::cerr << std::endl;
    17421719                                )
    1743 
     1720                               
    17441721                                if ( thisCost != Cost::infinity ) {
    17451722                                        // count one safe conversion for each value that is thrown away
  • src/ResolvExpr/TypeEnvironment.cc

    rb5629d8 rf0d67e5  
    107107
    108108        void EqvClass::print( std::ostream &os, Indenter indent ) const {
    109                 os << "(";
    110                 bool first = true;
    111                 for(const auto & var : vars) {
    112                         if(first) first = false;
    113                         else os << " ";
    114                         if( deterministic_output && isUnboundType(var) ) os << "[unbound]";
    115                         else os << var;
    116                 }
    117                 os << ")";
     109                if( !deterministic_output ) {
     110                        os << "( ";
     111                        std::copy( vars.begin(), vars.end(), std::ostream_iterator< std::string >( os, " " ) );
     112                        os << ")";
     113                }
    118114                if ( type ) {
    119115                        os << " -> ";
  • src/ResolvExpr/TypeEnvironment.h

    rb5629d8 rf0d67e5  
    149149                iterator end() const { return env.end(); }
    150150
    151                 auto size() const { return env.size(); }
    152 
    153151          private:
    154152                ClassList env;
  • src/SynTree/Expression.cc

    rb5629d8 rf0d67e5  
    7272
    7373        if ( result ) {
    74                 os << std::endl << indent << "with resolved type:" << std::endl;
    75                 os << (indent+1);
    76                 result->print( os, indent+1 );
     74                if (!deterministic_output) {
     75                        os << std::endl << indent << "with resolved type:" << std::endl;
     76                        os << (indent+1);
     77                        result->print( os, indent+1 );
     78                }
    7779        }
    7880
  • src/SynTree/NamedTypeDecl.cc

    rb5629d8 rf0d67e5  
    2222#include "LinkageSpec.h"         // for Spec, Cforall, linkageName
    2323#include "Type.h"                // for Type, Type::StorageClasses
    24 #include "CompilationState.h"
    2524
    2625NamedTypeDecl::NamedTypeDecl( const std::string &name, Type::StorageClasses scs, Type *base )
     
    4241        using namespace std;
    4342
    44         if ( ! name.empty() ) {
    45                 if( deterministic_output && isUnboundType(name) ) os << "[unbound]:";
    46                 else os << name << ": ";
    47         }
     43        if ( name != "" ) os << name << ": ";
    4844
    4945        if ( linkage != LinkageSpec::Cforall ) {
  • src/SynTree/ReferenceToType.cc

    rb5629d8 rf0d67e5  
    2424#include "Type.h"             // for TypeInstType, StructInstType, UnionInstType
    2525#include "TypeSubstitution.h" // for TypeSubstitution
    26 #include "CompilationState.h"
    2726
    2827class Attribute;
     
    206205
    207206        Type::print( os, indent );
    208         os << "instance of " << typeString() << " ";
    209         const auto & name_ = get_name();
    210         if( deterministic_output && isUnboundType(name) ) os << "[unbound]";
    211         else os << name;
    212         os << " (" << ( isFtype ? "" : "not" ) << " function type)";
     207        os << "instance of " << typeString() << " " << get_name() << " (" << ( isFtype ? "" : "not" ) << " function type)";
    213208        if ( ! parameters.empty() ) {
    214209                os << endl << indent << "... with parameters" << endl;
  • src/SynTree/Type.cc

    rb5629d8 rf0d67e5  
    156156const Type::Qualifiers noQualifiers;
    157157
    158 bool isUnboundType(const Type * type) {
    159         if (auto typeInst = dynamic_cast<const TypeInstType *>(type)) {
    160                 // xxx - look for a type name produced by renameTyVars.
    161 
    162                 // TODO: once TypeInstType representation is updated, it should properly check
    163                 // if the context id is filled. this is a temporary hack for now
    164                 return isUnboundType(typeInst->name);
    165         }
    166         return false;
    167 }
    168 
    169 bool isUnboundType(const std::string & tname) {
    170         // xxx - look for a type name produced by renameTyVars.
    171 
    172         // TODO: once TypeInstType representation is updated, it should properly check
    173         // if the context id is filled. this is a temporary hack for now
    174         if (std::count(tname.begin(), tname.end(), '_') >= 3) {
    175                 return true;
    176         }
    177         return false;
    178 }
    179 
    180158// Local Variables: //
    181159// tab-width: 4 //
  • src/SynTree/Type.h

    rb5629d8 rf0d67e5  
    733733};
    734734
    735 
    736 bool isUnboundType(const Type * type);
    737 bool isUnboundType(const std::string & tname);
    738 
    739735// Local Variables: //
    740736// tab-width: 4 //
  • tests/.expect/alloc-ERROR.nast.txt

    rb5629d8 rf0d67e5  
    1616          Name: stp
    1717
    18       ... with resolved type:
    19         unsigned long int
    2018
    2119
     
    3028    Name: stp
    3129    Constant Expression (10: signed int)
    32     ... with resolved type:
    33       signed int
    3430
    3531
  • tests/.expect/alloc-ERROR.oast.txt

    rb5629d8 rf0d67e5  
    1616          Name: stp
    1717
    18       with resolved type:
    19         unsigned long int
    2018
    2119
     
    3028    Name: stp
    3129    constant expression (10 10: signed int)
    32     with resolved type:
    33       signed int
    3430
    3531
  • tests/.expect/castError.oast.txt

    rb5629d8 rf0d67e5  
    33  Name: f
    44... to:
    5   char
    6 with resolved type:
    75  char Alternatives are:
    86Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
     
    119      ... returning nothing
    1210
    13       with resolved type:
    14         pointer to function
    15           accepting unspecified arguments
    16         ... returning nothing
    17 
    1811    ... to:
    19       char
    20     with resolved type:
    2112      char
    2213  (types:
     
    2718Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
    2819      Variable Expression: f: double
    29       with resolved type:
    30         double
    3120    ... to:
    32       char
    33     with resolved type:
    3421      char
    3522  (types:
     
    4027Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
    4128      Variable Expression: f: signed int
    42       with resolved type:
    43         signed int
    4429    ... to:
    45       char
    46     with resolved type:
    4730      char
    4831  (types:
     
    5639  Comma Expression:
    5740    constant expression (3 3: signed int)
    58     with resolved type:
    59       signed int
    6041    Name: v
    61 ... to: nothing
    62 with resolved type:
    63   void  Alternatives are:
     42... to: nothing Alternatives are:
    6443Cost ( 0, 0, 2, 0, 0, 0, 0 ): Generated Cast of:
    6544      Comma Expression:
    6645        constant expression (3 3: signed int)
    67         with resolved type:
    68           signed int
    6946        Variable Expression: v: unsigned char
    70         with resolved type:
    71           unsigned char
    72       with resolved type:
    73         unsigned char
    7447    ... to: nothing
    75     with resolved type:
    76       void
    7748  (types:
    7849    void
     
    8354      Comma Expression:
    8455        constant expression (3 3: signed int)
    85         with resolved type:
    86           signed int
    8756        Variable Expression: v: signed short int
    88         with resolved type:
    89           signed short int
    90       with resolved type:
    91         signed short int
    9257    ... to: nothing
    93     with resolved type:
    94       void
    9558  (types:
    9659    void
     
    10669    char
    10770
    108 with resolved type:
    109   instance of struct S with body 1
    110   ... with parameters
    111     char
    112 
  • tests/.expect/init1-ERROR.nast.txt

    rb5629d8 rf0d67e5  
    1111... to:
    1212  reference to signed int
    13 ... with resolved type:
    14   reference to signed int
    1513init1.cfa:107:1 error: Invalid application of existing declaration(s) in expression Applying untyped:
    1614  Name: ?{}
     
    1816  Generated Cast of:
    1917    Variable Expression: _retval_f_py: pointer to signed int
    20     ... with resolved type:
    21       pointer to signed int
    2218  ... to:
    23     reference to pointer to signed int
    24   ... with resolved type:
    2519    reference to pointer to signed int
    2620  Name: px
     
    3024... to:
    3125  reference to float
    32 ... with resolved type:
    33   reference to float
    3426init1.cfa:117:1 error: Invalid application of existing declaration(s) in expression Applying untyped:
    3527  Name: ?{}
     
    3729  Generated Cast of:
    3830    Variable Expression: _retval_f_py2: pointer to float
    39     ... with resolved type:
    40       pointer to float
    4131  ... to:
    42     reference to pointer to float
    43   ... with resolved type:
    4432    reference to pointer to float
    4533  Name: cpx
     
    4937... to:
    5038  reference to instance of type T (not function type)
    51 ... with resolved type:
    52   reference to instance of type T (not function type)
    5339init1.cfa:128:1 error: Invalid application of existing declaration(s) in expression Applying untyped:
    5440  Name: ?{}
     
    5642  Generated Cast of:
    5743    Variable Expression: _retval_anycvt: pointer to instance of type T (not function type)
    58     ... with resolved type:
    59       pointer to instance of type T (not function type)
    6044  ... to:
    61     reference to pointer to instance of type T (not function type)
    62   ... with resolved type:
    6345    reference to pointer to instance of type T (not function type)
    6446  Name: s
  • tests/.expect/init1-ERROR.oast.txt

    rb5629d8 rf0d67e5  
    11error: No reasonable alternatives for expression Untyped Init Expression
    2   Name: cpx  InitAlternative: pointer to float
     2  Name: rx  InitAlternative: reference to signed int
     3error: No reasonable alternatives for expression Untyped Init Expression
     4  Name: px  InitAlternative: pointer to signed int
    35error: No reasonable alternatives for expression Untyped Init Expression
    46  Name: crx  InitAlternative: reference to float
    57error: No reasonable alternatives for expression Untyped Init Expression
    6   Name: px  InitAlternative: pointer to signed int
    7 error: No reasonable alternatives for expression Untyped Init Expression
    8   Name: rx  InitAlternative: reference to signed int
     8  Name: cpx  InitAlternative: pointer to float
    99init1.cfa:104:1 error: No reasonable alternatives for expression Generated Cast of:
    1010  Name: rx
    1111... to:
    12   reference to signed int
    13 with resolved type:
    1412  reference to signed int
    1513init1.cfa:107:1 error: No reasonable alternatives for expression Applying untyped:
     
    1816  Generated Cast of:
    1917    Variable Expression: _retval_f_py: pointer to signed int
    20     with resolved type:
    21       pointer to signed int
    2218  ... to:
    23     reference to pointer to signed int
    24   with resolved type:
    2519    reference to pointer to signed int
    2620  Name: px
     
    3024... to:
    3125  reference to float
    32 with resolved type:
    33   reference to float
    3426init1.cfa:117:1 error: No reasonable alternatives for expression Applying untyped:
    3527  Name: ?{}
     
    3729  Generated Cast of:
    3830    Variable Expression: _retval_f_py2: pointer to float
    39     with resolved type:
    40       pointer to float
    4131  ... to:
    42     reference to pointer to float
    43   with resolved type:
    4432    reference to pointer to float
    4533  Name: cpx
     
    4937... to:
    5038  reference to instance of type T (not function type)
    51 with resolved type:
    52   reference to instance of type T (not function type)
    5339init1.cfa:128:1 error: No reasonable alternatives for expression Applying untyped:
    5440  Name: ?{}
     
    5642  Generated Cast of:
    5743    Variable Expression: _retval_anycvt: pointer to instance of type T (not function type)
    58     with resolved type:
    59       pointer to instance of type T (not function type)
    6044  ... to:
    61     reference to pointer to instance of type T (not function type)
    62   with resolved type:
    6345    reference to pointer to instance of type T (not function type)
    6446  Name: s
  • tests/errors/.expect/completeType.nast.x64.txt

    rb5629d8 rf0d67e5  
    66    Name: x
    77
    8 ... to: nothing
    9 ... with resolved type:
    10   void Alternatives are:
     8... to: nothing Alternatives are:
    119Cost ( 0, 1, 2, 0, 1, -1, 0 ): Generated Cast of:
    1210      Application of
     
    1917          reference to instance of type DT (not function type)
    2018
    21         ... with resolved type:
    22           pointer to forall
    23             [unbound]:data type
    24             function
    25           ... with parameters
    26             pointer to instance of type [unbound] (not function type)
    27           ... returning
    28             reference to instance of type [unbound] (not function type)
    29 
    3019        ... to arguments
    3120        Variable Expression: x: pointer to instance of struct B with body
    32         ... with resolved type:
    33           pointer to instance of struct B with body
    3421
    35       ... with resolved type:
    36         reference to instance of struct B with body
    3722    ... to: nothing
    38     ... with resolved type:
    39       void
    4023  (types:
    4124    void
    4225  )
    43   Environment:([unbound]) -> instance of struct B with body (no widening)
     26  Environment:( _99_2_DT ) -> instance of struct B with body (no widening)
    4427
    4528
     
    5437          reference to instance of type DT (not function type)
    5538
    56         ... with resolved type:
    57           pointer to forall
    58             [unbound]:data type
    59             function
    60           ... with parameters
    61             pointer to instance of type [unbound] (not function type)
    62           ... returning
    63             reference to instance of type [unbound] (not function type)
    64 
    6539        ... to arguments
    6640        Variable Expression: x: pointer to instance of struct A without body
    67         ... with resolved type:
    68           pointer to instance of struct A without body
    6941
    70       ... with resolved type:
    71         reference to instance of struct A without body
    7242    ... to: nothing
    73     ... with resolved type:
    74       void
    7543  (types:
    7644    void
    7745  )
    78   Environment:([unbound]) -> instance of struct A without body (no widening)
     46  Environment:( _99_2_DT ) -> instance of struct A without body (no widening)
    7947
    8048
     
    144112            ... returning nothing
    145113
    146             ... with resolved type:
    147               pointer to forall
    148                 [unbound]:sized data type
    149                 ... with assertions
    150                   ?=?: pointer to function
    151                   ... with parameters
    152                     reference to instance of type [unbound] (not function type)
    153                     instance of type [unbound] (not function type)
    154                   ... returning
    155                     instance of type [unbound] (not function type)
    156 
    157                   ?{}: pointer to function
    158                   ... with parameters
    159                     reference to instance of type [unbound] (not function type)
    160                   ... returning nothing
    161 
    162                   ?{}: pointer to function
    163                   ... with parameters
    164                     reference to instance of type [unbound] (not function type)
    165                     instance of type [unbound] (not function type)
    166                   ... returning nothing
    167 
    168                   ^?{}: pointer to function
    169                   ... with parameters
    170                     reference to instance of type [unbound] (not function type)
    171                   ... returning nothing
    172 
    173 
    174                 function
    175               ... with parameters
    176                 pointer to instance of type [unbound] (not function type)
    177               ... returning nothing
    178 
    179114            ... to arguments
    180115            Variable Expression: z: pointer to instance of type T (not function type)
    181             ... with resolved type:
    182               pointer to instance of type T (not function type)
    183116          with 1 pending inference slots
    184117
    185           ... with resolved type:
    186             void
    187118        (types:
    188119          void
    189120        )
    190         Environment:([unbound]) -> instance of type T (not function type) (no widening)
     121        Environment:( _118_0_T ) -> instance of type T (not function type) (no widening)
    191122
    192123      Could not satisfy assertion:
    193124?=?: pointer to function
    194125        ... with parameters
    195           reference to instance of type [unbound] (not function type)
    196           instance of type [unbound] (not function type)
     126          reference to instance of type _118_0_T (not function type)
     127          instance of type _118_0_T (not function type)
    197128        ... returning
    198           instance of type [unbound] (not function type)
     129          instance of type _118_0_T (not function type)
    199130
  • tests/errors/.expect/completeType.oast.x64.txt

    rb5629d8 rf0d67e5  
    66    Name: x
    77
    8 ... to: nothing
    9 with resolved type:
    10   void  Alternatives are:
     8... to: nothing Alternatives are:
    119Cost ( 0, 1, 2, 0, 1, -1, 0 ): Generated Cast of:
    1210      Application of
     
    2220
    2321
    24         with resolved type:
    25           pointer to forall
    26             [unbound]:data type
    27             function
    28           ... with parameters
    29             intrinsic pointer to instance of type [unbound] (not function type)
    30           ... returning
    31             _retval__operator_deref: reference to instance of type [unbound] (not function type)
    32             ... with attributes:
    33               Attribute with name: unused
    34 
    35 
    3622      ... to arguments
    3723        Variable Expression: x: pointer to instance of struct A with body 0
    38         with resolved type:
    39           pointer to instance of struct A with body 0
    4024
    41       with resolved type:
    42         reference to instance of struct A with body 0
    4325    ... to: nothing
    44     with resolved type:
    45       void
    4626  (types:
    4727    void
    4828  )
    49   Environment:([unbound]) -> instance of struct A with body 0 (no widening)
     29  Environment: -> instance of struct A with body 0 (no widening)
    5030
    5131
     
    6343
    6444
    65         with resolved type:
    66           pointer to forall
    67             [unbound]:data type
    68             function
    69           ... with parameters
    70             intrinsic pointer to instance of type [unbound] (not function type)
    71           ... returning
    72             _retval__operator_deref: reference to instance of type [unbound] (not function type)
    73             ... with attributes:
    74               Attribute with name: unused
    75 
    76 
    7745      ... to arguments
    7846        Variable Expression: x: pointer to instance of struct B with body 1
    79         with resolved type:
    80           pointer to instance of struct B with body 1
    8147
    82       with resolved type:
    83         reference to instance of struct B with body 1
    8448    ... to: nothing
    85     with resolved type:
    86       void
    8749  (types:
    8850    void
    8951  )
    90   Environment:([unbound]) -> instance of struct B with body 1 (no widening)
     52  Environment: -> instance of struct B with body 1 (no widening)
    9153
    9254
     
    159121            ... returning nothing
    160122
    161             with resolved type:
    162               pointer to forall
    163                 [unbound]:sized data type
    164                 ... with assertions
    165                   ?=?: pointer to function
    166                   ... with parameters
    167                     reference to instance of type [unbound] (not function type)
    168                     instance of type [unbound] (not function type)
    169                   ... returning
    170                     _retval__operator_assign: instance of type [unbound] (not function type)
    171                     ... with attributes:
    172                       Attribute with name: unused
    173 
    174 
    175                   ?{}: pointer to function
    176                   ... with parameters
    177                     reference to instance of type [unbound] (not function type)
    178                   ... returning nothing
    179 
    180                   ?{}: pointer to function
    181                   ... with parameters
    182                     reference to instance of type [unbound] (not function type)
    183                     instance of type [unbound] (not function type)
    184                   ... returning nothing
    185 
    186                   ^?{}: pointer to function
    187                   ... with parameters
    188                     reference to instance of type [unbound] (not function type)
    189                   ... returning nothing
    190 
    191 
    192                 function
    193               ... with parameters
    194                 pointer to instance of type [unbound] (not function type)
    195               ... returning nothing
    196 
    197123          ... to arguments
    198124            Variable Expression: z: pointer to instance of type T (not function type)
    199             with resolved type:
    200               pointer to instance of type T (not function type)
    201125
    202           with resolved type:
    203             void
    204126        (types:
    205127          void
    206128        )
    207         Environment:([unbound]) -> instance of type T (not function type) (no widening)
     129        Environment: -> instance of type T (not function type) (no widening)
    208130
    209131      Could not satisfy assertion:
    210132?=?: pointer to function
    211133        ... with parameters
    212           reference to instance of type [unbound] (not function type)
    213           instance of type [unbound] (not function type)
     134          reference to instance of type _110_0_T (not function type)
     135          instance of type _110_0_T (not function type)
    214136        ... returning
    215           _retval__operator_assign: instance of type [unbound] (not function type)
     137          _retval__operator_assign: instance of type _110_0_T (not function type)
    216138          ... with attributes:
    217139            Attribute with name: unused
  • tests/meta/.expect/archVast.nast.arm64.txt

    rb5629d8 rf0d67e5  
    33  Name: FA64
    44... to:
    5   char
    6 ... with resolved type:
    75  char Alternatives are:
    86Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
    97      Variable Expression: FA64: signed int
    10       ... with resolved type:
    11         signed int
    128    ... to:
    13       char
    14     ... with resolved type:
    159      char
    1610  (types:
     
    2418      ... returning nothing
    2519
    26       ... with resolved type:
    27         pointer to function
    28           accepting unspecified arguments
    29         ... returning nothing
    30 
    3120    ... to:
    32       char
    33     ... with resolved type:
    3421      char
    3522  (types:
     
    4027Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
    4128      Variable Expression: FA64: double
    42       ... with resolved type:
    43         double
    4429    ... to:
    45       char
    46     ... with resolved type:
    4730      char
    4831  (types:
  • tests/meta/.expect/archVast.nast.x64.txt

    rb5629d8 rf0d67e5  
    33  Name: FX64
    44... to:
    5   char
    6 ... with resolved type:
    75  char Alternatives are:
    86Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
    97      Variable Expression: FX64: signed int
    10       ... with resolved type:
    11         signed int
    128    ... to:
    13       char
    14     ... with resolved type:
    159      char
    1610  (types:
     
    2418      ... returning nothing
    2519
    26       ... with resolved type:
    27         pointer to function
    28           accepting unspecified arguments
    29         ... returning nothing
    30 
    3120    ... to:
    32       char
    33     ... with resolved type:
    3421      char
    3522  (types:
     
    4027Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
    4128      Variable Expression: FX64: double
    42       ... with resolved type:
    43         double
    4429    ... to:
    45       char
    46     ... with resolved type:
    4730      char
    4831  (types:
  • tests/meta/.expect/archVast.nast.x86.txt

    rb5629d8 rf0d67e5  
    33  Name: FX86
    44... to:
    5   char
    6 ... with resolved type:
    75  char Alternatives are:
    86Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
    97      Variable Expression: FX86: signed int
    10       ... with resolved type:
    11         signed int
    128    ... to:
    13       char
    14     ... with resolved type:
    159      char
    1610  (types:
     
    2418      ... returning nothing
    2519
    26       ... with resolved type:
    27         pointer to function
    28           accepting unspecified arguments
    29         ... returning nothing
    30 
    3120    ... to:
    32       char
    33     ... with resolved type:
    3421      char
    3522  (types:
     
    4027Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
    4128      Variable Expression: FX86: double
    42       ... with resolved type:
    43         double
    4429    ... to:
    45       char
    46     ... with resolved type:
    4730      char
    4831  (types:
  • tests/meta/.expect/archVast.oast.arm64.txt

    rb5629d8 rf0d67e5  
    33  Name: FA64
    44... to:
    5   char
    6 with resolved type:
    75  char Alternatives are:
    86Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
     
    119      ... returning nothing
    1210
    13       with resolved type:
    14         pointer to function
    15           accepting unspecified arguments
    16         ... returning nothing
    17 
    1811    ... to:
    19       char
    20     with resolved type:
    2112      char
    2213  (types:
     
    2718Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
    2819      Variable Expression: FA64: double
    29       with resolved type:
    30         double
    3120    ... to:
    32       char
    33     with resolved type:
    3421      char
    3522  (types:
     
    4027Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
    4128      Variable Expression: FA64: signed int
    42       with resolved type:
    43         signed int
    4429    ... to:
    45       char
    46     with resolved type:
    4730      char
    4831  (types:
  • tests/meta/.expect/archVast.oast.x64.txt

    rb5629d8 rf0d67e5  
    33  Name: FX64
    44... to:
    5   char
    6 with resolved type:
    75  char Alternatives are:
    86Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
     
    119      ... returning nothing
    1210
    13       with resolved type:
    14         pointer to function
    15           accepting unspecified arguments
    16         ... returning nothing
    17 
    1811    ... to:
    19       char
    20     with resolved type:
    2112      char
    2213  (types:
     
    2718Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
    2819      Variable Expression: FX64: double
    29       with resolved type:
    30         double
    3120    ... to:
    32       char
    33     with resolved type:
    3421      char
    3522  (types:
     
    4027Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
    4128      Variable Expression: FX64: signed int
    42       with resolved type:
    43         signed int
    4429    ... to:
    45       char
    46     with resolved type:
    4730      char
    4831  (types:
  • tests/meta/.expect/archVast.oast.x86.txt

    rb5629d8 rf0d67e5  
    33  Name: FX86
    44... to:
    5   char
    6 with resolved type:
    75  char Alternatives are:
    86Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
     
    119      ... returning nothing
    1210
    13       with resolved type:
    14         pointer to function
    15           accepting unspecified arguments
    16         ... returning nothing
    17 
    1811    ... to:
    19       char
    20     with resolved type:
    2112      char
    2213  (types:
     
    2718Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
    2819      Variable Expression: FX86: double
    29       with resolved type:
    30         double
    3120    ... to:
    32       char
    33     with resolved type:
    3421      char
    3522  (types:
     
    4027Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
    4128      Variable Expression: FX86: signed int
    42       with resolved type:
    43         signed int
    4429    ... to:
    45       char
    46     with resolved type:
    4730      char
    4831  (types:
  • tests/raii/.expect/ctor-autogen-ERR1.nast.txt

    rb5629d8 rf0d67e5  
    77        signed int
    88      ... returning nothing
    9 
    10       ... with resolved type:
    11         function
    12         ... with parameters
    13           reference to instance of struct Managed with body
    14           signed int
    15         ... returning nothing
    169
    1710      ... deleted by: ?{}: function
     
    3023                signed int
    3124
    32               ... with resolved type:
    33                 pointer to function
    34                 ... with parameters
    35                   reference to signed int
    36                   signed int
    37                 ... returning
    38                   signed int
    39 
    4025              ... to arguments
    4126              Generated Cast of:
     
    4530                  Generated Cast of:
    4631                    Variable Expression: m: reference to instance of struct Managed with body
    47                     ... with resolved type:
    48                       reference to instance of struct Managed with body
    4932                  ... to:
    5033                    instance of struct Managed with body
    51                   ... with resolved type:
    52                     instance of struct Managed with body
    53                 ... with resolved type:
    54                   signed int
    5534              ... to:
    56                 reference to signed int
    57               ... with resolved type:
    5835                reference to signed int
    5936              Generated Cast of:
    6037                Constant Expression (0: zero_t)
    61                 ... with resolved type:
    62                   zero_t
    6338              ... to:
    6439                signed int
    65               ... with resolved type:
    66                 signed int
    6740
    68             ... with resolved type:
    69               signed int
    7041            ... with environment:
    7142              Types:
     
    7647    Generated Cast of:
    7748      Variable Expression: x: instance of struct Managed with body
    78       ... with resolved type:
    79         instance of struct Managed with body
    8049    ... to:
    8150      reference to instance of struct Managed with body
    82     ... with resolved type:
    83       reference to instance of struct Managed with body
    8451    Constant Expression (123: signed int)
    85     ... with resolved type:
    86       signed int
    8752
    88   ... with resolved type:
    89     void
    9053... to: nothing
    91 ... with resolved type:
    92   void
  • tests/raii/.expect/ctor-autogen-ERR1.oast.txt

    rb5629d8 rf0d67e5  
    77        x: signed int
    88      ... returning nothing
    9 
    10       with resolved type:
    11         function
    12         ... with parameters
    13           _dst: reference to instance of struct Managed with body 1
    14           x: signed int
    15         ... returning nothing
    169
    1710      ... deleted by: ?{}: function
     
    3326
    3427
    35               with resolved type:
    36                 pointer to function
    37                 ... with parameters
    38                   intrinsic reference to signed int
    39                   intrinsic signed int
    40                 ... returning
    41                   _retval__operator_assign: signed int
    42                   ... with attributes:
    43                     Attribute with name: unused
    44 
    45 
    4628            ... to arguments
    4729              Generated Cast of:
     
    5133                  Generated Cast of:
    5234                    Variable Expression: m: reference to instance of struct Managed with body 1
    53                     with resolved type:
    54                       reference to instance of struct Managed with body 1
    5535                  ... to:
    5636                    instance of struct Managed with body 1
    57                   with resolved type:
    58                     instance of struct Managed with body 1
    59                 with resolved type:
    60                   signed int
    6137              ... to:
    62                 reference to signed int
    63               with resolved type:
    6438                reference to signed int
    6539              Generated Cast of:
    6640                constant expression (0 0: zero_t)
    67                 with resolved type:
    68                   zero_t
    6941              ... to:
    7042                signed int
    71               with resolved type:
    72                 signed int
    7343
    74             with resolved type:
    75               signed int
    7644            ... with environment:
    7745              Types:
     
    8250    Generated Cast of:
    8351      Variable Expression: x: instance of struct Managed with body 1
    84       with resolved type:
    85         instance of struct Managed with body 1
    8652    ... to:
    8753      reference to instance of struct Managed with body 1
    88     with resolved type:
    89       reference to instance of struct Managed with body 1
    9054    constant expression (123 123: signed int)
    91     with resolved type:
    92       signed int
    9355
    94   with resolved type:
    95     void
    9656... to: nothing
    97 with resolved type:
    98   void
  • tests/warnings/.expect/self-assignment.nast.txt

    rb5629d8 rf0d67e5  
    11warnings/self-assignment.cfa:29:1 warning: self assignment of expression: Generated Cast of:
    22  Variable Expression: j: signed int
    3   ... with resolved type:
    4     signed int
    53... to:
    6   reference to signed int
    7 ... with resolved type:
    84  reference to signed int
    95warnings/self-assignment.cfa:30:1 warning: self assignment of expression: Generated Cast of:
    106  Variable Expression: s: instance of struct S with body
    11   ... with resolved type:
    12     instance of struct S with body
    137... to:
    14   reference to instance of struct S with body
    15 ... with resolved type:
    168  reference to instance of struct S with body
    179warnings/self-assignment.cfa:31:1 warning: self assignment of expression: Generated Cast of:
     
    2012  ... from aggregate:
    2113    Variable Expression: s: instance of struct S with body
    22     ... with resolved type:
    23       instance of struct S with body
    24   ... with resolved type:
    25     signed int
    2614... to:
    27   reference to signed int
    28 ... with resolved type:
    2915  reference to signed int
    3016warnings/self-assignment.cfa:32:1 warning: self assignment of expression: Generated Cast of:
     
    3622    ... from aggregate:
    3723      Variable Expression: t: instance of struct T with body
    38       ... with resolved type:
    39         instance of struct T with body
    40     ... with resolved type:
    41       instance of struct S with body
    42   ... with resolved type:
    43     signed int
    4424... to:
    45   reference to signed int
    46 ... with resolved type:
    4725  reference to signed int
    4826warnings/self-assignment.cfa: In function '_X4mainFi___1':
  • tests/warnings/.expect/self-assignment.oast.txt

    rb5629d8 rf0d67e5  
    11warnings/self-assignment.cfa:29:1 warning: self assignment of expression: Generated Cast of:
    22  Variable Expression: j: signed int
    3   with resolved type:
    4     signed int
    53... to:
    6   reference to signed int
    7 with resolved type:
    84  reference to signed int
    95warnings/self-assignment.cfa:30:1 warning: self assignment of expression: Generated Cast of:
    106  Variable Expression: s: instance of struct S with body 1
    11   with resolved type:
    12     instance of struct S with body 1
    137... to:
    14   reference to instance of struct S with body 1
    15 with resolved type:
    168  reference to instance of struct S with body 1
    179warnings/self-assignment.cfa:31:1 warning: self assignment of expression: Generated Cast of:
     
    2012  ... from aggregate:
    2113    Variable Expression: s: instance of struct S with body 1
    22     with resolved type:
    23       instance of struct S with body 1
    24   with resolved type:
    25     signed int
    2614... to:
    27   reference to signed int
    28 with resolved type:
    2915  reference to signed int
    3016warnings/self-assignment.cfa:32:1 warning: self assignment of expression: Generated Cast of:
     
    3622    ... from aggregate:
    3723      Variable Expression: t: instance of struct T with body 1
    38       with resolved type:
    39         instance of struct T with body 1
    40     with resolved type:
    41       instance of struct S with body 1
    42   with resolved type:
    43     signed int
    4424... to:
    45   reference to signed int
    46 with resolved type:
    4725  reference to signed int
    4826warnings/self-assignment.cfa: In function '_X4mainFi___1':
Note: See TracChangeset for help on using the changeset viewer.