mirror of
https://github.com/carp-lang/Carp.git
synced 2024-11-05 04:44:12 +03:00
48489a5771
* feat: Can omit .init in simple cases * fix: Don't treat unqualified modules as interface sym:s * feat: Can handle implicit init of type inside 'use':d module * fix: Give deftypes and sumtypes correct parent environment! * test: A few test cases * refactor: Remove commented out code Co-authored-by: Erik Svedang <erik@Eriks-iMac.local>
27 lines
504 B
Plaintext
27 lines
504 B
Plaintext
(load "Test.carp")
|
|
(use Test)
|
|
|
|
(deftype A [])
|
|
|
|
(defmodule Wrap
|
|
(deftype B []))
|
|
|
|
(defmodule Wrap2
|
|
(deftype C []))
|
|
(use Wrap2)
|
|
|
|
(deftest test
|
|
(assert-equal test
|
|
"(A)"
|
|
(ref (str (ref (A))))
|
|
"implicit .init for global type works")
|
|
(assert-equal test
|
|
"(B)"
|
|
(ref (str (ref (Wrap.B))))
|
|
"implicit .init for qualified type defined inside module works")
|
|
(assert-equal test
|
|
"(C)"
|
|
(ref (str (ref (C))))
|
|
"implicit .init for 'use':d type defined inside module works")
|
|
)
|