diff --git a/src/Internal/ResolvedType.elm b/src/Internal/ResolvedType.elm index 6f0da0e..449aac3 100644 --- a/src/Internal/ResolvedType.elm +++ b/src/Internal/ResolvedType.elm @@ -21,17 +21,12 @@ refToExpr currentModule imports ref = else case List.Extra.find (\import_ -> import_.moduleName == ref.modulePath) imports of - Just { moduleAlias, exposingList } -> + Just { exposingList } -> if isExposed exposingList ref.name then Elm.CodeGen.fun ref.name else - case moduleAlias of - Just moduleAlias_ -> - Elm.CodeGen.fqFun [ moduleAlias_ ] ref.name - - Nothing -> - Elm.CodeGen.fqFun ref.modulePath ref.name + Elm.CodeGen.fqFun ref.modulePath ref.name Nothing -> Elm.CodeGen.fqFun ref.modulePath ref.name diff --git a/tests/FuzzerCodeGenTest.elm b/tests/FuzzerCodeGenTest.elm index add9f07..36bf2e4 100644 --- a/tests/FuzzerCodeGenTest.elm +++ b/tests/FuzzerCodeGenTest.elm @@ -1,6 +1,6 @@ module FuzzerCodeGenTest exposing (suite) -import CodeGenerator.Test exposing (FakeDependency, codeGenTest) +import CodeGenerator.Test exposing (FakeDependency, codeGenIncrementalTest, codeGenTest) import StandardModule import Test exposing (Test, describe) @@ -109,5 +109,39 @@ bFuzzer = (Fuzz.map Dict.fromList (Fuzz.list (Fuzz.pair Fuzz.string Fuzz.niceFloat))) (Fuzz.pair (Fuzz.maybe Fuzz.string) Fuzz.bool) (Fuzz.map2 (\\a b -> { a = a, b = b }) Fuzz.int Fuzz.int) +""" + , codeGenIncrementalTest "Issue #16" + [ elmJson ] + [] + [ """module SQLite.Statement.CreateTable exposing (ColumnConstraint(..), InnerColumnConstraint(..)) + +type alias ColumnConstraint = + { foo : (Maybe String), bar : InnerColumnConstraint } + +type InnerColumnConstraint = + InnerColumnConstraint String +""" + , """module ParserTest exposing (suite) + +import SQLite.Statement.CreateTable as CreateTable +import Fuzz exposing (Fuzzer) + +columnConstraintFuzzer : Fuzzer CreateTable.ColumnConstraint +columnConstraintFuzzer = + Debug.todo "" +""" + ] + """module ParserTest exposing (suite) + +import SQLite.Statement.CreateTable as CreateTable +import Fuzz exposing (Fuzzer) + +columnConstraintFuzzer : Fuzzer CreateTable.ColumnConstraint +columnConstraintFuzzer = + Fuzz.map2 CreateTable.ColumnConstraint (Fuzz.maybe Fuzz.string) innerColumnConstraintFuzzer + +innerColumnConstraintFuzzer : Fuzzer CreateTable.InnerColumnConstraint +innerColumnConstraintFuzzer = + Debug.todo "" """ ]