External Issue: Internal error when assigning c_nil to untyped var declaration

19244, "npadmana", "Internal error when assigning c_nil to untyped var declaration", "2022-02-11T23:29:01Z"

Summary of Problem

I'm getting an internal error when assigning c_nil to an untyped var declaration.

Steps to Reproduce

Source Code:

use CPtr;

var ptr = c_nil;

Compile command:

~/bugs> chpl test.chpl
test.chpl:3: internal error: AST-AGG-YPE-2003 chpl version 1.25.1
Note: This source location is a guess.

Internal errors indicate a bug in the Chapel compiler ("It's us, not you"),
and we're sorry for the hassle.  We would appreciate your reporting this bug -- 
please see https://chapel-lang.org/bugs.html for instructions.  In the meantime,
the filename + line number above may be useful in working around the issue.

~/bugs> chpl test.chpl --devel
test.chpl:3: internal error: no field 'nil' in class 'heap__nilType' in getField() [AST/AggregateType.cpp:2003]
Note: This source location is a guess.

Configuration Information

chpl version 1.25.1
  built with LLVM version 11.0.1
Copyright 2020-2021 Hewlett Packard Enterprise Development LP
Copyright 2004-2019 Cray Inc.
(See LICENSE file for more details)

CHPL_TARGET_PLATFORM: cray-xc
CHPL_TARGET_COMPILER: llvm
CHPL_TARGET_ARCH: x86_64
CHPL_TARGET_CPU: broadwell
CHPL_LOCALE_MODEL: flat
CHPL_COMM: ugni
CHPL_TASKS: qthreads
CHPL_LAUNCHER: aprun
CHPL_TIMERS: generic
CHPL_UNWIND: none
CHPL_MEM: jemalloc
CHPL_ATOMICS: cstdlib
  CHPL_NETWORK_ATOMICS: ugni
CHPL_GMP: bundled
CHPL_HWLOC: bundled
CHPL_RE2: bundled
CHPL_LLVM: bundled
CHPL_AUX_FILESYS: none