Skip to content

Support for generics #1802

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

Merged
merged 43 commits into from
Dec 10, 2020
Merged

Conversation

sake402
Copy link
Contributor

@sake402 sake402 commented Dec 5, 2020

Provides initial support for generic types

Description

Generic class and method generic parameters are looked up from the heapblock at runtime

Motivation and Context

This is meant to open opportunities to advance C# techniques, especially async

How Has This Been Tested?

Sample tests are in Test Application

What is working

Creating and constructing a generic class
Calling a generic method, instance or static
Passing generic parameter (reference type, value type or ref)

Not working yet

Returning a generic type from a method because the CLR_RECORD_METHODDEF::retVal was set by the MDP to be void and result is therefore not pushed onto the calling stack when returning, corrupting the calling stack in the process. Will need to update the MDP to effect this

Types of changes

  • Improvement (non-breaking change that improves a feature, code or algorithm)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Config and build (change in the configuration and build system, has no impact on code or features)
  • Dependencies (update dependencies and changes associated, has no impact on code or features)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@sake402 sake402 changed the title Support Support for generics Dec 5, 2020
@nfbot
Copy link
Member

nfbot commented Dec 7, 2020

@sake402 there are issues with the code style on the source files.
A PR was submitted with the code style fixes. Please review and merge the changes. See sake402#7.

Make sure you are using the project code style. Check the details here.

@nanoframework nanoframework deleted a comment from nfbot Dec 7, 2020
@nanoframework nanoframework deleted a comment from nfbot Dec 7, 2020
@nanoframework nanoframework deleted a comment from nfbot Dec 7, 2020
@nanoframework nanoframework deleted a comment from nfbot Dec 7, 2020
@nanoframework nanoframework deleted a comment from nfbot Dec 7, 2020
@josesimoes josesimoes changed the base branch from develop to develop-generics December 10, 2020 22:55
@nanoframework nanoframework deleted a comment from nfbot Dec 10, 2020
@nanoframework nanoframework deleted a comment from nfbot Dec 10, 2020
@nanoframework nanoframework deleted a comment from nfbot Dec 10, 2020
@nanoframework nanoframework deleted a comment from nfbot Dec 10, 2020
@josesimoes
Copy link
Member

@sake402 I'm merging this into it's own branch so it can be worked from there.
FYI I'm updating MDP to fully support generics and therefore fully support this feature.

@nanoframework nanoframework deleted a comment from nfbot Dec 10, 2020
@nanoframework nanoframework deleted a comment from nfbot Dec 10, 2020
@josesimoes josesimoes merged commit 46ee0ed into nanoframework:develop-generics Dec 10, 2020
josesimoes pushed a commit that referenced this pull request Dec 15, 2020
josesimoes pushed a commit that referenced this pull request Dec 16, 2020
josesimoes pushed a commit that referenced this pull request Jan 5, 2021
josesimoes pushed a commit that referenced this pull request Jan 11, 2021
josesimoes pushed a commit that referenced this pull request Feb 3, 2021
josesimoes pushed a commit that referenced this pull request Feb 15, 2021
josesimoes added a commit to Eclo/nf-interpreter that referenced this pull request Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants