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

wurstscript / WurstScript / 228

29 Nov 2023 05:00PM UTC coverage: 62.48% (-0.09%) from 62.574%
228

push

circleci

web-flow
Show dialog for choosing game path, cleanup (#1083)

* show dialog for choosing game path

* cleanup code

* remove logs and refactor

* remove confusing mpq error, make some mpq loads readonly

17295 of 27681 relevant lines covered (62.48%)

0.62 hits per line

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

83.33
de.peeeq.wurstscript/src/main/java/de/peeeq/wurstscript/types/WurstTypeNull.java
1
package de.peeeq.wurstscript.types;
2

3
import de.peeeq.wurstscript.ast.Element;
4
import de.peeeq.wurstscript.jassIm.ImExprOpt;
5
import de.peeeq.wurstscript.jassIm.ImType;
6
import de.peeeq.wurstscript.jassIm.JassIm;
7
import de.peeeq.wurstscript.translation.imtranslation.ImTranslator;
8
import de.peeeq.wurstscript.utils.Utils;
9
import org.eclipse.jdt.annotation.Nullable;
10

11

12
public class WurstTypeNull extends WurstType {
13

14
    private static final WurstTypeNull instance = new WurstTypeNull();
1✔
15

16
    private WurstTypeNull() { }
17

18
    @Override
19
    VariableBinding matchAgainstSupertypeIntern(WurstType other, @Nullable Element location, VariableBinding mapping,
20
            VariablePosition variablePosition) {
21
        if (other.isNullable()) {
1✔
22
            return mapping;
1✔
23
        }
24
        if (Utils.isJassCode(location)
1✔
25
                && (other instanceof WurstTypeInt || other instanceof WurstTypeIntLiteral)) {
26
            return mapping;
1✔
27
        }
28

29
        return null;
1✔
30
    }
31

32
    @Override
33
    public String getName() {
34
        return "null";
1✔
35
    }
36

37
    @Override
38
    public String getFullName() {
39
        return "null";
×
40
    }
41

42
    @Override
43
    public ImType imTranslateType(ImTranslator tr) {
44
        return JassIm.ImAnyType();
1✔
45
    }
46

47

48
    public static WurstTypeNull instance() {
49
        return instance;
1✔
50
    }
51

52
    @Override
53
    public ImExprOpt getDefaultValue(ImTranslator tr) {
54
        return JassIm.ImIntVal(0);
×
55
    }
56

57
    @Override
58
    protected boolean isNullable() {
59
        return true;
1✔
60
    }
61

62
}
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

© 2025 Coveralls, Inc