Created
November 6, 2018 06:54
-
-
Save blast-hardcheese/a4e790425716427c8227bbf35f6da8d0 to your computer and use it in GitHub Desktop.
Pathed types
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> compile | |
[info] Compiling 1 Scala source to /Users/dstewart/Projects/guardrail/modules/codegen/target/scala-2.12/classes... | |
[error] /Users/dstewart/Projects/guardrail/modules/codegen/src/main/scala/com/twilio/guardrail/CLI.scala:17: type mismatch; | |
[error] found : CLICommon.algebra.CoreTerms | |
[error] required: CLICommon.common.A.CoreTerms | |
[error] common.runM(algebra.coreTerm) | |
[error] ^ | |
[error] one error found | |
[error] (codegen/compile:compileIncremental) Compilation failed | |
[error] Total time: 0 s, completed Nov 5, 2018 10:53:10 PM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait CoreAlgebra { | |
class CoreTerms | |
def coreTerm: CoreTerms = | |
new CoreTerms | |
} | |
class Common(final val A: CoreAlgebra) { | |
def runM(C: A.CoreTerms): String = ??? | |
} | |
object CLICommon { | |
val algebra = new CoreAlgebra {} | |
val common = new Common(algebra) | |
def run: Unit = | |
common.runM(algebra.coreTerm) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment