Skip to content

Commit

Permalink
Merge branch 'release/0.31.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiayang committed Nov 5, 2018
2 parents e5c83f9 + c2ebb89 commit b6f9090
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## CHANGELOG (FIXED / IMPLEMENTED THINGS)

`(??)`
- static access now uses `::` instead of `.`, along the veins of C++ and Rust.
- polymorph instantiations now take the form of `Foo!<...>` (the exclamation mark) -- making it less likely to be ambiguous.
- polymorph arguments can now be positional, meaning `Foo!<int>` instead of `Foo!<T: int>`. The rules are similar to that of funtion calls
-- no positional arguments after named arguments.

`(0b937a5)`
- add chained comparison operators, eg. `10 < x < 30` would *succinctly* check for `x` between 10 and 30.
- consequently, changed the precedence for all six comparison operators (`==`, `!=`, `<`, `<=`, `>`, and `>=`) to be the same (500)
Expand Down
2 changes: 1 addition & 1 deletion source/backend/llvm/translator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ namespace backend
llvm::Type* it = typeToLlvm(c->getType(), mod);
return cachedConstants[c] = llvm::ConstantFP::get(it, cf->getValue());
}
else if(auto cn = dcast(fir::ConstantNumber, c))
else if(dcast(fir::ConstantNumber, c))
{
error("cannot");
}
Expand Down
5 changes: 3 additions & 2 deletions source/typecheck/polymorph/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ namespace sst
fir::Type* convertPtsType(TypecheckState* fs, const ProblemSpace_t& problems, pts::Type* input, int polysession)
{
fir::Type* fty = 0;
auto [ ty, trfs ] = decomposeIntoTransforms(input);
auto [ _ty, trfs ] = decomposeIntoTransforms(input);
pts::Type* ty = _ty;

if(ty->isNamedType())
{
fty = fs->convertParserTypeToFIR(ty, true);
if(!fty && (std::find_if(problems.begin(), problems.end(), [&ty](const auto& a) -> bool {
if(!fty && (std::find_if(problems.begin(), problems.end(), [ty](const auto& a) -> bool {
return ty->toNamedType()->name == a.first;
}) != problems.end()))
{
Expand Down
5 changes: 3 additions & 2 deletions source/typecheck/resolver/driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ namespace resolver

//* how it works in C++, and for now also in Flax, is that once we match *any* names in the current scope, we stop searching upwards
//* -- even if it means we will throw an error because of mismatched arguments or whatever.
bool didVar = false;
// bool didVar = false;

bool didGeneric = false;

auto errs = SimpleError::make(Location(), "");
Expand Down Expand Up @@ -118,7 +119,7 @@ namespace resolver
else if(dcast(VarDefn, def) && def->type->isFunctionType() /* && !didVar */)
{
cands.push_back({ def, ts });
didVar = true;
// didVar = true;
}
else
{
Expand Down

0 comments on commit b6f9090

Please sign in to comment.