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

C-level support for upcasts #198

Merged
merged 2 commits into from
Jul 28, 2015
Merged

C-level support for upcasts #198

merged 2 commits into from
Jul 28, 2015

Conversation

EliasC
Copy link
Contributor

@EliasC EliasC commented Jul 27, 2015

Before we had subtyping, a type cast (x : Foo) was a no-op
dynamically since it could only be used to help the typechecker figure
out the correct type. Now we need to do an actual pointer cast so that
assignments and function argument types get the right types in the
generated code. This PR fixes this.

@albertnetymk
Copy link
Contributor

Does it make sense to create a test case?

@EliasC
Copy link
Contributor Author

EliasC commented Jul 27, 2015

Good point! Added.

@albertnetymk
Copy link
Contributor

There's a typo, Foog, in test file.

@EliasC
Copy link
Contributor Author

EliasC commented Jul 27, 2015

That’s weird, I saw 70 passing tests. Will examine...

@EliasC
Copy link
Contributor Author

EliasC commented Jul 27, 2015

It seems it was running a version that I compiled manually in the test directory. At some point I added make clean to the testing script so that it would remove all residual programs and avoid this very problem, but it seems someone removed it. I will re-add it in this commit.

@albertnetymk
Copy link
Contributor

Does it make sense to edit src/tests/encore/Makefile to sth like this?

test:
        make -C basic clean test
        make -C modules clean test

@EliasC
Copy link
Contributor Author

EliasC commented Jul 27, 2015

That's a nicer solution. I'll go with that. Thanks!

@albertnetymk
Copy link
Contributor

I think it's ready to be merged. It's good that I don't need maintain this clean-before-test hack in my local stash any more.

@albertnetymk
Copy link
Contributor

When you do the rebase, I think it's good to regroup the upcast changes into one commit, if you intend to keep 2 commits in this PR.

@EliasC
Copy link
Contributor Author

EliasC commented Jul 28, 2015

Normally I would agree, but since the second commit also changes the testing script I think it's good if that is clearly visible.

@EliasC
Copy link
Contributor Author

EliasC commented Jul 28, 2015

Or do you mean that the testing script change should be in a commit of its own?

@albertnetymk
Copy link
Contributor

Yes, since the second commit msg uses and, it does two things, possibly.

@EliasC
Copy link
Contributor Author

EliasC commented Jul 28, 2015

Fair, I'll look into it.

Before we had subtyping, a type cast (`x : Foo`) was a no-op
dynamically since it could only be used to help the typechecker figure
out the correct type. Now we need to do an actual pointer cast so that
assignments and function argument types get the right types in the
generated code. This PR fixes this.
To avoid problems where residual compiled programs are run by `make
test` even if compilation of said program fails, the makefile in the
test directory will start by removing all old compiled programs.
@EliasC
Copy link
Contributor Author

EliasC commented Jul 28, 2015

This should be better I think

@albertnetymk
Copy link
Contributor

Yes, this is what I had in mind.

albertnetymk added a commit that referenced this pull request Jul 28, 2015
@albertnetymk albertnetymk merged commit 81679e3 into parapluu:master Jul 28, 2015
@EliasC EliasC deleted the fix/trait-cast branch July 28, 2015 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants