Skip to content
This repository was archived by the owner on Sep 1, 2020. It is now read-only.

Commit 9c3a93e

Browse files
committed
Add a scala-typelevel project
This is where our additions to scala-library.jar will go. The current content is the implicitAmbiguous annotation. I seemed to have made the right changes to make the REPL, the test classpath and scala-dist to work. I'm not sure if there's anything else we need but I also inserted references to typelevel where library was also referenced, just in case.
1 parent 4d4f703 commit 9c3a93e

File tree

9 files changed

+110
-8
lines changed

9 files changed

+110
-8
lines changed

build-ant-macros.xml

+1
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,7 @@
733733

734734
<sequential>
735735
<deploy-one name="scala-library" local="@{local}" signed="@{signed}"/>
736+
<deploy-one name="scala-typelevel" local="@{local}" signed="@{signed}"/>
736737
<deploy-one name="scala-reflect" local="@{local}" signed="@{signed}"/>
737738
<deploy-one name="scala-compiler" local="@{local}" signed="@{signed}"/>
738739

build.xml

+46-4
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ TODO:
349349
<path refid="external-modules.deps.classpath"/>
350350
<rsel:not><rsel:or>
351351
<rsel:name name="scala-library*.jar"/>
352+
<rsel:name name="scala-typelevel*.jar"/>
352353
<rsel:name name="scala-reflect*.jar"/>
353354
<rsel:name name="scala-compiler*.jar"/>
354355
</rsel:or></rsel:not>
@@ -650,7 +651,7 @@ TODO:
650651
<property name="partest-javaagent.description" value="Scala Compiler Testing Tool (compiler-specific java agent)"/>
651652

652653
<!-- projects without project-specific options: asm, forkjoin, manual, bin, repl -->
653-
<for list="actors,compiler,interactive,scaladoc,library,parser-combinators,partest,partest-extras,partest-javaagent,reflect,scalap,swing,xml,continuations-plugin,continuations-library" param="project">
654+
<for list="actors,compiler,interactive,scaladoc,library,typelevel,parser-combinators,partest,partest-extras,partest-javaagent,reflect,scalap,swing,xml,continuations-plugin,continuations-library" param="project">
654655
<sequential>
655656
<!-- description is mandatory -->
656657
<init-project-prop project="@{project}" name="package" default=""/> <!-- used by mvn-package, copy-bundle, make-bundle -->
@@ -732,6 +733,11 @@ TODO:
732733
<path refid="aux.libs"/>
733734
</path>
734735

736+
<path id="quick.typelevel.build.path">
737+
<path refid="quick.library.build.path"/>
738+
<pathelement location="${build-quick.dir}/classes/typelevel"/>
739+
</path>
740+
735741
<path id="quick.actors.build.path">
736742
<path refid="quick.library.build.path"/>
737743
<pathelement location="${build-quick.dir}/classes/actors"/>
@@ -786,6 +792,7 @@ TODO:
786792

787793
<path id="quick.bin.tool.path">
788794
<path refid="quick.repl.build.path"/>
795+
<path refid="quick.typelevel.build.path"/>
789796
<path refid="quick.actors.build.path"/>
790797
<pathelement location="${build-quick.dir}/classes/scalap"/>
791798
<pathelement location="${build-quick.dir}/classes/scaladoc"/>
@@ -795,6 +802,7 @@ TODO:
795802
<!-- PACK -->
796803
<path id="pack.compiler.path">
797804
<pathelement location="${library.jar}"/>
805+
<pathelement location="${typelevel.jar}"/>
798806
<pathelement location="${reflect.jar}"/>
799807
<pathelement location="${compiler.jar}"/>
800808
<pathelement location="${ant.jar}"/>
@@ -804,6 +812,7 @@ TODO:
804812

805813
<path id="pack.bin.tool.path">
806814
<pathelement location="${library.jar}"/>
815+
<pathelement location="${typelevel.jar}"/>
807816
<pathelement location="${xml.jar}"/>
808817
<pathelement location="${parser-combinators.jar}"/>
809818
<pathelement location="${actors.jar}"/>
@@ -820,6 +829,10 @@ TODO:
820829
<fileset dir="${forkjoin-classes}"/>
821830
</path>
822831

832+
<path id="pack.typelevel.files">
833+
<fileset dir="${build-quick.dir}/classes/typelevel"/>
834+
</path>
835+
823836
<path id="pack.actors.files">
824837
<fileset dir="${build-quick.dir}/classes/actors"/>
825838
</path>
@@ -866,6 +879,7 @@ TODO:
866879

