@@ -7,10 +7,10 @@ open System
77open System.Collections .Generic
88open System.Collections .Immutable
99open System.Linq
10+
1011open Microsoft.Quantum .QsCompiler .DataTypes
1112open Microsoft.Quantum .QsCompiler .Diagnostics
1213open Microsoft.Quantum .QsCompiler .ReservedKeywords
13- open Microsoft.Quantum .QsCompiler .SyntaxExtensions
1414open Microsoft.Quantum .QsCompiler .SyntaxTokens
1515open Microsoft.Quantum .QsCompiler .SyntaxTree
1616
@@ -599,17 +599,17 @@ module SymbolResolution =
599599 /// <exception cref="ArgumentException">The given source file is not listed as source of that namespace.</exception>
600600 let rec internal ResolveType ( processUDT , processTypeParameter ) ( qsType : QsType ) =
601601 let resolve = ResolveType( processUDT, processTypeParameter)
602- let asResolvedType t = ResolvedType.New ( true , t )
602+ let asResolvedType = TypeRange.annotated qsType.Range |> ResolvedType.create
603603 let buildWith builder ts = builder ts |> asResolvedType
604- let invalid = InvalidType |> asResolvedType
604+ let invalid = asResolvedType InvalidType
605605 let range = qsType.Range.ValueOr Range.Zero
606606
607607 match qsType.Type with
608608 | ArrayType baseType -> [ baseType ] |> AccumulateInner resolve ( buildWith ( fun ts -> ArrayType ts.[ 0 ]))
609609 | TupleType items -> items |> AccumulateInner resolve ( buildWith TupleType)
610610 | QsTypeKind.TypeParameter sym ->
611611 match sym.Symbol with
612- | Symbol name -> processTypeParameter ( name, sym.Range) |> fun ( k , errs ) -> k |> asResolvedType, errs
612+ | Symbol name -> processTypeParameter ( name, sym.Range) |> fun ( k , errs ) -> asResolvedType k , errs
613613 | InvalidSymbol -> invalid, [||]
614614 | _ ->
615615 invalid,
@@ -631,24 +631,24 @@ module SymbolResolution =
631631 [ arg; res ] |> AccumulateInner resolve ( buildWith ( fun ts -> QsTypeKind.Function( ts.[ 0 ], ts.[ 1 ])))
632632 | UserDefinedType name ->
633633 match name.Symbol with
634- | Symbol sym -> processUDT (( None, sym), name.Range) |> fun ( k , errs ) -> k |> asResolvedType, errs
634+ | Symbol sym -> processUDT (( None, sym), name.Range) |> fun ( k , errs ) -> asResolvedType k , errs
635635 | QualifiedSymbol ( ns, sym) ->
636- processUDT (( Some ns, sym), name.Range) |> fun ( k , errs ) -> k |> asResolvedType, errs
636+ processUDT (( Some ns, sym), name.Range) |> fun ( k , errs ) -> asResolvedType k , errs
637637 | InvalidSymbol -> invalid, [||]
638638 | MissingSymbol
639639 | OmittedSymbols
640640 | SymbolTuple _ -> invalid, [| range |> QsCompilerDiagnostic.Error( ErrorCode.ExpectingIdentifier, []) |]
641- | UnitType -> QsTypeKind.UnitType |> asResolvedType, [||]
642- | Int -> QsTypeKind.Int |> asResolvedType, [||]
643- | BigInt -> QsTypeKind.BigInt |> asResolvedType, [||]
644- | Double -> QsTypeKind.Double |> asResolvedType, [||]
645- | Bool -> QsTypeKind.Bool |> asResolvedType, [||]
646- | String -> QsTypeKind.String |> asResolvedType, [||]
647- | Qubit -> QsTypeKind.Qubit |> asResolvedType, [||]
648- | Result -> QsTypeKind.Result |> asResolvedType, [||]
649- | Pauli -> QsTypeKind.Pauli |> asResolvedType, [||]
650- | Range -> QsTypeKind.Range |> asResolvedType, [||]
651- | InvalidType -> QsTypeKind.InvalidType |> asResolvedType, [||]
641+ | UnitType -> asResolvedType UnitType , [||]
642+ | Int -> asResolvedType Int , [||]
643+ | BigInt -> asResolvedType BigInt , [||]
644+ | Double -> asResolvedType Double , [||]
645+ | Bool -> asResolvedType Bool , [||]
646+ | String -> asResolvedType String , [||]
647+ | Qubit -> asResolvedType Qubit , [||]
648+ | Result -> asResolvedType Result , [||]
649+ | Pauli -> asResolvedType Pauli , [||]
650+ | Range -> asResolvedType Range , [||]
651+ | InvalidType -> asResolvedType InvalidType , [||]
652652 | MissingType -> NotSupportedException " missing type cannot be resolved" |> raise
653653
654654 /// <summary>
0 commit comments