Skip to content

[Bug]: Conditional type aliases treat complete types as generic #26140

Open
@bradcray

Description

@bradcray

Summary of Problem

Given a fully-defaulted generic type, like:

record R {
  param x: int = 42;
}

we typically treat R as a "complete" type, which is to say, nothing more is unbound or generic about it, equivalent to R(42). However, today I was finding that when declaring a type alias with a conditional, like:

type t = if test then R else R;

the compiler would treat t as generic. Meanwhile, for a simple case like:

type t = R;

the compiler treated t as non-generic (i.e., simply using a type alias to refer to the complete type did not seem to be the issue).

Steps to Reproduce

Source Code:

Associated Future Test(s):

test/types/records/generic/typeAliasFullyDefaultedGeneric.chpl #26137

Configuration Information

  • Output of chpl --version: `chpl version 2.2.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions