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

rokucommunity / brighterscript / #13180

14 Oct 2024 03:33PM UTC coverage: 86.831% (-2.2%) from 89.045%
#13180

push

web-flow
Merge 7db2dd331 into d585c29e9

11596 of 14122 branches covered (82.11%)

Branch coverage included in aggregate %.

26 of 27 new or added lines in 6 files covered. (96.3%)

874 existing lines in 46 files now uncovered.

12721 of 13883 relevant lines covered (91.63%)

29829.56 hits per line

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

95.24
/src/types/DynamicType.ts
1
import type { GetTypeOptions, TypeCompatibilityData } from '../interfaces';
2
import { isDynamicType } 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
    constructor(
9
        public typeText?: string
171✔
10
    ) {
11
        super();
171✔
12
    }
13

14
    public readonly kind = BscTypeKind.DynamicType;
171✔
15

16
    public static readonly instance = new DynamicType();
1✔
17

18
    get returnType() {
19
        return DynamicType.instance;
514✔
20
    }
21

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

27
    /**
28
     * The dynamic type is convertible to everything.
29
     */
30
    public isTypeCompatible(targetType: BscType, data?: TypeCompatibilityData) {
31
        //everything can be dynamic, so as long as a type is provided, this is true
32
        return !!targetType;
354✔
33
    }
34

35
    public toString() {
36
        return this.typeText ?? 'dynamic';
4,884✔
37
    }
38

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

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

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

52
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