Permalink
Browse files

Fix missing interface declaration

  • Loading branch information...
LadyCailin committed Jan 25, 2019
1 parent c4ae56e commit a0b8b5c690bad5e58900ef18df2988d43b2d6213
@@ -3,7 +3,6 @@
import com.laytonsmith.PureUtilities.Version;
import com.laytonsmith.annotations.typeof;
import com.laytonsmith.core.MSVersion;
import com.laytonsmith.core.natives.interfaces.Booleanish;
import com.laytonsmith.core.natives.interfaces.ObjectModifier;
import java.util.EnumSet;
import java.util.Set;
@@ -12,7 +11,7 @@
* Represents a MethodScript boolean.
*/
@typeof("ms.lang.boolean")
public final class CBoolean extends CPrimitive implements Cloneable, Booleanish {
public final class CBoolean extends CPrimitive implements Cloneable {

@SuppressWarnings("FieldNameHidesFieldInSuperclass")
public static final CClassType TYPE = CClassType.get("ms.lang.boolean");
@@ -4,6 +4,7 @@
import com.laytonsmith.PureUtilities.Version;
import com.laytonsmith.core.MSVersion;
import com.laytonsmith.core.natives.interfaces.AbstractMixedInterfaceRunner;
import com.laytonsmith.core.natives.interfaces.Booleanish;
import com.laytonsmith.core.natives.interfaces.Mixed;
import com.laytonsmith.core.natives.interfaces.ObjectType;
import com.laytonsmith.core.natives.interfaces.ValueType;
@@ -17,7 +18,8 @@

@Override
public String docs() {
return "A primitive is any non-object and non-array data type. All primitives are pass by value.";
return "A primitive is any non-object and non-array data type. All primitives are pass by value and"
+ " Booleanish.";
}

@Override
@@ -32,7 +34,7 @@ public Version since() {

@Override
public CClassType[] getInterfaces() {
return new CClassType[]{ValueType.TYPE};
return new CClassType[]{ValueType.TYPE, Booleanish.TYPE};
}

@Override
@@ -1,5 +1,6 @@
package com.laytonsmith.core.constructs;

import com.laytonsmith.core.natives.interfaces.Booleanish;
import com.laytonsmith.core.natives.interfaces.Mixed;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertFalse;
@@ -12,6 +13,7 @@

@Test
public void testInstanceofUtil() {
assertTrue(InstanceofUtil.isInstanceof(CBoolean.FALSE, Booleanish.class));
assertTrue(InstanceofUtil.isInstanceof(new CInt(0, Target.UNKNOWN), CInt.class));
assertTrue(InstanceofUtil.isInstanceof(new CInt(0, Target.UNKNOWN), CNumber.class));
assertTrue(InstanceofUtil.isInstanceof(new CInt(0, Target.UNKNOWN), Mixed.class));
@@ -58,6 +58,7 @@ public void testDoesExtend() throws Exception {
assertTrue(get("array").doesExtend(get("ArrayAccess")));
assertFalse(get("array").doesExtend(get("string")));
assertTrue(get("array").doesExtend(get("array")));
assertTrue(get("array").doesExtend(get("Booleanish")));
}

@Test

0 comments on commit a0b8b5c

Please sign in to comment.