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

CopyMappingsDown applies mappings to implicit params #14

Open
Machine-Maker opened this issue Aug 2, 2023 · 0 comments
Open

CopyMappingsDown applies mappings to implicit params #14

Machine-Maker opened this issue Aug 2, 2023 · 0 comments

Comments

@Machine-Maker
Copy link
Contributor

Machine-Maker commented Aug 2, 2023

The CopyMappingsDown mappings change contributor doesn't check to make sure the parameter for which it is applying mappings would actually have a mapping.

class ParentClass {
	static class InnerStaticClass {
		InnerStaticClass(ParentClass parent, double value) {
		}
	}
}

class ChildClass extends ParentClass {
	class InnerClass extends ParentClass.InnerStaticClass {
		InnerClass(double value) {
			super(ChildClass.this, value);
		}
	}
}

The above example, if provided with mappings only for ParentClass$InnerStaticClass#<init> would apply 2 parameter mappings to ChildClass$InnerClass#<init>, the double param's mappings as well as the implicit ParentClass parameter.

I assume this is also an issue for any captured variables that would be in the constructor of a method-local class.

Tests I wrote to demo the issue: https://pastes.dev/BMugODf0zE

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

No branches or pull requests

1 participant