Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanjermakov committed Apr 19, 2024
1 parent ac50bb7 commit 2639e42
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lexer/lexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const lexerKeywordKinds = <const>[
'in-keyword',
'match-keyword',
'pub-keyword',
'await-keyword',
'await-keyword'
]

export const lexerDynamicKinds = <const>['name', 'string-part', 'char', 'int', 'float', 'bool']
Expand Down
6 changes: 3 additions & 3 deletions src/semantic/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ export const checkType = (type: Type, ctx: Context) => {
}
}

export const resolveMallebleType = (operand: Operand, inferred: VirtualType, ctx: Context): void => {
export const resolveMalleableType = (operand: Operand, inferred: VirtualType, ctx: Context): void => {
if (operand.type!.kind === 'malleable-type' && inferred.kind === 'fn-type') {
switch (operand.type!.operand.kind) {
case 'closure-expr':
Expand All @@ -799,7 +799,7 @@ export const resolveMallebleType = (operand: Operand, inferred: VirtualType, ctx
case 'identifier':
// TODO: properly
const ref = operand.type!.operand.ref
if (ref?.def.kind !== 'method-def') return unreachable()
assert(ref?.def.kind === 'method-def')
operand.type = checkQualifiedMethodCall(
operand.type!.operand,
<VirtualIdentifierMatch<MethodDef>>ref,
Expand All @@ -823,7 +823,7 @@ export const checkCallArgs = (node: AstNode<any>, args: Operand[], paramTypes: V
for (let i = 0; i < paramTypes.length; i++) {
const paramType = paramTypes[i]
const arg = args[i]
resolveMallebleType(arg, paramType, ctx)
resolveMalleableType(arg, paramType, ctx)
if (!isAssignable(arg.type!, paramType, ctx)) {
addError(ctx, typeError(ctx, arg, arg.type!, paramType))
}
Expand Down

0 comments on commit 2639e42

Please sign in to comment.