inline-java 0.6.3 → 0.6.4
raw patch · 4 files changed
+21/−3 lines, 4 files
Files
- CHANGELOG.md +14/−0
- inline-java.cabal +1/−1
- src/Language/Java/Inline.hs +2/−2
- tests/Language/Java/InlineSpec.hs +4/−0
CHANGELOG.md view
@@ -4,6 +4,20 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). +## [0.6.4] - 2017-04-09++### Fixed++* Fixed handling of repeated antiquotation variables, which in some+ cases was causing a compilation error.++## [0.6.3] - 2017-03-12++### Fixed++* Setting the `CLASSPATH` using Gradle is now fully supported. It was+ previously unusable due to a bug (see #42).+ ## [0.6.2] - 2017-02-21 * Avoid producing warnings about unused inlinejava_bytecode0 bindings.
inline-java.cabal view
@@ -1,5 +1,5 @@ name: inline-java-version: 0.6.3+version: 0.6.4 synopsis: Java interop via inline Java code in Haskell modules. description: Please see README.md. homepage: http://github.com/tweag/inline-java#readme
src/Language/Java/Inline.hs view
@@ -53,7 +53,7 @@ import qualified Data.ByteString.Char8 as BS import Data.Char (isAlphaNum) import Data.Generics (everything, mkQ)-import Data.List (intercalate, isPrefixOf, isSuffixOf)+import Data.List (intercalate, isPrefixOf, isSuffixOf, nub) import Data.Maybe (fromJust) import Data.Singletons (SomeSing(..)) import Data.String (fromString)@@ -132,7 +132,7 @@ } antis :: Java.Block -> [String]-antis = everything (++) (mkQ [] (\case Java.Name (Java.Ident ('$':av):_) -> [av]; _ -> []))+antis = nub . everything (++) (mkQ [] (\case Java.Name (Java.Ident ('$':av):_) -> [av]; _ -> [])) toJavaType :: Sing (a :: JType) -> Java.Type toJavaType ty = case Java.parser Java.ttype (pretty ty) of
tests/Language/Java/InlineSpec.hs view
@@ -40,6 +40,10 @@ bar = 2 :: Int32 ([java| $foo + $bar |] >>= reify) `shouldReturn` (3 :: Int32) + it "Supports repeated antiquotation variables" $ do+ obj :: JObject <- [java| new Object() {} |]+ ([java| $obj.equals($obj) |] >>= reify) `shouldReturn` True+ it "Supports antiquotation variables in blocks" $ do let z = 1 :: Int32 ([java| { return $z + 1; } |] >>= reify) `shouldReturn` (2 :: Int32)