Clean up unneeded ctors in boxed class, def and use of 'undefined'
commitb18eb12359dadeda4ac02cb9e35fa15d7fbce8d0
authorAndy Arvanitis <andyarvanitis@gmail.com>
dateWed 28 Nov 2018, 19:27 (8 years ago)
parent421f9de
pscpp.cabal+5−4
@@ -1,8 +1,10 @@
1−-- This file has been generated from package.yaml by hpack version 0.28.2.
1+cabal-version: 1.12
2+
3+-- This file has been generated from package.yaml by hpack version 0.31.0.
24--
35-- see: https://github.com/sol/hpack
46--
5−-- hash: 359fb647874c687db6015861dc97b20ba11f47258cc05324f1d925d939cb6024
7+-- hash: 21aa75281e615d7fe3001877e6820efd2dd2a33cf67fa7b101603e042139495e
68
79name: pscpp
810version: 0.1.0.0
@@ -15,10 +17,9 @@ copyright: 2018 Andy Arvanitis
1517license: BSD3
1618license-file: LICENSE
1719build-type: Simple
18−cabal-version: >= 1.10
1920extra-source-files:
20− ChangeLog.md
2121 README.md
22+ ChangeLog.md
2223
2324source-repository head
2425 type: git
runtime/purescript.h−3
@@ -38,10 +38,7 @@ namespace purescript {
3838 public:
3939 using std::shared_ptr<void>::shared_ptr;
4040
41− boxed() noexcept : std::shared_ptr<void>() {}
42− boxed(const std::nullptr_t) noexcept : std::shared_ptr<void>() {}
4341 boxed(const int n) : std::shared_ptr<void>(std::make_shared<int>(n)) {}
44−
4542 boxed(const long n) : std::shared_ptr<void>(std::make_shared<int>(static_cast<int>(n))) {
4643#if !defined(NDEBUG) // if debug build
4744 if (n < std::numeric_limits<int>::min() || n > std::numeric_limits<int>::max()) {
src/CodeGen/Cpp/Printer.hs+1−1
@@ -252,7 +252,7 @@ literals = mkPattern' match'
252252 [ return $ emit "return "
253253 , prettyPrintCpp' value
254254 ]
255− match (ReturnNoResult _) = return $ emit "return nullptr"
255+ match (ReturnNoResult _) = return $ emit "return undefined"
256256 -- match (Throw _ _) = return mempty
257257 match (Throw _ value) = mconcat <$> sequence
258258 [ return $ emit "throw "