001    /* Copyright (c) 2014, Erik Hogeman <Erik.Hogemn@gmail.com>
002     *                     Jesper Öqvist <jesper.oqvist@cs.lth.se>
003     * All rights reserved.
004     *
005     * Redistribution and use in source and binary forms, with or without
006     * modification, are permitted provided that the following conditions are met:
007     *
008     *     * Redistributions of source code must retain the above copyright notice,
009     *       this list of conditions and the following disclaimer.
010     *     * Redistributions in binary form must reproduce the above copyright
011     *       notice, this list of conditions and the following disclaimer in the
012     *       documentation and/or other materials provided with the distribution.
013     *     * Neither the name of the Lund University nor the names of its
014     *       contributors may be used to endorse or promote products derived from
015     *       this software without specific prior written permission.
016     *
017     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
018     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
019     * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
020     * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
021     * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
022     * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
023     * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
024     * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
025     * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
026     * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
027     * POSSIBILITY OF SUCH DAMAGE.
028     */
029    
030    /**
031     * Inherited equations for the toClass NTAs.
032     */
033    aspect ToClassInheritedEquations {
034      eq LambdaExpr.toClass().enclosingLambda() = this;
035    
036      eq ExprMethodReference.toClass().assignConvertedType() {
037        return targetInterface().functionDescriptor().method.type();
038      }
039    
040      eq TypeMethodReference.toClass().assignConvertedType() {
041        return targetInterface().functionDescriptor().method.type();
042      }
043    
044      eq ClassReference.toClass().targetType() {
045        return targetInterface().functionDescriptor().method.type();
046      }
047    }