Coveralls logob
Coveralls logo
  • Home
  • Features
  • Pricing
  • Docs
  • Sign In

wurstscript / WurstScript / 1005

21 Mar 2019 - 22:31 coverage decreased (-0.09%) to 61.245%
1005

Pull #822

travis-ci

9181eb84f9c35729a3bad740fb7f9d93?size=18&default=identiconweb-flow
more new bug fixes
Pull Request #822: WIP: support for persisting objects in compiletime expressions

14931 of 24379 relevant lines covered (61.25%)

0.61 hits per line

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

30.0
de.peeeq.wurstscript/src/main/java/de/peeeq/wurstscript/attributes/names/PackageLink.java
1
package de.peeeq.wurstscript.attributes.names;
2

3
import de.peeeq.wurstscript.ast.*;
4
import de.peeeq.wurstscript.types.VariableBinding;
5
import de.peeeq.wurstscript.types.WurstType;
6
import de.peeeq.wurstscript.types.WurstTypeBoundTypeParam;
7
import de.peeeq.wurstscript.types.WurstTypePackage;
8
import fj.data.TreeMap;
9

10
import java.util.Collections;
11
import java.util.List;
12
import java.util.Objects;
13

14

15
public class PackageLink extends DefLink {
16
    private final WPackage def;
17

18
    public PackageLink(Visibility visibility, WScope definedIn, WPackage def) {
19
        super(visibility, definedIn, Collections.emptyList(), null);
1×
20
        this.def = def;
1×
21
    }
1×
22

23
    public static PackageLink create(WPackage def, WScope definedIn) {
24
        return new PackageLink(calcVisibility(definedIn, def), definedIn, def);
1×
25
    }
26

27
    @Override
28
    public String getName() {
29
        return def.getName();
!
30
    }
31

32
    @Override
33
    public WPackage getDef() {
34
        return def;
1×
35
    }
36

37
    @Override
38
    public PackageLink withVisibility(Visibility newVis) {
39
        return new PackageLink(newVis, getDefinedIn(), def);
!
40
    }
41

42
    @Override
43
    public boolean receiverCompatibleWith(WurstType receiverType, Element location) {
44
        return receiverType == null;
!
45
    }
46

47
    @Override
48
    public NameLinkType getType() {
49
        return null;
!
50
    }
51

52
    @Override
53
    public PackageLink withTypeArgBinding(Element context, VariableBinding binding) {
54
        // packages do not have type parameters
55
        return this;
!
56
    }
57

58
    @Override
59
    public DefLink withGenericTypeParams(List<TypeParamDef> typeParams) {
60
        return this;
!
61
    }
62

63
    @Override
64
    public WurstType getTyp() {
65
        return new WurstTypePackage(def);
!
66
    }
67

68
    @Override
69
    public PackageLink withDef(NameDef def) {
70
        return new PackageLink(getVisibility(), getDefinedIn(), (WPackage) def);
!
71
    }
72

73

74
    public PackageLink hidingPrivate() {
75
        return (PackageLink) super.hidingPrivate();
!
76
    }
77

78
    public PackageLink hidingPrivateAndProtected() {
79
        return (PackageLink) super.hidingPrivateAndProtected();
!
80
    }
81

82
    @Override
83
    public boolean equals(Object o) {
UNCOV
84
        if (this == o) return true;
!
UNCOV
85
        if (o == null || getClass() != o.getClass()) return false;
!
UNCOV
86
        PackageLink that = (PackageLink) o;
!
UNCOV
87
        return Objects.equals(def, that.def);
!
88
    }
89

90
    @Override
91
    public int hashCode() {
92
        return Objects.hash(def);
1×
93
    }
94
}
Troubleshooting · Open an Issue · Sales · Support · ENTERPRISE · CAREERS · STATUS
BLOG · TWITTER · Legal & Privacy · Supported CI Services · What's a CI service? · Automated Testing

© 2022 Coveralls, Inc