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

wurstscript / WurstScript / 256

24 Jun 2025 04:33PM UTC coverage: 62.231% (-0.01%) from 62.245%
256

push

circleci

Frotty
fix build workflow and add release workflow

17261 of 27737 relevant lines covered (62.23%)

0.62 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.WurstTypePackage;
7

8
import java.util.Collections;
9
import java.util.List;
10
import java.util.Objects;
11

12

13
public class PackageLink extends DefLink {
14
    private final WPackage def;
15

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

21
    public static PackageLink create(WPackage def, WScope definedIn) {
22
        return new PackageLink(calcVisibility(definedIn, def), definedIn, def);
1✔
23
    }
24

25
    @Override
26
    public String getName() {
27
        return def.getName();
×
28
    }
29

30
    @Override
31
    public WPackage getDef() {
32
        return def;
1✔
33
    }
34

35
    @Override
36
    public PackageLink withVisibility(Visibility newVis) {
37
        return new PackageLink(newVis, getDefinedIn(), def);
×
38
    }
39

40
    @Override
41
    public boolean receiverCompatibleWith(WurstType receiverType, Element location) {
42
        return receiverType == null;
×
43
    }
44

45
    @Override
46
    public NameLinkType getType() {
47
        return null;
×
48
    }
49

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

56
    @Override
57
    public DefLink withGenericTypeParams(List<TypeParamDef> typeParams) {
58
        return this;
×
59
    }
60

61
    @Override
62
    public WurstType getTyp() {
63
        return new WurstTypePackage(def);
×
64
    }
65

66
    @Override
67
    public PackageLink withDef(NameDef def) {
68
        return new PackageLink(getVisibility(), getDefinedIn(), (WPackage) def);
×
69
    }
70

71

72
    public PackageLink hidingPrivate() {
73
        return (PackageLink) super.hidingPrivate();
×
74
    }
75

76
    public PackageLink hidingPrivateAndProtected() {
77
        return (PackageLink) super.hidingPrivateAndProtected();
×
78
    }
79

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

88
    @Override
89
    public int hashCode() {
90
        return Objects.hash(def);
1✔
91
    }
92
}
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