Comments (1)
Thanks for the very useful bug report. There were a couple of things going on here. One of them was fixed in PR #371 and there is a parser issues I opened bug #372.
The expected result of your example is the type error since you have 2 possible resolutions of the static call -- Foo::ala
and Bar::ala
. We check that there is only 1 unique resolution of the call. So, the following would be ok:
concept Foo {
static ala(a: Int): Int {
_debug("Called Foo::ala");
return a;
}
}
concept Bar {
}
entrypoint function main(): Int {
return Foo&Bar::ala(1);
}
In this case there is only 1 possible resolution -- namely Foo::ala
.
This isn't too useful when dealing with explicit types since you could just write Foo::ala
instead. However, it can be very convenient when dealing with template instantiation:
function baz<T>(a: Int): Int {
return T::ala(a);
}
In this case we want to be able to call baz<Foo&Bar>(3)
instead of having to ensure that each template type that may be used in a static resolution is unique. Similarly we should also allow cases like:
entity E provides Foo {
}
entrypoint function main(): Int {
return E::ala(1);
}
In this case we resolve the correct static member from the derived type instead of requiring the developer to use the exact concept type that specifies the static member.
I am merging PR #371 which should get this working but please repoen if there are other issues or questions.
from bosquelanguage.
Related Issues (20)
- Debug vs Release time checks HOT 1
- Parser ambiguity on "("
- Concept & and provides
- SymTest does not allow a List to be mapped into another type HOT 2
- Postcondition `ensures` does not compile when ref parameter provided HOT 1
- Could the built-in test runner be used to write unit tests for user programs? HOT 7
- IR-only code-gen backend? HOT 1
- It would be very-very nice if you could cite our paper :)
- Modelling remote execution and storage within Bosque
- npm ERR! Test failed BosqueLanguage-LearnBosqueProgramming branch HOT 1
- This repo is missing important files HOT 2
- Model constraints for CADL HOT 1
- SMT Division
- BigX support
- Decimal Support
- Rational Support
- ASCIIString
- Design of arithmetic operations (static vs. dynamic)
- Enum values
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bosquelanguage.