From e3540c364a3a039dbb36df014a28da187ea452aa Mon Sep 17 00:00:00 2001 From: Heather Miller Date: Fri, 11 Aug 2017 16:03:56 +0200 Subject: [PATCH 1/3] Forgive me Lord for I have sinned --- _plugins/tut_replace.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/_plugins/tut_replace.rb b/_plugins/tut_replace.rb index bb932932a2..06ee3c7fe9 100644 --- a/_plugins/tut_replace.rb +++ b/_plugins/tut_replace.rb @@ -12,7 +12,9 @@ def output_ext(ext) end def convert(content) - content.gsub("```tut\n", "```scala\n") + content = content.gsub("```tut:fail\n", "```scala\n") + content = content.gsub("```tut:nofail\n", "```scala\n") + content.gsub("```tut\n", "```scala\n") end end end From 0cdfd54673ee6d1d524c530102486b0c1ae8cd15 Mon Sep 17 00:00:00 2001 From: Heather Miller Date: Fri, 11 Aug 2017 16:07:00 +0200 Subject: [PATCH 2/3] Puts tut:fail back on snippet that should fail --- _tour/lower-type-bounds.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/_tour/lower-type-bounds.md b/_tour/lower-type-bounds.md index ae21c6a4b4..863f107a50 100644 --- a/_tour/lower-type-bounds.md +++ b/_tour/lower-type-bounds.md @@ -18,7 +18,7 @@ While [upper type bounds](upper-type-bounds.html) limit a type to a subtype of a Here is an example where this is useful: -```tut +```tut:fail trait Node[+B] { def prepend(elem: B): Unit } @@ -33,6 +33,7 @@ case class Nil[+B]() extends Node[B] { def prepend(elem: B) = ListNode[B](elem, this) } ``` + This program implements a singly-linked list. `Nil` represents an empty element (i.e. an empty list). `class ListNode` is a node which contains an element of type `B` (`head`) and a reference to the rest of the list (`tail`). The `class Node` and its subtypes are covariant because we have `+B`. However, this program does _not_ compile because the parameter `elem` in `prepend` is of type `B`, which we declared *co*variant. This doesn't work because functions are *contra*variant in their parameter types and *co*variant in their result types. From f5bb1586f4de5248cf2fc81e8b39b25484830f0c Mon Sep 17 00:00:00 2001 From: Heather Miller Date: Fri, 11 Aug 2017 16:10:28 +0200 Subject: [PATCH 3/3] Drone CI should work too? --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a7e59fd84c..6dccfec463 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # Scala Documentation # + [![Build Status](https://platform-ci.scala-lang.org/api/badges/scala/docs.scala-lang/status.svg)](https://platform-ci.scala-lang.org/scala/docs.scala-lang) This repository contains the source for the Scala documentation website, as well as the source for "Scala Improvement Process" (SIP) documents.