cake: Warn and skip code gen for duplicate aliases
PR #2455 created a conflict with existing Cake.Incubator addin
- (2688,10): error CS0111: Type 'Submission#0' already defines a member called 'EnvironmentVariable' with the same parameter types
Repro script
#addin nuget:?package=Cake.Incubator&version=3.1.0
What we think we need to do here is track methods generated by code gen and skip & warn on any duplicates, prioritizing what’s in Cake.Common.
Likely would need to add using statements to avoid errors with aliases being invoked on ICakeContext
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 17 (17 by maintainers)
Commits related to this issue
- PoC (GH-2487) fix Don't merge, just a quick PoC what parts affected by the issue, it does so by a dupe check on method/property signarture, if a colliede occurs it excludes that member from code gen, ... — committed to devlead/cake by devlead 5 years ago
- (GH-2487) Warn&exclude duplicate alias in codegen — committed to devlead/cake by devlead 5 years ago
- (GH-2487) Warn&exclude duplicate alias in codegen — committed to devlead/cake by devlead 5 years ago
- (GH-2487) Warn&exclude duplicate alias in codegen * Fixes #2487 — committed to devlead/cake by devlead 5 years ago
- (GH-2487) Warn&exclude duplicate alias in codegen * Fixes #2487 — committed to devlead/cake by devlead 5 years ago
- (GH-2487) Warn&exclude duplicate alias in codegen * Fixes #2487 — committed to devlead/cake by devlead 5 years ago
- Merge pull request #2488 from devlead/feature/gh-2487 GH2487: Add alias dupe check on method/property signarture — committed to cake-build/cake by patriksvensson 5 years ago
@wwwlicious with 4.0 impact looks better
@gitfool I’ll say leave as is.
No new Cake version should be required.
If there’s no aliases in a namespace it won’t to be imported automatically and would need a using statement tool be found.
You can automatically import namespaces via attributes on an alias
https://github.com/cake-build/cake/blob/5e8e454abd071d1553f0cae7e01e616bf7f7be57/src/Cake.Common/Tools/DotNetCore/DotNetCoreAliases.cs#L51