Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/browser/fileSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
return Promise.reject(
error.responseText ||
getErrorStatusDescription(error.status) ||
error.toString(),

Check warning on line 93 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18)

'error' will evaluate to '[object Object]' when stringified

Check warning on line 93 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 20)

'error' will evaluate to '[object Object]' when stringified

Check warning on line 93 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (macOS-latest, 20)

'error' will evaluate to '[object Object]' when stringified

Check warning on line 93 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 18)

'error' will evaluate to '[object Object]' when stringified

Check warning on line 93 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 20)

'error' will evaluate to '[object Object]' when stringified
);
},
);
Expand All @@ -109,7 +109,7 @@

let cachedFiletree: Promise<IndexedDBFileSystemNode>;
const getFiletree = (): Promise<IndexedDBFileSystemNode> => {
if (!cachedFiletree) {

Check warning on line 112 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18)

Expected non-Promise value in a boolean conditional

Check warning on line 112 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 20)

Expected non-Promise value in a boolean conditional

Check warning on line 112 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (macOS-latest, 20)

Expected non-Promise value in a boolean conditional

Check warning on line 112 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 18)

Expected non-Promise value in a boolean conditional

Check warning on line 112 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 20)

Expected non-Promise value in a boolean conditional
cachedFiletree = (async (): Promise<IndexedDBFileSystemNode> => {
const rootNode = new IndexedDBFileSystemNode({
children: new Map(),
Expand All @@ -121,7 +121,7 @@
"readonly",
(objectStore) => objectStore.getAllKeys(),
);
const keys = result.map((key) => key.toString());

Check warning on line 124 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18)

'key' may evaluate to '[object Object]' when stringified

Check warning on line 124 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 20)

'key' may evaluate to '[object Object]' when stringified

Check warning on line 124 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (macOS-latest, 20)

'key' may evaluate to '[object Object]' when stringified

Check warning on line 124 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 18)

'key' may evaluate to '[object Object]' when stringified

Check warning on line 124 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 20)

'key' may evaluate to '[object Object]' when stringified
keys.forEach((key) => rootNode.add(key, { type: "file" }));
return rootNode;
})();
Expand All @@ -143,7 +143,7 @@
};

const fileWriteBatch: { resource: URI; content: Uint8Array }[] = [];
const writeMany = async () => {

Check warning on line 146 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18)

Missing return type on function

Check warning on line 146 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 20)

Missing return type on function

Check warning on line 146 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (macOS-latest, 20)

Missing return type on function

Check warning on line 146 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 18)

Missing return type on function

Check warning on line 146 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 20)

Missing return type on function
if (fileWriteBatch.length) {
const fileBatch = fileWriteBatch.splice(0, fileWriteBatch.length);
await indexedDB.runInTransaction(store, "readwrite", (objectStore) =>
Expand All @@ -156,7 +156,7 @@

return {
async readFile(resource: URI): Promise<Uint8Array> {
const result = await indexedDB.runInTransaction(

Check warning on line 159 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18)

Unsafe assignment of an `any` value

Check warning on line 159 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 20)

Unsafe assignment of an `any` value

Check warning on line 159 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (macOS-latest, 20)

Unsafe assignment of an `any` value

Check warning on line 159 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 18)

Unsafe assignment of an `any` value

Check warning on line 159 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 20)

Unsafe assignment of an `any` value
store,
"readonly",
(objectStore) => objectStore.get(resource.path),
Expand All @@ -168,8 +168,8 @@
result instanceof Uint8Array
? result
: typeof result === "string"
? new TextEncoder().encode(result)
: undefined;
? new TextEncoder().encode(result)

Check failure on line 171 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18)

Insert `··`

Check failure on line 171 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 20)

Insert `··`

Check failure on line 171 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (macOS-latest, 20)

Insert `··`

Check failure on line 171 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 18)

Insert `··`

Check failure on line 171 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 20)

Insert `··`
: undefined;

Check failure on line 172 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18)

Insert `··`

Check failure on line 172 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 20)

Insert `··`

Check failure on line 172 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (macOS-latest, 20)

Insert `··`

Check failure on line 172 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 18)

Insert `··`

Check failure on line 172 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 20)

Insert `··`
if (buffer === undefined) {
throw Error(
`IndexedDB entry at "${resource.path}" in unexpected format`,
Expand Down Expand Up @@ -276,7 +276,7 @@
}
}

add(path: string, entry: { type: "file"; size?: number } | { type: "dir" }) {

Check warning on line 279 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18)

Missing return type on function

Check warning on line 279 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 20)

Missing return type on function

