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

rokucommunity / brighterscript / #14044

20 Mar 2025 07:09PM UTC coverage: 87.163% (-2.0%) from 89.117%
#14044

push

web-flow
Merge e33b1f944 into 0eceb0830

13257 of 16072 branches covered (82.49%)

Branch coverage included in aggregate %.

1163 of 1279 new or added lines in 24 files covered. (90.93%)

802 existing lines in 52 files now uncovered.

14323 of 15570 relevant lines covered (91.99%)

21312.85 hits per line

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

95.45
/src/types/DynamicType.ts
1
import type { GetTypeOptions, TypeCompatibilityData } from '../interfaces';
2
import { isDynamicType, isUninitializedType, isVoidType } from '../astUtils/reflection';
1✔
3
import { BscType } from './BscType';
1✔
4
import { BscTypeKind } from './BscTypeKind';
1✔
5
import { BuiltInInterfaceAdder } from './BuiltInInterfaceAdder';
1✔
6

7
export class DynamicType extends BscType {
1✔
8

9
    public readonly kind = BscTypeKind.DynamicType;
29✔
10

11
    public static readonly instance = new DynamicType();
1✔
12

13
    public isBuiltIn = true;
29✔
14

15
    get returnType() {
16
        return DynamicType.instance;
516✔
17
    }
18

19
    public isAssignableTo(targetType: BscType) {
20
        //everything can be dynamic, so as long as a type is provided, this is true
UNCOV
21
        return !!targetType;
×
22
    }
23

24
    /**
25
     * The dynamic type is convertible to everything.
26
     */
27
    public isTypeCompatible(targetType: BscType, data?: TypeCompatibilityData) {
28
        //everything can be dynamic, so as long as a type is provided, this is true
29
        if (isVoidType(targetType) || isUninitializedType(targetType)) {
4,000✔
30
            return false;
1✔
31
        }
32
        return !!targetType;
3,999✔
33
    }
34

35
    public toString() {
36
        return 'dynamic';
5,328✔
37
    }
38

39
    public toTypeString(): string {
40
        return this.toString();
4✔
41
    }
42

43
    public isEqual(targetType: BscType) {
44
        return isDynamicType(targetType);
51✔
45
    }
46

47
    getMemberType(memberName: string, options: GetTypeOptions) {
48
        return DynamicType.instance;
641✔
49
    }
50

51

52
}
53

54
BuiltInInterfaceAdder.primitiveTypeInstanceCache.set('dynamic', DynamicType.instance);
1✔
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