• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

source-academy / js-slang / 23995741899

05 Apr 2026 06:14AM UTC coverage: 77.093% (+0.002%) from 77.091%
23995741899

push

github

web-flow
Upgrade to TypeScript 6 and Prettier improvements (#1936)

* Upgrade TypeScript to v6

* Fix import source

* Fix tsconfig

* Fix preexisting type errors

* Remove scm-slang

* Bump node types

* Fix tsconfig

* Fix node types specifier

* Enable trailing commas

* Enable semicolons

* Check and commit files with changed line numbers

* Update Yarn to 4.13.0

* Remove unneeded sicp package deps

3112 of 4282 branches covered (72.68%)

Branch coverage included in aggregate %.

3761 of 5218 new or added lines in 152 files covered. (72.08%)

26 existing lines in 9 files now uncovered.

7136 of 9011 relevant lines covered (79.19%)

175254.05 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

24.14
/src/typeChecker/internalTypeErrors.ts
1
import { UNKNOWN_LOCATION } from '../constants';
2
import { ErrorSeverity, ErrorType, type SourceError } from '../errors/base';
3
import type { Node, NodeWithInferredType, Type } from '../types';
4
import { typeToString } from '../utils/stringify';
5
import type * as tsEs from './tsESTree';
6

7
export class TypeError implements SourceError {
NEW
8
  public type = ErrorType.TYPE;
×
NEW
9
  public severity = ErrorSeverity.WARNING;
×
10

11
  constructor(
12
    public node: NodeWithInferredType<Node>,
×
NEW
13
    public message: string,
×
14
  ) {
NEW
15
    node.typability = 'Untypable';
×
16
  }
17

18
  get location() {
NEW
19
    return this.node.loc ?? UNKNOWN_LOCATION;
×
20
  }
21
  public explain() {
NEW
22
    return this.message;
×
23
  }
24
  public elaborate() {
NEW
25
    return this.message;
×
26
  }
27
}
28

29
/**
30
 * Temporary error that will eventually be converted to TypeError as some errors are only thrown
31
 * where there is no handle to the node
32
 */
33
export class InternalTypeError extends Error {
34
  // constructor(public message: string, ...params: any[]) {
35
  //   super(...params)
36
  // }
37
  constructor(public message: string) {
×
NEW
38
    super();
×
39
  }
40
}
41

42
export class UnifyError extends InternalTypeError {
43
  constructor(
44
    public LHS: Type,
×
NEW
45
    public RHS: Type,
×
46
  ) {
NEW
47
    super(`Failed to unify LHS: ${typeToString(LHS)}, RHS: ${typeToString(RHS)}`);
×
48
  }
49
}
50

51
export class InternalDifferentNumberArgumentsError extends InternalTypeError {
52
  constructor(
53
    public numExpectedArgs: number,
×
NEW
54
    public numReceived: number,
×
55
  ) {
NEW
56
    super(`Expected ${numExpectedArgs} args, got ${numReceived}`);
×
57
  }
58
}
59

60
export class InternalCyclicReferenceError extends InternalTypeError {
61
  constructor(public name: string) {
×
NEW
62
    super(`contains a cyclic reference to itself`);
×
63
  }
64
}
65

66
export class TypecheckError implements SourceError {
67
  public type = ErrorType.TYPE;
1✔
68
  public severity = ErrorSeverity.WARNING;
1✔
69

70
  constructor(
71
    public node: tsEs.Node | tsEs.TSType,
1✔
72
    public message: string,
1✔
73
  ) {}
74

75
  get location() {
76
    return this.node.loc ?? UNKNOWN_LOCATION;
5!
77
  }
78
  public explain() {
79
    return this.message;
1✔
80
  }
81
  public elaborate() {
NEW
82
    return this.message;
×
83
  }
84
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc