Comments (8)
Some properties of extension types are different from the corresponding properties of inline classes, so we'll need some additional PRs about the expected behavior.
In particular, there is no instance variable declaration, and the representation name and type are specified as (<type> <identifier>)
in the declaration header (the meaning of which is the same as final <type> <identifier>;
in the declaration body plus a constructor that does this.<identifier>
to initialize it).
Another new thing: It is allowed for an extension type to declare that it implements .... T ....
for some T
that aren't extension types.
But let's look into that later on, for now we just need to stop expecting an error for things like extension type E(int i) implements int {}
.
from co19.
Just confirmed with @johnniwinther: The flag that enables the extension type feature will be inline-class
, so that particular bit escapes the rename. Other than that, the phrase 'inline class' and terms like 'inline-class' should not occur anywhere.
from co19.
Perhaps this could be done in two steps, such that the diffs will be informative: First move all affected tests from /inline-classes/
to /extension-types/
(I probably got the directory name somewhat wrong, but the idea should be clear), and then change the tests to use the new syntax. Or vice versa, whatever is most convenient.
If we do both things in the same PR then I'm afraid it's going to look like deleting a bunch of libraries and adding a bunch of different libraries, with no connection between the two.
from co19.
Why do we need a connection between obsolete inline classes tests and the new extension types ones? Why not to simply have new tests first, and then delete the old ones? Otherwise there will be mess with renaming, large diffs etc
from co19.
I thought the "move then edit" approach would yield the smallest diffs:
If there is no connection then the diff will be 2 times everything (one for delete old library, one for add new library, no connection), and it would be necessary to start from scratch with every test. It's very easy to skip over the 'delete file' changes, but this is still 1 times everything.
But with "move then edit" we'd only need to consider the changes in every test. So there would be lots of situations where something like inline class V {
is changed to extension type V(int i) {
, and a couple of lines are deleted below that (an instance variable and a constructor), and the rest of the declaration would presumably be unchanged. Similarly, lots of usages (call sites, type declarations) could remain unchanged.
from co19.
Ok, I understand your idea. Ok, let's try to do the next PR this way, but I suggest "edit then move". Some tests needs to be deleted, some added, some reordered. So, first, "edit" that is changing an exising tests and adding new ones, then "move". That is moving, renaming, reordering and deleting unnecessary tests
from co19.
Sounds good, thanks!
from co19.
All inline classes tests transformed to extension type tests. Go on with extension type tests as part of #1400
from co19.
Related Issues (20)
- Add more tests for extension types and union types
- New tests needed for wildcarded local variables and parameters HOT 1
- Failures on [co19] Roll co19 to 802c5a6ec0201644ec714484695af7bfea681500
- Add more tests that extension is not a type
- [Wildcard Variables] co19 Tests HOT 1
- Get rid of co19 tests using legacy code HOT 1
- CFE no longer supports pre 2.12 libraries HOT 1
- co19/LanguageFeatures/Augmentation-libraries/augmenting_types_A05_t04 HOT 1
- co19/LanguageFeatures/Augmentation-libraries/augmented_expression_A01_t05 HOT 2
- co19/LanguageFeatures/Augmentation-libraries/augmented_expression_A01_t09 HOT 1
- Fix co19 exhaustiveness tests
- Add extension type preclude tests static vs instance
- Failures on [co19] Roll co19 to 21fed8dd4549cf31c30947b1d73fe46321cf6f7b
- Add more extension member conflict tests
- Testing null aware elements HOT 1
- `wildcards_do_not_shadow_A01_t04` test semantics HOT 3
- Failures on [co19] Roll co19 to 0546571c7b003eeb1d52b1c33fe70c734da5fd68
- Failures on [co19] Roll co19 to 3039a657e991d13bae5eefd60e9eff1adffbf45d
- Add more tests for callable objects, including extension types
- co19/Language/Classes/Constructors/Factories/redirecting_constructor_t03 HOT 1
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 co19.