867880
<!-- DOCS -->
868881
<path id="docs.library.build.path"> <path refid="quick.library.build.path"/> </path>
882+
<path id="docs.typelevel.build.path"> <path refid="quick.typelevel.build.path"/> </path>
869883
<path id="docs.reflect.build.path"> <path refid="quick.reflect.build.path"/> </path>
870884
<path id="docs.compiler.build.path"> <path refid="quick.compiler.build.path"/> </path>
871885
<path id="docs.scaladoc.build.path"> <path refid="quick.scaladoc.build.path"/> </path>
@@ -877,6 +891,7 @@ TODO:
877891
<path id="scaladoc.classpath">
878892
<path refid="external-modules-nocore"/>
879893
<pathelement location="${library.jar}"/>
894+
<pathelement location="${typelevel.jar}"/>
880895
<pathelement location="${reflect.jar}"/>
881896
<pathelement location="${compiler.jar}"/>
882897

@@ -892,6 +907,7 @@ TODO:
892907
<path id="manual.build.path">
893908
<path refid="external-modules-nocore"/> <!-- xml -->
894909
<pathelement location="${library.jar}"/>
910+
<pathelement location="${typelevel.jar}"/>
895911
<pathelement location="${build.dir}/manmaker/classes"/>
896912
<path refid="aux.libs"/> <!-- for ant -->
897913
</path>
@@ -917,6 +933,7 @@ TODO:
917933
</path>
918934
<path id="partest.compilation.path.core">
919935
<pathelement location="${library.jar}"/>
936+
<pathelement location="${typelevel.jar}"/>
920937
<pathelement location="${reflect.jar}"/>
921938
<pathelement location="${compiler.jar}"/>
922939
</path>
@@ -940,6 +957,7 @@ TODO:
940957
<path refid="partest.classpath"/>
941958
<rsel:not><rsel:or>
942959
<rsel:name name="scala-library*.jar"/>
960+
<rsel:name name="scala-typelevel*.jar"/>
943961
</rsel:or></rsel:not>
944962
</restrict>
945963
<pathelement location="${scala-xml}"/>
@@ -950,6 +968,7 @@ TODO:
950968
<path refid="scalacheck.classpath"/>
951969
<rsel:not><rsel:or>
952970
<rsel:name name="scala-library*.jar"/>
971+
<rsel:name name="scala-typelevel*.jar"/>
953972
<rsel:name name="scala-compiler*.jar"/>
954973
<rsel:name name="scala-reflect*.jar"/>
955974
<rsel:name name="scala-actors*.jar"/>
@@ -976,6 +995,7 @@ TODO:
976995
<path id="test.osgi.compiler.build.path">
977996
<pathelement location="${test.osgi.classes}"/>
978997
<pathelement location="${build-osgi.dir}/org.scala-lang.scala-library.jar"/>
998+
<pathelement location="${build-osgi.dir}/org.scala-lang.scala-typelevel.jar"/>
979999
<pathelement location="${build-osgi.dir}/org.scala-lang.scala-reflect.jar"/>
9801000
<pathelement location="${build-osgi.dir}/org.scala-lang.scala-compiler.jar"/>
9811001
<pathelement location="${build-osgi.dir}/org.scala-lang.scala-actors.jar"/>
@@ -1090,6 +1110,9 @@ TODO:
10901110
<target name="quick.lib" depends="quick.start">
10911111
<staged-build with="locker" stage="quick" project="library" srcpath="${src.dir}/library" includes="lib.rootdoc.includes"/></target>
10921112

1113+
<target name="quick.typelevel" depends="quick.lib">
1114+
<staged-build with="locker" stage="quick" project="typelevel"/> </target>
1115+
10931116
<target name="quick.reflect" depends="quick.lib">
10941117
<staged-build with="locker" stage="quick" project="reflect"/> </target>
10951118

@@ -1128,6 +1151,8 @@ TODO:
11281151
============================================================================ -->
11291152
<target name="pack.lib" depends="quick.lib, forkjoin.done"> <staged-pack project="library"/></target>
11301153

1154+
<target name="pack.typelevel" depends="quick.typelevel"> <staged-pack project="typelevel"/></target>
1155+
11311156
<target name="pack.reflect" depends="quick.reflect"> <staged-pack project="reflect"/> </target>
11321157

11331158
<!-- TODO modularize compiler. Remove other quick targets when they become modules. -->
@@ -1147,7 +1172,7 @@ TODO:
11471172
<copy file="${basedir}/META-INF/MANIFEST.MF" toDir="${build-pack.dir}/META-INF"/>
11481173
<manifest file="${build-pack.dir}/META-INF/MANIFEST.MF" mode="update">
11491174
<attribute name="Bundle-Version" value="${version.number}"/>
1150-
<attribute name="Class-Path" value="scala-reflect.jar scala-library.jar"/>
1175+
<attribute name="Class-Path" value="scala-reflect.jar scala-library.jar scala-typelevel.jar"/>
11511176
</manifest>
11521177
</pre>
11531178
<!-- JSR-223 support introduced in 2.11 -->
@@ -1166,7 +1191,7 @@ TODO:
11661191