Check warning on line 279 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (macOS-latest, 20)

Missing return type on function

Check warning on line 279 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 18)

Missing return type on function

Check warning on line 279 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 20)

Missing return type on function
this.doAdd(
path.split("/").filter((p) => p.length),
entry,
Expand All @@ -284,7 +284,7 @@
);
}

private doAdd(

Check warning on line 287 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18)

Missing return type on function

Check warning on line 287 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 20)

Missing return type on function

Check warning on line 287 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (macOS-latest, 20)

Missing return type on function

Check warning on line 287 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 18)

Missing return type on function

Check warning on line 287 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 20)

Missing return type on function
pathParts: string[],
entry: { type: "file"; size?: number } | { type: "dir" },
originalPath: string,
Expand Down Expand Up @@ -349,7 +349,7 @@
}
}

print(indentation = "") {

Check warning on line 352 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18)

Missing return type on function

Check warning on line 352 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 20)

Missing return type on function

Check warning on line 352 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (macOS-latest, 20)

Missing return type on function

Check warning on line 352 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 18)

Missing return type on function

Check warning on line 352 in src/browser/fileSystem.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 20)

Missing return type on function
console.log(indentation + this.entry.path);
if (this.entry.type === FileType.Directory) {
this.entry.children.forEach((child) => child.print(indentation + " "));
Expand Down
5 changes: 1 addition & 4 deletions src/browser/indexedDB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,7 @@
private database: IDBDatabase | null = null;
private readonly pendingTransactions: IDBTransaction[] = [];

constructor(
database: IDBDatabase,
private readonly name: string,
) {
constructor(database: IDBDatabase, private readonly name: string) {

Check failure on line 101 in src/browser/indexedDB.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18)

Replace `database:·IDBDatabase,·private·readonly·name:·string` with `⏎····database:·IDBDatabase,⏎····private·readonly·name:·string,⏎··`

Check failure on line 101 in src/browser/indexedDB.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 20)

Replace `database:·IDBDatabase,·private·readonly·name:·string` with `⏎····database:·IDBDatabase,⏎····private·readonly·name:·string,⏎··`

Check failure on line 101 in src/browser/indexedDB.ts

View workflow job for this annotation

GitHub Actions / build (macOS-latest, 20)

Replace `database:·IDBDatabase,·private·readonly·name:·string` with `⏎····database:·IDBDatabase,⏎····private·readonly·name:·string,⏎··`

Check failure on line 101 in src/browser/indexedDB.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 18)

Replace `database:·IDBDatabase,·private·readonly·name:·string` with `␍⏎····database:·IDBDatabase,␍⏎····private·readonly·name:·string,␍⏎··`

Check failure on line 101 in src/browser/indexedDB.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 20)

Replace `database:·IDBDatabase,·private·readonly·name:·string` with `␍⏎····database:·IDBDatabase,␍⏎····private·readonly·name:·string,␍⏎··`
this.database = database;
}

Expand Down Expand Up @@ -183,7 +180,7 @@
if (cursor.result) {
// Keep cursor key/value in our map
if (isValid(cursor.result.value)) {
items.set(cursor.result.key.toString(), cursor.result.value);

Check warning on line 183 in src/browser/indexedDB.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18)

'cursor.result.key' may evaluate to '[object Object]' when stringified

Check warning on line 183 in src/browser/indexedDB.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 20)

'cursor.result.key' may evaluate to '[object Object]' when stringified

Check warning on line 183 in src/browser/indexedDB.ts

View workflow job for this annotation

GitHub Actions / build (macOS-latest, 20)

'cursor.result.key' may evaluate to '[object Object]' when stringified

Check warning on line 183 in src/browser/indexedDB.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 18)

'cursor.result.key' may evaluate to '[object Object]' when stringified

Check warning on line 183 in src/browser/indexedDB.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 20)

'cursor.result.key' may evaluate to '[object Object]' when stringified
}

// Advance cursor to next row
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
nodeParent.type === "field_access_expr"
? nodeParent?.childForFieldName("target")
: nodeParent.type === "field"
? nodeParent.parent
: nodeAtPosition;
? nodeParent.parent

Check failure on line 73 in src/common/providers/codeAction/addMissingRecordFieldCodeAction.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18)

Insert `··`

Check failure on line 73 in src/common/providers/codeAction/addMissingRecordFieldCodeAction.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 20)

Insert `··`

Check failure on line 73 in src/common/providers/codeAction/addMissingRecordFieldCodeAction.ts

View workflow job for this annotation

GitHub Actions / build (macOS-latest, 20)

Insert `··`

