Skip to content

Method generic type parameters are out of parameter list scope for 'nameof' expression #42

@controlflow

Description

@controlflow
[A(nameof(U))] // ok
class Test<U> {
  void M<T>(
    T t = default(T), // ok
    string s = nameof(T) // error CS0103: The name 'T' does not exist in the current context
  ) { }
}

class A : System.Attribute {
    public A(string s) { }
}

It compiles as expected in CTP4, but fails in current 'master'. Maybe related to #40.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions