From cfcfe8c7ef535bcf7425294b56f5f9af14c09dd5 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Wed, 25 May 2022 08:21:36 +0900 Subject: [PATCH] limit the constructor signatures of `PartialStruct` and `Conditional` (#45436) --- base/boot.jl | 2 +- base/compiler/typelattice.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/base/boot.jl b/base/boot.jl index bb7fcfd0719edc..f85c2417de6054 100644 --- a/base/boot.jl +++ b/base/boot.jl @@ -432,7 +432,7 @@ eval(Core, quote relocatability) end Const(@nospecialize(v)) = $(Expr(:new, :Const, :v)) - PartialStruct(@nospecialize(typ), fields::Array{Any, 1}) = $(Expr(:new, :PartialStruct, :typ, :fields)) + PartialStruct(typ::DataType, fields::Array{Any, 1}) = $(Expr(:new, :PartialStruct, :typ, :fields)) PartialOpaque(@nospecialize(typ), @nospecialize(env), parent::MethodInstance, source::Method) = $(Expr(:new, :PartialOpaque, :typ, :env, :parent, :source)) InterConditional(slot::Int, @nospecialize(vtype), @nospecialize(elsetype)) = $(Expr(:new, :InterConditional, :slot, :vtype, :elsetype)) MethodMatch(@nospecialize(spec_types), sparams::SimpleVector, method::Method, fully_covers::Bool) = $(Expr(:new, :MethodMatch, :spec_types, :sparams, :method, :fully_covers)) diff --git a/base/compiler/typelattice.jl b/base/compiler/typelattice.jl index 79db3b6cf20b65..235a52fac168ad 100644 --- a/base/compiler/typelattice.jl +++ b/base/compiler/typelattice.jl @@ -37,7 +37,7 @@ struct Conditional vtype elsetype function Conditional( - var, + var::SlotNumber, @nospecialize(vtype), @nospecialize(nottype)) return new(var, vtype, nottype)