Skip to content

Commit

Permalink
Overconfabulate
Browse files Browse the repository at this point in the history
  • Loading branch information
honvex-cool committed Jan 21, 2025
1 parent 9b7e886 commit 20f1d47
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
1 change: 0 additions & 1 deletion src/main/kotlin/cacophony/semantic/names/NameResolver.kt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ private class NameResolver(val diagnostics: Diagnostics) {
val decidedShape = decideSingleShape(declaration.type, declaration.value)
val arity = (decidedShape as? Shape.Functional)?.arity
symbolsTable.define(declaration.identifier, declaration, arity)
println("decided shape for $declaration is $decidedShape")
defsToShapes[declaration] = decidedShape
return setOf(Shape.Atomic)
}
Expand Down
4 changes: 1 addition & 3 deletions src/main/kotlin/cacophony/semantic/types/TypeChecker.kt
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ private class Typer(

is Definition.VariableDeclaration -> {
val expect = if (expression.type == null) {
println(shapes[expression])
shapes[expression].toExpectation()
} else expression.type.toExpectation()
val deducedType = typeExpression(expression.value, expect) ?: return null
Expand Down Expand Up @@ -184,9 +183,8 @@ private class Typer(
}

if (functionType.args.size != expression.arguments.size) {
val p = TreePrinter().printTree(expression)
throw IllegalStateException(
"Arity of function resolved in previous step does not match (in $p)",
"Arity of function resolved in previous step does not match",
)
}
val argsTypes = expression.arguments.zip(functionType.args).map {
Expand Down

0 comments on commit 20f1d47

Please sign in to comment.