11671192
<target name="pack.scalap" depends="quick.scalap"> <staged-pack project="scalap"/> </target>
11681193

1169-
<target name="pack.core" depends="pack.reflect, pack.comp, pack.lib"/>
1194+
<target name="pack.core" depends="pack.reflect, pack.comp, pack.lib, pack.typelevel"/>
11701195

11711196
<!-- TODO modularize compiler: pack.scaladoc, pack.interactive, -->
11721197
<target name="pack.modules" depends="pack.actors, pack.scalap">
@@ -1232,6 +1257,7 @@ TODO:
12321257
</fileset>
12331258
<filelist>
12341259
<file name="${library.jar}"/>
1260+
<file name="${typelevel.jar}"/>
12351261
<file name="${reflect.jar}"/>
12361262
<file name="${compiler.jar}"/>
12371263
</filelist>
@@ -1244,6 +1270,10 @@ TODO:
12441270
<fileset dir="${src.dir}/library"/>
12451271
</make-bundle>
12461272

1273+
<make-bundle project="typelevel">
1274+
<fileset dir="${src.dir}/typelevel"/>
1275+
</make-bundle>
1276+
12471277
<make-bundle project="reflect">
12481278
<fileset dir="${src.dir}/reflect"/>
12491279
</make-bundle>
@@ -1568,6 +1598,12 @@ TODO:
15681598
</staged-docs>
15691599
</target>
15701600

1601+
<target name="docs.typelevel" depends="docs.start" unless="docs.skip">
1602+
<staged-docs project="typelevel">
1603+
<include name="**/*.scala"/>
1604+
</staged-docs>
1605+
</target>
1606+
15711607
<target name="docs.reflect" depends="docs.start" unless="docs.skip">
15721608
<staged-docs project="reflect">
15731609
<include name="**/*.scala"/>
@@ -1611,7 +1647,7 @@ TODO:
16111647
</staged-docs>
16121648
</target>
16131649

1614-
<target name="docs.core" depends="docs.lib, docs.reflect, docs.comp" unless="docs.skip"/>
1650+
<target name="docs.core" depends="docs.lib, docs.typelevel, docs.reflect, docs.comp" unless="docs.skip"/>
16151651
<!-- TODO modularize compiler: docs.scaladoc, docs.interactive, -->
16161652
<target name="docs.done" depends="docs.core, docs.actors, docs.scalap" unless="docs.skip"/>
16171653

@@ -1667,6 +1703,7 @@ MAIN DISTRIBUTION PACKAGING
16671703
<mkdir dir="${dist.maven}"/>
16681704

16691705
<mvn-package project="library"/>
1706+
<mvn-package project="typelevel"/>
16701707
<mvn-package project="reflect"/>
16711708
<mvn-package project="compiler"/>
16721709

@@ -1731,30 +1768,35 @@ MAIN DISTRIBUTION PACKAGING
17311768
<target name="publish" depends="pack-maven.done, init.maven" description="Publishes unsigned artifacts to the maven repo.">
17321769
<deploy />
17331770
<deploy-pom name="scala-library-all"/>
1771+
<deploy-jar name="scala-typelevel"/>
17341772
<deploy-jar name="scala-dist"/>
17351773
</target>
17361774

17371775
<target name="publish.local" depends="pack-maven.done, init.maven" description="Publishes unsigned artifacts to the local maven repo.">
17381776
<deploy local="true"/>
17391777
<deploy-pom name="scala-library-all" local="true"/>
1778+
<deploy-jar name="scala-typelevel" local="true"/>
17401779
<deploy-jar name="scala-dist" local="true"/>
17411780
</target>
17421781

17431782
<target name="publish.signed" depends="pack-maven.done, init.maven" description="Publishes signed artifacts to the remote maven repo.">
17441783
<deploy signed="true"/>
17451784
<deploy-pom name="scala-library-all" signed="true"/>
1785+
<deploy-jar name="scala-typelevel" signed="true"/>
17461786
<deploy-jar name="scala-dist" signed="true"/>
17471787
</target>
17481788

17491789
<target name="publish-core" depends="pack-maven.core, init.maven">
17501790
<deploy-one name="scala-compiler" />
17511791
<deploy-one name="scala-library" />
1792+
<deploy-one name="scala-typelevel" />
17521793
<deploy-one name="scala-reflect" />
17531794
</target>
17541795

17551796
<target name="publish-core-local" depends="pack-maven.core, init.maven">
17561797
<deploy-one name="scala-compiler" local="true"/>
17571798
<deploy-one name="scala-library" local="true"/>
1799+
<deploy-one name="scala-typelevel" local="true"/>
17581800
<deploy-one name="scala-reflect" local="true"/>
17591801
</target>
17601802

src/build/bnd/scala-typelevel.bnd

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Bundle-Name: Scala Typelevel Library
2+
Bundle-SymbolicName: org.scala-lang.scala-typelevel
3+
ver: @VERSION@
4+
Bundle-Version: ${ver}
5+
Export-Package: *;version=${ver}
6+
Import-Package: scala.*;version="${range;[==,=+);@VERSION@}",*
7+
Bundle-RequiredExecutionEnvironment: JavaSE-1.6, JavaSE-1.7

src/build/maven/scala-dist-pom.xml

+5
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@
3434
<artifactId>scala-library-all</artifactId>
3535
<version>@VERSION@</version>
3636
</dependency>
37+
<dependency>
38+
<groupId>org.scala-lang</groupId>
39+
<artifactId>scala-typelevel</artifactId>
40+
<version>@VERSION@</version>
41+
</dependency>
3742
<dependency>
3843
<groupId>org.scala-lang</groupId>
3944
<artifactId>scala-compiler</artifactId>
+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?xml version="1.0"?>
2+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>org.scala-lang</groupId>
5+
<artifactId>scala-typelevel</artifactId>
6+
<packaging>jar</packaging>
7+
<version>@VERSION@</version>
8+
<name>Scala Typelevel Library</name>
9+
<description>Typelevel Library for the Typelevel Scala Compiler</description>
10+
<url>http://typelevel.org/</url>
11+
<inceptionYear>2014</inceptionYear>
12+
<organization>
13+
<name>Typelevel</name>
14+
<url>http://typelevel.org/</url>
15+
</organization>
16+
<licenses>
17+
<license>
18+
<name>BSD 3-Clause</name>
19+
<url>http://www.scala-lang.org/license.html</url>
20+
<distribution>repo</distribution>
21+
</license>
22+
</licenses>
23+
<scm>
24+
<connection>scm:git:git://github.com/typelevel/scala.git</connection>
25+
<url>https://github.com/typelevel/scala.git</url>
26+
</scm>
27+
<issueManagement>
28+
<system>GitHub</system>
29+
<url>https://github.com/typelevel/scala/issues/</url>
30+
</issueManagement>
31+
<properties>
32+
<info.apiURL>http://www.scala-lang.org/api/@VERSION@/</info.apiURL>
33+
</properties>
34+
<dependencies>
35+
<dependency>
36+
<groupId>org.scala-lang</groupId>
37+
<artifactId>scala-library</artifactId>
38+
<version>@VERSION@</version>
39+
</dependency>
40+
</dependencies>
41+
<developers>
42+
<developer>
43+
<id>typelevel</id>
44+
<name>Typelevel</name>
45+
</developer>
46+
</developers>
47+
</project>

src/reflect/scala/reflect/internal/Definitions.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,7 @@ trait Definitions extends api.StandardDefinitions {
10911091
lazy val BridgeClass = requiredClass[scala.annotation.bridge]
10921092
lazy val ElidableMethodClass = requiredClass[scala.annotation.elidable]
10931093
lazy val ImplicitNotFoundClass = requiredClass[scala.annotation.implicitNotFound]
1094-
lazy val ImplicitAmbiguousClass = requiredClass[scala.annotation.implicitAmbiguous]
1094+
lazy val ImplicitAmbiguousClass = getClassIfDefined("scala.typelevel.annotation.implicitAmbiguous")
10951095
lazy val MigrationAnnotationClass = requiredClass[scala.annotation.migration]
10961096
lazy val ScalaStrictFPAttr = requiredClass[scala.annotation.strictfp]
10971097
lazy val SwitchClass = requiredClass[scala.annotation.switch]

src/library/scala/annotation/implicitAmbiguous.scala renamed to src/typelevel/scala/typelevel/annotation/implicitAmbiguous.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package scala.annotation
1+
package scala.typelevel.annotation
22

33
import scala.annotation.meta._
44

Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
object Test {
22
trait =!=[C, D]
33

4-
@annotation.implicitAmbiguous("Could not prove ${A} =!= ${B}")
4+
@typelevel.annotation.implicitAmbiguous("Could not prove ${A} =!= ${B}")
55
implicit def neqAmbig1[A] : A =!= A = null
66
}

test/files/neg/implicit-ambiguous.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ object Test {
33

44
implicit def neq[E, F] : E =!= F = null
55

6-
@annotation.implicitAmbiguous("Could not prove ${J} =!= ${J}")
6+
@typelevel.annotation.implicitAmbiguous("Could not prove ${J} =!= ${J}")
77
implicit def neqAmbig1[G, H, J] : J =!= J = null
88
implicit def neqAmbig2[I] : I =!= I = null
99

0 commit comments

Comments
 (0)