Skip to content

Polymorphic methods without term params don't have MethodType #1214

@liufengyun

Description

@liufengyun

This issue is related to #1046 and PR #1205. It's expected that all methods have either MethodicType or PolyType(MethodicType).

However, this is not true in current dotty. Given following simple program:

class Test {
  def foo[T] = 5
}

The method foo takes a non-method type [T]Int. The full type signature for foo is as follows:

PolyType(
     List(T),
     List(
         TypeBounds(
             TypeRef(ThisType(TypeRef(NoPrefix,scala)),Nothing),
             TypeRef(ThisType(TypeRef(NoPrefix,scala)),Any)
          )
     ),
     TypeRef(ThisType(TypeRef(NoPrefix,scala)),Int)
)

Is this an intentional design or a bug?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions