`targetName` on a type element is ignored
See original GitHub issueCompiler version
3.1.1-RC1
Minimized code
package com.example
import scala.annotation.targetName
class TargetName:
def genericId[@targetName("this_is_ignored") *](value: *): * = value
Output
javap TargetName:
Compiled from "TargetName.scala"
public class com.example.TargetName {
public com.example.TargetName();
public <$times> $times genericId($times);
}
Expectation
Not sure if the expected result is a renamed type or a restriction on the use of targetName. Anyway, the compiler shows a warning if @targetName is not present:
type * has an operator name; it should come with an @targetName annotation
so I guess it is a bug 🙂
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Property 'name' does not exist on type 'EventTarget' - React + ...
While the solution proposed by @Agney will probably work in most cases, it failed me when I was using event delegation – the...
Read more >target dev name will be ignored for network interface when ...
Manually specified targets using these prefixes may be ignored. Actual result: target name cannot be manually set, it's ignored by libvirt and automatically...
Read more >MSBuild Items - Microsoft Learn
Items are grouped into item types based on their element names. Item types are named lists of items that can be used as...
Read more >Move definitions of BeforeBuild and AfterBuild targets ... - GitHub
I presume that the intention was for you to override them in your project files after the .targets import near the bottom of...
Read more >Targets and Extension-Points - Apache Ant
A target name can be any alphanumeric string valid in the encoding of the XML file. The empty string is in this set,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We should also check that other illegal target names are rejected. E.g. following:
There are lots of other examples like this. One needs to consult the docs what constitutes a legal method name.
It looks like this would be pretty hard to change, and parameter names should not matter anyway for generic signatures.