Check failure on line 73 in src/common/providers/codeAction/addMissingRecordFieldCodeAction.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 18)

Insert `··`

Check failure on line 73 in src/common/providers/codeAction/addMissingRecordFieldCodeAction.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 20)

Insert `··`
: nodeAtPosition;

Check failure on line 74 in src/common/providers/codeAction/addMissingRecordFieldCodeAction.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18)

Insert `··`

Check failure on line 74 in src/common/providers/codeAction/addMissingRecordFieldCodeAction.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 20)

Insert `··`

Check failure on line 74 in src/common/providers/codeAction/addMissingRecordFieldCodeAction.ts

View workflow job for this annotation

GitHub Actions / build (macOS-latest, 20)

Insert `··`

Check failure on line 74 in src/common/providers/codeAction/addMissingRecordFieldCodeAction.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 18)

Insert `··`

Check failure on line 74 in src/common/providers/codeAction/addMissingRecordFieldCodeAction.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 20)

Insert `··`

// Adjust for parenthesis expr. Will need to change when we handle it better in inference
if (target?.type === "parenthesized_expr") {
Expand Down
4 changes: 2 additions & 2 deletions src/common/providers/codeLensProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@
},
)
: exposed
? Command.create("exposed", "")
: Command.create("local", "");
? Command.create("exposed", "")

Check failure on line 117 in src/common/providers/codeLensProvider.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18)

Insert `··`

Check failure on line 117 in src/common/providers/codeLensProvider.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 20)

Insert `··`

Check failure on line 117 in src/common/providers/codeLensProvider.ts

View workflow job for this annotation

GitHub Actions / build (macOS-latest, 20)

Insert `··`

Check failure on line 117 in src/common/providers/codeLensProvider.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 18)

Insert `··`

Check failure on line 117 in src/common/providers/codeLensProvider.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 20)

Insert `··`
: Command.create("local", "");

