Skip to content

Commit

Permalink
[FIXED]resolving an extension without parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
arakov committed Oct 20, 2023
1 parent 68b653f commit 7160635
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion elenasrc3/elc/cliconst.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace elena_lang
{
#define ELC_REVISION_NUMBER 0x020A
#define ELC_REVISION_NUMBER 0x020B

#if defined _M_IX86 || _M_X64

Expand Down
3 changes: 2 additions & 1 deletion elenasrc3/elc/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6882,8 +6882,9 @@ ref_t Compiler :: mapExtension(BuildTreeWriter& writer, Scope& scope, mssg_t& me
}

if (resolvedMessage) {
if (counter > 1 && implicitSignatureRef == 0) {
if (counter > 1 && (implicitSignatureRef == 0 && getArgCount(message) > 1)) {
// HOTFIX : does not resolve an ambigous extension for a weak message
// excluding messages without arguments
}
else {
// if we are lucky - use the resolved one
Expand Down
29 changes: 18 additions & 11 deletions tests60/sandbox/sandbox.l
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
import system'calendar;
import extensions;

const int MAX = 50000000;
//import system'calendar;
//import extensions;
//
//const int MAX = 50000000;
//
//public program()
//{
// real pi := 0.0;
// for(int i := 0, i < MAX, i += 1)
// {
// pi += -1.0.power(i) / (i*2+1) * 4
// };
//
// console.printLine(pi);
//}

public program()
{
real pi := 0.0;
for(int i := 0, i < MAX, i += 1)
{
pi += -1.0.power(i) / (i*2+1) * 4
};
int n := 3;

console.printLine(pi);
}
bool b := n.isOdd();
}

0 comments on commit 7160635

Please sign in to comment.