Skip to content

Commit

Permalink
Merge Small_Integer and Big_Integer types (#7636)
Browse files Browse the repository at this point in the history
Merge Small_Integer and Big_Integer types into a single Integer type
  • Loading branch information
Akirathan authored Sep 8, 2023
1 parent 3c00cb4 commit e0ee8fd
Show file tree
Hide file tree
Showing 65 changed files with 801 additions and 1,215 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,7 @@
- [Use `numpy` & co. from Enso!][7678]
- [Changed layout of local libraries directory, making it easier to reference
projects next to each other][7634]
- [Merge `Small_Integer` and `Big_Integer` types][7636]

[3227]: https://github.com/enso-org/enso/pull/3227
[3248]: https://github.com/enso-org/enso/pull/3248
Expand Down Expand Up @@ -1082,6 +1083,7 @@
[7613]: https://github.com/enso-org/enso/pull/7613
[7678]: https://github.com/enso-org/enso/pull/7678
[7634]: https://github.com/enso-org/enso/pull/7634
[7636]: https://github.com/enso-org/enso/pull/7636

# Enso 2.0.0-alpha.18 (2021-10-12)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5092,7 +5092,7 @@ class RuntimeServerTest
Api.ExecutionFailed(
contextId,
Api.ExecutionResult.Diagnostic.error(
"Type error: expected `that` to be Number, but got Function.",
"Type error: expected `that` to be Integer, but got Function.",
Some(mainFile),
Some(model.Range(model.Position(11, 8), model.Position(11, 17))),
None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,15 @@ class RuntimeVisualizationsTest
Api.ExpressionUpdate(
Main.idMainZ,
Some(ConstantsGen.INTEGER),
None,
Some(
Api.MethodCall(
Api.MethodPointer(
"Standard.Base.Data.Numbers",
"Standard.Base.Data.Numbers.Integer",
"+"
)
)
),
Vector(Api.ProfilingInfo.ExecutionTime(0)),
fromCache,
typeChanged,
Expand All @@ -209,7 +217,15 @@ class RuntimeVisualizationsTest
Api.ExpressionUpdate(
Main.idFooY,
Some(ConstantsGen.INTEGER),
None,
Some(
Api.MethodCall(
Api.MethodPointer(
"Standard.Base.Data.Numbers",
"Standard.Base.Data.Numbers.Integer",
"+"
)
)
),
Vector(Api.ProfilingInfo.ExecutionTime(0)),
fromCache,
typeChanged,
Expand All @@ -231,7 +247,15 @@ class RuntimeVisualizationsTest
Api.ExpressionUpdate(
Main.idFooZ,
Some(ConstantsGen.INTEGER),
None,
Some(
Api.MethodCall(
Api.MethodPointer(
"Standard.Base.Data.Numbers",
"Standard.Base.Data.Numbers.Integer",
"*"
)
)
),
Vector(Api.ProfilingInfo.ExecutionTime(0)),
fromCache,
typeChanged,
Expand Down Expand Up @@ -973,12 +997,30 @@ class RuntimeVisualizationsTest
contextId,
context.Main.idFooY,
ConstantsGen.INTEGER,
methodCall = Some(
Api.MethodCall(
Api.MethodPointer(
"Standard.Base.Data.Numbers",
"Standard.Base.Data.Numbers.Integer",
"+"
)
)
),
typeChanged = false
),
TestMessages.update(
contextId,
context.Main.idFooZ,
ConstantsGen.INTEGER,
methodCall = Some(
Api.MethodCall(
Api.MethodPointer(
"Standard.Base.Data.Numbers",
"Standard.Base.Data.Numbers.Integer",
"*"
)
)
),
typeChanged = false
),
context.executionComplete(contextId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ boolean doAnyType(Object expectedType, Object payload) {
@Specialization
boolean doLongCheck(Type expectedType, long payload) {
var numbers = EnsoContext.get(this).getBuiltins().number();
return checkParentTypes(numbers.getSmallInteger(), expectedType);
return checkParentTypes(numbers.getInteger(), expectedType);
}

@Specialization
Expand All @@ -97,7 +97,7 @@ boolean doDoubleCheck(Type expectedType, double payload) {
@Specialization
boolean doBigIntegerCheck(Type expectedType, EnsoBigInteger value) {
var numbers = EnsoContext.get(this).getBuiltins().number();
return checkParentTypes(numbers.getBigInteger(), expectedType);
return checkParentTypes(numbers.getInteger(), expectedType);
}

@Specialization
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit e0ee8fd

Please sign in to comment.