Skip to content

Assignment T{TT} = Int should error #25642

@mauro3

Description

@mauro3

I think this should throw an error (or does it make sense?):

julia> T{TT} = Int                                                                                                                                                       
Int64                                                                                                                                                                    

instead it semi-works:

julia> T                                                                                                                                                                 
Int64                                                                                                                                                                    

thus the parameter TT is, I think, just silently ignored.

Here what it gets lowered to:

julia> Meta.lower(Main, :(T{TT} = Int))
:($(Expr(:thunk, CodeInfo(:(begin
      const T
      TT = (Core.TypeVar)(:TT)
      SSAValue(0) = (Core.UnionAll)(TT, Int)
      T = SSAValue(0)
      return SSAValue(0)
  end)))))

Metadata

Metadata

Assignees

No one assigned

    Labels

    types and dispatchTypes, subtyping and method dispatch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions