<!-- 
RSS generated by JIRA (4.4#649-r158309) at Thu May 23 15:58:19 CDT 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://dev.clojure.org/jira/si/jira.issueviews:issue-xml/CLJ-760/CLJ-760.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Clojure JIRA</title>
    <link>http://dev.clojure.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>4.4</version>
        <build-number>649</build-number>
        <build-date>25-07-2011</build-date>
    </build-info>

<item>
            <title>[CLJ-760] ClassNotFound when AOT compiling a self-referring deftype extended to a protocol</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-760</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;If I create a deftype that refers to itself in a protocol extension like below:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;(ns type-test)

(defprotocol Foo
  (isa-foo [x]))

(deftype TypeTest []
  Foo
  (isa-foo [x]
           (instance? TypeTest x)))
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And use that code via another namespace:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;(ns test-type-user
  (:use [type-test :only (isa-foo)])
  (:import [type-test TypeTest]))

(isa-foo (TypeTest.))
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When I try to AOT compile the test-type-user namespace with Clojure 1.2.0, I get &lt;em&gt;java.lang.NoClassDefFoundError: compile&lt;/em&gt;&lt;em&gt;stub/type-test/TypeTest (test_type_user.clj:5)&lt;/em&gt;.  Full stack trace attached.  Running the same code on 1.2.1 and 1.3.0-alpha6 yielded the same exception with a slightly different error message (stacktrace for 1.2.1 is also in the attached file).&lt;/p&gt;

&lt;p&gt;This came up in a test at Revelytix.  We worked around this issue by not using &lt;em&gt;instance?&lt;/em&gt; and instead comparing based on class name.  Another workaround is to define the deftype and the extension separately (using extend-type or something similar).  This problem also doesn&apos;t occur if the usage of the deftype and the definition of it are in the same namespace (i.e. if &lt;em&gt;type-test&lt;/em&gt; and &lt;em&gt;test-type-user&lt;/em&gt; were in the same file).&lt;/p&gt;
</description>
                <environment>Clojure 1.2.0, 1.2.1, 1.3.0-alpha6, JDK 1.6.0_24, Ubuntu 10.10</environment>
            <key id="14376">CLJ-760</key>
            <summary>ClassNotFound when AOT compiling a self-referring deftype extended to a protocol</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                <priority id="3" iconUrl="http://dev.clojure.org/jira/images/icons/priority_major.gif">Major</priority>
                    <status id="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="ryansenior">Ryan Senior</reporter>
                        <labels>
                    </labels>
                <created>Fri, 18 Mar 2011 09:06:37 -0500</created>
                <updated>Fri, 18 Mar 2011 10:27:46 -0500</updated>
                                    <version>Release 1.2</version>
                                                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="26312" author="alexmiller" created="Fri, 18 Mar 2011 10:27:46 -0500"  >&lt;p&gt;The first case where we saw this was actually in having a deftype implement a Java interface (not a protocol) and in that case you cannot extend the interface outside the deftype (although comparing based on class name of course works).  &lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10153" name="stacktraces.txt" size="4744" author="ryansenior" created="Fri, 18 Mar 2011 09:06:37 -0500" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>
</channel>
</rss>