Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce webcli module #252

Merged
merged 2 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ xdk-net = { group = "org.xtclang", name = "lib-net", version.ref = "xdk" }
xdk-oodb = { group = "org.xtclang", name = "lib-oodb", version.ref = "xdk" }
xdk-web = { group = "org.xtclang", name = "lib-web", version.ref = "xdk" }
xdk-webauth = { group = "org.xtclang", name = "lib-webauth", version.ref = "xdk" }
xdk-webcli = { group = "org.xtclang", name = "lib-webcli", version.ref = "xdk" }
xdk-xenia = { group = "org.xtclang", name = "lib-xenia", version.ref = "xdk" }

javatools = { group = "org.xtclang", name = "javatools", version.ref = "xdk" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ public boolean isImmutable()
return getReferredToType().isImmutable();
}

@Override
public boolean isService()
{
return false;
}

@Override
public boolean containsGenericParam(String sName)
{
Expand Down
2 changes: 1 addition & 1 deletion javatools/src/main/java/org/xvm/asm/op/Var_S.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ protected int complete(Frame frame, int iPC, ObjectHandle[] ahArg)
boolean fImmutable = true;
for (ObjectHandle hValue : ahArg)
{
if (hValue.isMutable())
if (!hValue.isPassThrough())
{
fImmutable = false;
break;
Expand Down
2 changes: 1 addition & 1 deletion javatools/src/main/java/org/xvm/asm/op/Var_SN.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ protected int complete(Frame frame, int iPC, ObjectHandle[] ahArg)
boolean fImmutable = true;
for (ObjectHandle hValue : ahArg)
{
if (hValue.isMutable())
if (!hValue.isPassThrough())
{
fImmutable = false;
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.xvm.asm.constants.AnnotatedTypeConstant;
import org.xvm.asm.constants.IdentityConstant;
import org.xvm.asm.constants.TypeConstant;
import org.xvm.asm.constants.TypedefConstant;
import org.xvm.asm.constants.UnresolvedNameConstant;
import org.xvm.asm.constants.UnresolvedTypeConstant;

Expand Down Expand Up @@ -351,8 +352,22 @@ protected TypeConstant calculateType(Context ctx, ErrorListener errs)

if (fResolved)
{
IdentityConstant idAnno = (IdentityConstant) constAnno;
ClassStructure clzAnno = (ClassStructure) idAnno.getComponent();
IdentityConstant idAnno = (IdentityConstant) constAnno;
if (idAnno instanceof TypedefConstant idTypedef)
{
TypeConstant typeRef = idTypedef.getReferredToType();
if (typeRef.isSingleUnderlyingClass(false))
{
idAnno = typeRef.getSingleUnderlyingClass(false);
}
else
{
log(errs, Severity.ERROR, Constants.VE_ANNOTATION_NOT_MIXIN, idTypedef);
return null;
}
}

ClassStructure clzAnno = (ClassStructure) idAnno.getComponent();
if (clzAnno.getFormat() != Component.Format.MIXIN)
{
log(errs, Severity.ERROR, Constants.VE_ANNOTATION_NOT_MIXIN, clzAnno.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ protected Expression validate(Context ctx, TypeConstant typeRequired, ErrorListe
}

typeActual = pool.ensureParameterizedTypeConstant(typeActual, typeElement);
if (typeElement.isImmutable())
if (typeElement.isImmutable() || typeElement.isService())
{
typeActual = pool.ensureImmutableTypeConstant(typeActual);
}
Expand Down
Loading