"Slicing" due to type unstable parametric type construction #30335
Labels
bug
Indicates an unexpected problem or unintended behavior
types and dispatch
Types, subtyping and method dispatch
I'm seeing something that reminds me a little bit about type slicing in C++; I'm trying to generate term symbols (https://en.wikipedia.org/wiki/Term_symbol) from their string representation. I have this type
The creation of a
Term
from a string is accomplished with (input error checks removed)Input
1S
should yieldTerm.L=0
,1[5]
=>Term.L=5
,1[3/2]
=>Term.L=3//2
(rational). The last one however, results inwhere it can be seen that the type of
L
was not correctly inferred, and3//2
was split such that the numerator ended up inL
and the denominator inS.num
, etc.This works as it should on Julia v1.0.2, but not on nightly 1bd316b. I can make it work on nightly by either
const spectroscopic="spdfghiklmnoqrtuv"
(which is the sane thing to do anyway), orterm_string
withTerm{Int,Rational{Int},typeof(L)}(L, S, m[3] == "o" ? -1 : 1)
I tried to bisect using the following scripts:
term-test.jl
:but I end up with the unsatisfactory result
The text was updated successfully, but these errors were encountered: