Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a809c12b95 | |||
| 86d7b36ba7 | |||
| 43c8328615 | |||
| c15d411660 |
@@ -2,4 +2,4 @@ mkdocs==1.4.2
|
|||||||
mkdocs-simple-hooks==0.1.5
|
mkdocs-simple-hooks==0.1.5
|
||||||
mkdocs-material==9.0.9
|
mkdocs-material==9.0.9
|
||||||
mike==1.1.2
|
mike==1.1.2
|
||||||
pygments==2.14.0
|
pygments==2.15.0
|
||||||
+7
-1
@@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
### Changed
|
### Changed
|
||||||
### Removed
|
### Removed
|
||||||
### Fixed
|
### Fixed
|
||||||
|
- Fixed a bug with polymorphism that allowed functions with the same name but different type to be considered as implementations for their corresponding interface function.
|
||||||
|
|
||||||
|
## [7.2.1]
|
||||||
|
### Fixed
|
||||||
|
- Fixed bugs with the newly added debugging symbols
|
||||||
|
|
||||||
## [7.2.0]
|
## [7.2.0]
|
||||||
### Added
|
### Added
|
||||||
@@ -395,7 +400,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Simplify calldata creation - instead of passing a compiled contract, simply
|
- Simplify calldata creation - instead of passing a compiled contract, simply
|
||||||
pass a (stubbed) contract string.
|
pass a (stubbed) contract string.
|
||||||
|
|
||||||
[Unreleased]: https://github.com/aeternity/aesophia/compare/v7.2.0...HEAD
|
[Unreleased]: https://github.com/aeternity/aesophia/compare/v7.2.1...HEAD
|
||||||
|
[7.2.1]: https://github.com/aeternity/aesophia/compare/v7.2.0...v7.2.1
|
||||||
[7.2.0]: https://github.com/aeternity/aesophia/compare/v7.1.0...v7.2.0
|
[7.2.0]: https://github.com/aeternity/aesophia/compare/v7.1.0...v7.2.0
|
||||||
[7.1.0]: https://github.com/aeternity/aesophia/compare/v7.0.1...v7.1.0
|
[7.1.0]: https://github.com/aeternity/aesophia/compare/v7.0.1...v7.1.0
|
||||||
[7.0.1]: https://github.com/aeternity/aesophia/compare/v7.0.0...v7.0.1
|
[7.0.1]: https://github.com/aeternity/aesophia/compare/v7.0.0...v7.0.1
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@
|
|||||||
{base_plt_apps, [erts, kernel, stdlib, crypto, mnesia]}
|
{base_plt_apps, [erts, kernel, stdlib, crypto, mnesia]}
|
||||||
]}.
|
]}.
|
||||||
|
|
||||||
{relx, [{release, {aesophia, "7.2.0"},
|
{relx, [{release, {aesophia, "7.2.1"},
|
||||||
[aesophia, aebytecode, getopt]},
|
[aesophia, aebytecode, getopt]},
|
||||||
|
|
||||||
{dev_mode, true},
|
{dev_mode, true},
|
||||||
|
|||||||
@@ -1582,7 +1582,7 @@ check_reserved_entrypoints(Funs) ->
|
|||||||
check_fundecl(Env, {fun_decl, Ann, Id = {id, _, Name}, Type = {fun_t, _, _, _, _}}) ->
|
check_fundecl(Env, {fun_decl, Ann, Id = {id, _, Name}, Type = {fun_t, _, _, _, _}}) ->
|
||||||
Type1 = {fun_t, _, Named, Args, Ret} = check_type(Env, Type),
|
Type1 = {fun_t, _, Named, Args, Ret} = check_type(Env, Type),
|
||||||
TypeSig = {type_sig, Ann, none, Named, Args, Ret},
|
TypeSig = {type_sig, Ann, none, Named, Args, Ret},
|
||||||
register_implementation(Id, TypeSig),
|
register_implementation(Env, Id, TypeSig),
|
||||||
{{Name, TypeSig}, {fun_decl, Ann, Id, Type1}};
|
{{Name, TypeSig}, {fun_decl, Ann, Id, Type1}};
|
||||||
check_fundecl(Env, {fun_decl, Ann, Id = {id, _, Name}, Type}) ->
|
check_fundecl(Env, {fun_decl, Ann, Id = {id, _, Name}, Type}) ->
|
||||||
type_error({fundecl_must_have_funtype, Ann, Id, Type}),
|
type_error({fundecl_must_have_funtype, Ann, Id, Type}),
|
||||||
@@ -1590,13 +1590,16 @@ check_fundecl(Env, {fun_decl, Ann, Id = {id, _, Name}, Type}) ->
|
|||||||
|
|
||||||
%% Register the function FunId as implemented by deleting it from the functions
|
%% Register the function FunId as implemented by deleting it from the functions
|
||||||
%% to be implemented table if it is included there, or return true otherwise.
|
%% to be implemented table if it is included there, or return true otherwise.
|
||||||
-spec register_implementation(FunId, FunSig) -> true | no_return() when
|
-spec register_implementation(env(), FunId, FunSig) -> true | no_return() when
|
||||||
FunId :: aeso_syntax:id(),
|
FunId :: aeso_syntax:id(),
|
||||||
FunSig :: typesig().
|
FunSig :: typesig().
|
||||||
register_implementation(Id, Sig) ->
|
register_implementation(Env, Id, Sig) ->
|
||||||
Name = name(Id),
|
Name = name(Id),
|
||||||
case ets_lookup(functions_to_implement, Name) of
|
case ets_lookup(functions_to_implement, Name) of
|
||||||
[{Name, Interface, Decl = {fun_decl, _, DeclId, _}}] ->
|
[{Name, Interface, Decl = {fun_decl, _, DeclId, FunT}}] ->
|
||||||
|
When = {implement_interface_fun, aeso_syntax:get_ann(Sig), Name, name(Interface)},
|
||||||
|
unify(Env, typesig_to_fun_t(Sig), FunT, When),
|
||||||
|
|
||||||
DeclStateful = aeso_syntax:get_ann(stateful, Decl, false),
|
DeclStateful = aeso_syntax:get_ann(stateful, Decl, false),
|
||||||
DeclPayable = aeso_syntax:get_ann(payable, Decl, false),
|
DeclPayable = aeso_syntax:get_ann(payable, Decl, false),
|
||||||
|
|
||||||
@@ -1624,7 +1627,7 @@ infer_nonrec(Env, LetFun) ->
|
|||||||
create_constraints(),
|
create_constraints(),
|
||||||
NewLetFun = {{_, Sig}, _} = infer_letfun(Env, LetFun),
|
NewLetFun = {{_, Sig}, _} = infer_letfun(Env, LetFun),
|
||||||
check_special_funs(Env, NewLetFun),
|
check_special_funs(Env, NewLetFun),
|
||||||
register_implementation(get_letfun_id(LetFun), Sig),
|
register_implementation(Env, get_letfun_id(LetFun), Sig),
|
||||||
solve_then_destroy_and_report_unsolved_constraints(Env),
|
solve_then_destroy_and_report_unsolved_constraints(Env),
|
||||||
Result = {TypeSig, _} = instantiate(NewLetFun),
|
Result = {TypeSig, _} = instantiate(NewLetFun),
|
||||||
print_typesig(TypeSig),
|
print_typesig(TypeSig),
|
||||||
@@ -1654,7 +1657,7 @@ infer_letrec(Env, Defs) ->
|
|||||||
Inferred =
|
Inferred =
|
||||||
[ begin
|
[ begin
|
||||||
Res = {{Name, TypeSig}, LetFun} = infer_letfun(ExtendEnv, LF),
|
Res = {{Name, TypeSig}, LetFun} = infer_letfun(ExtendEnv, LF),
|
||||||
register_implementation(get_letfun_id(LetFun), TypeSig),
|
register_implementation(Env, get_letfun_id(LetFun), TypeSig),
|
||||||
Got = proplists:get_value(Name, Funs),
|
Got = proplists:get_value(Name, Funs),
|
||||||
Expect = typesig_to_fun_t(TypeSig),
|
Expect = typesig_to_fun_t(TypeSig),
|
||||||
unify(Env, Got, Expect, {check_typesig, Name, Got, Expect}),
|
unify(Env, Got, Expect, {check_typesig, Name, Got, Expect}),
|
||||||
@@ -4165,6 +4168,10 @@ pp_when({var_args, Ann, Fun}) ->
|
|||||||
{pos(Ann)
|
{pos(Ann)
|
||||||
, io_lib:format("when resolving arguments of variadic function `~s`", [pp_expr(Fun)])
|
, io_lib:format("when resolving arguments of variadic function `~s`", [pp_expr(Fun)])
|
||||||
};
|
};
|
||||||
|
pp_when({implement_interface_fun, Ann, Entrypoint, Interface}) ->
|
||||||
|
{ pos(Ann)
|
||||||
|
, io_lib:format("when implementing the entrypoint `~s` from the interface `~s`", [Entrypoint, Interface])
|
||||||
|
};
|
||||||
pp_when(unknown) -> {pos(0,0), ""}.
|
pp_when(unknown) -> {pos(0,0), ""}.
|
||||||
|
|
||||||
-spec pp_why_record(why_record()) -> {pos(), iolist()}.
|
-spec pp_why_record(why_record()) -> {pos(), iolist()}.
|
||||||
|
|||||||
@@ -1262,7 +1262,7 @@ event_function(_Env = #{event_type := {variant_t, EventCons}}, EventType = {vari
|
|||||||
end,
|
end,
|
||||||
Indices = [ {var, [], V} || {indexed, V} <- IVars ],
|
Indices = [ {var, [], V} || {indexed, V} <- IVars ],
|
||||||
Body = {builtin, [], chain_event, [Payload, Hash | Indices]},
|
Body = {builtin, [], chain_event, [Payload, Hash | Indices]},
|
||||||
{'case', {con, [], Arities, Tag, Vars}, {nosplit, [], Body}}
|
{'case', {con, Arities, Tag, Vars}, {nosplit, [], Body}}
|
||||||
end,
|
end,
|
||||||
#{ attrs => [private],
|
#{ attrs => [private],
|
||||||
args => [{"e", EventType}],
|
args => [{"e", EventType}],
|
||||||
@@ -1580,7 +1580,7 @@ simpl_proj(Env, I, Expr) ->
|
|||||||
|
|
||||||
-spec get_catchalls([fcase()]) -> [fcase()].
|
-spec get_catchalls([fcase()]) -> [fcase()].
|
||||||
get_catchalls(Alts) ->
|
get_catchalls(Alts) ->
|
||||||
[ C || C = {'case', {var, _, _}, _} <- Alts ].
|
[ C || C = {'case', {var, _}, _} <- Alts ].
|
||||||
|
|
||||||
%% The scode compiler can't handle multiple catch-alls, so we need to nest them
|
%% The scode compiler can't handle multiple catch-alls, so we need to nest them
|
||||||
%% inside each other. Instead of
|
%% inside each other. Instead of
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{application, aesophia,
|
{application, aesophia,
|
||||||
[{description, "Compiler for Aeternity Sophia language"},
|
[{description, "Compiler for Aeternity Sophia language"},
|
||||||
{vsn, "7.2.0"},
|
{vsn, "7.2.1"},
|
||||||
{registered, []},
|
{registered, []},
|
||||||
{applications,
|
{applications,
|
||||||
[kernel,
|
[kernel,
|
||||||
|
|||||||
@@ -871,10 +871,10 @@ failing_contracts() ->
|
|||||||
"Trying to implement or extend an undefined interface `Z`">>
|
"Trying to implement or extend an undefined interface `Z`">>
|
||||||
])
|
])
|
||||||
, ?TYPE_ERROR(polymorphism_contract_interface_same_name_different_type,
|
, ?TYPE_ERROR(polymorphism_contract_interface_same_name_different_type,
|
||||||
[<<?Pos(9,5)
|
[<<?Pos(5,5)
|
||||||
"Duplicate definitions of `f` at\n"
|
"Cannot unify `char` and `int`\n"
|
||||||
" - line 8, column 5\n"
|
"when implementing the entrypoint `f` from the interface `I1`">>
|
||||||
" - line 9, column 5">>])
|
])
|
||||||
, ?TYPE_ERROR(polymorphism_contract_missing_implementation,
|
, ?TYPE_ERROR(polymorphism_contract_missing_implementation,
|
||||||
[<<?Pos(4,20)
|
[<<?Pos(4,20)
|
||||||
"Unimplemented entrypoint `f` from the interface `I1` in the contract `I2`">>
|
"Unimplemented entrypoint `f` from the interface `I1` in the contract `I2`">>
|
||||||
|
|||||||
Reference in New Issue
Block a user