예제 #1
0
 public override QsTypeKind <ResolvedType, UserDefinedType, QsTypeParameter, CallableInformation> OnTypeParameter(QsTypeParameter tp)
 {
     if (this.SharedState.CurrentParamTypes.TryGetValue(Tuple.Create(tp.Origin, tp.TypeName), out var typeParam))
     {
         return(typeParam.Resolution);
     }
     return(QsTypeKind <ResolvedType, UserDefinedType, QsTypeParameter, CallableInformation> .NewTypeParameter(tp));
 }
예제 #2
0
            public override QsTypeKind onTypeParameter(QsTypeParameter tp)
            {
                this.CodeOutput.onTypeParameter(tp);
                var tpName = NonNullable <string> .New(this.CodeOutput.Output ?? "");

                this.OnIdentifier?.Invoke(Identifier.NewLocalVariable(tpName), tp.Range);
                return(QsTypeKind.NewTypeParameter(tp));
            }
 // If an intrinsic callable is generic, then its type parameters can occur within expressions;
 // when generic intrinsics are called, the type of that call contains type parameter types.
 public override QsTypeKind <ResolvedType, UserDefinedType, QsTypeParameter, CallableInformation> OnTypeParameter(QsTypeParameter tp) =>
 this.SharedState.IntrinsicCallableSet.Contains(tp.Origin)
     ? QsTypeKind <ResolvedType, UserDefinedType, QsTypeParameter, CallableInformation> .NewTypeParameter(tp)
     : throw new Exception("Type Parameter types must be resolved");
예제 #4
0
 public override QsTypeKind onUserDefinedType(UserDefinedType udt)
 {
     this.OnIdentifier?.Invoke(Identifier.NewGlobalCallable(new QsQualifiedName(udt.Namespace, udt.Name)), udt.Range);
     return(QsTypeKind.NewUserDefinedType(udt));
 }