Type hinting a primitive local with a matching type errors

Description

Description:

Problem:

The Compiler does not allow local bindings to be both primitive and have type hints. But that situation is ok if the local binding type hint matches the primitive type.

Proposed:

In the case where a local binding is both a primitive and has a matching type hint, drop the type hint, otherwise error as before.

Screened By: fogus

Patch: clj-2680-3.patch

Environment

None

Attachments

4

Activity

Show:

Alex MillerJanuary 13, 2022 at 10:06 PM

Released in 1.11.0-alpha4

Alex MillerJanuary 13, 2022 at 8:39 PM

-4 rebases against master, no changes

Michael FogusDecember 16, 2021 at 4:12 PM

version 3 is much cleaner. screened.

Alex MillerDecember 16, 2021 at 4:05 PM

-3 patch improves logic to only set this.tag if needed

Michael FogusDecember 16, 2021 at 2:41 PM

applied, tested, ran through some scenarios in the REPL e.g. (let [x 1.2] (Math/abs ^long x)) fails as expected.

Fixed

Details

Assignee

Reporter

Approval

Ok

Patch

Code and Test

Priority

Affects versions

Fix versions

Created December 15, 2021 at 9:37 PM
Updated January 13, 2022 at 10:06 PM
Resolved January 13, 2022 at 10:06 PM