break;
}
Expand Down
5 changes: 3 additions & 2 deletions src/common/providers/diagnostics/diagnosticsProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,9 @@ export class DiagnosticsProvider implements Disposable {
private async getElmMakeDiagnostics(
sourceFile: ISourceFile,
): Promise<boolean> {
const elmMakeDiagnostics =
await this.elmMakeDiagnostics.createDiagnostics(sourceFile);
const elmMakeDiagnostics = await this.elmMakeDiagnostics.createDiagnostics(
sourceFile,
);

this.resetDiagnostics(elmMakeDiagnostics, DiagnosticKind.ElmMake);

Expand Down
7 changes: 4 additions & 3 deletions src/common/providers/diagnostics/elmAnalyseJsonService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ export class ElmAnalyseJsonService implements IElmAnalyseJsonService {

let elmAnalyseJson = {};
try {
elmAnalyseJson = require(
path.join(workspacePath, "elm-analyse.json"),
) as IElmAnalyseJson;
elmAnalyseJson = require(path.join(
workspacePath,
"elm-analyse.json",
)) as IElmAnalyseJson;
} catch {
this.connection.console.info(
"No elm-analyse.json found, enabling all diagnostic checks.",
Expand Down
9 changes: 4 additions & 5 deletions src/common/providers/diagnostics/elmLsDiagnostics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -916,11 +916,10 @@ export class ElmLsDiagnostics {

const listConcats = this.unnecessaryListConcatQuery
.matches(tree.rootNode)
.filter(
(match) =>
match.captures[2].node?.namedChildren.every(
(c) => c.type === "list_expr",
),
.filter((match) =>
match.captures[2].node?.namedChildren.every(
(c) => c.type === "list_expr",
),
)
.map((match) => match.captures[0].node)
.filter(Utils.notUndefinedOrNull);
Expand Down
17 changes: 9 additions & 8 deletions src/common/providers/handlers/moveRefactoringHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ export class MoveRefactoringHandler {
}

const tree = params.program.getSourceFile(params.sourceUri)?.tree;
const destinationTree = params.program.getSourceFile(params.destination.uri)
?.tree;
const destinationTree = params.program.getSourceFile(
params.destination.uri,
)?.tree;

if (tree && destinationTree) {
const nodeAtPosition = TreeUtils.getNamedDescendantForPosition(
Expand All @@ -84,21 +85,21 @@ export class MoveRefactoringHandler {
? nodeAtPosition.parent?.parent?.previousNamedSibling
: undefined
: isTypeNode
? nodeAtPosition.parent
: undefined;
? nodeAtPosition.parent
: undefined;

const declarationNode = isDeclarationNode
? nodeAtPosition.parent?.parent
: isTypeNode
? nodeAtPosition.parent?.nextNamedSibling
: undefined;
? nodeAtPosition.parent?.nextNamedSibling
: undefined;

const commentNode =
typeNode?.previousNamedSibling?.type === "block_comment"
? typeNode.previousNamedSibling
: declarationNode?.previousNamedSibling?.type === "block_comment"
? declarationNode.previousNamedSibling
: undefined;
? declarationNode.previousNamedSibling
: undefined;

const functionName = nodeAtPosition.text;

Expand Down
5 changes: 1 addition & 4 deletions src/common/util/sequence.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
export class Sequence<T> {
private mappers: ((value: T) => unknown)[] = [];

constructor(
private first: T,
private getter: (value: T) => T | undefined,
) {}
constructor(private first: T, private getter: (value: T) => T | undefined) {}

private iterator = function* <T>(
first: T,
Expand Down
5 changes: 1 addition & 4 deletions src/compiler/patternMatches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,7 @@ const list: Union = {
const nil: Pattern = Ctor(list, nilName, []);

export class PatternMatches {
constructor(
private program: IProgram,
private sourceFile: ISourceFile,
) {}
constructor(private program: IProgram, private sourceFile: ISourceFile) {}

public static check(
region: SyntaxNode,
Expand Down
5 changes: 1 addition & 4 deletions src/compiler/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,7 @@ export class Program implements IProgram {

private disposables: Disposable[] = [];

constructor(
private rootPath: URI,
programHost: IProgramHost,
) {
constructor(private rootPath: URI, programHost: IProgramHost) {
this.settings = container.resolve("Settings");
this.connection = container.resolve("Connection");
this.parser = container.resolve("Parser");
Expand Down
21 changes: 10 additions & 11 deletions src/compiler/typeChecker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -566,9 +566,9 @@ export function createTypeChecker(program: IProgram): TypeChecker {
isTypeUsage
? symbol.type === "Type" || symbol.type === "TypeAlias"
: isConstructorUsage
? symbol.type === "UnionConstructor" ||
(symbol.type === "TypeAlias" && symbol.constructors?.length)
: symbol.type === "UnionConstructor",
? symbol.type === "UnionConstructor" ||
(symbol.type === "TypeAlias" && symbol.constructors?.length)
: symbol.type === "UnionConstructor",
) ?? [];

if (localSymbols.length > 0) {
Expand Down Expand Up @@ -675,14 +675,13 @@ export function createTypeChecker(program: IProgram): TypeChecker {
nodeAtPosition,
(node) => node.parent ?? undefined,
)
.map(
(node) =>
sourceFile.symbolLinks
?.get(node)
?.get(
nodeAtPositionText,
(s) => s.node.type !== "infix_declaration",
),
.map((node) =>
sourceFile.symbolLinks
?.get(node)
?.get(
nodeAtPositionText,
(s) => s.node.type !== "infix_declaration",
),
)
.find(Utils.notUndefined);

Expand Down
14 changes: 8 additions & 6 deletions src/compiler/typeExpression.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,14 +408,16 @@ export class TypeExpression {
const fieldRefs =
RecordFieldReferenceTable.fromExpressions(fieldExpressions);

const baseTypeDefinition = findDefinition(record.baseType, this.program)
?.expr;
const baseTypeDefinition = findDefinition(
record.baseType,
this.program,
)?.expr;

const baseType = baseTypeDefinition
? this.getTypeVar(baseTypeDefinition)
: record.baseType
? TVar(record.baseType.text)
: undefined;
? TVar(record.baseType.text)
: undefined;

const type = TRecord(fieldTypes, baseType, undefined, fieldRefs);

Expand Down Expand Up @@ -512,8 +514,8 @@ export class TypeExpression {
const params = declaredType?.alias
? declaredType.alias.parameters
: declaredType?.nodeType === "Union"
? declaredType.params
: [];
? declaredType.params
: [];

if (declaredType.nodeType !== "Unknown" && params.length !== args.length) {
this.diagnostics.push(
Expand Down
10 changes: 4 additions & 6 deletions src/compiler/typeInference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -619,12 +619,10 @@ export class InferenceScope {
binding.bindingType === "Annotated"
? (<Annotated>binding).type
: binding.bindingType === "Unannotated"
? binding.count === 0
? bodyType
: uncurryFunction(
TFunction((<Unannotated>binding).params, bodyType),
)
: bodyType;
? binding.count === 0
? bodyType
: uncurryFunction(TFunction((<Unannotated>binding).params, bodyType))
: bodyType;

return this.toTopLevelResult(type, replaceExpressionTypes);
}
Expand Down
Loading